001package org.hl7.fhir.r4.model.codesystems; 002 003 004 005 006/* 007 Copyright (c) 2011+, HL7, Inc. 008 All rights reserved. 009 010 Redistribution and use in source and binary forms, with or without modification, 011 are permitted provided that the following conditions are met: 012 013 * Redistributions of source code must retain the above copyright notice, this 014 list of conditions and the following disclaimer. 015 * Redistributions in binary form must reproduce the above copyright notice, 016 this list of conditions and the following disclaimer in the documentation 017 and/or other materials provided with the distribution. 018 * Neither the name of HL7 nor the names of its contributors may be used to 019 endorse or promote products derived from this software without specific 020 prior written permission. 021 022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 023 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 024 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 025 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 026 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 027 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 028 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 029 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 030 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 031 POSSIBILITY OF SUCH DAMAGE. 032 033*/ 034 035// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 036 037 038import org.hl7.fhir.exceptions.FHIRException; 039 040public enum FlagCategory { 041 042 /** 043 * Flags related to the subject's dietary needs. 044 */ 045 DIET, 046 /** 047 * Flags related to the subject's medications. 048 */ 049 DRUG, 050 /** 051 * Flags related to performing laboratory tests and related processes (e.g. phlebotomy). 052 */ 053 LAB, 054 /** 055 * Flags related to administrative and financial processes. 056 */ 057 ADMIN, 058 /** 059 * Flags related to coming into contact with the patient. 060 */ 061 CONTACT, 062 /** 063 * Flags related to the subject's clinical data. 064 */ 065 CLINICAL, 066 /** 067 * Flags related to behavior. 068 */ 069 BEHAVIORAL, 070 /** 071 * Flags related to research. 072 */ 073 RESEARCH, 074 /** 075 * Flags related to subject's advance directives. 076 */ 077 ADVANCEDIRECTIVE, 078 /** 079 * Flags related to safety precautions. 080 */ 081 SAFETY, 082 /** 083 * added to help the parsers 084 */ 085 NULL; 086 public static FlagCategory fromCode(String codeString) throws FHIRException { 087 if (codeString == null || "".equals(codeString)) 088 return null; 089 if ("diet".equals(codeString)) 090 return DIET; 091 if ("drug".equals(codeString)) 092 return DRUG; 093 if ("lab".equals(codeString)) 094 return LAB; 095 if ("admin".equals(codeString)) 096 return ADMIN; 097 if ("contact".equals(codeString)) 098 return CONTACT; 099 if ("clinical".equals(codeString)) 100 return CLINICAL; 101 if ("behavioral".equals(codeString)) 102 return BEHAVIORAL; 103 if ("research".equals(codeString)) 104 return RESEARCH; 105 if ("advance-directive".equals(codeString)) 106 return ADVANCEDIRECTIVE; 107 if ("safety".equals(codeString)) 108 return SAFETY; 109 throw new FHIRException("Unknown FlagCategory code '"+codeString+"'"); 110 } 111 public String toCode() { 112 switch (this) { 113 case DIET: return "diet"; 114 case DRUG: return "drug"; 115 case LAB: return "lab"; 116 case ADMIN: return "admin"; 117 case CONTACT: return "contact"; 118 case CLINICAL: return "clinical"; 119 case BEHAVIORAL: return "behavioral"; 120 case RESEARCH: return "research"; 121 case ADVANCEDIRECTIVE: return "advance-directive"; 122 case SAFETY: return "safety"; 123 case NULL: return null; 124 default: return "?"; 125 } 126 } 127 public String getSystem() { 128 return "http://terminology.hl7.org/CodeSystem/flag-category"; 129 } 130 public String getDefinition() { 131 switch (this) { 132 case DIET: return "Flags related to the subject's dietary needs."; 133 case DRUG: return "Flags related to the subject's medications."; 134 case LAB: return "Flags related to performing laboratory tests and related processes (e.g. phlebotomy)."; 135 case ADMIN: return "Flags related to administrative and financial processes."; 136 case CONTACT: return "Flags related to coming into contact with the patient."; 137 case CLINICAL: return "Flags related to the subject's clinical data."; 138 case BEHAVIORAL: return "Flags related to behavior."; 139 case RESEARCH: return "Flags related to research."; 140 case ADVANCEDIRECTIVE: return "Flags related to subject's advance directives."; 141 case SAFETY: return "Flags related to safety precautions."; 142 case NULL: return null; 143 default: return "?"; 144 } 145 } 146 public String getDisplay() { 147 switch (this) { 148 case DIET: return "Diet"; 149 case DRUG: return "Drug"; 150 case LAB: return "Lab"; 151 case ADMIN: return "Administrative"; 152 case CONTACT: return "Subject Contact"; 153 case CLINICAL: return "Clinical"; 154 case BEHAVIORAL: return "Behavioral"; 155 case RESEARCH: return "Research"; 156 case ADVANCEDIRECTIVE: return "Advance Directive"; 157 case SAFETY: return "Safety"; 158 case NULL: return null; 159 default: return "?"; 160 } 161 } 162 163 164}