001package org.hl7.fhir.dstu2016may.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 Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0
036
037
038import org.hl7.fhir.exceptions.FHIRException;
039
040public enum EncounterClass {
041
042        /**
043         * An encounter during which the patient is hospitalized and stays overnight.
044         */
045        INPATIENT, 
046        /**
047         * An encounter during which the patient is not hospitalized overnight.
048         */
049        OUTPATIENT, 
050        /**
051         * An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit.
052         */
053        AMBULATORY, 
054        /**
055         * An encounter in the Emergency Care Department.
056         */
057        EMERGENCY, 
058        /**
059         * An encounter where the practitioner visits the patient at his/her home.
060         */
061        HOME, 
062        /**
063         * An encounter taking place outside the regular environment for giving care.
064         */
065        FIELD, 
066        /**
067         * An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight.
068         */
069        DAYTIME, 
070        /**
071         * An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact.
072         */
073        VIRTUAL, 
074        /**
075         * Any other encounter type that is not described by one of the other values. Where this is used it is expected that an implementer will include an extension value to define what the actual other type is.
076         */
077        OTHER, 
078        /**
079         * added to help the parsers
080         */
081        NULL;
082        public static EncounterClass fromCode(String codeString) throws FHIRException {
083            if (codeString == null || "".equals(codeString))
084                return null;
085        if ("inpatient".equals(codeString))
086          return INPATIENT;
087        if ("outpatient".equals(codeString))
088          return OUTPATIENT;
089        if ("ambulatory".equals(codeString))
090          return AMBULATORY;
091        if ("emergency".equals(codeString))
092          return EMERGENCY;
093        if ("home".equals(codeString))
094          return HOME;
095        if ("field".equals(codeString))
096          return FIELD;
097        if ("daytime".equals(codeString))
098          return DAYTIME;
099        if ("virtual".equals(codeString))
100          return VIRTUAL;
101        if ("other".equals(codeString))
102          return OTHER;
103        throw new FHIRException("Unknown EncounterClass code '"+codeString+"'");
104        }
105        public String toCode() {
106          switch (this) {
107            case INPATIENT: return "inpatient";
108            case OUTPATIENT: return "outpatient";
109            case AMBULATORY: return "ambulatory";
110            case EMERGENCY: return "emergency";
111            case HOME: return "home";
112            case FIELD: return "field";
113            case DAYTIME: return "daytime";
114            case VIRTUAL: return "virtual";
115            case OTHER: return "other";
116            case NULL: return null;
117            default: return "?";
118          }
119        }
120        public String getSystem() {
121          return "http://hl7.org/fhir/encounter-class";
122        }
123        public String getDefinition() {
124          switch (this) {
125            case INPATIENT: return "An encounter during which the patient is hospitalized and stays overnight.";
126            case OUTPATIENT: return "An encounter during which the patient is not hospitalized overnight.";
127            case AMBULATORY: return "An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit.";
128            case EMERGENCY: return "An encounter in the Emergency Care Department.";
129            case HOME: return "An encounter where the practitioner visits the patient at his/her home.";
130            case FIELD: return "An encounter taking place outside the regular environment for giving care.";
131            case DAYTIME: return "An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight.";
132            case VIRTUAL: return "An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact.";
133            case OTHER: return "Any other encounter type that is not described by one of the other values. Where this is used it is expected that an implementer will include an extension value to define what the actual other type is.";
134            case NULL: return null;
135            default: return "?";
136          }
137        }
138        public String getDisplay() {
139          switch (this) {
140            case INPATIENT: return "Inpatient";
141            case OUTPATIENT: return "Outpatient";
142            case AMBULATORY: return "Ambulatory";
143            case EMERGENCY: return "Emergency";
144            case HOME: return "Home";
145            case FIELD: return "Field";
146            case DAYTIME: return "Daytime";
147            case VIRTUAL: return "Virtual";
148            case OTHER: return "Other";
149            case NULL: return null;
150            default: return "?";
151          }
152    }
153
154
155}