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