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 SpecimenCollectionMethodEnum {
009
010        /**
011         * Code Value: <b>119295008</b>
012         */
013        _119295008("119295008", "http://snomed.info/sct"),
014        
015        /**
016         * Code Value: <b>413651001</b>
017         */
018        _413651001("413651001", "http://snomed.info/sct"),
019        
020        /**
021         * Code Value: <b>360020006</b>
022         */
023        _360020006("360020006", "http://snomed.info/sct"),
024        
025        /**
026         * Code Value: <b>430823004</b>
027         */
028        _430823004("430823004", "http://snomed.info/sct"),
029        
030        /**
031         * Code Value: <b>16404004</b>
032         */
033        _16404004("16404004", "http://snomed.info/sct"),
034        
035        /**
036         * Code Value: <b>67889009</b>
037         */
038        _67889009("67889009", "http://snomed.info/sct"),
039        
040        /**
041         * Code Value: <b>29240004</b>
042         */
043        _29240004("29240004", "http://snomed.info/sct"),
044        
045        /**
046         * Code Value: <b>45710003</b>
047         */
048        _45710003("45710003", "http://snomed.info/sct"),
049        
050        /**
051         * Code Value: <b>7800008</b>
052         */
053        _7800008("7800008", "http://snomed.info/sct"),
054        
055        /**
056         * Code Value: <b>258431006</b>
057         */
058        _258431006("258431006", "http://snomed.info/sct"),
059        
060        /**
061         * Code Value: <b>20255002</b>
062         */
063        _20255002("20255002", "http://snomed.info/sct"),
064        
065        /**
066         * Code Value: <b>386147002</b>
067         */
068        _386147002("386147002", "http://snomed.info/sct"),
069        
070        /**
071         * Code Value: <b>278450005</b>
072         */
073        _278450005("278450005", "http://snomed.info/sct"),
074        
075        ;
076        
077        /**
078         * Identifier for this Value Set:
079         * 
080         */
081        public static final String VALUESET_IDENTIFIER = "";
082
083        /**
084         * Name for this Value Set:
085         * SpecimenCollectionMethod
086         */
087        public static final String VALUESET_NAME = "SpecimenCollectionMethod";
088
089        private static Map<String, SpecimenCollectionMethodEnum> CODE_TO_ENUM = new HashMap<String, SpecimenCollectionMethodEnum>();
090        private static Map<String, Map<String, SpecimenCollectionMethodEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, SpecimenCollectionMethodEnum>>();
091        
092        private final String myCode;
093        private final String mySystem;
094        
095        static {
096                for (SpecimenCollectionMethodEnum next : SpecimenCollectionMethodEnum.values()) {
097                        CODE_TO_ENUM.put(next.getCode(), next);
098                        
099                        if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) {
100                                SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, SpecimenCollectionMethodEnum>());
101                        }
102                        SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next);                 
103                }
104        }
105        
106        /**
107         * Returns the code associated with this enumerated value
108         */
109        public String getCode() {
110                return myCode;
111        }
112        
113        /**
114         * Returns the code system associated with this enumerated value
115         */
116        public String getSystem() {
117                return mySystem;
118        }
119        
120        /**
121         * Returns the enumerated value associated with this code
122         */
123        public static SpecimenCollectionMethodEnum forCode(String theCode) {
124                SpecimenCollectionMethodEnum retVal = CODE_TO_ENUM.get(theCode);
125                return retVal;
126        }
127
128        /**
129         * Converts codes to their respective enumerated values
130         */
131        public static final IValueSetEnumBinder<SpecimenCollectionMethodEnum> VALUESET_BINDER = new IValueSetEnumBinder<SpecimenCollectionMethodEnum>() {
132                @Override
133                public String toCodeString(SpecimenCollectionMethodEnum theEnum) {
134                        return theEnum.getCode();
135                }
136
137                @Override
138                public String toSystemString(SpecimenCollectionMethodEnum theEnum) {
139                        return theEnum.getSystem();
140                }
141                
142                @Override
143                public SpecimenCollectionMethodEnum fromCodeString(String theCodeString) {
144                        return CODE_TO_ENUM.get(theCodeString);
145                }
146                
147                @Override
148                public SpecimenCollectionMethodEnum fromCodeString(String theCodeString, String theSystemString) {
149                        Map<String, SpecimenCollectionMethodEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString);
150                        if (map == null) {
151                                return null;
152                        }
153                        return map.get(theCodeString);
154                }
155                
156        };
157        
158        /** 
159         * Constructor
160         */
161        SpecimenCollectionMethodEnum(String theCode, String theSystem) {
162                myCode = theCode;
163                mySystem = theSystem;
164        }
165
166        
167}