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 Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0
033
034import org.hl7.fhir.exceptions.FHIRException;
035
036public enum AdverseEventSeriousness {
037
038  /**
039   * Non-serious.
040   */
041  NONSERIOUS,
042  /**
043   * Serious.
044   */
045  SERIOUS,
046  /**
047   * Results in death.
048   */
049  SERIOUSRESULTSINDEATH,
050  /**
051   * Is Life-threatening.
052   */
053  SERIOUSISLIFETHREATENING,
054  /**
055   * Requires inpatient hospitalization or causes prolongation of existing
056   * hospitalization.
057   */
058  SERIOUSRESULTSINHOSPITALIZATION,
059  /**
060   * Results in persistent or significant disability/incapacity.
061   */
062  SERIOUSRESULTSINDISABILITY,
063  /**
064   * Is a congenital anomaly/birth defect.
065   */
066  SERIOUSISBIRTHDEFECT,
067  /**
068   * Requires intervention to prevent permanent impairment or damage (i.e., an
069   * important medical event that requires medical judgement).
070   */
071  SERIOUSREQUIRESPREVENTIMPAIRMENT,
072  /**
073   * added to help the parsers
074   */
075  NULL;
076
077  public static AdverseEventSeriousness fromCode(String codeString) throws FHIRException {
078    if (codeString == null || "".equals(codeString))
079      return null;
080    if ("Non-serious".equals(codeString))
081      return NONSERIOUS;
082    if ("Serious".equals(codeString))
083      return SERIOUS;
084    if ("SeriousResultsInDeath".equals(codeString))
085      return SERIOUSRESULTSINDEATH;
086    if ("SeriousIsLifeThreatening".equals(codeString))
087      return SERIOUSISLIFETHREATENING;
088    if ("SeriousResultsInHospitalization".equals(codeString))
089      return SERIOUSRESULTSINHOSPITALIZATION;
090    if ("SeriousResultsInDisability".equals(codeString))
091      return SERIOUSRESULTSINDISABILITY;
092    if ("SeriousIsBirthDefect".equals(codeString))
093      return SERIOUSISBIRTHDEFECT;
094    if ("SeriousRequiresPreventImpairment".equals(codeString))
095      return SERIOUSREQUIRESPREVENTIMPAIRMENT;
096    throw new FHIRException("Unknown AdverseEventSeriousness code '" + codeString + "'");
097  }
098
099  public String toCode() {
100    switch (this) {
101    case NONSERIOUS:
102      return "Non-serious";
103    case SERIOUS:
104      return "Serious";
105    case SERIOUSRESULTSINDEATH:
106      return "SeriousResultsInDeath";
107    case SERIOUSISLIFETHREATENING:
108      return "SeriousIsLifeThreatening";
109    case SERIOUSRESULTSINHOSPITALIZATION:
110      return "SeriousResultsInHospitalization";
111    case SERIOUSRESULTSINDISABILITY:
112      return "SeriousResultsInDisability";
113    case SERIOUSISBIRTHDEFECT:
114      return "SeriousIsBirthDefect";
115    case SERIOUSREQUIRESPREVENTIMPAIRMENT:
116      return "SeriousRequiresPreventImpairment";
117    case NULL:
118      return null;
119    default:
120      return "?";
121    }
122  }
123
124  public String getSystem() {
125    return "http://terminology.hl7.org/CodeSystem/adverse-event-seriousness";
126  }
127
128  public String getDefinition() {
129    switch (this) {
130    case NONSERIOUS:
131      return "Non-serious.";
132    case SERIOUS:
133      return "Serious.";
134    case SERIOUSRESULTSINDEATH:
135      return "Results in death.";
136    case SERIOUSISLIFETHREATENING:
137      return "Is Life-threatening.";
138    case SERIOUSRESULTSINHOSPITALIZATION:
139      return "Requires inpatient hospitalization or causes prolongation of existing hospitalization.";
140    case SERIOUSRESULTSINDISABILITY:
141      return "Results in persistent or significant disability/incapacity.";
142    case SERIOUSISBIRTHDEFECT:
143      return "Is a congenital anomaly/birth defect.";
144    case SERIOUSREQUIRESPREVENTIMPAIRMENT:
145      return "Requires intervention to prevent permanent impairment or damage (i.e., an important medical event that requires medical judgement).";
146    case NULL:
147      return null;
148    default:
149      return "?";
150    }
151  }
152
153  public String getDisplay() {
154    switch (this) {
155    case NONSERIOUS:
156      return "Non-serious";
157    case SERIOUS:
158      return "Serious";
159    case SERIOUSRESULTSINDEATH:
160      return "Results in death";
161    case SERIOUSISLIFETHREATENING:
162      return "Is Life-threatening";
163    case SERIOUSRESULTSINHOSPITALIZATION:
164      return "Requires or prolongs inpatient hospitalization";
165    case SERIOUSRESULTSINDISABILITY:
166      return "Results in persistent or significant disability/incapacity";
167    case SERIOUSISBIRTHDEFECT:
168      return "Is a congenital anomaly/birth defect";
169    case SERIOUSREQUIRESPREVENTIMPAIRMENT:
170      return "Requires intervention to prevent permanent impairment";
171    case NULL:
172      return null;
173    default:
174      return "?";
175    }
176  }
177
178}