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