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