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 Appointmentstatus {
037
038  /**
039   * None of the participant(s) have finalized their acceptance of the appointment
040   * request, and the start/end time might not be set yet.
041   */
042  PROPOSED,
043  /**
044   * Some or all of the participant(s) have not finalized their acceptance of the
045   * appointment request.
046   */
047  PENDING,
048  /**
049   * All participant(s) have been considered and the appointment is confirmed to
050   * go ahead at the date/times specified.
051   */
052  BOOKED,
053  /**
054   * The patient/patients has/have arrived and is/are waiting to be seen.
055   */
056  ARRIVED,
057  /**
058   * The planning stages of the appointment are now complete, the encounter
059   * resource will exist and will track further status changes. Note that an
060   * encounter may exist before the appointment status is fulfilled for many
061   * reasons.
062   */
063  FULFILLED,
064  /**
065   * The appointment has been cancelled.
066   */
067  CANCELLED,
068  /**
069   * Some or all of the participant(s) have not/did not appear for the appointment
070   * (usually the patient).
071   */
072  NOSHOW,
073  /**
074   * This instance should not have been part of this patient's medical record.
075   */
076  ENTEREDINERROR,
077  /**
078   * When checked in, all pre-encounter administrative work is complete, and the
079   * encounter may begin. (where multiple patients are involved, they are all
080   * present).
081   */
082  CHECKEDIN,
083  /**
084   * The appointment has been placed on a waitlist, to be scheduled/confirmed in
085   * the future when a slot/service is available. A specific time might or might
086   * not be pre-allocated.
087   */
088  WAITLIST,
089  /**
090   * added to help the parsers
091   */
092  NULL;
093
094  public static Appointmentstatus fromCode(String codeString) throws FHIRException {
095    if (codeString == null || "".equals(codeString))
096      return null;
097    if ("proposed".equals(codeString))
098      return PROPOSED;
099    if ("pending".equals(codeString))
100      return PENDING;
101    if ("booked".equals(codeString))
102      return BOOKED;
103    if ("arrived".equals(codeString))
104      return ARRIVED;
105    if ("fulfilled".equals(codeString))
106      return FULFILLED;
107    if ("cancelled".equals(codeString))
108      return CANCELLED;
109    if ("noshow".equals(codeString))
110      return NOSHOW;
111    if ("entered-in-error".equals(codeString))
112      return ENTEREDINERROR;
113    if ("checked-in".equals(codeString))
114      return CHECKEDIN;
115    if ("waitlist".equals(codeString))
116      return WAITLIST;
117    throw new FHIRException("Unknown Appointmentstatus code '" + codeString + "'");
118  }
119
120  public String toCode() {
121    switch (this) {
122    case PROPOSED:
123      return "proposed";
124    case PENDING:
125      return "pending";
126    case BOOKED:
127      return "booked";
128    case ARRIVED:
129      return "arrived";
130    case FULFILLED:
131      return "fulfilled";
132    case CANCELLED:
133      return "cancelled";
134    case NOSHOW:
135      return "noshow";
136    case ENTEREDINERROR:
137      return "entered-in-error";
138    case CHECKEDIN:
139      return "checked-in";
140    case WAITLIST:
141      return "waitlist";
142    case NULL:
143      return null;
144    default:
145      return "?";
146    }
147  }
148
149  public String getSystem() {
150    return "http://hl7.org/fhir/appointmentstatus";
151  }
152
153  public String getDefinition() {
154    switch (this) {
155    case PROPOSED:
156      return "None of the participant(s) have finalized their acceptance of the appointment request, and the start/end time might not be set yet.";
157    case PENDING:
158      return "Some or all of the participant(s) have not finalized their acceptance of the appointment request.";
159    case BOOKED:
160      return "All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times specified.";
161    case ARRIVED:
162      return "The patient/patients has/have arrived and is/are waiting to be seen.";
163    case FULFILLED:
164      return "The planning stages of the appointment are now complete, the encounter resource will exist and will track further status changes. Note that an encounter may exist before the appointment status is fulfilled for many reasons.";
165    case CANCELLED:
166      return "The appointment has been cancelled.";
167    case NOSHOW:
168      return "Some or all of the participant(s) have not/did not appear for the appointment (usually the patient).";
169    case ENTEREDINERROR:
170      return "This instance should not have been part of this patient's medical record.";
171    case CHECKEDIN:
172      return "When checked in, all pre-encounter administrative work is complete, and the encounter may begin. (where multiple patients are involved, they are all present).";
173    case WAITLIST:
174      return "The appointment has been placed on a waitlist, to be scheduled/confirmed in the future when a slot/service is available.\nA specific time might or might not be pre-allocated.";
175    case NULL:
176      return null;
177    default:
178      return "?";
179    }
180  }
181
182  public String getDisplay() {
183    switch (this) {
184    case PROPOSED:
185      return "Proposed";
186    case PENDING:
187      return "Pending";
188    case BOOKED:
189      return "Booked";
190    case ARRIVED:
191      return "Arrived";
192    case FULFILLED:
193      return "Fulfilled";
194    case CANCELLED:
195      return "Cancelled";
196    case NOSHOW:
197      return "No Show";
198    case ENTEREDINERROR:
199      return "Entered in error";
200    case CHECKEDIN:
201      return "Checked In";
202    case WAITLIST:
203      return "Waitlisted";
204    case NULL:
205      return null;
206    default:
207      return "?";
208    }
209  }
210
211}