001package org.hl7.fhir.r4.model.codesystems;
002
003/*-
004 * #%L
005 * org.hl7.fhir.r4
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, 
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this 
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, 
034     this list of conditions and the following disclaimer in the documentation 
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
049  POSSIBILITY OF SUCH DAMAGE.
050  
051*/
052
053// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0
054
055
056import org.hl7.fhir.exceptions.FHIRException;
057
058public enum ItemType {
059
060        /**
061         * An item with no direct answer but should have at least one child item.
062         */
063        GROUP, 
064        /**
065         * Text for display that will not capture an answer or have child items.
066         */
067        DISPLAY, 
068        /**
069         * 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).
070         */
071        QUESTION, 
072        /**
073         * Question with a yes/no answer (valueBoolean).
074         */
075        BOOLEAN, 
076        /**
077         * Question with is a real number answer (valueDecimal).
078         */
079        DECIMAL, 
080        /**
081         * Question with an integer answer (valueInteger).
082         */
083        INTEGER, 
084        /**
085         * Question with a date answer (valueDate).
086         */
087        DATE, 
088        /**
089         * Question with a date and time answer (valueDateTime).
090         */
091        DATETIME, 
092        /**
093         * Question with a time (hour:minute:second) answer independent of date. (valueTime).
094         */
095        TIME, 
096        /**
097         * Question with a short (few words to short sentence) free-text entry answer (valueString).
098         */
099        STRING, 
100        /**
101         * Question with a long (potentially multi-paragraph) free-text entry answer (valueString).
102         */
103        TEXT, 
104        /**
105         * Question with a URL (website, FTP site, etc.) answer (valueUri).
106         */
107        URL, 
108        /**
109         * 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).
110         */
111        CHOICE, 
112        /**
113         * 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).
114         */
115        OPENCHOICE, 
116        /**
117         * Question with binary content such as an image, PDF, etc. as an answer (valueAttachment).
118         */
119        ATTACHMENT, 
120        /**
121         * Question with a reference to another resource (practitioner, organization, etc.) as an answer (valueReference).
122         */
123        REFERENCE, 
124        /**
125         * 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).
126         */
127        QUANTITY, 
128        /**
129         * added to help the parsers
130         */
131        NULL;
132        public static ItemType fromCode(String codeString) throws FHIRException {
133            if (codeString == null || "".equals(codeString))
134                return null;
135        if ("group".equals(codeString))
136          return GROUP;
137        if ("display".equals(codeString))
138          return DISPLAY;
139        if ("question".equals(codeString))
140          return QUESTION;
141        if ("boolean".equals(codeString))
142          return BOOLEAN;
143        if ("decimal".equals(codeString))
144          return DECIMAL;
145        if ("integer".equals(codeString))
146          return INTEGER;
147        if ("date".equals(codeString))
148          return DATE;
149        if ("dateTime".equals(codeString))
150          return DATETIME;
151        if ("time".equals(codeString))
152          return TIME;
153        if ("string".equals(codeString))
154          return STRING;
155        if ("text".equals(codeString))
156          return TEXT;
157        if ("url".equals(codeString))
158          return URL;
159        if ("choice".equals(codeString))
160          return CHOICE;
161        if ("open-choice".equals(codeString))
162          return OPENCHOICE;
163        if ("attachment".equals(codeString))
164          return ATTACHMENT;
165        if ("reference".equals(codeString))
166          return REFERENCE;
167        if ("quantity".equals(codeString))
168          return QUANTITY;
169        throw new FHIRException("Unknown ItemType code '"+codeString+"'");
170        }
171        public String toCode() {
172          switch (this) {
173            case GROUP: return "group";
174            case DISPLAY: return "display";
175            case QUESTION: return "question";
176            case BOOLEAN: return "boolean";
177            case DECIMAL: return "decimal";
178            case INTEGER: return "integer";
179            case DATE: return "date";
180            case DATETIME: return "dateTime";
181            case TIME: return "time";
182            case STRING: return "string";
183            case TEXT: return "text";
184            case URL: return "url";
185            case CHOICE: return "choice";
186            case OPENCHOICE: return "open-choice";
187            case ATTACHMENT: return "attachment";
188            case REFERENCE: return "reference";
189            case QUANTITY: return "quantity";
190            default: return "?";
191          }
192        }
193        public String getSystem() {
194          return "http://hl7.org/fhir/item-type";
195        }
196        public String getDefinition() {
197          switch (this) {
198            case GROUP: return "An item with no direct answer but should have at least one child item.";
199            case DISPLAY: return "Text for display that will not capture an answer or have child items.";
200            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).";
201            case BOOLEAN: return "Question with a yes/no answer (valueBoolean).";
202            case DECIMAL: return "Question with is a real number answer (valueDecimal).";
203            case INTEGER: return "Question with an integer answer (valueInteger).";
204            case DATE: return "Question with a date answer (valueDate).";
205            case DATETIME: return "Question with a date and time answer (valueDateTime).";
206            case TIME: return "Question with a time (hour:minute:second) answer independent of date. (valueTime).";
207            case STRING: return "Question with a short (few words to short sentence) free-text entry answer (valueString).";
208            case TEXT: return "Question with a long (potentially multi-paragraph) free-text entry answer (valueString).";
209            case URL: return "Question with a URL (website, FTP site, etc.) answer (valueUri).";
210            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).";
211            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).";
212            case ATTACHMENT: return "Question with binary content such as an image, PDF, etc. as an answer (valueAttachment).";
213            case REFERENCE: return "Question with a reference to another resource (practitioner, organization, etc.) as an answer (valueReference).";
214            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).";
215            default: return "?";
216          }
217        }
218        public String getDisplay() {
219          switch (this) {
220            case GROUP: return "Group";
221            case DISPLAY: return "Display";
222            case QUESTION: return "Question";
223            case BOOLEAN: return "Boolean";
224            case DECIMAL: return "Decimal";
225            case INTEGER: return "Integer";
226            case DATE: return "Date";
227            case DATETIME: return "Date Time";
228            case TIME: return "Time";
229            case STRING: return "String";
230            case TEXT: return "Text";
231            case URL: return "Url";
232            case CHOICE: return "Choice";
233            case OPENCHOICE: return "Open Choice";
234            case ATTACHMENT: return "Attachment";
235            case REFERENCE: return "Reference";
236            case QUANTITY: return "Quantity";
237            default: return "?";
238          }
239    }
240
241
242}
243