001package org.hl7.fhir.dstu3.model;
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 Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.1
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.dstu3.model.Enumerations.*;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046import org.hl7.fhir.exceptions.FHIRFormatError;
047/**
048 * A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.
049 */
050@ResourceDef(name="Questionnaire", profile="http://hl7.org/fhir/StructureDefinition/Questionnaire")
051@ChildOrder(names={"url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "description", "purpose", "approvalDate", "lastReviewDate", "effectivePeriod", "useContext", "jurisdiction", "contact", "copyright", "code", "subjectType", "item"})
052public class Questionnaire extends MetadataResource {
053
054    public enum QuestionnaireItemType {
055        /**
056         * An item with no direct answer but should have at least one child item.
057         */
058        GROUP, 
059        /**
060         * Text for display that will not capture an answer or have child items.
061         */
062        DISPLAY, 
063        /**
064         * An item that defines a specific answer to be captured, and may have child items.
065(the answer provided in the QuestionnaireResponse should be of the defined datatype)
066         */
067        QUESTION, 
068        /**
069         * Question with a yes/no answer (valueBoolean)
070         */
071        BOOLEAN, 
072        /**
073         * Question with is a real number answer (valueDecimal)
074         */
075        DECIMAL, 
076        /**
077         * Question with an integer answer (valueInteger)
078         */
079        INTEGER, 
080        /**
081         * Question with a date answer (valueDate)
082         */
083        DATE, 
084        /**
085         * Question with a date and time answer (valueDateTime)
086         */
087        DATETIME, 
088        /**
089         * Question with a time (hour:minute:second) answer independent of date. (valueTime)
090         */
091        TIME, 
092        /**
093         * Question with a short (few words to short sentence) free-text entry answer (valueString)
094         */
095        STRING, 
096        /**
097         * Question with a long (potentially multi-paragraph) free-text entry answer (valueString)
098         */
099        TEXT, 
100        /**
101         * Question with a URL (website, FTP site, etc.) answer (valueUri)
102         */
103        URL, 
104        /**
105         * Question with a Coding drawn from a list of options (specified in either the option property, or via the valueset referenced in the options property) as an answer (valueCoding)
106         */
107        CHOICE, 
108        /**
109         * Answer is a Coding drawn from a list of options (as with the choice type) or a free-text entry in a string (valueCoding or valueString)
110         */
111        OPENCHOICE, 
112        /**
113         * Question with binary content such as a image, PDF, etc. as an answer (valueAttachment)
114         */
115        ATTACHMENT, 
116        /**
117         * Question with a reference to another resource (practitioner, organization, etc.) as an answer (valueReference)
118         */
119        REFERENCE, 
120        /**
121         * Question with a combination of a numeric value and unit, potentially with a comparator (<, >, etc.) as an answer. (valueQuantity)
122There is an extension 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit' that can be used to define what unit whould be captured (or the a unit that has a ucum conversion from the provided unit)
123         */
124        QUANTITY, 
125        /**
126         * added to help the parsers with the generic types
127         */
128        NULL;
129        public static QuestionnaireItemType fromCode(String codeString) throws FHIRException {
130            if (codeString == null || "".equals(codeString))
131                return null;
132        if ("group".equals(codeString))
133          return GROUP;
134        if ("display".equals(codeString))
135          return DISPLAY;
136        if ("question".equals(codeString))
137          return QUESTION;
138        if ("boolean".equals(codeString))
139          return BOOLEAN;
140        if ("decimal".equals(codeString))
141          return DECIMAL;
142        if ("integer".equals(codeString))
143          return INTEGER;
144        if ("date".equals(codeString))
145          return DATE;
146        if ("dateTime".equals(codeString))
147          return DATETIME;
148        if ("time".equals(codeString))
149          return TIME;
150        if ("string".equals(codeString))
151          return STRING;
152        if ("text".equals(codeString))
153          return TEXT;
154        if ("url".equals(codeString))
155          return URL;
156        if ("choice".equals(codeString))
157          return CHOICE;
158        if ("open-choice".equals(codeString))
159          return OPENCHOICE;
160        if ("attachment".equals(codeString))
161          return ATTACHMENT;
162        if ("reference".equals(codeString))
163          return REFERENCE;
164        if ("quantity".equals(codeString))
165          return QUANTITY;
166        if (Configuration.isAcceptInvalidEnums())
167          return null;
168        else
169          throw new FHIRException("Unknown QuestionnaireItemType code '"+codeString+"'");
170        }
171        public String toCode() {
172          switch (this) {
173            case GROUP: return "group";
174            case DISPLAY: return "display";
175            case QUESTION: return "question";
176            case BOOLEAN: return "boolean";
177            case DECIMAL: return "decimal";
178            case INTEGER: return "integer";
179            case DATE: return "date";
180            case DATETIME: return "dateTime";
181            case TIME: return "time";
182            case STRING: return "string";
183            case TEXT: return "text";
184            case URL: return "url";
185            case CHOICE: return "choice";
186            case OPENCHOICE: return "open-choice";
187            case ATTACHMENT: return "attachment";
188            case REFERENCE: return "reference";
189            case QUANTITY: return "quantity";
190            default: return "?";
191          }
192        }
193        public String getSystem() {
194          switch (this) {
195            case GROUP: return "http://hl7.org/fhir/item-type";
196            case DISPLAY: return "http://hl7.org/fhir/item-type";
197            case QUESTION: return "http://hl7.org/fhir/item-type";
198            case BOOLEAN: return "http://hl7.org/fhir/item-type";
199            case DECIMAL: return "http://hl7.org/fhir/item-type";
200            case INTEGER: return "http://hl7.org/fhir/item-type";
201            case DATE: return "http://hl7.org/fhir/item-type";
202            case DATETIME: return "http://hl7.org/fhir/item-type";
203            case TIME: return "http://hl7.org/fhir/item-type";
204            case STRING: return "http://hl7.org/fhir/item-type";
205            case TEXT: return "http://hl7.org/fhir/item-type";
206            case URL: return "http://hl7.org/fhir/item-type";
207            case CHOICE: return "http://hl7.org/fhir/item-type";
208            case OPENCHOICE: return "http://hl7.org/fhir/item-type";
209            case ATTACHMENT: return "http://hl7.org/fhir/item-type";
210            case REFERENCE: return "http://hl7.org/fhir/item-type";
211            case QUANTITY: return "http://hl7.org/fhir/item-type";
212            default: return "?";
213          }
214        }
215        public String getDefinition() {
216          switch (this) {
217            case GROUP: return "An item with no direct answer but should have at least one child item.";
218            case DISPLAY: return "Text for display that will not capture an answer or have child items.";
219            case QUESTION: return "An item that defines a specific answer to be captured, and may have child items.\n(the answer provided in the QuestionnaireResponse should be of the defined datatype)";
220            case BOOLEAN: return "Question with a yes/no answer (valueBoolean)";
221            case DECIMAL: return "Question with is a real number answer (valueDecimal)";
222            case INTEGER: return "Question with an integer answer (valueInteger)";
223            case DATE: return "Question with a date answer (valueDate)";
224            case DATETIME: return "Question with a date and time answer (valueDateTime)";
225            case TIME: return "Question with a time (hour:minute:second) answer independent of date. (valueTime)";
226            case STRING: return "Question with a short (few words to short sentence) free-text entry answer (valueString)";
227            case TEXT: return "Question with a long (potentially multi-paragraph) free-text entry answer (valueString)";
228            case URL: return "Question with a URL (website, FTP site, etc.) answer (valueUri)";
229            case CHOICE: return "Question with a Coding drawn from a list of options (specified in either the option property, or via the valueset referenced in the options property) as an answer (valueCoding)";
230            case OPENCHOICE: return "Answer is a Coding drawn from a list of options (as with the choice type) or a free-text entry in a string (valueCoding or valueString)";
231            case ATTACHMENT: return "Question with binary content such as a image, PDF, etc. as an answer (valueAttachment)";
232            case REFERENCE: return "Question with a reference to another resource (practitioner, organization, etc.) as an answer (valueReference)";
233            case QUANTITY: return "Question with a combination of a numeric value and unit, potentially with a comparator (<, >, etc.) as an answer. (valueQuantity)\nThere is an extension 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit' that can be used to define what unit whould be captured (or the a unit that has a ucum conversion from the provided unit)";
234            default: return "?";
235          }
236        }
237        public String getDisplay() {
238          switch (this) {
239            case GROUP: return "Group";
240            case DISPLAY: return "Display";
241            case QUESTION: return "Question";
242            case BOOLEAN: return "Boolean";
243            case DECIMAL: return "Decimal";
244            case INTEGER: return "Integer";
245            case DATE: return "Date";
246            case DATETIME: return "Date Time";
247            case TIME: return "Time";
248            case STRING: return "String";
249            case TEXT: return "Text";
250            case URL: return "Url";
251            case CHOICE: return "Choice";
252            case OPENCHOICE: return "Open Choice";
253            case ATTACHMENT: return "Attachment";
254            case REFERENCE: return "Reference";
255            case QUANTITY: return "Quantity";
256            default: return "?";
257          }
258        }
259    }
260
261  public static class QuestionnaireItemTypeEnumFactory implements EnumFactory<QuestionnaireItemType> {
262    public QuestionnaireItemType fromCode(String codeString) throws IllegalArgumentException {
263      if (codeString == null || "".equals(codeString))
264            if (codeString == null || "".equals(codeString))
265                return null;
266        if ("group".equals(codeString))
267          return QuestionnaireItemType.GROUP;
268        if ("display".equals(codeString))
269          return QuestionnaireItemType.DISPLAY;
270        if ("question".equals(codeString))
271          return QuestionnaireItemType.QUESTION;
272        if ("boolean".equals(codeString))
273          return QuestionnaireItemType.BOOLEAN;
274        if ("decimal".equals(codeString))
275          return QuestionnaireItemType.DECIMAL;
276        if ("integer".equals(codeString))
277          return QuestionnaireItemType.INTEGER;
278        if ("date".equals(codeString))
279          return QuestionnaireItemType.DATE;
280        if ("dateTime".equals(codeString))
281          return QuestionnaireItemType.DATETIME;
282        if ("time".equals(codeString))
283          return QuestionnaireItemType.TIME;
284        if ("string".equals(codeString))
285          return QuestionnaireItemType.STRING;
286        if ("text".equals(codeString))
287          return QuestionnaireItemType.TEXT;
288        if ("url".equals(codeString))
289          return QuestionnaireItemType.URL;
290        if ("choice".equals(codeString))
291          return QuestionnaireItemType.CHOICE;
292        if ("open-choice".equals(codeString))
293          return QuestionnaireItemType.OPENCHOICE;
294        if ("attachment".equals(codeString))
295          return QuestionnaireItemType.ATTACHMENT;
296        if ("reference".equals(codeString))
297          return QuestionnaireItemType.REFERENCE;
298        if ("quantity".equals(codeString))
299          return QuestionnaireItemType.QUANTITY;
300        throw new IllegalArgumentException("Unknown QuestionnaireItemType code '"+codeString+"'");
301        }
302        public Enumeration<QuestionnaireItemType> fromType(Base code) throws FHIRException {
303          if (code == null)
304            return null;
305          if (code.isEmpty())
306            return new Enumeration<QuestionnaireItemType>(this);
307          String codeString = ((PrimitiveType) code).asStringValue();
308          if (codeString == null || "".equals(codeString))
309            return null;
310        if ("group".equals(codeString))
311          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.GROUP);
312        if ("display".equals(codeString))
313          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.DISPLAY);
314        if ("question".equals(codeString))
315          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.QUESTION);
316        if ("boolean".equals(codeString))
317          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.BOOLEAN);
318        if ("decimal".equals(codeString))
319          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.DECIMAL);
320        if ("integer".equals(codeString))
321          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.INTEGER);
322        if ("date".equals(codeString))
323          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.DATE);
324        if ("dateTime".equals(codeString))
325          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.DATETIME);
326        if ("time".equals(codeString))
327          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.TIME);
328        if ("string".equals(codeString))
329          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.STRING);
330        if ("text".equals(codeString))
331          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.TEXT);
332        if ("url".equals(codeString))
333          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.URL);
334        if ("choice".equals(codeString))
335          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.CHOICE);
336        if ("open-choice".equals(codeString))
337          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.OPENCHOICE);
338        if ("attachment".equals(codeString))
339          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.ATTACHMENT);
340        if ("reference".equals(codeString))
341          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.REFERENCE);
342        if ("quantity".equals(codeString))
343          return new Enumeration<QuestionnaireItemType>(this, QuestionnaireItemType.QUANTITY);
344        throw new FHIRException("Unknown QuestionnaireItemType code '"+codeString+"'");
345        }
346    public String toCode(QuestionnaireItemType code) {
347      if (code == QuestionnaireItemType.GROUP)
348        return "group";
349      if (code == QuestionnaireItemType.DISPLAY)
350        return "display";
351      if (code == QuestionnaireItemType.QUESTION)
352        return "question";
353      if (code == QuestionnaireItemType.BOOLEAN)
354        return "boolean";
355      if (code == QuestionnaireItemType.DECIMAL)
356        return "decimal";
357      if (code == QuestionnaireItemType.INTEGER)
358        return "integer";
359      if (code == QuestionnaireItemType.DATE)
360        return "date";
361      if (code == QuestionnaireItemType.DATETIME)
362        return "dateTime";
363      if (code == QuestionnaireItemType.TIME)
364        return "time";
365      if (code == QuestionnaireItemType.STRING)
366        return "string";
367      if (code == QuestionnaireItemType.TEXT)
368        return "text";
369      if (code == QuestionnaireItemType.URL)
370        return "url";
371      if (code == QuestionnaireItemType.CHOICE)
372        return "choice";
373      if (code == QuestionnaireItemType.OPENCHOICE)
374        return "open-choice";
375      if (code == QuestionnaireItemType.ATTACHMENT)
376        return "attachment";
377      if (code == QuestionnaireItemType.REFERENCE)
378        return "reference";
379      if (code == QuestionnaireItemType.QUANTITY)
380        return "quantity";
381      return "?";
382      }
383    public String toSystem(QuestionnaireItemType code) {
384      return code.getSystem();
385      }
386    }
387
388    @Block()
389    public static class QuestionnaireItemComponent extends BackboneElement implements IBaseBackboneElement {
390        /**
391         * An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.
392         */
393        @Child(name = "linkId", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
394        @Description(shortDefinition="Unique id for item in questionnaire", formalDefinition="An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource." )
395        protected StringType linkId;
396
397        /**
398         * A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: 
399
400* code (ElementDefinition.code)
401* type (ElementDefinition.type)
402* required (ElementDefinition.min)
403* repeats (ElementDefinition.max)
404* maxLength (ElementDefinition.maxLength)
405* options (ElementDefinition.binding)
406
407Any information provided in these elements on a Questionnaire Item overrides the information from the definition.
408         */
409        @Child(name = "definition", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false)
410        @Description(shortDefinition="ElementDefinition - details for the item", formalDefinition="A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: \n\n* code (ElementDefinition.code)\n* type (ElementDefinition.type)\n* required (ElementDefinition.min)\n* repeats (ElementDefinition.max)\n* maxLength (ElementDefinition.maxLength)\n* options (ElementDefinition.binding)\n\nAny information provided in these elements on a Questionnaire Item overrides the information from the definition." )
411        protected UriType definition;
412
413        /**
414         * A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers).
415         */
416        @Child(name = "code", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
417        @Description(shortDefinition="Corresponding concept for this item in a terminology", formalDefinition="A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers)." )
418        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/questionnaire-questions")
419        protected List<Coding> code;
420
421        /**
422         * A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire.
423         */
424        @Child(name = "prefix", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
425        @Description(shortDefinition="E.g. \"1(a)\", \"2.5.3\"", formalDefinition="A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire." )
426        protected StringType prefix;
427
428        /**
429         * The name of a section, the text of a question or text content for a display item.
430         */
431        @Child(name = "text", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
432        @Description(shortDefinition="Primary text for the item", formalDefinition="The name of a section, the text of a question or text content for a display item." )
433        protected StringType text;
434
435        /**
436         * The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).
437         */
438        @Child(name = "type", type = {CodeType.class}, order=6, min=1, max=1, modifier=false, summary=false)
439        @Description(shortDefinition="group | display | boolean | decimal | integer | date | dateTime +", formalDefinition="The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.)." )
440        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/item-type")
441        protected Enumeration<QuestionnaireItemType> type;
442
443        /**
444         * A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.
445         */
446        @Child(name = "enableWhen", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true)
447        @Description(shortDefinition="Only allow data when", formalDefinition="A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true." )
448        protected List<QuestionnaireItemEnableWhenComponent> enableWhen;
449
450        /**
451         * An indication, if true, that the item must be present in a "completed" QuestionnaireResponse.  If false, the item may be skipped when answering the questionnaire.
452         */
453        @Child(name = "required", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false)
454        @Description(shortDefinition="Whether the item must be included in data results", formalDefinition="An indication, if true, that the item must be present in a \"completed\" QuestionnaireResponse.  If false, the item may be skipped when answering the questionnaire." )
455        protected BooleanType required;
456
457        /**
458         * An indication, if true, that the item may occur multiple times in the response, collecting multiple answers answers for questions or multiple sets of answers for groups.
459         */
460        @Child(name = "repeats", type = {BooleanType.class}, order=9, min=0, max=1, modifier=false, summary=false)
461        @Description(shortDefinition="Whether the item may repeat", formalDefinition="An indication, if true, that the item may occur multiple times in the response, collecting multiple answers answers for questions or multiple sets of answers for groups." )
462        protected BooleanType repeats;
463
464        /**
465         * An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.
466         */
467        @Child(name = "readOnly", type = {BooleanType.class}, order=10, min=0, max=1, modifier=false, summary=false)
468        @Description(shortDefinition="Don't allow human editing", formalDefinition="An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire." )
469        protected BooleanType readOnly;
470
471        /**
472         * The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.
473         */
474        @Child(name = "maxLength", type = {IntegerType.class}, order=11, min=0, max=1, modifier=false, summary=false)
475        @Description(shortDefinition="No more than this many characters", formalDefinition="The maximum number of characters that are permitted in the answer to be considered a \"valid\" QuestionnaireResponse." )
476        protected IntegerType maxLength;
477
478        /**
479         * A reference to a value set containing a list of codes representing permitted answers for a "choice" or "open-choice" question.
480         */
481        @Child(name = "options", type = {ValueSet.class}, order=12, min=0, max=1, modifier=false, summary=false)
482        @Description(shortDefinition="Valueset containing permitted answers", formalDefinition="A reference to a value set containing a list of codes representing permitted answers for a \"choice\" or \"open-choice\" question." )
483        protected Reference options;
484
485        /**
486         * The actual object that is the target of the reference (A reference to a value set containing a list of codes representing permitted answers for a "choice" or "open-choice" question.)
487         */
488        protected ValueSet optionsTarget;
489
490        /**
491         * One of the permitted answers for a "choice" or "open-choice" question.
492         */
493        @Child(name = "option", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
494        @Description(shortDefinition="Permitted answer", formalDefinition="One of the permitted answers for a \"choice\" or \"open-choice\" question." )
495        protected List<QuestionnaireItemOptionComponent> option;
496
497        /**
498         * The value that should be defaulted when initially rendering the questionnaire for user input.
499         */
500        @Child(name = "initial", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class, Reference.class}, order=14, min=0, max=1, modifier=false, summary=false)
501        @Description(shortDefinition="Default value when item is first rendered", formalDefinition="The value that should be defaulted when initially rendering the questionnaire for user input." )
502        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/questionnaire-answers")
503        protected Type initial;
504
505        /**
506         * Text, questions and other groups to be nested beneath a question or group.
507         */
508        @Child(name = "item", type = {QuestionnaireItemComponent.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
509        @Description(shortDefinition="Nested questionnaire items", formalDefinition="Text, questions and other groups to be nested beneath a question or group." )
510        protected List<QuestionnaireItemComponent> item;
511
512        private static final long serialVersionUID = -1997112302L;
513
514    /**
515     * Constructor
516     */
517      public QuestionnaireItemComponent() {
518        super();
519      }
520
521    /**
522     * Constructor
523     */
524      public QuestionnaireItemComponent(StringType linkId, Enumeration<QuestionnaireItemType> type) {
525        super();
526        this.linkId = linkId;
527        this.type = type;
528      }
529
530        /**
531         * @return {@link #linkId} (An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value
532         */
533        public StringType getLinkIdElement() { 
534          if (this.linkId == null)
535            if (Configuration.errorOnAutoCreate())
536              throw new Error("Attempt to auto-create QuestionnaireItemComponent.linkId");
537            else if (Configuration.doAutoCreate())
538              this.linkId = new StringType(); // bb
539          return this.linkId;
540        }
541
542        public boolean hasLinkIdElement() { 
543          return this.linkId != null && !this.linkId.isEmpty();
544        }
545
546        public boolean hasLinkId() { 
547          return this.linkId != null && !this.linkId.isEmpty();
548        }
549
550        /**
551         * @param value {@link #linkId} (An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value
552         */
553        public QuestionnaireItemComponent setLinkIdElement(StringType value) { 
554          this.linkId = value;
555          return this;
556        }
557
558        /**
559         * @return An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.
560         */
561        public String getLinkId() { 
562          return this.linkId == null ? null : this.linkId.getValue();
563        }
564
565        /**
566         * @param value An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.
567         */
568        public QuestionnaireItemComponent setLinkId(String value) { 
569            if (this.linkId == null)
570              this.linkId = new StringType();
571            this.linkId.setValue(value);
572          return this;
573        }
574
575        /**
576         * @return {@link #definition} (A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: 
577
578* code (ElementDefinition.code)
579* type (ElementDefinition.type)
580* required (ElementDefinition.min)
581* repeats (ElementDefinition.max)
582* maxLength (ElementDefinition.maxLength)
583* options (ElementDefinition.binding)
584
585Any information provided in these elements on a Questionnaire Item overrides the information from the definition.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
586         */
587        public UriType getDefinitionElement() { 
588          if (this.definition == null)
589            if (Configuration.errorOnAutoCreate())
590              throw new Error("Attempt to auto-create QuestionnaireItemComponent.definition");
591            else if (Configuration.doAutoCreate())
592              this.definition = new UriType(); // bb
593          return this.definition;
594        }
595
596        public boolean hasDefinitionElement() { 
597          return this.definition != null && !this.definition.isEmpty();
598        }
599
600        public boolean hasDefinition() { 
601          return this.definition != null && !this.definition.isEmpty();
602        }
603
604        /**
605         * @param value {@link #definition} (A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: 
606
607* code (ElementDefinition.code)
608* type (ElementDefinition.type)
609* required (ElementDefinition.min)
610* repeats (ElementDefinition.max)
611* maxLength (ElementDefinition.maxLength)
612* options (ElementDefinition.binding)
613
614Any information provided in these elements on a Questionnaire Item overrides the information from the definition.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
615         */
616        public QuestionnaireItemComponent setDefinitionElement(UriType value) { 
617          this.definition = value;
618          return this;
619        }
620
621        /**
622         * @return A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: 
623
624* code (ElementDefinition.code)
625* type (ElementDefinition.type)
626* required (ElementDefinition.min)
627* repeats (ElementDefinition.max)
628* maxLength (ElementDefinition.maxLength)
629* options (ElementDefinition.binding)
630
631Any information provided in these elements on a Questionnaire Item overrides the information from the definition.
632         */
633        public String getDefinition() { 
634          return this.definition == null ? null : this.definition.getValue();
635        }
636
637        /**
638         * @param value A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: 
639
640* code (ElementDefinition.code)
641* type (ElementDefinition.type)
642* required (ElementDefinition.min)
643* repeats (ElementDefinition.max)
644* maxLength (ElementDefinition.maxLength)
645* options (ElementDefinition.binding)
646
647Any information provided in these elements on a Questionnaire Item overrides the information from the definition.
648         */
649        public QuestionnaireItemComponent setDefinition(String value) { 
650          if (Utilities.noString(value))
651            this.definition = null;
652          else {
653            if (this.definition == null)
654              this.definition = new UriType();
655            this.definition.setValue(value);
656          }
657          return this;
658        }
659
660        /**
661         * @return {@link #code} (A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers).)
662         */
663        public List<Coding> getCode() { 
664          if (this.code == null)
665            this.code = new ArrayList<Coding>();
666          return this.code;
667        }
668
669        /**
670         * @return Returns a reference to <code>this</code> for easy method chaining
671         */
672        public QuestionnaireItemComponent setCode(List<Coding> theCode) { 
673          this.code = theCode;
674          return this;
675        }
676
677        public boolean hasCode() { 
678          if (this.code == null)
679            return false;
680          for (Coding item : this.code)
681            if (!item.isEmpty())
682              return true;
683          return false;
684        }
685
686        public Coding addCode() { //3
687          Coding t = new Coding();
688          if (this.code == null)
689            this.code = new ArrayList<Coding>();
690          this.code.add(t);
691          return t;
692        }
693
694        public QuestionnaireItemComponent addCode(Coding t) { //3
695          if (t == null)
696            return this;
697          if (this.code == null)
698            this.code = new ArrayList<Coding>();
699          this.code.add(t);
700          return this;
701        }
702
703        /**
704         * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist
705         */
706        public Coding getCodeFirstRep() { 
707          if (getCode().isEmpty()) {
708            addCode();
709          }
710          return getCode().get(0);
711        }
712
713        /**
714         * @return {@link #prefix} (A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPrefix" gives direct access to the value
715         */
716        public StringType getPrefixElement() { 
717          if (this.prefix == null)
718            if (Configuration.errorOnAutoCreate())
719              throw new Error("Attempt to auto-create QuestionnaireItemComponent.prefix");
720            else if (Configuration.doAutoCreate())
721              this.prefix = new StringType(); // bb
722          return this.prefix;
723        }
724
725        public boolean hasPrefixElement() { 
726          return this.prefix != null && !this.prefix.isEmpty();
727        }
728
729        public boolean hasPrefix() { 
730          return this.prefix != null && !this.prefix.isEmpty();
731        }
732
733        /**
734         * @param value {@link #prefix} (A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPrefix" gives direct access to the value
735         */
736        public QuestionnaireItemComponent setPrefixElement(StringType value) { 
737          this.prefix = value;
738          return this;
739        }
740
741        /**
742         * @return A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire.
743         */
744        public String getPrefix() { 
745          return this.prefix == null ? null : this.prefix.getValue();
746        }
747
748        /**
749         * @param value A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire.
750         */
751        public QuestionnaireItemComponent setPrefix(String value) { 
752          if (Utilities.noString(value))
753            this.prefix = null;
754          else {
755            if (this.prefix == null)
756              this.prefix = new StringType();
757            this.prefix.setValue(value);
758          }
759          return this;
760        }
761
762        /**
763         * @return {@link #text} (The name of a section, the text of a question or text content for a display item.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
764         */
765        public StringType getTextElement() { 
766          if (this.text == null)
767            if (Configuration.errorOnAutoCreate())
768              throw new Error("Attempt to auto-create QuestionnaireItemComponent.text");
769            else if (Configuration.doAutoCreate())
770              this.text = new StringType(); // bb
771          return this.text;
772        }
773
774        public boolean hasTextElement() { 
775          return this.text != null && !this.text.isEmpty();
776        }
777
778        public boolean hasText() { 
779          return this.text != null && !this.text.isEmpty();
780        }
781
782        /**
783         * @param value {@link #text} (The name of a section, the text of a question or text content for a display item.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
784         */
785        public QuestionnaireItemComponent setTextElement(StringType value) { 
786          this.text = value;
787          return this;
788        }
789
790        /**
791         * @return The name of a section, the text of a question or text content for a display item.
792         */
793        public String getText() { 
794          return this.text == null ? null : this.text.getValue();
795        }
796
797        /**
798         * @param value The name of a section, the text of a question or text content for a display item.
799         */
800        public QuestionnaireItemComponent setText(String value) { 
801          if (Utilities.noString(value))
802            this.text = null;
803          else {
804            if (this.text == null)
805              this.text = new StringType();
806            this.text.setValue(value);
807          }
808          return this;
809        }
810
811        /**
812         * @return {@link #type} (The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
813         */
814        public Enumeration<QuestionnaireItemType> getTypeElement() { 
815          if (this.type == null)
816            if (Configuration.errorOnAutoCreate())
817              throw new Error("Attempt to auto-create QuestionnaireItemComponent.type");
818            else if (Configuration.doAutoCreate())
819              this.type = new Enumeration<QuestionnaireItemType>(new QuestionnaireItemTypeEnumFactory()); // bb
820          return this.type;
821        }
822
823        public boolean hasTypeElement() { 
824          return this.type != null && !this.type.isEmpty();
825        }
826
827        public boolean hasType() { 
828          return this.type != null && !this.type.isEmpty();
829        }
830
831        /**
832         * @param value {@link #type} (The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
833         */
834        public QuestionnaireItemComponent setTypeElement(Enumeration<QuestionnaireItemType> value) { 
835          this.type = value;
836          return this;
837        }
838
839        /**
840         * @return The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).
841         */
842        public QuestionnaireItemType getType() { 
843          return this.type == null ? null : this.type.getValue();
844        }
845
846        /**
847         * @param value The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).
848         */
849        public QuestionnaireItemComponent setType(QuestionnaireItemType value) { 
850            if (this.type == null)
851              this.type = new Enumeration<QuestionnaireItemType>(new QuestionnaireItemTypeEnumFactory());
852            this.type.setValue(value);
853          return this;
854        }
855
856        /**
857         * @return {@link #enableWhen} (A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.)
858         */
859        public List<QuestionnaireItemEnableWhenComponent> getEnableWhen() { 
860          if (this.enableWhen == null)
861            this.enableWhen = new ArrayList<QuestionnaireItemEnableWhenComponent>();
862          return this.enableWhen;
863        }
864
865        /**
866         * @return Returns a reference to <code>this</code> for easy method chaining
867         */
868        public QuestionnaireItemComponent setEnableWhen(List<QuestionnaireItemEnableWhenComponent> theEnableWhen) { 
869          this.enableWhen = theEnableWhen;
870          return this;
871        }
872
873        public boolean hasEnableWhen() { 
874          if (this.enableWhen == null)
875            return false;
876          for (QuestionnaireItemEnableWhenComponent item : this.enableWhen)
877            if (!item.isEmpty())
878              return true;
879          return false;
880        }
881
882        public QuestionnaireItemEnableWhenComponent addEnableWhen() { //3
883          QuestionnaireItemEnableWhenComponent t = new QuestionnaireItemEnableWhenComponent();
884          if (this.enableWhen == null)
885            this.enableWhen = new ArrayList<QuestionnaireItemEnableWhenComponent>();
886          this.enableWhen.add(t);
887          return t;
888        }
889
890        public QuestionnaireItemComponent addEnableWhen(QuestionnaireItemEnableWhenComponent t) { //3
891          if (t == null)
892            return this;
893          if (this.enableWhen == null)
894            this.enableWhen = new ArrayList<QuestionnaireItemEnableWhenComponent>();
895          this.enableWhen.add(t);
896          return this;
897        }
898
899        /**
900         * @return The first repetition of repeating field {@link #enableWhen}, creating it if it does not already exist
901         */
902        public QuestionnaireItemEnableWhenComponent getEnableWhenFirstRep() { 
903          if (getEnableWhen().isEmpty()) {
904            addEnableWhen();
905          }
906          return getEnableWhen().get(0);
907        }
908
909        /**
910         * @return {@link #required} (An indication, if true, that the item must be present in a "completed" QuestionnaireResponse.  If false, the item may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value
911         */
912        public BooleanType getRequiredElement() { 
913          if (this.required == null)
914            if (Configuration.errorOnAutoCreate())
915              throw new Error("Attempt to auto-create QuestionnaireItemComponent.required");
916            else if (Configuration.doAutoCreate())
917              this.required = new BooleanType(); // bb
918          return this.required;
919        }
920
921        public boolean hasRequiredElement() { 
922          return this.required != null && !this.required.isEmpty();
923        }
924
925        public boolean hasRequired() { 
926          return this.required != null && !this.required.isEmpty();
927        }
928
929        /**
930         * @param value {@link #required} (An indication, if true, that the item must be present in a "completed" QuestionnaireResponse.  If false, the item may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value
931         */
932        public QuestionnaireItemComponent setRequiredElement(BooleanType value) { 
933          this.required = value;
934          return this;
935        }
936
937        /**
938         * @return An indication, if true, that the item must be present in a "completed" QuestionnaireResponse.  If false, the item may be skipped when answering the questionnaire.
939         */
940        public boolean getRequired() { 
941          return this.required == null || this.required.isEmpty() ? false : this.required.getValue();
942        }
943
944        /**
945         * @param value An indication, if true, that the item must be present in a "completed" QuestionnaireResponse.  If false, the item may be skipped when answering the questionnaire.
946         */
947        public QuestionnaireItemComponent setRequired(boolean value) { 
948            if (this.required == null)
949              this.required = new BooleanType();
950            this.required.setValue(value);
951          return this;
952        }
953
954        /**
955         * @return {@link #repeats} (An indication, if true, that the item may occur multiple times in the response, collecting multiple answers answers for questions or multiple sets of answers for groups.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value
956         */
957        public BooleanType getRepeatsElement() { 
958          if (this.repeats == null)
959            if (Configuration.errorOnAutoCreate())
960              throw new Error("Attempt to auto-create QuestionnaireItemComponent.repeats");
961            else if (Configuration.doAutoCreate())
962              this.repeats = new BooleanType(); // bb
963          return this.repeats;
964        }
965
966        public boolean hasRepeatsElement() { 
967          return this.repeats != null && !this.repeats.isEmpty();
968        }
969
970        public boolean hasRepeats() { 
971          return this.repeats != null && !this.repeats.isEmpty();
972        }
973
974        /**
975         * @param value {@link #repeats} (An indication, if true, that the item may occur multiple times in the response, collecting multiple answers answers for questions or multiple sets of answers for groups.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value
976         */
977        public QuestionnaireItemComponent setRepeatsElement(BooleanType value) { 
978          this.repeats = value;
979          return this;
980        }
981
982        /**
983         * @return An indication, if true, that the item may occur multiple times in the response, collecting multiple answers answers for questions or multiple sets of answers for groups.
984         */
985        public boolean getRepeats() { 
986          return this.repeats == null || this.repeats.isEmpty() ? false : this.repeats.getValue();
987        }
988
989        /**
990         * @param value An indication, if true, that the item may occur multiple times in the response, collecting multiple answers answers for questions or multiple sets of answers for groups.
991         */
992        public QuestionnaireItemComponent setRepeats(boolean value) { 
993            if (this.repeats == null)
994              this.repeats = new BooleanType();
995            this.repeats.setValue(value);
996          return this;
997        }
998
999        /**
1000         * @return {@link #readOnly} (An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.). This is the underlying object with id, value and extensions. The accessor "getReadOnly" gives direct access to the value
1001         */
1002        public BooleanType getReadOnlyElement() { 
1003          if (this.readOnly == null)
1004            if (Configuration.errorOnAutoCreate())
1005              throw new Error("Attempt to auto-create QuestionnaireItemComponent.readOnly");
1006            else if (Configuration.doAutoCreate())
1007              this.readOnly = new BooleanType(); // bb
1008          return this.readOnly;
1009        }
1010
1011        public boolean hasReadOnlyElement() { 
1012          return this.readOnly != null && !this.readOnly.isEmpty();
1013        }
1014
1015        public boolean hasReadOnly() { 
1016          return this.readOnly != null && !this.readOnly.isEmpty();
1017        }
1018
1019        /**
1020         * @param value {@link #readOnly} (An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.). This is the underlying object with id, value and extensions. The accessor "getReadOnly" gives direct access to the value
1021         */
1022        public QuestionnaireItemComponent setReadOnlyElement(BooleanType value) { 
1023          this.readOnly = value;
1024          return this;
1025        }
1026
1027        /**
1028         * @return An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.
1029         */
1030        public boolean getReadOnly() { 
1031          return this.readOnly == null || this.readOnly.isEmpty() ? false : this.readOnly.getValue();
1032        }
1033
1034        /**
1035         * @param value An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.
1036         */
1037        public QuestionnaireItemComponent setReadOnly(boolean value) { 
1038            if (this.readOnly == null)
1039              this.readOnly = new BooleanType();
1040            this.readOnly.setValue(value);
1041          return this;
1042        }
1043
1044        /**
1045         * @return {@link #maxLength} (The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value
1046         */
1047        public IntegerType getMaxLengthElement() { 
1048          if (this.maxLength == null)
1049            if (Configuration.errorOnAutoCreate())
1050              throw new Error("Attempt to auto-create QuestionnaireItemComponent.maxLength");
1051            else if (Configuration.doAutoCreate())
1052              this.maxLength = new IntegerType(); // bb
1053          return this.maxLength;
1054        }
1055
1056        public boolean hasMaxLengthElement() { 
1057          return this.maxLength != null && !this.maxLength.isEmpty();
1058        }
1059
1060        public boolean hasMaxLength() { 
1061          return this.maxLength != null && !this.maxLength.isEmpty();
1062        }
1063
1064        /**
1065         * @param value {@link #maxLength} (The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value
1066         */
1067        public QuestionnaireItemComponent setMaxLengthElement(IntegerType value) { 
1068          this.maxLength = value;
1069          return this;
1070        }
1071
1072        /**
1073         * @return The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.
1074         */
1075        public int getMaxLength() { 
1076          return this.maxLength == null || this.maxLength.isEmpty() ? 0 : this.maxLength.getValue();
1077        }
1078
1079        /**
1080         * @param value The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.
1081         */
1082        public QuestionnaireItemComponent setMaxLength(int value) { 
1083            if (this.maxLength == null)
1084              this.maxLength = new IntegerType();
1085            this.maxLength.setValue(value);
1086          return this;
1087        }
1088
1089        /**
1090         * @return {@link #options} (A reference to a value set containing a list of codes representing permitted answers for a "choice" or "open-choice" question.)
1091         */
1092        public Reference getOptions() { 
1093          if (this.options == null)
1094            if (Configuration.errorOnAutoCreate())
1095              throw new Error("Attempt to auto-create QuestionnaireItemComponent.options");
1096            else if (Configuration.doAutoCreate())
1097              this.options = new Reference(); // cc
1098          return this.options;
1099        }
1100
1101        public boolean hasOptions() { 
1102          return this.options != null && !this.options.isEmpty();
1103        }
1104
1105        /**
1106         * @param value {@link #options} (A reference to a value set containing a list of codes representing permitted answers for a "choice" or "open-choice" question.)
1107         */
1108        public QuestionnaireItemComponent setOptions(Reference value)  { 
1109          this.options = value;
1110          return this;
1111        }
1112
1113        /**
1114         * @return {@link #options} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to a value set containing a list of codes representing permitted answers for a "choice" or "open-choice" question.)
1115         */
1116        public ValueSet getOptionsTarget() { 
1117          if (this.optionsTarget == null)
1118            if (Configuration.errorOnAutoCreate())
1119              throw new Error("Attempt to auto-create QuestionnaireItemComponent.options");
1120            else if (Configuration.doAutoCreate())
1121              this.optionsTarget = new ValueSet(); // aa
1122          return this.optionsTarget;
1123        }
1124
1125        /**
1126         * @param value {@link #options} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to a value set containing a list of codes representing permitted answers for a "choice" or "open-choice" question.)
1127         */
1128        public QuestionnaireItemComponent setOptionsTarget(ValueSet value) { 
1129          this.optionsTarget = value;
1130          return this;
1131        }
1132
1133        /**
1134         * @return {@link #option} (One of the permitted answers for a "choice" or "open-choice" question.)
1135         */
1136        public List<QuestionnaireItemOptionComponent> getOption() { 
1137          if (this.option == null)
1138            this.option = new ArrayList<QuestionnaireItemOptionComponent>();
1139          return this.option;
1140        }
1141
1142        /**
1143         * @return Returns a reference to <code>this</code> for easy method chaining
1144         */
1145        public QuestionnaireItemComponent setOption(List<QuestionnaireItemOptionComponent> theOption) { 
1146          this.option = theOption;
1147          return this;
1148        }
1149
1150        public boolean hasOption() { 
1151          if (this.option == null)
1152            return false;
1153          for (QuestionnaireItemOptionComponent item : this.option)
1154            if (!item.isEmpty())
1155              return true;
1156          return false;
1157        }
1158
1159        public QuestionnaireItemOptionComponent addOption() { //3
1160          QuestionnaireItemOptionComponent t = new QuestionnaireItemOptionComponent();
1161          if (this.option == null)
1162            this.option = new ArrayList<QuestionnaireItemOptionComponent>();
1163          this.option.add(t);
1164          return t;
1165        }
1166
1167        public QuestionnaireItemComponent addOption(QuestionnaireItemOptionComponent t) { //3
1168          if (t == null)
1169            return this;
1170          if (this.option == null)
1171            this.option = new ArrayList<QuestionnaireItemOptionComponent>();
1172          this.option.add(t);
1173          return this;
1174        }
1175
1176        /**
1177         * @return The first repetition of repeating field {@link #option}, creating it if it does not already exist
1178         */
1179        public QuestionnaireItemOptionComponent getOptionFirstRep() { 
1180          if (getOption().isEmpty()) {
1181            addOption();
1182          }
1183          return getOption().get(0);
1184        }
1185
1186        /**
1187         * @return {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1188         */
1189        public Type getInitial() { 
1190          return this.initial;
1191        }
1192
1193        /**
1194         * @return {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1195         */
1196        public BooleanType getInitialBooleanType() throws FHIRException { 
1197          if (this.initial == null)
1198            return null;
1199          if (!(this.initial instanceof BooleanType))
1200            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.initial.getClass().getName()+" was encountered");
1201          return (BooleanType) this.initial;
1202        }
1203
1204        public boolean hasInitialBooleanType() { 
1205          return this != null && this.initial instanceof BooleanType;
1206        }
1207
1208        /**
1209         * @return {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1210         */
1211        public DecimalType getInitialDecimalType() throws FHIRException { 
1212          if (this.initial == null)
1213            return null;
1214          if (!(this.initial instanceof DecimalType))
1215            throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.initial.getClass().getName()+" was encountered");
1216          return (DecimalType) this.initial;
1217        }
1218
1219        public boolean hasInitialDecimalType() { 
1220          return this != null && this.initial instanceof DecimalType;
1221        }
1222
1223        /**
1224         * @return {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1225         */
1226        public IntegerType getInitialIntegerType() throws FHIRException { 
1227          if (this.initial == null)
1228            return null;
1229          if (!(this.initial instanceof IntegerType))
1230            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.initial.getClass().getName()+" was encountered");
1231          return (IntegerType) this.initial;
1232        }
1233
1234        public boolean hasInitialIntegerType() { 
1235          return this != null && this.initial instanceof IntegerType;
1236        }
1237
1238        /**
1239         * @return {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1240         */
1241        public DateType getInitialDateType() throws FHIRException { 
1242          if (this.initial == null)
1243            return null;
1244          if (!(this.initial instanceof DateType))
1245            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.initial.getClass().getName()+" was encountered");
1246          return (DateType) this.initial;
1247        }
1248
1249        public boolean hasInitialDateType() { 
1250          return this != null && this.initial instanceof DateType;
1251        }
1252
1253        /**
1254         * @return {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1255         */
1256        public DateTimeType getInitialDateTimeType() throws FHIRException { 
1257          if (this.initial == null)
1258            return null;
1259          if (!(this.initial instanceof DateTimeType))
1260            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.initial.getClass().getName()+" was encountered");
1261          return (DateTimeType) this.initial;
1262        }
1263
1264        public boolean hasInitialDateTimeType() { 
1265          return this != null && this.initial instanceof DateTimeType;
1266        }
1267
1268        /**
1269         * @return {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1270         */
1271        public TimeType getInitialTimeType() throws FHIRException { 
1272          if (this.initial == null)
1273            return null;
1274          if (!(this.initial instanceof TimeType))
1275            throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.initial.getClass().getName()+" was encountered");
1276          return (TimeType) this.initial;
1277        }
1278
1279        public boolean hasInitialTimeType() { 
1280          return this != null && this.initial instanceof TimeType;
1281        }
1282
1283        /**
1284         * @return {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1285         */
1286        public StringType getInitialStringType() throws FHIRException { 
1287          if (this.initial == null)
1288            return null;
1289          if (!(this.initial instanceof StringType))
1290            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.initial.getClass().getName()+" was encountered");
1291          return (StringType) this.initial;
1292        }
1293
1294        public boolean hasInitialStringType() { 
1295          return this != null && this.initial instanceof StringType;
1296        }
1297
1298        /**
1299         * @return {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1300         */
1301        public UriType getInitialUriType() throws FHIRException { 
1302          if (this.initial == null)
1303            return null;
1304          if (!(this.initial instanceof UriType))
1305            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.initial.getClass().getName()+" was encountered");
1306          return (UriType) this.initial;
1307        }
1308
1309        public boolean hasInitialUriType() { 
1310          return this != null && this.initial instanceof UriType;
1311        }
1312
1313        /**
1314         * @return {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1315         */
1316        public Attachment getInitialAttachment() throws FHIRException { 
1317          if (this.initial == null)
1318            return null;
1319          if (!(this.initial instanceof Attachment))
1320            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.initial.getClass().getName()+" was encountered");
1321          return (Attachment) this.initial;
1322        }
1323
1324        public boolean hasInitialAttachment() { 
1325          return this != null && this.initial instanceof Attachment;
1326        }
1327
1328        /**
1329         * @return {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1330         */
1331        public Coding getInitialCoding() throws FHIRException { 
1332          if (this.initial == null)
1333            return null;
1334          if (!(this.initial instanceof Coding))
1335            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.initial.getClass().getName()+" was encountered");
1336          return (Coding) this.initial;
1337        }
1338
1339        public boolean hasInitialCoding() { 
1340          return this != null && this.initial instanceof Coding;
1341        }
1342
1343        /**
1344         * @return {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1345         */
1346        public Quantity getInitialQuantity() throws FHIRException { 
1347          if (this.initial == null)
1348            return null;
1349          if (!(this.initial instanceof Quantity))
1350            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.initial.getClass().getName()+" was encountered");
1351          return (Quantity) this.initial;
1352        }
1353
1354        public boolean hasInitialQuantity() { 
1355          return this != null && this.initial instanceof Quantity;
1356        }
1357
1358        /**
1359         * @return {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1360         */
1361        public Reference getInitialReference() throws FHIRException { 
1362          if (this.initial == null)
1363            return null;
1364          if (!(this.initial instanceof Reference))
1365            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.initial.getClass().getName()+" was encountered");
1366          return (Reference) this.initial;
1367        }
1368
1369        public boolean hasInitialReference() { 
1370          return this != null && this.initial instanceof Reference;
1371        }
1372
1373        public boolean hasInitial() { 
1374          return this.initial != null && !this.initial.isEmpty();
1375        }
1376
1377        /**
1378         * @param value {@link #initial} (The value that should be defaulted when initially rendering the questionnaire for user input.)
1379         */
1380        public QuestionnaireItemComponent setInitial(Type value) throws FHIRFormatError { 
1381          if (value != null && !(value instanceof BooleanType || value instanceof DecimalType || value instanceof IntegerType || value instanceof DateType || value instanceof DateTimeType || value instanceof TimeType || value instanceof StringType || value instanceof UriType || value instanceof Attachment || value instanceof Coding || value instanceof Quantity || value instanceof Reference))
1382            throw new FHIRFormatError("Not the right type for Questionnaire.item.initial[x]: "+value.fhirType());
1383          this.initial = value;
1384          return this;
1385        }
1386
1387        /**
1388         * @return {@link #item} (Text, questions and other groups to be nested beneath a question or group.)
1389         */
1390        public List<QuestionnaireItemComponent> getItem() { 
1391          if (this.item == null)
1392            this.item = new ArrayList<QuestionnaireItemComponent>();
1393          return this.item;
1394        }
1395
1396        /**
1397         * @return Returns a reference to <code>this</code> for easy method chaining
1398         */
1399        public QuestionnaireItemComponent setItem(List<QuestionnaireItemComponent> theItem) { 
1400          this.item = theItem;
1401          return this;
1402        }
1403
1404        public boolean hasItem() { 
1405          if (this.item == null)
1406            return false;
1407          for (QuestionnaireItemComponent item : this.item)
1408            if (!item.isEmpty())
1409              return true;
1410          return false;
1411        }
1412
1413        public QuestionnaireItemComponent addItem() { //3
1414          QuestionnaireItemComponent t = new QuestionnaireItemComponent();
1415          if (this.item == null)
1416            this.item = new ArrayList<QuestionnaireItemComponent>();
1417          this.item.add(t);
1418          return t;
1419        }
1420
1421        public QuestionnaireItemComponent addItem(QuestionnaireItemComponent t) { //3
1422          if (t == null)
1423            return this;
1424          if (this.item == null)
1425            this.item = new ArrayList<QuestionnaireItemComponent>();
1426          this.item.add(t);
1427          return this;
1428        }
1429
1430        /**
1431         * @return The first repetition of repeating field {@link #item}, creating it if it does not already exist
1432         */
1433        public QuestionnaireItemComponent getItemFirstRep() { 
1434          if (getItem().isEmpty()) {
1435            addItem();
1436          }
1437          return getItem().get(0);
1438        }
1439
1440        protected void listChildren(List<Property> children) {
1441          super.listChildren(children);
1442          children.add(new Property("linkId", "string", "An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.", 0, 1, linkId));
1443          children.add(new Property("definition", "uri", "A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: \n\n* code (ElementDefinition.code)\n* type (ElementDefinition.type)\n* required (ElementDefinition.min)\n* repeats (ElementDefinition.max)\n* maxLength (ElementDefinition.maxLength)\n* options (ElementDefinition.binding)\n\nAny information provided in these elements on a Questionnaire Item overrides the information from the definition.", 0, 1, definition));
1444          children.add(new Property("code", "Coding", "A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers).", 0, java.lang.Integer.MAX_VALUE, code));
1445          children.add(new Property("prefix", "string", "A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire.", 0, 1, prefix));
1446          children.add(new Property("text", "string", "The name of a section, the text of a question or text content for a display item.", 0, 1, text));
1447          children.add(new Property("type", "code", "The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).", 0, 1, type));
1448          children.add(new Property("enableWhen", "", "A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.", 0, java.lang.Integer.MAX_VALUE, enableWhen));
1449          children.add(new Property("required", "boolean", "An indication, if true, that the item must be present in a \"completed\" QuestionnaireResponse.  If false, the item may be skipped when answering the questionnaire.", 0, 1, required));
1450          children.add(new Property("repeats", "boolean", "An indication, if true, that the item may occur multiple times in the response, collecting multiple answers answers for questions or multiple sets of answers for groups.", 0, 1, repeats));
1451          children.add(new Property("readOnly", "boolean", "An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.", 0, 1, readOnly));
1452          children.add(new Property("maxLength", "integer", "The maximum number of characters that are permitted in the answer to be considered a \"valid\" QuestionnaireResponse.", 0, 1, maxLength));
1453          children.add(new Property("options", "Reference(ValueSet)", "A reference to a value set containing a list of codes representing permitted answers for a \"choice\" or \"open-choice\" question.", 0, 1, options));
1454          children.add(new Property("option", "", "One of the permitted answers for a \"choice\" or \"open-choice\" question.", 0, java.lang.Integer.MAX_VALUE, option));
1455          children.add(new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial));
1456          children.add(new Property("item", "@Questionnaire.item", "Text, questions and other groups to be nested beneath a question or group.", 0, java.lang.Integer.MAX_VALUE, item));
1457        }
1458
1459        @Override
1460        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1461          switch (_hash) {
1462          case -1102667083: /*linkId*/  return new Property("linkId", "string", "An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.", 0, 1, linkId);
1463          case -1014418093: /*definition*/  return new Property("definition", "uri", "A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: \n\n* code (ElementDefinition.code)\n* type (ElementDefinition.type)\n* required (ElementDefinition.min)\n* repeats (ElementDefinition.max)\n* maxLength (ElementDefinition.maxLength)\n* options (ElementDefinition.binding)\n\nAny information provided in these elements on a Questionnaire Item overrides the information from the definition.", 0, 1, definition);
1464          case 3059181: /*code*/  return new Property("code", "Coding", "A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers).", 0, java.lang.Integer.MAX_VALUE, code);
1465          case -980110702: /*prefix*/  return new Property("prefix", "string", "A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire.", 0, 1, prefix);
1466          case 3556653: /*text*/  return new Property("text", "string", "The name of a section, the text of a question or text content for a display item.", 0, 1, text);
1467          case 3575610: /*type*/  return new Property("type", "code", "The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).", 0, 1, type);
1468          case 1893321565: /*enableWhen*/  return new Property("enableWhen", "", "A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.", 0, java.lang.Integer.MAX_VALUE, enableWhen);
1469          case -393139297: /*required*/  return new Property("required", "boolean", "An indication, if true, that the item must be present in a \"completed\" QuestionnaireResponse.  If false, the item may be skipped when answering the questionnaire.", 0, 1, required);
1470          case 1094288952: /*repeats*/  return new Property("repeats", "boolean", "An indication, if true, that the item may occur multiple times in the response, collecting multiple answers answers for questions or multiple sets of answers for groups.", 0, 1, repeats);
1471          case -867683742: /*readOnly*/  return new Property("readOnly", "boolean", "An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.", 0, 1, readOnly);
1472          case -791400086: /*maxLength*/  return new Property("maxLength", "integer", "The maximum number of characters that are permitted in the answer to be considered a \"valid\" QuestionnaireResponse.", 0, 1, maxLength);
1473          case -1249474914: /*options*/  return new Property("options", "Reference(ValueSet)", "A reference to a value set containing a list of codes representing permitted answers for a \"choice\" or \"open-choice\" question.", 0, 1, options);
1474          case -1010136971: /*option*/  return new Property("option", "", "One of the permitted answers for a \"choice\" or \"open-choice\" question.", 0, java.lang.Integer.MAX_VALUE, option);
1475          case 871077564: /*initial[x]*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1476          case 1948342084: /*initial*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1477          case 1508030532: /*initialBoolean*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1478          case -1309384851: /*initialDecimal*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1479          case -893596326: /*initialInteger*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1480          case 1232894226: /*initialDate*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1481          case -709007617: /*initialDateTime*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1482          case 1233378353: /*initialTime*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1483          case -152690571: /*initialString*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1484          case 871071624: /*initialUri*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1485          case -970373241: /*initialAttachment*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1486          case -615791666: /*initialCoding*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1487          case 508206063: /*initialQuantity*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1488          case -1170213785: /*initialReference*/  return new Property("initial[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be defaulted when initially rendering the questionnaire for user input.", 0, 1, initial);
1489          case 3242771: /*item*/  return new Property("item", "@Questionnaire.item", "Text, questions and other groups to be nested beneath a question or group.", 0, java.lang.Integer.MAX_VALUE, item);
1490          default: return super.getNamedProperty(_hash, _name, _checkValid);
1491          }
1492
1493        }
1494
1495      @Override
1496      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1497        switch (hash) {
1498        case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : new Base[] {this.linkId}; // StringType
1499        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // UriType
1500        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // Coding
1501        case -980110702: /*prefix*/ return this.prefix == null ? new Base[0] : new Base[] {this.prefix}; // StringType
1502        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
1503        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<QuestionnaireItemType>
1504        case 1893321565: /*enableWhen*/ return this.enableWhen == null ? new Base[0] : this.enableWhen.toArray(new Base[this.enableWhen.size()]); // QuestionnaireItemEnableWhenComponent
1505        case -393139297: /*required*/ return this.required == null ? new Base[0] : new Base[] {this.required}; // BooleanType
1506        case 1094288952: /*repeats*/ return this.repeats == null ? new Base[0] : new Base[] {this.repeats}; // BooleanType
1507        case -867683742: /*readOnly*/ return this.readOnly == null ? new Base[0] : new Base[] {this.readOnly}; // BooleanType
1508        case -791400086: /*maxLength*/ return this.maxLength == null ? new Base[0] : new Base[] {this.maxLength}; // IntegerType
1509        case -1249474914: /*options*/ return this.options == null ? new Base[0] : new Base[] {this.options}; // Reference
1510        case -1010136971: /*option*/ return this.option == null ? new Base[0] : this.option.toArray(new Base[this.option.size()]); // QuestionnaireItemOptionComponent
1511        case 1948342084: /*initial*/ return this.initial == null ? new Base[0] : new Base[] {this.initial}; // Type
1512        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireItemComponent
1513        default: return super.getProperty(hash, name, checkValid);
1514        }
1515
1516      }
1517
1518      @Override
1519      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1520        switch (hash) {
1521        case -1102667083: // linkId
1522          this.linkId = castToString(value); // StringType
1523          return value;
1524        case -1014418093: // definition
1525          this.definition = castToUri(value); // UriType
1526          return value;
1527        case 3059181: // code
1528          this.getCode().add(castToCoding(value)); // Coding
1529          return value;
1530        case -980110702: // prefix
1531          this.prefix = castToString(value); // StringType
1532          return value;
1533        case 3556653: // text
1534          this.text = castToString(value); // StringType
1535          return value;
1536        case 3575610: // type
1537          value = new QuestionnaireItemTypeEnumFactory().fromType(castToCode(value));
1538          this.type = (Enumeration) value; // Enumeration<QuestionnaireItemType>
1539          return value;
1540        case 1893321565: // enableWhen
1541          this.getEnableWhen().add((QuestionnaireItemEnableWhenComponent) value); // QuestionnaireItemEnableWhenComponent
1542          return value;
1543        case -393139297: // required
1544          this.required = castToBoolean(value); // BooleanType
1545          return value;
1546        case 1094288952: // repeats
1547          this.repeats = castToBoolean(value); // BooleanType
1548          return value;
1549        case -867683742: // readOnly
1550          this.readOnly = castToBoolean(value); // BooleanType
1551          return value;
1552        case -791400086: // maxLength
1553          this.maxLength = castToInteger(value); // IntegerType
1554          return value;
1555        case -1249474914: // options
1556          this.options = castToReference(value); // Reference
1557          return value;
1558        case -1010136971: // option
1559          this.getOption().add((QuestionnaireItemOptionComponent) value); // QuestionnaireItemOptionComponent
1560          return value;
1561        case 1948342084: // initial
1562          this.initial = castToType(value); // Type
1563          return value;
1564        case 3242771: // item
1565          this.getItem().add((QuestionnaireItemComponent) value); // QuestionnaireItemComponent
1566          return value;
1567        default: return super.setProperty(hash, name, value);
1568        }
1569
1570      }
1571
1572      @Override
1573      public Base setProperty(String name, Base value) throws FHIRException {
1574        if (name.equals("linkId")) {
1575          this.linkId = castToString(value); // StringType
1576        } else if (name.equals("definition")) {
1577          this.definition = castToUri(value); // UriType
1578        } else if (name.equals("code")) {
1579          this.getCode().add(castToCoding(value));
1580        } else if (name.equals("prefix")) {
1581          this.prefix = castToString(value); // StringType
1582        } else if (name.equals("text")) {
1583          this.text = castToString(value); // StringType
1584        } else if (name.equals("type")) {
1585          value = new QuestionnaireItemTypeEnumFactory().fromType(castToCode(value));
1586          this.type = (Enumeration) value; // Enumeration<QuestionnaireItemType>
1587        } else if (name.equals("enableWhen")) {
1588          this.getEnableWhen().add((QuestionnaireItemEnableWhenComponent) value);
1589        } else if (name.equals("required")) {
1590          this.required = castToBoolean(value); // BooleanType
1591        } else if (name.equals("repeats")) {
1592          this.repeats = castToBoolean(value); // BooleanType
1593        } else if (name.equals("readOnly")) {
1594          this.readOnly = castToBoolean(value); // BooleanType
1595        } else if (name.equals("maxLength")) {
1596          this.maxLength = castToInteger(value); // IntegerType
1597        } else if (name.equals("options")) {
1598          this.options = castToReference(value); // Reference
1599        } else if (name.equals("option")) {
1600          this.getOption().add((QuestionnaireItemOptionComponent) value);
1601        } else if (name.equals("initial[x]")) {
1602          this.initial = castToType(value); // Type
1603        } else if (name.equals("item")) {
1604          this.getItem().add((QuestionnaireItemComponent) value);
1605        } else
1606          return super.setProperty(name, value);
1607        return value;
1608      }
1609
1610      @Override
1611      public Base makeProperty(int hash, String name) throws FHIRException {
1612        switch (hash) {
1613        case -1102667083:  return getLinkIdElement();
1614        case -1014418093:  return getDefinitionElement();
1615        case 3059181:  return addCode(); 
1616        case -980110702:  return getPrefixElement();
1617        case 3556653:  return getTextElement();
1618        case 3575610:  return getTypeElement();
1619        case 1893321565:  return addEnableWhen(); 
1620        case -393139297:  return getRequiredElement();
1621        case 1094288952:  return getRepeatsElement();
1622        case -867683742:  return getReadOnlyElement();
1623        case -791400086:  return getMaxLengthElement();
1624        case -1249474914:  return getOptions(); 
1625        case -1010136971:  return addOption(); 
1626        case 871077564:  return getInitial(); 
1627        case 1948342084:  return getInitial(); 
1628        case 3242771:  return addItem(); 
1629        default: return super.makeProperty(hash, name);
1630        }
1631
1632      }
1633
1634      @Override
1635      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1636        switch (hash) {
1637        case -1102667083: /*linkId*/ return new String[] {"string"};
1638        case -1014418093: /*definition*/ return new String[] {"uri"};
1639        case 3059181: /*code*/ return new String[] {"Coding"};
1640        case -980110702: /*prefix*/ return new String[] {"string"};
1641        case 3556653: /*text*/ return new String[] {"string"};
1642        case 3575610: /*type*/ return new String[] {"code"};
1643        case 1893321565: /*enableWhen*/ return new String[] {};
1644        case -393139297: /*required*/ return new String[] {"boolean"};
1645        case 1094288952: /*repeats*/ return new String[] {"boolean"};
1646        case -867683742: /*readOnly*/ return new String[] {"boolean"};
1647        case -791400086: /*maxLength*/ return new String[] {"integer"};
1648        case -1249474914: /*options*/ return new String[] {"Reference"};
1649        case -1010136971: /*option*/ return new String[] {};
1650        case 1948342084: /*initial*/ return new String[] {"boolean", "decimal", "integer", "date", "dateTime", "time", "string", "uri", "Attachment", "Coding", "Quantity", "Reference"};
1651        case 3242771: /*item*/ return new String[] {"@Questionnaire.item"};
1652        default: return super.getTypesForProperty(hash, name);
1653        }
1654
1655      }
1656
1657      @Override
1658      public Base addChild(String name) throws FHIRException {
1659        if (name.equals("linkId")) {
1660          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.linkId");
1661        }
1662        else if (name.equals("definition")) {
1663          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.definition");
1664        }
1665        else if (name.equals("code")) {
1666          return addCode();
1667        }
1668        else if (name.equals("prefix")) {
1669          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.prefix");
1670        }
1671        else if (name.equals("text")) {
1672          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.text");
1673        }
1674        else if (name.equals("type")) {
1675          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.type");
1676        }
1677        else if (name.equals("enableWhen")) {
1678          return addEnableWhen();
1679        }
1680        else if (name.equals("required")) {
1681          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.required");
1682        }
1683        else if (name.equals("repeats")) {
1684          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.repeats");
1685        }
1686        else if (name.equals("readOnly")) {
1687          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.readOnly");
1688        }
1689        else if (name.equals("maxLength")) {
1690          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.maxLength");
1691        }
1692        else if (name.equals("options")) {
1693          this.options = new Reference();
1694          return this.options;
1695        }
1696        else if (name.equals("option")) {
1697          return addOption();
1698        }
1699        else if (name.equals("initialBoolean")) {
1700          this.initial = new BooleanType();
1701          return this.initial;
1702        }
1703        else if (name.equals("initialDecimal")) {
1704          this.initial = new DecimalType();
1705          return this.initial;
1706        }
1707        else if (name.equals("initialInteger")) {
1708          this.initial = new IntegerType();
1709          return this.initial;
1710        }
1711        else if (name.equals("initialDate")) {
1712          this.initial = new DateType();
1713          return this.initial;
1714        }
1715        else if (name.equals("initialDateTime")) {
1716          this.initial = new DateTimeType();
1717          return this.initial;
1718        }
1719        else if (name.equals("initialTime")) {
1720          this.initial = new TimeType();
1721          return this.initial;
1722        }
1723        else if (name.equals("initialString")) {
1724          this.initial = new StringType();
1725          return this.initial;
1726        }
1727        else if (name.equals("initialUri")) {
1728          this.initial = new UriType();
1729          return this.initial;
1730        }
1731        else if (name.equals("initialAttachment")) {
1732          this.initial = new Attachment();
1733          return this.initial;
1734        }
1735        else if (name.equals("initialCoding")) {
1736          this.initial = new Coding();
1737          return this.initial;
1738        }
1739        else if (name.equals("initialQuantity")) {
1740          this.initial = new Quantity();
1741          return this.initial;
1742        }
1743        else if (name.equals("initialReference")) {
1744          this.initial = new Reference();
1745          return this.initial;
1746        }
1747        else if (name.equals("item")) {
1748          return addItem();
1749        }
1750        else
1751          return super.addChild(name);
1752      }
1753
1754      public QuestionnaireItemComponent copy() {
1755        QuestionnaireItemComponent dst = new QuestionnaireItemComponent();
1756        copyValues(dst);
1757        dst.linkId = linkId == null ? null : linkId.copy();
1758        dst.definition = definition == null ? null : definition.copy();
1759        if (code != null) {
1760          dst.code = new ArrayList<Coding>();
1761          for (Coding i : code)
1762            dst.code.add(i.copy());
1763        };
1764        dst.prefix = prefix == null ? null : prefix.copy();
1765        dst.text = text == null ? null : text.copy();
1766        dst.type = type == null ? null : type.copy();
1767        if (enableWhen != null) {
1768          dst.enableWhen = new ArrayList<QuestionnaireItemEnableWhenComponent>();
1769          for (QuestionnaireItemEnableWhenComponent i : enableWhen)
1770            dst.enableWhen.add(i.copy());
1771        };
1772        dst.required = required == null ? null : required.copy();
1773        dst.repeats = repeats == null ? null : repeats.copy();
1774        dst.readOnly = readOnly == null ? null : readOnly.copy();
1775        dst.maxLength = maxLength == null ? null : maxLength.copy();
1776        dst.options = options == null ? null : options.copy();
1777        if (option != null) {
1778          dst.option = new ArrayList<QuestionnaireItemOptionComponent>();
1779          for (QuestionnaireItemOptionComponent i : option)
1780            dst.option.add(i.copy());
1781        };
1782        dst.initial = initial == null ? null : initial.copy();
1783        if (item != null) {
1784          dst.item = new ArrayList<QuestionnaireItemComponent>();
1785          for (QuestionnaireItemComponent i : item)
1786            dst.item.add(i.copy());
1787        };
1788        return dst;
1789      }
1790
1791      @Override
1792      public boolean equalsDeep(Base other_) {
1793        if (!super.equalsDeep(other_))
1794          return false;
1795        if (!(other_ instanceof QuestionnaireItemComponent))
1796          return false;
1797        QuestionnaireItemComponent o = (QuestionnaireItemComponent) other_;
1798        return compareDeep(linkId, o.linkId, true) && compareDeep(definition, o.definition, true) && compareDeep(code, o.code, true)
1799           && compareDeep(prefix, o.prefix, true) && compareDeep(text, o.text, true) && compareDeep(type, o.type, true)
1800           && compareDeep(enableWhen, o.enableWhen, true) && compareDeep(required, o.required, true) && compareDeep(repeats, o.repeats, true)
1801           && compareDeep(readOnly, o.readOnly, true) && compareDeep(maxLength, o.maxLength, true) && compareDeep(options, o.options, true)
1802           && compareDeep(option, o.option, true) && compareDeep(initial, o.initial, true) && compareDeep(item, o.item, true)
1803          ;
1804      }
1805
1806      @Override
1807      public boolean equalsShallow(Base other_) {
1808        if (!super.equalsShallow(other_))
1809          return false;
1810        if (!(other_ instanceof QuestionnaireItemComponent))
1811          return false;
1812        QuestionnaireItemComponent o = (QuestionnaireItemComponent) other_;
1813        return compareValues(linkId, o.linkId, true) && compareValues(definition, o.definition, true) && compareValues(prefix, o.prefix, true)
1814           && compareValues(text, o.text, true) && compareValues(type, o.type, true) && compareValues(required, o.required, true)
1815           && compareValues(repeats, o.repeats, true) && compareValues(readOnly, o.readOnly, true) && compareValues(maxLength, o.maxLength, true)
1816          ;
1817      }
1818
1819      public boolean isEmpty() {
1820        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(linkId, definition, code
1821          , prefix, text, type, enableWhen, required, repeats, readOnly, maxLength, options
1822          , option, initial, item);
1823      }
1824
1825  public String fhirType() {
1826    return "Questionnaire.item";
1827
1828  }
1829
1830  }
1831
1832    @Block()
1833    public static class QuestionnaireItemEnableWhenComponent extends BackboneElement implements IBaseBackboneElement {
1834        /**
1835         * The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.
1836         */
1837        @Child(name = "question", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1838        @Description(shortDefinition="Question that determines whether item is enabled", formalDefinition="The linkId for the question whose answer (or lack of answer) governs whether this item is enabled." )
1839        protected StringType question;
1840
1841        /**
1842         * An indication that this item should be enabled only if the specified question is answered (hasAnswer=true) or not answered (hasAnswer=false).
1843         */
1844        @Child(name = "hasAnswer", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1845        @Description(shortDefinition="Enable when answered or not", formalDefinition="An indication that this item should be enabled only if the specified question is answered (hasAnswer=true) or not answered (hasAnswer=false)." )
1846        protected BooleanType hasAnswer;
1847
1848        /**
1849         * An answer that the referenced question must match in order for the item to be enabled.
1850         */
1851        @Child(name = "answer", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class, Reference.class}, order=3, min=0, max=1, modifier=false, summary=false)
1852        @Description(shortDefinition="Value question must have", formalDefinition="An answer that the referenced question must match in order for the item to be enabled." )
1853        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/questionnaire-answers")
1854        protected Type answer;
1855
1856        private static final long serialVersionUID = -300241115L;
1857
1858    /**
1859     * Constructor
1860     */
1861      public QuestionnaireItemEnableWhenComponent() {
1862        super();
1863      }
1864
1865    /**
1866     * Constructor
1867     */
1868      public QuestionnaireItemEnableWhenComponent(StringType question) {
1869        super();
1870        this.question = question;
1871      }
1872
1873        /**
1874         * @return {@link #question} (The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.). This is the underlying object with id, value and extensions. The accessor "getQuestion" gives direct access to the value
1875         */
1876        public StringType getQuestionElement() { 
1877          if (this.question == null)
1878            if (Configuration.errorOnAutoCreate())
1879              throw new Error("Attempt to auto-create QuestionnaireItemEnableWhenComponent.question");
1880            else if (Configuration.doAutoCreate())
1881              this.question = new StringType(); // bb
1882          return this.question;
1883        }
1884
1885        public boolean hasQuestionElement() { 
1886          return this.question != null && !this.question.isEmpty();
1887        }
1888
1889        public boolean hasQuestion() { 
1890          return this.question != null && !this.question.isEmpty();
1891        }
1892
1893        /**
1894         * @param value {@link #question} (The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.). This is the underlying object with id, value and extensions. The accessor "getQuestion" gives direct access to the value
1895         */
1896        public QuestionnaireItemEnableWhenComponent setQuestionElement(StringType value) { 
1897          this.question = value;
1898          return this;
1899        }
1900
1901        /**
1902         * @return The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.
1903         */
1904        public String getQuestion() { 
1905          return this.question == null ? null : this.question.getValue();
1906        }
1907
1908        /**
1909         * @param value The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.
1910         */
1911        public QuestionnaireItemEnableWhenComponent setQuestion(String value) { 
1912            if (this.question == null)
1913              this.question = new StringType();
1914            this.question.setValue(value);
1915          return this;
1916        }
1917
1918        /**
1919         * @return {@link #hasAnswer} (An indication that this item should be enabled only if the specified question is answered (hasAnswer=true) or not answered (hasAnswer=false).). This is the underlying object with id, value and extensions. The accessor "getHasAnswer" gives direct access to the value
1920         */
1921        public BooleanType getHasAnswerElement() { 
1922          if (this.hasAnswer == null)
1923            if (Configuration.errorOnAutoCreate())
1924              throw new Error("Attempt to auto-create QuestionnaireItemEnableWhenComponent.hasAnswer");
1925            else if (Configuration.doAutoCreate())
1926              this.hasAnswer = new BooleanType(); // bb
1927          return this.hasAnswer;
1928        }
1929
1930        public boolean hasHasAnswerElement() { 
1931          return this.hasAnswer != null && !this.hasAnswer.isEmpty();
1932        }
1933
1934        public boolean hasHasAnswer() { 
1935          return this.hasAnswer != null && !this.hasAnswer.isEmpty();
1936        }
1937
1938        /**
1939         * @param value {@link #hasAnswer} (An indication that this item should be enabled only if the specified question is answered (hasAnswer=true) or not answered (hasAnswer=false).). This is the underlying object with id, value and extensions. The accessor "getHasAnswer" gives direct access to the value
1940         */
1941        public QuestionnaireItemEnableWhenComponent setHasAnswerElement(BooleanType value) { 
1942          this.hasAnswer = value;
1943          return this;
1944        }
1945
1946        /**
1947         * @return An indication that this item should be enabled only if the specified question is answered (hasAnswer=true) or not answered (hasAnswer=false).
1948         */
1949        public boolean getHasAnswer() { 
1950          return this.hasAnswer == null || this.hasAnswer.isEmpty() ? false : this.hasAnswer.getValue();
1951        }
1952
1953        /**
1954         * @param value An indication that this item should be enabled only if the specified question is answered (hasAnswer=true) or not answered (hasAnswer=false).
1955         */
1956        public QuestionnaireItemEnableWhenComponent setHasAnswer(boolean value) { 
1957            if (this.hasAnswer == null)
1958              this.hasAnswer = new BooleanType();
1959            this.hasAnswer.setValue(value);
1960          return this;
1961        }
1962
1963        /**
1964         * @return {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
1965         */
1966        public Type getAnswer() { 
1967          return this.answer;
1968        }
1969
1970        /**
1971         * @return {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
1972         */
1973        public BooleanType getAnswerBooleanType() throws FHIRException { 
1974          if (this.answer == null)
1975            return null;
1976          if (!(this.answer instanceof BooleanType))
1977            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.answer.getClass().getName()+" was encountered");
1978          return (BooleanType) this.answer;
1979        }
1980
1981        public boolean hasAnswerBooleanType() { 
1982          return this != null && this.answer instanceof BooleanType;
1983        }
1984
1985        /**
1986         * @return {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
1987         */
1988        public DecimalType getAnswerDecimalType() throws FHIRException { 
1989          if (this.answer == null)
1990            return null;
1991          if (!(this.answer instanceof DecimalType))
1992            throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.answer.getClass().getName()+" was encountered");
1993          return (DecimalType) this.answer;
1994        }
1995
1996        public boolean hasAnswerDecimalType() { 
1997          return this != null && this.answer instanceof DecimalType;
1998        }
1999
2000        /**
2001         * @return {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
2002         */
2003        public IntegerType getAnswerIntegerType() throws FHIRException { 
2004          if (this.answer == null)
2005            return null;
2006          if (!(this.answer instanceof IntegerType))
2007            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.answer.getClass().getName()+" was encountered");
2008          return (IntegerType) this.answer;
2009        }
2010
2011        public boolean hasAnswerIntegerType() { 
2012          return this != null && this.answer instanceof IntegerType;
2013        }
2014
2015        /**
2016         * @return {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
2017         */
2018        public DateType getAnswerDateType() throws FHIRException { 
2019          if (this.answer == null)
2020            return null;
2021          if (!(this.answer instanceof DateType))
2022            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.answer.getClass().getName()+" was encountered");
2023          return (DateType) this.answer;
2024        }
2025
2026        public boolean hasAnswerDateType() { 
2027          return this != null && this.answer instanceof DateType;
2028        }
2029
2030        /**
2031         * @return {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
2032         */
2033        public DateTimeType getAnswerDateTimeType() throws FHIRException { 
2034          if (this.answer == null)
2035            return null;
2036          if (!(this.answer instanceof DateTimeType))
2037            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.answer.getClass().getName()+" was encountered");
2038          return (DateTimeType) this.answer;
2039        }
2040
2041        public boolean hasAnswerDateTimeType() { 
2042          return this != null && this.answer instanceof DateTimeType;
2043        }
2044
2045        /**
2046         * @return {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
2047         */
2048        public TimeType getAnswerTimeType() throws FHIRException { 
2049          if (this.answer == null)
2050            return null;
2051          if (!(this.answer instanceof TimeType))
2052            throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.answer.getClass().getName()+" was encountered");
2053          return (TimeType) this.answer;
2054        }
2055
2056        public boolean hasAnswerTimeType() { 
2057          return this != null && this.answer instanceof TimeType;
2058        }
2059
2060        /**
2061         * @return {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
2062         */
2063        public StringType getAnswerStringType() throws FHIRException { 
2064          if (this.answer == null)
2065            return null;
2066          if (!(this.answer instanceof StringType))
2067            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.answer.getClass().getName()+" was encountered");
2068          return (StringType) this.answer;
2069        }
2070
2071        public boolean hasAnswerStringType() { 
2072          return this != null && this.answer instanceof StringType;
2073        }
2074
2075        /**
2076         * @return {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
2077         */
2078        public UriType getAnswerUriType() throws FHIRException { 
2079          if (this.answer == null)
2080            return null;
2081          if (!(this.answer instanceof UriType))
2082            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.answer.getClass().getName()+" was encountered");
2083          return (UriType) this.answer;
2084        }
2085
2086        public boolean hasAnswerUriType() { 
2087          return this != null && this.answer instanceof UriType;
2088        }
2089
2090        /**
2091         * @return {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
2092         */
2093        public Attachment getAnswerAttachment() throws FHIRException { 
2094          if (this.answer == null)
2095            return null;
2096          if (!(this.answer instanceof Attachment))
2097            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.answer.getClass().getName()+" was encountered");
2098          return (Attachment) this.answer;
2099        }
2100
2101        public boolean hasAnswerAttachment() { 
2102          return this != null && this.answer instanceof Attachment;
2103        }
2104
2105        /**
2106         * @return {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
2107         */
2108        public Coding getAnswerCoding() throws FHIRException { 
2109          if (this.answer == null)
2110            return null;
2111          if (!(this.answer instanceof Coding))
2112            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.answer.getClass().getName()+" was encountered");
2113          return (Coding) this.answer;
2114        }
2115
2116        public boolean hasAnswerCoding() { 
2117          return this != null && this.answer instanceof Coding;
2118        }
2119
2120        /**
2121         * @return {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
2122         */
2123        public Quantity getAnswerQuantity() throws FHIRException { 
2124          if (this.answer == null)
2125            return null;
2126          if (!(this.answer instanceof Quantity))
2127            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.answer.getClass().getName()+" was encountered");
2128          return (Quantity) this.answer;
2129        }
2130
2131        public boolean hasAnswerQuantity() { 
2132          return this != null && this.answer instanceof Quantity;
2133        }
2134
2135        /**
2136         * @return {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
2137         */
2138        public Reference getAnswerReference() throws FHIRException { 
2139          if (this.answer == null)
2140            return null;
2141          if (!(this.answer instanceof Reference))
2142            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.answer.getClass().getName()+" was encountered");
2143          return (Reference) this.answer;
2144        }
2145
2146        public boolean hasAnswerReference() { 
2147          return this != null && this.answer instanceof Reference;
2148        }
2149
2150        public boolean hasAnswer() { 
2151          return this.answer != null && !this.answer.isEmpty();
2152        }
2153
2154        /**
2155         * @param value {@link #answer} (An answer that the referenced question must match in order for the item to be enabled.)
2156         */
2157        public QuestionnaireItemEnableWhenComponent setAnswer(Type value) throws FHIRFormatError { 
2158          if (value != null && !(value instanceof BooleanType || value instanceof DecimalType || value instanceof IntegerType || value instanceof DateType || value instanceof DateTimeType || value instanceof TimeType || value instanceof StringType || value instanceof UriType || value instanceof Attachment || value instanceof Coding || value instanceof Quantity || value instanceof Reference))
2159            throw new FHIRFormatError("Not the right type for Questionnaire.item.enableWhen.answer[x]: "+value.fhirType());
2160          this.answer = value;
2161          return this;
2162        }
2163
2164        protected void listChildren(List<Property> children) {
2165          super.listChildren(children);
2166          children.add(new Property("question", "string", "The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.", 0, 1, question));
2167          children.add(new Property("hasAnswer", "boolean", "An indication that this item should be enabled only if the specified question is answered (hasAnswer=true) or not answered (hasAnswer=false).", 0, 1, hasAnswer));
2168          children.add(new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer));
2169        }
2170
2171        @Override
2172        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2173          switch (_hash) {
2174          case -1165870106: /*question*/  return new Property("question", "string", "The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.", 0, 1, question);
2175          case -793058568: /*hasAnswer*/  return new Property("hasAnswer", "boolean", "An indication that this item should be enabled only if the specified question is answered (hasAnswer=true) or not answered (hasAnswer=false).", 0, 1, hasAnswer);
2176          case 1693524994: /*answer[x]*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2177          case -1412808770: /*answer*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2178          case 1194603146: /*answerBoolean*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2179          case -1622812237: /*answerDecimal*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2180          case -1207023712: /*answerInteger*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2181          case 958960780: /*answerDate*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2182          case -1835321991: /*answerDateTime*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2183          case 959444907: /*answerTime*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2184          case -1409727121: /*answerString*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2185          case 1693519054: /*answerUri*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2186          case -1026728063: /*answerAttachment*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2187          case -1872828216: /*answerCoding*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2188          case -618108311: /*answerQuantity*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2189          case -1726221011: /*answerReference*/  return new Property("answer[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "An answer that the referenced question must match in order for the item to be enabled.", 0, 1, answer);
2190          default: return super.getNamedProperty(_hash, _name, _checkValid);
2191          }
2192
2193        }
2194
2195      @Override
2196      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2197        switch (hash) {
2198        case -1165870106: /*question*/ return this.question == null ? new Base[0] : new Base[] {this.question}; // StringType
2199        case -793058568: /*hasAnswer*/ return this.hasAnswer == null ? new Base[0] : new Base[] {this.hasAnswer}; // BooleanType
2200        case -1412808770: /*answer*/ return this.answer == null ? new Base[0] : new Base[] {this.answer}; // Type
2201        default: return super.getProperty(hash, name, checkValid);
2202        }
2203
2204      }
2205
2206      @Override
2207      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2208        switch (hash) {
2209        case -1165870106: // question
2210          this.question = castToString(value); // StringType
2211          return value;
2212        case -793058568: // hasAnswer
2213          this.hasAnswer = castToBoolean(value); // BooleanType
2214          return value;
2215        case -1412808770: // answer
2216          this.answer = castToType(value); // Type
2217          return value;
2218        default: return super.setProperty(hash, name, value);
2219        }
2220
2221      }
2222
2223      @Override
2224      public Base setProperty(String name, Base value) throws FHIRException {
2225        if (name.equals("question")) {
2226          this.question = castToString(value); // StringType
2227        } else if (name.equals("hasAnswer")) {
2228          this.hasAnswer = castToBoolean(value); // BooleanType
2229        } else if (name.equals("answer[x]")) {
2230          this.answer = castToType(value); // Type
2231        } else
2232          return super.setProperty(name, value);
2233        return value;
2234      }
2235
2236      @Override
2237      public Base makeProperty(int hash, String name) throws FHIRException {
2238        switch (hash) {
2239        case -1165870106:  return getQuestionElement();
2240        case -793058568:  return getHasAnswerElement();
2241        case 1693524994:  return getAnswer(); 
2242        case -1412808770:  return getAnswer(); 
2243        default: return super.makeProperty(hash, name);
2244        }
2245
2246      }
2247
2248      @Override
2249      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2250        switch (hash) {
2251        case -1165870106: /*question*/ return new String[] {"string"};
2252        case -793058568: /*hasAnswer*/ return new String[] {"boolean"};
2253        case -1412808770: /*answer*/ return new String[] {"boolean", "decimal", "integer", "date", "dateTime", "time", "string", "uri", "Attachment", "Coding", "Quantity", "Reference"};
2254        default: return super.getTypesForProperty(hash, name);
2255        }
2256
2257      }
2258
2259      @Override
2260      public Base addChild(String name) throws FHIRException {
2261        if (name.equals("question")) {
2262          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.question");
2263        }
2264        else if (name.equals("hasAnswer")) {
2265          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.hasAnswer");
2266        }
2267        else if (name.equals("answerBoolean")) {
2268          this.answer = new BooleanType();
2269          return this.answer;
2270        }
2271        else if (name.equals("answerDecimal")) {
2272          this.answer = new DecimalType();
2273          return this.answer;
2274        }
2275        else if (name.equals("answerInteger")) {
2276          this.answer = new IntegerType();
2277          return this.answer;
2278        }
2279        else if (name.equals("answerDate")) {
2280          this.answer = new DateType();
2281          return this.answer;
2282        }
2283        else if (name.equals("answerDateTime")) {
2284          this.answer = new DateTimeType();
2285          return this.answer;
2286        }
2287        else if (name.equals("answerTime")) {
2288          this.answer = new TimeType();
2289          return this.answer;
2290        }
2291        else if (name.equals("answerString")) {
2292          this.answer = new StringType();
2293          return this.answer;
2294        }
2295        else if (name.equals("answerUri")) {
2296          this.answer = new UriType();
2297          return this.answer;
2298        }
2299        else if (name.equals("answerAttachment")) {
2300          this.answer = new Attachment();
2301          return this.answer;
2302        }
2303        else if (name.equals("answerCoding")) {
2304          this.answer = new Coding();
2305          return this.answer;
2306        }
2307        else if (name.equals("answerQuantity")) {
2308          this.answer = new Quantity();
2309          return this.answer;
2310        }
2311        else if (name.equals("answerReference")) {
2312          this.answer = new Reference();
2313          return this.answer;
2314        }
2315        else
2316          return super.addChild(name);
2317      }
2318
2319      public QuestionnaireItemEnableWhenComponent copy() {
2320        QuestionnaireItemEnableWhenComponent dst = new QuestionnaireItemEnableWhenComponent();
2321        copyValues(dst);
2322        dst.question = question == null ? null : question.copy();
2323        dst.hasAnswer = hasAnswer == null ? null : hasAnswer.copy();
2324        dst.answer = answer == null ? null : answer.copy();
2325        return dst;
2326      }
2327
2328      @Override
2329      public boolean equalsDeep(Base other_) {
2330        if (!super.equalsDeep(other_))
2331          return false;
2332        if (!(other_ instanceof QuestionnaireItemEnableWhenComponent))
2333          return false;
2334        QuestionnaireItemEnableWhenComponent o = (QuestionnaireItemEnableWhenComponent) other_;
2335        return compareDeep(question, o.question, true) && compareDeep(hasAnswer, o.hasAnswer, true) && compareDeep(answer, o.answer, true)
2336          ;
2337      }
2338
2339      @Override
2340      public boolean equalsShallow(Base other_) {
2341        if (!super.equalsShallow(other_))
2342          return false;
2343        if (!(other_ instanceof QuestionnaireItemEnableWhenComponent))
2344          return false;
2345        QuestionnaireItemEnableWhenComponent o = (QuestionnaireItemEnableWhenComponent) other_;
2346        return compareValues(question, o.question, true) && compareValues(hasAnswer, o.hasAnswer, true);
2347      }
2348
2349      public boolean isEmpty() {
2350        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(question, hasAnswer, answer
2351          );
2352      }
2353
2354  public String fhirType() {
2355    return "Questionnaire.item.enableWhen";
2356
2357  }
2358
2359  }
2360
2361    @Block()
2362    public static class QuestionnaireItemOptionComponent extends BackboneElement implements IBaseBackboneElement {
2363        /**
2364         * A potential answer that's allowed as the answer to this question.
2365         */
2366        @Child(name = "value", type = {IntegerType.class, DateType.class, TimeType.class, StringType.class, Coding.class}, order=1, min=1, max=1, modifier=false, summary=false)
2367        @Description(shortDefinition="Answer value", formalDefinition="A potential answer that's allowed as the answer to this question." )
2368        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/questionnaire-answers")
2369        protected Type value;
2370
2371        private static final long serialVersionUID = -732981989L;
2372
2373    /**
2374     * Constructor
2375     */
2376      public QuestionnaireItemOptionComponent() {
2377        super();
2378      }
2379
2380    /**
2381     * Constructor
2382     */
2383      public QuestionnaireItemOptionComponent(Type value) {
2384        super();
2385        this.value = value;
2386      }
2387
2388        /**
2389         * @return {@link #value} (A potential answer that's allowed as the answer to this question.)
2390         */
2391        public Type getValue() { 
2392          return this.value;
2393        }
2394
2395        /**
2396         * @return {@link #value} (A potential answer that's allowed as the answer to this question.)
2397         */
2398        public IntegerType getValueIntegerType() throws FHIRException { 
2399          if (this.value == null)
2400            return null;
2401          if (!(this.value instanceof IntegerType))
2402            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
2403          return (IntegerType) this.value;
2404        }
2405
2406        public boolean hasValueIntegerType() { 
2407          return this != null && this.value instanceof IntegerType;
2408        }
2409
2410        /**
2411         * @return {@link #value} (A potential answer that's allowed as the answer to this question.)
2412         */
2413        public DateType getValueDateType() throws FHIRException { 
2414          if (this.value == null)
2415            return null;
2416          if (!(this.value instanceof DateType))
2417            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered");
2418          return (DateType) this.value;
2419        }
2420
2421        public boolean hasValueDateType() { 
2422          return this != null && this.value instanceof DateType;
2423        }
2424
2425        /**
2426         * @return {@link #value} (A potential answer that's allowed as the answer to this question.)
2427         */
2428        public TimeType getValueTimeType() throws FHIRException { 
2429          if (this.value == null)
2430            return null;
2431          if (!(this.value instanceof TimeType))
2432            throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered");
2433          return (TimeType) this.value;
2434        }
2435
2436        public boolean hasValueTimeType() { 
2437          return this != null && this.value instanceof TimeType;
2438        }
2439
2440        /**
2441         * @return {@link #value} (A potential answer that's allowed as the answer to this question.)
2442         */
2443        public StringType getValueStringType() throws FHIRException { 
2444          if (this.value == null)
2445            return null;
2446          if (!(this.value instanceof StringType))
2447            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
2448          return (StringType) this.value;
2449        }
2450
2451        public boolean hasValueStringType() { 
2452          return this != null && this.value instanceof StringType;
2453        }
2454
2455        /**
2456         * @return {@link #value} (A potential answer that's allowed as the answer to this question.)
2457         */
2458        public Coding getValueCoding() throws FHIRException { 
2459          if (this.value == null)
2460            return null;
2461          if (!(this.value instanceof Coding))
2462            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered");
2463          return (Coding) this.value;
2464        }
2465
2466        public boolean hasValueCoding() { 
2467          return this != null && this.value instanceof Coding;
2468        }
2469
2470        public boolean hasValue() { 
2471          return this.value != null && !this.value.isEmpty();
2472        }
2473
2474        /**
2475         * @param value {@link #value} (A potential answer that's allowed as the answer to this question.)
2476         */
2477        public QuestionnaireItemOptionComponent setValue(Type value) throws FHIRFormatError { 
2478          if (value != null && !(value instanceof IntegerType || value instanceof DateType || value instanceof TimeType || value instanceof StringType || value instanceof Coding))
2479            throw new FHIRFormatError("Not the right type for Questionnaire.item.option.value[x]: "+value.fhirType());
2480          this.value = value;
2481          return this;
2482        }
2483
2484        protected void listChildren(List<Property> children) {
2485          super.listChildren(children);
2486          children.add(new Property("value[x]", "integer|date|time|string|Coding", "A potential answer that's allowed as the answer to this question.", 0, 1, value));
2487        }
2488
2489        @Override
2490        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2491          switch (_hash) {
2492          case -1410166417: /*value[x]*/  return new Property("value[x]", "integer|date|time|string|Coding", "A potential answer that's allowed as the answer to this question.", 0, 1, value);
2493          case 111972721: /*value*/  return new Property("value[x]", "integer|date|time|string|Coding", "A potential answer that's allowed as the answer to this question.", 0, 1, value);
2494          case -1668204915: /*valueInteger*/  return new Property("value[x]", "integer|date|time|string|Coding", "A potential answer that's allowed as the answer to this question.", 0, 1, value);
2495          case -766192449: /*valueDate*/  return new Property("value[x]", "integer|date|time|string|Coding", "A potential answer that's allowed as the answer to this question.", 0, 1, value);
2496          case -765708322: /*valueTime*/  return new Property("value[x]", "integer|date|time|string|Coding", "A potential answer that's allowed as the answer to this question.", 0, 1, value);
2497          case -1424603934: /*valueString*/  return new Property("value[x]", "integer|date|time|string|Coding", "A potential answer that's allowed as the answer to this question.", 0, 1, value);
2498          case -1887705029: /*valueCoding*/  return new Property("value[x]", "integer|date|time|string|Coding", "A potential answer that's allowed as the answer to this question.", 0, 1, value);
2499          default: return super.getNamedProperty(_hash, _name, _checkValid);
2500          }
2501
2502        }
2503
2504      @Override
2505      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2506        switch (hash) {
2507        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type
2508        default: return super.getProperty(hash, name, checkValid);
2509        }
2510
2511      }
2512
2513      @Override
2514      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2515        switch (hash) {
2516        case 111972721: // value
2517          this.value = castToType(value); // Type
2518          return value;
2519        default: return super.setProperty(hash, name, value);
2520        }
2521
2522      }
2523
2524      @Override
2525      public Base setProperty(String name, Base value) throws FHIRException {
2526        if (name.equals("value[x]")) {
2527          this.value = castToType(value); // Type
2528        } else
2529          return super.setProperty(name, value);
2530        return value;
2531      }
2532
2533      @Override
2534      public Base makeProperty(int hash, String name) throws FHIRException {
2535        switch (hash) {
2536        case -1410166417:  return getValue(); 
2537        case 111972721:  return getValue(); 
2538        default: return super.makeProperty(hash, name);
2539        }
2540
2541      }
2542
2543      @Override
2544      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2545        switch (hash) {
2546        case 111972721: /*value*/ return new String[] {"integer", "date", "time", "string", "Coding"};
2547        default: return super.getTypesForProperty(hash, name);
2548        }
2549
2550      }
2551
2552      @Override
2553      public Base addChild(String name) throws FHIRException {
2554        if (name.equals("valueInteger")) {
2555          this.value = new IntegerType();
2556          return this.value;
2557        }
2558        else if (name.equals("valueDate")) {
2559          this.value = new DateType();
2560          return this.value;
2561        }
2562        else if (name.equals("valueTime")) {
2563          this.value = new TimeType();
2564          return this.value;
2565        }
2566        else if (name.equals("valueString")) {
2567          this.value = new StringType();
2568          return this.value;
2569        }
2570        else if (name.equals("valueCoding")) {
2571          this.value = new Coding();
2572          return this.value;
2573        }
2574        else
2575          return super.addChild(name);
2576      }
2577
2578      public QuestionnaireItemOptionComponent copy() {
2579        QuestionnaireItemOptionComponent dst = new QuestionnaireItemOptionComponent();
2580        copyValues(dst);
2581        dst.value = value == null ? null : value.copy();
2582        return dst;
2583      }
2584
2585      @Override
2586      public boolean equalsDeep(Base other_) {
2587        if (!super.equalsDeep(other_))
2588          return false;
2589        if (!(other_ instanceof QuestionnaireItemOptionComponent))
2590          return false;
2591        QuestionnaireItemOptionComponent o = (QuestionnaireItemOptionComponent) other_;
2592        return compareDeep(value, o.value, true);
2593      }
2594
2595      @Override
2596      public boolean equalsShallow(Base other_) {
2597        if (!super.equalsShallow(other_))
2598          return false;
2599        if (!(other_ instanceof QuestionnaireItemOptionComponent))
2600          return false;
2601        QuestionnaireItemOptionComponent o = (QuestionnaireItemOptionComponent) other_;
2602        return true;
2603      }
2604
2605      public boolean isEmpty() {
2606        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value);
2607      }
2608
2609  public String fhirType() {
2610    return "Questionnaire.item.option";
2611
2612  }
2613
2614  }
2615
2616    /**
2617     * A formal identifier that is used to identify this questionnaire when it is represented in other formats, or referenced in a specification, model, design or an instance.
2618     */
2619    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2620    @Description(shortDefinition="Additional identifier for the questionnaire", formalDefinition="A formal identifier that is used to identify this questionnaire when it is represented in other formats, or referenced in a specification, model, design or an instance." )
2621    protected List<Identifier> identifier;
2622
2623    /**
2624     * Explaination of why this questionnaire is needed and why it has been designed as it has.
2625     */
2626    @Child(name = "purpose", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=false)
2627    @Description(shortDefinition="Why this questionnaire is defined", formalDefinition="Explaination of why this questionnaire is needed and why it has been designed as it has." )
2628    protected MarkdownType purpose;
2629
2630    /**
2631     * The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
2632     */
2633    @Child(name = "approvalDate", type = {DateType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2634    @Description(shortDefinition="When the questionnaire was approved by publisher", formalDefinition="The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage." )
2635    protected DateType approvalDate;
2636
2637    /**
2638     * The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.
2639     */
2640    @Child(name = "lastReviewDate", type = {DateType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2641    @Description(shortDefinition="When the questionnaire was last reviewed", formalDefinition="The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date." )
2642    protected DateType lastReviewDate;
2643
2644    /**
2645     * The period during which the questionnaire content was or is planned to be in active use.
2646     */
2647    @Child(name = "effectivePeriod", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=true)
2648    @Description(shortDefinition="When the questionnaire is expected to be used", formalDefinition="The period during which the questionnaire content was or is planned to be in active use." )
2649    protected Period effectivePeriod;
2650
2651    /**
2652     * A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire.
2653     */
2654    @Child(name = "copyright", type = {MarkdownType.class}, order=5, min=0, max=1, modifier=false, summary=false)
2655    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire." )
2656    protected MarkdownType copyright;
2657
2658    /**
2659     * An identifier for this question or group of questions in a particular terminology such as LOINC.
2660     */
2661    @Child(name = "code", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2662    @Description(shortDefinition="Concept that represents the overall questionnaire", formalDefinition="An identifier for this question or group of questions in a particular terminology such as LOINC." )
2663    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/questionnaire-questions")
2664    protected List<Coding> code;
2665
2666    /**
2667     * The types of subjects that can be the subject of responses created for the questionnaire.
2668     */
2669    @Child(name = "subjectType", type = {CodeType.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2670    @Description(shortDefinition="Resource that can be subject of QuestionnaireResponse", formalDefinition="The types of subjects that can be the subject of responses created for the questionnaire." )
2671    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types")
2672    protected List<CodeType> subjectType;
2673
2674    /**
2675     * A particular question, question grouping or display text that is part of the questionnaire.
2676     */
2677    @Child(name = "item", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2678    @Description(shortDefinition="Questions and sections within the Questionnaire", formalDefinition="A particular question, question grouping or display text that is part of the questionnaire." )
2679    protected List<QuestionnaireItemComponent> item;
2680
2681    private static final long serialVersionUID = -1846925043L;
2682
2683  /**
2684   * Constructor
2685   */
2686    public Questionnaire() {
2687      super();
2688    }
2689
2690  /**
2691   * Constructor
2692   */
2693    public Questionnaire(Enumeration<PublicationStatus> status) {
2694      super();
2695      this.status = status;
2696    }
2697
2698    /**
2699     * @return {@link #url} (An absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published. The URL SHOULD include the major version of the questionnaire. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2700     */
2701    public UriType getUrlElement() { 
2702      if (this.url == null)
2703        if (Configuration.errorOnAutoCreate())
2704          throw new Error("Attempt to auto-create Questionnaire.url");
2705        else if (Configuration.doAutoCreate())
2706          this.url = new UriType(); // bb
2707      return this.url;
2708    }
2709
2710    public boolean hasUrlElement() { 
2711      return this.url != null && !this.url.isEmpty();
2712    }
2713
2714    public boolean hasUrl() { 
2715      return this.url != null && !this.url.isEmpty();
2716    }
2717
2718    /**
2719     * @param value {@link #url} (An absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published. The URL SHOULD include the major version of the questionnaire. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2720     */
2721    public Questionnaire setUrlElement(UriType value) { 
2722      this.url = value;
2723      return this;
2724    }
2725
2726    /**
2727     * @return An absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published. The URL SHOULD include the major version of the questionnaire. For more information see [Technical and Business Versions](resource.html#versions).
2728     */
2729    public String getUrl() { 
2730      return this.url == null ? null : this.url.getValue();
2731    }
2732
2733    /**
2734     * @param value An absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published. The URL SHOULD include the major version of the questionnaire. For more information see [Technical and Business Versions](resource.html#versions).
2735     */
2736    public Questionnaire setUrl(String value) { 
2737      if (Utilities.noString(value))
2738        this.url = null;
2739      else {
2740        if (this.url == null)
2741          this.url = new UriType();
2742        this.url.setValue(value);
2743      }
2744      return this;
2745    }
2746
2747    /**
2748     * @return {@link #identifier} (A formal identifier that is used to identify this questionnaire when it is represented in other formats, or referenced in a specification, model, design or an instance.)
2749     */
2750    public List<Identifier> getIdentifier() { 
2751      if (this.identifier == null)
2752        this.identifier = new ArrayList<Identifier>();
2753      return this.identifier;
2754    }
2755
2756    /**
2757     * @return Returns a reference to <code>this</code> for easy method chaining
2758     */
2759    public Questionnaire setIdentifier(List<Identifier> theIdentifier) { 
2760      this.identifier = theIdentifier;
2761      return this;
2762    }
2763
2764    public boolean hasIdentifier() { 
2765      if (this.identifier == null)
2766        return false;
2767      for (Identifier item : this.identifier)
2768        if (!item.isEmpty())
2769          return true;
2770      return false;
2771    }
2772
2773    public Identifier addIdentifier() { //3
2774      Identifier t = new Identifier();
2775      if (this.identifier == null)
2776        this.identifier = new ArrayList<Identifier>();
2777      this.identifier.add(t);
2778      return t;
2779    }
2780
2781    public Questionnaire addIdentifier(Identifier t) { //3
2782      if (t == null)
2783        return this;
2784      if (this.identifier == null)
2785        this.identifier = new ArrayList<Identifier>();
2786      this.identifier.add(t);
2787      return this;
2788    }
2789
2790    /**
2791     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
2792     */
2793    public Identifier getIdentifierFirstRep() { 
2794      if (getIdentifier().isEmpty()) {
2795        addIdentifier();
2796      }
2797      return getIdentifier().get(0);
2798    }
2799
2800    /**
2801     * @return {@link #version} (The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2802     */
2803    public StringType getVersionElement() { 
2804      if (this.version == null)
2805        if (Configuration.errorOnAutoCreate())
2806          throw new Error("Attempt to auto-create Questionnaire.version");
2807        else if (Configuration.doAutoCreate())
2808          this.version = new StringType(); // bb
2809      return this.version;
2810    }
2811
2812    public boolean hasVersionElement() { 
2813      return this.version != null && !this.version.isEmpty();
2814    }
2815
2816    public boolean hasVersion() { 
2817      return this.version != null && !this.version.isEmpty();
2818    }
2819
2820    /**
2821     * @param value {@link #version} (The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2822     */
2823    public Questionnaire setVersionElement(StringType value) { 
2824      this.version = value;
2825      return this;
2826    }
2827
2828    /**
2829     * @return The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
2830     */
2831    public String getVersion() { 
2832      return this.version == null ? null : this.version.getValue();
2833    }
2834
2835    /**
2836     * @param value The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
2837     */
2838    public Questionnaire setVersion(String value) { 
2839      if (Utilities.noString(value))
2840        this.version = null;
2841      else {
2842        if (this.version == null)
2843          this.version = new StringType();
2844        this.version.setValue(value);
2845      }
2846      return this;
2847    }
2848
2849    /**
2850     * @return {@link #name} (A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2851     */
2852    public StringType getNameElement() { 
2853      if (this.name == null)
2854        if (Configuration.errorOnAutoCreate())
2855          throw new Error("Attempt to auto-create Questionnaire.name");
2856        else if (Configuration.doAutoCreate())
2857          this.name = new StringType(); // bb
2858      return this.name;
2859    }
2860
2861    public boolean hasNameElement() { 
2862      return this.name != null && !this.name.isEmpty();
2863    }
2864
2865    public boolean hasName() { 
2866      return this.name != null && !this.name.isEmpty();
2867    }
2868
2869    /**
2870     * @param value {@link #name} (A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2871     */
2872    public Questionnaire setNameElement(StringType value) { 
2873      this.name = value;
2874      return this;
2875    }
2876
2877    /**
2878     * @return A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generation.
2879     */
2880    public String getName() { 
2881      return this.name == null ? null : this.name.getValue();
2882    }
2883
2884    /**
2885     * @param value A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generation.
2886     */
2887    public Questionnaire setName(String value) { 
2888      if (Utilities.noString(value))
2889        this.name = null;
2890      else {
2891        if (this.name == null)
2892          this.name = new StringType();
2893        this.name.setValue(value);
2894      }
2895      return this;
2896    }
2897
2898    /**
2899     * @return {@link #title} (A short, descriptive, user-friendly title for the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2900     */
2901    public StringType getTitleElement() { 
2902      if (this.title == null)
2903        if (Configuration.errorOnAutoCreate())
2904          throw new Error("Attempt to auto-create Questionnaire.title");
2905        else if (Configuration.doAutoCreate())
2906          this.title = new StringType(); // bb
2907      return this.title;
2908    }
2909
2910    public boolean hasTitleElement() { 
2911      return this.title != null && !this.title.isEmpty();
2912    }
2913
2914    public boolean hasTitle() { 
2915      return this.title != null && !this.title.isEmpty();
2916    }
2917
2918    /**
2919     * @param value {@link #title} (A short, descriptive, user-friendly title for the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2920     */
2921    public Questionnaire setTitleElement(StringType value) { 
2922      this.title = value;
2923      return this;
2924    }
2925
2926    /**
2927     * @return A short, descriptive, user-friendly title for the questionnaire.
2928     */
2929    public String getTitle() { 
2930      return this.title == null ? null : this.title.getValue();
2931    }
2932
2933    /**
2934     * @param value A short, descriptive, user-friendly title for the questionnaire.
2935     */
2936    public Questionnaire setTitle(String value) { 
2937      if (Utilities.noString(value))
2938        this.title = null;
2939      else {
2940        if (this.title == null)
2941          this.title = new StringType();
2942        this.title.setValue(value);
2943      }
2944      return this;
2945    }
2946
2947    /**
2948     * @return {@link #status} (The status of this questionnaire. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2949     */
2950    public Enumeration<PublicationStatus> getStatusElement() { 
2951      if (this.status == null)
2952        if (Configuration.errorOnAutoCreate())
2953          throw new Error("Attempt to auto-create Questionnaire.status");
2954        else if (Configuration.doAutoCreate())
2955          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
2956      return this.status;
2957    }
2958
2959    public boolean hasStatusElement() { 
2960      return this.status != null && !this.status.isEmpty();
2961    }
2962
2963    public boolean hasStatus() { 
2964      return this.status != null && !this.status.isEmpty();
2965    }
2966
2967    /**
2968     * @param value {@link #status} (The status of this questionnaire. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2969     */
2970    public Questionnaire setStatusElement(Enumeration<PublicationStatus> value) { 
2971      this.status = value;
2972      return this;
2973    }
2974
2975    /**
2976     * @return The status of this questionnaire. Enables tracking the life-cycle of the content.
2977     */
2978    public PublicationStatus getStatus() { 
2979      return this.status == null ? null : this.status.getValue();
2980    }
2981
2982    /**
2983     * @param value The status of this questionnaire. Enables tracking the life-cycle of the content.
2984     */
2985    public Questionnaire setStatus(PublicationStatus value) { 
2986        if (this.status == null)
2987          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
2988        this.status.setValue(value);
2989      return this;
2990    }
2991
2992    /**
2993     * @return {@link #experimental} (A boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
2994     */
2995    public BooleanType getExperimentalElement() { 
2996      if (this.experimental == null)
2997        if (Configuration.errorOnAutoCreate())
2998          throw new Error("Attempt to auto-create Questionnaire.experimental");
2999        else if (Configuration.doAutoCreate())
3000          this.experimental = new BooleanType(); // bb
3001      return this.experimental;
3002    }
3003
3004    public boolean hasExperimentalElement() { 
3005      return this.experimental != null && !this.experimental.isEmpty();
3006    }
3007
3008    public boolean hasExperimental() { 
3009      return this.experimental != null && !this.experimental.isEmpty();
3010    }
3011
3012    /**
3013     * @param value {@link #experimental} (A boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
3014     */
3015    public Questionnaire setExperimentalElement(BooleanType value) { 
3016      this.experimental = value;
3017      return this;
3018    }
3019
3020    /**
3021     * @return A boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
3022     */
3023    public boolean getExperimental() { 
3024      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
3025    }
3026
3027    /**
3028     * @param value A boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
3029     */
3030    public Questionnaire setExperimental(boolean value) { 
3031        if (this.experimental == null)
3032          this.experimental = new BooleanType();
3033        this.experimental.setValue(value);
3034      return this;
3035    }
3036
3037    /**
3038     * @return {@link #date} (The date  (and optionally time) when the questionnaire was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
3039     */
3040    public DateTimeType getDateElement() { 
3041      if (this.date == null)
3042        if (Configuration.errorOnAutoCreate())
3043          throw new Error("Attempt to auto-create Questionnaire.date");
3044        else if (Configuration.doAutoCreate())
3045          this.date = new DateTimeType(); // bb
3046      return this.date;
3047    }
3048
3049    public boolean hasDateElement() { 
3050      return this.date != null && !this.date.isEmpty();
3051    }
3052
3053    public boolean hasDate() { 
3054      return this.date != null && !this.date.isEmpty();
3055    }
3056
3057    /**
3058     * @param value {@link #date} (The date  (and optionally time) when the questionnaire was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
3059     */
3060    public Questionnaire setDateElement(DateTimeType value) { 
3061      this.date = value;
3062      return this;
3063    }
3064
3065    /**
3066     * @return The date  (and optionally time) when the questionnaire was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changes.
3067     */
3068    public Date getDate() { 
3069      return this.date == null ? null : this.date.getValue();
3070    }
3071
3072    /**
3073     * @param value The date  (and optionally time) when the questionnaire was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changes.
3074     */
3075    public Questionnaire setDate(Date value) { 
3076      if (value == null)
3077        this.date = null;
3078      else {
3079        if (this.date == null)
3080          this.date = new DateTimeType();
3081        this.date.setValue(value);
3082      }
3083      return this;
3084    }
3085
3086    /**
3087     * @return {@link #publisher} (The name of the individual or organization that published the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
3088     */
3089    public StringType getPublisherElement() { 
3090      if (this.publisher == null)
3091        if (Configuration.errorOnAutoCreate())
3092          throw new Error("Attempt to auto-create Questionnaire.publisher");
3093        else if (Configuration.doAutoCreate())
3094          this.publisher = new StringType(); // bb
3095      return this.publisher;
3096    }
3097
3098    public boolean hasPublisherElement() { 
3099      return this.publisher != null && !this.publisher.isEmpty();
3100    }
3101
3102    public boolean hasPublisher() { 
3103      return this.publisher != null && !this.publisher.isEmpty();
3104    }
3105
3106    /**
3107     * @param value {@link #publisher} (The name of the individual or organization that published the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
3108     */
3109    public Questionnaire setPublisherElement(StringType value) { 
3110      this.publisher = value;
3111      return this;
3112    }
3113
3114    /**
3115     * @return The name of the individual or organization that published the questionnaire.
3116     */
3117    public String getPublisher() { 
3118      return this.publisher == null ? null : this.publisher.getValue();
3119    }
3120
3121    /**
3122     * @param value The name of the individual or organization that published the questionnaire.
3123     */
3124    public Questionnaire setPublisher(String value) { 
3125      if (Utilities.noString(value))
3126        this.publisher = null;
3127      else {
3128        if (this.publisher == null)
3129          this.publisher = new StringType();
3130        this.publisher.setValue(value);
3131      }
3132      return this;
3133    }
3134
3135    /**
3136     * @return {@link #description} (A free text natural language description of the questionnaire from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3137     */
3138    public MarkdownType getDescriptionElement() { 
3139      if (this.description == null)
3140        if (Configuration.errorOnAutoCreate())
3141          throw new Error("Attempt to auto-create Questionnaire.description");
3142        else if (Configuration.doAutoCreate())
3143          this.description = new MarkdownType(); // bb
3144      return this.description;
3145    }
3146
3147    public boolean hasDescriptionElement() { 
3148      return this.description != null && !this.description.isEmpty();
3149    }
3150
3151    public boolean hasDescription() { 
3152      return this.description != null && !this.description.isEmpty();
3153    }
3154
3155    /**
3156     * @param value {@link #description} (A free text natural language description of the questionnaire from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3157     */
3158    public Questionnaire setDescriptionElement(MarkdownType value) { 
3159      this.description = value;
3160      return this;
3161    }
3162
3163    /**
3164     * @return A free text natural language description of the questionnaire from a consumer's perspective.
3165     */
3166    public String getDescription() { 
3167      return this.description == null ? null : this.description.getValue();
3168    }
3169
3170    /**
3171     * @param value A free text natural language description of the questionnaire from a consumer's perspective.
3172     */
3173    public Questionnaire setDescription(String value) { 
3174      if (value == null)
3175        this.description = null;
3176      else {
3177        if (this.description == null)
3178          this.description = new MarkdownType();
3179        this.description.setValue(value);
3180      }
3181      return this;
3182    }
3183
3184    /**
3185     * @return {@link #purpose} (Explaination of why this questionnaire is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
3186     */
3187    public MarkdownType getPurposeElement() { 
3188      if (this.purpose == null)
3189        if (Configuration.errorOnAutoCreate())
3190          throw new Error("Attempt to auto-create Questionnaire.purpose");
3191        else if (Configuration.doAutoCreate())
3192          this.purpose = new MarkdownType(); // bb
3193      return this.purpose;
3194    }
3195
3196    public boolean hasPurposeElement() { 
3197      return this.purpose != null && !this.purpose.isEmpty();
3198    }
3199
3200    public boolean hasPurpose() { 
3201      return this.purpose != null && !this.purpose.isEmpty();
3202    }
3203
3204    /**
3205     * @param value {@link #purpose} (Explaination of why this questionnaire is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
3206     */
3207    public Questionnaire setPurposeElement(MarkdownType value) { 
3208      this.purpose = value;
3209      return this;
3210    }
3211
3212    /**
3213     * @return Explaination of why this questionnaire is needed and why it has been designed as it has.
3214     */
3215    public String getPurpose() { 
3216      return this.purpose == null ? null : this.purpose.getValue();
3217    }
3218
3219    /**
3220     * @param value Explaination of why this questionnaire is needed and why it has been designed as it has.
3221     */
3222    public Questionnaire setPurpose(String value) { 
3223      if (value == null)
3224        this.purpose = null;
3225      else {
3226        if (this.purpose == null)
3227          this.purpose = new MarkdownType();
3228        this.purpose.setValue(value);
3229      }
3230      return this;
3231    }
3232
3233    /**
3234     * @return {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
3235     */
3236    public DateType getApprovalDateElement() { 
3237      if (this.approvalDate == null)
3238        if (Configuration.errorOnAutoCreate())
3239          throw new Error("Attempt to auto-create Questionnaire.approvalDate");
3240        else if (Configuration.doAutoCreate())
3241          this.approvalDate = new DateType(); // bb
3242      return this.approvalDate;
3243    }
3244
3245    public boolean hasApprovalDateElement() { 
3246      return this.approvalDate != null && !this.approvalDate.isEmpty();
3247    }
3248
3249    public boolean hasApprovalDate() { 
3250      return this.approvalDate != null && !this.approvalDate.isEmpty();
3251    }
3252
3253    /**
3254     * @param value {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
3255     */
3256    public Questionnaire setApprovalDateElement(DateType value) { 
3257      this.approvalDate = value;
3258      return this;
3259    }
3260
3261    /**
3262     * @return The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
3263     */
3264    public Date getApprovalDate() { 
3265      return this.approvalDate == null ? null : this.approvalDate.getValue();
3266    }
3267
3268    /**
3269     * @param value The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
3270     */
3271    public Questionnaire setApprovalDate(Date value) { 
3272      if (value == null)
3273        this.approvalDate = null;
3274      else {
3275        if (this.approvalDate == null)
3276          this.approvalDate = new DateType();
3277        this.approvalDate.setValue(value);
3278      }
3279      return this;
3280    }
3281
3282    /**
3283     * @return {@link #lastReviewDate} (The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
3284     */
3285    public DateType getLastReviewDateElement() { 
3286      if (this.lastReviewDate == null)
3287        if (Configuration.errorOnAutoCreate())
3288          throw new Error("Attempt to auto-create Questionnaire.lastReviewDate");
3289        else if (Configuration.doAutoCreate())
3290          this.lastReviewDate = new DateType(); // bb
3291      return this.lastReviewDate;
3292    }
3293
3294    public boolean hasLastReviewDateElement() { 
3295      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
3296    }
3297
3298    public boolean hasLastReviewDate() { 
3299      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
3300    }
3301
3302    /**
3303     * @param value {@link #lastReviewDate} (The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
3304     */
3305    public Questionnaire setLastReviewDateElement(DateType value) { 
3306      this.lastReviewDate = value;
3307      return this;
3308    }
3309
3310    /**
3311     * @return The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.
3312     */
3313    public Date getLastReviewDate() { 
3314      return this.lastReviewDate == null ? null : this.lastReviewDate.getValue();
3315    }
3316
3317    /**
3318     * @param value The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.
3319     */
3320    public Questionnaire setLastReviewDate(Date value) { 
3321      if (value == null)
3322        this.lastReviewDate = null;
3323      else {
3324        if (this.lastReviewDate == null)
3325          this.lastReviewDate = new DateType();
3326        this.lastReviewDate.setValue(value);
3327      }
3328      return this;
3329    }
3330
3331    /**
3332     * @return {@link #effectivePeriod} (The period during which the questionnaire content was or is planned to be in active use.)
3333     */
3334    public Period getEffectivePeriod() { 
3335      if (this.effectivePeriod == null)
3336        if (Configuration.errorOnAutoCreate())
3337          throw new Error("Attempt to auto-create Questionnaire.effectivePeriod");
3338        else if (Configuration.doAutoCreate())
3339          this.effectivePeriod = new Period(); // cc
3340      return this.effectivePeriod;
3341    }
3342
3343    public boolean hasEffectivePeriod() { 
3344      return this.effectivePeriod != null && !this.effectivePeriod.isEmpty();
3345    }
3346
3347    /**
3348     * @param value {@link #effectivePeriod} (The period during which the questionnaire content was or is planned to be in active use.)
3349     */
3350    public Questionnaire setEffectivePeriod(Period value)  { 
3351      this.effectivePeriod = value;
3352      return this;
3353    }
3354
3355    /**
3356     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate questionnaire instances.)
3357     */
3358    public List<UsageContext> getUseContext() { 
3359      if (this.useContext == null)
3360        this.useContext = new ArrayList<UsageContext>();
3361      return this.useContext;
3362    }
3363
3364    /**
3365     * @return Returns a reference to <code>this</code> for easy method chaining
3366     */
3367    public Questionnaire setUseContext(List<UsageContext> theUseContext) { 
3368      this.useContext = theUseContext;
3369      return this;
3370    }
3371
3372    public boolean hasUseContext() { 
3373      if (this.useContext == null)
3374        return false;
3375      for (UsageContext item : this.useContext)
3376        if (!item.isEmpty())
3377          return true;
3378      return false;
3379    }
3380
3381    public UsageContext addUseContext() { //3
3382      UsageContext t = new UsageContext();
3383      if (this.useContext == null)
3384        this.useContext = new ArrayList<UsageContext>();
3385      this.useContext.add(t);
3386      return t;
3387    }
3388
3389    public Questionnaire addUseContext(UsageContext t) { //3
3390      if (t == null)
3391        return this;
3392      if (this.useContext == null)
3393        this.useContext = new ArrayList<UsageContext>();
3394      this.useContext.add(t);
3395      return this;
3396    }
3397
3398    /**
3399     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
3400     */
3401    public UsageContext getUseContextFirstRep() { 
3402      if (getUseContext().isEmpty()) {
3403        addUseContext();
3404      }
3405      return getUseContext().get(0);
3406    }
3407
3408    /**
3409     * @return {@link #jurisdiction} (A legal or geographic region in which the questionnaire is intended to be used.)
3410     */
3411    public List<CodeableConcept> getJurisdiction() { 
3412      if (this.jurisdiction == null)
3413        this.jurisdiction = new ArrayList<CodeableConcept>();
3414      return this.jurisdiction;
3415    }
3416
3417    /**
3418     * @return Returns a reference to <code>this</code> for easy method chaining
3419     */
3420    public Questionnaire setJurisdiction(List<CodeableConcept> theJurisdiction) { 
3421      this.jurisdiction = theJurisdiction;
3422      return this;
3423    }
3424
3425    public boolean hasJurisdiction() { 
3426      if (this.jurisdiction == null)
3427        return false;
3428      for (CodeableConcept item : this.jurisdiction)
3429        if (!item.isEmpty())
3430          return true;
3431      return false;
3432    }
3433
3434    public CodeableConcept addJurisdiction() { //3
3435      CodeableConcept t = new CodeableConcept();
3436      if (this.jurisdiction == null)
3437        this.jurisdiction = new ArrayList<CodeableConcept>();
3438      this.jurisdiction.add(t);
3439      return t;
3440    }
3441
3442    public Questionnaire addJurisdiction(CodeableConcept t) { //3
3443      if (t == null)
3444        return this;
3445      if (this.jurisdiction == null)
3446        this.jurisdiction = new ArrayList<CodeableConcept>();
3447      this.jurisdiction.add(t);
3448      return this;
3449    }
3450
3451    /**
3452     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
3453     */
3454    public CodeableConcept getJurisdictionFirstRep() { 
3455      if (getJurisdiction().isEmpty()) {
3456        addJurisdiction();
3457      }
3458      return getJurisdiction().get(0);
3459    }
3460
3461    /**
3462     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
3463     */
3464    public List<ContactDetail> getContact() { 
3465      if (this.contact == null)
3466        this.contact = new ArrayList<ContactDetail>();
3467      return this.contact;
3468    }
3469
3470    /**
3471     * @return Returns a reference to <code>this</code> for easy method chaining
3472     */
3473    public Questionnaire setContact(List<ContactDetail> theContact) { 
3474      this.contact = theContact;
3475      return this;
3476    }
3477
3478    public boolean hasContact() { 
3479      if (this.contact == null)
3480        return false;
3481      for (ContactDetail item : this.contact)
3482        if (!item.isEmpty())
3483          return true;
3484      return false;
3485    }
3486
3487    public ContactDetail addContact() { //3
3488      ContactDetail t = new ContactDetail();
3489      if (this.contact == null)
3490        this.contact = new ArrayList<ContactDetail>();
3491      this.contact.add(t);
3492      return t;
3493    }
3494
3495    public Questionnaire addContact(ContactDetail t) { //3
3496      if (t == null)
3497        return this;
3498      if (this.contact == null)
3499        this.contact = new ArrayList<ContactDetail>();
3500      this.contact.add(t);
3501      return this;
3502    }
3503
3504    /**
3505     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
3506     */
3507    public ContactDetail getContactFirstRep() { 
3508      if (getContact().isEmpty()) {
3509        addContact();
3510      }
3511      return getContact().get(0);
3512    }
3513
3514    /**
3515     * @return {@link #copyright} (A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3516     */
3517    public MarkdownType getCopyrightElement() { 
3518      if (this.copyright == null)
3519        if (Configuration.errorOnAutoCreate())
3520          throw new Error("Attempt to auto-create Questionnaire.copyright");
3521        else if (Configuration.doAutoCreate())
3522          this.copyright = new MarkdownType(); // bb
3523      return this.copyright;
3524    }
3525
3526    public boolean hasCopyrightElement() { 
3527      return this.copyright != null && !this.copyright.isEmpty();
3528    }
3529
3530    public boolean hasCopyright() { 
3531      return this.copyright != null && !this.copyright.isEmpty();
3532    }
3533
3534    /**
3535     * @param value {@link #copyright} (A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3536     */
3537    public Questionnaire setCopyrightElement(MarkdownType value) { 
3538      this.copyright = value;
3539      return this;
3540    }
3541
3542    /**
3543     * @return A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire.
3544     */
3545    public String getCopyright() { 
3546      return this.copyright == null ? null : this.copyright.getValue();
3547    }
3548
3549    /**
3550     * @param value A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire.
3551     */
3552    public Questionnaire setCopyright(String value) { 
3553      if (value == null)
3554        this.copyright = null;
3555      else {
3556        if (this.copyright == null)
3557          this.copyright = new MarkdownType();
3558        this.copyright.setValue(value);
3559      }
3560      return this;
3561    }
3562
3563    /**
3564     * @return {@link #code} (An identifier for this question or group of questions in a particular terminology such as LOINC.)
3565     */
3566    public List<Coding> getCode() { 
3567      if (this.code == null)
3568        this.code = new ArrayList<Coding>();
3569      return this.code;
3570    }
3571
3572    /**
3573     * @return Returns a reference to <code>this</code> for easy method chaining
3574     */
3575    public Questionnaire setCode(List<Coding> theCode) { 
3576      this.code = theCode;
3577      return this;
3578    }
3579
3580    public boolean hasCode() { 
3581      if (this.code == null)
3582        return false;
3583      for (Coding item : this.code)
3584        if (!item.isEmpty())
3585          return true;
3586      return false;
3587    }
3588
3589    public Coding addCode() { //3
3590      Coding t = new Coding();
3591      if (this.code == null)
3592        this.code = new ArrayList<Coding>();
3593      this.code.add(t);
3594      return t;
3595    }
3596
3597    public Questionnaire addCode(Coding t) { //3
3598      if (t == null)
3599        return this;
3600      if (this.code == null)
3601        this.code = new ArrayList<Coding>();
3602      this.code.add(t);
3603      return this;
3604    }
3605
3606    /**
3607     * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist
3608     */
3609    public Coding getCodeFirstRep() { 
3610      if (getCode().isEmpty()) {
3611        addCode();
3612      }
3613      return getCode().get(0);
3614    }
3615
3616    /**
3617     * @return {@link #subjectType} (The types of subjects that can be the subject of responses created for the questionnaire.)
3618     */
3619    public List<CodeType> getSubjectType() { 
3620      if (this.subjectType == null)
3621        this.subjectType = new ArrayList<CodeType>();
3622      return this.subjectType;
3623    }
3624
3625    /**
3626     * @return Returns a reference to <code>this</code> for easy method chaining
3627     */
3628    public Questionnaire setSubjectType(List<CodeType> theSubjectType) { 
3629      this.subjectType = theSubjectType;
3630      return this;
3631    }
3632
3633    public boolean hasSubjectType() { 
3634      if (this.subjectType == null)
3635        return false;
3636      for (CodeType item : this.subjectType)
3637        if (!item.isEmpty())
3638          return true;
3639      return false;
3640    }
3641
3642    /**
3643     * @return {@link #subjectType} (The types of subjects that can be the subject of responses created for the questionnaire.)
3644     */
3645    public CodeType addSubjectTypeElement() {//2 
3646      CodeType t = new CodeType();
3647      if (this.subjectType == null)
3648        this.subjectType = new ArrayList<CodeType>();
3649      this.subjectType.add(t);
3650      return t;
3651    }
3652
3653    /**
3654     * @param value {@link #subjectType} (The types of subjects that can be the subject of responses created for the questionnaire.)
3655     */
3656    public Questionnaire addSubjectType(String value) { //1
3657      CodeType t = new CodeType();
3658      t.setValue(value);
3659      if (this.subjectType == null)
3660        this.subjectType = new ArrayList<CodeType>();
3661      this.subjectType.add(t);
3662      return this;
3663    }
3664
3665    /**
3666     * @param value {@link #subjectType} (The types of subjects that can be the subject of responses created for the questionnaire.)
3667     */
3668    public boolean hasSubjectType(String value) { 
3669      if (this.subjectType == null)
3670        return false;
3671      for (CodeType v : this.subjectType)
3672        if (v.getValue().equals(value)) // code
3673          return true;
3674      return false;
3675    }
3676
3677    /**
3678     * @return {@link #item} (A particular question, question grouping or display text that is part of the questionnaire.)
3679     */
3680    public List<QuestionnaireItemComponent> getItem() { 
3681      if (this.item == null)
3682        this.item = new ArrayList<QuestionnaireItemComponent>();
3683      return this.item;
3684    }
3685
3686    /**
3687     * @return Returns a reference to <code>this</code> for easy method chaining
3688     */
3689    public Questionnaire setItem(List<QuestionnaireItemComponent> theItem) { 
3690      this.item = theItem;
3691      return this;
3692    }
3693
3694    public boolean hasItem() { 
3695      if (this.item == null)
3696        return false;
3697      for (QuestionnaireItemComponent item : this.item)
3698        if (!item.isEmpty())
3699          return true;
3700      return false;
3701    }
3702
3703    public QuestionnaireItemComponent addItem() { //3
3704      QuestionnaireItemComponent t = new QuestionnaireItemComponent();
3705      if (this.item == null)
3706        this.item = new ArrayList<QuestionnaireItemComponent>();
3707      this.item.add(t);
3708      return t;
3709    }
3710
3711    public Questionnaire addItem(QuestionnaireItemComponent t) { //3
3712      if (t == null)
3713        return this;
3714      if (this.item == null)
3715        this.item = new ArrayList<QuestionnaireItemComponent>();
3716      this.item.add(t);
3717      return this;
3718    }
3719
3720    /**
3721     * @return The first repetition of repeating field {@link #item}, creating it if it does not already exist
3722     */
3723    public QuestionnaireItemComponent getItemFirstRep() { 
3724      if (getItem().isEmpty()) {
3725        addItem();
3726      }
3727      return getItem().get(0);
3728    }
3729
3730      protected void listChildren(List<Property> children) {
3731        super.listChildren(children);
3732        children.add(new Property("url", "uri", "An absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published. The URL SHOULD include the major version of the questionnaire. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url));
3733        children.add(new Property("identifier", "Identifier", "A formal identifier that is used to identify this questionnaire when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier));
3734        children.add(new Property("version", "string", "The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version));
3735        children.add(new Property("name", "string", "A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
3736        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the questionnaire.", 0, 1, title));
3737        children.add(new Property("status", "code", "The status of this questionnaire. Enables tracking the life-cycle of the content.", 0, 1, status));
3738        children.add(new Property("experimental", "boolean", "A boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental));
3739        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the questionnaire was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changes.", 0, 1, date));
3740        children.add(new Property("publisher", "string", "The name of the individual or organization that published the questionnaire.", 0, 1, publisher));
3741        children.add(new Property("description", "markdown", "A free text natural language description of the questionnaire from a consumer's perspective.", 0, 1, description));
3742        children.add(new Property("purpose", "markdown", "Explaination of why this questionnaire is needed and why it has been designed as it has.", 0, 1, purpose));
3743        children.add(new Property("approvalDate", "date", "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.", 0, 1, approvalDate));
3744        children.add(new Property("lastReviewDate", "date", "The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.", 0, 1, lastReviewDate));
3745        children.add(new Property("effectivePeriod", "Period", "The period during which the questionnaire content was or is planned to be in active use.", 0, 1, effectivePeriod));
3746        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate questionnaire instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
3747        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the questionnaire is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
3748        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
3749        children.add(new Property("copyright", "markdown", "A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire.", 0, 1, copyright));
3750        children.add(new Property("code", "Coding", "An identifier for this question or group of questions in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, code));
3751        children.add(new Property("subjectType", "code", "The types of subjects that can be the subject of responses created for the questionnaire.", 0, java.lang.Integer.MAX_VALUE, subjectType));
3752        children.add(new Property("item", "", "A particular question, question grouping or display text that is part of the questionnaire.", 0, java.lang.Integer.MAX_VALUE, item));
3753      }
3754
3755      @Override
3756      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3757        switch (_hash) {
3758        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published. The URL SHOULD include the major version of the questionnaire. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url);
3759        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A formal identifier that is used to identify this questionnaire when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier);
3760        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version);
3761        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
3762        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the questionnaire.", 0, 1, title);
3763        case -892481550: /*status*/  return new Property("status", "code", "The status of this questionnaire. Enables tracking the life-cycle of the content.", 0, 1, status);
3764        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental);
3765        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the questionnaire was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changes.", 0, 1, date);
3766        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the individual or organization that published the questionnaire.", 0, 1, publisher);
3767        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the questionnaire from a consumer's perspective.", 0, 1, description);
3768        case -220463842: /*purpose*/  return new Property("purpose", "markdown", "Explaination of why this questionnaire is needed and why it has been designed as it has.", 0, 1, purpose);
3769        case 223539345: /*approvalDate*/  return new Property("approvalDate", "date", "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.", 0, 1, approvalDate);
3770        case -1687512484: /*lastReviewDate*/  return new Property("lastReviewDate", "date", "The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.", 0, 1, lastReviewDate);
3771        case -403934648: /*effectivePeriod*/  return new Property("effectivePeriod", "Period", "The period during which the questionnaire content was or is planned to be in active use.", 0, 1, effectivePeriod);
3772        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate questionnaire instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
3773        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the questionnaire is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
3774        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
3775        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire.", 0, 1, copyright);
3776        case 3059181: /*code*/  return new Property("code", "Coding", "An identifier for this question or group of questions in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, code);
3777        case -603200890: /*subjectType*/  return new Property("subjectType", "code", "The types of subjects that can be the subject of responses created for the questionnaire.", 0, java.lang.Integer.MAX_VALUE, subjectType);
3778        case 3242771: /*item*/  return new Property("item", "", "A particular question, question grouping or display text that is part of the questionnaire.", 0, java.lang.Integer.MAX_VALUE, item);
3779        default: return super.getNamedProperty(_hash, _name, _checkValid);
3780        }
3781
3782      }
3783
3784      @Override
3785      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3786        switch (hash) {
3787        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
3788        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3789        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
3790        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3791        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
3792        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
3793        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
3794        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
3795        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
3796        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
3797        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
3798        case 223539345: /*approvalDate*/ return this.approvalDate == null ? new Base[0] : new Base[] {this.approvalDate}; // DateType
3799        case -1687512484: /*lastReviewDate*/ return this.lastReviewDate == null ? new Base[0] : new Base[] {this.lastReviewDate}; // DateType
3800        case -403934648: /*effectivePeriod*/ return this.effectivePeriod == null ? new Base[0] : new Base[] {this.effectivePeriod}; // Period
3801        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
3802        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
3803        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
3804        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
3805        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // Coding
3806        case -603200890: /*subjectType*/ return this.subjectType == null ? new Base[0] : this.subjectType.toArray(new Base[this.subjectType.size()]); // CodeType
3807        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireItemComponent
3808        default: return super.getProperty(hash, name, checkValid);
3809        }
3810
3811      }
3812
3813      @Override
3814      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3815        switch (hash) {
3816        case 116079: // url
3817          this.url = castToUri(value); // UriType
3818          return value;
3819        case -1618432855: // identifier
3820          this.getIdentifier().add(castToIdentifier(value)); // Identifier
3821          return value;
3822        case 351608024: // version
3823          this.version = castToString(value); // StringType
3824          return value;
3825        case 3373707: // name
3826          this.name = castToString(value); // StringType
3827          return value;
3828        case 110371416: // title
3829          this.title = castToString(value); // StringType
3830          return value;
3831        case -892481550: // status
3832          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
3833          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3834          return value;
3835        case -404562712: // experimental
3836          this.experimental = castToBoolean(value); // BooleanType
3837          return value;
3838        case 3076014: // date
3839          this.date = castToDateTime(value); // DateTimeType
3840          return value;
3841        case 1447404028: // publisher
3842          this.publisher = castToString(value); // StringType
3843          return value;
3844        case -1724546052: // description
3845          this.description = castToMarkdown(value); // MarkdownType
3846          return value;
3847        case -220463842: // purpose
3848          this.purpose = castToMarkdown(value); // MarkdownType
3849          return value;
3850        case 223539345: // approvalDate
3851          this.approvalDate = castToDate(value); // DateType
3852          return value;
3853        case -1687512484: // lastReviewDate
3854          this.lastReviewDate = castToDate(value); // DateType
3855          return value;
3856        case -403934648: // effectivePeriod
3857          this.effectivePeriod = castToPeriod(value); // Period
3858          return value;
3859        case -669707736: // useContext
3860          this.getUseContext().add(castToUsageContext(value)); // UsageContext
3861          return value;
3862        case -507075711: // jurisdiction
3863          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
3864          return value;
3865        case 951526432: // contact
3866          this.getContact().add(castToContactDetail(value)); // ContactDetail
3867          return value;
3868        case 1522889671: // copyright
3869          this.copyright = castToMarkdown(value); // MarkdownType
3870          return value;
3871        case 3059181: // code
3872          this.getCode().add(castToCoding(value)); // Coding
3873          return value;
3874        case -603200890: // subjectType
3875          this.getSubjectType().add(castToCode(value)); // CodeType
3876          return value;
3877        case 3242771: // item
3878          this.getItem().add((QuestionnaireItemComponent) value); // QuestionnaireItemComponent
3879          return value;
3880        default: return super.setProperty(hash, name, value);
3881        }
3882
3883      }
3884
3885      @Override
3886      public Base setProperty(String name, Base value) throws FHIRException {
3887        if (name.equals("url")) {
3888          this.url = castToUri(value); // UriType
3889        } else if (name.equals("identifier")) {
3890          this.getIdentifier().add(castToIdentifier(value));
3891        } else if (name.equals("version")) {
3892          this.version = castToString(value); // StringType
3893        } else if (name.equals("name")) {
3894          this.name = castToString(value); // StringType
3895        } else if (name.equals("title")) {
3896          this.title = castToString(value); // StringType
3897        } else if (name.equals("status")) {
3898          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
3899          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3900        } else if (name.equals("experimental")) {
3901          this.experimental = castToBoolean(value); // BooleanType
3902        } else if (name.equals("date")) {
3903          this.date = castToDateTime(value); // DateTimeType
3904        } else if (name.equals("publisher")) {
3905          this.publisher = castToString(value); // StringType
3906        } else if (name.equals("description")) {
3907          this.description = castToMarkdown(value); // MarkdownType
3908        } else if (name.equals("purpose")) {
3909          this.purpose = castToMarkdown(value); // MarkdownType
3910        } else if (name.equals("approvalDate")) {
3911          this.approvalDate = castToDate(value); // DateType
3912        } else if (name.equals("lastReviewDate")) {
3913          this.lastReviewDate = castToDate(value); // DateType
3914        } else if (name.equals("effectivePeriod")) {
3915          this.effectivePeriod = castToPeriod(value); // Period
3916        } else if (name.equals("useContext")) {
3917          this.getUseContext().add(castToUsageContext(value));
3918        } else if (name.equals("jurisdiction")) {
3919          this.getJurisdiction().add(castToCodeableConcept(value));
3920        } else if (name.equals("contact")) {
3921          this.getContact().add(castToContactDetail(value));
3922        } else if (name.equals("copyright")) {
3923          this.copyright = castToMarkdown(value); // MarkdownType
3924        } else if (name.equals("code")) {
3925          this.getCode().add(castToCoding(value));
3926        } else if (name.equals("subjectType")) {
3927          this.getSubjectType().add(castToCode(value));
3928        } else if (name.equals("item")) {
3929          this.getItem().add((QuestionnaireItemComponent) value);
3930        } else
3931          return super.setProperty(name, value);
3932        return value;
3933      }
3934
3935      @Override
3936      public Base makeProperty(int hash, String name) throws FHIRException {
3937        switch (hash) {
3938        case 116079:  return getUrlElement();
3939        case -1618432855:  return addIdentifier(); 
3940        case 351608024:  return getVersionElement();
3941        case 3373707:  return getNameElement();
3942        case 110371416:  return getTitleElement();
3943        case -892481550:  return getStatusElement();
3944        case -404562712:  return getExperimentalElement();
3945        case 3076014:  return getDateElement();
3946        case 1447404028:  return getPublisherElement();
3947        case -1724546052:  return getDescriptionElement();
3948        case -220463842:  return getPurposeElement();
3949        case 223539345:  return getApprovalDateElement();
3950        case -1687512484:  return getLastReviewDateElement();
3951        case -403934648:  return getEffectivePeriod(); 
3952        case -669707736:  return addUseContext(); 
3953        case -507075711:  return addJurisdiction(); 
3954        case 951526432:  return addContact(); 
3955        case 1522889671:  return getCopyrightElement();
3956        case 3059181:  return addCode(); 
3957        case -603200890:  return addSubjectTypeElement();
3958        case 3242771:  return addItem(); 
3959        default: return super.makeProperty(hash, name);
3960        }
3961
3962      }
3963
3964      @Override
3965      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3966        switch (hash) {
3967        case 116079: /*url*/ return new String[] {"uri"};
3968        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3969        case 351608024: /*version*/ return new String[] {"string"};
3970        case 3373707: /*name*/ return new String[] {"string"};
3971        case 110371416: /*title*/ return new String[] {"string"};
3972        case -892481550: /*status*/ return new String[] {"code"};
3973        case -404562712: /*experimental*/ return new String[] {"boolean"};
3974        case 3076014: /*date*/ return new String[] {"dateTime"};
3975        case 1447404028: /*publisher*/ return new String[] {"string"};
3976        case -1724546052: /*description*/ return new String[] {"markdown"};
3977        case -220463842: /*purpose*/ return new String[] {"markdown"};
3978        case 223539345: /*approvalDate*/ return new String[] {"date"};
3979        case -1687512484: /*lastReviewDate*/ return new String[] {"date"};
3980        case -403934648: /*effectivePeriod*/ return new String[] {"Period"};
3981        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
3982        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
3983        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
3984        case 1522889671: /*copyright*/ return new String[] {"markdown"};
3985        case 3059181: /*code*/ return new String[] {"Coding"};
3986        case -603200890: /*subjectType*/ return new String[] {"code"};
3987        case 3242771: /*item*/ return new String[] {};
3988        default: return super.getTypesForProperty(hash, name);
3989        }
3990
3991      }
3992
3993      @Override
3994      public Base addChild(String name) throws FHIRException {
3995        if (name.equals("url")) {
3996          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.url");
3997        }
3998        else if (name.equals("identifier")) {
3999          return addIdentifier();
4000        }
4001        else if (name.equals("version")) {
4002          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.version");
4003        }
4004        else if (name.equals("name")) {
4005          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.name");
4006        }
4007        else if (name.equals("title")) {
4008          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.title");
4009        }
4010        else if (name.equals("status")) {
4011          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.status");
4012        }
4013        else if (name.equals("experimental")) {
4014          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.experimental");
4015        }
4016        else if (name.equals("date")) {
4017          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.date");
4018        }
4019        else if (name.equals("publisher")) {
4020          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.publisher");
4021        }
4022        else if (name.equals("description")) {
4023          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.description");
4024        }
4025        else if (name.equals("purpose")) {
4026          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.purpose");
4027        }
4028        else if (name.equals("approvalDate")) {
4029          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.approvalDate");
4030        }
4031        else if (name.equals("lastReviewDate")) {
4032          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.lastReviewDate");
4033        }
4034        else if (name.equals("effectivePeriod")) {
4035          this.effectivePeriod = new Period();
4036          return this.effectivePeriod;
4037        }
4038        else if (name.equals("useContext")) {
4039          return addUseContext();
4040        }
4041        else if (name.equals("jurisdiction")) {
4042          return addJurisdiction();
4043        }
4044        else if (name.equals("contact")) {
4045          return addContact();
4046        }
4047        else if (name.equals("copyright")) {
4048          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.copyright");
4049        }
4050        else if (name.equals("code")) {
4051          return addCode();
4052        }
4053        else if (name.equals("subjectType")) {
4054          throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.subjectType");
4055        }
4056        else if (name.equals("item")) {
4057          return addItem();
4058        }
4059        else
4060          return super.addChild(name);
4061      }
4062
4063  public String fhirType() {
4064    return "Questionnaire";
4065
4066  }
4067
4068      public Questionnaire copy() {
4069        Questionnaire dst = new Questionnaire();
4070        copyValues(dst);
4071        dst.url = url == null ? null : url.copy();
4072        if (identifier != null) {
4073          dst.identifier = new ArrayList<Identifier>();
4074          for (Identifier i : identifier)
4075            dst.identifier.add(i.copy());
4076        };
4077        dst.version = version == null ? null : version.copy();
4078        dst.name = name == null ? null : name.copy();
4079        dst.title = title == null ? null : title.copy();
4080        dst.status = status == null ? null : status.copy();
4081        dst.experimental = experimental == null ? null : experimental.copy();
4082        dst.date = date == null ? null : date.copy();
4083        dst.publisher = publisher == null ? null : publisher.copy();
4084        dst.description = description == null ? null : description.copy();
4085        dst.purpose = purpose == null ? null : purpose.copy();
4086        dst.approvalDate = approvalDate == null ? null : approvalDate.copy();
4087        dst.lastReviewDate = lastReviewDate == null ? null : lastReviewDate.copy();
4088        dst.effectivePeriod = effectivePeriod == null ? null : effectivePeriod.copy();
4089        if (useContext != null) {
4090          dst.useContext = new ArrayList<UsageContext>();
4091          for (UsageContext i : useContext)
4092            dst.useContext.add(i.copy());
4093        };
4094        if (jurisdiction != null) {
4095          dst.jurisdiction = new ArrayList<CodeableConcept>();
4096          for (CodeableConcept i : jurisdiction)
4097            dst.jurisdiction.add(i.copy());
4098        };
4099        if (contact != null) {
4100          dst.contact = new ArrayList<ContactDetail>();
4101          for (ContactDetail i : contact)
4102            dst.contact.add(i.copy());
4103        };
4104        dst.copyright = copyright == null ? null : copyright.copy();
4105        if (code != null) {
4106          dst.code = new ArrayList<Coding>();
4107          for (Coding i : code)
4108            dst.code.add(i.copy());
4109        };
4110        if (subjectType != null) {
4111          dst.subjectType = new ArrayList<CodeType>();
4112          for (CodeType i : subjectType)
4113            dst.subjectType.add(i.copy());
4114        };
4115        if (item != null) {
4116          dst.item = new ArrayList<QuestionnaireItemComponent>();
4117          for (QuestionnaireItemComponent i : item)
4118            dst.item.add(i.copy());
4119        };
4120        return dst;
4121      }
4122
4123      protected Questionnaire typedCopy() {
4124        return copy();
4125      }
4126
4127      @Override
4128      public boolean equalsDeep(Base other_) {
4129        if (!super.equalsDeep(other_))
4130          return false;
4131        if (!(other_ instanceof Questionnaire))
4132          return false;
4133        Questionnaire o = (Questionnaire) other_;
4134        return compareDeep(identifier, o.identifier, true) && compareDeep(purpose, o.purpose, true) && compareDeep(approvalDate, o.approvalDate, true)
4135           && compareDeep(lastReviewDate, o.lastReviewDate, true) && compareDeep(effectivePeriod, o.effectivePeriod, true)
4136           && compareDeep(copyright, o.copyright, true) && compareDeep(code, o.code, true) && compareDeep(subjectType, o.subjectType, true)
4137           && compareDeep(item, o.item, true);
4138      }
4139
4140      @Override
4141      public boolean equalsShallow(Base other_) {
4142        if (!super.equalsShallow(other_))
4143          return false;
4144        if (!(other_ instanceof Questionnaire))
4145          return false;
4146        Questionnaire o = (Questionnaire) other_;
4147        return compareValues(purpose, o.purpose, true) && compareValues(approvalDate, o.approvalDate, true)
4148           && compareValues(lastReviewDate, o.lastReviewDate, true) && compareValues(copyright, o.copyright, true)
4149           && compareValues(subjectType, o.subjectType, true);
4150      }
4151
4152      public boolean isEmpty() {
4153        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, purpose, approvalDate
4154          , lastReviewDate, effectivePeriod, copyright, code, subjectType, item);
4155      }
4156
4157  @Override
4158  public ResourceType getResourceType() {
4159    return ResourceType.Questionnaire;
4160   }
4161
4162 /**
4163   * Search parameter: <b>date</b>
4164   * <p>
4165   * Description: <b>The questionnaire publication date</b><br>
4166   * Type: <b>date</b><br>
4167   * Path: <b>Questionnaire.date</b><br>
4168   * </p>
4169   */
4170  @SearchParamDefinition(name="date", path="Questionnaire.date", description="The questionnaire publication date", type="date" )
4171  public static final String SP_DATE = "date";
4172 /**
4173   * <b>Fluent Client</b> search parameter constant for <b>date</b>
4174   * <p>
4175   * Description: <b>The questionnaire publication date</b><br>
4176   * Type: <b>date</b><br>
4177   * Path: <b>Questionnaire.date</b><br>
4178   * </p>
4179   */
4180  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
4181
4182 /**
4183   * Search parameter: <b>identifier</b>
4184   * <p>
4185   * Description: <b>External identifier for the questionnaire</b><br>
4186   * Type: <b>token</b><br>
4187   * Path: <b>Questionnaire.identifier</b><br>
4188   * </p>
4189   */
4190  @SearchParamDefinition(name="identifier", path="Questionnaire.identifier", description="External identifier for the questionnaire", type="token" )
4191  public static final String SP_IDENTIFIER = "identifier";
4192 /**
4193   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4194   * <p>
4195   * Description: <b>External identifier for the questionnaire</b><br>
4196   * Type: <b>token</b><br>
4197   * Path: <b>Questionnaire.identifier</b><br>
4198   * </p>
4199   */
4200  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4201
4202 /**
4203   * Search parameter: <b>effective</b>
4204   * <p>
4205   * Description: <b>The time during which the questionnaire is intended to be in use</b><br>
4206   * Type: <b>date</b><br>
4207   * Path: <b>Questionnaire.effectivePeriod</b><br>
4208   * </p>
4209   */
4210  @SearchParamDefinition(name="effective", path="Questionnaire.effectivePeriod", description="The time during which the questionnaire is intended to be in use", type="date" )
4211  public static final String SP_EFFECTIVE = "effective";
4212 /**
4213   * <b>Fluent Client</b> search parameter constant for <b>effective</b>
4214   * <p>
4215   * Description: <b>The time during which the questionnaire is intended to be in use</b><br>
4216   * Type: <b>date</b><br>
4217   * Path: <b>Questionnaire.effectivePeriod</b><br>
4218   * </p>
4219   */
4220  public static final ca.uhn.fhir.rest.gclient.DateClientParam EFFECTIVE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EFFECTIVE);
4221
4222 /**
4223   * Search parameter: <b>code</b>
4224   * <p>
4225   * Description: <b>A code that corresponds to one of its items in the questionnaire</b><br>
4226   * Type: <b>token</b><br>
4227   * Path: <b>Questionnaire.item.code</b><br>
4228   * </p>
4229   */
4230  @SearchParamDefinition(name="code", path="Questionnaire.item.code", description="A code that corresponds to one of its items in the questionnaire", type="token" )
4231  public static final String SP_CODE = "code";
4232 /**
4233   * <b>Fluent Client</b> search parameter constant for <b>code</b>
4234   * <p>
4235   * Description: <b>A code that corresponds to one of its items in the questionnaire</b><br>
4236   * Type: <b>token</b><br>
4237   * Path: <b>Questionnaire.item.code</b><br>
4238   * </p>
4239   */
4240  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
4241
4242 /**
4243   * Search parameter: <b>jurisdiction</b>
4244   * <p>
4245   * Description: <b>Intended jurisdiction for the questionnaire</b><br>
4246   * Type: <b>token</b><br>
4247   * Path: <b>Questionnaire.jurisdiction</b><br>
4248   * </p>
4249   */
4250  @SearchParamDefinition(name="jurisdiction", path="Questionnaire.jurisdiction", description="Intended jurisdiction for the questionnaire", type="token" )
4251  public static final String SP_JURISDICTION = "jurisdiction";
4252 /**
4253   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
4254   * <p>
4255   * Description: <b>Intended jurisdiction for the questionnaire</b><br>
4256   * Type: <b>token</b><br>
4257   * Path: <b>Questionnaire.jurisdiction</b><br>
4258   * </p>
4259   */
4260  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
4261
4262 /**
4263   * Search parameter: <b>name</b>
4264   * <p>
4265   * Description: <b>Computationally friendly name of the questionnaire</b><br>
4266   * Type: <b>string</b><br>
4267   * Path: <b>Questionnaire.name</b><br>
4268   * </p>
4269   */
4270  @SearchParamDefinition(name="name", path="Questionnaire.name", description="Computationally friendly name of the questionnaire", type="string" )
4271  public static final String SP_NAME = "name";
4272 /**
4273   * <b>Fluent Client</b> search parameter constant for <b>name</b>
4274   * <p>
4275   * Description: <b>Computationally friendly name of the questionnaire</b><br>
4276   * Type: <b>string</b><br>
4277   * Path: <b>Questionnaire.name</b><br>
4278   * </p>
4279   */
4280  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
4281
4282 /**
4283   * Search parameter: <b>description</b>
4284   * <p>
4285   * Description: <b>The description of the questionnaire</b><br>
4286   * Type: <b>string</b><br>
4287   * Path: <b>Questionnaire.description</b><br>
4288   * </p>
4289   */
4290  @SearchParamDefinition(name="description", path="Questionnaire.description", description="The description of the questionnaire", type="string" )
4291  public static final String SP_DESCRIPTION = "description";
4292 /**
4293   * <b>Fluent Client</b> search parameter constant for <b>description</b>
4294   * <p>
4295   * Description: <b>The description of the questionnaire</b><br>
4296   * Type: <b>string</b><br>
4297   * Path: <b>Questionnaire.description</b><br>
4298   * </p>
4299   */
4300  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
4301
4302 /**
4303   * Search parameter: <b>publisher</b>
4304   * <p>
4305   * Description: <b>Name of the publisher of the questionnaire</b><br>
4306   * Type: <b>string</b><br>
4307   * Path: <b>Questionnaire.publisher</b><br>
4308   * </p>
4309   */
4310  @SearchParamDefinition(name="publisher", path="Questionnaire.publisher", description="Name of the publisher of the questionnaire", type="string" )
4311  public static final String SP_PUBLISHER = "publisher";
4312 /**
4313   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
4314   * <p>
4315   * Description: <b>Name of the publisher of the questionnaire</b><br>
4316   * Type: <b>string</b><br>
4317   * Path: <b>Questionnaire.publisher</b><br>
4318   * </p>
4319   */
4320  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
4321
4322 /**
4323   * Search parameter: <b>title</b>
4324   * <p>
4325   * Description: <b>The human-friendly name of the questionnaire</b><br>
4326   * Type: <b>string</b><br>
4327   * Path: <b>Questionnaire.title</b><br>
4328   * </p>
4329   */
4330  @SearchParamDefinition(name="title", path="Questionnaire.title", description="The human-friendly name of the questionnaire", type="string" )
4331  public static final String SP_TITLE = "title";
4332 /**
4333   * <b>Fluent Client</b> search parameter constant for <b>title</b>
4334   * <p>
4335   * Description: <b>The human-friendly name of the questionnaire</b><br>
4336   * Type: <b>string</b><br>
4337   * Path: <b>Questionnaire.title</b><br>
4338   * </p>
4339   */
4340  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
4341
4342 /**
4343   * Search parameter: <b>version</b>
4344   * <p>
4345   * Description: <b>The business version of the questionnaire</b><br>
4346   * Type: <b>token</b><br>
4347   * Path: <b>Questionnaire.version</b><br>
4348   * </p>
4349   */
4350  @SearchParamDefinition(name="version", path="Questionnaire.version", description="The business version of the questionnaire", type="token" )
4351  public static final String SP_VERSION = "version";
4352 /**
4353   * <b>Fluent Client</b> search parameter constant for <b>version</b>
4354   * <p>
4355   * Description: <b>The business version of the questionnaire</b><br>
4356   * Type: <b>token</b><br>
4357   * Path: <b>Questionnaire.version</b><br>
4358   * </p>
4359   */
4360  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
4361
4362 /**
4363   * Search parameter: <b>url</b>
4364   * <p>
4365   * Description: <b>The uri that identifies the questionnaire</b><br>
4366   * Type: <b>uri</b><br>
4367   * Path: <b>Questionnaire.url</b><br>
4368   * </p>
4369   */
4370  @SearchParamDefinition(name="url", path="Questionnaire.url", description="The uri that identifies the questionnaire", type="uri" )
4371  public static final String SP_URL = "url";
4372 /**
4373   * <b>Fluent Client</b> search parameter constant for <b>url</b>
4374   * <p>
4375   * Description: <b>The uri that identifies the questionnaire</b><br>
4376   * Type: <b>uri</b><br>
4377   * Path: <b>Questionnaire.url</b><br>
4378   * </p>
4379   */
4380  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
4381
4382 /**
4383   * Search parameter: <b>status</b>
4384   * <p>
4385   * Description: <b>The current status of the questionnaire</b><br>
4386   * Type: <b>token</b><br>
4387   * Path: <b>Questionnaire.status</b><br>
4388   * </p>
4389   */
4390  @SearchParamDefinition(name="status", path="Questionnaire.status", description="The current status of the questionnaire", type="token" )
4391  public static final String SP_STATUS = "status";
4392 /**
4393   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4394   * <p>
4395   * Description: <b>The current status of the questionnaire</b><br>
4396   * Type: <b>token</b><br>
4397   * Path: <b>Questionnaire.status</b><br>
4398   * </p>
4399   */
4400  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4401
4402
4403}
4404