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 ItemType { 041 042 /** 043 * An item with no direct answer but should have at least one child item. 044 */ 045 GROUP, 046 /** 047 * Text for display that will not capture an answer or have child items. 048 */ 049 DISPLAY, 050 /** 051 * An item that defines a specific answer to be captured, and which may have child items. (the answer provided in the QuestionnaireResponse should be of the defined datatype). 052 */ 053 QUESTION, 054 /** 055 * Question with a yes/no answer (valueBoolean). 056 */ 057 BOOLEAN, 058 /** 059 * Question with is a real number answer (valueDecimal). 060 */ 061 DECIMAL, 062 /** 063 * Question with an integer answer (valueInteger). 064 */ 065 INTEGER, 066 /** 067 * Question with a date answer (valueDate). 068 */ 069 DATE, 070 /** 071 * Question with a date and time answer (valueDateTime). 072 */ 073 DATETIME, 074 /** 075 * Question with a time (hour:minute:second) answer independent of date. (valueTime). 076 */ 077 TIME, 078 /** 079 * Question with a short (few words to short sentence) free-text entry answer (valueString). 080 */ 081 STRING, 082 /** 083 * Question with a long (potentially multi-paragraph) free-text entry answer (valueString). 084 */ 085 TEXT, 086 /** 087 * Question with a URL (website, FTP site, etc.) answer (valueUri). 088 */ 089 URL, 090 /** 091 * Question with a Coding drawn from a list of possible answers (specified in either the answerOption property, or via the valueset referenced in the answerValueSet property) as an answer (valueCoding). 092 */ 093 CHOICE, 094 /** 095 * Answer is a Coding drawn from a list of possible answers (as with the choice type) or a free-text entry in a string (valueCoding or valueString). 096 */ 097 OPENCHOICE, 098 /** 099 * Question with binary content such as an image, PDF, etc. as an answer (valueAttachment). 100 */ 101 ATTACHMENT, 102 /** 103 * Question with a reference to another resource (practitioner, organization, etc.) as an answer (valueReference). 104 */ 105 REFERENCE, 106 /** 107 * Question with a combination of a numeric value and unit, potentially with a comparator (<, >, etc.) as an answer. (valueQuantity) There is an extension 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit' that can be used to define what unit should be captured (or the unit that has a ucum conversion from the provided unit). 108 */ 109 QUANTITY, 110 /** 111 * added to help the parsers 112 */ 113 NULL; 114 public static ItemType fromCode(String codeString) throws FHIRException { 115 if (codeString == null || "".equals(codeString)) 116 return null; 117 if ("group".equals(codeString)) 118 return GROUP; 119 if ("display".equals(codeString)) 120 return DISPLAY; 121 if ("question".equals(codeString)) 122 return QUESTION; 123 if ("boolean".equals(codeString)) 124 return BOOLEAN; 125 if ("decimal".equals(codeString)) 126 return DECIMAL; 127 if ("integer".equals(codeString)) 128 return INTEGER; 129 if ("date".equals(codeString)) 130 return DATE; 131 if ("dateTime".equals(codeString)) 132 return DATETIME; 133 if ("time".equals(codeString)) 134 return TIME; 135 if ("string".equals(codeString)) 136 return STRING; 137 if ("text".equals(codeString)) 138 return TEXT; 139 if ("url".equals(codeString)) 140 return URL; 141 if ("choice".equals(codeString)) 142 return CHOICE; 143 if ("open-choice".equals(codeString)) 144 return OPENCHOICE; 145 if ("attachment".equals(codeString)) 146 return ATTACHMENT; 147 if ("reference".equals(codeString)) 148 return REFERENCE; 149 if ("quantity".equals(codeString)) 150 return QUANTITY; 151 throw new FHIRException("Unknown ItemType code '"+codeString+"'"); 152 } 153 public String toCode() { 154 switch (this) { 155 case GROUP: return "group"; 156 case DISPLAY: return "display"; 157 case QUESTION: return "question"; 158 case BOOLEAN: return "boolean"; 159 case DECIMAL: return "decimal"; 160 case INTEGER: return "integer"; 161 case DATE: return "date"; 162 case DATETIME: return "dateTime"; 163 case TIME: return "time"; 164 case STRING: return "string"; 165 case TEXT: return "text"; 166 case URL: return "url"; 167 case CHOICE: return "choice"; 168 case OPENCHOICE: return "open-choice"; 169 case ATTACHMENT: return "attachment"; 170 case REFERENCE: return "reference"; 171 case QUANTITY: return "quantity"; 172 default: return "?"; 173 } 174 } 175 public String getSystem() { 176 return "http://hl7.org/fhir/item-type"; 177 } 178 public String getDefinition() { 179 switch (this) { 180 case GROUP: return "An item with no direct answer but should have at least one child item."; 181 case DISPLAY: return "Text for display that will not capture an answer or have child items."; 182 case QUESTION: return "An item that defines a specific answer to be captured, and which may have child items. (the answer provided in the QuestionnaireResponse should be of the defined datatype)."; 183 case BOOLEAN: return "Question with a yes/no answer (valueBoolean)."; 184 case DECIMAL: return "Question with is a real number answer (valueDecimal)."; 185 case INTEGER: return "Question with an integer answer (valueInteger)."; 186 case DATE: return "Question with a date answer (valueDate)."; 187 case DATETIME: return "Question with a date and time answer (valueDateTime)."; 188 case TIME: return "Question with a time (hour:minute:second) answer independent of date. (valueTime)."; 189 case STRING: return "Question with a short (few words to short sentence) free-text entry answer (valueString)."; 190 case TEXT: return "Question with a long (potentially multi-paragraph) free-text entry answer (valueString)."; 191 case URL: return "Question with a URL (website, FTP site, etc.) answer (valueUri)."; 192 case CHOICE: return "Question with a Coding drawn from a list of possible answers (specified in either the answerOption property, or via the valueset referenced in the answerValueSet property) as an answer (valueCoding)."; 193 case OPENCHOICE: return "Answer is a Coding drawn from a list of possible answers (as with the choice type) or a free-text entry in a string (valueCoding or valueString)."; 194 case ATTACHMENT: return "Question with binary content such as an image, PDF, etc. as an answer (valueAttachment)."; 195 case REFERENCE: return "Question with a reference to another resource (practitioner, organization, etc.) as an answer (valueReference)."; 196 case QUANTITY: return "Question with a combination of a numeric value and unit, potentially with a comparator (<, >, etc.) as an answer. (valueQuantity) There is an extension 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit' that can be used to define what unit should be captured (or the unit that has a ucum conversion from the provided unit)."; 197 default: return "?"; 198 } 199 } 200 public String getDisplay() { 201 switch (this) { 202 case GROUP: return "Group"; 203 case DISPLAY: return "Display"; 204 case QUESTION: return "Question"; 205 case BOOLEAN: return "Boolean"; 206 case DECIMAL: return "Decimal"; 207 case INTEGER: return "Integer"; 208 case DATE: return "Date"; 209 case DATETIME: return "Date Time"; 210 case TIME: return "Time"; 211 case STRING: return "String"; 212 case TEXT: return "Text"; 213 case URL: return "Url"; 214 case CHOICE: return "Choice"; 215 case OPENCHOICE: return "Open Choice"; 216 case ATTACHMENT: return "Attachment"; 217 case REFERENCE: return "Reference"; 218 case QUANTITY: return "Quantity"; 219 default: return "?"; 220 } 221 } 222 223 224}