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