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 AssertionResponseTypesEnum {
009
010        /**
011         * Display: <b>okay</b><br>
012         * Code Value: <b>okay</b>
013         *
014         * Response code is 200.
015         */
016        OKAY("okay", "http://hl7.org/fhir/assert-response-code-types"),
017        
018        /**
019         * Display: <b>created</b><br>
020         * Code Value: <b>created</b>
021         *
022         * Response code is 201.
023         */
024        CREATED("created", "http://hl7.org/fhir/assert-response-code-types"),
025        
026        /**
027         * Display: <b>noContent</b><br>
028         * Code Value: <b>noContent</b>
029         *
030         * Response code is 204.
031         */
032        NOCONTENT("noContent", "http://hl7.org/fhir/assert-response-code-types"),
033        
034        /**
035         * Display: <b>notModified</b><br>
036         * Code Value: <b>notModified</b>
037         *
038         * Response code is 304.
039         */
040        NOTMODIFIED("notModified", "http://hl7.org/fhir/assert-response-code-types"),
041        
042        /**
043         * Display: <b>bad</b><br>
044         * Code Value: <b>bad</b>
045         *
046         * Response code is 400.
047         */
048        BAD("bad", "http://hl7.org/fhir/assert-response-code-types"),
049        
050        /**
051         * Display: <b>forbidden</b><br>
052         * Code Value: <b>forbidden</b>
053         *
054         * Response code is 403.
055         */
056        FORBIDDEN("forbidden", "http://hl7.org/fhir/assert-response-code-types"),
057        
058        /**
059         * Display: <b>notFound</b><br>
060         * Code Value: <b>notFound</b>
061         *
062         * Response code is 404.
063         */
064        NOTFOUND("notFound", "http://hl7.org/fhir/assert-response-code-types"),
065        
066        /**
067         * Display: <b>methodNotAllowed</b><br>
068         * Code Value: <b>methodNotAllowed</b>
069         *
070         * Response code is 405.
071         */
072        METHODNOTALLOWED("methodNotAllowed", "http://hl7.org/fhir/assert-response-code-types"),
073        
074        /**
075         * Display: <b>conflict</b><br>
076         * Code Value: <b>conflict</b>
077         *
078         * Response code is 409.
079         */
080        CONFLICT("conflict", "http://hl7.org/fhir/assert-response-code-types"),
081        
082        /**
083         * Display: <b>gone</b><br>
084         * Code Value: <b>gone</b>
085         *
086         * Response code is 410.
087         */
088        GONE("gone", "http://hl7.org/fhir/assert-response-code-types"),
089        
090        /**
091         * Display: <b>preconditionFailed</b><br>
092         * Code Value: <b>preconditionFailed</b>
093         *
094         * Response code is 412.
095         */
096        PRECONDITIONFAILED("preconditionFailed", "http://hl7.org/fhir/assert-response-code-types"),
097        
098        /**
099         * Display: <b>unprocessable</b><br>
100         * Code Value: <b>unprocessable</b>
101         *
102         * Response code is 422.
103         */
104        UNPROCESSABLE("unprocessable", "http://hl7.org/fhir/assert-response-code-types"),
105        
106        ;
107        
108        /**
109         * Identifier for this Value Set:
110         * 
111         */
112        public static final String VALUESET_IDENTIFIER = "";
113
114        /**
115         * Name for this Value Set:
116         * AssertionResponseTypes
117         */
118        public static final String VALUESET_NAME = "AssertionResponseTypes";
119
120        private static Map<String, AssertionResponseTypesEnum> CODE_TO_ENUM = new HashMap<String, AssertionResponseTypesEnum>();
121        private static Map<String, Map<String, AssertionResponseTypesEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, AssertionResponseTypesEnum>>();
122        
123        private final String myCode;
124        private final String mySystem;
125        
126        static {
127                for (AssertionResponseTypesEnum next : AssertionResponseTypesEnum.values()) {
128                        CODE_TO_ENUM.put(next.getCode(), next);
129                        
130                        if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) {
131                                SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, AssertionResponseTypesEnum>());
132                        }
133                        SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next);                 
134                }
135        }
136        
137        /**
138         * Returns the code associated with this enumerated value
139         */
140        public String getCode() {
141                return myCode;
142        }
143        
144        /**
145         * Returns the code system associated with this enumerated value
146         */
147        public String getSystem() {
148                return mySystem;
149        }
150        
151        /**
152         * Returns the enumerated value associated with this code
153         */
154        public static AssertionResponseTypesEnum forCode(String theCode) {
155                AssertionResponseTypesEnum retVal = CODE_TO_ENUM.get(theCode);
156                return retVal;
157        }
158
159        /**
160         * Converts codes to their respective enumerated values
161         */
162        public static final IValueSetEnumBinder<AssertionResponseTypesEnum> VALUESET_BINDER = new IValueSetEnumBinder<AssertionResponseTypesEnum>() {
163                @Override
164                public String toCodeString(AssertionResponseTypesEnum theEnum) {
165                        return theEnum.getCode();
166                }
167
168                @Override
169                public String toSystemString(AssertionResponseTypesEnum theEnum) {
170                        return theEnum.getSystem();
171                }
172                
173                @Override
174                public AssertionResponseTypesEnum fromCodeString(String theCodeString) {
175                        return CODE_TO_ENUM.get(theCodeString);
176                }
177                
178                @Override
179                public AssertionResponseTypesEnum fromCodeString(String theCodeString, String theSystemString) {
180                        Map<String, AssertionResponseTypesEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString);
181                        if (map == null) {
182                                return null;
183                        }
184                        return map.get(theCodeString);
185                }
186                
187        };
188        
189        /** 
190         * Constructor
191         */
192        AssertionResponseTypesEnum(String theCode, String theSystem) {
193                myCode = theCode;
194                mySystem = theSystem;
195        }
196
197        
198}