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