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