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 PermittedDataType {
041
042        /**
043         * A measured amount.
044         */
045        QUANTITY, 
046        /**
047         * A coded concept from a reference terminology and/or text.
048         */
049        CODEABLECONCEPT, 
050        /**
051         * A sequence of Unicode characters.
052         */
053        STRING, 
054        /**
055         * true or false.
056         */
057        BOOLEAN, 
058        /**
059         * A signed integer.
060         */
061        INTEGER, 
062        /**
063         * A set of values bounded by low and high.
064         */
065        RANGE, 
066        /**
067         * A ratio of two Quantity values - a numerator and a denominator.
068         */
069        RATIO, 
070        /**
071         * A series of measurements taken by a device.
072         */
073        SAMPLEDDATA, 
074        /**
075         * A time during the day, in the format hh:mm:ss.
076         */
077        TIME, 
078        /**
079         * A date, date-time or partial date (e.g. just year or year + month) as used in human communication.
080         */
081        DATETIME, 
082        /**
083         * A time range defined by start and end date/time.
084         */
085        PERIOD, 
086        /**
087         * added to help the parsers
088         */
089        NULL;
090        public static PermittedDataType fromCode(String codeString) throws FHIRException {
091            if (codeString == null || "".equals(codeString))
092                return null;
093        if ("Quantity".equals(codeString))
094          return QUANTITY;
095        if ("CodeableConcept".equals(codeString))
096          return CODEABLECONCEPT;
097        if ("string".equals(codeString))
098          return STRING;
099        if ("boolean".equals(codeString))
100          return BOOLEAN;
101        if ("integer".equals(codeString))
102          return INTEGER;
103        if ("Range".equals(codeString))
104          return RANGE;
105        if ("Ratio".equals(codeString))
106          return RATIO;
107        if ("SampledData".equals(codeString))
108          return SAMPLEDDATA;
109        if ("time".equals(codeString))
110          return TIME;
111        if ("dateTime".equals(codeString))
112          return DATETIME;
113        if ("Period".equals(codeString))
114          return PERIOD;
115        throw new FHIRException("Unknown PermittedDataType code '"+codeString+"'");
116        }
117        public String toCode() {
118          switch (this) {
119            case QUANTITY: return "Quantity";
120            case CODEABLECONCEPT: return "CodeableConcept";
121            case STRING: return "string";
122            case BOOLEAN: return "boolean";
123            case INTEGER: return "integer";
124            case RANGE: return "Range";
125            case RATIO: return "Ratio";
126            case SAMPLEDDATA: return "SampledData";
127            case TIME: return "time";
128            case DATETIME: return "dateTime";
129            case PERIOD: return "Period";
130            case NULL: return null;
131            default: return "?";
132          }
133        }
134        public String getSystem() {
135          return "http://hl7.org/fhir/permitted-data-type";
136        }
137        public String getDefinition() {
138          switch (this) {
139            case QUANTITY: return "A measured amount.";
140            case CODEABLECONCEPT: return "A coded concept from a reference terminology and/or text.";
141            case STRING: return "A sequence of Unicode characters.";
142            case BOOLEAN: return "true or false.";
143            case INTEGER: return "A signed integer.";
144            case RANGE: return "A set of values bounded by low and high.";
145            case RATIO: return "A ratio of two Quantity values - a numerator and a denominator.";
146            case SAMPLEDDATA: return "A series of measurements taken by a device.";
147            case TIME: return "A time during the day, in the format hh:mm:ss.";
148            case DATETIME: return "A date, date-time or partial date (e.g. just year or year + month) as used in human communication.";
149            case PERIOD: return "A time range defined by start and end date/time.";
150            case NULL: return null;
151            default: return "?";
152          }
153        }
154        public String getDisplay() {
155          switch (this) {
156            case QUANTITY: return "Quantity";
157            case CODEABLECONCEPT: return "CodeableConcept";
158            case STRING: return "string";
159            case BOOLEAN: return "boolean";
160            case INTEGER: return "integer";
161            case RANGE: return "Range";
162            case RATIO: return "Ratio";
163            case SAMPLEDDATA: return "SampledData";
164            case TIME: return "time";
165            case DATETIME: return "dateTime";
166            case PERIOD: return "Period";
167            case NULL: return null;
168            default: return "?";
169          }
170    }
171
172
173}