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