001package org.hl7.fhir.dstu2016may.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 8, 2016 03:05+1000 for FHIR v1.4.0
033import java.util.ArrayList;
034import java.util.Date;
035import java.util.List;
036
037import org.hl7.fhir.exceptions.FHIRException;
038import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
039import org.hl7.fhir.utilities.Utilities;
040
041import ca.uhn.fhir.model.api.annotation.Block;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.Description;
044import ca.uhn.fhir.model.api.annotation.ResourceDef;
045import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
046/**
047 * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.
048 */
049@ResourceDef(name="QuestionnaireResponse", profile="http://hl7.org/fhir/Profile/QuestionnaireResponse")
050public class QuestionnaireResponse extends DomainResource {
051
052    public enum QuestionnaireResponseStatus {
053        /**
054         * This QuestionnaireResponse has been partially filled out with answers, but changes or additions are still expected to be made to it.
055         */
056        INPROGRESS, 
057        /**
058         * This QuestionnaireResponse has been filled out with answers, and the current content is regarded as definitive.
059         */
060        COMPLETED, 
061        /**
062         * This QuestionnaireResponse has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards.
063         */
064        AMENDED, 
065        /**
066         * added to help the parsers
067         */
068        NULL;
069        public static QuestionnaireResponseStatus fromCode(String codeString) throws FHIRException {
070            if (codeString == null || "".equals(codeString))
071                return null;
072        if ("in-progress".equals(codeString))
073          return INPROGRESS;
074        if ("completed".equals(codeString))
075          return COMPLETED;
076        if ("amended".equals(codeString))
077          return AMENDED;
078        throw new FHIRException("Unknown QuestionnaireResponseStatus code '"+codeString+"'");
079        }
080        public String toCode() {
081          switch (this) {
082            case INPROGRESS: return "in-progress";
083            case COMPLETED: return "completed";
084            case AMENDED: return "amended";
085            default: return "?";
086          }
087        }
088        public String getSystem() {
089          switch (this) {
090            case INPROGRESS: return "http://hl7.org/fhir/questionnaire-answers-status";
091            case COMPLETED: return "http://hl7.org/fhir/questionnaire-answers-status";
092            case AMENDED: return "http://hl7.org/fhir/questionnaire-answers-status";
093            default: return "?";
094          }
095        }
096        public String getDefinition() {
097          switch (this) {
098            case INPROGRESS: return "This QuestionnaireResponse has been partially filled out with answers, but changes or additions are still expected to be made to it.";
099            case COMPLETED: return "This QuestionnaireResponse has been filled out with answers, and the current content is regarded as definitive.";
100            case AMENDED: return "This QuestionnaireResponse has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards.";
101            default: return "?";
102          }
103        }
104        public String getDisplay() {
105          switch (this) {
106            case INPROGRESS: return "In Progress";
107            case COMPLETED: return "Completed";
108            case AMENDED: return "Amended";
109            default: return "?";
110          }
111        }
112    }
113
114  public static class QuestionnaireResponseStatusEnumFactory implements EnumFactory<QuestionnaireResponseStatus> {
115    public QuestionnaireResponseStatus fromCode(String codeString) throws IllegalArgumentException {
116      if (codeString == null || "".equals(codeString))
117            if (codeString == null || "".equals(codeString))
118                return null;
119        if ("in-progress".equals(codeString))
120          return QuestionnaireResponseStatus.INPROGRESS;
121        if ("completed".equals(codeString))
122          return QuestionnaireResponseStatus.COMPLETED;
123        if ("amended".equals(codeString))
124          return QuestionnaireResponseStatus.AMENDED;
125        throw new IllegalArgumentException("Unknown QuestionnaireResponseStatus code '"+codeString+"'");
126        }
127        public Enumeration<QuestionnaireResponseStatus> fromType(Base code) throws FHIRException {
128          if (code == null || code.isEmpty())
129            return null;
130          String codeString = ((PrimitiveType) code).asStringValue();
131          if (codeString == null || "".equals(codeString))
132            return null;
133        if ("in-progress".equals(codeString))
134          return new Enumeration<QuestionnaireResponseStatus>(this, QuestionnaireResponseStatus.INPROGRESS);
135        if ("completed".equals(codeString))
136          return new Enumeration<QuestionnaireResponseStatus>(this, QuestionnaireResponseStatus.COMPLETED);
137        if ("amended".equals(codeString))
138          return new Enumeration<QuestionnaireResponseStatus>(this, QuestionnaireResponseStatus.AMENDED);
139        throw new FHIRException("Unknown QuestionnaireResponseStatus code '"+codeString+"'");
140        }
141    public String toCode(QuestionnaireResponseStatus code) {
142      if (code == QuestionnaireResponseStatus.INPROGRESS)
143        return "in-progress";
144      if (code == QuestionnaireResponseStatus.COMPLETED)
145        return "completed";
146      if (code == QuestionnaireResponseStatus.AMENDED)
147        return "amended";
148      return "?";
149      }
150    public String toSystem(QuestionnaireResponseStatus code) {
151      return code.getSystem();
152      }
153    }
154
155    @Block()
156    public static class QuestionnaireResponseItemComponent extends BackboneElement implements IBaseBackboneElement {
157        /**
158         * Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.
159         */
160        @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
161        @Description(shortDefinition="Corresponding item within Questionnaire", formalDefinition="Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource." )
162        protected StringType linkId;
163
164        /**
165         * Text that is displayed above the contents of the group or as the text of the question being answered.
166         */
167        @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
168        @Description(shortDefinition="Name for group or question text", formalDefinition="Text that is displayed above the contents of the group or as the text of the question being answered." )
169        protected StringType text;
170
171        /**
172         * More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.
173         */
174        @Child(name = "subject", type = {}, order=3, min=0, max=1, modifier=false, summary=false)
175        @Description(shortDefinition="The subject this group's answers are about", formalDefinition="More specific subject this section's answers are about, details the subject given in QuestionnaireResponse." )
176        protected Reference subject;
177
178        /**
179         * The actual object that is the target of the reference (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.)
180         */
181        protected Resource subjectTarget;
182
183        /**
184         * The respondent's answer(s) to the question.
185         */
186        @Child(name = "answer", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
187        @Description(shortDefinition="The response(s) to the question", formalDefinition="The respondent's answer(s) to the question." )
188        protected List<QuestionnaireResponseItemAnswerComponent> answer;
189
190        /**
191         * Questions or sub-groups nested beneath a question or group.
192         */
193        @Child(name = "item", type = {QuestionnaireResponseItemComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
194        @Description(shortDefinition="Nested questionnaire response items", formalDefinition="Questions or sub-groups nested beneath a question or group." )
195        protected List<QuestionnaireResponseItemComponent> item;
196
197        private static final long serialVersionUID = 1059526517L;
198
199    /**
200     * Constructor
201     */
202      public QuestionnaireResponseItemComponent() {
203        super();
204      }
205
206        /**
207         * @return {@link #linkId} (Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value
208         */
209        public StringType getLinkIdElement() { 
210          if (this.linkId == null)
211            if (Configuration.errorOnAutoCreate())
212              throw new Error("Attempt to auto-create QuestionnaireResponseItemComponent.linkId");
213            else if (Configuration.doAutoCreate())
214              this.linkId = new StringType(); // bb
215          return this.linkId;
216        }
217
218        public boolean hasLinkIdElement() { 
219          return this.linkId != null && !this.linkId.isEmpty();
220        }
221
222        public boolean hasLinkId() { 
223          return this.linkId != null && !this.linkId.isEmpty();
224        }
225
226        /**
227         * @param value {@link #linkId} (Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value
228         */
229        public QuestionnaireResponseItemComponent setLinkIdElement(StringType value) { 
230          this.linkId = value;
231          return this;
232        }
233
234        /**
235         * @return Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.
236         */
237        public String getLinkId() { 
238          return this.linkId == null ? null : this.linkId.getValue();
239        }
240
241        /**
242         * @param value Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.
243         */
244        public QuestionnaireResponseItemComponent setLinkId(String value) { 
245          if (Utilities.noString(value))
246            this.linkId = null;
247          else {
248            if (this.linkId == null)
249              this.linkId = new StringType();
250            this.linkId.setValue(value);
251          }
252          return this;
253        }
254
255        /**
256         * @return {@link #text} (Text that is displayed above the contents of the group or as the text of the question being answered.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
257         */
258        public StringType getTextElement() { 
259          if (this.text == null)
260            if (Configuration.errorOnAutoCreate())
261              throw new Error("Attempt to auto-create QuestionnaireResponseItemComponent.text");
262            else if (Configuration.doAutoCreate())
263              this.text = new StringType(); // bb
264          return this.text;
265        }
266
267        public boolean hasTextElement() { 
268          return this.text != null && !this.text.isEmpty();
269        }
270
271        public boolean hasText() { 
272          return this.text != null && !this.text.isEmpty();
273        }
274
275        /**
276         * @param value {@link #text} (Text that is displayed above the contents of the group or as the text of the question being answered.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
277         */
278        public QuestionnaireResponseItemComponent setTextElement(StringType value) { 
279          this.text = value;
280          return this;
281        }
282
283        /**
284         * @return Text that is displayed above the contents of the group or as the text of the question being answered.
285         */
286        public String getText() { 
287          return this.text == null ? null : this.text.getValue();
288        }
289
290        /**
291         * @param value Text that is displayed above the contents of the group or as the text of the question being answered.
292         */
293        public QuestionnaireResponseItemComponent setText(String value) { 
294          if (Utilities.noString(value))
295            this.text = null;
296          else {
297            if (this.text == null)
298              this.text = new StringType();
299            this.text.setValue(value);
300          }
301          return this;
302        }
303
304        /**
305         * @return {@link #subject} (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.)
306         */
307        public Reference getSubject() { 
308          if (this.subject == null)
309            if (Configuration.errorOnAutoCreate())
310              throw new Error("Attempt to auto-create QuestionnaireResponseItemComponent.subject");
311            else if (Configuration.doAutoCreate())
312              this.subject = new Reference(); // cc
313          return this.subject;
314        }
315
316        public boolean hasSubject() { 
317          return this.subject != null && !this.subject.isEmpty();
318        }
319
320        /**
321         * @param value {@link #subject} (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.)
322         */
323        public QuestionnaireResponseItemComponent setSubject(Reference value) { 
324          this.subject = value;
325          return this;
326        }
327
328        /**
329         * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.)
330         */
331        public Resource getSubjectTarget() { 
332          return this.subjectTarget;
333        }
334
335        /**
336         * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.)
337         */
338        public QuestionnaireResponseItemComponent setSubjectTarget(Resource value) { 
339          this.subjectTarget = value;
340          return this;
341        }
342
343        /**
344         * @return {@link #answer} (The respondent's answer(s) to the question.)
345         */
346        public List<QuestionnaireResponseItemAnswerComponent> getAnswer() { 
347          if (this.answer == null)
348            this.answer = new ArrayList<QuestionnaireResponseItemAnswerComponent>();
349          return this.answer;
350        }
351
352        public boolean hasAnswer() { 
353          if (this.answer == null)
354            return false;
355          for (QuestionnaireResponseItemAnswerComponent item : this.answer)
356            if (!item.isEmpty())
357              return true;
358          return false;
359        }
360
361        /**
362         * @return {@link #answer} (The respondent's answer(s) to the question.)
363         */
364    // syntactic sugar
365        public QuestionnaireResponseItemAnswerComponent addAnswer() { //3
366          QuestionnaireResponseItemAnswerComponent t = new QuestionnaireResponseItemAnswerComponent();
367          if (this.answer == null)
368            this.answer = new ArrayList<QuestionnaireResponseItemAnswerComponent>();
369          this.answer.add(t);
370          return t;
371        }
372
373    // syntactic sugar
374        public QuestionnaireResponseItemComponent addAnswer(QuestionnaireResponseItemAnswerComponent t) { //3
375          if (t == null)
376            return this;
377          if (this.answer == null)
378            this.answer = new ArrayList<QuestionnaireResponseItemAnswerComponent>();
379          this.answer.add(t);
380          return this;
381        }
382
383        /**
384         * @return {@link #item} (Questions or sub-groups nested beneath a question or group.)
385         */
386        public List<QuestionnaireResponseItemComponent> getItem() { 
387          if (this.item == null)
388            this.item = new ArrayList<QuestionnaireResponseItemComponent>();
389          return this.item;
390        }
391
392        public boolean hasItem() { 
393          if (this.item == null)
394            return false;
395          for (QuestionnaireResponseItemComponent item : this.item)
396            if (!item.isEmpty())
397              return true;
398          return false;
399        }
400
401        /**
402         * @return {@link #item} (Questions or sub-groups nested beneath a question or group.)
403         */
404    // syntactic sugar
405        public QuestionnaireResponseItemComponent addItem() { //3
406          QuestionnaireResponseItemComponent t = new QuestionnaireResponseItemComponent();
407          if (this.item == null)
408            this.item = new ArrayList<QuestionnaireResponseItemComponent>();
409          this.item.add(t);
410          return t;
411        }
412
413    // syntactic sugar
414        public QuestionnaireResponseItemComponent addItem(QuestionnaireResponseItemComponent t) { //3
415          if (t == null)
416            return this;
417          if (this.item == null)
418            this.item = new ArrayList<QuestionnaireResponseItemComponent>();
419          this.item.add(t);
420          return this;
421        }
422
423        protected void listChildren(List<Property> childrenList) {
424          super.listChildren(childrenList);
425          childrenList.add(new Property("linkId", "string", "Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.", 0, java.lang.Integer.MAX_VALUE, linkId));
426          childrenList.add(new Property("text", "string", "Text that is displayed above the contents of the group or as the text of the question being answered.", 0, java.lang.Integer.MAX_VALUE, text));
427          childrenList.add(new Property("subject", "Reference(Any)", "More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, subject));
428          childrenList.add(new Property("answer", "", "The respondent's answer(s) to the question.", 0, java.lang.Integer.MAX_VALUE, answer));
429          childrenList.add(new Property("item", "@QuestionnaireResponse.item", "Questions or sub-groups nested beneath a question or group.", 0, java.lang.Integer.MAX_VALUE, item));
430        }
431
432      @Override
433      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
434        switch (hash) {
435        case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : new Base[] {this.linkId}; // StringType
436        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
437        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
438        case -1412808770: /*answer*/ return this.answer == null ? new Base[0] : this.answer.toArray(new Base[this.answer.size()]); // QuestionnaireResponseItemAnswerComponent
439        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireResponseItemComponent
440        default: return super.getProperty(hash, name, checkValid);
441        }
442
443      }
444
445      @Override
446      public void setProperty(int hash, String name, Base value) throws FHIRException {
447        switch (hash) {
448        case -1102667083: // linkId
449          this.linkId = castToString(value); // StringType
450          break;
451        case 3556653: // text
452          this.text = castToString(value); // StringType
453          break;
454        case -1867885268: // subject
455          this.subject = castToReference(value); // Reference
456          break;
457        case -1412808770: // answer
458          this.getAnswer().add((QuestionnaireResponseItemAnswerComponent) value); // QuestionnaireResponseItemAnswerComponent
459          break;
460        case 3242771: // item
461          this.getItem().add((QuestionnaireResponseItemComponent) value); // QuestionnaireResponseItemComponent
462          break;
463        default: super.setProperty(hash, name, value);
464        }
465
466      }
467
468      @Override
469      public void setProperty(String name, Base value) throws FHIRException {
470        if (name.equals("linkId"))
471          this.linkId = castToString(value); // StringType
472        else if (name.equals("text"))
473          this.text = castToString(value); // StringType
474        else if (name.equals("subject"))
475          this.subject = castToReference(value); // Reference
476        else if (name.equals("answer"))
477          this.getAnswer().add((QuestionnaireResponseItemAnswerComponent) value);
478        else if (name.equals("item"))
479          this.getItem().add((QuestionnaireResponseItemComponent) value);
480        else
481          super.setProperty(name, value);
482      }
483
484      @Override
485      public Base makeProperty(int hash, String name) throws FHIRException {
486        switch (hash) {
487        case -1102667083: throw new FHIRException("Cannot make property linkId as it is not a complex type"); // StringType
488        case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType
489        case -1867885268:  return getSubject(); // Reference
490        case -1412808770:  return addAnswer(); // QuestionnaireResponseItemAnswerComponent
491        case 3242771:  return addItem(); // QuestionnaireResponseItemComponent
492        default: return super.makeProperty(hash, name);
493        }
494
495      }
496
497      @Override
498      public Base addChild(String name) throws FHIRException {
499        if (name.equals("linkId")) {
500          throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.linkId");
501        }
502        else if (name.equals("text")) {
503          throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.text");
504        }
505        else if (name.equals("subject")) {
506          this.subject = new Reference();
507          return this.subject;
508        }
509        else if (name.equals("answer")) {
510          return addAnswer();
511        }
512        else if (name.equals("item")) {
513          return addItem();
514        }
515        else
516          return super.addChild(name);
517      }
518
519      public QuestionnaireResponseItemComponent copy() {
520        QuestionnaireResponseItemComponent dst = new QuestionnaireResponseItemComponent();
521        copyValues(dst);
522        dst.linkId = linkId == null ? null : linkId.copy();
523        dst.text = text == null ? null : text.copy();
524        dst.subject = subject == null ? null : subject.copy();
525        if (answer != null) {
526          dst.answer = new ArrayList<QuestionnaireResponseItemAnswerComponent>();
527          for (QuestionnaireResponseItemAnswerComponent i : answer)
528            dst.answer.add(i.copy());
529        };
530        if (item != null) {
531          dst.item = new ArrayList<QuestionnaireResponseItemComponent>();
532          for (QuestionnaireResponseItemComponent i : item)
533            dst.item.add(i.copy());
534        };
535        return dst;
536      }
537
538      @Override
539      public boolean equalsDeep(Base other) {
540        if (!super.equalsDeep(other))
541          return false;
542        if (!(other instanceof QuestionnaireResponseItemComponent))
543          return false;
544        QuestionnaireResponseItemComponent o = (QuestionnaireResponseItemComponent) other;
545        return compareDeep(linkId, o.linkId, true) && compareDeep(text, o.text, true) && compareDeep(subject, o.subject, true)
546           && compareDeep(answer, o.answer, true) && compareDeep(item, o.item, true);
547      }
548
549      @Override
550      public boolean equalsShallow(Base other) {
551        if (!super.equalsShallow(other))
552          return false;
553        if (!(other instanceof QuestionnaireResponseItemComponent))
554          return false;
555        QuestionnaireResponseItemComponent o = (QuestionnaireResponseItemComponent) other;
556        return compareValues(linkId, o.linkId, true) && compareValues(text, o.text, true);
557      }
558
559      public boolean isEmpty() {
560        return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (text == null || text.isEmpty())
561           && (subject == null || subject.isEmpty()) && (answer == null || answer.isEmpty()) && (item == null || item.isEmpty())
562          ;
563      }
564
565  public String fhirType() {
566    return "QuestionnaireResponse.item";
567
568  }
569
570  }
571
572    @Block()
573    public static class QuestionnaireResponseItemAnswerComponent extends BackboneElement implements IBaseBackboneElement {
574        /**
575         * The answer (or one of the answers) provided by the respondent to the question.
576         */
577        @Child(name = "value", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class}, order=1, min=0, max=1, modifier=false, summary=false)
578        @Description(shortDefinition="Single-valued answer to the question", formalDefinition="The answer (or one of the answers) provided by the respondent to the question." )
579        protected Type value;
580
581        /**
582         * Nested groups and/or questions found within this particular answer.
583         */
584        @Child(name = "item", type = {QuestionnaireResponseItemComponent.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
585        @Description(shortDefinition="Nested groups and questions", formalDefinition="Nested groups and/or questions found within this particular answer." )
586        protected List<QuestionnaireResponseItemComponent> item;
587
588        private static final long serialVersionUID = 2052422636L;
589
590    /**
591     * Constructor
592     */
593      public QuestionnaireResponseItemAnswerComponent() {
594        super();
595      }
596
597        /**
598         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
599         */
600        public Type getValue() { 
601          return this.value;
602        }
603
604        /**
605         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
606         */
607        public BooleanType getValueBooleanType() throws FHIRException { 
608          if (!(this.value instanceof BooleanType))
609            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
610          return (BooleanType) this.value;
611        }
612
613        public boolean hasValueBooleanType() { 
614          return this.value instanceof BooleanType;
615        }
616
617        /**
618         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
619         */
620        public DecimalType getValueDecimalType() throws FHIRException { 
621          if (!(this.value instanceof DecimalType))
622            throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered");
623          return (DecimalType) this.value;
624        }
625
626        public boolean hasValueDecimalType() { 
627          return this.value instanceof DecimalType;
628        }
629
630        /**
631         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
632         */
633        public IntegerType getValueIntegerType() throws FHIRException { 
634          if (!(this.value instanceof IntegerType))
635            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
636          return (IntegerType) this.value;
637        }
638
639        public boolean hasValueIntegerType() { 
640          return this.value instanceof IntegerType;
641        }
642
643        /**
644         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
645         */
646        public DateType getValueDateType() throws FHIRException { 
647          if (!(this.value instanceof DateType))
648            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered");
649          return (DateType) this.value;
650        }
651
652        public boolean hasValueDateType() { 
653          return this.value instanceof DateType;
654        }
655
656        /**
657         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
658         */
659        public DateTimeType getValueDateTimeType() throws FHIRException { 
660          if (!(this.value instanceof DateTimeType))
661            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered");
662          return (DateTimeType) this.value;
663        }
664
665        public boolean hasValueDateTimeType() { 
666          return this.value instanceof DateTimeType;
667        }
668
669        /**
670         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
671         */
672        public InstantType getValueInstantType() throws FHIRException { 
673          if (!(this.value instanceof InstantType))
674            throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.value.getClass().getName()+" was encountered");
675          return (InstantType) this.value;
676        }
677
678        public boolean hasValueInstantType() { 
679          return this.value instanceof InstantType;
680        }
681
682        /**
683         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
684         */
685        public TimeType getValueTimeType() throws FHIRException { 
686          if (!(this.value instanceof TimeType))
687            throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered");
688          return (TimeType) this.value;
689        }
690
691        public boolean hasValueTimeType() { 
692          return this.value instanceof TimeType;
693        }
694
695        /**
696         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
697         */
698        public StringType getValueStringType() throws FHIRException { 
699          if (!(this.value instanceof StringType))
700            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
701          return (StringType) this.value;
702        }
703
704        public boolean hasValueStringType() { 
705          return this.value instanceof StringType;
706        }
707
708        /**
709         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
710         */
711        public UriType getValueUriType() throws FHIRException { 
712          if (!(this.value instanceof UriType))
713            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered");
714          return (UriType) this.value;
715        }
716
717        public boolean hasValueUriType() { 
718          return this.value instanceof UriType;
719        }
720
721        /**
722         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
723         */
724        public Attachment getValueAttachment() throws FHIRException { 
725          if (!(this.value instanceof Attachment))
726            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
727          return (Attachment) this.value;
728        }
729
730        public boolean hasValueAttachment() { 
731          return this.value instanceof Attachment;
732        }
733
734        /**
735         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
736         */
737        public Coding getValueCoding() throws FHIRException { 
738          if (!(this.value instanceof Coding))
739            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered");
740          return (Coding) this.value;
741        }
742
743        public boolean hasValueCoding() { 
744          return this.value instanceof Coding;
745        }
746
747        /**
748         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
749         */
750        public Quantity getValueQuantity() throws FHIRException { 
751          if (!(this.value instanceof Quantity))
752            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
753          return (Quantity) this.value;
754        }
755
756        public boolean hasValueQuantity() { 
757          return this.value instanceof Quantity;
758        }
759
760        /**
761         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
762         */
763        public Reference getValueReference() throws FHIRException { 
764          if (!(this.value instanceof Reference))
765            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered");
766          return (Reference) this.value;
767        }
768
769        public boolean hasValueReference() { 
770          return this.value instanceof Reference;
771        }
772
773        public boolean hasValue() { 
774          return this.value != null && !this.value.isEmpty();
775        }
776
777        /**
778         * @param value {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
779         */
780        public QuestionnaireResponseItemAnswerComponent setValue(Type value) { 
781          this.value = value;
782          return this;
783        }
784
785        /**
786         * @return {@link #item} (Nested groups and/or questions found within this particular answer.)
787         */
788        public List<QuestionnaireResponseItemComponent> getItem() { 
789          if (this.item == null)
790            this.item = new ArrayList<QuestionnaireResponseItemComponent>();
791          return this.item;
792        }
793
794        public boolean hasItem() { 
795          if (this.item == null)
796            return false;
797          for (QuestionnaireResponseItemComponent item : this.item)
798            if (!item.isEmpty())
799              return true;
800          return false;
801        }
802
803        /**
804         * @return {@link #item} (Nested groups and/or questions found within this particular answer.)
805         */
806    // syntactic sugar
807        public QuestionnaireResponseItemComponent addItem() { //3
808          QuestionnaireResponseItemComponent t = new QuestionnaireResponseItemComponent();
809          if (this.item == null)
810            this.item = new ArrayList<QuestionnaireResponseItemComponent>();
811          this.item.add(t);
812          return t;
813        }
814
815    // syntactic sugar
816        public QuestionnaireResponseItemAnswerComponent addItem(QuestionnaireResponseItemComponent t) { //3
817          if (t == null)
818            return this;
819          if (this.item == null)
820            this.item = new ArrayList<QuestionnaireResponseItemComponent>();
821          this.item.add(t);
822          return this;
823        }
824
825        protected void listChildren(List<Property> childrenList) {
826          super.listChildren(childrenList);
827          childrenList.add(new Property("value[x]", "boolean|decimal|integer|date|dateTime|instant|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, java.lang.Integer.MAX_VALUE, value));
828          childrenList.add(new Property("item", "@QuestionnaireResponse.item", "Nested groups and/or questions found within this particular answer.", 0, java.lang.Integer.MAX_VALUE, item));
829        }
830
831      @Override
832      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
833        switch (hash) {
834        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type
835        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireResponseItemComponent
836        default: return super.getProperty(hash, name, checkValid);
837        }
838
839      }
840
841      @Override
842      public void setProperty(int hash, String name, Base value) throws FHIRException {
843        switch (hash) {
844        case 111972721: // value
845          this.value = (Type) value; // Type
846          break;
847        case 3242771: // item
848          this.getItem().add((QuestionnaireResponseItemComponent) value); // QuestionnaireResponseItemComponent
849          break;
850        default: super.setProperty(hash, name, value);
851        }
852
853      }
854
855      @Override
856      public void setProperty(String name, Base value) throws FHIRException {
857        if (name.equals("value[x]"))
858          this.value = (Type) value; // Type
859        else if (name.equals("item"))
860          this.getItem().add((QuestionnaireResponseItemComponent) value);
861        else
862          super.setProperty(name, value);
863      }
864
865      @Override
866      public Base makeProperty(int hash, String name) throws FHIRException {
867        switch (hash) {
868        case -1410166417:  return getValue(); // Type
869        case 3242771:  return addItem(); // QuestionnaireResponseItemComponent
870        default: return super.makeProperty(hash, name);
871        }
872
873      }
874
875      @Override
876      public Base addChild(String name) throws FHIRException {
877        if (name.equals("valueBoolean")) {
878          this.value = new BooleanType();
879          return this.value;
880        }
881        else if (name.equals("valueDecimal")) {
882          this.value = new DecimalType();
883          return this.value;
884        }
885        else if (name.equals("valueInteger")) {
886          this.value = new IntegerType();
887          return this.value;
888        }
889        else if (name.equals("valueDate")) {
890          this.value = new DateType();
891          return this.value;
892        }
893        else if (name.equals("valueDateTime")) {
894          this.value = new DateTimeType();
895          return this.value;
896        }
897        else if (name.equals("valueInstant")) {
898          this.value = new InstantType();
899          return this.value;
900        }
901        else if (name.equals("valueTime")) {
902          this.value = new TimeType();
903          return this.value;
904        }
905        else if (name.equals("valueString")) {
906          this.value = new StringType();
907          return this.value;
908        }
909        else if (name.equals("valueUri")) {
910          this.value = new UriType();
911          return this.value;
912        }
913        else if (name.equals("valueAttachment")) {
914          this.value = new Attachment();
915          return this.value;
916        }
917        else if (name.equals("valueCoding")) {
918          this.value = new Coding();
919          return this.value;
920        }
921        else if (name.equals("valueQuantity")) {
922          this.value = new Quantity();
923          return this.value;
924        }
925        else if (name.equals("valueReference")) {
926          this.value = new Reference();
927          return this.value;
928        }
929        else if (name.equals("item")) {
930          return addItem();
931        }
932        else
933          return super.addChild(name);
934      }
935
936      public QuestionnaireResponseItemAnswerComponent copy() {
937        QuestionnaireResponseItemAnswerComponent dst = new QuestionnaireResponseItemAnswerComponent();
938        copyValues(dst);
939        dst.value = value == null ? null : value.copy();
940        if (item != null) {
941          dst.item = new ArrayList<QuestionnaireResponseItemComponent>();
942          for (QuestionnaireResponseItemComponent i : item)
943            dst.item.add(i.copy());
944        };
945        return dst;
946      }
947
948      @Override
949      public boolean equalsDeep(Base other) {
950        if (!super.equalsDeep(other))
951          return false;
952        if (!(other instanceof QuestionnaireResponseItemAnswerComponent))
953          return false;
954        QuestionnaireResponseItemAnswerComponent o = (QuestionnaireResponseItemAnswerComponent) other;
955        return compareDeep(value, o.value, true) && compareDeep(item, o.item, true);
956      }
957
958      @Override
959      public boolean equalsShallow(Base other) {
960        if (!super.equalsShallow(other))
961          return false;
962        if (!(other instanceof QuestionnaireResponseItemAnswerComponent))
963          return false;
964        QuestionnaireResponseItemAnswerComponent o = (QuestionnaireResponseItemAnswerComponent) other;
965        return true;
966      }
967
968      public boolean isEmpty() {
969        return super.isEmpty() && (value == null || value.isEmpty()) && (item == null || item.isEmpty())
970          ;
971      }
972
973  public String fhirType() {
974    return "QuestionnaireResponse.item.answer";
975
976  }
977
978  }
979
980    /**
981     * A business identifier assigned to a particular completed (or partially completed) questionnaire.
982     */
983    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true)
984    @Description(shortDefinition="Unique id for this set of answers", formalDefinition="A business identifier assigned to a particular completed (or partially completed) questionnaire." )
985    protected Identifier identifier;
986
987    /**
988     * Indicates the Questionnaire resource that defines the form for which answers are being provided.
989     */
990    @Child(name = "questionnaire", type = {Questionnaire.class}, order=1, min=0, max=1, modifier=false, summary=true)
991    @Description(shortDefinition="Form being answered", formalDefinition="Indicates the Questionnaire resource that defines the form for which answers are being provided." )
992    protected Reference questionnaire;
993
994    /**
995     * The actual object that is the target of the reference (Indicates the Questionnaire resource that defines the form for which answers are being provided.)
996     */
997    protected Questionnaire questionnaireTarget;
998
999    /**
1000     * The lifecycle status of the questionnaire response as a whole.
1001     */
1002    @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true)
1003    @Description(shortDefinition="in-progress | completed | amended", formalDefinition="The lifecycle status of the questionnaire response as a whole." )
1004    protected Enumeration<QuestionnaireResponseStatus> status;
1005
1006    /**
1007     * The subject of the questionnaire response.  This could be a patient, organization, practitioner, device, etc.  This is who/what the answers apply to, but is not necessarily the source of information.
1008     */
1009    @Child(name = "subject", type = {}, order=3, min=0, max=1, modifier=false, summary=true)
1010    @Description(shortDefinition="The subject of the questions", formalDefinition="The subject of the questionnaire response.  This could be a patient, organization, practitioner, device, etc.  This is who/what the answers apply to, but is not necessarily the source of information." )
1011    protected Reference subject;
1012
1013    /**
1014     * The actual object that is the target of the reference (The subject of the questionnaire response.  This could be a patient, organization, practitioner, device, etc.  This is who/what the answers apply to, but is not necessarily the source of information.)
1015     */
1016    protected Resource subjectTarget;
1017
1018    /**
1019     * Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.
1020     */
1021    @Child(name = "author", type = {Device.class, Practitioner.class, Patient.class, RelatedPerson.class}, order=4, min=0, max=1, modifier=false, summary=true)
1022    @Description(shortDefinition="Person who received and recorded the answers", formalDefinition="Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system." )
1023    protected Reference author;
1024
1025    /**
1026     * The actual object that is the target of the reference (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.)
1027     */
1028    protected Resource authorTarget;
1029
1030    /**
1031     * The date and/or time that this version of the questionnaire response was authored.
1032     */
1033    @Child(name = "authored", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true)
1034    @Description(shortDefinition="Date this version was authored", formalDefinition="The date and/or time that this version of the questionnaire response was authored." )
1035    protected DateTimeType authored;
1036
1037    /**
1038     * The person who answered the questions about the subject.
1039     */
1040    @Child(name = "source", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=6, min=0, max=1, modifier=false, summary=true)
1041    @Description(shortDefinition="The person who answered the questions", formalDefinition="The person who answered the questions about the subject." )
1042    protected Reference source;
1043
1044    /**
1045     * The actual object that is the target of the reference (The person who answered the questions about the subject.)
1046     */
1047    protected Resource sourceTarget;
1048
1049    /**
1050     * Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.
1051     */
1052    @Child(name = "encounter", type = {Encounter.class}, order=7, min=0, max=1, modifier=false, summary=true)
1053    @Description(shortDefinition="Primary encounter during which the answers were collected", formalDefinition="Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers." )
1054    protected Reference encounter;
1055
1056    /**
1057     * The actual object that is the target of the reference (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.)
1058     */
1059    protected Encounter encounterTarget;
1060
1061    /**
1062     * Corresponds to a group or question item from the original questionnaire.
1063     */
1064    @Child(name = "item", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1065    @Description(shortDefinition="Groups and questions", formalDefinition="Corresponds to a group or question item from the original questionnaire." )
1066    protected List<QuestionnaireResponseItemComponent> item;
1067
1068    private static final long serialVersionUID = 850624885L;
1069
1070  /**
1071   * Constructor
1072   */
1073    public QuestionnaireResponse() {
1074      super();
1075    }
1076
1077  /**
1078   * Constructor
1079   */
1080    public QuestionnaireResponse(Enumeration<QuestionnaireResponseStatus> status) {
1081      super();
1082      this.status = status;
1083    }
1084
1085    /**
1086     * @return {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.)
1087     */
1088    public Identifier getIdentifier() { 
1089      if (this.identifier == null)
1090        if (Configuration.errorOnAutoCreate())
1091          throw new Error("Attempt to auto-create QuestionnaireResponse.identifier");
1092        else if (Configuration.doAutoCreate())
1093          this.identifier = new Identifier(); // cc
1094      return this.identifier;
1095    }
1096
1097    public boolean hasIdentifier() { 
1098      return this.identifier != null && !this.identifier.isEmpty();
1099    }
1100
1101    /**
1102     * @param value {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.)
1103     */
1104    public QuestionnaireResponse setIdentifier(Identifier value) { 
1105      this.identifier = value;
1106      return this;
1107    }
1108
1109    /**
1110     * @return {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.)
1111     */
1112    public Reference getQuestionnaire() { 
1113      if (this.questionnaire == null)
1114        if (Configuration.errorOnAutoCreate())
1115          throw new Error("Attempt to auto-create QuestionnaireResponse.questionnaire");
1116        else if (Configuration.doAutoCreate())
1117          this.questionnaire = new Reference(); // cc
1118      return this.questionnaire;
1119    }
1120
1121    public boolean hasQuestionnaire() { 
1122      return this.questionnaire != null && !this.questionnaire.isEmpty();
1123    }
1124
1125    /**
1126     * @param value {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.)
1127     */
1128    public QuestionnaireResponse setQuestionnaire(Reference value) { 
1129      this.questionnaire = value;
1130      return this;
1131    }
1132
1133    /**
1134     * @return {@link #questionnaire} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the Questionnaire resource that defines the form for which answers are being provided.)
1135     */
1136    public Questionnaire getQuestionnaireTarget() { 
1137      if (this.questionnaireTarget == null)
1138        if (Configuration.errorOnAutoCreate())
1139          throw new Error("Attempt to auto-create QuestionnaireResponse.questionnaire");
1140        else if (Configuration.doAutoCreate())
1141          this.questionnaireTarget = new Questionnaire(); // aa
1142      return this.questionnaireTarget;
1143    }
1144
1145    /**
1146     * @param value {@link #questionnaire} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the Questionnaire resource that defines the form for which answers are being provided.)
1147     */
1148    public QuestionnaireResponse setQuestionnaireTarget(Questionnaire value) { 
1149      this.questionnaireTarget = value;
1150      return this;
1151    }
1152
1153    /**
1154     * @return {@link #status} (The lifecycle status of the questionnaire response as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1155     */
1156    public Enumeration<QuestionnaireResponseStatus> getStatusElement() { 
1157      if (this.status == null)
1158        if (Configuration.errorOnAutoCreate())
1159          throw new Error("Attempt to auto-create QuestionnaireResponse.status");
1160        else if (Configuration.doAutoCreate())
1161          this.status = new Enumeration<QuestionnaireResponseStatus>(new QuestionnaireResponseStatusEnumFactory()); // bb
1162      return this.status;
1163    }
1164
1165    public boolean hasStatusElement() { 
1166      return this.status != null && !this.status.isEmpty();
1167    }
1168
1169    public boolean hasStatus() { 
1170      return this.status != null && !this.status.isEmpty();
1171    }
1172
1173    /**
1174     * @param value {@link #status} (The lifecycle status of the questionnaire response as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1175     */
1176    public QuestionnaireResponse setStatusElement(Enumeration<QuestionnaireResponseStatus> value) { 
1177      this.status = value;
1178      return this;
1179    }
1180
1181    /**
1182     * @return The lifecycle status of the questionnaire response as a whole.
1183     */
1184    public QuestionnaireResponseStatus getStatus() { 
1185      return this.status == null ? null : this.status.getValue();
1186    }
1187
1188    /**
1189     * @param value The lifecycle status of the questionnaire response as a whole.
1190     */
1191    public QuestionnaireResponse setStatus(QuestionnaireResponseStatus value) { 
1192        if (this.status == null)
1193          this.status = new Enumeration<QuestionnaireResponseStatus>(new QuestionnaireResponseStatusEnumFactory());
1194        this.status.setValue(value);
1195      return this;
1196    }
1197
1198    /**
1199     * @return {@link #subject} (The subject of the questionnaire response.  This could be a patient, organization, practitioner, device, etc.  This is who/what the answers apply to, but is not necessarily the source of information.)
1200     */
1201    public Reference getSubject() { 
1202      if (this.subject == null)
1203        if (Configuration.errorOnAutoCreate())
1204          throw new Error("Attempt to auto-create QuestionnaireResponse.subject");
1205        else if (Configuration.doAutoCreate())
1206          this.subject = new Reference(); // cc
1207      return this.subject;
1208    }
1209
1210    public boolean hasSubject() { 
1211      return this.subject != null && !this.subject.isEmpty();
1212    }
1213
1214    /**
1215     * @param value {@link #subject} (The subject of the questionnaire response.  This could be a patient, organization, practitioner, device, etc.  This is who/what the answers apply to, but is not necessarily the source of information.)
1216     */
1217    public QuestionnaireResponse setSubject(Reference value) { 
1218      this.subject = value;
1219      return this;
1220    }
1221
1222    /**
1223     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The subject of the questionnaire response.  This could be a patient, organization, practitioner, device, etc.  This is who/what the answers apply to, but is not necessarily the source of information.)
1224     */
1225    public Resource getSubjectTarget() { 
1226      return this.subjectTarget;
1227    }
1228
1229    /**
1230     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The subject of the questionnaire response.  This could be a patient, organization, practitioner, device, etc.  This is who/what the answers apply to, but is not necessarily the source of information.)
1231     */
1232    public QuestionnaireResponse setSubjectTarget(Resource value) { 
1233      this.subjectTarget = value;
1234      return this;
1235    }
1236
1237    /**
1238     * @return {@link #author} (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.)
1239     */
1240    public Reference getAuthor() { 
1241      if (this.author == null)
1242        if (Configuration.errorOnAutoCreate())
1243          throw new Error("Attempt to auto-create QuestionnaireResponse.author");
1244        else if (Configuration.doAutoCreate())
1245          this.author = new Reference(); // cc
1246      return this.author;
1247    }
1248
1249    public boolean hasAuthor() { 
1250      return this.author != null && !this.author.isEmpty();
1251    }
1252
1253    /**
1254     * @param value {@link #author} (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.)
1255     */
1256    public QuestionnaireResponse setAuthor(Reference value) { 
1257      this.author = value;
1258      return this;
1259    }
1260
1261    /**
1262     * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.)
1263     */
1264    public Resource getAuthorTarget() { 
1265      return this.authorTarget;
1266    }
1267
1268    /**
1269     * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.)
1270     */
1271    public QuestionnaireResponse setAuthorTarget(Resource value) { 
1272      this.authorTarget = value;
1273      return this;
1274    }
1275
1276    /**
1277     * @return {@link #authored} (The date and/or time that this version of the questionnaire response was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value
1278     */
1279    public DateTimeType getAuthoredElement() { 
1280      if (this.authored == null)
1281        if (Configuration.errorOnAutoCreate())
1282          throw new Error("Attempt to auto-create QuestionnaireResponse.authored");
1283        else if (Configuration.doAutoCreate())
1284          this.authored = new DateTimeType(); // bb
1285      return this.authored;
1286    }
1287
1288    public boolean hasAuthoredElement() { 
1289      return this.authored != null && !this.authored.isEmpty();
1290    }
1291
1292    public boolean hasAuthored() { 
1293      return this.authored != null && !this.authored.isEmpty();
1294    }
1295
1296    /**
1297     * @param value {@link #authored} (The date and/or time that this version of the questionnaire response was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value
1298     */
1299    public QuestionnaireResponse setAuthoredElement(DateTimeType value) { 
1300      this.authored = value;
1301      return this;
1302    }
1303
1304    /**
1305     * @return The date and/or time that this version of the questionnaire response was authored.
1306     */
1307    public Date getAuthored() { 
1308      return this.authored == null ? null : this.authored.getValue();
1309    }
1310
1311    /**
1312     * @param value The date and/or time that this version of the questionnaire response was authored.
1313     */
1314    public QuestionnaireResponse setAuthored(Date value) { 
1315      if (value == null)
1316        this.authored = null;
1317      else {
1318        if (this.authored == null)
1319          this.authored = new DateTimeType();
1320        this.authored.setValue(value);
1321      }
1322      return this;
1323    }
1324
1325    /**
1326     * @return {@link #source} (The person who answered the questions about the subject.)
1327     */
1328    public Reference getSource() { 
1329      if (this.source == null)
1330        if (Configuration.errorOnAutoCreate())
1331          throw new Error("Attempt to auto-create QuestionnaireResponse.source");
1332        else if (Configuration.doAutoCreate())
1333          this.source = new Reference(); // cc
1334      return this.source;
1335    }
1336
1337    public boolean hasSource() { 
1338      return this.source != null && !this.source.isEmpty();
1339    }
1340
1341    /**
1342     * @param value {@link #source} (The person who answered the questions about the subject.)
1343     */
1344    public QuestionnaireResponse setSource(Reference value) { 
1345      this.source = value;
1346      return this;
1347    }
1348
1349    /**
1350     * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who answered the questions about the subject.)
1351     */
1352    public Resource getSourceTarget() { 
1353      return this.sourceTarget;
1354    }
1355
1356    /**
1357     * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who answered the questions about the subject.)
1358     */
1359    public QuestionnaireResponse setSourceTarget(Resource value) { 
1360      this.sourceTarget = value;
1361      return this;
1362    }
1363
1364    /**
1365     * @return {@link #encounter} (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.)
1366     */
1367    public Reference getEncounter() { 
1368      if (this.encounter == null)
1369        if (Configuration.errorOnAutoCreate())
1370          throw new Error("Attempt to auto-create QuestionnaireResponse.encounter");
1371        else if (Configuration.doAutoCreate())
1372          this.encounter = new Reference(); // cc
1373      return this.encounter;
1374    }
1375
1376    public boolean hasEncounter() { 
1377      return this.encounter != null && !this.encounter.isEmpty();
1378    }
1379
1380    /**
1381     * @param value {@link #encounter} (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.)
1382     */
1383    public QuestionnaireResponse setEncounter(Reference value) { 
1384      this.encounter = value;
1385      return this;
1386    }
1387
1388    /**
1389     * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.)
1390     */
1391    public Encounter getEncounterTarget() { 
1392      if (this.encounterTarget == null)
1393        if (Configuration.errorOnAutoCreate())
1394          throw new Error("Attempt to auto-create QuestionnaireResponse.encounter");
1395        else if (Configuration.doAutoCreate())
1396          this.encounterTarget = new Encounter(); // aa
1397      return this.encounterTarget;
1398    }
1399
1400    /**
1401     * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.)
1402     */
1403    public QuestionnaireResponse setEncounterTarget(Encounter value) { 
1404      this.encounterTarget = value;
1405      return this;
1406    }
1407
1408    /**
1409     * @return {@link #item} (Corresponds to a group or question item from the original questionnaire.)
1410     */
1411    public List<QuestionnaireResponseItemComponent> getItem() { 
1412      if (this.item == null)
1413        this.item = new ArrayList<QuestionnaireResponseItemComponent>();
1414      return this.item;
1415    }
1416
1417    public boolean hasItem() { 
1418      if (this.item == null)
1419        return false;
1420      for (QuestionnaireResponseItemComponent item : this.item)
1421        if (!item.isEmpty())
1422          return true;
1423      return false;
1424    }
1425
1426    /**
1427     * @return {@link #item} (Corresponds to a group or question item from the original questionnaire.)
1428     */
1429    // syntactic sugar
1430    public QuestionnaireResponseItemComponent addItem() { //3
1431      QuestionnaireResponseItemComponent t = new QuestionnaireResponseItemComponent();
1432      if (this.item == null)
1433        this.item = new ArrayList<QuestionnaireResponseItemComponent>();
1434      this.item.add(t);
1435      return t;
1436    }
1437
1438    // syntactic sugar
1439    public QuestionnaireResponse addItem(QuestionnaireResponseItemComponent t) { //3
1440      if (t == null)
1441        return this;
1442      if (this.item == null)
1443        this.item = new ArrayList<QuestionnaireResponseItemComponent>();
1444      this.item.add(t);
1445      return this;
1446    }
1447
1448      protected void listChildren(List<Property> childrenList) {
1449        super.listChildren(childrenList);
1450        childrenList.add(new Property("identifier", "Identifier", "A business identifier assigned to a particular completed (or partially completed) questionnaire.", 0, java.lang.Integer.MAX_VALUE, identifier));
1451        childrenList.add(new Property("questionnaire", "Reference(Questionnaire)", "Indicates the Questionnaire resource that defines the form for which answers are being provided.", 0, java.lang.Integer.MAX_VALUE, questionnaire));
1452        childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire response as a whole.", 0, java.lang.Integer.MAX_VALUE, status));
1453        childrenList.add(new Property("subject", "Reference(Any)", "The subject of the questionnaire response.  This could be a patient, organization, practitioner, device, etc.  This is who/what the answers apply to, but is not necessarily the source of information.", 0, java.lang.Integer.MAX_VALUE, subject));
1454        childrenList.add(new Property("author", "Reference(Device|Practitioner|Patient|RelatedPerson)", "Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.", 0, java.lang.Integer.MAX_VALUE, author));
1455        childrenList.add(new Property("authored", "dateTime", "The date and/or time that this version of the questionnaire response was authored.", 0, java.lang.Integer.MAX_VALUE, authored));
1456        childrenList.add(new Property("source", "Reference(Patient|Practitioner|RelatedPerson)", "The person who answered the questions about the subject.", 0, java.lang.Integer.MAX_VALUE, source));
1457        childrenList.add(new Property("encounter", "Reference(Encounter)", "Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.", 0, java.lang.Integer.MAX_VALUE, encounter));
1458        childrenList.add(new Property("item", "", "Corresponds to a group or question item from the original questionnaire.", 0, java.lang.Integer.MAX_VALUE, item));
1459      }
1460
1461      @Override
1462      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1463        switch (hash) {
1464        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
1465        case -1017049693: /*questionnaire*/ return this.questionnaire == null ? new Base[0] : new Base[] {this.questionnaire}; // Reference
1466        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<QuestionnaireResponseStatus>
1467        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1468        case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference
1469        case 1433073514: /*authored*/ return this.authored == null ? new Base[0] : new Base[] {this.authored}; // DateTimeType
1470        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference
1471        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
1472        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireResponseItemComponent
1473        default: return super.getProperty(hash, name, checkValid);
1474        }
1475
1476      }
1477
1478      @Override
1479      public void setProperty(int hash, String name, Base value) throws FHIRException {
1480        switch (hash) {
1481        case -1618432855: // identifier
1482          this.identifier = castToIdentifier(value); // Identifier
1483          break;
1484        case -1017049693: // questionnaire
1485          this.questionnaire = castToReference(value); // Reference
1486          break;
1487        case -892481550: // status
1488          this.status = new QuestionnaireResponseStatusEnumFactory().fromType(value); // Enumeration<QuestionnaireResponseStatus>
1489          break;
1490        case -1867885268: // subject
1491          this.subject = castToReference(value); // Reference
1492          break;
1493        case -1406328437: // author
1494          this.author = castToReference(value); // Reference
1495          break;
1496        case 1433073514: // authored
1497          this.authored = castToDateTime(value); // DateTimeType
1498          break;
1499        case -896505829: // source
1500          this.source = castToReference(value); // Reference
1501          break;
1502        case 1524132147: // encounter
1503          this.encounter = castToReference(value); // Reference
1504          break;
1505        case 3242771: // item
1506          this.getItem().add((QuestionnaireResponseItemComponent) value); // QuestionnaireResponseItemComponent
1507          break;
1508        default: super.setProperty(hash, name, value);
1509        }
1510
1511      }
1512
1513      @Override
1514      public void setProperty(String name, Base value) throws FHIRException {
1515        if (name.equals("identifier"))
1516          this.identifier = castToIdentifier(value); // Identifier
1517        else if (name.equals("questionnaire"))
1518          this.questionnaire = castToReference(value); // Reference
1519        else if (name.equals("status"))
1520          this.status = new QuestionnaireResponseStatusEnumFactory().fromType(value); // Enumeration<QuestionnaireResponseStatus>
1521        else if (name.equals("subject"))
1522          this.subject = castToReference(value); // Reference
1523        else if (name.equals("author"))
1524          this.author = castToReference(value); // Reference
1525        else if (name.equals("authored"))
1526          this.authored = castToDateTime(value); // DateTimeType
1527        else if (name.equals("source"))
1528          this.source = castToReference(value); // Reference
1529        else if (name.equals("encounter"))
1530          this.encounter = castToReference(value); // Reference
1531        else if (name.equals("item"))
1532          this.getItem().add((QuestionnaireResponseItemComponent) value);
1533        else
1534          super.setProperty(name, value);
1535      }
1536
1537      @Override
1538      public Base makeProperty(int hash, String name) throws FHIRException {
1539        switch (hash) {
1540        case -1618432855:  return getIdentifier(); // Identifier
1541        case -1017049693:  return getQuestionnaire(); // Reference
1542        case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration<QuestionnaireResponseStatus>
1543        case -1867885268:  return getSubject(); // Reference
1544        case -1406328437:  return getAuthor(); // Reference
1545        case 1433073514: throw new FHIRException("Cannot make property authored as it is not a complex type"); // DateTimeType
1546        case -896505829:  return getSource(); // Reference
1547        case 1524132147:  return getEncounter(); // Reference
1548        case 3242771:  return addItem(); // QuestionnaireResponseItemComponent
1549        default: return super.makeProperty(hash, name);
1550        }
1551
1552      }
1553
1554      @Override
1555      public Base addChild(String name) throws FHIRException {
1556        if (name.equals("identifier")) {
1557          this.identifier = new Identifier();
1558          return this.identifier;
1559        }
1560        else if (name.equals("questionnaire")) {
1561          this.questionnaire = new Reference();
1562          return this.questionnaire;
1563        }
1564        else if (name.equals("status")) {
1565          throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.status");
1566        }
1567        else if (name.equals("subject")) {
1568          this.subject = new Reference();
1569          return this.subject;
1570        }
1571        else if (name.equals("author")) {
1572          this.author = new Reference();
1573          return this.author;
1574        }
1575        else if (name.equals("authored")) {
1576          throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.authored");
1577        }
1578        else if (name.equals("source")) {
1579          this.source = new Reference();
1580          return this.source;
1581        }
1582        else if (name.equals("encounter")) {
1583          this.encounter = new Reference();
1584          return this.encounter;
1585        }
1586        else if (name.equals("item")) {
1587          return addItem();
1588        }
1589        else
1590          return super.addChild(name);
1591      }
1592
1593  public String fhirType() {
1594    return "QuestionnaireResponse";
1595
1596  }
1597
1598      public QuestionnaireResponse copy() {
1599        QuestionnaireResponse dst = new QuestionnaireResponse();
1600        copyValues(dst);
1601        dst.identifier = identifier == null ? null : identifier.copy();
1602        dst.questionnaire = questionnaire == null ? null : questionnaire.copy();
1603        dst.status = status == null ? null : status.copy();
1604        dst.subject = subject == null ? null : subject.copy();
1605        dst.author = author == null ? null : author.copy();
1606        dst.authored = authored == null ? null : authored.copy();
1607        dst.source = source == null ? null : source.copy();
1608        dst.encounter = encounter == null ? null : encounter.copy();
1609        if (item != null) {
1610          dst.item = new ArrayList<QuestionnaireResponseItemComponent>();
1611          for (QuestionnaireResponseItemComponent i : item)
1612            dst.item.add(i.copy());
1613        };
1614        return dst;
1615      }
1616
1617      protected QuestionnaireResponse typedCopy() {
1618        return copy();
1619      }
1620
1621      @Override
1622      public boolean equalsDeep(Base other) {
1623        if (!super.equalsDeep(other))
1624          return false;
1625        if (!(other instanceof QuestionnaireResponse))
1626          return false;
1627        QuestionnaireResponse o = (QuestionnaireResponse) other;
1628        return compareDeep(identifier, o.identifier, true) && compareDeep(questionnaire, o.questionnaire, true)
1629           && compareDeep(status, o.status, true) && compareDeep(subject, o.subject, true) && compareDeep(author, o.author, true)
1630           && compareDeep(authored, o.authored, true) && compareDeep(source, o.source, true) && compareDeep(encounter, o.encounter, true)
1631           && compareDeep(item, o.item, true);
1632      }
1633
1634      @Override
1635      public boolean equalsShallow(Base other) {
1636        if (!super.equalsShallow(other))
1637          return false;
1638        if (!(other instanceof QuestionnaireResponse))
1639          return false;
1640        QuestionnaireResponse o = (QuestionnaireResponse) other;
1641        return compareValues(status, o.status, true) && compareValues(authored, o.authored, true);
1642      }
1643
1644      public boolean isEmpty() {
1645        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (questionnaire == null || questionnaire.isEmpty())
1646           && (status == null || status.isEmpty()) && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty())
1647           && (authored == null || authored.isEmpty()) && (source == null || source.isEmpty()) && (encounter == null || encounter.isEmpty())
1648           && (item == null || item.isEmpty());
1649      }
1650
1651  @Override
1652  public ResourceType getResourceType() {
1653    return ResourceType.QuestionnaireResponse;
1654   }
1655
1656 /**
1657   * Search parameter: <b>author</b>
1658   * <p>
1659   * Description: <b>The author of the questionnaire</b><br>
1660   * Type: <b>reference</b><br>
1661   * Path: <b>QuestionnaireResponse.author</b><br>
1662   * </p>
1663   */
1664  @SearchParamDefinition(name="author", path="QuestionnaireResponse.author", description="The author of the questionnaire", type="reference" )
1665  public static final String SP_AUTHOR = "author";
1666 /**
1667   * <b>Fluent Client</b> search parameter constant for <b>author</b>
1668   * <p>
1669   * Description: <b>The author of the questionnaire</b><br>
1670   * Type: <b>reference</b><br>
1671   * Path: <b>QuestionnaireResponse.author</b><br>
1672   * </p>
1673   */
1674  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR);
1675
1676/**
1677   * Constant for fluent queries to be used to add include statements. Specifies
1678   * the path value of "<b>QuestionnaireResponse:author</b>".
1679   */
1680  public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:author").toLocked();
1681
1682 /**
1683   * Search parameter: <b>questionnaire</b>
1684   * <p>
1685   * Description: <b>The questionnaire the answers are provided for</b><br>
1686   * Type: <b>reference</b><br>
1687   * Path: <b>QuestionnaireResponse.questionnaire</b><br>
1688   * </p>
1689   */
1690  @SearchParamDefinition(name="questionnaire", path="QuestionnaireResponse.questionnaire", description="The questionnaire the answers are provided for", type="reference" )
1691  public static final String SP_QUESTIONNAIRE = "questionnaire";
1692 /**
1693   * <b>Fluent Client</b> search parameter constant for <b>questionnaire</b>
1694   * <p>
1695   * Description: <b>The questionnaire the answers are provided for</b><br>
1696   * Type: <b>reference</b><br>
1697   * Path: <b>QuestionnaireResponse.questionnaire</b><br>
1698   * </p>
1699   */
1700  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam QUESTIONNAIRE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_QUESTIONNAIRE);
1701
1702/**
1703   * Constant for fluent queries to be used to add include statements. Specifies
1704   * the path value of "<b>QuestionnaireResponse:questionnaire</b>".
1705   */
1706  public static final ca.uhn.fhir.model.api.Include INCLUDE_QUESTIONNAIRE = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:questionnaire").toLocked();
1707
1708 /**
1709   * Search parameter: <b>patient</b>
1710   * <p>
1711   * Description: <b>The patient that is the subject of the questionnaire</b><br>
1712   * Type: <b>reference</b><br>
1713   * Path: <b>QuestionnaireResponse.subject</b><br>
1714   * </p>
1715   */
1716  @SearchParamDefinition(name="patient", path="QuestionnaireResponse.subject", description="The patient that is the subject of the questionnaire", type="reference" )
1717  public static final String SP_PATIENT = "patient";
1718 /**
1719   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1720   * <p>
1721   * Description: <b>The patient that is the subject of the questionnaire</b><br>
1722   * Type: <b>reference</b><br>
1723   * Path: <b>QuestionnaireResponse.subject</b><br>
1724   * </p>
1725   */
1726  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
1727
1728/**
1729   * Constant for fluent queries to be used to add include statements. Specifies
1730   * the path value of "<b>QuestionnaireResponse:patient</b>".
1731   */
1732  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:patient").toLocked();
1733
1734 /**
1735   * Search parameter: <b>authored</b>
1736   * <p>
1737   * Description: <b>When the questionnaire was authored</b><br>
1738   * Type: <b>date</b><br>
1739   * Path: <b>QuestionnaireResponse.authored</b><br>
1740   * </p>
1741   */
1742  @SearchParamDefinition(name="authored", path="QuestionnaireResponse.authored", description="When the questionnaire was authored", type="date" )
1743  public static final String SP_AUTHORED = "authored";
1744 /**
1745   * <b>Fluent Client</b> search parameter constant for <b>authored</b>
1746   * <p>
1747   * Description: <b>When the questionnaire was authored</b><br>
1748   * Type: <b>date</b><br>
1749   * Path: <b>QuestionnaireResponse.authored</b><br>
1750   * </p>
1751   */
1752  public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORED);
1753
1754 /**
1755   * Search parameter: <b>source</b>
1756   * <p>
1757   * Description: <b>The person who answered the questions</b><br>
1758   * Type: <b>reference</b><br>
1759   * Path: <b>QuestionnaireResponse.source</b><br>
1760   * </p>
1761   */
1762  @SearchParamDefinition(name="source", path="QuestionnaireResponse.source", description="The person who answered the questions", type="reference" )
1763  public static final String SP_SOURCE = "source";
1764 /**
1765   * <b>Fluent Client</b> search parameter constant for <b>source</b>
1766   * <p>
1767   * Description: <b>The person who answered the questions</b><br>
1768   * Type: <b>reference</b><br>
1769   * Path: <b>QuestionnaireResponse.source</b><br>
1770   * </p>
1771   */
1772  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE);
1773
1774/**
1775   * Constant for fluent queries to be used to add include statements. Specifies
1776   * the path value of "<b>QuestionnaireResponse:source</b>".
1777   */
1778  public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:source").toLocked();
1779
1780 /**
1781   * Search parameter: <b>status</b>
1782   * <p>
1783   * Description: <b>The status of the questionnaire response</b><br>
1784   * Type: <b>token</b><br>
1785   * Path: <b>QuestionnaireResponse.status</b><br>
1786   * </p>
1787   */
1788  @SearchParamDefinition(name="status", path="QuestionnaireResponse.status", description="The status of the questionnaire response", type="token" )
1789  public static final String SP_STATUS = "status";
1790 /**
1791   * <b>Fluent Client</b> search parameter constant for <b>status</b>
1792   * <p>
1793   * Description: <b>The status of the questionnaire response</b><br>
1794   * Type: <b>token</b><br>
1795   * Path: <b>QuestionnaireResponse.status</b><br>
1796   * </p>
1797   */
1798  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
1799
1800 /**
1801   * Search parameter: <b>subject</b>
1802   * <p>
1803   * Description: <b>The subject of the questionnaire</b><br>
1804   * Type: <b>reference</b><br>
1805   * Path: <b>QuestionnaireResponse.subject</b><br>
1806   * </p>
1807   */
1808  @SearchParamDefinition(name="subject", path="QuestionnaireResponse.subject", description="The subject of the questionnaire", type="reference" )
1809  public static final String SP_SUBJECT = "subject";
1810 /**
1811   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
1812   * <p>
1813   * Description: <b>The subject of the questionnaire</b><br>
1814   * Type: <b>reference</b><br>
1815   * Path: <b>QuestionnaireResponse.subject</b><br>
1816   * </p>
1817   */
1818  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
1819
1820/**
1821   * Constant for fluent queries to be used to add include statements. Specifies
1822   * the path value of "<b>QuestionnaireResponse:subject</b>".
1823   */
1824  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:subject").toLocked();
1825
1826 /**
1827   * Search parameter: <b>encounter</b>
1828   * <p>
1829   * Description: <b>Encounter during which questionnaire was authored</b><br>
1830   * Type: <b>reference</b><br>
1831   * Path: <b>QuestionnaireResponse.encounter</b><br>
1832   * </p>
1833   */
1834  @SearchParamDefinition(name="encounter", path="QuestionnaireResponse.encounter", description="Encounter during which questionnaire was authored", type="reference" )
1835  public static final String SP_ENCOUNTER = "encounter";
1836 /**
1837   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
1838   * <p>
1839   * Description: <b>Encounter during which questionnaire was authored</b><br>
1840   * Type: <b>reference</b><br>
1841   * Path: <b>QuestionnaireResponse.encounter</b><br>
1842   * </p>
1843   */
1844  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
1845
1846/**
1847   * Constant for fluent queries to be used to add include statements. Specifies
1848   * the path value of "<b>QuestionnaireResponse:encounter</b>".
1849   */
1850  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:encounter").toLocked();
1851
1852
1853}
1854