001 002package ca.uhn.fhir.model.dstu2.valueset; 003 004import ca.uhn.fhir.model.api.*; 005import java.util.HashMap; 006import java.util.Map; 007 008public enum NutritionOrderStatusEnum { 009 010 /** 011 * Display: <b>Proposed</b><br> 012 * Code Value: <b>proposed</b> 013 * 014 * The request has been proposed. 015 */ 016 PROPOSED("proposed", "http://hl7.org/fhir/nutrition-order-status"), 017 018 /** 019 * Display: <b>Draft</b><br> 020 * Code Value: <b>draft</b> 021 * 022 * The request is in preliminary form prior to being sent. 023 */ 024 DRAFT("draft", "http://hl7.org/fhir/nutrition-order-status"), 025 026 /** 027 * Display: <b>Planned</b><br> 028 * Code Value: <b>planned</b> 029 * 030 * The request has been planned. 031 */ 032 PLANNED("planned", "http://hl7.org/fhir/nutrition-order-status"), 033 034 /** 035 * Display: <b>Requested</b><br> 036 * Code Value: <b>requested</b> 037 * 038 * The request has been placed. 039 */ 040 REQUESTED("requested", "http://hl7.org/fhir/nutrition-order-status"), 041 042 /** 043 * Display: <b>Active</b><br> 044 * Code Value: <b>active</b> 045 * 046 * The request is 'actionable', but not all actions that are implied by it have occurred yet. 047 */ 048 ACTIVE("active", "http://hl7.org/fhir/nutrition-order-status"), 049 050 /** 051 * Display: <b>On-Hold</b><br> 052 * Code Value: <b>on-hold</b> 053 * 054 * Actions implied by the request have been temporarily halted, but are expected to continue later. May also be called "suspended". 055 */ 056 ON_HOLD("on-hold", "http://hl7.org/fhir/nutrition-order-status"), 057 058 /** 059 * Display: <b>Completed</b><br> 060 * Code Value: <b>completed</b> 061 * 062 * All actions that are implied by the order have occurred and no continuation is planned (this will rarely be made explicit). 063 */ 064 COMPLETED("completed", "http://hl7.org/fhir/nutrition-order-status"), 065 066 /** 067 * Display: <b>Cancelled</b><br> 068 * Code Value: <b>cancelled</b> 069 * 070 * The request has been withdrawn and is no longer actionable. 071 */ 072 CANCELLED("cancelled", "http://hl7.org/fhir/nutrition-order-status"), 073 074 ; 075 076 /** 077 * Identifier for this Value Set: 078 * 079 */ 080 public static final String VALUESET_IDENTIFIER = ""; 081 082 /** 083 * Name for this Value Set: 084 * NutritionOrderStatus 085 */ 086 public static final String VALUESET_NAME = "NutritionOrderStatus"; 087 088 private static Map<String, NutritionOrderStatusEnum> CODE_TO_ENUM = new HashMap<String, NutritionOrderStatusEnum>(); 089 private static Map<String, Map<String, NutritionOrderStatusEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, NutritionOrderStatusEnum>>(); 090 091 private final String myCode; 092 private final String mySystem; 093 094 static { 095 for (NutritionOrderStatusEnum next : NutritionOrderStatusEnum.values()) { 096 CODE_TO_ENUM.put(next.getCode(), next); 097 098 if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) { 099 SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, NutritionOrderStatusEnum>()); 100 } 101 SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next); 102 } 103 } 104 105 /** 106 * Returns the code associated with this enumerated value 107 */ 108 public String getCode() { 109 return myCode; 110 } 111 112 /** 113 * Returns the code system associated with this enumerated value 114 */ 115 public String getSystem() { 116 return mySystem; 117 } 118 119 /** 120 * Returns the enumerated value associated with this code 121 */ 122 public static NutritionOrderStatusEnum forCode(String theCode) { 123 NutritionOrderStatusEnum retVal = CODE_TO_ENUM.get(theCode); 124 return retVal; 125 } 126 127 /** 128 * Converts codes to their respective enumerated values 129 */ 130 public static final IValueSetEnumBinder<NutritionOrderStatusEnum> VALUESET_BINDER = new IValueSetEnumBinder<NutritionOrderStatusEnum>() { 131 @Override 132 public String toCodeString(NutritionOrderStatusEnum theEnum) { 133 return theEnum.getCode(); 134 } 135 136 @Override 137 public String toSystemString(NutritionOrderStatusEnum theEnum) { 138 return theEnum.getSystem(); 139 } 140 141 @Override 142 public NutritionOrderStatusEnum fromCodeString(String theCodeString) { 143 return CODE_TO_ENUM.get(theCodeString); 144 } 145 146 @Override 147 public NutritionOrderStatusEnum fromCodeString(String theCodeString, String theSystemString) { 148 Map<String, NutritionOrderStatusEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString); 149 if (map == null) { 150 return null; 151 } 152 return map.get(theCodeString); 153 } 154 155 }; 156 157 /** 158 * Constructor 159 */ 160 NutritionOrderStatusEnum(String theCode, String theSystem) { 161 myCode = theCode; 162 mySystem = theSystem; 163 } 164 165 166}