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