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