001package org.hl7.fhir.r5.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.r5
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023/*
024  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Thu, Dec 13, 2018 14:07+1100 for FHIR v4.0.0
053import java.util.ArrayList;
054import java.util.Date;
055import java.util.List;
056import org.hl7.fhir.exceptions.FHIRException;
057import org.hl7.fhir.instance.model.api.ICompositeType;
058
059import org.hl7.fhir.instance.model.api.IBaseDatatypeElement;
060import org.hl7.fhir.utilities.Utilities;
061import ca.uhn.fhir.model.api.annotation.ResourceDef;
062import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
063import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
064import ca.uhn.fhir.model.api.annotation.Child;
065import ca.uhn.fhir.model.api.annotation.ChildOrder;
066import ca.uhn.fhir.model.api.annotation.Description;
067import ca.uhn.fhir.model.api.annotation.Block;
068/**
069 * 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 questionnaire being responded to.
070 */
071@ResourceDef(name="QuestionnaireResponse", profile="http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse")
072public class QuestionnaireResponse extends DomainResource {
073
074    public enum QuestionnaireResponseStatus {
075        /**
076         * This QuestionnaireResponse has been partially filled out with answers but changes or additions are still expected to be made to it.
077         */
078        INPROGRESS, 
079        /**
080         * This QuestionnaireResponse has been filled out with answers and the current content is regarded as definitive.
081         */
082        COMPLETED, 
083        /**
084         * This QuestionnaireResponse has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards.
085         */
086        AMENDED, 
087        /**
088         * This QuestionnaireResponse was entered in error and voided.
089         */
090        ENTEREDINERROR, 
091        /**
092         * This QuestionnaireResponse has been partially filled out with answers but has been abandoned. It is unknown whether changes or additions are expected to be made to it.
093         */
094        STOPPED, 
095        /**
096         * added to help the parsers with the generic types
097         */
098        NULL;
099        public static QuestionnaireResponseStatus fromCode(String codeString) throws FHIRException {
100            if (codeString == null || "".equals(codeString))
101                return null;
102        if ("in-progress".equals(codeString))
103          return INPROGRESS;
104        if ("completed".equals(codeString))
105          return COMPLETED;
106        if ("amended".equals(codeString))
107          return AMENDED;
108        if ("entered-in-error".equals(codeString))
109          return ENTEREDINERROR;
110        if ("stopped".equals(codeString))
111          return STOPPED;
112        if (Configuration.isAcceptInvalidEnums())
113          return null;
114        else
115          throw new FHIRException("Unknown QuestionnaireResponseStatus code '"+codeString+"'");
116        }
117        public String toCode() {
118          switch (this) {
119            case INPROGRESS: return "in-progress";
120            case COMPLETED: return "completed";
121            case AMENDED: return "amended";
122            case ENTEREDINERROR: return "entered-in-error";
123            case STOPPED: return "stopped";
124            default: return "?";
125          }
126        }
127        public String getSystem() {
128          switch (this) {
129            case INPROGRESS: return "http://hl7.org/fhir/questionnaire-answers-status";
130            case COMPLETED: return "http://hl7.org/fhir/questionnaire-answers-status";
131            case AMENDED: return "http://hl7.org/fhir/questionnaire-answers-status";
132            case ENTEREDINERROR: return "http://hl7.org/fhir/questionnaire-answers-status";
133            case STOPPED: return "http://hl7.org/fhir/questionnaire-answers-status";
134            default: return "?";
135          }
136        }
137        public String getDefinition() {
138          switch (this) {
139            case INPROGRESS: return "This QuestionnaireResponse has been partially filled out with answers but changes or additions are still expected to be made to it.";
140            case COMPLETED: return "This QuestionnaireResponse has been filled out with answers and the current content is regarded as definitive.";
141            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.";
142            case ENTEREDINERROR: return "This QuestionnaireResponse was entered in error and voided.";
143            case STOPPED: return "This QuestionnaireResponse has been partially filled out with answers but has been abandoned. It is unknown whether changes or additions are expected to be made to it.";
144            default: return "?";
145          }
146        }
147        public String getDisplay() {
148          switch (this) {
149            case INPROGRESS: return "In Progress";
150            case COMPLETED: return "Completed";
151            case AMENDED: return "Amended";
152            case ENTEREDINERROR: return "Entered in Error";
153            case STOPPED: return "Stopped";
154            default: return "?";
155          }
156        }
157    }
158
159  public static class QuestionnaireResponseStatusEnumFactory implements EnumFactory<QuestionnaireResponseStatus> {
160    public QuestionnaireResponseStatus fromCode(String codeString) throws IllegalArgumentException {
161      if (codeString == null || "".equals(codeString))
162            if (codeString == null || "".equals(codeString))
163                return null;
164        if ("in-progress".equals(codeString))
165          return QuestionnaireResponseStatus.INPROGRESS;
166        if ("completed".equals(codeString))
167          return QuestionnaireResponseStatus.COMPLETED;
168        if ("amended".equals(codeString))
169          return QuestionnaireResponseStatus.AMENDED;
170        if ("entered-in-error".equals(codeString))
171          return QuestionnaireResponseStatus.ENTEREDINERROR;
172        if ("stopped".equals(codeString))
173          return QuestionnaireResponseStatus.STOPPED;
174        throw new IllegalArgumentException("Unknown QuestionnaireResponseStatus code '"+codeString+"'");
175        }
176        public Enumeration<QuestionnaireResponseStatus> fromType(Base code) throws FHIRException {
177          if (code == null)
178            return null;
179          if (code.isEmpty())
180            return new Enumeration<QuestionnaireResponseStatus>(this);
181          String codeString = ((PrimitiveType) code).asStringValue();
182          if (codeString == null || "".equals(codeString))
183            return null;
184        if ("in-progress".equals(codeString))
185          return new Enumeration<QuestionnaireResponseStatus>(this, QuestionnaireResponseStatus.INPROGRESS);
186        if ("completed".equals(codeString))
187          return new Enumeration<QuestionnaireResponseStatus>(this, QuestionnaireResponseStatus.COMPLETED);
188        if ("amended".equals(codeString))
189          return new Enumeration<QuestionnaireResponseStatus>(this, QuestionnaireResponseStatus.AMENDED);
190        if ("entered-in-error".equals(codeString))
191          return new Enumeration<QuestionnaireResponseStatus>(this, QuestionnaireResponseStatus.ENTEREDINERROR);
192        if ("stopped".equals(codeString))
193          return new Enumeration<QuestionnaireResponseStatus>(this, QuestionnaireResponseStatus.STOPPED);
194        throw new FHIRException("Unknown QuestionnaireResponseStatus code '"+codeString+"'");
195        }
196    public String toCode(QuestionnaireResponseStatus code) {
197      if (code == QuestionnaireResponseStatus.INPROGRESS)
198        return "in-progress";
199      if (code == QuestionnaireResponseStatus.COMPLETED)
200        return "completed";
201      if (code == QuestionnaireResponseStatus.AMENDED)
202        return "amended";
203      if (code == QuestionnaireResponseStatus.ENTEREDINERROR)
204        return "entered-in-error";
205      if (code == QuestionnaireResponseStatus.STOPPED)
206        return "stopped";
207      return "?";
208      }
209    public String toSystem(QuestionnaireResponseStatus code) {
210      return code.getSystem();
211      }
212    }
213
214    @Block()
215    public static class QuestionnaireResponseItemComponent extends BackboneElement implements IBaseBackboneElement {
216        /**
217         * The item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.
218         */
219        @Child(name = "linkId", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
220        @Description(shortDefinition="Pointer to specific item from Questionnaire", formalDefinition="The item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource." )
221        protected StringType linkId;
222
223        /**
224         * A reference to an [[[ElementDefinition]]] that provides the details for the item.
225         */
226        @Child(name = "definition", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false)
227        @Description(shortDefinition="ElementDefinition - details for the item", formalDefinition="A reference to an [[[ElementDefinition]]] that provides the details for the item." )
228        protected UriType definition;
229
230        /**
231         * Text that is displayed above the contents of the group or as the text of the question being answered.
232         */
233        @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
234        @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." )
235        protected StringType text;
236
237        /**
238         * The respondent's answer(s) to the question.
239         */
240        @Child(name = "answer", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
241        @Description(shortDefinition="The response(s) to the question", formalDefinition="The respondent's answer(s) to the question." )
242        protected List<QuestionnaireResponseItemAnswerComponent> answer;
243
244        /**
245         * Questions or sub-groups nested beneath a question or group.
246         */
247        @Child(name = "item", type = {QuestionnaireResponseItemComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
248        @Description(shortDefinition="Nested questionnaire response items", formalDefinition="Questions or sub-groups nested beneath a question or group." )
249        protected List<QuestionnaireResponseItemComponent> item;
250
251        private static final long serialVersionUID = -1395483402L;
252
253    /**
254     * Constructor
255     */
256      public QuestionnaireResponseItemComponent() {
257        super();
258      }
259
260    /**
261     * Constructor
262     */
263      public QuestionnaireResponseItemComponent(StringType linkId) {
264        super();
265        this.linkId = linkId;
266      }
267
268        /**
269         * @return {@link #linkId} (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
270         */
271        public StringType getLinkIdElement() { 
272          if (this.linkId == null)
273            if (Configuration.errorOnAutoCreate())
274              throw new Error("Attempt to auto-create QuestionnaireResponseItemComponent.linkId");
275            else if (Configuration.doAutoCreate())
276              this.linkId = new StringType(); // bb
277          return this.linkId;
278        }
279
280        public boolean hasLinkIdElement() { 
281          return this.linkId != null && !this.linkId.isEmpty();
282        }
283
284        public boolean hasLinkId() { 
285          return this.linkId != null && !this.linkId.isEmpty();
286        }
287
288        /**
289         * @param value {@link #linkId} (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
290         */
291        public QuestionnaireResponseItemComponent setLinkIdElement(StringType value) { 
292          this.linkId = value;
293          return this;
294        }
295
296        /**
297         * @return The item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.
298         */
299        public String getLinkId() { 
300          return this.linkId == null ? null : this.linkId.getValue();
301        }
302
303        /**
304         * @param value The item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.
305         */
306        public QuestionnaireResponseItemComponent setLinkId(String value) { 
307            if (this.linkId == null)
308              this.linkId = new StringType();
309            this.linkId.setValue(value);
310          return this;
311        }
312
313        /**
314         * @return {@link #definition} (A reference to an [[[ElementDefinition]]] that provides the details for the item.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
315         */
316        public UriType getDefinitionElement() { 
317          if (this.definition == null)
318            if (Configuration.errorOnAutoCreate())
319              throw new Error("Attempt to auto-create QuestionnaireResponseItemComponent.definition");
320            else if (Configuration.doAutoCreate())
321              this.definition = new UriType(); // bb
322          return this.definition;
323        }
324
325        public boolean hasDefinitionElement() { 
326          return this.definition != null && !this.definition.isEmpty();
327        }
328
329        public boolean hasDefinition() { 
330          return this.definition != null && !this.definition.isEmpty();
331        }
332
333        /**
334         * @param value {@link #definition} (A reference to an [[[ElementDefinition]]] that provides the details for the item.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
335         */
336        public QuestionnaireResponseItemComponent setDefinitionElement(UriType value) { 
337          this.definition = value;
338          return this;
339        }
340
341        /**
342         * @return A reference to an [[[ElementDefinition]]] that provides the details for the item.
343         */
344        public String getDefinition() { 
345          return this.definition == null ? null : this.definition.getValue();
346        }
347
348        /**
349         * @param value A reference to an [[[ElementDefinition]]] that provides the details for the item.
350         */
351        public QuestionnaireResponseItemComponent setDefinition(String value) { 
352          if (Utilities.noString(value))
353            this.definition = null;
354          else {
355            if (this.definition == null)
356              this.definition = new UriType();
357            this.definition.setValue(value);
358          }
359          return this;
360        }
361
362        /**
363         * @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
364         */
365        public StringType getTextElement() { 
366          if (this.text == null)
367            if (Configuration.errorOnAutoCreate())
368              throw new Error("Attempt to auto-create QuestionnaireResponseItemComponent.text");
369            else if (Configuration.doAutoCreate())
370              this.text = new StringType(); // bb
371          return this.text;
372        }
373
374        public boolean hasTextElement() { 
375          return this.text != null && !this.text.isEmpty();
376        }
377
378        public boolean hasText() { 
379          return this.text != null && !this.text.isEmpty();
380        }
381
382        /**
383         * @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
384         */
385        public QuestionnaireResponseItemComponent setTextElement(StringType value) { 
386          this.text = value;
387          return this;
388        }
389
390        /**
391         * @return Text that is displayed above the contents of the group or as the text of the question being answered.
392         */
393        public String getText() { 
394          return this.text == null ? null : this.text.getValue();
395        }
396
397        /**
398         * @param value Text that is displayed above the contents of the group or as the text of the question being answered.
399         */
400        public QuestionnaireResponseItemComponent setText(String value) { 
401          if (Utilities.noString(value))
402            this.text = null;
403          else {
404            if (this.text == null)
405              this.text = new StringType();
406            this.text.setValue(value);
407          }
408          return this;
409        }
410
411        /**
412         * @return {@link #answer} (The respondent's answer(s) to the question.)
413         */
414        public List<QuestionnaireResponseItemAnswerComponent> getAnswer() { 
415          if (this.answer == null)
416            this.answer = new ArrayList<QuestionnaireResponseItemAnswerComponent>();
417          return this.answer;
418        }
419
420        /**
421         * @return Returns a reference to <code>this</code> for easy method chaining
422         */
423        public QuestionnaireResponseItemComponent setAnswer(List<QuestionnaireResponseItemAnswerComponent> theAnswer) { 
424          this.answer = theAnswer;
425          return this;
426        }
427
428        public boolean hasAnswer() { 
429          if (this.answer == null)
430            return false;
431          for (QuestionnaireResponseItemAnswerComponent item : this.answer)
432            if (!item.isEmpty())
433              return true;
434          return false;
435        }
436
437        public QuestionnaireResponseItemAnswerComponent addAnswer() { //3
438          QuestionnaireResponseItemAnswerComponent t = new QuestionnaireResponseItemAnswerComponent();
439          if (this.answer == null)
440            this.answer = new ArrayList<QuestionnaireResponseItemAnswerComponent>();
441          this.answer.add(t);
442          return t;
443        }
444
445        public QuestionnaireResponseItemComponent addAnswer(QuestionnaireResponseItemAnswerComponent t) { //3
446          if (t == null)
447            return this;
448          if (this.answer == null)
449            this.answer = new ArrayList<QuestionnaireResponseItemAnswerComponent>();
450          this.answer.add(t);
451          return this;
452        }
453
454        /**
455         * @return The first repetition of repeating field {@link #answer}, creating it if it does not already exist
456         */
457        public QuestionnaireResponseItemAnswerComponent getAnswerFirstRep() { 
458          if (getAnswer().isEmpty()) {
459            addAnswer();
460          }
461          return getAnswer().get(0);
462        }
463
464        /**
465         * @return {@link #item} (Questions or sub-groups nested beneath a question or group.)
466         */
467        public List<QuestionnaireResponseItemComponent> getItem() { 
468          if (this.item == null)
469            this.item = new ArrayList<QuestionnaireResponseItemComponent>();
470          return this.item;
471        }
472
473        /**
474         * @return Returns a reference to <code>this</code> for easy method chaining
475         */
476        public QuestionnaireResponseItemComponent setItem(List<QuestionnaireResponseItemComponent> theItem) { 
477          this.item = theItem;
478          return this;
479        }
480
481        public boolean hasItem() { 
482          if (this.item == null)
483            return false;
484          for (QuestionnaireResponseItemComponent item : this.item)
485            if (!item.isEmpty())
486              return true;
487          return false;
488        }
489
490        public QuestionnaireResponseItemComponent addItem() { //3
491          QuestionnaireResponseItemComponent t = new QuestionnaireResponseItemComponent();
492          if (this.item == null)
493            this.item = new ArrayList<QuestionnaireResponseItemComponent>();
494          this.item.add(t);
495          return t;
496        }
497
498        public QuestionnaireResponseItemComponent addItem(QuestionnaireResponseItemComponent t) { //3
499          if (t == null)
500            return this;
501          if (this.item == null)
502            this.item = new ArrayList<QuestionnaireResponseItemComponent>();
503          this.item.add(t);
504          return this;
505        }
506
507        /**
508         * @return The first repetition of repeating field {@link #item}, creating it if it does not already exist
509         */
510        public QuestionnaireResponseItemComponent getItemFirstRep() { 
511          if (getItem().isEmpty()) {
512            addItem();
513          }
514          return getItem().get(0);
515        }
516
517        protected void listChildren(List<Property> children) {
518          super.listChildren(children);
519          children.add(new Property("linkId", "string", "The item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.", 0, 1, linkId));
520          children.add(new Property("definition", "uri", "A reference to an [[[ElementDefinition]]] that provides the details for the item.", 0, 1, definition));
521          children.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, 1, text));
522          children.add(new Property("answer", "", "The respondent's answer(s) to the question.", 0, java.lang.Integer.MAX_VALUE, answer));
523          children.add(new Property("item", "@QuestionnaireResponse.item", "Questions or sub-groups nested beneath a question or group.", 0, java.lang.Integer.MAX_VALUE, item));
524        }
525
526        @Override
527        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
528          switch (_hash) {
529          case -1102667083: /*linkId*/  return new Property("linkId", "string", "The item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.", 0, 1, linkId);
530          case -1014418093: /*definition*/  return new Property("definition", "uri", "A reference to an [[[ElementDefinition]]] that provides the details for the item.", 0, 1, definition);
531          case 3556653: /*text*/  return new Property("text", "string", "Text that is displayed above the contents of the group or as the text of the question being answered.", 0, 1, text);
532          case -1412808770: /*answer*/  return new Property("answer", "", "The respondent's answer(s) to the question.", 0, java.lang.Integer.MAX_VALUE, answer);
533          case 3242771: /*item*/  return new Property("item", "@QuestionnaireResponse.item", "Questions or sub-groups nested beneath a question or group.", 0, java.lang.Integer.MAX_VALUE, item);
534          default: return super.getNamedProperty(_hash, _name, _checkValid);
535          }
536
537        }
538
539      @Override
540      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
541        switch (hash) {
542        case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : new Base[] {this.linkId}; // StringType
543        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // UriType
544        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
545        case -1412808770: /*answer*/ return this.answer == null ? new Base[0] : this.answer.toArray(new Base[this.answer.size()]); // QuestionnaireResponseItemAnswerComponent
546        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireResponseItemComponent
547        default: return super.getProperty(hash, name, checkValid);
548        }
549
550      }
551
552      @Override
553      public Base setProperty(int hash, String name, Base value) throws FHIRException {
554        switch (hash) {
555        case -1102667083: // linkId
556          this.linkId = castToString(value); // StringType
557          return value;
558        case -1014418093: // definition
559          this.definition = castToUri(value); // UriType
560          return value;
561        case 3556653: // text
562          this.text = castToString(value); // StringType
563          return value;
564        case -1412808770: // answer
565          this.getAnswer().add((QuestionnaireResponseItemAnswerComponent) value); // QuestionnaireResponseItemAnswerComponent
566          return value;
567        case 3242771: // item
568          this.getItem().add((QuestionnaireResponseItemComponent) value); // QuestionnaireResponseItemComponent
569          return value;
570        default: return super.setProperty(hash, name, value);
571        }
572
573      }
574
575      @Override
576      public Base setProperty(String name, Base value) throws FHIRException {
577        if (name.equals("linkId")) {
578          this.linkId = castToString(value); // StringType
579        } else if (name.equals("definition")) {
580          this.definition = castToUri(value); // UriType
581        } else if (name.equals("text")) {
582          this.text = castToString(value); // StringType
583        } else if (name.equals("answer")) {
584          this.getAnswer().add((QuestionnaireResponseItemAnswerComponent) value);
585        } else if (name.equals("item")) {
586          this.getItem().add((QuestionnaireResponseItemComponent) value);
587        } else
588          return super.setProperty(name, value);
589        return value;
590      }
591
592      @Override
593      public Base makeProperty(int hash, String name) throws FHIRException {
594        switch (hash) {
595        case -1102667083:  return getLinkIdElement();
596        case -1014418093:  return getDefinitionElement();
597        case 3556653:  return getTextElement();
598        case -1412808770:  return addAnswer(); 
599        case 3242771:  return addItem(); 
600        default: return super.makeProperty(hash, name);
601        }
602
603      }
604
605      @Override
606      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
607        switch (hash) {
608        case -1102667083: /*linkId*/ return new String[] {"string"};
609        case -1014418093: /*definition*/ return new String[] {"uri"};
610        case 3556653: /*text*/ return new String[] {"string"};
611        case -1412808770: /*answer*/ return new String[] {};
612        case 3242771: /*item*/ return new String[] {"@QuestionnaireResponse.item"};
613        default: return super.getTypesForProperty(hash, name);
614        }
615
616      }
617
618      @Override
619      public Base addChild(String name) throws FHIRException {
620        if (name.equals("linkId")) {
621          throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.linkId");
622        }
623        else if (name.equals("definition")) {
624          throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.definition");
625        }
626        else if (name.equals("text")) {
627          throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.text");
628        }
629        else if (name.equals("answer")) {
630          return addAnswer();
631        }
632        else if (name.equals("item")) {
633          return addItem();
634        }
635        else
636          return super.addChild(name);
637      }
638
639      public QuestionnaireResponseItemComponent copy() {
640        QuestionnaireResponseItemComponent dst = new QuestionnaireResponseItemComponent();
641        copyValues(dst);
642        return dst;
643      }
644
645      public void copyValues(QuestionnaireResponseItemComponent dst) {
646        super.copyValues(dst);
647        dst.linkId = linkId == null ? null : linkId.copy();
648        dst.definition = definition == null ? null : definition.copy();
649        dst.text = text == null ? null : text.copy();
650        if (answer != null) {
651          dst.answer = new ArrayList<QuestionnaireResponseItemAnswerComponent>();
652          for (QuestionnaireResponseItemAnswerComponent i : answer)
653            dst.answer.add(i.copy());
654        };
655        if (item != null) {
656          dst.item = new ArrayList<QuestionnaireResponseItemComponent>();
657          for (QuestionnaireResponseItemComponent i : item)
658            dst.item.add(i.copy());
659        };
660      }
661
662      @Override
663      public boolean equalsDeep(Base other_) {
664        if (!super.equalsDeep(other_))
665          return false;
666        if (!(other_ instanceof QuestionnaireResponseItemComponent))
667          return false;
668        QuestionnaireResponseItemComponent o = (QuestionnaireResponseItemComponent) other_;
669        return compareDeep(linkId, o.linkId, true) && compareDeep(definition, o.definition, true) && compareDeep(text, o.text, true)
670           && compareDeep(answer, o.answer, true) && compareDeep(item, o.item, true);
671      }
672
673      @Override
674      public boolean equalsShallow(Base other_) {
675        if (!super.equalsShallow(other_))
676          return false;
677        if (!(other_ instanceof QuestionnaireResponseItemComponent))
678          return false;
679        QuestionnaireResponseItemComponent o = (QuestionnaireResponseItemComponent) other_;
680        return compareValues(linkId, o.linkId, true) && compareValues(definition, o.definition, true) && compareValues(text, o.text, true)
681          ;
682      }
683
684      public boolean isEmpty() {
685        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(linkId, definition, text
686          , answer, item);
687      }
688
689  public String fhirType() {
690    return "QuestionnaireResponse.item";
691
692  }
693
694  }
695
696    @Block()
697    public static class QuestionnaireResponseItemAnswerComponent extends BackboneElement implements IBaseBackboneElement {
698        /**
699         * The answer (or one of the answers) provided by the respondent to the question.
700         */
701        @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=0, max=1, modifier=false, summary=false)
702        @Description(shortDefinition="Single-valued answer to the question", formalDefinition="The answer (or one of the answers) provided by the respondent to the question." )
703        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/questionnaire-answers")
704        protected Type value;
705
706        /**
707         * Nested groups and/or questions found within this particular answer.
708         */
709        @Child(name = "item", type = {QuestionnaireResponseItemComponent.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
710        @Description(shortDefinition="Nested groups and questions", formalDefinition="Nested groups and/or questions found within this particular answer." )
711        protected List<QuestionnaireResponseItemComponent> item;
712
713        private static final long serialVersionUID = 2052422636L;
714
715    /**
716     * Constructor
717     */
718      public QuestionnaireResponseItemAnswerComponent() {
719        super();
720      }
721
722        /**
723         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
724         */
725        public Type getValue() { 
726          return this.value;
727        }
728
729        /**
730         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
731         */
732        public BooleanType getValueBooleanType() throws FHIRException { 
733          if (this.value == null)
734            this.value = new BooleanType();
735          if (!(this.value instanceof BooleanType))
736            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
737          return (BooleanType) this.value;
738        }
739
740        public boolean hasValueBooleanType() { 
741          return this != null && this.value instanceof BooleanType;
742        }
743
744        /**
745         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
746         */
747        public DecimalType getValueDecimalType() throws FHIRException { 
748          if (this.value == null)
749            this.value = new DecimalType();
750          if (!(this.value instanceof DecimalType))
751            throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered");
752          return (DecimalType) this.value;
753        }
754
755        public boolean hasValueDecimalType() { 
756          return this != null && this.value instanceof DecimalType;
757        }
758
759        /**
760         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
761         */
762        public IntegerType getValueIntegerType() throws FHIRException { 
763          if (this.value == null)
764            this.value = new IntegerType();
765          if (!(this.value instanceof IntegerType))
766            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
767          return (IntegerType) this.value;
768        }
769
770        public boolean hasValueIntegerType() { 
771          return this != null && this.value instanceof IntegerType;
772        }
773
774        /**
775         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
776         */
777        public DateType getValueDateType() throws FHIRException { 
778          if (this.value == null)
779            this.value = new DateType();
780          if (!(this.value instanceof DateType))
781            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered");
782          return (DateType) this.value;
783        }
784
785        public boolean hasValueDateType() { 
786          return this != null && this.value instanceof DateType;
787        }
788
789        /**
790         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
791         */
792        public DateTimeType getValueDateTimeType() throws FHIRException { 
793          if (this.value == null)
794            this.value = new DateTimeType();
795          if (!(this.value instanceof DateTimeType))
796            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered");
797          return (DateTimeType) this.value;
798        }
799
800        public boolean hasValueDateTimeType() { 
801          return this != null && this.value instanceof DateTimeType;
802        }
803
804        /**
805         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
806         */
807        public TimeType getValueTimeType() throws FHIRException { 
808          if (this.value == null)
809            this.value = new TimeType();
810          if (!(this.value instanceof TimeType))
811            throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered");
812          return (TimeType) this.value;
813        }
814
815        public boolean hasValueTimeType() { 
816          return this != null && this.value instanceof TimeType;
817        }
818
819        /**
820         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
821         */
822        public StringType getValueStringType() throws FHIRException { 
823          if (this.value == null)
824            this.value = new StringType();
825          if (!(this.value instanceof StringType))
826            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
827          return (StringType) this.value;
828        }
829
830        public boolean hasValueStringType() { 
831          return this != null && this.value instanceof StringType;
832        }
833
834        /**
835         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
836         */
837        public UriType getValueUriType() throws FHIRException { 
838          if (this.value == null)
839            this.value = new UriType();
840          if (!(this.value instanceof UriType))
841            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered");
842          return (UriType) this.value;
843        }
844
845        public boolean hasValueUriType() { 
846          return this != null && this.value instanceof UriType;
847        }
848
849        /**
850         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
851         */
852        public Attachment getValueAttachment() throws FHIRException { 
853          if (this.value == null)
854            this.value = new Attachment();
855          if (!(this.value instanceof Attachment))
856            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
857          return (Attachment) this.value;
858        }
859
860        public boolean hasValueAttachment() { 
861          return this != null && this.value instanceof Attachment;
862        }
863
864        /**
865         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
866         */
867        public Coding getValueCoding() throws FHIRException { 
868          if (this.value == null)
869            this.value = new Coding();
870          if (!(this.value instanceof Coding))
871            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered");
872          return (Coding) this.value;
873        }
874
875        public boolean hasValueCoding() { 
876          return this != null && this.value instanceof Coding;
877        }
878
879        /**
880         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
881         */
882        public Quantity getValueQuantity() throws FHIRException { 
883          if (this.value == null)
884            this.value = new Quantity();
885          if (!(this.value instanceof Quantity))
886            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
887          return (Quantity) this.value;
888        }
889
890        public boolean hasValueQuantity() { 
891          return this != null && this.value instanceof Quantity;
892        }
893
894        /**
895         * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
896         */
897        public Reference getValueReference() throws FHIRException { 
898          if (this.value == null)
899            this.value = new Reference();
900          if (!(this.value instanceof Reference))
901            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered");
902          return (Reference) this.value;
903        }
904
905        public boolean hasValueReference() { 
906          return this != null && this.value instanceof Reference;
907        }
908
909        public boolean hasValue() { 
910          return this.value != null && !this.value.isEmpty();
911        }
912
913        /**
914         * @param value {@link #value} (The answer (or one of the answers) provided by the respondent to the question.)
915         */
916        public QuestionnaireResponseItemAnswerComponent setValue(Type value) { 
917          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))
918            throw new Error("Not the right type for QuestionnaireResponse.item.answer.value[x]: "+value.fhirType());
919          this.value = value;
920          return this;
921        }
922
923        /**
924         * @return {@link #item} (Nested groups and/or questions found within this particular answer.)
925         */
926        public List<QuestionnaireResponseItemComponent> getItem() { 
927          if (this.item == null)
928            this.item = new ArrayList<QuestionnaireResponseItemComponent>();
929          return this.item;
930        }
931
932        /**
933         * @return Returns a reference to <code>this</code> for easy method chaining
934         */
935        public QuestionnaireResponseItemAnswerComponent setItem(List<QuestionnaireResponseItemComponent> theItem) { 
936          this.item = theItem;
937          return this;
938        }
939
940        public boolean hasItem() { 
941          if (this.item == null)
942            return false;
943          for (QuestionnaireResponseItemComponent item : this.item)
944            if (!item.isEmpty())
945              return true;
946          return false;
947        }
948
949        public QuestionnaireResponseItemComponent addItem() { //3
950          QuestionnaireResponseItemComponent t = new QuestionnaireResponseItemComponent();
951          if (this.item == null)
952            this.item = new ArrayList<QuestionnaireResponseItemComponent>();
953          this.item.add(t);
954          return t;
955        }
956
957        public QuestionnaireResponseItemAnswerComponent addItem(QuestionnaireResponseItemComponent t) { //3
958          if (t == null)
959            return this;
960          if (this.item == null)
961            this.item = new ArrayList<QuestionnaireResponseItemComponent>();
962          this.item.add(t);
963          return this;
964        }
965
966        /**
967         * @return The first repetition of repeating field {@link #item}, creating it if it does not already exist
968         */
969        public QuestionnaireResponseItemComponent getItemFirstRep() { 
970          if (getItem().isEmpty()) {
971            addItem();
972          }
973          return getItem().get(0);
974        }
975
976        protected void listChildren(List<Property> children) {
977          super.listChildren(children);
978          children.add(new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value));
979          children.add(new Property("item", "@QuestionnaireResponse.item", "Nested groups and/or questions found within this particular answer.", 0, java.lang.Integer.MAX_VALUE, item));
980        }
981
982        @Override
983        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
984          switch (_hash) {
985          case -1410166417: /*value[x]*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
986          case 111972721: /*value*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
987          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
988          case -2083993440: /*valueDecimal*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
989          case -1668204915: /*valueInteger*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
990          case -766192449: /*valueDate*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
991          case 1047929900: /*valueDateTime*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
992          case -765708322: /*valueTime*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
993          case -1424603934: /*valueString*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
994          case -1410172357: /*valueUri*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
995          case -475566732: /*valueAttachment*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
996          case -1887705029: /*valueCoding*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
997          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
998          case 1755241690: /*valueReference*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, 1, value);
999          case 3242771: /*item*/  return new Property("item", "@QuestionnaireResponse.item", "Nested groups and/or questions found within this particular answer.", 0, java.lang.Integer.MAX_VALUE, item);
1000          default: return super.getNamedProperty(_hash, _name, _checkValid);
1001          }
1002
1003        }
1004
1005      @Override
1006      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1007        switch (hash) {
1008        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type
1009        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireResponseItemComponent
1010        default: return super.getProperty(hash, name, checkValid);
1011        }
1012
1013      }
1014
1015      @Override
1016      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1017        switch (hash) {
1018        case 111972721: // value
1019          this.value = castToType(value); // Type
1020          return value;
1021        case 3242771: // item
1022          this.getItem().add((QuestionnaireResponseItemComponent) value); // QuestionnaireResponseItemComponent
1023          return value;
1024        default: return super.setProperty(hash, name, value);
1025        }
1026
1027      }
1028
1029      @Override
1030      public Base setProperty(String name, Base value) throws FHIRException {
1031        if (name.equals("value[x]")) {
1032          this.value = castToType(value); // Type
1033        } else if (name.equals("item")) {
1034          this.getItem().add((QuestionnaireResponseItemComponent) value);
1035        } else
1036          return super.setProperty(name, value);
1037        return value;
1038      }
1039
1040      @Override
1041      public Base makeProperty(int hash, String name) throws FHIRException {
1042        switch (hash) {
1043        case -1410166417:  return getValue();
1044        case 111972721:  return getValue();
1045        case 3242771:  return addItem(); 
1046        default: return super.makeProperty(hash, name);
1047        }
1048
1049      }
1050
1051      @Override
1052      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1053        switch (hash) {
1054        case 111972721: /*value*/ return new String[] {"boolean", "decimal", "integer", "date", "dateTime", "time", "string", "uri", "Attachment", "Coding", "Quantity", "Reference"};
1055        case 3242771: /*item*/ return new String[] {"@QuestionnaireResponse.item"};
1056        default: return super.getTypesForProperty(hash, name);
1057        }
1058
1059      }
1060
1061      @Override
1062      public Base addChild(String name) throws FHIRException {
1063        if (name.equals("valueBoolean")) {
1064          this.value = new BooleanType();
1065          return this.value;
1066        }
1067        else if (name.equals("valueDecimal")) {
1068          this.value = new DecimalType();
1069          return this.value;
1070        }
1071        else if (name.equals("valueInteger")) {
1072          this.value = new IntegerType();
1073          return this.value;
1074        }
1075        else if (name.equals("valueDate")) {
1076          this.value = new DateType();
1077          return this.value;
1078        }
1079        else if (name.equals("valueDateTime")) {
1080          this.value = new DateTimeType();
1081          return this.value;
1082        }
1083        else if (name.equals("valueTime")) {
1084          this.value = new TimeType();
1085          return this.value;
1086        }
1087        else if (name.equals("valueString")) {
1088          this.value = new StringType();
1089          return this.value;
1090        }
1091        else if (name.equals("valueUri")) {
1092          this.value = new UriType();
1093          return this.value;
1094        }
1095        else if (name.equals("valueAttachment")) {
1096          this.value = new Attachment();
1097          return this.value;
1098        }
1099        else if (name.equals("valueCoding")) {
1100          this.value = new Coding();
1101          return this.value;
1102        }
1103        else if (name.equals("valueQuantity")) {
1104          this.value = new Quantity();
1105          return this.value;
1106        }
1107        else if (name.equals("valueReference")) {
1108          this.value = new Reference();
1109          return this.value;
1110        }
1111        else if (name.equals("item")) {
1112          return addItem();
1113        }
1114        else
1115          return super.addChild(name);
1116      }
1117
1118      public QuestionnaireResponseItemAnswerComponent copy() {
1119        QuestionnaireResponseItemAnswerComponent dst = new QuestionnaireResponseItemAnswerComponent();
1120        copyValues(dst);
1121        return dst;
1122      }
1123
1124      public void copyValues(QuestionnaireResponseItemAnswerComponent dst) {
1125        super.copyValues(dst);
1126        dst.value = value == null ? null : value.copy();
1127        if (item != null) {
1128          dst.item = new ArrayList<QuestionnaireResponseItemComponent>();
1129          for (QuestionnaireResponseItemComponent i : item)
1130            dst.item.add(i.copy());
1131        };
1132      }
1133
1134      @Override
1135      public boolean equalsDeep(Base other_) {
1136        if (!super.equalsDeep(other_))
1137          return false;
1138        if (!(other_ instanceof QuestionnaireResponseItemAnswerComponent))
1139          return false;
1140        QuestionnaireResponseItemAnswerComponent o = (QuestionnaireResponseItemAnswerComponent) other_;
1141        return compareDeep(value, o.value, true) && compareDeep(item, o.item, true);
1142      }
1143
1144      @Override
1145      public boolean equalsShallow(Base other_) {
1146        if (!super.equalsShallow(other_))
1147          return false;
1148        if (!(other_ instanceof QuestionnaireResponseItemAnswerComponent))
1149          return false;
1150        QuestionnaireResponseItemAnswerComponent o = (QuestionnaireResponseItemAnswerComponent) other_;
1151        return true;
1152      }
1153
1154      public boolean isEmpty() {
1155        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value, item);
1156      }
1157
1158  public String fhirType() {
1159    return "QuestionnaireResponse.item.answer";
1160
1161  }
1162
1163  }
1164
1165    /**
1166     * A business identifier assigned to a particular completed (or partially completed) questionnaire.
1167     */
1168    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true)
1169    @Description(shortDefinition="Unique id for this set of answers", formalDefinition="A business identifier assigned to a particular completed (or partially completed) questionnaire." )
1170    protected Identifier identifier;
1171
1172    /**
1173     * The order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse.  For example, a ServiceRequest seeking an intake assessment or a decision support recommendation to assess for post-partum depression.
1174     */
1175    @Child(name = "basedOn", type = {CarePlan.class, ServiceRequest.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1176    @Description(shortDefinition="Request fulfilled by this QuestionnaireResponse", formalDefinition="The order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse.  For example, a ServiceRequest seeking an intake assessment or a decision support recommendation to assess for post-partum depression." )
1177    protected List<Reference> basedOn;
1178
1179    /**
1180     * A procedure or observation that this questionnaire was performed as part of the execution of.  For example, the surgery a checklist was executed as part of.
1181     */
1182    @Child(name = "partOf", type = {Observation.class, Procedure.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1183    @Description(shortDefinition="Part of this action", formalDefinition="A procedure or observation that this questionnaire was performed as part of the execution of.  For example, the surgery a checklist was executed as part of." )
1184    protected List<Reference> partOf;
1185
1186    /**
1187     * The Questionnaire that defines and organizes the questions for which answers are being provided.
1188     */
1189    @Child(name = "questionnaire", type = {CanonicalType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1190    @Description(shortDefinition="Form being answered", formalDefinition="The Questionnaire that defines and organizes the questions for which answers are being provided." )
1191    protected CanonicalType questionnaire;
1192
1193    /**
1194     * The position of the questionnaire response within its overall lifecycle.
1195     */
1196    @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true)
1197    @Description(shortDefinition="in-progress | completed | amended | entered-in-error | stopped", formalDefinition="The position of the questionnaire response within its overall lifecycle." )
1198    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/questionnaire-answers-status")
1199    protected Enumeration<QuestionnaireResponseStatus> status;
1200
1201    /**
1202     * 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.
1203     */
1204    @Child(name = "subject", type = {Reference.class}, order=5, min=0, max=1, modifier=false, summary=true)
1205    @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." )
1206    protected Reference subject;
1207
1208    /**
1209     * The Encounter during which this questionnaire response was created or to which the creation of this record is tightly associated.
1210     */
1211    @Child(name = "encounter", type = {Encounter.class}, order=6, min=0, max=1, modifier=false, summary=true)
1212    @Description(shortDefinition="Encounter created as part of", formalDefinition="The Encounter during which this questionnaire response was created or to which the creation of this record is tightly associated." )
1213    protected Reference encounter;
1214
1215    /**
1216     * The date and/or time that this set of answers were last changed.
1217     */
1218    @Child(name = "authored", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
1219    @Description(shortDefinition="Date the answers were gathered", formalDefinition="The date and/or time that this set of answers were last changed." )
1220    protected DateTimeType authored;
1221
1222    /**
1223     * Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.
1224     */
1225    @Child(name = "author", type = {Device.class, Practitioner.class, PractitionerRole.class, Patient.class, RelatedPerson.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=true)
1226    @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." )
1227    protected Reference author;
1228
1229    /**
1230     * The person who answered the questions about the subject.
1231     */
1232    @Child(name = "source", type = {Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class}, order=9, min=0, max=1, modifier=false, summary=true)
1233    @Description(shortDefinition="The person who answered the questions", formalDefinition="The person who answered the questions about the subject." )
1234    protected Reference source;
1235
1236    /**
1237     * A group or question item from the original questionnaire for which answers are provided.
1238     */
1239    @Child(name = "item", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1240    @Description(shortDefinition="Groups and questions", formalDefinition="A group or question item from the original questionnaire for which answers are provided." )
1241    protected List<QuestionnaireResponseItemComponent> item;
1242
1243    private static final long serialVersionUID = 764655391L;
1244
1245  /**
1246   * Constructor
1247   */
1248    public QuestionnaireResponse() {
1249      super();
1250    }
1251
1252  /**
1253   * Constructor
1254   */
1255    public QuestionnaireResponse(Enumeration<QuestionnaireResponseStatus> status) {
1256      super();
1257      this.status = status;
1258    }
1259
1260    /**
1261     * @return {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.)
1262     */
1263    public Identifier getIdentifier() { 
1264      if (this.identifier == null)
1265        if (Configuration.errorOnAutoCreate())
1266          throw new Error("Attempt to auto-create QuestionnaireResponse.identifier");
1267        else if (Configuration.doAutoCreate())
1268          this.identifier = new Identifier(); // cc
1269      return this.identifier;
1270    }
1271
1272    public boolean hasIdentifier() { 
1273      return this.identifier != null && !this.identifier.isEmpty();
1274    }
1275
1276    /**
1277     * @param value {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.)
1278     */
1279    public QuestionnaireResponse setIdentifier(Identifier value) { 
1280      this.identifier = value;
1281      return this;
1282    }
1283
1284    /**
1285     * @return {@link #basedOn} (The order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse.  For example, a ServiceRequest seeking an intake assessment or a decision support recommendation to assess for post-partum depression.)
1286     */
1287    public List<Reference> getBasedOn() { 
1288      if (this.basedOn == null)
1289        this.basedOn = new ArrayList<Reference>();
1290      return this.basedOn;
1291    }
1292
1293    /**
1294     * @return Returns a reference to <code>this</code> for easy method chaining
1295     */
1296    public QuestionnaireResponse setBasedOn(List<Reference> theBasedOn) { 
1297      this.basedOn = theBasedOn;
1298      return this;
1299    }
1300
1301    public boolean hasBasedOn() { 
1302      if (this.basedOn == null)
1303        return false;
1304      for (Reference item : this.basedOn)
1305        if (!item.isEmpty())
1306          return true;
1307      return false;
1308    }
1309
1310    public Reference addBasedOn() { //3
1311      Reference t = new Reference();
1312      if (this.basedOn == null)
1313        this.basedOn = new ArrayList<Reference>();
1314      this.basedOn.add(t);
1315      return t;
1316    }
1317
1318    public QuestionnaireResponse addBasedOn(Reference t) { //3
1319      if (t == null)
1320        return this;
1321      if (this.basedOn == null)
1322        this.basedOn = new ArrayList<Reference>();
1323      this.basedOn.add(t);
1324      return this;
1325    }
1326
1327    /**
1328     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist
1329     */
1330    public Reference getBasedOnFirstRep() { 
1331      if (getBasedOn().isEmpty()) {
1332        addBasedOn();
1333      }
1334      return getBasedOn().get(0);
1335    }
1336
1337    /**
1338     * @return {@link #partOf} (A procedure or observation that this questionnaire was performed as part of the execution of.  For example, the surgery a checklist was executed as part of.)
1339     */
1340    public List<Reference> getPartOf() { 
1341      if (this.partOf == null)
1342        this.partOf = new ArrayList<Reference>();
1343      return this.partOf;
1344    }
1345
1346    /**
1347     * @return Returns a reference to <code>this</code> for easy method chaining
1348     */
1349    public QuestionnaireResponse setPartOf(List<Reference> thePartOf) { 
1350      this.partOf = thePartOf;
1351      return this;
1352    }
1353
1354    public boolean hasPartOf() { 
1355      if (this.partOf == null)
1356        return false;
1357      for (Reference item : this.partOf)
1358        if (!item.isEmpty())
1359          return true;
1360      return false;
1361    }
1362
1363    public Reference addPartOf() { //3
1364      Reference t = new Reference();
1365      if (this.partOf == null)
1366        this.partOf = new ArrayList<Reference>();
1367      this.partOf.add(t);
1368      return t;
1369    }
1370
1371    public QuestionnaireResponse addPartOf(Reference t) { //3
1372      if (t == null)
1373        return this;
1374      if (this.partOf == null)
1375        this.partOf = new ArrayList<Reference>();
1376      this.partOf.add(t);
1377      return this;
1378    }
1379
1380    /**
1381     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist
1382     */
1383    public Reference getPartOfFirstRep() { 
1384      if (getPartOf().isEmpty()) {
1385        addPartOf();
1386      }
1387      return getPartOf().get(0);
1388    }
1389
1390    /**
1391     * @return {@link #questionnaire} (The Questionnaire that defines and organizes the questions for which answers are being provided.). This is the underlying object with id, value and extensions. The accessor "getQuestionnaire" gives direct access to the value
1392     */
1393    public CanonicalType getQuestionnaireElement() { 
1394      if (this.questionnaire == null)
1395        if (Configuration.errorOnAutoCreate())
1396          throw new Error("Attempt to auto-create QuestionnaireResponse.questionnaire");
1397        else if (Configuration.doAutoCreate())
1398          this.questionnaire = new CanonicalType(); // bb
1399      return this.questionnaire;
1400    }
1401
1402    public boolean hasQuestionnaireElement() { 
1403      return this.questionnaire != null && !this.questionnaire.isEmpty();
1404    }
1405
1406    public boolean hasQuestionnaire() { 
1407      return this.questionnaire != null && !this.questionnaire.isEmpty();
1408    }
1409
1410    /**
1411     * @param value {@link #questionnaire} (The Questionnaire that defines and organizes the questions for which answers are being provided.). This is the underlying object with id, value and extensions. The accessor "getQuestionnaire" gives direct access to the value
1412     */
1413    public QuestionnaireResponse setQuestionnaireElement(CanonicalType value) { 
1414      this.questionnaire = value;
1415      return this;
1416    }
1417
1418    /**
1419     * @return The Questionnaire that defines and organizes the questions for which answers are being provided.
1420     */
1421    public String getQuestionnaire() { 
1422      return this.questionnaire == null ? null : this.questionnaire.getValue();
1423    }
1424
1425    /**
1426     * @param value The Questionnaire that defines and organizes the questions for which answers are being provided.
1427     */
1428    public QuestionnaireResponse setQuestionnaire(String value) { 
1429      if (Utilities.noString(value))
1430        this.questionnaire = null;
1431      else {
1432        if (this.questionnaire == null)
1433          this.questionnaire = new CanonicalType();
1434        this.questionnaire.setValue(value);
1435      }
1436      return this;
1437    }
1438
1439    /**
1440     * @return {@link #status} (The position of the questionnaire response within its overall lifecycle.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1441     */
1442    public Enumeration<QuestionnaireResponseStatus> getStatusElement() { 
1443      if (this.status == null)
1444        if (Configuration.errorOnAutoCreate())
1445          throw new Error("Attempt to auto-create QuestionnaireResponse.status");
1446        else if (Configuration.doAutoCreate())
1447          this.status = new Enumeration<QuestionnaireResponseStatus>(new QuestionnaireResponseStatusEnumFactory()); // bb
1448      return this.status;
1449    }
1450
1451    public boolean hasStatusElement() { 
1452      return this.status != null && !this.status.isEmpty();
1453    }
1454
1455    public boolean hasStatus() { 
1456      return this.status != null && !this.status.isEmpty();
1457    }
1458
1459    /**
1460     * @param value {@link #status} (The position of the questionnaire response within its overall lifecycle.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1461     */
1462    public QuestionnaireResponse setStatusElement(Enumeration<QuestionnaireResponseStatus> value) { 
1463      this.status = value;
1464      return this;
1465    }
1466
1467    /**
1468     * @return The position of the questionnaire response within its overall lifecycle.
1469     */
1470    public QuestionnaireResponseStatus getStatus() { 
1471      return this.status == null ? null : this.status.getValue();
1472    }
1473
1474    /**
1475     * @param value The position of the questionnaire response within its overall lifecycle.
1476     */
1477    public QuestionnaireResponse setStatus(QuestionnaireResponseStatus value) { 
1478        if (this.status == null)
1479          this.status = new Enumeration<QuestionnaireResponseStatus>(new QuestionnaireResponseStatusEnumFactory());
1480        this.status.setValue(value);
1481      return this;
1482    }
1483
1484    /**
1485     * @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.)
1486     */
1487    public Reference getSubject() { 
1488      if (this.subject == null)
1489        if (Configuration.errorOnAutoCreate())
1490          throw new Error("Attempt to auto-create QuestionnaireResponse.subject");
1491        else if (Configuration.doAutoCreate())
1492          this.subject = new Reference(); // cc
1493      return this.subject;
1494    }
1495
1496    public boolean hasSubject() { 
1497      return this.subject != null && !this.subject.isEmpty();
1498    }
1499
1500    /**
1501     * @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.)
1502     */
1503    public QuestionnaireResponse setSubject(Reference value) { 
1504      this.subject = value;
1505      return this;
1506    }
1507
1508    /**
1509     * @return {@link #encounter} (The Encounter during which this questionnaire response was created or to which the creation of this record is tightly associated.)
1510     */
1511    public Reference getEncounter() { 
1512      if (this.encounter == null)
1513        if (Configuration.errorOnAutoCreate())
1514          throw new Error("Attempt to auto-create QuestionnaireResponse.encounter");
1515        else if (Configuration.doAutoCreate())
1516          this.encounter = new Reference(); // cc
1517      return this.encounter;
1518    }
1519
1520    public boolean hasEncounter() { 
1521      return this.encounter != null && !this.encounter.isEmpty();
1522    }
1523
1524    /**
1525     * @param value {@link #encounter} (The Encounter during which this questionnaire response was created or to which the creation of this record is tightly associated.)
1526     */
1527    public QuestionnaireResponse setEncounter(Reference value) { 
1528      this.encounter = value;
1529      return this;
1530    }
1531
1532    /**
1533     * @return {@link #authored} (The date and/or time that this set of answers were last changed.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value
1534     */
1535    public DateTimeType getAuthoredElement() { 
1536      if (this.authored == null)
1537        if (Configuration.errorOnAutoCreate())
1538          throw new Error("Attempt to auto-create QuestionnaireResponse.authored");
1539        else if (Configuration.doAutoCreate())
1540          this.authored = new DateTimeType(); // bb
1541      return this.authored;
1542    }
1543
1544    public boolean hasAuthoredElement() { 
1545      return this.authored != null && !this.authored.isEmpty();
1546    }
1547
1548    public boolean hasAuthored() { 
1549      return this.authored != null && !this.authored.isEmpty();
1550    }
1551
1552    /**
1553     * @param value {@link #authored} (The date and/or time that this set of answers were last changed.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value
1554     */
1555    public QuestionnaireResponse setAuthoredElement(DateTimeType value) { 
1556      this.authored = value;
1557      return this;
1558    }
1559
1560    /**
1561     * @return The date and/or time that this set of answers were last changed.
1562     */
1563    public Date getAuthored() { 
1564      return this.authored == null ? null : this.authored.getValue();
1565    }
1566
1567    /**
1568     * @param value The date and/or time that this set of answers were last changed.
1569     */
1570    public QuestionnaireResponse setAuthored(Date value) { 
1571      if (value == null)
1572        this.authored = null;
1573      else {
1574        if (this.authored == null)
1575          this.authored = new DateTimeType();
1576        this.authored.setValue(value);
1577      }
1578      return this;
1579    }
1580
1581    /**
1582     * @return {@link #author} (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.)
1583     */
1584    public Reference getAuthor() { 
1585      if (this.author == null)
1586        if (Configuration.errorOnAutoCreate())
1587          throw new Error("Attempt to auto-create QuestionnaireResponse.author");
1588        else if (Configuration.doAutoCreate())
1589          this.author = new Reference(); // cc
1590      return this.author;
1591    }
1592
1593    public boolean hasAuthor() { 
1594      return this.author != null && !this.author.isEmpty();
1595    }
1596
1597    /**
1598     * @param value {@link #author} (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.)
1599     */
1600    public QuestionnaireResponse setAuthor(Reference value) { 
1601      this.author = value;
1602      return this;
1603    }
1604
1605    /**
1606     * @return {@link #source} (The person who answered the questions about the subject.)
1607     */
1608    public Reference getSource() { 
1609      if (this.source == null)
1610        if (Configuration.errorOnAutoCreate())
1611          throw new Error("Attempt to auto-create QuestionnaireResponse.source");
1612        else if (Configuration.doAutoCreate())
1613          this.source = new Reference(); // cc
1614      return this.source;
1615    }
1616
1617    public boolean hasSource() { 
1618      return this.source != null && !this.source.isEmpty();
1619    }
1620
1621    /**
1622     * @param value {@link #source} (The person who answered the questions about the subject.)
1623     */
1624    public QuestionnaireResponse setSource(Reference value) { 
1625      this.source = value;
1626      return this;
1627    }
1628
1629    /**
1630     * @return {@link #item} (A group or question item from the original questionnaire for which answers are provided.)
1631     */
1632    public List<QuestionnaireResponseItemComponent> getItem() { 
1633      if (this.item == null)
1634        this.item = new ArrayList<QuestionnaireResponseItemComponent>();
1635      return this.item;
1636    }
1637
1638    /**
1639     * @return Returns a reference to <code>this</code> for easy method chaining
1640     */
1641    public QuestionnaireResponse setItem(List<QuestionnaireResponseItemComponent> theItem) { 
1642      this.item = theItem;
1643      return this;
1644    }
1645
1646    public boolean hasItem() { 
1647      if (this.item == null)
1648        return false;
1649      for (QuestionnaireResponseItemComponent item : this.item)
1650        if (!item.isEmpty())
1651          return true;
1652      return false;
1653    }
1654
1655    public QuestionnaireResponseItemComponent addItem() { //3
1656      QuestionnaireResponseItemComponent t = new QuestionnaireResponseItemComponent();
1657      if (this.item == null)
1658        this.item = new ArrayList<QuestionnaireResponseItemComponent>();
1659      this.item.add(t);
1660      return t;
1661    }
1662
1663    public QuestionnaireResponse addItem(QuestionnaireResponseItemComponent t) { //3
1664      if (t == null)
1665        return this;
1666      if (this.item == null)
1667        this.item = new ArrayList<QuestionnaireResponseItemComponent>();
1668      this.item.add(t);
1669      return this;
1670    }
1671
1672    /**
1673     * @return The first repetition of repeating field {@link #item}, creating it if it does not already exist
1674     */
1675    public QuestionnaireResponseItemComponent getItemFirstRep() { 
1676      if (getItem().isEmpty()) {
1677        addItem();
1678      }
1679      return getItem().get(0);
1680    }
1681
1682      protected void listChildren(List<Property> children) {
1683        super.listChildren(children);
1684        children.add(new Property("identifier", "Identifier", "A business identifier assigned to a particular completed (or partially completed) questionnaire.", 0, 1, identifier));
1685        children.add(new Property("basedOn", "Reference(CarePlan|ServiceRequest)", "The order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse.  For example, a ServiceRequest seeking an intake assessment or a decision support recommendation to assess for post-partum depression.", 0, java.lang.Integer.MAX_VALUE, basedOn));
1686        children.add(new Property("partOf", "Reference(Observation|Procedure)", "A procedure or observation that this questionnaire was performed as part of the execution of.  For example, the surgery a checklist was executed as part of.", 0, java.lang.Integer.MAX_VALUE, partOf));
1687        children.add(new Property("questionnaire", "canonical(Questionnaire)", "The Questionnaire that defines and organizes the questions for which answers are being provided.", 0, 1, questionnaire));
1688        children.add(new Property("status", "code", "The position of the questionnaire response within its overall lifecycle.", 0, 1, status));
1689        children.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, 1, subject));
1690        children.add(new Property("encounter", "Reference(Encounter)", "The Encounter during which this questionnaire response was created or to which the creation of this record is tightly associated.", 0, 1, encounter));
1691        children.add(new Property("authored", "dateTime", "The date and/or time that this set of answers were last changed.", 0, 1, authored));
1692        children.add(new Property("author", "Reference(Device|Practitioner|PractitionerRole|Patient|RelatedPerson|Organization)", "Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.", 0, 1, author));
1693        children.add(new Property("source", "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson)", "The person who answered the questions about the subject.", 0, 1, source));
1694        children.add(new Property("item", "", "A group or question item from the original questionnaire for which answers are provided.", 0, java.lang.Integer.MAX_VALUE, item));
1695      }
1696
1697      @Override
1698      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1699        switch (_hash) {
1700        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A business identifier assigned to a particular completed (or partially completed) questionnaire.", 0, 1, identifier);
1701        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(CarePlan|ServiceRequest)", "The order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse.  For example, a ServiceRequest seeking an intake assessment or a decision support recommendation to assess for post-partum depression.", 0, java.lang.Integer.MAX_VALUE, basedOn);
1702        case -995410646: /*partOf*/  return new Property("partOf", "Reference(Observation|Procedure)", "A procedure or observation that this questionnaire was performed as part of the execution of.  For example, the surgery a checklist was executed as part of.", 0, java.lang.Integer.MAX_VALUE, partOf);
1703        case -1017049693: /*questionnaire*/  return new Property("questionnaire", "canonical(Questionnaire)", "The Questionnaire that defines and organizes the questions for which answers are being provided.", 0, 1, questionnaire);
1704        case -892481550: /*status*/  return new Property("status", "code", "The position of the questionnaire response within its overall lifecycle.", 0, 1, status);
1705        case -1867885268: /*subject*/  return 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, 1, subject);
1706        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The Encounter during which this questionnaire response was created or to which the creation of this record is tightly associated.", 0, 1, encounter);
1707        case 1433073514: /*authored*/  return new Property("authored", "dateTime", "The date and/or time that this set of answers were last changed.", 0, 1, authored);
1708        case -1406328437: /*author*/  return new Property("author", "Reference(Device|Practitioner|PractitionerRole|Patient|RelatedPerson|Organization)", "Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.", 0, 1, author);
1709        case -896505829: /*source*/  return new Property("source", "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson)", "The person who answered the questions about the subject.", 0, 1, source);
1710        case 3242771: /*item*/  return new Property("item", "", "A group or question item from the original questionnaire for which answers are provided.", 0, java.lang.Integer.MAX_VALUE, item);
1711        default: return super.getNamedProperty(_hash, _name, _checkValid);
1712        }
1713
1714      }
1715
1716      @Override
1717      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1718        switch (hash) {
1719        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
1720        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
1721        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
1722        case -1017049693: /*questionnaire*/ return this.questionnaire == null ? new Base[0] : new Base[] {this.questionnaire}; // CanonicalType
1723        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<QuestionnaireResponseStatus>
1724        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1725        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
1726        case 1433073514: /*authored*/ return this.authored == null ? new Base[0] : new Base[] {this.authored}; // DateTimeType
1727        case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference
1728        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference
1729        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireResponseItemComponent
1730        default: return super.getProperty(hash, name, checkValid);
1731        }
1732
1733      }
1734
1735      @Override
1736      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1737        switch (hash) {
1738        case -1618432855: // identifier
1739          this.identifier = castToIdentifier(value); // Identifier
1740          return value;
1741        case -332612366: // basedOn
1742          this.getBasedOn().add(castToReference(value)); // Reference
1743          return value;
1744        case -995410646: // partOf
1745          this.getPartOf().add(castToReference(value)); // Reference
1746          return value;
1747        case -1017049693: // questionnaire
1748          this.questionnaire = castToCanonical(value); // CanonicalType
1749          return value;
1750        case -892481550: // status
1751          value = new QuestionnaireResponseStatusEnumFactory().fromType(castToCode(value));
1752          this.status = (Enumeration) value; // Enumeration<QuestionnaireResponseStatus>
1753          return value;
1754        case -1867885268: // subject
1755          this.subject = castToReference(value); // Reference
1756          return value;
1757        case 1524132147: // encounter
1758          this.encounter = castToReference(value); // Reference
1759          return value;
1760        case 1433073514: // authored
1761          this.authored = castToDateTime(value); // DateTimeType
1762          return value;
1763        case -1406328437: // author
1764          this.author = castToReference(value); // Reference
1765          return value;
1766        case -896505829: // source
1767          this.source = castToReference(value); // Reference
1768          return value;
1769        case 3242771: // item
1770          this.getItem().add((QuestionnaireResponseItemComponent) value); // QuestionnaireResponseItemComponent
1771          return value;
1772        default: return super.setProperty(hash, name, value);
1773        }
1774
1775      }
1776
1777      @Override
1778      public Base setProperty(String name, Base value) throws FHIRException {
1779        if (name.equals("identifier")) {
1780          this.identifier = castToIdentifier(value); // Identifier
1781        } else if (name.equals("basedOn")) {
1782          this.getBasedOn().add(castToReference(value));
1783        } else if (name.equals("partOf")) {
1784          this.getPartOf().add(castToReference(value));
1785        } else if (name.equals("questionnaire")) {
1786          this.questionnaire = castToCanonical(value); // CanonicalType
1787        } else if (name.equals("status")) {
1788          value = new QuestionnaireResponseStatusEnumFactory().fromType(castToCode(value));
1789          this.status = (Enumeration) value; // Enumeration<QuestionnaireResponseStatus>
1790        } else if (name.equals("subject")) {
1791          this.subject = castToReference(value); // Reference
1792        } else if (name.equals("encounter")) {
1793          this.encounter = castToReference(value); // Reference
1794        } else if (name.equals("authored")) {
1795          this.authored = castToDateTime(value); // DateTimeType
1796        } else if (name.equals("author")) {
1797          this.author = castToReference(value); // Reference
1798        } else if (name.equals("source")) {
1799          this.source = castToReference(value); // Reference
1800        } else if (name.equals("item")) {
1801          this.getItem().add((QuestionnaireResponseItemComponent) value);
1802        } else
1803          return super.setProperty(name, value);
1804        return value;
1805      }
1806
1807      @Override
1808      public Base makeProperty(int hash, String name) throws FHIRException {
1809        switch (hash) {
1810        case -1618432855:  return getIdentifier();
1811        case -332612366:  return addBasedOn(); 
1812        case -995410646:  return addPartOf(); 
1813        case -1017049693:  return getQuestionnaireElement();
1814        case -892481550:  return getStatusElement();
1815        case -1867885268:  return getSubject();
1816        case 1524132147:  return getEncounter();
1817        case 1433073514:  return getAuthoredElement();
1818        case -1406328437:  return getAuthor();
1819        case -896505829:  return getSource();
1820        case 3242771:  return addItem(); 
1821        default: return super.makeProperty(hash, name);
1822        }
1823
1824      }
1825
1826      @Override
1827      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1828        switch (hash) {
1829        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1830        case -332612366: /*basedOn*/ return new String[] {"Reference"};
1831        case -995410646: /*partOf*/ return new String[] {"Reference"};
1832        case -1017049693: /*questionnaire*/ return new String[] {"canonical"};
1833        case -892481550: /*status*/ return new String[] {"code"};
1834        case -1867885268: /*subject*/ return new String[] {"Reference"};
1835        case 1524132147: /*encounter*/ return new String[] {"Reference"};
1836        case 1433073514: /*authored*/ return new String[] {"dateTime"};
1837        case -1406328437: /*author*/ return new String[] {"Reference"};
1838        case -896505829: /*source*/ return new String[] {"Reference"};
1839        case 3242771: /*item*/ return new String[] {};
1840        default: return super.getTypesForProperty(hash, name);
1841        }
1842
1843      }
1844
1845      @Override
1846      public Base addChild(String name) throws FHIRException {
1847        if (name.equals("identifier")) {
1848          this.identifier = new Identifier();
1849          return this.identifier;
1850        }
1851        else if (name.equals("basedOn")) {
1852          return addBasedOn();
1853        }
1854        else if (name.equals("partOf")) {
1855          return addPartOf();
1856        }
1857        else if (name.equals("questionnaire")) {
1858          throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.questionnaire");
1859        }
1860        else if (name.equals("status")) {
1861          throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.status");
1862        }
1863        else if (name.equals("subject")) {
1864          this.subject = new Reference();
1865          return this.subject;
1866        }
1867        else if (name.equals("encounter")) {
1868          this.encounter = new Reference();
1869          return this.encounter;
1870        }
1871        else if (name.equals("authored")) {
1872          throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.authored");
1873        }
1874        else if (name.equals("author")) {
1875          this.author = new Reference();
1876          return this.author;
1877        }
1878        else if (name.equals("source")) {
1879          this.source = new Reference();
1880          return this.source;
1881        }
1882        else if (name.equals("item")) {
1883          return addItem();
1884        }
1885        else
1886          return super.addChild(name);
1887      }
1888
1889  public String fhirType() {
1890    return "QuestionnaireResponse";
1891
1892  }
1893
1894      public QuestionnaireResponse copy() {
1895        QuestionnaireResponse dst = new QuestionnaireResponse();
1896        copyValues(dst);
1897        return dst;
1898      }
1899
1900      public void copyValues(QuestionnaireResponse dst) {
1901        super.copyValues(dst);
1902        dst.identifier = identifier == null ? null : identifier.copy();
1903        if (basedOn != null) {
1904          dst.basedOn = new ArrayList<Reference>();
1905          for (Reference i : basedOn)
1906            dst.basedOn.add(i.copy());
1907        };
1908        if (partOf != null) {
1909          dst.partOf = new ArrayList<Reference>();
1910          for (Reference i : partOf)
1911            dst.partOf.add(i.copy());
1912        };
1913        dst.questionnaire = questionnaire == null ? null : questionnaire.copy();
1914        dst.status = status == null ? null : status.copy();
1915        dst.subject = subject == null ? null : subject.copy();
1916        dst.encounter = encounter == null ? null : encounter.copy();
1917        dst.authored = authored == null ? null : authored.copy();
1918        dst.author = author == null ? null : author.copy();
1919        dst.source = source == null ? null : source.copy();
1920        if (item != null) {
1921          dst.item = new ArrayList<QuestionnaireResponseItemComponent>();
1922          for (QuestionnaireResponseItemComponent i : item)
1923            dst.item.add(i.copy());
1924        };
1925      }
1926
1927      protected QuestionnaireResponse typedCopy() {
1928        return copy();
1929      }
1930
1931      @Override
1932      public boolean equalsDeep(Base other_) {
1933        if (!super.equalsDeep(other_))
1934          return false;
1935        if (!(other_ instanceof QuestionnaireResponse))
1936          return false;
1937        QuestionnaireResponse o = (QuestionnaireResponse) other_;
1938        return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(partOf, o.partOf, true)
1939           && compareDeep(questionnaire, o.questionnaire, true) && compareDeep(status, o.status, true) && compareDeep(subject, o.subject, true)
1940           && compareDeep(encounter, o.encounter, true) && compareDeep(authored, o.authored, true) && compareDeep(author, o.author, true)
1941           && compareDeep(source, o.source, true) && compareDeep(item, o.item, true);
1942      }
1943
1944      @Override
1945      public boolean equalsShallow(Base other_) {
1946        if (!super.equalsShallow(other_))
1947          return false;
1948        if (!(other_ instanceof QuestionnaireResponse))
1949          return false;
1950        QuestionnaireResponse o = (QuestionnaireResponse) other_;
1951        return compareValues(status, o.status, true) && compareValues(authored, o.authored, true);
1952      }
1953
1954      public boolean isEmpty() {
1955        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, partOf
1956          , questionnaire, status, subject, encounter, authored, author, source, item
1957          );
1958      }
1959
1960  @Override
1961  public ResourceType getResourceType() {
1962    return ResourceType.QuestionnaireResponse;
1963   }
1964
1965 /**
1966   * Search parameter: <b>authored</b>
1967   * <p>
1968   * Description: <b>When the questionnaire response was last changed</b><br>
1969   * Type: <b>date</b><br>
1970   * Path: <b>QuestionnaireResponse.authored</b><br>
1971   * </p>
1972   */
1973  @SearchParamDefinition(name="authored", path="QuestionnaireResponse.authored", description="When the questionnaire response was last changed", type="date" )
1974  public static final String SP_AUTHORED = "authored";
1975 /**
1976   * <b>Fluent Client</b> search parameter constant for <b>authored</b>
1977   * <p>
1978   * Description: <b>When the questionnaire response was last changed</b><br>
1979   * Type: <b>date</b><br>
1980   * Path: <b>QuestionnaireResponse.authored</b><br>
1981   * </p>
1982   */
1983  public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORED);
1984
1985 /**
1986   * Search parameter: <b>identifier</b>
1987   * <p>
1988   * Description: <b>The unique identifier for the questionnaire response</b><br>
1989   * Type: <b>token</b><br>
1990   * Path: <b>QuestionnaireResponse.identifier</b><br>
1991   * </p>
1992   */
1993  @SearchParamDefinition(name="identifier", path="QuestionnaireResponse.identifier", description="The unique identifier for the questionnaire response", type="token" )
1994  public static final String SP_IDENTIFIER = "identifier";
1995 /**
1996   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1997   * <p>
1998   * Description: <b>The unique identifier for the questionnaire response</b><br>
1999   * Type: <b>token</b><br>
2000   * Path: <b>QuestionnaireResponse.identifier</b><br>
2001   * </p>
2002   */
2003  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2004
2005 /**
2006   * Search parameter: <b>questionnaire</b>
2007   * <p>
2008   * Description: <b>The questionnaire the answers are provided for</b><br>
2009   * Type: <b>reference</b><br>
2010   * Path: <b>QuestionnaireResponse.questionnaire</b><br>
2011   * </p>
2012   */
2013  @SearchParamDefinition(name="questionnaire", path="QuestionnaireResponse.questionnaire", description="The questionnaire the answers are provided for", type="reference", target={Questionnaire.class } )
2014  public static final String SP_QUESTIONNAIRE = "questionnaire";
2015 /**
2016   * <b>Fluent Client</b> search parameter constant for <b>questionnaire</b>
2017   * <p>
2018   * Description: <b>The questionnaire the answers are provided for</b><br>
2019   * Type: <b>reference</b><br>
2020   * Path: <b>QuestionnaireResponse.questionnaire</b><br>
2021   * </p>
2022   */
2023  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam QUESTIONNAIRE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_QUESTIONNAIRE);
2024
2025/**
2026   * Constant for fluent queries to be used to add include statements. Specifies
2027   * the path value of "<b>QuestionnaireResponse:questionnaire</b>".
2028   */
2029  public static final ca.uhn.fhir.model.api.Include INCLUDE_QUESTIONNAIRE = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:questionnaire").toLocked();
2030
2031 /**
2032   * Search parameter: <b>based-on</b>
2033   * <p>
2034   * Description: <b>Plan/proposal/order fulfilled by this questionnaire response</b><br>
2035   * Type: <b>reference</b><br>
2036   * Path: <b>QuestionnaireResponse.basedOn</b><br>
2037   * </p>
2038   */
2039  @SearchParamDefinition(name="based-on", path="QuestionnaireResponse.basedOn", description="Plan/proposal/order fulfilled by this questionnaire response", type="reference", target={CarePlan.class, ServiceRequest.class } )
2040  public static final String SP_BASED_ON = "based-on";
2041 /**
2042   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
2043   * <p>
2044   * Description: <b>Plan/proposal/order fulfilled by this questionnaire response</b><br>
2045   * Type: <b>reference</b><br>
2046   * Path: <b>QuestionnaireResponse.basedOn</b><br>
2047   * </p>
2048   */
2049  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
2050
2051/**
2052   * Constant for fluent queries to be used to add include statements. Specifies
2053   * the path value of "<b>QuestionnaireResponse:based-on</b>".
2054   */
2055  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:based-on").toLocked();
2056
2057 /**
2058   * Search parameter: <b>subject</b>
2059   * <p>
2060   * Description: <b>The subject of the questionnaire response</b><br>
2061   * Type: <b>reference</b><br>
2062   * Path: <b>QuestionnaireResponse.subject</b><br>
2063   * </p>
2064   */
2065  @SearchParamDefinition(name="subject", path="QuestionnaireResponse.subject", description="The subject of the questionnaire response", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") } )
2066  public static final String SP_SUBJECT = "subject";
2067 /**
2068   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2069   * <p>
2070   * Description: <b>The subject of the questionnaire response</b><br>
2071   * Type: <b>reference</b><br>
2072   * Path: <b>QuestionnaireResponse.subject</b><br>
2073   * </p>
2074   */
2075  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2076
2077/**
2078   * Constant for fluent queries to be used to add include statements. Specifies
2079   * the path value of "<b>QuestionnaireResponse:subject</b>".
2080   */
2081  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:subject").toLocked();
2082
2083 /**
2084   * Search parameter: <b>author</b>
2085   * <p>
2086   * Description: <b>The author of the questionnaire response</b><br>
2087   * Type: <b>reference</b><br>
2088   * Path: <b>QuestionnaireResponse.author</b><br>
2089   * </p>
2090   */
2091  @SearchParamDefinition(name="author", path="QuestionnaireResponse.author", description="The author of the questionnaire response", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2092  public static final String SP_AUTHOR = "author";
2093 /**
2094   * <b>Fluent Client</b> search parameter constant for <b>author</b>
2095   * <p>
2096   * Description: <b>The author of the questionnaire response</b><br>
2097   * Type: <b>reference</b><br>
2098   * Path: <b>QuestionnaireResponse.author</b><br>
2099   * </p>
2100   */
2101  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR);
2102
2103/**
2104   * Constant for fluent queries to be used to add include statements. Specifies
2105   * the path value of "<b>QuestionnaireResponse:author</b>".
2106   */
2107  public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:author").toLocked();
2108
2109 /**
2110   * Search parameter: <b>patient</b>
2111   * <p>
2112   * Description: <b>The patient that is the subject of the questionnaire response</b><br>
2113   * Type: <b>reference</b><br>
2114   * Path: <b>QuestionnaireResponse.subject</b><br>
2115   * </p>
2116   */
2117  @SearchParamDefinition(name="patient", path="QuestionnaireResponse.subject.where(resolve() is Patient)", description="The patient that is the subject of the questionnaire response", type="reference", target={Patient.class } )
2118  public static final String SP_PATIENT = "patient";
2119 /**
2120   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2121   * <p>
2122   * Description: <b>The patient that is the subject of the questionnaire response</b><br>
2123   * Type: <b>reference</b><br>
2124   * Path: <b>QuestionnaireResponse.subject</b><br>
2125   * </p>
2126   */
2127  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2128
2129/**
2130   * Constant for fluent queries to be used to add include statements. Specifies
2131   * the path value of "<b>QuestionnaireResponse:patient</b>".
2132   */
2133  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:patient").toLocked();
2134
2135 /**
2136   * Search parameter: <b>part-of</b>
2137   * <p>
2138   * Description: <b>Procedure or observation this questionnaire response was performed as a part of</b><br>
2139   * Type: <b>reference</b><br>
2140   * Path: <b>QuestionnaireResponse.partOf</b><br>
2141   * </p>
2142   */
2143  @SearchParamDefinition(name="part-of", path="QuestionnaireResponse.partOf", description="Procedure or observation this questionnaire response was performed as a part of", type="reference", target={Observation.class, Procedure.class } )
2144  public static final String SP_PART_OF = "part-of";
2145 /**
2146   * <b>Fluent Client</b> search parameter constant for <b>part-of</b>
2147   * <p>
2148   * Description: <b>Procedure or observation this questionnaire response was performed as a part of</b><br>
2149   * Type: <b>reference</b><br>
2150   * Path: <b>QuestionnaireResponse.partOf</b><br>
2151   * </p>
2152   */
2153  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF);
2154
2155/**
2156   * Constant for fluent queries to be used to add include statements. Specifies
2157   * the path value of "<b>QuestionnaireResponse:part-of</b>".
2158   */
2159  public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:part-of").toLocked();
2160
2161 /**
2162   * Search parameter: <b>encounter</b>
2163   * <p>
2164   * Description: <b>Encounter associated with the questionnaire response</b><br>
2165   * Type: <b>reference</b><br>
2166   * Path: <b>QuestionnaireResponse.encounter</b><br>
2167   * </p>
2168   */
2169  @SearchParamDefinition(name="encounter", path="QuestionnaireResponse.encounter", description="Encounter associated with the questionnaire response", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Encounter") }, target={Encounter.class } )
2170  public static final String SP_ENCOUNTER = "encounter";
2171 /**
2172   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
2173   * <p>
2174   * Description: <b>Encounter associated with the questionnaire response</b><br>
2175   * Type: <b>reference</b><br>
2176   * Path: <b>QuestionnaireResponse.encounter</b><br>
2177   * </p>
2178   */
2179  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
2180
2181/**
2182   * Constant for fluent queries to be used to add include statements. Specifies
2183   * the path value of "<b>QuestionnaireResponse:encounter</b>".
2184   */
2185  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:encounter").toLocked();
2186
2187 /**
2188   * Search parameter: <b>source</b>
2189   * <p>
2190   * Description: <b>The individual providing the information reflected in the questionnaire respose</b><br>
2191   * Type: <b>reference</b><br>
2192   * Path: <b>QuestionnaireResponse.source</b><br>
2193   * </p>
2194   */
2195  @SearchParamDefinition(name="source", path="QuestionnaireResponse.source", description="The individual providing the information reflected in the questionnaire respose", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2196  public static final String SP_SOURCE = "source";
2197 /**
2198   * <b>Fluent Client</b> search parameter constant for <b>source</b>
2199   * <p>
2200   * Description: <b>The individual providing the information reflected in the questionnaire respose</b><br>
2201   * Type: <b>reference</b><br>
2202   * Path: <b>QuestionnaireResponse.source</b><br>
2203   * </p>
2204   */
2205  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE);
2206
2207/**
2208   * Constant for fluent queries to be used to add include statements. Specifies
2209   * the path value of "<b>QuestionnaireResponse:source</b>".
2210   */
2211  public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:source").toLocked();
2212
2213 /**
2214   * Search parameter: <b>status</b>
2215   * <p>
2216   * Description: <b>The status of the questionnaire response</b><br>
2217   * Type: <b>token</b><br>
2218   * Path: <b>QuestionnaireResponse.status</b><br>
2219   * </p>
2220   */
2221  @SearchParamDefinition(name="status", path="QuestionnaireResponse.status", description="The status of the questionnaire response", type="token" )
2222  public static final String SP_STATUS = "status";
2223 /**
2224   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2225   * <p>
2226   * Description: <b>The status of the questionnaire response</b><br>
2227   * Type: <b>token</b><br>
2228   * Path: <b>QuestionnaireResponse.status</b><br>
2229   * </p>
2230   */
2231  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2232
2233
2234}
2235