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 FlagCategory {
041
042        /**
043         * Flags related to the subject's dietary needs.
044         */
045        DIET, 
046        /**
047         * Flags related to the subject's medications.
048         */
049        DRUG, 
050        /**
051         * Flags related to performing laboratory tests and related processes (e.g. phlebotomy).
052         */
053        LAB, 
054        /**
055         * Flags related to administrative and financial processes.
056         */
057        ADMIN, 
058        /**
059         * Flags related to coming into contact with the patient.
060         */
061        CONTACT, 
062        /**
063         * Flags related to the subject's clinical data.
064         */
065        CLINICAL, 
066        /**
067         * Flags related to behavior.
068         */
069        BEHAVIORAL, 
070        /**
071         * Flags related to research.
072         */
073        RESEARCH, 
074        /**
075         * Flags related to subject's advance directives.
076         */
077        ADVANCEDIRECTIVE, 
078        /**
079         * Flags related to safety precautions.
080         */
081        SAFETY, 
082        /**
083         * added to help the parsers
084         */
085        NULL;
086        public static FlagCategory fromCode(String codeString) throws FHIRException {
087            if (codeString == null || "".equals(codeString))
088                return null;
089        if ("diet".equals(codeString))
090          return DIET;
091        if ("drug".equals(codeString))
092          return DRUG;
093        if ("lab".equals(codeString))
094          return LAB;
095        if ("admin".equals(codeString))
096          return ADMIN;
097        if ("contact".equals(codeString))
098          return CONTACT;
099        if ("clinical".equals(codeString))
100          return CLINICAL;
101        if ("behavioral".equals(codeString))
102          return BEHAVIORAL;
103        if ("research".equals(codeString))
104          return RESEARCH;
105        if ("advance-directive".equals(codeString))
106          return ADVANCEDIRECTIVE;
107        if ("safety".equals(codeString))
108          return SAFETY;
109        throw new FHIRException("Unknown FlagCategory code '"+codeString+"'");
110        }
111        public String toCode() {
112          switch (this) {
113            case DIET: return "diet";
114            case DRUG: return "drug";
115            case LAB: return "lab";
116            case ADMIN: return "admin";
117            case CONTACT: return "contact";
118            case CLINICAL: return "clinical";
119            case BEHAVIORAL: return "behavioral";
120            case RESEARCH: return "research";
121            case ADVANCEDIRECTIVE: return "advance-directive";
122            case SAFETY: return "safety";
123            default: return "?";
124          }
125        }
126        public String getSystem() {
127          return "http://terminology.hl7.org/CodeSystem/flag-category";
128        }
129        public String getDefinition() {
130          switch (this) {
131            case DIET: return "Flags related to the subject's dietary needs.";
132            case DRUG: return "Flags related to the subject's medications.";
133            case LAB: return "Flags related to performing laboratory tests and related processes (e.g. phlebotomy).";
134            case ADMIN: return "Flags related to administrative and financial processes.";
135            case CONTACT: return "Flags related to coming into contact with the patient.";
136            case CLINICAL: return "Flags related to the subject's clinical data.";
137            case BEHAVIORAL: return "Flags related to behavior.";
138            case RESEARCH: return "Flags related to research.";
139            case ADVANCEDIRECTIVE: return "Flags related to subject's advance directives.";
140            case SAFETY: return "Flags related to safety precautions.";
141            default: return "?";
142          }
143        }
144        public String getDisplay() {
145          switch (this) {
146            case DIET: return "Diet";
147            case DRUG: return "Drug";
148            case LAB: return "Lab";
149            case ADMIN: return "Administrative";
150            case CONTACT: return "Subject Contact";
151            case CLINICAL: return "Clinical";
152            case BEHAVIORAL: return "Behavioral";
153            case RESEARCH: return "Research";
154            case ADVANCEDIRECTIVE: return "Advance Directive";
155            case SAFETY: return "Safety";
156            default: return "?";
157          }
158    }
159
160
161}