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 QuestionnaireItemControl {
059
060        /**
061         * UI controls relevant to organizing groups of questions
062         */
063        GROUP, 
064        /**
065         * Questions within the group should be listed sequentially
066         */
067        LIST, 
068        /**
069         * Questions within the group are rows in the table with possible answers as columns.  Used for 'choice' questions.
070         */
071        TABLE, 
072        /**
073         * Questions within the group are columns in the table with possible answers as rows.  Used for 'choice' questions.
074         */
075        HTABLE, 
076        /**
077         * Questions within the group are columns in the table with each group repetition as a row.  Used for single-answer questions.
078         */
079        GTABLE, 
080        /**
081         * This table has one row - for the question.  Permitted answers are columns.  Used for choice questions.
082         */
083        ATABLE, 
084        /**
085         * The group is to be continuously visible at the top of the questionnaire
086         */
087        HEADER, 
088        /**
089         * The group is to be continuously visible at the bottom of the questionnaire
090         */
091        FOOTER, 
092        /**
093         * UI controls relevant to rendering questionnaire text items
094         */
095        TEXT, 
096        /**
097         * Text is displayed as a paragraph in a sequential position between sibling items (default behavior)
098         */
099        INLINE, 
100        /**
101         * Text is displayed immediately below or within the answer-entry area of the containing question item (typically as a guide for what to enter)
102         */
103        PROMPT, 
104        /**
105         * Text is displayed adjacent (horizontally or vertically) to the answer space for the parent question, typically to indicate a unit of measure
106         */
107        UNIT, 
108        /**
109         * Text is displayed to the left of the set of answer choices or a scaling control for the parent question item to indicate the meaning of the 'lower' bound.  E.g. 'Strongly disagree'
110         */
111        LOWER, 
112        /**
113         * Text is displayed to the right of the set of answer choices or a scaling control for the parent question item to indicate the meaning of the 'upper' bound.  E.g. 'Strongly agree'
114         */
115        UPPER, 
116        /**
117         * Text is temporarily visible over top of an item if the mouse is positioned over top of the text for the containing item
118         */
119        FLYOVER, 
120        /**
121         * Text is displayed in a dialog box or similar control if invoked by pushing a button or some other UI-appropriate action to request 'help' for a question, group or the questionnaire as a whole (depending what the text is nested within)
122         */
123        HELP, 
124        /**
125         * UI controls relevant to capturing question data
126         */
127        QUESTION, 
128        /**
129         * A control which provides a list of potential matches based on text entered into a control.  Used for large choice sets where text-matching is an appropriate discovery mechanism.
130         */
131        AUTOCOMPLETE, 
132        /**
133         * A control where an item (or multiple items) can be selected from a list that is only displayed when the user is editing the field.
134         */
135        DROPDOWN, 
136        /**
137         * A control where choices are listed with a box beside them.  The box can be toggled to select or de-select a given choice.  Multiple selections may be possible.
138         */
139        CHECKBOX, 
140        /**
141         * A control where editing an item spawns a separate dialog box or screen permitting a user to navigate, filter or otherwise discover an appropriate match.  Useful for large choice sets where text matching is not an appropriate discovery mechanism.  Such screens must generally be tuned for the specific choice list structure.
142         */
143        LOOKUP, 
144        /**
145         * A control where choices are listed with a button beside them.  The button can be toggled to select or de-select a given choice.  Selecting one item deselects all others.
146         */
147        RADIOBUTTON, 
148        /**
149         * A control where an axis is displayed between the high and low values and the control can be visually manipulated to select a value anywhere on the axis.
150         */
151        SLIDER, 
152        /**
153         * A control where a list of numeric or other ordered values can be scrolled through via arrows.
154         */
155        SPINNER, 
156        /**
157         * A control where a user can type in their answer freely.
158         */
159        TEXTBOX, 
160        /**
161         * added to help the parsers
162         */
163        NULL;
164        public static QuestionnaireItemControl fromCode(String codeString) throws FHIRException {
165            if (codeString == null || "".equals(codeString))
166                return null;
167        if ("group".equals(codeString))
168          return GROUP;
169        if ("list".equals(codeString))
170          return LIST;
171        if ("table".equals(codeString))
172          return TABLE;
173        if ("htable".equals(codeString))
174          return HTABLE;
175        if ("gtable".equals(codeString))
176          return GTABLE;
177        if ("atable".equals(codeString))
178          return ATABLE;
179        if ("header".equals(codeString))
180          return HEADER;
181        if ("footer".equals(codeString))
182          return FOOTER;
183        if ("text".equals(codeString))
184          return TEXT;
185        if ("inline".equals(codeString))
186          return INLINE;
187        if ("prompt".equals(codeString))
188          return PROMPT;
189        if ("unit".equals(codeString))
190          return UNIT;
191        if ("lower".equals(codeString))
192          return LOWER;
193        if ("upper".equals(codeString))
194          return UPPER;
195        if ("flyover".equals(codeString))
196          return FLYOVER;
197        if ("help".equals(codeString))
198          return HELP;
199        if ("question".equals(codeString))
200          return QUESTION;
201        if ("autocomplete".equals(codeString))
202          return AUTOCOMPLETE;
203        if ("drop-down".equals(codeString))
204          return DROPDOWN;
205        if ("check-box".equals(codeString))
206          return CHECKBOX;
207        if ("lookup".equals(codeString))
208          return LOOKUP;
209        if ("radio-button".equals(codeString))
210          return RADIOBUTTON;
211        if ("slider".equals(codeString))
212          return SLIDER;
213        if ("spinner".equals(codeString))
214          return SPINNER;
215        if ("text-box".equals(codeString))
216          return TEXTBOX;
217        throw new FHIRException("Unknown QuestionnaireItemControl code '"+codeString+"'");
218        }
219        public String toCode() {
220          switch (this) {
221            case GROUP: return "group";
222            case LIST: return "list";
223            case TABLE: return "table";
224            case HTABLE: return "htable";
225            case GTABLE: return "gtable";
226            case ATABLE: return "atable";
227            case HEADER: return "header";
228            case FOOTER: return "footer";
229            case TEXT: return "text";
230            case INLINE: return "inline";
231            case PROMPT: return "prompt";
232            case UNIT: return "unit";
233            case LOWER: return "lower";
234            case UPPER: return "upper";
235            case FLYOVER: return "flyover";
236            case HELP: return "help";
237            case QUESTION: return "question";
238            case AUTOCOMPLETE: return "autocomplete";
239            case DROPDOWN: return "drop-down";
240            case CHECKBOX: return "check-box";
241            case LOOKUP: return "lookup";
242            case RADIOBUTTON: return "radio-button";
243            case SLIDER: return "slider";
244            case SPINNER: return "spinner";
245            case TEXTBOX: return "text-box";
246            default: return "?";
247          }
248        }
249        public String getSystem() {
250          return "http://hl7.org/fhir/questionnaire-item-control";
251        }
252        public String getDefinition() {
253          switch (this) {
254            case GROUP: return "UI controls relevant to organizing groups of questions";
255            case LIST: return "Questions within the group should be listed sequentially";
256            case TABLE: return "Questions within the group are rows in the table with possible answers as columns.  Used for 'choice' questions.";
257            case HTABLE: return "Questions within the group are columns in the table with possible answers as rows.  Used for 'choice' questions.";
258            case GTABLE: return "Questions within the group are columns in the table with each group repetition as a row.  Used for single-answer questions.";
259            case ATABLE: return "This table has one row - for the question.  Permitted answers are columns.  Used for choice questions.";
260            case HEADER: return "The group is to be continuously visible at the top of the questionnaire";
261            case FOOTER: return "The group is to be continuously visible at the bottom of the questionnaire";
262            case TEXT: return "UI controls relevant to rendering questionnaire text items";
263            case INLINE: return "Text is displayed as a paragraph in a sequential position between sibling items (default behavior)";
264            case PROMPT: return "Text is displayed immediately below or within the answer-entry area of the containing question item (typically as a guide for what to enter)";
265            case UNIT: return "Text is displayed adjacent (horizontally or vertically) to the answer space for the parent question, typically to indicate a unit of measure";
266            case LOWER: return "Text is displayed to the left of the set of answer choices or a scaling control for the parent question item to indicate the meaning of the 'lower' bound.  E.g. 'Strongly disagree'";
267            case UPPER: return "Text is displayed to the right of the set of answer choices or a scaling control for the parent question item to indicate the meaning of the 'upper' bound.  E.g. 'Strongly agree'";
268            case FLYOVER: return "Text is temporarily visible over top of an item if the mouse is positioned over top of the text for the containing item";
269            case HELP: return "Text is displayed in a dialog box or similar control if invoked by pushing a button or some other UI-appropriate action to request 'help' for a question, group or the questionnaire as a whole (depending what the text is nested within)";
270            case QUESTION: return "UI controls relevant to capturing question data";
271            case AUTOCOMPLETE: return "A control which provides a list of potential matches based on text entered into a control.  Used for large choice sets where text-matching is an appropriate discovery mechanism.";
272            case DROPDOWN: return "A control where an item (or multiple items) can be selected from a list that is only displayed when the user is editing the field.";
273            case CHECKBOX: return "A control where choices are listed with a box beside them.  The box can be toggled to select or de-select a given choice.  Multiple selections may be possible.";
274            case LOOKUP: return "A control where editing an item spawns a separate dialog box or screen permitting a user to navigate, filter or otherwise discover an appropriate match.  Useful for large choice sets where text matching is not an appropriate discovery mechanism.  Such screens must generally be tuned for the specific choice list structure.";
275            case RADIOBUTTON: return "A control where choices are listed with a button beside them.  The button can be toggled to select or de-select a given choice.  Selecting one item deselects all others.";
276            case SLIDER: return "A control where an axis is displayed between the high and low values and the control can be visually manipulated to select a value anywhere on the axis.";
277            case SPINNER: return "A control where a list of numeric or other ordered values can be scrolled through via arrows.";
278            case TEXTBOX: return "A control where a user can type in their answer freely.";
279            default: return "?";
280          }
281        }
282        public String getDisplay() {
283          switch (this) {
284            case GROUP: return "group";
285            case LIST: return "List";
286            case TABLE: return "Vertical Answer Table";
287            case HTABLE: return "Horizontal Answer Table";
288            case GTABLE: return "Group Table";
289            case ATABLE: return "Answer Table";
290            case HEADER: return "Header";
291            case FOOTER: return "Footer";
292            case TEXT: return "text";
293            case INLINE: return "In-line";
294            case PROMPT: return "Prompt";
295            case UNIT: return "Unit";
296            case LOWER: return "Lower-bound";
297            case UPPER: return "Upper-bound";
298            case FLYOVER: return "Fly-over";
299            case HELP: return "Help-Button";
300            case QUESTION: return "question";
301            case AUTOCOMPLETE: return "Auto-complete";
302            case DROPDOWN: return "Drop down";
303            case CHECKBOX: return "Check-box";
304            case LOOKUP: return "Lookup";
305            case RADIOBUTTON: return "Radio Button";
306            case SLIDER: return "Slider";
307            case SPINNER: return "Spinner";
308            case TEXTBOX: return "Text Box";
309            default: return "?";
310          }
311    }
312
313
314}
315