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 ListItemFlag {
037
038  /**
039   * No change has been made to the status of this medicine item.
040   */
041  _01,
042  /**
043   * The medicine item has changed. The change may be described in an extension
044   * (not defined yet)
045   */
046  _02,
047  /**
048   * The prescription for this medicine item was cancelled by an authorized health
049   * care provider. The patient may be advised to complete the course of the
050   * prescribed medicine. This advice is a clinical decision made based on
051   * assessment of the patient's clinical condition.
052   */
053  _03,
054  /**
055   * A new medicine item has been prescribed
056   */
057  _04,
058  /**
059   * Administration of this medication item that the patient is currently taking
060   * is stopped or recommended to be stopped (i.e. instructed to be ceased by a
061   * health care provider). This cessation is anticipated to be permanent. The
062   * Change Description should describe the reason for cessation. Example uses:
063   * the medication in question is considered ineffective or has caused serious
064   * adverse effects. This value applies both to the cessation of a medication
065   * that is prescribed by another healthcare provider or patient
066   * self-administration of OTC medicines.
067   */
068  _05,
069  /**
070   * Administration of this medication item that the patient is currently taking
071   * is on hold, or instructed or recommended by a health care provider to be
072   * temporarily stopped, or subject to clinical review (i.e. the stop may be
073   * temporary or permanent depending on the outcome of clinical review), or
074   * temporarily suspended as a pre-requisite to certain surgical or diagnostic
075   * procedures.
076   */
077  _06,
078  /**
079   * added to help the parsers
080   */
081  NULL;
082
083  public static ListItemFlag fromCode(String codeString) throws FHIRException {
084    if (codeString == null || "".equals(codeString))
085      return null;
086    if ("01".equals(codeString))
087      return _01;
088    if ("02".equals(codeString))
089      return _02;
090    if ("03".equals(codeString))
091      return _03;
092    if ("04".equals(codeString))
093      return _04;
094    if ("05".equals(codeString))
095      return _05;
096    if ("06".equals(codeString))
097      return _06;
098    throw new FHIRException("Unknown ListItemFlag code '" + codeString + "'");
099  }
100
101  public String toCode() {
102    switch (this) {
103    case _01:
104      return "01";
105    case _02:
106      return "02";
107    case _03:
108      return "03";
109    case _04:
110      return "04";
111    case _05:
112      return "05";
113    case _06:
114      return "06";
115    case NULL:
116      return null;
117    default:
118      return "?";
119    }
120  }
121
122  public String getSystem() {
123    return "urn:oid:1.2.36.1.2001.1001.101.104.16592";
124  }
125
126  public String getDefinition() {
127    switch (this) {
128    case _01:
129      return "No change has been made to the status of this medicine item.";
130    case _02:
131      return "The medicine item has changed. The change may be described in an extension (not defined yet)";
132    case _03:
133      return "The prescription for this medicine item was cancelled by an authorized health care provider. The patient may be advised to complete the course of the prescribed medicine. This advice is a clinical decision made based on assessment of the patient's clinical condition.";
134    case _04:
135      return "A new medicine item has been prescribed";
136    case _05:
137      return "Administration of this medication item that the patient is currently taking is stopped or recommended to be stopped (i.e. instructed to be ceased by a health care provider). This cessation is anticipated to be permanent. The Change Description should describe the reason for cessation. Example uses: the medication in question is considered ineffective or has caused serious adverse effects. This value applies both to the cessation of a medication that is prescribed by another healthcare provider or patient self-administration of OTC medicines.";
138    case _06:
139      return "Administration of this medication item that the patient is currently taking is on hold, or instructed or recommended by a health care provider to be temporarily stopped, or subject to clinical review (i.e. the stop may be temporary or permanent depending on the outcome of clinical review), or temporarily suspended as a pre-requisite to certain surgical or diagnostic procedures.";
140    case NULL:
141      return null;
142    default:
143      return "?";
144    }
145  }
146
147  public String getDisplay() {
148    switch (this) {
149    case _01:
150      return "Unchanged";
151    case _02:
152      return "Changed";
153    case _03:
154      return "Cancelled";
155    case _04:
156      return "Prescribed";
157    case _05:
158      return "Ceased";
159    case _06:
160      return "Suspended";
161    case NULL:
162      return null;
163    default:
164      return "?";
165    }
166  }
167
168}