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 CertaintySubcomponentRating {
041
042        /**
043         * no change to quality rating.
044         */
045        NOCHANGE, 
046        /**
047         * reduce quality rating by 1.
048         */
049        DOWNCODE1, 
050        /**
051         * reduce quality rating by 2.
052         */
053        DOWNCODE2, 
054        /**
055         * reduce quality rating by 3.
056         */
057        DOWNCODE3, 
058        /**
059         * increase quality rating by 1.
060         */
061        UPCODE1, 
062        /**
063         * increase quality rating by 2.
064         */
065        UPCODE2, 
066        /**
067         * no serious concern.
068         */
069        NOCONCERN, 
070        /**
071         * serious concern.
072         */
073        SERIOUSCONCERN, 
074        /**
075         * critical concern.
076         */
077        CRITICALCONCERN, 
078        /**
079         * possible reason for increasing quality rating was checked and found to bepresent.
080         */
081        PRESENT, 
082        /**
083         * possible reason for increasing quality rating was checked and found to be absent.
084         */
085        ABSENT, 
086        /**
087         * added to help the parsers
088         */
089        NULL;
090        public static CertaintySubcomponentRating fromCode(String codeString) throws FHIRException {
091            if (codeString == null || "".equals(codeString))
092                return null;
093        if ("no-change".equals(codeString))
094          return NOCHANGE;
095        if ("downcode1".equals(codeString))
096          return DOWNCODE1;
097        if ("downcode2".equals(codeString))
098          return DOWNCODE2;
099        if ("downcode3".equals(codeString))
100          return DOWNCODE3;
101        if ("upcode1".equals(codeString))
102          return UPCODE1;
103        if ("upcode2".equals(codeString))
104          return UPCODE2;
105        if ("no-concern".equals(codeString))
106          return NOCONCERN;
107        if ("serious-concern".equals(codeString))
108          return SERIOUSCONCERN;
109        if ("critical-concern".equals(codeString))
110          return CRITICALCONCERN;
111        if ("present".equals(codeString))
112          return PRESENT;
113        if ("absent".equals(codeString))
114          return ABSENT;
115        throw new FHIRException("Unknown CertaintySubcomponentRating code '"+codeString+"'");
116        }
117        public String toCode() {
118          switch (this) {
119            case NOCHANGE: return "no-change";
120            case DOWNCODE1: return "downcode1";
121            case DOWNCODE2: return "downcode2";
122            case DOWNCODE3: return "downcode3";
123            case UPCODE1: return "upcode1";
124            case UPCODE2: return "upcode2";
125            case NOCONCERN: return "no-concern";
126            case SERIOUSCONCERN: return "serious-concern";
127            case CRITICALCONCERN: return "critical-concern";
128            case PRESENT: return "present";
129            case ABSENT: return "absent";
130            case NULL: return null;
131            default: return "?";
132          }
133        }
134        public String getSystem() {
135          return "http://terminology.hl7.org/CodeSystem/certainty-subcomponent-rating";
136        }
137        public String getDefinition() {
138          switch (this) {
139            case NOCHANGE: return "no change to quality rating.";
140            case DOWNCODE1: return "reduce quality rating by 1.";
141            case DOWNCODE2: return "reduce quality rating by 2.";
142            case DOWNCODE3: return "reduce quality rating by 3.";
143            case UPCODE1: return "increase quality rating by 1.";
144            case UPCODE2: return "increase quality rating by 2.";
145            case NOCONCERN: return "no serious concern.";
146            case SERIOUSCONCERN: return "serious concern.";
147            case CRITICALCONCERN: return "critical concern.";
148            case PRESENT: return "possible reason for increasing quality rating was checked and found to bepresent.";
149            case ABSENT: return "possible reason for increasing quality rating was checked and found to be absent.";
150            case NULL: return null;
151            default: return "?";
152          }
153        }
154        public String getDisplay() {
155          switch (this) {
156            case NOCHANGE: return "no change to rating";
157            case DOWNCODE1: return "reduce rating: -1";
158            case DOWNCODE2: return "reduce rating: -2";
159            case DOWNCODE3: return "reduce rating: -3";
160            case UPCODE1: return "increase rating: +1";
161            case UPCODE2: return "increase rating: +2";
162            case NOCONCERN: return "no serious concern";
163            case SERIOUSCONCERN: return "serious concern";
164            case CRITICALCONCERN: return "critical concern";
165            case PRESENT: return "present";
166            case ABSENT: return "absent";
167            case NULL: return null;
168            default: return "?";
169          }
170    }
171
172
173}