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 PractitionerSpecialtyEnum {
009
010        /**
011         * Display: <b>Cardiologist</b><br>
012         * Code Value: <b>cardio</b>
013         */
014        CARDIOLOGIST("cardio", "http://hl7.org/fhir/practitioner-specialty"),
015        
016        /**
017         * Display: <b>Dentist</b><br>
018         * Code Value: <b>dent</b>
019         */
020        DENTIST("dent", "http://hl7.org/fhir/practitioner-specialty"),
021        
022        /**
023         * Display: <b>Dietary consultant</b><br>
024         * Code Value: <b>dietary</b>
025         */
026        DIETARY_CONSULTANT("dietary", "http://hl7.org/fhir/practitioner-specialty"),
027        
028        /**
029         * Display: <b>Midwife</b><br>
030         * Code Value: <b>midw</b>
031         */
032        MIDWIFE("midw", "http://hl7.org/fhir/practitioner-specialty"),
033        
034        /**
035         * Display: <b>Systems architect</b><br>
036         * Code Value: <b>sysarch</b>
037         */
038        SYSTEMS_ARCHITECT("sysarch", "http://hl7.org/fhir/practitioner-specialty"),
039        
040        ;
041        
042        /**
043         * Identifier for this Value Set:
044         * 
045         */
046        public static final String VALUESET_IDENTIFIER = "";
047
048        /**
049         * Name for this Value Set:
050         * PractitionerSpecialty
051         */
052        public static final String VALUESET_NAME = "PractitionerSpecialty";
053
054        private static Map<String, PractitionerSpecialtyEnum> CODE_TO_ENUM = new HashMap<String, PractitionerSpecialtyEnum>();
055        private static Map<String, Map<String, PractitionerSpecialtyEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, PractitionerSpecialtyEnum>>();
056        
057        private final String myCode;
058        private final String mySystem;
059        
060        static {
061                for (PractitionerSpecialtyEnum next : PractitionerSpecialtyEnum.values()) {
062                        CODE_TO_ENUM.put(next.getCode(), next);
063                        
064                        if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) {
065                                SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, PractitionerSpecialtyEnum>());
066                        }
067                        SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next);                 
068                }
069        }
070        
071        /**
072         * Returns the code associated with this enumerated value
073         */
074        public String getCode() {
075                return myCode;
076        }
077        
078        /**
079         * Returns the code system associated with this enumerated value
080         */
081        public String getSystem() {
082                return mySystem;
083        }
084        
085        /**
086         * Returns the enumerated value associated with this code
087         */
088        public static PractitionerSpecialtyEnum forCode(String theCode) {
089                PractitionerSpecialtyEnum retVal = CODE_TO_ENUM.get(theCode);
090                return retVal;
091        }
092
093        /**
094         * Converts codes to their respective enumerated values
095         */
096        public static final IValueSetEnumBinder<PractitionerSpecialtyEnum> VALUESET_BINDER = new IValueSetEnumBinder<PractitionerSpecialtyEnum>() {
097                @Override
098                public String toCodeString(PractitionerSpecialtyEnum theEnum) {
099                        return theEnum.getCode();
100                }
101
102                @Override
103                public String toSystemString(PractitionerSpecialtyEnum theEnum) {
104                        return theEnum.getSystem();
105                }
106                
107                @Override
108                public PractitionerSpecialtyEnum fromCodeString(String theCodeString) {
109                        return CODE_TO_ENUM.get(theCodeString);
110                }
111                
112                @Override
113                public PractitionerSpecialtyEnum fromCodeString(String theCodeString, String theSystemString) {
114                        Map<String, PractitionerSpecialtyEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString);
115                        if (map == null) {
116                                return null;
117                        }
118                        return map.get(theCodeString);
119                }
120                
121        };
122        
123        /** 
124         * Constructor
125         */
126        PractitionerSpecialtyEnum(String theCode, String theSystem) {
127                myCode = theCode;
128                mySystem = theSystem;
129        }
130
131        
132}