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 MessageEventEnum { 009 010 /** 011 * Display: <b>MedicationAdministration-Complete</b><br> 012 * Code Value: <b>MedicationAdministration-Complete</b> 013 * 014 * Change the status of a Medication Administration to show that it is complete. 015 */ 016 MEDICATIONADMINISTRATION_COMPLETE("MedicationAdministration-Complete", "http://hl7.org/fhir/message-events"), 017 018 /** 019 * Display: <b>MedicationAdministration-Nullification</b><br> 020 * Code Value: <b>MedicationAdministration-Nullification</b> 021 * 022 * Someone wishes to record that the record of administration of a medication is in error and should be ignored. 023 */ 024 MEDICATIONADMINISTRATION_NULLIFICATION("MedicationAdministration-Nullification", "http://hl7.org/fhir/message-events"), 025 026 /** 027 * Display: <b>MedicationAdministration-Recording</b><br> 028 * Code Value: <b>MedicationAdministration-Recording</b> 029 * 030 * Indicates that a medication has been recorded against the patient's record. 031 */ 032 MEDICATIONADMINISTRATION_RECORDING("MedicationAdministration-Recording", "http://hl7.org/fhir/message-events"), 033 034 /** 035 * Display: <b>MedicationAdministration-Update</b><br> 036 * Code Value: <b>MedicationAdministration-Update</b> 037 * 038 * Update a Medication Administration record. 039 */ 040 MEDICATIONADMINISTRATION_UPDATE("MedicationAdministration-Update", "http://hl7.org/fhir/message-events"), 041 042 /** 043 * Display: <b>admin-notify</b><br> 044 * Code Value: <b>admin-notify</b> 045 * 046 * Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use. 047 */ 048 ADMIN_NOTIFY("admin-notify", "http://hl7.org/fhir/message-events"), 049 050 /** 051 * Display: <b>diagnosticreport-provide</b><br> 052 * Code Value: <b>diagnosticreport-provide</b> 053 * 054 * Provide a diagnostic report, or update a previously provided diagnostic report. 055 */ 056 DIAGNOSTICREPORT_PROVIDE("diagnosticreport-provide", "http://hl7.org/fhir/message-events"), 057 058 /** 059 * Display: <b>observation-provide</b><br> 060 * Code Value: <b>observation-provide</b> 061 * 062 * Provide a simple observation or update a previously provided simple observation. 063 */ 064 OBSERVATION_PROVIDE("observation-provide", "http://hl7.org/fhir/message-events"), 065 066 /** 067 * Display: <b>patient-link</b><br> 068 * Code Value: <b>patient-link</b> 069 * 070 * Notification that two patient records actually identify the same patient. 071 */ 072 PATIENT_LINK("patient-link", "http://hl7.org/fhir/message-events"), 073 074 /** 075 * Display: <b>patient-unlink</b><br> 076 * Code Value: <b>patient-unlink</b> 077 * 078 * Notification that previous advice that two patient records concern the same patient is now considered incorrect. 079 */ 080 PATIENT_UNLINK("patient-unlink", "http://hl7.org/fhir/message-events"), 081 082 /** 083 * Display: <b>valueset-expand</b><br> 084 * Code Value: <b>valueset-expand</b> 085 * 086 * The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message. 087 */ 088 VALUESET_EXPAND("valueset-expand", "http://hl7.org/fhir/message-events"), 089 090 ; 091 092 /** 093 * Identifier for this Value Set: 094 * 095 */ 096 public static final String VALUESET_IDENTIFIER = ""; 097 098 /** 099 * Name for this Value Set: 100 * MessageEvent 101 */ 102 public static final String VALUESET_NAME = "MessageEvent"; 103 104 private static Map<String, MessageEventEnum> CODE_TO_ENUM = new HashMap<String, MessageEventEnum>(); 105 private static Map<String, Map<String, MessageEventEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, MessageEventEnum>>(); 106 107 private final String myCode; 108 private final String mySystem; 109 110 static { 111 for (MessageEventEnum next : MessageEventEnum.values()) { 112 CODE_TO_ENUM.put(next.getCode(), next); 113 114 if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) { 115 SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, MessageEventEnum>()); 116 } 117 SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next); 118 } 119 } 120 121 /** 122 * Returns the code associated with this enumerated value 123 */ 124 public String getCode() { 125 return myCode; 126 } 127 128 /** 129 * Returns the code system associated with this enumerated value 130 */ 131 public String getSystem() { 132 return mySystem; 133 } 134 135 /** 136 * Returns the enumerated value associated with this code 137 */ 138 public static MessageEventEnum forCode(String theCode) { 139 MessageEventEnum retVal = CODE_TO_ENUM.get(theCode); 140 return retVal; 141 } 142 143 /** 144 * Converts codes to their respective enumerated values 145 */ 146 public static final IValueSetEnumBinder<MessageEventEnum> VALUESET_BINDER = new IValueSetEnumBinder<MessageEventEnum>() { 147 @Override 148 public String toCodeString(MessageEventEnum theEnum) { 149 return theEnum.getCode(); 150 } 151 152 @Override 153 public String toSystemString(MessageEventEnum theEnum) { 154 return theEnum.getSystem(); 155 } 156 157 @Override 158 public MessageEventEnum fromCodeString(String theCodeString) { 159 return CODE_TO_ENUM.get(theCodeString); 160 } 161 162 @Override 163 public MessageEventEnum fromCodeString(String theCodeString, String theSystemString) { 164 Map<String, MessageEventEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString); 165 if (map == null) { 166 return null; 167 } 168 return map.get(theCodeString); 169 } 170 171 }; 172 173 /** 174 * Constructor 175 */ 176 MessageEventEnum(String theCode, String theSystem) { 177 myCode = theCode; 178 mySystem = theSystem; 179 } 180 181 182}