001package org.hl7.fhir.r5.model.codesystems; 002 003/* 004 * #%L 005 * org.hl7.fhir.r5 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 Copyright (c) 2011+, HL7, Inc. 025 All rights reserved. 026 027 Redistribution and use in source and binary forms, with or without modification, 028 are permitted provided that the following conditions are met: 029 030 * Redistributions of source code must retain the above copyright notice, this 031 list of conditions and the following disclaimer. 032 * Redistributions in binary form must reproduce the above copyright notice, 033 this list of conditions and the following disclaimer in the documentation 034 and/or other materials provided with the distribution. 035 * Neither the name of HL7 nor the names of its contributors may be used to 036 endorse or promote products derived from this software without specific 037 prior written permission. 038 039 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 040 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 041 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 042 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 043 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 044 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 045 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 046 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 047 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 048 POSSIBILITY OF SUCH DAMAGE. 049 050*/ 051 052// Generated on Thu, Oct 17, 2019 09:42+1100 for FHIR v4.1.0 053 054 055import org.hl7.fhir.exceptions.FHIRException; 056 057public enum QuestionnaireItemControl { 058 059 /** 060 * UI controls relevant to organizing groups of questions 061 */ 062 GROUP, 063 /** 064 * Questions within the group should be listed sequentially 065 */ 066 LIST, 067 /** 068 * Questions within the group are rows in the table with possible answers as columns. Used for 'choice' questions. 069 */ 070 TABLE, 071 /** 072 * Questions within the group are columns in the table with possible answers as rows. Used for 'choice' questions. 073 */ 074 HTABLE, 075 /** 076 * Questions within the group are columns in the table with each group repetition as a row. Used for single-answer questions. 077 */ 078 GTABLE, 079 /** 080 * This table has one row - for the question. Permitted answers are columns. Used for choice questions. 081 */ 082 ATABLE, 083 /** 084 * The group is to be continuously visible at the top of the questionnaire 085 */ 086 HEADER, 087 /** 088 * The group is to be continuously visible at the bottom of the questionnaire 089 */ 090 FOOTER, 091 /** 092 * UI controls relevant to rendering questionnaire text items 093 */ 094 TEXT, 095 /** 096 * Text is displayed as a paragraph in a sequential position between sibling items (default behavior) 097 */ 098 INLINE, 099 /** 100 * Text is displayed immediately below or within the answer-entry area of the containing question item (typically as a guide for what to enter) 101 */ 102 PROMPT, 103 /** 104 * Text is displayed adjacent (horizontally or vertically) to the answer space for the parent question, typically to indicate a unit of measure 105 */ 106 UNIT, 107 /** 108 * 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' 109 */ 110 LOWER, 111 /** 112 * 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' 113 */ 114 UPPER, 115 /** 116 * Text is temporarily visible over top of an item if the mouse is positioned over top of the text for the containing item 117 */ 118 FLYOVER, 119 /** 120 * 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) 121 */ 122 HELP, 123 /** 124 * UI controls relevant to capturing question data 125 */ 126 QUESTION, 127 /** 128 * 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. 129 */ 130 AUTOCOMPLETE, 131 /** 132 * 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. 133 */ 134 DROPDOWN, 135 /** 136 * 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. 137 */ 138 CHECKBOX, 139 /** 140 * 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. 141 */ 142 LOOKUP, 143 /** 144 * 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. 145 */ 146 RADIOBUTTON, 147 /** 148 * 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. 149 */ 150 SLIDER, 151 /** 152 * A control where a list of numeric or other ordered values can be scrolled through via arrows. 153 */ 154 SPINNER, 155 /** 156 * A control where a user can type in their answer freely. 157 */ 158 TEXTBOX, 159 /** 160 * added to help the parsers 161 */ 162 NULL; 163 public static QuestionnaireItemControl fromCode(String codeString) throws FHIRException { 164 if (codeString == null || "".equals(codeString)) 165 return null; 166 if ("group".equals(codeString)) 167 return GROUP; 168 if ("list".equals(codeString)) 169 return LIST; 170 if ("table".equals(codeString)) 171 return TABLE; 172 if ("htable".equals(codeString)) 173 return HTABLE; 174 if ("gtable".equals(codeString)) 175 return GTABLE; 176 if ("atable".equals(codeString)) 177 return ATABLE; 178 if ("header".equals(codeString)) 179 return HEADER; 180 if ("footer".equals(codeString)) 181 return FOOTER; 182 if ("text".equals(codeString)) 183 return TEXT; 184 if ("inline".equals(codeString)) 185 return INLINE; 186 if ("prompt".equals(codeString)) 187 return PROMPT; 188 if ("unit".equals(codeString)) 189 return UNIT; 190 if ("lower".equals(codeString)) 191 return LOWER; 192 if ("upper".equals(codeString)) 193 return UPPER; 194 if ("flyover".equals(codeString)) 195 return FLYOVER; 196 if ("help".equals(codeString)) 197 return HELP; 198 if ("question".equals(codeString)) 199 return QUESTION; 200 if ("autocomplete".equals(codeString)) 201 return AUTOCOMPLETE; 202 if ("drop-down".equals(codeString)) 203 return DROPDOWN; 204 if ("check-box".equals(codeString)) 205 return CHECKBOX; 206 if ("lookup".equals(codeString)) 207 return LOOKUP; 208 if ("radio-button".equals(codeString)) 209 return RADIOBUTTON; 210 if ("slider".equals(codeString)) 211 return SLIDER; 212 if ("spinner".equals(codeString)) 213 return SPINNER; 214 if ("text-box".equals(codeString)) 215 return TEXTBOX; 216 throw new FHIRException("Unknown QuestionnaireItemControl code '"+codeString+"'"); 217 } 218 public String toCode() { 219 switch (this) { 220 case GROUP: return "group"; 221 case LIST: return "list"; 222 case TABLE: return "table"; 223 case HTABLE: return "htable"; 224 case GTABLE: return "gtable"; 225 case ATABLE: return "atable"; 226 case HEADER: return "header"; 227 case FOOTER: return "footer"; 228 case TEXT: return "text"; 229 case INLINE: return "inline"; 230 case PROMPT: return "prompt"; 231 case UNIT: return "unit"; 232 case LOWER: return "lower"; 233 case UPPER: return "upper"; 234 case FLYOVER: return "flyover"; 235 case HELP: return "help"; 236 case QUESTION: return "question"; 237 case AUTOCOMPLETE: return "autocomplete"; 238 case DROPDOWN: return "drop-down"; 239 case CHECKBOX: return "check-box"; 240 case LOOKUP: return "lookup"; 241 case RADIOBUTTON: return "radio-button"; 242 case SLIDER: return "slider"; 243 case SPINNER: return "spinner"; 244 case TEXTBOX: return "text-box"; 245 default: return "?"; 246 } 247 } 248 public String getSystem() { 249 return "http://hl7.org/fhir/questionnaire-item-control"; 250 } 251 public String getDefinition() { 252 switch (this) { 253 case GROUP: return "UI controls relevant to organizing groups of questions"; 254 case LIST: return "Questions within the group should be listed sequentially"; 255 case TABLE: return "Questions within the group are rows in the table with possible answers as columns. Used for 'choice' questions."; 256 case HTABLE: return "Questions within the group are columns in the table with possible answers as rows. Used for 'choice' questions."; 257 case GTABLE: return "Questions within the group are columns in the table with each group repetition as a row. Used for single-answer questions."; 258 case ATABLE: return "This table has one row - for the question. Permitted answers are columns. Used for choice questions."; 259 case HEADER: return "The group is to be continuously visible at the top of the questionnaire"; 260 case FOOTER: return "The group is to be continuously visible at the bottom of the questionnaire"; 261 case TEXT: return "UI controls relevant to rendering questionnaire text items"; 262 case INLINE: return "Text is displayed as a paragraph in a sequential position between sibling items (default behavior)"; 263 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)"; 264 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"; 265 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'"; 266 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'"; 267 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"; 268 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)"; 269 case QUESTION: return "UI controls relevant to capturing question data"; 270 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."; 271 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."; 272 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."; 273 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."; 274 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."; 275 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."; 276 case SPINNER: return "A control where a list of numeric or other ordered values can be scrolled through via arrows."; 277 case TEXTBOX: return "A control where a user can type in their answer freely."; 278 default: return "?"; 279 } 280 } 281 public String getDisplay() { 282 switch (this) { 283 case GROUP: return "group"; 284 case LIST: return "List"; 285 case TABLE: return "Vertical Answer Table"; 286 case HTABLE: return "Horizontal Answer Table"; 287 case GTABLE: return "Group Table"; 288 case ATABLE: return "Answer Table"; 289 case HEADER: return "Header"; 290 case FOOTER: return "Footer"; 291 case TEXT: return "text"; 292 case INLINE: return "In-line"; 293 case PROMPT: return "Prompt"; 294 case UNIT: return "Unit"; 295 case LOWER: return "Lower-bound"; 296 case UPPER: return "Upper-bound"; 297 case FLYOVER: return "Fly-over"; 298 case HELP: return "Help-Button"; 299 case QUESTION: return "question"; 300 case AUTOCOMPLETE: return "Auto-complete"; 301 case DROPDOWN: return "Drop down"; 302 case CHECKBOX: return "Check-box"; 303 case LOOKUP: return "Lookup"; 304 case RADIOBUTTON: return "Radio Button"; 305 case SLIDER: return "Slider"; 306 case SPINNER: return "Spinner"; 307 case TEXTBOX: return "Text Box"; 308 default: return "?"; 309 } 310 } 311 312 313} 314