001package org.hl7.fhir.dstu3.model.codesystems; 002 003/*- 004 * #%L 005 * org.hl7.fhir.dstu3 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 Sat, Mar 25, 2017 21:03-0400 for FHIR v3.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 070 */ 071 TABLE, 072 /** 073 * The group is to be continuously visible at the top of the questionnaire 074 */ 075 HEADER, 076 /** 077 * The group is to be continuously visible at the bottom of the questionnaire 078 */ 079 FOOTER, 080 /** 081 * UI controls relevant to rendering questionnaire text items 082 */ 083 TEXT, 084 /** 085 * Text is displayed as a paragraph in a sequential position between sibling items (default behavior) 086 */ 087 INLINE, 088 /** 089 * Text is displayed immediately below or within the answer-entry area of the containing question item (typically as a guide for what to enter) 090 */ 091 PROMPT, 092 /** 093 * Text is displayed adjacent (horizontally or vertically) to the answer space for the parent question, typically to indicate a unit of measure 094 */ 095 UNIT, 096 /** 097 * 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' 098 */ 099 LOWER, 100 /** 101 * 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' 102 */ 103 UPPER, 104 /** 105 * Text is temporarily visible over top of an item if the mouse is positioned over top of the text for the containing item 106 */ 107 FLYOVER, 108 /** 109 * 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) 110 */ 111 HELP, 112 /** 113 * UI controls relevant to capturing question data 114 */ 115 QUESTION, 116 /** 117 * 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. 118 */ 119 AUTOCOMPLETE, 120 /** 121 * 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. 122 */ 123 DROPDOWN, 124 /** 125 * 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. 126 */ 127 CHECKBOX, 128 /** 129 * 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. 130 */ 131 LOOKUP, 132 /** 133 * 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. 134 */ 135 RADIOBUTTON, 136 /** 137 * 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. 138 */ 139 SLIDER, 140 /** 141 * A control where a list of numeric or other ordered values can be scrolled through via arrows. 142 */ 143 SPINNER, 144 /** 145 * A control where a user can type in their answer freely. 146 */ 147 TEXTBOX, 148 /** 149 * added to help the parsers 150 */ 151 NULL; 152 public static QuestionnaireItemControl fromCode(String codeString) throws FHIRException { 153 if (codeString == null || "".equals(codeString)) 154 return null; 155 if ("group".equals(codeString)) 156 return GROUP; 157 if ("list".equals(codeString)) 158 return LIST; 159 if ("table".equals(codeString)) 160 return TABLE; 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 HEADER: return "header"; 207 case FOOTER: return "footer"; 208 case TEXT: return "text"; 209 case INLINE: return "inline"; 210 case PROMPT: return "prompt"; 211 case UNIT: return "unit"; 212 case LOWER: return "lower"; 213 case UPPER: return "upper"; 214 case FLYOVER: return "flyover"; 215 case HELP: return "help"; 216 case QUESTION: return "question"; 217 case AUTOCOMPLETE: return "autocomplete"; 218 case DROPDOWN: return "drop-down"; 219 case CHECKBOX: return "check-box"; 220 case LOOKUP: return "lookup"; 221 case RADIOBUTTON: return "radio-button"; 222 case SLIDER: return "slider"; 223 case SPINNER: return "spinner"; 224 case TEXTBOX: return "text-box"; 225 default: return "?"; 226 } 227 } 228 public String getSystem() { 229 return "http://hl7.org/fhir/questionnaire-item-control"; 230 } 231 public String getDefinition() { 232 switch (this) { 233 case GROUP: return "UI controls relevant to organizing groups of questions"; 234 case LIST: return "Questions within the group should be listed sequentially"; 235 case TABLE: return "Questions within the group are rows in the table with possible answers as columns"; 236 case HEADER: return "The group is to be continuously visible at the top of the questionnaire"; 237 case FOOTER: return "The group is to be continuously visible at the bottom of the questionnaire"; 238 case TEXT: return "UI controls relevant to rendering questionnaire text items"; 239 case INLINE: return "Text is displayed as a paragraph in a sequential position between sibling items (default behavior)"; 240 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)"; 241 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"; 242 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'"; 243 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'"; 244 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"; 245 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)"; 246 case QUESTION: return "UI controls relevant to capturing question data"; 247 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."; 248 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."; 249 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."; 250 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."; 251 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."; 252 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."; 253 case SPINNER: return "A control where a list of numeric or other ordered values can be scrolled through via arrows."; 254 case TEXTBOX: return "A control where a user can type in their answer freely."; 255 default: return "?"; 256 } 257 } 258 public String getDisplay() { 259 switch (this) { 260 case GROUP: return "group"; 261 case LIST: return "List"; 262 case TABLE: return "Table"; 263 case HEADER: return "Header"; 264 case FOOTER: return "Footer"; 265 case TEXT: return "text"; 266 case INLINE: return "In-line"; 267 case PROMPT: return "Prompt"; 268 case UNIT: return "Unit"; 269 case LOWER: return "Lower-bound"; 270 case UPPER: return "Upper-bound"; 271 case FLYOVER: return "Fly-over"; 272 case HELP: return "Help-Button"; 273 case QUESTION: return "question"; 274 case AUTOCOMPLETE: return "Auto-complete"; 275 case DROPDOWN: return "Drop down"; 276 case CHECKBOX: return "Check-box"; 277 case LOOKUP: return "Lookup"; 278 case RADIOBUTTON: return "Radio Button"; 279 case SLIDER: return "Slider"; 280 case SPINNER: return "Spinner"; 281 case TEXTBOX: return "Text Box"; 282 default: return "?"; 283 } 284 } 285 286 287} 288