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 Slotstatus {
037
038  /**
039   * Indicates that the time interval is busy because one or more events have been
040   * scheduled for that interval.
041   */
042  BUSY,
043  /**
044   * Indicates that the time interval is free for scheduling.
045   */
046  FREE,
047  /**
048   * Indicates that the time interval is busy and that the interval cannot be
049   * scheduled.
050   */
051  BUSYUNAVAILABLE,
052  /**
053   * Indicates that the time interval is busy because one or more events have been
054   * tentatively scheduled for that interval.
055   */
056  BUSYTENTATIVE,
057  /**
058   * This instance should not have been part of this patient's medical record.
059   */
060  ENTEREDINERROR,
061  /**
062   * added to help the parsers
063   */
064  NULL;
065
066  public static Slotstatus fromCode(String codeString) throws FHIRException {
067    if (codeString == null || "".equals(codeString))
068      return null;
069    if ("busy".equals(codeString))
070      return BUSY;
071    if ("free".equals(codeString))
072      return FREE;
073    if ("busy-unavailable".equals(codeString))
074      return BUSYUNAVAILABLE;
075    if ("busy-tentative".equals(codeString))
076      return BUSYTENTATIVE;
077    if ("entered-in-error".equals(codeString))
078      return ENTEREDINERROR;
079    throw new FHIRException("Unknown Slotstatus code '" + codeString + "'");
080  }
081
082  public String toCode() {
083    switch (this) {
084    case BUSY:
085      return "busy";
086    case FREE:
087      return "free";
088    case BUSYUNAVAILABLE:
089      return "busy-unavailable";
090    case BUSYTENTATIVE:
091      return "busy-tentative";
092    case ENTEREDINERROR:
093      return "entered-in-error";
094    case NULL:
095      return null;
096    default:
097      return "?";
098    }
099  }
100
101  public String getSystem() {
102    return "http://hl7.org/fhir/slotstatus";
103  }
104
105  public String getDefinition() {
106    switch (this) {
107    case BUSY:
108      return "Indicates that the time interval is busy because one  or more events have been scheduled for that interval.";
109    case FREE:
110      return "Indicates that the time interval is free for scheduling.";
111    case BUSYUNAVAILABLE:
112      return "Indicates that the time interval is busy and that the interval cannot be scheduled.";
113    case BUSYTENTATIVE:
114      return "Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval.";
115    case ENTEREDINERROR:
116      return "This instance should not have been part of this patient's medical record.";
117    case NULL:
118      return null;
119    default:
120      return "?";
121    }
122  }
123
124  public String getDisplay() {
125    switch (this) {
126    case BUSY:
127      return "Busy";
128    case FREE:
129      return "Free";
130    case BUSYUNAVAILABLE:
131      return "Busy (Unavailable)";
132    case BUSYTENTATIVE:
133      return "Busy (Tentative)";
134    case ENTEREDINERROR:
135      return "Entered in error";
136    case NULL:
137      return null;
138    default:
139      return "?";
140    }
141  }
142
143}