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 ContractActorRoleCodesEnum {
009
010        /**
011         * Display: <b>Practitioner</b><br>
012         * Code Value: <b>practitioner</b>
013         */
014        PRACTITIONER("practitioner", "http://www.hl7.org/fhir/contractactorrole"),
015        
016        /**
017         * Display: <b>Patient</b><br>
018         * Code Value: <b>patient</b>
019         */
020        PATIENT("patient", "http://www.hl7.org/fhir/contractactorrole"),
021        
022        ;
023        
024        /**
025         * Identifier for this Value Set:
026         * 
027         */
028        public static final String VALUESET_IDENTIFIER = "";
029
030        /**
031         * Name for this Value Set:
032         * Contract Actor Role Codes
033         */
034        public static final String VALUESET_NAME = "Contract Actor Role Codes";
035
036        private static Map<String, ContractActorRoleCodesEnum> CODE_TO_ENUM = new HashMap<String, ContractActorRoleCodesEnum>();
037        private static Map<String, Map<String, ContractActorRoleCodesEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, ContractActorRoleCodesEnum>>();
038        
039        private final String myCode;
040        private final String mySystem;
041        
042        static {
043                for (ContractActorRoleCodesEnum next : ContractActorRoleCodesEnum.values()) {
044                        CODE_TO_ENUM.put(next.getCode(), next);
045                        
046                        if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) {
047                                SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, ContractActorRoleCodesEnum>());
048                        }
049                        SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next);                 
050                }
051        }
052        
053        /**
054         * Returns the code associated with this enumerated value
055         */
056        public String getCode() {
057                return myCode;
058        }
059        
060        /**
061         * Returns the code system associated with this enumerated value
062         */
063        public String getSystem() {
064                return mySystem;
065        }
066        
067        /**
068         * Returns the enumerated value associated with this code
069         */
070        public static ContractActorRoleCodesEnum forCode(String theCode) {
071                ContractActorRoleCodesEnum retVal = CODE_TO_ENUM.get(theCode);
072                return retVal;
073        }
074
075        /**
076         * Converts codes to their respective enumerated values
077         */
078        public static final IValueSetEnumBinder<ContractActorRoleCodesEnum> VALUESET_BINDER = new IValueSetEnumBinder<ContractActorRoleCodesEnum>() {
079                @Override
080                public String toCodeString(ContractActorRoleCodesEnum theEnum) {
081                        return theEnum.getCode();
082                }
083
084                @Override
085                public String toSystemString(ContractActorRoleCodesEnum theEnum) {
086                        return theEnum.getSystem();
087                }
088                
089                @Override
090                public ContractActorRoleCodesEnum fromCodeString(String theCodeString) {
091                        return CODE_TO_ENUM.get(theCodeString);
092                }
093                
094                @Override
095                public ContractActorRoleCodesEnum fromCodeString(String theCodeString, String theSystemString) {
096                        Map<String, ContractActorRoleCodesEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString);
097                        if (map == null) {
098                                return null;
099                        }
100                        return map.get(theCodeString);
101                }
102                
103        };
104        
105        /** 
106         * Constructor
107         */
108        ContractActorRoleCodesEnum(String theCode, String theSystem) {
109                myCode = theCode;
110                mySystem = theSystem;
111        }
112
113        
114}