001package org.hl7.fhir.r5.model.codesystems; 002 003/* 004 * #%L 005 * org.hl7.fhir.r5 006 * %% 007 * Copyright (C) 2014 - 2019 Health Level 7 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023/* 024 Copyright (c) 2011+, HL7, Inc. 025 All rights reserved. 026 027 Redistribution and use in source and binary forms, with or without modification, 028 are permitted provided that the following conditions are met: 029 030 * Redistributions of source code must retain the above copyright notice, this 031 list of conditions and the following disclaimer. 032 * Redistributions in binary form must reproduce the above copyright notice, 033 this list of conditions and the following disclaimer in the documentation 034 and/or other materials provided with the distribution. 035 * Neither the name of HL7 nor the names of its contributors may be used to 036 endorse or promote products derived from this software without specific 037 prior written permission. 038 039 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 040 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 041 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 042 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 043 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 044 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 045 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 046 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 047 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 048 POSSIBILITY OF SUCH DAMAGE. 049 050*/ 051 052// Generated on Thu, Oct 17, 2019 09:42+1100 for FHIR v4.1.0 053 054 055import org.hl7.fhir.exceptions.FHIRException; 056 057public enum EncounterAdmitSource { 058 059 /** 060 * The Patient has been transferred from another hospital for this encounter. 061 */ 062 HOSPTRANS, 063 /** 064 * The patient has been transferred from the emergency department within the hospital. This is typically used in the transition to an inpatient encounter 065 */ 066 EMD, 067 /** 068 * The patient has been transferred from an outpatient department within the hospital. 069 */ 070 OUTP, 071 /** 072 * The patient is a newborn and the encounter will track the baby related activities (as opposed to the Mothers encounter - that may be associated using the newborn encounters partof property) 073 */ 074 BORN, 075 /** 076 * The patient has been admitted due to a referred from a General Practitioner. 077 */ 078 GP, 079 /** 080 * The patient has been admitted due to a referred from a Specialist (as opposed to a General Practitioner). 081 */ 082 MP, 083 /** 084 * The patient has been transferred from a nursing home. 085 */ 086 NURSING, 087 /** 088 * The patient has been transferred from a psychiatric facility. 089 */ 090 PSYCH, 091 /** 092 * The patient has been transferred from a rehabilitation facility or clinic. 093 */ 094 REHAB, 095 /** 096 * The patient has been admitted from a source otherwise not specified here. 097 */ 098 OTHER, 099 /** 100 * added to help the parsers 101 */ 102 NULL; 103 public static EncounterAdmitSource fromCode(String codeString) throws FHIRException { 104 if (codeString == null || "".equals(codeString)) 105 return null; 106 if ("hosp-trans".equals(codeString)) 107 return HOSPTRANS; 108 if ("emd".equals(codeString)) 109 return EMD; 110 if ("outp".equals(codeString)) 111 return OUTP; 112 if ("born".equals(codeString)) 113 return BORN; 114 if ("gp".equals(codeString)) 115 return GP; 116 if ("mp".equals(codeString)) 117 return MP; 118 if ("nursing".equals(codeString)) 119 return NURSING; 120 if ("psych".equals(codeString)) 121 return PSYCH; 122 if ("rehab".equals(codeString)) 123 return REHAB; 124 if ("other".equals(codeString)) 125 return OTHER; 126 throw new FHIRException("Unknown EncounterAdmitSource code '"+codeString+"'"); 127 } 128 public String toCode() { 129 switch (this) { 130 case HOSPTRANS: return "hosp-trans"; 131 case EMD: return "emd"; 132 case OUTP: return "outp"; 133 case BORN: return "born"; 134 case GP: return "gp"; 135 case MP: return "mp"; 136 case NURSING: return "nursing"; 137 case PSYCH: return "psych"; 138 case REHAB: return "rehab"; 139 case OTHER: return "other"; 140 default: return "?"; 141 } 142 } 143 public String getSystem() { 144 return "http://terminology.hl7.org/CodeSystem/admit-source"; 145 } 146 public String getDefinition() { 147 switch (this) { 148 case HOSPTRANS: return "The Patient has been transferred from another hospital for this encounter."; 149 case EMD: return "The patient has been transferred from the emergency department within the hospital. This is typically used in the transition to an inpatient encounter"; 150 case OUTP: return "The patient has been transferred from an outpatient department within the hospital."; 151 case BORN: return "The patient is a newborn and the encounter will track the baby related activities (as opposed to the Mothers encounter - that may be associated using the newborn encounters partof property)"; 152 case GP: return "The patient has been admitted due to a referred from a General Practitioner."; 153 case MP: return "The patient has been admitted due to a referred from a Specialist (as opposed to a General Practitioner)."; 154 case NURSING: return "The patient has been transferred from a nursing home."; 155 case PSYCH: return "The patient has been transferred from a psychiatric facility."; 156 case REHAB: return "The patient has been transferred from a rehabilitation facility or clinic."; 157 case OTHER: return "The patient has been admitted from a source otherwise not specified here."; 158 default: return "?"; 159 } 160 } 161 public String getDisplay() { 162 switch (this) { 163 case HOSPTRANS: return "Transferred from other hospital"; 164 case EMD: return "From accident/emergency department"; 165 case OUTP: return "From outpatient department"; 166 case BORN: return "Born in hospital"; 167 case GP: return "General Practitioner referral"; 168 case MP: return "Medical Practitioner/physician referral"; 169 case NURSING: return "From nursing home"; 170 case PSYCH: return "From psychiatric hospital"; 171 case REHAB: return "From rehabilitation facility"; 172 case OTHER: return "Other"; 173 default: return "?"; 174 } 175 } 176 177 178} 179