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 MedicationdispenseStatusReason {
058
059        /**
060         * The order has been stopped by the prescriber but this fact has not necessarily captured electronically. Example: A verbal stop, a fax, etc.
061         */
062        FRR01, 
063        /**
064         * Order has not been fulfilled within a reasonable amount of time, and might not be current.
065         */
066        FRR02, 
067        /**
068         * Data needed to safely act on the order which was expected to become available independent of the order is not yet available. Example: Lab results, diagnostic imaging, etc.
069         */
070        FRR03, 
071        /**
072         * Product not available or manufactured. Cannot supply.
073         */
074        FRR04, 
075        /**
076         * The dispenser has ethical, religious or moral objections to fulfilling the order/dispensing the product.
077         */
078        FRR05, 
079        /**
080         * Fulfiller not able to provide appropriate care associated with fulfilling the order. Example: Therapy requires ongoing monitoring by fulfiller and fulfiller will be ending practice, leaving town, unable to schedule necessary time, etc.
081         */
082        FRR06, 
083        /**
084         * 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.
085         */
086        ALTCHOICE, 
087        /**
088         * Clarification is required before the order can be acted upon.
089         */
090        CLARIF, 
091        /**
092         * 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.
093         */
094        DRUGHIGH, 
095        /**
096         * The patient has been admitted to a care facility and their community medications are suspended until hospital discharge.
097         */
098        HOSPADM, 
099        /**
100         * The therapy would interfere with a planned lab test and the therapy is being withdrawn until the test is completed.
101         */
102        LABINT, 
103        /**
104         * Patient not available for a period of time due to a scheduled therapy, leave of absence or other reason.
105         */
106        NONAVAIL, 
107        /**
108         * The patient is pregnant or breast feeding. The therapy will be resumed when the pregnancy is complete and the patient is no longer breastfeeding.
109         */
110        PREG, 
111        /**
112         * 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.
113         */
114        SAIG, 
115        /**
116         * 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.
117         */
118        SDDI, 
119        /**
120         * Another short-term co-occurring therapy fulfills the same purpose as this therapy. This therapy will be resumed when the co-occuring therapy is complete.
121         */
122        SDUPTHER, 
123        /**
124         * The patient is believed to have an intolerance to a substance that is part of the therapy and the therapy is being temporarily withdrawn to confirm.
125         */
126        SINTOL, 
127        /**
128         * 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.
129         */
130        SURG, 
131        /**
132         * 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.
133         */
134        WASHOUT, 
135        /**
136         * Drug out of stock. Cannot supply.
137         */
138        OUTOFSTOCK, 
139        /**
140         * Drug no longer marketed Cannot supply.
141         */
142        OFFMARKET, 
143        /**
144         * added to help the parsers
145         */
146        NULL;
147        public static MedicationdispenseStatusReason fromCode(String codeString) throws FHIRException {
148            if (codeString == null || "".equals(codeString))
149                return null;
150        if ("frr01".equals(codeString))
151          return FRR01;
152        if ("frr02".equals(codeString))
153          return FRR02;
154        if ("frr03".equals(codeString))
155          return FRR03;
156        if ("frr04".equals(codeString))
157          return FRR04;
158        if ("frr05".equals(codeString))
159          return FRR05;
160        if ("frr06".equals(codeString))
161          return FRR06;
162        if ("altchoice".equals(codeString))
163          return ALTCHOICE;
164        if ("clarif".equals(codeString))
165          return CLARIF;
166        if ("drughigh".equals(codeString))
167          return DRUGHIGH;
168        if ("hospadm".equals(codeString))
169          return HOSPADM;
170        if ("labint".equals(codeString))
171          return LABINT;
172        if ("non-avail".equals(codeString))
173          return NONAVAIL;
174        if ("preg".equals(codeString))
175          return PREG;
176        if ("saig".equals(codeString))
177          return SAIG;
178        if ("sddi".equals(codeString))
179          return SDDI;
180        if ("sdupther".equals(codeString))
181          return SDUPTHER;
182        if ("sintol".equals(codeString))
183          return SINTOL;
184        if ("surg".equals(codeString))
185          return SURG;
186        if ("washout".equals(codeString))
187          return WASHOUT;
188        if ("outofstock".equals(codeString))
189          return OUTOFSTOCK;
190        if ("offmarket".equals(codeString))
191          return OFFMARKET;
192        throw new FHIRException("Unknown MedicationdispenseStatusReason code '"+codeString+"'");
193        }
194        public String toCode() {
195          switch (this) {
196            case FRR01: return "frr01";
197            case FRR02: return "frr02";
198            case FRR03: return "frr03";
199            case FRR04: return "frr04";
200            case FRR05: return "frr05";
201            case FRR06: return "frr06";
202            case ALTCHOICE: return "altchoice";
203            case CLARIF: return "clarif";
204            case DRUGHIGH: return "drughigh";
205            case HOSPADM: return "hospadm";
206            case LABINT: return "labint";
207            case NONAVAIL: return "non-avail";
208            case PREG: return "preg";
209            case SAIG: return "saig";
210            case SDDI: return "sddi";
211            case SDUPTHER: return "sdupther";
212            case SINTOL: return "sintol";
213            case SURG: return "surg";
214            case WASHOUT: return "washout";
215            case OUTOFSTOCK: return "outofstock";
216            case OFFMARKET: return "offmarket";
217            default: return "?";
218          }
219        }
220        public String getSystem() {
221          return "http://terminology.hl7.org/fhir/CodeSystem/medicationdispense-status-reason";
222        }
223        public String getDefinition() {
224          switch (this) {
225            case FRR01: return "The order has been stopped by the prescriber but this fact has not necessarily captured electronically. Example: A verbal stop, a fax, etc.";
226            case FRR02: return "Order has not been fulfilled within a reasonable amount of time, and might not be current.";
227            case FRR03: return "Data needed to safely act on the order which was expected to become available independent of the order is not yet available. Example: Lab results, diagnostic imaging, etc.";
228            case FRR04: return "Product not available or manufactured. Cannot supply.";
229            case FRR05: return "The dispenser has ethical, religious or moral objections to fulfilling the order/dispensing the product.";
230            case FRR06: return "Fulfiller not able to provide appropriate care associated with fulfilling the order. Example: Therapy requires ongoing monitoring by fulfiller and fulfiller will be ending practice, leaving town, unable to schedule necessary time, etc.";
231            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.";
232            case CLARIF: return "Clarification is required before the order can be acted upon.";
233            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.";
234            case HOSPADM: return "The patient has been admitted to a care facility and their community medications are suspended until hospital discharge.";
235            case LABINT: return "The therapy would interfere with a planned lab test and the therapy is being withdrawn until the test is completed.";
236            case NONAVAIL: return "Patient not available for a period of time due to a scheduled therapy, leave of absence or other reason.";
237            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.";
238            case SAIG: 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.";
239            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.";
240            case SDUPTHER: return "Another short-term co-occurring therapy fulfills the same purpose as this therapy. This therapy will be resumed when the co-occuring therapy is complete.";
241            case SINTOL: return "The patient is believed to have an intolerance to a substance that is part of the therapy and the therapy is being temporarily withdrawn to confirm.";
242            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.";
243            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.";
244            case OUTOFSTOCK: return "Drug out of stock. Cannot supply.";
245            case OFFMARKET: return "Drug no longer marketed Cannot supply.";
246            default: return "?";
247          }
248        }
249        public String getDisplay() {
250          switch (this) {
251            case FRR01: return "Order Stopped";
252            case FRR02: return "Stale-dated Order";
253            case FRR03: return "Incomplete data";
254            case FRR04: return "Product unavailable";
255            case FRR05: return "Ethical/religious";
256            case FRR06: return "Unable to provide care";
257            case ALTCHOICE: return "Try another treatment first";
258            case CLARIF: return "Prescription/Request requires clarification";
259            case DRUGHIGH: return "Drug level too high";
260            case HOSPADM: return "Admission to hospital";
261            case LABINT: return "Lab interference issues";
262            case NONAVAIL: return "Patient not available";
263            case PREG: return "Patient is pregnant or breastfeeding";
264            case SAIG: return "Allergy";
265            case SDDI: return "Drug interacts with another drug";
266            case SDUPTHER: return "Duplicate therapy";
267            case SINTOL: return "Suspected intolerance";
268            case SURG: return "Patient scheduled for surgery";
269            case WASHOUT: return "Washout";
270            case OUTOFSTOCK: return "Drug not available - out of stock";
271            case OFFMARKET: return "Drug not available - off market";
272            default: return "?";
273          }
274    }
275
276
277}
278