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 default: return "?"; 229 } 230 } 231 public String getSystem() { 232 return "http://hl7.org/fhir/questionnaire-item-control"; 233 } 234 public String getDefinition() { 235 switch (this) { 236 case GROUP: return "UI controls relevant to organizing groups of questions"; 237 case LIST: return "Questions within the group should be listed sequentially"; 238 case TABLE: return "Questions within the group are rows in the table with possible answers as columns. Used for 'choice' questions."; 239 case HTABLE: return "Questions within the group are columns in the table with possible answers as rows. Used for 'choice' questions."; 240 case GTABLE: return "Questions within the group are columns in the table with each group repetition as a row. Used for single-answer questions."; 241 case ATABLE: return "This table has one row - for the question. Permitted answers are columns. Used for choice questions."; 242 case HEADER: return "The group is to be continuously visible at the top of the questionnaire"; 243 case FOOTER: return "The group is to be continuously visible at the bottom of the questionnaire"; 244 case TEXT: return "UI controls relevant to rendering questionnaire text items"; 245 case INLINE: return "Text is displayed as a paragraph in a sequential position between sibling items (default behavior)"; 246 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)"; 247 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"; 248 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'"; 249 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'"; 250 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"; 251 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)"; 252 case QUESTION: return "UI controls relevant to capturing question data"; 253 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."; 254 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."; 255 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."; 256 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."; 257 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."; 258 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."; 259 case SPINNER: return "A control where a list of numeric or other ordered values can be scrolled through via arrows."; 260 case TEXTBOX: return "A control where a user can type in their answer freely."; 261 default: return "?"; 262 } 263 } 264 public String getDisplay() { 265 switch (this) { 266 case GROUP: return "group"; 267 case LIST: return "List"; 268 case TABLE: return "Vertical Answer Table"; 269 case HTABLE: return "Horizontal Answer Table"; 270 case GTABLE: return "Group Table"; 271 case ATABLE: return "Answer Table"; 272 case HEADER: return "Header"; 273 case FOOTER: return "Footer"; 274 case TEXT: return "text"; 275 case INLINE: return "In-line"; 276 case PROMPT: return "Prompt"; 277 case UNIT: return "Unit"; 278 case LOWER: return "Lower-bound"; 279 case UPPER: return "Upper-bound"; 280 case FLYOVER: return "Fly-over"; 281 case HELP: return "Help-Button"; 282 case QUESTION: return "question"; 283 case AUTOCOMPLETE: return "Auto-complete"; 284 case DROPDOWN: return "Drop down"; 285 case CHECKBOX: return "Check-box"; 286 case LOOKUP: return "Lookup"; 287 case RADIOBUTTON: return "Radio Button"; 288 case SLIDER: return "Slider"; 289 case SPINNER: return "Spinner"; 290 case TEXTBOX: return "Text Box"; 291 default: return "?"; 292 } 293 } 294 295 296}