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