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