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 DeviceStatusReason {
037
038  /**
039   * The device is off.
040   */
041  ONLINE,
042  /**
043   * The device is paused.
044   */
045  PAUSED,
046  /**
047   * The device is ready but not actively operating.
048   */
049  STANDBY,
050  /**
051   * The device is offline.
052   */
053  OFFLINE,
054  /**
055   * The device is not ready.
056   */
057  NOTREADY,
058  /**
059   * The device transducer is disconnected.
060   */
061  TRANSDUCDISCON,
062  /**
063   * The device hardware is disconnected.
064   */
065  HWDISCON,
066  /**
067   * The device is off.
068   */
069  OFF,
070  /**
071   * added to help the parsers
072   */
073  NULL;
074
075  public static DeviceStatusReason fromCode(String codeString) throws FHIRException {
076    if (codeString == null || "".equals(codeString))
077      return null;
078    if ("online".equals(codeString))
079      return ONLINE;
080    if ("paused".equals(codeString))
081      return PAUSED;
082    if ("standby".equals(codeString))
083      return STANDBY;
084    if ("offline".equals(codeString))
085      return OFFLINE;
086    if ("not-ready".equals(codeString))
087      return NOTREADY;
088    if ("transduc-discon".equals(codeString))
089      return TRANSDUCDISCON;
090    if ("hw-discon".equals(codeString))
091      return HWDISCON;
092    if ("off".equals(codeString))
093      return OFF;
094    throw new FHIRException("Unknown DeviceStatusReason code '" + codeString + "'");
095  }
096
097  public String toCode() {
098    switch (this) {
099    case ONLINE:
100      return "online";
101    case PAUSED:
102      return "paused";
103    case STANDBY:
104      return "standby";
105    case OFFLINE:
106      return "offline";
107    case NOTREADY:
108      return "not-ready";
109    case TRANSDUCDISCON:
110      return "transduc-discon";
111    case HWDISCON:
112      return "hw-discon";
113    case OFF:
114      return "off";
115    case NULL:
116      return null;
117    default:
118      return "?";
119    }
120  }
121
122  public String getSystem() {
123    return "http://terminology.hl7.org/CodeSystem/device-status-reason";
124  }
125
126  public String getDefinition() {
127    switch (this) {
128    case ONLINE:
129      return "The device is off.";
130    case PAUSED:
131      return "The device is paused.";
132    case STANDBY:
133      return "The device is ready but not actively operating.";
134    case OFFLINE:
135      return "The device is offline.";
136    case NOTREADY:
137      return "The device is not ready.";
138    case TRANSDUCDISCON:
139      return "The device transducer is disconnected.";
140    case HWDISCON:
141      return "The device hardware is disconnected.";
142    case OFF:
143      return "The device is off.";
144    case NULL:
145      return null;
146    default:
147      return "?";
148    }
149  }
150
151  public String getDisplay() {
152    switch (this) {
153    case ONLINE:
154      return "Online";
155    case PAUSED:
156      return "Paused";
157    case STANDBY:
158      return "Standby";
159    case OFFLINE:
160      return "Offline";
161    case NOTREADY:
162      return "Not Ready";
163    case TRANSDUCDISCON:
164      return "Transducer Disconnected";
165    case HWDISCON:
166      return "Hardware Disconnected";
167    case OFF:
168      return "Off";
169    case NULL:
170      return null;
171    default:
172      return "?";
173    }
174  }
175
176}