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 EndpointStatus {
037
038  /**
039   * This endpoint is expected to be active and can be used.
040   */
041  ACTIVE,
042  /**
043   * This endpoint is temporarily unavailable.
044   */
045  SUSPENDED,
046  /**
047   * This endpoint has exceeded connectivity thresholds and is considered in an
048   * error state and should no longer be attempted to connect to until corrective
049   * action is taken.
050   */
051  ERROR,
052  /**
053   * This endpoint is no longer to be used.
054   */
055  OFF,
056  /**
057   * This instance should not have been part of this patient's medical record.
058   */
059  ENTEREDINERROR,
060  /**
061   * This endpoint is not intended for production usage.
062   */
063  TEST,
064  /**
065   * added to help the parsers
066   */
067  NULL;
068
069  public static EndpointStatus fromCode(String codeString) throws FHIRException {
070    if (codeString == null || "".equals(codeString))
071      return null;
072    if ("active".equals(codeString))
073      return ACTIVE;
074    if ("suspended".equals(codeString))
075      return SUSPENDED;
076    if ("error".equals(codeString))
077      return ERROR;
078    if ("off".equals(codeString))
079      return OFF;
080    if ("entered-in-error".equals(codeString))
081      return ENTEREDINERROR;
082    if ("test".equals(codeString))
083      return TEST;
084    throw new FHIRException("Unknown EndpointStatus code '" + codeString + "'");
085  }
086
087  public String toCode() {
088    switch (this) {
089    case ACTIVE:
090      return "active";
091    case SUSPENDED:
092      return "suspended";
093    case ERROR:
094      return "error";
095    case OFF:
096      return "off";
097    case ENTEREDINERROR:
098      return "entered-in-error";
099    case TEST:
100      return "test";
101    case NULL:
102      return null;
103    default:
104      return "?";
105    }
106  }
107
108  public String getSystem() {
109    return "http://hl7.org/fhir/endpoint-status";
110  }
111
112  public String getDefinition() {
113    switch (this) {
114    case ACTIVE:
115      return "This endpoint is expected to be active and can be used.";
116    case SUSPENDED:
117      return "This endpoint is temporarily unavailable.";
118    case ERROR:
119      return "This endpoint has exceeded connectivity thresholds and is considered in an error state and should no longer be attempted to connect to until corrective action is taken.";
120    case OFF:
121      return "This endpoint is no longer to be used.";
122    case ENTEREDINERROR:
123      return "This instance should not have been part of this patient's medical record.";
124    case TEST:
125      return "This endpoint is not intended for production usage.";
126    case NULL:
127      return null;
128    default:
129      return "?";
130    }
131  }
132
133  public String getDisplay() {
134    switch (this) {
135    case ACTIVE:
136      return "Active";
137    case SUSPENDED:
138      return "Suspended";
139    case ERROR:
140      return "Error";
141    case OFF:
142      return "Off";
143    case ENTEREDINERROR:
144      return "Entered in error";
145    case TEST:
146      return "Test";
147    case NULL:
148      return null;
149    default:
150      return "?";
151    }
152  }
153
154}