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 Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034
035import org.hl7.fhir.exceptions.FHIRException;
036
037public enum AdverseEventCategory {
038
039        /**
040         * null
041         */
042        PRODUCTPROBLEM, 
043        /**
044         * null
045         */
046        PRODUCTQUALITY, 
047        /**
048         * null
049         */
050        PRODUCTUSEERROR, 
051        /**
052         * null
053         */
054        WRONGDOSE, 
055        /**
056         * null
057         */
058        INCORRECTPRESCRIBINGINFORMATION, 
059        /**
060         * null
061         */
062        WRONGTECHNIQUE, 
063        /**
064         * null
065         */
066        WRONGROUTEOFADMINISTRATION, 
067        /**
068         * null
069         */
070        WRONGRATE, 
071        /**
072         * null
073         */
074        WRONGDURATION, 
075        /**
076         * null
077         */
078        WRONGTIME, 
079        /**
080         * null
081         */
082        EXPIREDDRUG, 
083        /**
084         * null
085         */
086        MEDICALDEVICEUSEERROR, 
087        /**
088         * null
089         */
090        PROBLEMDIFFERENTMANUFACTURER, 
091        /**
092         * null
093         */
094        UNSAFEPHYSICALENVIRONMENT, 
095        /**
096         * added to help the parsers
097         */
098        NULL;
099        public static AdverseEventCategory fromCode(String codeString) throws FHIRException {
100            if (codeString == null || "".equals(codeString))
101                return null;
102        if ("ProductProblem".equals(codeString))
103          return PRODUCTPROBLEM;
104        if ("ProductQuality".equals(codeString))
105          return PRODUCTQUALITY;
106        if ("ProductUseError".equals(codeString))
107          return PRODUCTUSEERROR;
108        if ("WrongDose".equals(codeString))
109          return WRONGDOSE;
110        if ("IncorrectPrescribingInformation".equals(codeString))
111          return INCORRECTPRESCRIBINGINFORMATION;
112        if ("WrongTechnique".equals(codeString))
113          return WRONGTECHNIQUE;
114        if ("WrongRouteOfAdministration".equals(codeString))
115          return WRONGROUTEOFADMINISTRATION;
116        if ("WrongRate".equals(codeString))
117          return WRONGRATE;
118        if ("WrongDuration".equals(codeString))
119          return WRONGDURATION;
120        if ("WrongTime".equals(codeString))
121          return WRONGTIME;
122        if ("ExpiredDrug".equals(codeString))
123          return EXPIREDDRUG;
124        if ("MedicalDeviceUseError".equals(codeString))
125          return MEDICALDEVICEUSEERROR;
126        if ("ProblemDifferentManufacturer".equals(codeString))
127          return PROBLEMDIFFERENTMANUFACTURER;
128        if ("UnsafePhysicalEnvironment".equals(codeString))
129          return UNSAFEPHYSICALENVIRONMENT;
130        throw new FHIRException("Unknown AdverseEventCategory code '"+codeString+"'");
131        }
132        public String toCode() {
133          switch (this) {
134            case PRODUCTPROBLEM: return "ProductProblem";
135            case PRODUCTQUALITY: return "ProductQuality";
136            case PRODUCTUSEERROR: return "ProductUseError";
137            case WRONGDOSE: return "WrongDose";
138            case INCORRECTPRESCRIBINGINFORMATION: return "IncorrectPrescribingInformation";
139            case WRONGTECHNIQUE: return "WrongTechnique";
140            case WRONGROUTEOFADMINISTRATION: return "WrongRouteOfAdministration";
141            case WRONGRATE: return "WrongRate";
142            case WRONGDURATION: return "WrongDuration";
143            case WRONGTIME: return "WrongTime";
144            case EXPIREDDRUG: return "ExpiredDrug";
145            case MEDICALDEVICEUSEERROR: return "MedicalDeviceUseError";
146            case PROBLEMDIFFERENTMANUFACTURER: return "ProblemDifferentManufacturer";
147            case UNSAFEPHYSICALENVIRONMENT: return "UnsafePhysicalEnvironment";
148            default: return "?";
149          }
150        }
151        public String getSystem() {
152          return "http://hl7.org/fhir/adverse-event-category";
153        }
154        public String getDefinition() {
155          switch (this) {
156            case PRODUCTPROBLEM: return "";
157            case PRODUCTQUALITY: return "";
158            case PRODUCTUSEERROR: return "";
159            case WRONGDOSE: return "";
160            case INCORRECTPRESCRIBINGINFORMATION: return "";
161            case WRONGTECHNIQUE: return "";
162            case WRONGROUTEOFADMINISTRATION: return "";
163            case WRONGRATE: return "";
164            case WRONGDURATION: return "";
165            case WRONGTIME: return "";
166            case EXPIREDDRUG: return "";
167            case MEDICALDEVICEUSEERROR: return "";
168            case PROBLEMDIFFERENTMANUFACTURER: return "";
169            case UNSAFEPHYSICALENVIRONMENT: return "";
170            default: return "?";
171          }
172        }
173        public String getDisplay() {
174          switch (this) {
175            case PRODUCTPROBLEM: return "Product Problem";
176            case PRODUCTQUALITY: return "Product Quality";
177            case PRODUCTUSEERROR: return "Product Use Error";
178            case WRONGDOSE: return "Wrong Dose";
179            case INCORRECTPRESCRIBINGINFORMATION: return "Incorrect Prescribing Information";
180            case WRONGTECHNIQUE: return "Wrong Technique";
181            case WRONGROUTEOFADMINISTRATION: return "Wrong Route of Administration";
182            case WRONGRATE: return "Wrong Rate";
183            case WRONGDURATION: return "Wrong Duration";
184            case WRONGTIME: return "Wrong Time";
185            case EXPIREDDRUG: return "Expired Drug";
186            case MEDICALDEVICEUSEERROR: return "Medical Device Use Error";
187            case PROBLEMDIFFERENTMANUFACTURER: return "Problem with Different Manufacturer of Same Medicine";
188            case UNSAFEPHYSICALENVIRONMENT: return "Unsafe Physical Environment";
189            default: return "?";
190          }
191    }
192
193
194}
195