001package org.hl7.fhir.dstu3.model.codesystems;
002
003/*-
004 * #%L
005 * org.hl7.fhir.dstu3
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, 
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this 
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, 
034     this list of conditions and the following disclaimer in the documentation 
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
049  POSSIBILITY OF SUCH DAMAGE.
050  
051*/
052
053// Generated on Sat, Mar 25, 2017 21:03-0400 for FHIR v3.0.0
054
055
056import org.hl7.fhir.exceptions.FHIRException;
057
058public enum IssueType {
059
060        /**
061         * Content invalid against the specification or a profile.
062         */
063        INVALID, 
064        /**
065         * A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax.
066         */
067        STRUCTURE, 
068        /**
069         * A required element is missing.
070         */
071        REQUIRED, 
072        /**
073         * An element value is invalid.
074         */
075        VALUE, 
076        /**
077         * A content validation rule failed - e.g. a schematron rule.
078         */
079        INVARIANT, 
080        /**
081         * An authentication/authorization/permissions issue of some kind.
082         */
083        SECURITY, 
084        /**
085         * The client needs to initiate an authentication process.
086         */
087        LOGIN, 
088        /**
089         * The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable).
090         */
091        UNKNOWN, 
092        /**
093         * User session expired; a login may be required.
094         */
095        EXPIRED, 
096        /**
097         * The user does not have the rights to perform this action.
098         */
099        FORBIDDEN, 
100        /**
101         * Some information was not or may not have been returned due to business rules, consent or privacy rules, or access permission constraints.  This information may be accessible through alternate processes.
102         */
103        SUPPRESSED, 
104        /**
105         * Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged.
106         */
107        PROCESSING, 
108        /**
109         * The resource or profile is not supported.
110         */
111        NOTSUPPORTED, 
112        /**
113         * An attempt was made to create a duplicate record.
114         */
115        DUPLICATE, 
116        /**
117         * The reference provided was not found. In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the content is not found further into the application architecture.
118         */
119        NOTFOUND, 
120        /**
121         * Provided content is too long (typically, this is a denial of service protection type of error).
122         */
123        TOOLONG, 
124        /**
125         * The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code.
126         */
127        CODEINVALID, 
128        /**
129         * An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not recognized.
130         */
131        EXTENSION, 
132        /**
133         * The operation was stopped to protect server resources; e.g. a request for a value set expansion on all of SNOMED CT.
134         */
135        TOOCOSTLY, 
136        /**
137         * The content/operation failed to pass some business rule, and so could not proceed.
138         */
139        BUSINESSRULE, 
140        /**
141         * Content could not be accepted because of an edit conflict (i.e. version aware updates) (In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the conflict is discovered further into the application architecture.)
142         */
143        CONFLICT, 
144        /**
145         * Not all data sources typically accessed could be reached, or responded in time, so the returned information may not be complete.
146         */
147        INCOMPLETE, 
148        /**
149         * Transient processing issues. The system receiving the error may be able to resubmit the same content once an underlying issue is resolved.
150         */
151        TRANSIENT, 
152        /**
153         * A resource/record locking failure (usually in an underlying database).
154         */
155        LOCKERROR, 
156        /**
157         * The persistent store is unavailable; e.g. the database is down for maintenance or similar action.
158         */
159        NOSTORE, 
160        /**
161         * An unexpected internal error has occurred.
162         */
163        EXCEPTION, 
164        /**
165         * An internal timeout has occurred.
166         */
167        TIMEOUT, 
168        /**
169         * The system is not prepared to handle this request due to load management.
170         */
171        THROTTLED, 
172        /**
173         * A message unrelated to the processing success of the completed operation (examples of the latter include things like reminders of password expiry, system maintenance times, etc.).
174         */
175        INFORMATIONAL, 
176        /**
177         * added to help the parsers
178         */
179        NULL;
180        public static IssueType fromCode(String codeString) throws FHIRException {
181            if (codeString == null || "".equals(codeString))
182                return null;
183        if ("invalid".equals(codeString))
184          return INVALID;
185        if ("structure".equals(codeString))
186          return STRUCTURE;
187        if ("required".equals(codeString))
188          return REQUIRED;
189        if ("value".equals(codeString))
190          return VALUE;
191        if ("invariant".equals(codeString))
192          return INVARIANT;
193        if ("security".equals(codeString))
194          return SECURITY;
195        if ("login".equals(codeString))
196          return LOGIN;
197        if ("unknown".equals(codeString))
198          return UNKNOWN;
199        if ("expired".equals(codeString))
200          return EXPIRED;
201        if ("forbidden".equals(codeString))
202          return FORBIDDEN;
203        if ("suppressed".equals(codeString))
204          return SUPPRESSED;
205        if ("processing".equals(codeString))
206          return PROCESSING;
207        if ("not-supported".equals(codeString))
208          return NOTSUPPORTED;
209        if ("duplicate".equals(codeString))
210          return DUPLICATE;
211        if ("not-found".equals(codeString))
212          return NOTFOUND;
213        if ("too-long".equals(codeString))
214          return TOOLONG;
215        if ("code-invalid".equals(codeString))
216          return CODEINVALID;
217        if ("extension".equals(codeString))
218          return EXTENSION;
219        if ("too-costly".equals(codeString))
220          return TOOCOSTLY;
221        if ("business-rule".equals(codeString))
222          return BUSINESSRULE;
223        if ("conflict".equals(codeString))
224          return CONFLICT;
225        if ("incomplete".equals(codeString))
226          return INCOMPLETE;
227        if ("transient".equals(codeString))
228          return TRANSIENT;
229        if ("lock-error".equals(codeString))
230          return LOCKERROR;
231        if ("no-store".equals(codeString))
232          return NOSTORE;
233        if ("exception".equals(codeString))
234          return EXCEPTION;
235        if ("timeout".equals(codeString))
236          return TIMEOUT;
237        if ("throttled".equals(codeString))
238          return THROTTLED;
239        if ("informational".equals(codeString))
240          return INFORMATIONAL;
241        throw new FHIRException("Unknown IssueType code '"+codeString+"'");
242        }
243        public String toCode() {
244          switch (this) {
245            case INVALID: return "invalid";
246            case STRUCTURE: return "structure";
247            case REQUIRED: return "required";
248            case VALUE: return "value";
249            case INVARIANT: return "invariant";
250            case SECURITY: return "security";
251            case LOGIN: return "login";
252            case UNKNOWN: return "unknown";
253            case EXPIRED: return "expired";
254            case FORBIDDEN: return "forbidden";
255            case SUPPRESSED: return "suppressed";
256            case PROCESSING: return "processing";
257            case NOTSUPPORTED: return "not-supported";
258            case DUPLICATE: return "duplicate";
259            case NOTFOUND: return "not-found";
260            case TOOLONG: return "too-long";
261            case CODEINVALID: return "code-invalid";
262            case EXTENSION: return "extension";
263            case TOOCOSTLY: return "too-costly";
264            case BUSINESSRULE: return "business-rule";
265            case CONFLICT: return "conflict";
266            case INCOMPLETE: return "incomplete";
267            case TRANSIENT: return "transient";
268            case LOCKERROR: return "lock-error";
269            case NOSTORE: return "no-store";
270            case EXCEPTION: return "exception";
271            case TIMEOUT: return "timeout";
272            case THROTTLED: return "throttled";
273            case INFORMATIONAL: return "informational";
274            default: return "?";
275          }
276        }
277        public String getSystem() {
278          return "http://hl7.org/fhir/issue-type";
279        }
280        public String getDefinition() {
281          switch (this) {
282            case INVALID: return "Content invalid against the specification or a profile.";
283            case STRUCTURE: return "A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax.";
284            case REQUIRED: return "A required element is missing.";
285            case VALUE: return "An element value is invalid.";
286            case INVARIANT: return "A content validation rule failed - e.g. a schematron rule.";
287            case SECURITY: return "An authentication/authorization/permissions issue of some kind.";
288            case LOGIN: return "The client needs to initiate an authentication process.";
289            case UNKNOWN: return "The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable).";
290            case EXPIRED: return "User session expired; a login may be required.";
291            case FORBIDDEN: return "The user does not have the rights to perform this action.";
292            case SUPPRESSED: return "Some information was not or may not have been returned due to business rules, consent or privacy rules, or access permission constraints.  This information may be accessible through alternate processes.";
293            case PROCESSING: return "Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged.";
294            case NOTSUPPORTED: return "The resource or profile is not supported.";
295            case DUPLICATE: return "An attempt was made to create a duplicate record.";
296            case NOTFOUND: return "The reference provided was not found. In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the content is not found further into the application architecture.";
297            case TOOLONG: return "Provided content is too long (typically, this is a denial of service protection type of error).";
298            case CODEINVALID: return "The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code.";
299            case EXTENSION: return "An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not recognized.";
300            case TOOCOSTLY: return "The operation was stopped to protect server resources; e.g. a request for a value set expansion on all of SNOMED CT.";
301            case BUSINESSRULE: return "The content/operation failed to pass some business rule, and so could not proceed.";
302            case CONFLICT: return "Content could not be accepted because of an edit conflict (i.e. version aware updates) (In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the conflict is discovered further into the application architecture.)";
303            case INCOMPLETE: return "Not all data sources typically accessed could be reached, or responded in time, so the returned information may not be complete.";
304            case TRANSIENT: return "Transient processing issues. The system receiving the error may be able to resubmit the same content once an underlying issue is resolved.";
305            case LOCKERROR: return "A resource/record locking failure (usually in an underlying database).";
306            case NOSTORE: return "The persistent store is unavailable; e.g. the database is down for maintenance or similar action.";
307            case EXCEPTION: return "An unexpected internal error has occurred.";
308            case TIMEOUT: return "An internal timeout has occurred.";
309            case THROTTLED: return "The system is not prepared to handle this request due to load management.";
310            case INFORMATIONAL: return "A message unrelated to the processing success of the completed operation (examples of the latter include things like reminders of password expiry, system maintenance times, etc.).";
311            default: return "?";
312          }
313        }
314        public String getDisplay() {
315          switch (this) {
316            case INVALID: return "Invalid Content";
317            case STRUCTURE: return "Structural Issue";
318            case REQUIRED: return "Required element missing";
319            case VALUE: return "Element value invalid";
320            case INVARIANT: return "Validation rule failed";
321            case SECURITY: return "Security Problem";
322            case LOGIN: return "Login Required";
323            case UNKNOWN: return "Unknown User";
324            case EXPIRED: return "Session Expired";
325            case FORBIDDEN: return "Forbidden";
326            case SUPPRESSED: return "Information  Suppressed";
327            case PROCESSING: return "Processing Failure";
328            case NOTSUPPORTED: return "Content not supported";
329            case DUPLICATE: return "Duplicate";
330            case NOTFOUND: return "Not Found";
331            case TOOLONG: return "Content Too Long";
332            case CODEINVALID: return "Invalid Code";
333            case EXTENSION: return "Unacceptable Extension";
334            case TOOCOSTLY: return "Operation Too Costly";
335            case BUSINESSRULE: return "Business Rule Violation";
336            case CONFLICT: return "Edit Version Conflict";
337            case INCOMPLETE: return "Incomplete Results";
338            case TRANSIENT: return "Transient Issue";
339            case LOCKERROR: return "Lock Error";
340            case NOSTORE: return "No Store Available";
341            case EXCEPTION: return "Exception";
342            case TIMEOUT: return "Timeout";
343            case THROTTLED: return "Throttled";
344            case INFORMATIONAL: return "Informational Note";
345            default: return "?";
346          }
347    }
348
349
350}
351