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