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 Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034
035import org.hl7.fhir.exceptions.FHIRException;
036
037public enum EncounterAdmitSource {
038
039        /**
040         * The Patient has been transferred from another hospital for this encounter.
041         */
042        HOSPTRANS, 
043        /**
044         * The patient has been transferred from the emergency department within the hospital. This is typically used in the transition to an inpatient encounter
045         */
046        EMD, 
047        /**
048         * The patient has been transferred from an outpatient department within the hospital.
049         */
050        OUTP, 
051        /**
052         * 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)
053         */
054        BORN, 
055        /**
056         * The patient has been admitted due to a referred from a General Practitioner.
057         */
058        GP, 
059        /**
060         * The patient has been admitted due to a referred from a Specialist (as opposed to a General Practitioner).
061         */
062        MP, 
063        /**
064         * The patient has been transferred from a nursing home.
065         */
066        NURSING, 
067        /**
068         * The patient has been transferred from a psychiatric facility.
069         */
070        PSYCH, 
071        /**
072         * The patient has been transferred from a rehabilitiation facility or clinic.
073         */
074        REHAB, 
075        /**
076         * The patient has been admitted from a source otherwise not specified here.
077         */
078        OTHER, 
079        /**
080         * added to help the parsers
081         */
082        NULL;
083        public static EncounterAdmitSource fromCode(String codeString) throws FHIRException {
084            if (codeString == null || "".equals(codeString))
085                return null;
086        if ("hosp-trans".equals(codeString))
087          return HOSPTRANS;
088        if ("emd".equals(codeString))
089          return EMD;
090        if ("outp".equals(codeString))
091          return OUTP;
092        if ("born".equals(codeString))
093          return BORN;
094        if ("gp".equals(codeString))
095          return GP;
096        if ("mp".equals(codeString))
097          return MP;
098        if ("nursing".equals(codeString))
099          return NURSING;
100        if ("psych".equals(codeString))
101          return PSYCH;
102        if ("rehab".equals(codeString))
103          return REHAB;
104        if ("other".equals(codeString))
105          return OTHER;
106        throw new FHIRException("Unknown EncounterAdmitSource code '"+codeString+"'");
107        }
108        public String toCode() {
109          switch (this) {
110            case HOSPTRANS: return "hosp-trans";
111            case EMD: return "emd";
112            case OUTP: return "outp";
113            case BORN: return "born";
114            case GP: return "gp";
115            case MP: return "mp";
116            case NURSING: return "nursing";
117            case PSYCH: return "psych";
118            case REHAB: return "rehab";
119            case OTHER: return "other";
120            default: return "?";
121          }
122        }
123        public String getSystem() {
124          return "http://hl7.org/fhir/admit-source";
125        }
126        public String getDefinition() {
127          switch (this) {
128            case HOSPTRANS: return "The Patient has been transferred from another hospital for this encounter.";
129            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";
130            case OUTP: return "The patient has been transferred from an outpatient department within the hospital.";
131            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)";
132            case GP: return "The patient has been admitted due to a referred from a General Practitioner.";
133            case MP: return "The patient has been admitted due to a referred from a Specialist (as opposed to a General Practitioner).";
134            case NURSING: return "The patient has been transferred from a nursing home.";
135            case PSYCH: return "The patient has been transferred from a psychiatric facility.";
136            case REHAB: return "The patient has been transferred from a rehabilitiation facility or clinic.";
137            case OTHER: return "The patient has been admitted from a source otherwise not specified here.";
138            default: return "?";
139          }
140        }
141        public String getDisplay() {
142          switch (this) {
143            case HOSPTRANS: return "Transferred from other hospital";
144            case EMD: return "From accident/emergency department";
145            case OUTP: return "From outpatient department";
146            case BORN: return "Born in hospital";
147            case GP: return "General Practitioner referral";
148            case MP: return "Medical Practitioner/physician referral";
149            case NURSING: return "From nursing home";
150            case PSYCH: return "From psychiatric hospital";
151            case REHAB: return "From rehabilitation facility";
152            case OTHER: return "Other";
153            default: return "?";
154          }
155    }
156
157
158}
159