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 IssueType {
038
039        /**
040         * Content invalid against the specification or a profile.
041         */
042        INVALID, 
043        /**
044         * A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax.
045         */
046        STRUCTURE, 
047        /**
048         * A required element is missing.
049         */
050        REQUIRED, 
051        /**
052         * An element or header value is invalid.
053         */
054        VALUE, 
055        /**
056         * A content validation rule failed - e.g. a schematron rule.
057         */
058        INVARIANT, 
059        /**
060         * An authentication/authorization/permissions issue of some kind.
061         */
062        SECURITY, 
063        /**
064         * The client needs to initiate an authentication process.
065         */
066        LOGIN, 
067        /**
068         * The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable).
069         */
070        UNKNOWN, 
071        /**
072         * User session expired; a login may be required.
073         */
074        EXPIRED, 
075        /**
076         * The user does not have the rights to perform this action.
077         */
078        FORBIDDEN, 
079        /**
080         * Some information was not or might not have been returned due to business rules, consent or privacy rules, or access permission constraints.  This information may be accessible through alternate processes.
081         */
082        SUPPRESSED, 
083        /**
084         * Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged.
085         */
086        PROCESSING, 
087        /**
088         * The interaction, operation, resource or profile is not supported.
089         */
090        NOTSUPPORTED, 
091        /**
092         * An attempt was made to create a duplicate record.
093         */
094        DUPLICATE, 
095        /**
096         * Multiple matching records were found when the operation required only one match.
097         */
098        MULTIPLEMATCHES, 
099        /**
100         * 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.
101         */
102        NOTFOUND, 
103        /**
104         * The reference pointed to content (usually a resource) that has been deleted.
105         */
106        DELETED, 
107        /**
108         * Provided content is too long (typically, this is a denial of service protection type of error).
109         */
110        TOOLONG, 
111        /**
112         * The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code.
113         */
114        CODEINVALID, 
115        /**
116         * An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not recognized.
117         */
118        EXTENSION, 
119        /**
120         * The operation was stopped to protect server resources; e.g. a request for a value set expansion on all of SNOMED CT.
121         */
122        TOOCOSTLY, 
123        /**
124         * The content/operation failed to pass some business rule and so could not proceed.
125         */
126        BUSINESSRULE, 
127        /**
128         * 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 409 error, but this code may be used where the conflict is discovered further into the application architecture.).
129         */
130        CONFLICT, 
131        /**
132         * Transient processing issues. The system receiving the error may be able to resubmit the same content once an underlying issue is resolved.
133         */
134        TRANSIENT, 
135        /**
136         * A resource/record locking failure (usually in an underlying database).
137         */
138        LOCKERROR, 
139        /**
140         * The persistent store is unavailable; e.g. the database is down for maintenance or similar action, and the interaction or operation cannot be processed.
141         */
142        NOSTORE, 
143        /**
144         * y.
145         */
146        EXCEPTION, 
147        /**
148         * An internal timeout has occurred.
149         */
150        TIMEOUT, 
151        /**
152         * Not all data sources typically accessed could be reached or responded in time, so the returned information might not be complete (applies to search interactions and some operations).
153         */
154        INCOMPLETE, 
155        /**
156         * The system is not prepared to handle this request due to load management.
157         */
158        THROTTLED, 
159        /**
160         * 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.).
161         */
162        INFORMATIONAL, 
163        /**
164         * added to help the parsers
165         */
166        NULL;
167        public static IssueType fromCode(String codeString) throws FHIRException {
168            if (codeString == null || "".equals(codeString))
169                return null;
170        if ("invalid".equals(codeString))
171          return INVALID;
172        if ("structure".equals(codeString))
173          return STRUCTURE;
174        if ("required".equals(codeString))
175          return REQUIRED;
176        if ("value".equals(codeString))
177          return VALUE;
178        if ("invariant".equals(codeString))
179          return INVARIANT;
180        if ("security".equals(codeString))
181          return SECURITY;
182        if ("login".equals(codeString))
183          return LOGIN;
184        if ("unknown".equals(codeString))
185          return UNKNOWN;
186        if ("expired".equals(codeString))
187          return EXPIRED;
188        if ("forbidden".equals(codeString))
189          return FORBIDDEN;
190        if ("suppressed".equals(codeString))
191          return SUPPRESSED;
192        if ("processing".equals(codeString))
193          return PROCESSING;
194        if ("not-supported".equals(codeString))
195          return NOTSUPPORTED;
196        if ("duplicate".equals(codeString))
197          return DUPLICATE;
198        if ("multiple-matches".equals(codeString))
199          return MULTIPLEMATCHES;
200        if ("not-found".equals(codeString))
201          return NOTFOUND;
202        if ("deleted".equals(codeString))
203          return DELETED;
204        if ("too-long".equals(codeString))
205          return TOOLONG;
206        if ("code-invalid".equals(codeString))
207          return CODEINVALID;
208        if ("extension".equals(codeString))
209          return EXTENSION;
210        if ("too-costly".equals(codeString))
211          return TOOCOSTLY;
212        if ("business-rule".equals(codeString))
213          return BUSINESSRULE;
214        if ("conflict".equals(codeString))
215          return CONFLICT;
216        if ("transient".equals(codeString))
217          return TRANSIENT;
218        if ("lock-error".equals(codeString))
219          return LOCKERROR;
220        if ("no-store".equals(codeString))
221          return NOSTORE;
222        if ("exception".equals(codeString))
223          return EXCEPTION;
224        if ("timeout".equals(codeString))
225          return TIMEOUT;
226        if ("incomplete".equals(codeString))
227          return INCOMPLETE;
228        if ("throttled".equals(codeString))
229          return THROTTLED;
230        if ("informational".equals(codeString))
231          return INFORMATIONAL;
232        throw new FHIRException("Unknown IssueType code '"+codeString+"'");
233        }
234        public String toCode() {
235          switch (this) {
236            case INVALID: return "invalid";
237            case STRUCTURE: return "structure";
238            case REQUIRED: return "required";
239            case VALUE: return "value";
240            case INVARIANT: return "invariant";
241            case SECURITY: return "security";
242            case LOGIN: return "login";
243            case UNKNOWN: return "unknown";
244            case EXPIRED: return "expired";
245            case FORBIDDEN: return "forbidden";
246            case SUPPRESSED: return "suppressed";
247            case PROCESSING: return "processing";
248            case NOTSUPPORTED: return "not-supported";
249            case DUPLICATE: return "duplicate";
250            case MULTIPLEMATCHES: return "multiple-matches";
251            case NOTFOUND: return "not-found";
252            case DELETED: return "deleted";
253            case TOOLONG: return "too-long";
254            case CODEINVALID: return "code-invalid";
255            case EXTENSION: return "extension";
256            case TOOCOSTLY: return "too-costly";
257            case BUSINESSRULE: return "business-rule";
258            case CONFLICT: return "conflict";
259            case TRANSIENT: return "transient";
260            case LOCKERROR: return "lock-error";
261            case NOSTORE: return "no-store";
262            case EXCEPTION: return "exception";
263            case TIMEOUT: return "timeout";
264            case INCOMPLETE: return "incomplete";
265            case THROTTLED: return "throttled";
266            case INFORMATIONAL: return "informational";
267            default: return "?";
268          }
269        }
270        public String getSystem() {
271          return "http://hl7.org/fhir/issue-type";
272        }
273        public String getDefinition() {
274          switch (this) {
275            case INVALID: return "Content invalid against the specification or a profile.";
276            case STRUCTURE: return "A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax.";
277            case REQUIRED: return "A required element is missing.";
278            case VALUE: return "An element or header value is invalid.";
279            case INVARIANT: return "A content validation rule failed - e.g. a schematron rule.";
280            case SECURITY: return "An authentication/authorization/permissions issue of some kind.";
281            case LOGIN: return "The client needs to initiate an authentication process.";
282            case UNKNOWN: return "The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable).";
283            case EXPIRED: return "User session expired; a login may be required.";
284            case FORBIDDEN: return "The user does not have the rights to perform this action.";
285            case SUPPRESSED: return "Some information was not or might not have been returned due to business rules, consent or privacy rules, or access permission constraints.  This information may be accessible through alternate processes.";
286            case PROCESSING: return "Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged.";
287            case NOTSUPPORTED: return "The interaction, operation, resource or profile is not supported.";
288            case DUPLICATE: return "An attempt was made to create a duplicate record.";
289            case MULTIPLEMATCHES: return "Multiple matching records were found when the operation required only one match.";
290            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.";
291            case DELETED: return "The reference pointed to content (usually a resource) that has been deleted.";
292            case TOOLONG: return "Provided content is too long (typically, this is a denial of service protection type of error).";
293            case CODEINVALID: return "The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code.";
294            case EXTENSION: return "An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not recognized.";
295            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.";
296            case BUSINESSRULE: return "The content/operation failed to pass some business rule and so could not proceed.";
297            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 409 error, but this code may be used where the conflict is discovered further into the application architecture.).";
298            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.";
299            case LOCKERROR: return "A resource/record locking failure (usually in an underlying database).";
300            case NOSTORE: return "The persistent store is unavailable; e.g. the database is down for maintenance or similar action, and the interaction or operation cannot be processed.";
301            case EXCEPTION: return "y.";
302            case TIMEOUT: return "An internal timeout has occurred.";
303            case INCOMPLETE: return "Not all data sources typically accessed could be reached or responded in time, so the returned information might not be complete (applies to search interactions and some operations).";
304            case THROTTLED: return "The system is not prepared to handle this request due to load management.";
305            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.).";
306            default: return "?";
307          }
308        }
309        public String getDisplay() {
310          switch (this) {
311            case INVALID: return "Invalid Content";
312            case STRUCTURE: return "Structural Issue";
313            case REQUIRED: return "Required element missing";
314            case VALUE: return "Element value invalid";
315            case INVARIANT: return "Validation rule failed";
316            case SECURITY: return "Security Problem";
317            case LOGIN: return "Login Required";
318            case UNKNOWN: return "Unknown User";
319            case EXPIRED: return "Session Expired";
320            case FORBIDDEN: return "Forbidden";
321            case SUPPRESSED: return "Information  Suppressed";
322            case PROCESSING: return "Processing Failure";
323            case NOTSUPPORTED: return "Content not supported";
324            case DUPLICATE: return "Duplicate";
325            case MULTIPLEMATCHES: return "Multiple Matches";
326            case NOTFOUND: return "Not Found";
327            case DELETED: return "Deleted";
328            case TOOLONG: return "Content Too Long";
329            case CODEINVALID: return "Invalid Code";
330            case EXTENSION: return "Unacceptable Extension";
331            case TOOCOSTLY: return "Operation Too Costly";
332            case BUSINESSRULE: return "Business Rule Violation";
333            case CONFLICT: return "Edit Version Conflict";
334            case TRANSIENT: return "Transient Issue";
335            case LOCKERROR: return "Lock Error";
336            case NOSTORE: return "No Store Available";
337            case EXCEPTION: return "Exception";
338            case TIMEOUT: return "Timeout";
339            case INCOMPLETE: return "Incomplete Results";
340            case THROTTLED: return "Throttled";
341            case INFORMATIONAL: return "Informational Note";
342            default: return "?";
343          }
344    }
345
346
347}
348