001package org.hl7.fhir.r4.model.codesystems;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0
036
037
038import org.hl7.fhir.exceptions.FHIRException;
039
040public enum EncounterDischargeDisposition {
041
042        /**
043         * The patient was dicharged and has indicated that they are going to return home afterwards.
044         */
045        HOME, 
046        /**
047         * The patient was discharged and has indicated that they are going to return home afterwards, but not the patient's home - e.g. a family member's home.
048         */
049        ALTHOME, 
050        /**
051         * The patient was transferred to another healthcare facility.
052         */
053        OTHERHCF, 
054        /**
055         * The patient has been discharged into palliative care.
056         */
057        HOSP, 
058        /**
059         * The patient has been discharged into long-term care where is likely to be monitored through an ongoing episode-of-care.
060         */
061        LONG, 
062        /**
063         * The patient self discharged against medical advice.
064         */
065        AADVICE, 
066        /**
067         * The patient has deceased during this encounter.
068         */
069        EXP, 
070        /**
071         * The patient has been transferred to a psychiatric facility.
072         */
073        PSY, 
074        /**
075         * The patient was discharged and is to receive post acute care rehabilitation services.
076         */
077        REHAB, 
078        /**
079         * The patient has been discharged to a skilled nursing facility for the patient to receive additional care.
080         */
081        SNF, 
082        /**
083         * The discharge disposition has not otherwise defined.
084         */
085        OTH, 
086        /**
087         * added to help the parsers
088         */
089        NULL;
090        public static EncounterDischargeDisposition fromCode(String codeString) throws FHIRException {
091            if (codeString == null || "".equals(codeString))
092                return null;
093        if ("home".equals(codeString))
094          return HOME;
095        if ("alt-home".equals(codeString))
096          return ALTHOME;
097        if ("other-hcf".equals(codeString))
098          return OTHERHCF;
099        if ("hosp".equals(codeString))
100          return HOSP;
101        if ("long".equals(codeString))
102          return LONG;
103        if ("aadvice".equals(codeString))
104          return AADVICE;
105        if ("exp".equals(codeString))
106          return EXP;
107        if ("psy".equals(codeString))
108          return PSY;
109        if ("rehab".equals(codeString))
110          return REHAB;
111        if ("snf".equals(codeString))
112          return SNF;
113        if ("oth".equals(codeString))
114          return OTH;
115        throw new FHIRException("Unknown EncounterDischargeDisposition code '"+codeString+"'");
116        }
117        public String toCode() {
118          switch (this) {
119            case HOME: return "home";
120            case ALTHOME: return "alt-home";
121            case OTHERHCF: return "other-hcf";
122            case HOSP: return "hosp";
123            case LONG: return "long";
124            case AADVICE: return "aadvice";
125            case EXP: return "exp";
126            case PSY: return "psy";
127            case REHAB: return "rehab";
128            case SNF: return "snf";
129            case OTH: return "oth";
130            default: return "?";
131          }
132        }
133        public String getSystem() {
134          return "http://terminology.hl7.org/CodeSystem/discharge-disposition";
135        }
136        public String getDefinition() {
137          switch (this) {
138            case HOME: return "The patient was dicharged and has indicated that they are going to return home afterwards.";
139            case ALTHOME: return "The patient was discharged and has indicated that they are going to return home afterwards, but not the patient's home - e.g. a family member's home.";
140            case OTHERHCF: return "The patient was transferred to another healthcare facility.";
141            case HOSP: return "The patient has been discharged into palliative care.";
142            case LONG: return "The patient has been discharged into long-term care where is likely to be monitored through an ongoing episode-of-care.";
143            case AADVICE: return "The patient self discharged against medical advice.";
144            case EXP: return "The patient has deceased during this encounter.";
145            case PSY: return "The patient has been transferred to a psychiatric facility.";
146            case REHAB: return "The patient was discharged and is to receive post acute care rehabilitation services.";
147            case SNF: return "The patient has been discharged to a skilled nursing facility for the patient to receive additional care.";
148            case OTH: return "The discharge disposition has not otherwise defined.";
149            default: return "?";
150          }
151        }
152        public String getDisplay() {
153          switch (this) {
154            case HOME: return "Home";
155            case ALTHOME: return "Alternative home";
156            case OTHERHCF: return "Other healthcare facility";
157            case HOSP: return "Hospice";
158            case LONG: return "Long-term care";
159            case AADVICE: return "Left against advice";
160            case EXP: return "Expired";
161            case PSY: return "Psychiatric hospital";
162            case REHAB: return "Rehabilitation";
163            case SNF: return "Skilled nursing facility";
164            case OTH: return "Other";
165            default: return "?";
166          }
167    }
168
169
170}