001package org.hl7.fhir.instance.model.valuesets; 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 Wed, Nov 11, 2015 10:54-0500 for FHIR v1.0.2 033 034 035public enum QuestionnaireQuestionControl { 036 037 /** 038 * 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. 039 */ 040 AUTOCOMPLETE, 041 /** 042 * 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. 043 */ 044 DROPDOWN, 045 /** 046 * 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. 047 */ 048 CHECKBOX, 049 /** 050 * 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. 051 */ 052 LOOKUP, 053 /** 054 * 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. 055 */ 056 RADIOBUTTON, 057 /** 058 * 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. 059 */ 060 SLIDER, 061 /** 062 * A control where a list of numeric or other ordered values can be scrolled through via arrows. 063 */ 064 SPINNER, 065 /** 066 * A control where a user can type in their answer freely. 067 */ 068 TEXTBOX, 069 /** 070 * added to help the parsers 071 */ 072 NULL; 073 public static QuestionnaireQuestionControl fromCode(String codeString) throws Exception { 074 if (codeString == null || "".equals(codeString)) 075 return null; 076 if ("autocomplete".equals(codeString)) 077 return AUTOCOMPLETE; 078 if ("drop-down".equals(codeString)) 079 return DROPDOWN; 080 if ("check-box".equals(codeString)) 081 return CHECKBOX; 082 if ("lookup".equals(codeString)) 083 return LOOKUP; 084 if ("radio-button".equals(codeString)) 085 return RADIOBUTTON; 086 if ("slider".equals(codeString)) 087 return SLIDER; 088 if ("spinner".equals(codeString)) 089 return SPINNER; 090 if ("text-box".equals(codeString)) 091 return TEXTBOX; 092 throw new Exception("Unknown QuestionnaireQuestionControl code '"+codeString+"'"); 093 } 094 public String toCode() { 095 switch (this) { 096 case AUTOCOMPLETE: return "autocomplete"; 097 case DROPDOWN: return "drop-down"; 098 case CHECKBOX: return "check-box"; 099 case LOOKUP: return "lookup"; 100 case RADIOBUTTON: return "radio-button"; 101 case SLIDER: return "slider"; 102 case SPINNER: return "spinner"; 103 case TEXTBOX: return "text-box"; 104 default: return "?"; 105 } 106 } 107 public String getSystem() { 108 return "http://hl7.org/fhir/questionnaire-question-control"; 109 } 110 public String getDefinition() { 111 switch (this) { 112 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."; 113 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."; 114 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."; 115 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."; 116 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."; 117 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."; 118 case SPINNER: return "A control where a list of numeric or other ordered values can be scrolled through via arrows."; 119 case TEXTBOX: return "A control where a user can type in their answer freely."; 120 default: return "?"; 121 } 122 } 123 public String getDisplay() { 124 switch (this) { 125 case AUTOCOMPLETE: return "Auto-complete"; 126 case DROPDOWN: return "Drop down"; 127 case CHECKBOX: return "Check-box"; 128 case LOOKUP: return "Lookup"; 129 case RADIOBUTTON: return "Radio Button"; 130 case SLIDER: return "Slider"; 131 case SPINNER: return "Spinner"; 132 case TEXTBOX: return "Text Box"; 133 default: return "?"; 134 } 135 } 136 137 138} 139