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 MedicationrequestStatusReason {
058
059        /**
060         * This therapy has been ordered as a backup to a preferred therapy. This order will be released when and if the preferred therapy is unsuccessful.
061         */
062        ALTCHOICE, 
063        /**
064         * Clarification is required before the order can be acted upon.
065         */
066        CLARIF, 
067        /**
068         * The current level of the medication in the patient's system is too high. The medication is suspended to allow the level to subside to a safer level.
069         */
070        DRUGHIGH, 
071        /**
072         * The patient has been admitted to a care facility and their community medications are suspended until hospital discharge.
073         */
074        HOSPADM, 
075        /**
076         * The therapy would interfere with a planned lab test and the therapy is being withdrawn until the test is completed.
077         */
078        LABINT, 
079        /**
080         * Patient not available for a period of time due to a scheduled therapy, leave of absence or other reason.
081         */
082        NONAVAIL, 
083        /**
084         * The patient is pregnant or breast feeding. The therapy will be resumed when the pregnancy is complete and the patient is no longer breastfeeding.
085         */
086        PREG, 
087        /**
088         * The patient is believed to be allergic to a substance that is part of the therapy and the therapy is being temporarily withdrawn to confirm.
089         */
090        SALG, 
091        /**
092         * The drug interacts with a short-term treatment that is more urgently required. This order will be resumed when the short-term treatment is complete.
093         */
094        SDDI, 
095        /**
096         * The drug interacts with a short-term treatment that is more urgently required. This order will be resumed when the short-term treatment is complete.
097         */
098        SDUPTHER, 
099        /**
100         * The drug interacts with a short-term treatment that is more urgently required. This order will be resumed when the short-term treatment is complete.
101         */
102        SINTOL, 
103        /**
104         * The drug is contraindicated for patients receiving surgery and the patient is scheduled to be admitted for surgery in the near future. The drug will be resumed when the patient has sufficiently recovered from the surgery.
105         */
106        SURG, 
107        /**
108         * The patient was previously receiving a medication contraindicated with the current medication. The current medication will remain on hold until the prior medication has been cleansed from their system.
109         */
110        WASHOUT, 
111        /**
112         * added to help the parsers
113         */
114        NULL;
115        public static MedicationrequestStatusReason fromCode(String codeString) throws FHIRException {
116            if (codeString == null || "".equals(codeString))
117                return null;
118        if ("altchoice".equals(codeString))
119          return ALTCHOICE;
120        if ("clarif".equals(codeString))
121          return CLARIF;
122        if ("drughigh".equals(codeString))
123          return DRUGHIGH;
124        if ("hospadm".equals(codeString))
125          return HOSPADM;
126        if ("labint".equals(codeString))
127          return LABINT;
128        if ("non-avail".equals(codeString))
129          return NONAVAIL;
130        if ("preg".equals(codeString))
131          return PREG;
132        if ("salg".equals(codeString))
133          return SALG;
134        if ("sddi".equals(codeString))
135          return SDDI;
136        if ("sdupther".equals(codeString))
137          return SDUPTHER;
138        if ("sintol".equals(codeString))
139          return SINTOL;
140        if ("surg".equals(codeString))
141          return SURG;
142        if ("washout".equals(codeString))
143          return WASHOUT;
144        throw new FHIRException("Unknown MedicationrequestStatusReason code '"+codeString+"'");
145        }
146        public String toCode() {
147          switch (this) {
148            case ALTCHOICE: return "altchoice";
149            case CLARIF: return "clarif";
150            case DRUGHIGH: return "drughigh";
151            case HOSPADM: return "hospadm";
152            case LABINT: return "labint";
153            case NONAVAIL: return "non-avail";
154            case PREG: return "preg";
155            case SALG: return "salg";
156            case SDDI: return "sddi";
157            case SDUPTHER: return "sdupther";
158            case SINTOL: return "sintol";
159            case SURG: return "surg";
160            case WASHOUT: return "washout";
161            default: return "?";
162          }
163        }
164        public String getSystem() {
165          return "http://terminology.hl7.org/CodeSystem/medicationrequest-status-reason";
166        }
167        public String getDefinition() {
168          switch (this) {
169            case ALTCHOICE: return "This therapy has been ordered as a backup to a preferred therapy. This order will be released when and if the preferred therapy is unsuccessful.";
170            case CLARIF: return "Clarification is required before the order can be acted upon.";
171            case DRUGHIGH: return "The current level of the medication in the patient's system is too high. The medication is suspended to allow the level to subside to a safer level.";
172            case HOSPADM: return "The patient has been admitted to a care facility and their community medications are suspended until hospital discharge.";
173            case LABINT: return "The therapy would interfere with a planned lab test and the therapy is being withdrawn until the test is completed.";
174            case NONAVAIL: return "Patient not available for a period of time due to a scheduled therapy, leave of absence or other reason.";
175            case PREG: return "The patient is pregnant or breast feeding. The therapy will be resumed when the pregnancy is complete and the patient is no longer breastfeeding.";
176            case SALG: return "The patient is believed to be allergic to a substance that is part of the therapy and the therapy is being temporarily withdrawn to confirm.";
177            case SDDI: return "The drug interacts with a short-term treatment that is more urgently required. This order will be resumed when the short-term treatment is complete.";
178            case SDUPTHER: return "The drug interacts with a short-term treatment that is more urgently required. This order will be resumed when the short-term treatment is complete.";
179            case SINTOL: return "The drug interacts with a short-term treatment that is more urgently required. This order will be resumed when the short-term treatment is complete.";
180            case SURG: return "The drug is contraindicated for patients receiving surgery and the patient is scheduled to be admitted for surgery in the near future. The drug will be resumed when the patient has sufficiently recovered from the surgery.";
181            case WASHOUT: return "The patient was previously receiving a medication contraindicated with the current medication. The current medication will remain on hold until the prior medication has been cleansed from their system.";
182            default: return "?";
183          }
184        }
185        public String getDisplay() {
186          switch (this) {
187            case ALTCHOICE: return "Try another treatment first";
188            case CLARIF: return "Prescription requires clarification";
189            case DRUGHIGH: return "Drug level too high";
190            case HOSPADM: return "Admission to hospital";
191            case LABINT: return "Lab interference issues";
192            case NONAVAIL: return "Patient not available";
193            case PREG: return "Parent is pregnant/breast feeding";
194            case SALG: return "Allergy";
195            case SDDI: return "Drug interacts with another drug";
196            case SDUPTHER: return "Duplicate therapy";
197            case SINTOL: return "Suspected intolerance";
198            case SURG: return "Patient scheduled for surgery.";
199            case WASHOUT: return "Waiting for old drug to wash out";
200            default: return "?";
201          }
202    }
203
204
205}
206