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 EncounterLocationStatus { 037 038 /** 039 * The patient is planned to be moved to this location at some point in the 040 * future. 041 */ 042 PLANNED, 043 /** 044 * The patient is currently at this location, or was between the period 045 * specified. 046 * 047 * A system may update these records when the patient leaves the location to 048 * either reserved, or completed. 049 */ 050 ACTIVE, 051 /** 052 * This location is held empty for this patient. 053 */ 054 RESERVED, 055 /** 056 * The patient was at this location during the period specified. 057 * 058 * Not to be used when the patient is currently at the location. 059 */ 060 COMPLETED, 061 /** 062 * added to help the parsers 063 */ 064 NULL; 065 066 public static EncounterLocationStatus fromCode(String codeString) throws FHIRException { 067 if (codeString == null || "".equals(codeString)) 068 return null; 069 if ("planned".equals(codeString)) 070 return PLANNED; 071 if ("active".equals(codeString)) 072 return ACTIVE; 073 if ("reserved".equals(codeString)) 074 return RESERVED; 075 if ("completed".equals(codeString)) 076 return COMPLETED; 077 throw new FHIRException("Unknown EncounterLocationStatus code '" + codeString + "'"); 078 } 079 080 public String toCode() { 081 switch (this) { 082 case PLANNED: 083 return "planned"; 084 case ACTIVE: 085 return "active"; 086 case RESERVED: 087 return "reserved"; 088 case COMPLETED: 089 return "completed"; 090 case NULL: 091 return null; 092 default: 093 return "?"; 094 } 095 } 096 097 public String getSystem() { 098 return "http://hl7.org/fhir/encounter-location-status"; 099 } 100 101 public String getDefinition() { 102 switch (this) { 103 case PLANNED: 104 return "The patient is planned to be moved to this location at some point in the future."; 105 case ACTIVE: 106 return "The patient is currently at this location, or was between the period specified.\r\rA system may update these records when the patient leaves the location to either reserved, or completed."; 107 case RESERVED: 108 return "This location is held empty for this patient."; 109 case COMPLETED: 110 return "The patient was at this location during the period specified.\r\rNot to be used when the patient is currently at the location."; 111 case NULL: 112 return null; 113 default: 114 return "?"; 115 } 116 } 117 118 public String getDisplay() { 119 switch (this) { 120 case PLANNED: 121 return "Planned"; 122 case ACTIVE: 123 return "Active"; 124 case RESERVED: 125 return "Reserved"; 126 case COMPLETED: 127 return "Completed"; 128 case NULL: 129 return null; 130 default: 131 return "?"; 132 } 133 } 134 135}