ca.uhn.fhir.model.dstu2.valueset.AdmitSourceEnum Maven / Gradle / Ivy
The newest version!
package ca.uhn.fhir.model.dstu2.valueset;
import ca.uhn.fhir.model.api.*;
import java.util.HashMap;
import java.util.Map;
public enum AdmitSourceEnum {
/**
* Display: Transferred from other hospital
* Code Value: hosp-trans
*/
TRANSFERRED_FROM_OTHER_HOSPITAL("hosp-trans", "http://hl7.org/fhir/admit-source"),
/**
* Display: From accident/emergency department
* Code Value: emd
*/
FROM_ACCIDENT_EMERGENCY_DEPARTMENT("emd", "http://hl7.org/fhir/admit-source"),
/**
* Display: From outpatient department
* Code Value: outp
*/
FROM_OUTPATIENT_DEPARTMENT("outp", "http://hl7.org/fhir/admit-source"),
/**
* Display: Born in hospital
* Code Value: born
*/
BORN_IN_HOSPITAL("born", "http://hl7.org/fhir/admit-source"),
/**
* Display: General Practitioner referral
* Code Value: gp
*/
GENERAL_PRACTITIONER_REFERRAL("gp", "http://hl7.org/fhir/admit-source"),
/**
* Display: Medical Practitioner/physician referral
* Code Value: mp
*/
MEDICAL_PRACTITIONER_PHYSICIAN_REFERRAL("mp", "http://hl7.org/fhir/admit-source"),
/**
* Display: From nursing home
* Code Value: nursing
*/
FROM_NURSING_HOME("nursing", "http://hl7.org/fhir/admit-source"),
/**
* Display: From psychiatric hospital
* Code Value: psych
*/
FROM_PSYCHIATRIC_HOSPITAL("psych", "http://hl7.org/fhir/admit-source"),
/**
* Display: From rehabilitation facility
* Code Value: rehab
*/
FROM_REHABILITATION_FACILITY("rehab", "http://hl7.org/fhir/admit-source"),
/**
* Display: Other
* Code Value: other
*/
OTHER("other", "http://hl7.org/fhir/admit-source"),
;
/**
* Identifier for this Value Set:
*
*/
public static final String VALUESET_IDENTIFIER = "";
/**
* Name for this Value Set:
* AdmitSource
*/
public static final String VALUESET_NAME = "AdmitSource";
private static Map CODE_TO_ENUM = new HashMap();
private static Map> SYSTEM_TO_CODE_TO_ENUM = new HashMap>();
private final String myCode;
private final String mySystem;
static {
for (AdmitSourceEnum next : AdmitSourceEnum.values()) {
CODE_TO_ENUM.put(next.getCode(), next);
if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) {
SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap());
}
SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next);
}
}
/**
* Returns the code associated with this enumerated value
*/
public String getCode() {
return myCode;
}
/**
* Returns the code system associated with this enumerated value
*/
public String getSystem() {
return mySystem;
}
/**
* Returns the enumerated value associated with this code
*/
public static AdmitSourceEnum forCode(String theCode) {
AdmitSourceEnum retVal = CODE_TO_ENUM.get(theCode);
return retVal;
}
/**
* Converts codes to their respective enumerated values
*/
public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() {
@Override
public String toCodeString(AdmitSourceEnum theEnum) {
return theEnum.getCode();
}
@Override
public String toSystemString(AdmitSourceEnum theEnum) {
return theEnum.getSystem();
}
@Override
public AdmitSourceEnum fromCodeString(String theCodeString) {
return CODE_TO_ENUM.get(theCodeString);
}
@Override
public AdmitSourceEnum fromCodeString(String theCodeString, String theSystemString) {
Map map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString);
if (map == null) {
return null;
}
return map.get(theCodeString);
}
};
/**
* Constructor
*/
AdmitSourceEnum(String theCode, String theSystem) {
myCode = theCode;
mySystem = theSystem;
}
}