001package org.hl7.fhir.dstu3.model.codesystems;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Sat, Mar 25, 2017 21:03-0400 for FHIR v3.0.0
036
037
038import org.hl7.fhir.exceptions.FHIRException;
039
040public enum AssertResponseCodeTypes {
041
042        /**
043         * Response code is 200.
044         */
045        OKAY, 
046        /**
047         * Response code is 201.
048         */
049        CREATED, 
050        /**
051         * Response code is 204.
052         */
053        NOCONTENT, 
054        /**
055         * Response code is 304.
056         */
057        NOTMODIFIED, 
058        /**
059         * Response code is 400.
060         */
061        BAD, 
062        /**
063         * Response code is 403.
064         */
065        FORBIDDEN, 
066        /**
067         * Response code is 404.
068         */
069        NOTFOUND, 
070        /**
071         * Response code is 405.
072         */
073        METHODNOTALLOWED, 
074        /**
075         * Response code is 409.
076         */
077        CONFLICT, 
078        /**
079         * Response code is 410.
080         */
081        GONE, 
082        /**
083         * Response code is 412.
084         */
085        PRECONDITIONFAILED, 
086        /**
087         * Response code is 422.
088         */
089        UNPROCESSABLE, 
090        /**
091         * added to help the parsers
092         */
093        NULL;
094        public static AssertResponseCodeTypes fromCode(String codeString) throws FHIRException {
095            if (codeString == null || "".equals(codeString))
096                return null;
097        if ("okay".equals(codeString))
098          return OKAY;
099        if ("created".equals(codeString))
100          return CREATED;
101        if ("noContent".equals(codeString))
102          return NOCONTENT;
103        if ("notModified".equals(codeString))
104          return NOTMODIFIED;
105        if ("bad".equals(codeString))
106          return BAD;
107        if ("forbidden".equals(codeString))
108          return FORBIDDEN;
109        if ("notFound".equals(codeString))
110          return NOTFOUND;
111        if ("methodNotAllowed".equals(codeString))
112          return METHODNOTALLOWED;
113        if ("conflict".equals(codeString))
114          return CONFLICT;
115        if ("gone".equals(codeString))
116          return GONE;
117        if ("preconditionFailed".equals(codeString))
118          return PRECONDITIONFAILED;
119        if ("unprocessable".equals(codeString))
120          return UNPROCESSABLE;
121        throw new FHIRException("Unknown AssertResponseCodeTypes code '"+codeString+"'");
122        }
123        public String toCode() {
124          switch (this) {
125            case OKAY: return "okay";
126            case CREATED: return "created";
127            case NOCONTENT: return "noContent";
128            case NOTMODIFIED: return "notModified";
129            case BAD: return "bad";
130            case FORBIDDEN: return "forbidden";
131            case NOTFOUND: return "notFound";
132            case METHODNOTALLOWED: return "methodNotAllowed";
133            case CONFLICT: return "conflict";
134            case GONE: return "gone";
135            case PRECONDITIONFAILED: return "preconditionFailed";
136            case UNPROCESSABLE: return "unprocessable";
137            case NULL: return null;
138            default: return "?";
139          }
140        }
141        public String getSystem() {
142          return "http://hl7.org/fhir/assert-response-code-types";
143        }
144        public String getDefinition() {
145          switch (this) {
146            case OKAY: return "Response code is 200.";
147            case CREATED: return "Response code is 201.";
148            case NOCONTENT: return "Response code is 204.";
149            case NOTMODIFIED: return "Response code is 304.";
150            case BAD: return "Response code is 400.";
151            case FORBIDDEN: return "Response code is 403.";
152            case NOTFOUND: return "Response code is 404.";
153            case METHODNOTALLOWED: return "Response code is 405.";
154            case CONFLICT: return "Response code is 409.";
155            case GONE: return "Response code is 410.";
156            case PRECONDITIONFAILED: return "Response code is 412.";
157            case UNPROCESSABLE: return "Response code is 422.";
158            case NULL: return null;
159            default: return "?";
160          }
161        }
162        public String getDisplay() {
163          switch (this) {
164            case OKAY: return "okay";
165            case CREATED: return "created";
166            case NOCONTENT: return "noContent";
167            case NOTMODIFIED: return "notModified";
168            case BAD: return "bad";
169            case FORBIDDEN: return "forbidden";
170            case NOTFOUND: return "notFound";
171            case METHODNOTALLOWED: return "methodNotAllowed";
172            case CONFLICT: return "conflict";
173            case GONE: return "gone";
174            case PRECONDITIONFAILED: return "preconditionFailed";
175            case UNPROCESSABLE: return "unprocessable";
176            case NULL: return null;
177            default: return "?";
178          }
179    }
180
181
182}