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 V3ActStatus {
037
038  /**
039   * Encompasses the expected states of an Act, but excludes "nullified" and
040   * "obsolete" which represent unusual terminal states for the life-cycle.
041   */
042  NORMAL,
043  /**
044   * The Act has been terminated prior to the originally intended completion.
045   */
046  ABORTED,
047  /**
048   * The Act can be performed or is being performed
049   */
050  ACTIVE,
051  /**
052   * The Act has been abandoned before activation.
053   */
054  CANCELLED,
055  /**
056   * An Act that has terminated normally after all of its constituents have been
057   * performed.
058   */
059  COMPLETED,
060  /**
061   * An Act that is still in the preparatory stages has been put aside. No action
062   * can occur until the Act is released.
063   */
064  HELD,
065  /**
066   * An Act that is in the preparatory stages and may not yet be acted upon
067   */
068  NEW,
069  /**
070   * An Act that has been activated (actions could or have been performed against
071   * it), but has been temporarily disabled. No further action should be taken
072   * against it until it is released
073   */
074  SUSPENDED,
075  /**
076   * This Act instance was created in error and has been 'removed' and is treated
077   * as though it never existed. A record is retained for audit purposes only.
078   */
079  NULLIFIED,
080  /**
081   * This Act instance has been replaced by a new instance.
082   */
083  OBSOLETE,
084  /**
085   * added to help the parsers
086   */
087  NULL;
088
089  public static V3ActStatus fromCode(String codeString) throws FHIRException {
090    if (codeString == null || "".equals(codeString))
091      return null;
092    if ("normal".equals(codeString))
093      return NORMAL;
094    if ("aborted".equals(codeString))
095      return ABORTED;
096    if ("active".equals(codeString))
097      return ACTIVE;
098    if ("cancelled".equals(codeString))
099      return CANCELLED;
100    if ("completed".equals(codeString))
101      return COMPLETED;
102    if ("held".equals(codeString))
103      return HELD;
104    if ("new".equals(codeString))
105      return NEW;
106    if ("suspended".equals(codeString))
107      return SUSPENDED;
108    if ("nullified".equals(codeString))
109      return NULLIFIED;
110    if ("obsolete".equals(codeString))
111      return OBSOLETE;
112    throw new FHIRException("Unknown V3ActStatus code '" + codeString + "'");
113  }
114
115  public String toCode() {
116    switch (this) {
117    case NORMAL:
118      return "normal";
119    case ABORTED:
120      return "aborted";
121    case ACTIVE:
122      return "active";
123    case CANCELLED:
124      return "cancelled";
125    case COMPLETED:
126      return "completed";
127    case HELD:
128      return "held";
129    case NEW:
130      return "new";
131    case SUSPENDED:
132      return "suspended";
133    case NULLIFIED:
134      return "nullified";
135    case OBSOLETE:
136      return "obsolete";
137    case NULL:
138      return null;
139    default:
140      return "?";
141    }
142  }
143
144  public String getSystem() {
145    return "http://terminology.hl7.org/CodeSystem/v3-ActStatus";
146  }
147
148  public String getDefinition() {
149    switch (this) {
150    case NORMAL:
151      return "Encompasses the expected states of an Act, but excludes \"nullified\" and \"obsolete\" which represent unusual terminal states for the life-cycle.";
152    case ABORTED:
153      return "The Act has been terminated prior to the originally intended completion.";
154    case ACTIVE:
155      return "The Act can be performed or is being performed";
156    case CANCELLED:
157      return "The Act has been abandoned before activation.";
158    case COMPLETED:
159      return "An Act that has terminated normally after all of its constituents have been performed.";
160    case HELD:
161      return "An Act that is still in the preparatory stages has been put aside.  No action can occur until the Act is released.";
162    case NEW:
163      return "An Act that is in the preparatory stages and may not yet be acted upon";
164    case SUSPENDED:
165      return "An Act that has been activated (actions could or have been performed against it), but has been temporarily disabled.  No further action should be taken against it until it is released";
166    case NULLIFIED:
167      return "This Act instance was created in error and has been 'removed' and is treated as though it never existed.  A record is retained for audit purposes only.";
168    case OBSOLETE:
169      return "This Act instance has been replaced by a new instance.";
170    case NULL:
171      return null;
172    default:
173      return "?";
174    }
175  }
176
177  public String getDisplay() {
178    switch (this) {
179    case NORMAL:
180      return "normal";
181    case ABORTED:
182      return "aborted";
183    case ACTIVE:
184      return "active";
185    case CANCELLED:
186      return "cancelled";
187    case COMPLETED:
188      return "completed";
189    case HELD:
190      return "held";
191    case NEW:
192      return "new";
193    case SUSPENDED:
194      return "suspended";
195    case NULLIFIED:
196      return "nullified";
197    case OBSOLETE:
198      return "obsolete";
199    case NULL:
200      return null;
201    default:
202      return "?";
203    }
204  }
205
206}