001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Fri, Jul 15, 2022 11:20+1000 for FHIR v5.0.0-snapshot2
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * A record of a healthcare consumer?s  choices  or choices made on their behalf by a third party, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.
052 */
053@ResourceDef(name="Consent", profile="http://hl7.org/fhir/StructureDefinition/Consent")
054public class Consent extends DomainResource {
055
056    public enum ConsentDataMeaning {
057        /**
058         * The consent applies directly to the instance of the resource.
059         */
060        INSTANCE, 
061        /**
062         * The consent applies directly to the instance of the resource and instances it refers to.
063         */
064        RELATED, 
065        /**
066         * The consent applies directly to the instance of the resource and instances that refer to it.
067         */
068        DEPENDENTS, 
069        /**
070         * The consent applies to instances of resources that are authored by.
071         */
072        AUTHOREDBY, 
073        /**
074         * added to help the parsers with the generic types
075         */
076        NULL;
077        public static ConsentDataMeaning fromCode(String codeString) throws FHIRException {
078            if (codeString == null || "".equals(codeString))
079                return null;
080        if ("instance".equals(codeString))
081          return INSTANCE;
082        if ("related".equals(codeString))
083          return RELATED;
084        if ("dependents".equals(codeString))
085          return DEPENDENTS;
086        if ("authoredby".equals(codeString))
087          return AUTHOREDBY;
088        if (Configuration.isAcceptInvalidEnums())
089          return null;
090        else
091          throw new FHIRException("Unknown ConsentDataMeaning code '"+codeString+"'");
092        }
093        public String toCode() {
094          switch (this) {
095            case INSTANCE: return "instance";
096            case RELATED: return "related";
097            case DEPENDENTS: return "dependents";
098            case AUTHOREDBY: return "authoredby";
099            case NULL: return null;
100            default: return "?";
101          }
102        }
103        public String getSystem() {
104          switch (this) {
105            case INSTANCE: return "http://hl7.org/fhir/consent-data-meaning";
106            case RELATED: return "http://hl7.org/fhir/consent-data-meaning";
107            case DEPENDENTS: return "http://hl7.org/fhir/consent-data-meaning";
108            case AUTHOREDBY: return "http://hl7.org/fhir/consent-data-meaning";
109            case NULL: return null;
110            default: return "?";
111          }
112        }
113        public String getDefinition() {
114          switch (this) {
115            case INSTANCE: return "The consent applies directly to the instance of the resource.";
116            case RELATED: return "The consent applies directly to the instance of the resource and instances it refers to.";
117            case DEPENDENTS: return "The consent applies directly to the instance of the resource and instances that refer to it.";
118            case AUTHOREDBY: return "The consent applies to instances of resources that are authored by.";
119            case NULL: return null;
120            default: return "?";
121          }
122        }
123        public String getDisplay() {
124          switch (this) {
125            case INSTANCE: return "Instance";
126            case RELATED: return "Related";
127            case DEPENDENTS: return "Dependents";
128            case AUTHOREDBY: return "AuthoredBy";
129            case NULL: return null;
130            default: return "?";
131          }
132        }
133    }
134
135  public static class ConsentDataMeaningEnumFactory implements EnumFactory<ConsentDataMeaning> {
136    public ConsentDataMeaning fromCode(String codeString) throws IllegalArgumentException {
137      if (codeString == null || "".equals(codeString))
138            if (codeString == null || "".equals(codeString))
139                return null;
140        if ("instance".equals(codeString))
141          return ConsentDataMeaning.INSTANCE;
142        if ("related".equals(codeString))
143          return ConsentDataMeaning.RELATED;
144        if ("dependents".equals(codeString))
145          return ConsentDataMeaning.DEPENDENTS;
146        if ("authoredby".equals(codeString))
147          return ConsentDataMeaning.AUTHOREDBY;
148        throw new IllegalArgumentException("Unknown ConsentDataMeaning code '"+codeString+"'");
149        }
150        public Enumeration<ConsentDataMeaning> fromType(Base code) throws FHIRException {
151          if (code == null)
152            return null;
153          if (code.isEmpty())
154            return new Enumeration<ConsentDataMeaning>(this);
155          String codeString = ((PrimitiveType) code).asStringValue();
156          if (codeString == null || "".equals(codeString))
157            return null;
158        if ("instance".equals(codeString))
159          return new Enumeration<ConsentDataMeaning>(this, ConsentDataMeaning.INSTANCE);
160        if ("related".equals(codeString))
161          return new Enumeration<ConsentDataMeaning>(this, ConsentDataMeaning.RELATED);
162        if ("dependents".equals(codeString))
163          return new Enumeration<ConsentDataMeaning>(this, ConsentDataMeaning.DEPENDENTS);
164        if ("authoredby".equals(codeString))
165          return new Enumeration<ConsentDataMeaning>(this, ConsentDataMeaning.AUTHOREDBY);
166        throw new FHIRException("Unknown ConsentDataMeaning code '"+codeString+"'");
167        }
168    public String toCode(ConsentDataMeaning code) {
169      if (code == ConsentDataMeaning.INSTANCE)
170        return "instance";
171      if (code == ConsentDataMeaning.RELATED)
172        return "related";
173      if (code == ConsentDataMeaning.DEPENDENTS)
174        return "dependents";
175      if (code == ConsentDataMeaning.AUTHOREDBY)
176        return "authoredby";
177      return "?";
178      }
179    public String toSystem(ConsentDataMeaning code) {
180      return code.getSystem();
181      }
182    }
183
184    public enum ConsentProvisionType {
185        /**
186         * Consent is denied for actions meeting these rules.
187         */
188        DENY, 
189        /**
190         * Consent is provided for actions meeting these rules.
191         */
192        PERMIT, 
193        /**
194         * added to help the parsers with the generic types
195         */
196        NULL;
197        public static ConsentProvisionType fromCode(String codeString) throws FHIRException {
198            if (codeString == null || "".equals(codeString))
199                return null;
200        if ("deny".equals(codeString))
201          return DENY;
202        if ("permit".equals(codeString))
203          return PERMIT;
204        if (Configuration.isAcceptInvalidEnums())
205          return null;
206        else
207          throw new FHIRException("Unknown ConsentProvisionType code '"+codeString+"'");
208        }
209        public String toCode() {
210          switch (this) {
211            case DENY: return "deny";
212            case PERMIT: return "permit";
213            case NULL: return null;
214            default: return "?";
215          }
216        }
217        public String getSystem() {
218          switch (this) {
219            case DENY: return "http://hl7.org/fhir/consent-provision-type";
220            case PERMIT: return "http://hl7.org/fhir/consent-provision-type";
221            case NULL: return null;
222            default: return "?";
223          }
224        }
225        public String getDefinition() {
226          switch (this) {
227            case DENY: return "Consent is denied for actions meeting these rules.";
228            case PERMIT: return "Consent is provided for actions meeting these rules.";
229            case NULL: return null;
230            default: return "?";
231          }
232        }
233        public String getDisplay() {
234          switch (this) {
235            case DENY: return "Deny";
236            case PERMIT: return "Permit";
237            case NULL: return null;
238            default: return "?";
239          }
240        }
241    }
242
243  public static class ConsentProvisionTypeEnumFactory implements EnumFactory<ConsentProvisionType> {
244    public ConsentProvisionType fromCode(String codeString) throws IllegalArgumentException {
245      if (codeString == null || "".equals(codeString))
246            if (codeString == null || "".equals(codeString))
247                return null;
248        if ("deny".equals(codeString))
249          return ConsentProvisionType.DENY;
250        if ("permit".equals(codeString))
251          return ConsentProvisionType.PERMIT;
252        throw new IllegalArgumentException("Unknown ConsentProvisionType code '"+codeString+"'");
253        }
254        public Enumeration<ConsentProvisionType> fromType(Base code) throws FHIRException {
255          if (code == null)
256            return null;
257          if (code.isEmpty())
258            return new Enumeration<ConsentProvisionType>(this);
259          String codeString = ((PrimitiveType) code).asStringValue();
260          if (codeString == null || "".equals(codeString))
261            return null;
262        if ("deny".equals(codeString))
263          return new Enumeration<ConsentProvisionType>(this, ConsentProvisionType.DENY);
264        if ("permit".equals(codeString))
265          return new Enumeration<ConsentProvisionType>(this, ConsentProvisionType.PERMIT);
266        throw new FHIRException("Unknown ConsentProvisionType code '"+codeString+"'");
267        }
268    public String toCode(ConsentProvisionType code) {
269      if (code == ConsentProvisionType.DENY)
270        return "deny";
271      if (code == ConsentProvisionType.PERMIT)
272        return "permit";
273      return "?";
274      }
275    public String toSystem(ConsentProvisionType code) {
276      return code.getSystem();
277      }
278    }
279
280    public enum ConsentState {
281        /**
282         * The consent is in development or awaiting use but is not yet intended to be acted upon.
283         */
284        DRAFT, 
285        /**
286         * The consent is to be followed and enforced.
287         */
288        ACTIVE, 
289        /**
290         * The consent is terminated or replaced.
291         */
292        INACTIVE, 
293        /**
294         * The consent development has been terminated prior to completion.
295         */
296        NOTDONE, 
297        /**
298         * The consent was created wrongly (e.g. wrong patient) and should be ignored.
299         */
300        ENTEREDINERROR, 
301        /**
302         * The resource is in an indeterminate state.
303         */
304        UNKNOWN, 
305        /**
306         * added to help the parsers with the generic types
307         */
308        NULL;
309        public static ConsentState fromCode(String codeString) throws FHIRException {
310            if (codeString == null || "".equals(codeString))
311                return null;
312        if ("draft".equals(codeString))
313          return DRAFT;
314        if ("active".equals(codeString))
315          return ACTIVE;
316        if ("inactive".equals(codeString))
317          return INACTIVE;
318        if ("not-done".equals(codeString))
319          return NOTDONE;
320        if ("entered-in-error".equals(codeString))
321          return ENTEREDINERROR;
322        if ("unknown".equals(codeString))
323          return UNKNOWN;
324        if (Configuration.isAcceptInvalidEnums())
325          return null;
326        else
327          throw new FHIRException("Unknown ConsentState code '"+codeString+"'");
328        }
329        public String toCode() {
330          switch (this) {
331            case DRAFT: return "draft";
332            case ACTIVE: return "active";
333            case INACTIVE: return "inactive";
334            case NOTDONE: return "not-done";
335            case ENTEREDINERROR: return "entered-in-error";
336            case UNKNOWN: return "unknown";
337            case NULL: return null;
338            default: return "?";
339          }
340        }
341        public String getSystem() {
342          switch (this) {
343            case DRAFT: return "http://hl7.org/fhir/consent-state-codes";
344            case ACTIVE: return "http://hl7.org/fhir/consent-state-codes";
345            case INACTIVE: return "http://hl7.org/fhir/consent-state-codes";
346            case NOTDONE: return "http://hl7.org/fhir/consent-state-codes";
347            case ENTEREDINERROR: return "http://hl7.org/fhir/consent-state-codes";
348            case UNKNOWN: return "http://hl7.org/fhir/consent-state-codes";
349            case NULL: return null;
350            default: return "?";
351          }
352        }
353        public String getDefinition() {
354          switch (this) {
355            case DRAFT: return "The consent is in development or awaiting use but is not yet intended to be acted upon.";
356            case ACTIVE: return "The consent is to be followed and enforced.";
357            case INACTIVE: return "The consent is terminated or replaced.";
358            case NOTDONE: return "The consent development has been terminated prior to completion.";
359            case ENTEREDINERROR: return "The consent was created wrongly (e.g. wrong patient) and should be ignored.";
360            case UNKNOWN: return "The resource is in an indeterminate state.";
361            case NULL: return null;
362            default: return "?";
363          }
364        }
365        public String getDisplay() {
366          switch (this) {
367            case DRAFT: return "Pending";
368            case ACTIVE: return "Active";
369            case INACTIVE: return "Inactive";
370            case NOTDONE: return "Abandoned";
371            case ENTEREDINERROR: return "Entered in Error";
372            case UNKNOWN: return "Unknown";
373            case NULL: return null;
374            default: return "?";
375          }
376        }
377    }
378
379  public static class ConsentStateEnumFactory implements EnumFactory<ConsentState> {
380    public ConsentState fromCode(String codeString) throws IllegalArgumentException {
381      if (codeString == null || "".equals(codeString))
382            if (codeString == null || "".equals(codeString))
383                return null;
384        if ("draft".equals(codeString))
385          return ConsentState.DRAFT;
386        if ("active".equals(codeString))
387          return ConsentState.ACTIVE;
388        if ("inactive".equals(codeString))
389          return ConsentState.INACTIVE;
390        if ("not-done".equals(codeString))
391          return ConsentState.NOTDONE;
392        if ("entered-in-error".equals(codeString))
393          return ConsentState.ENTEREDINERROR;
394        if ("unknown".equals(codeString))
395          return ConsentState.UNKNOWN;
396        throw new IllegalArgumentException("Unknown ConsentState code '"+codeString+"'");
397        }
398        public Enumeration<ConsentState> fromType(Base code) throws FHIRException {
399          if (code == null)
400            return null;
401          if (code.isEmpty())
402            return new Enumeration<ConsentState>(this);
403          String codeString = ((PrimitiveType) code).asStringValue();
404          if (codeString == null || "".equals(codeString))
405            return null;
406        if ("draft".equals(codeString))
407          return new Enumeration<ConsentState>(this, ConsentState.DRAFT);
408        if ("active".equals(codeString))
409          return new Enumeration<ConsentState>(this, ConsentState.ACTIVE);
410        if ("inactive".equals(codeString))
411          return new Enumeration<ConsentState>(this, ConsentState.INACTIVE);
412        if ("not-done".equals(codeString))
413          return new Enumeration<ConsentState>(this, ConsentState.NOTDONE);
414        if ("entered-in-error".equals(codeString))
415          return new Enumeration<ConsentState>(this, ConsentState.ENTEREDINERROR);
416        if ("unknown".equals(codeString))
417          return new Enumeration<ConsentState>(this, ConsentState.UNKNOWN);
418        throw new FHIRException("Unknown ConsentState code '"+codeString+"'");
419        }
420    public String toCode(ConsentState code) {
421      if (code == ConsentState.DRAFT)
422        return "draft";
423      if (code == ConsentState.ACTIVE)
424        return "active";
425      if (code == ConsentState.INACTIVE)
426        return "inactive";
427      if (code == ConsentState.NOTDONE)
428        return "not-done";
429      if (code == ConsentState.ENTEREDINERROR)
430        return "entered-in-error";
431      if (code == ConsentState.UNKNOWN)
432        return "unknown";
433      return "?";
434      }
435    public String toSystem(ConsentState code) {
436      return code.getSystem();
437      }
438    }
439
440    @Block()
441    public static class ConsentPolicyBasisComponent extends BackboneElement implements IBaseBackboneElement {
442        /**
443         * A Reference that identifies the policy the organization will enforce for this Consent.
444         */
445        @Child(name = "reference", type = {Reference.class}, order=1, min=0, max=1, modifier=false, summary=false)
446        @Description(shortDefinition="Reference backing policy resource", formalDefinition="A Reference that identifies the policy the organization will enforce for this Consent." )
447        protected Reference reference;
448
449        /**
450         * A URL that links to a computable version of the policy the organization will enforce for this Consent.
451         */
452        @Child(name = "url", type = {UrlType.class}, order=2, min=0, max=1, modifier=false, summary=false)
453        @Description(shortDefinition="URL to a computable backing policy", formalDefinition="A URL that links to a computable version of the policy the organization will enforce for this Consent." )
454        protected UrlType url;
455
456        private static final long serialVersionUID = 252506182L;
457
458    /**
459     * Constructor
460     */
461      public ConsentPolicyBasisComponent() {
462        super();
463      }
464
465        /**
466         * @return {@link #reference} (A Reference that identifies the policy the organization will enforce for this Consent.)
467         */
468        public Reference getReference() { 
469          if (this.reference == null)
470            if (Configuration.errorOnAutoCreate())
471              throw new Error("Attempt to auto-create ConsentPolicyBasisComponent.reference");
472            else if (Configuration.doAutoCreate())
473              this.reference = new Reference(); // cc
474          return this.reference;
475        }
476
477        public boolean hasReference() { 
478          return this.reference != null && !this.reference.isEmpty();
479        }
480
481        /**
482         * @param value {@link #reference} (A Reference that identifies the policy the organization will enforce for this Consent.)
483         */
484        public ConsentPolicyBasisComponent setReference(Reference value) { 
485          this.reference = value;
486          return this;
487        }
488
489        /**
490         * @return {@link #url} (A URL that links to a computable version of the policy the organization will enforce for this Consent.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
491         */
492        public UrlType getUrlElement() { 
493          if (this.url == null)
494            if (Configuration.errorOnAutoCreate())
495              throw new Error("Attempt to auto-create ConsentPolicyBasisComponent.url");
496            else if (Configuration.doAutoCreate())
497              this.url = new UrlType(); // bb
498          return this.url;
499        }
500
501        public boolean hasUrlElement() { 
502          return this.url != null && !this.url.isEmpty();
503        }
504
505        public boolean hasUrl() { 
506          return this.url != null && !this.url.isEmpty();
507        }
508
509        /**
510         * @param value {@link #url} (A URL that links to a computable version of the policy the organization will enforce for this Consent.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
511         */
512        public ConsentPolicyBasisComponent setUrlElement(UrlType value) { 
513          this.url = value;
514          return this;
515        }
516
517        /**
518         * @return A URL that links to a computable version of the policy the organization will enforce for this Consent.
519         */
520        public String getUrl() { 
521          return this.url == null ? null : this.url.getValue();
522        }
523
524        /**
525         * @param value A URL that links to a computable version of the policy the organization will enforce for this Consent.
526         */
527        public ConsentPolicyBasisComponent setUrl(String value) { 
528          if (Utilities.noString(value))
529            this.url = null;
530          else {
531            if (this.url == null)
532              this.url = new UrlType();
533            this.url.setValue(value);
534          }
535          return this;
536        }
537
538        protected void listChildren(List<Property> children) {
539          super.listChildren(children);
540          children.add(new Property("reference", "Reference(Any)", "A Reference that identifies the policy the organization will enforce for this Consent.", 0, 1, reference));
541          children.add(new Property("url", "url", "A URL that links to a computable version of the policy the organization will enforce for this Consent.", 0, 1, url));
542        }
543
544        @Override
545        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
546          switch (_hash) {
547          case -925155509: /*reference*/  return new Property("reference", "Reference(Any)", "A Reference that identifies the policy the organization will enforce for this Consent.", 0, 1, reference);
548          case 116079: /*url*/  return new Property("url", "url", "A URL that links to a computable version of the policy the organization will enforce for this Consent.", 0, 1, url);
549          default: return super.getNamedProperty(_hash, _name, _checkValid);
550          }
551
552        }
553
554      @Override
555      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
556        switch (hash) {
557        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
558        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UrlType
559        default: return super.getProperty(hash, name, checkValid);
560        }
561
562      }
563
564      @Override
565      public Base setProperty(int hash, String name, Base value) throws FHIRException {
566        switch (hash) {
567        case -925155509: // reference
568          this.reference = TypeConvertor.castToReference(value); // Reference
569          return value;
570        case 116079: // url
571          this.url = TypeConvertor.castToUrl(value); // UrlType
572          return value;
573        default: return super.setProperty(hash, name, value);
574        }
575
576      }
577
578      @Override
579      public Base setProperty(String name, Base value) throws FHIRException {
580        if (name.equals("reference")) {
581          this.reference = TypeConvertor.castToReference(value); // Reference
582        } else if (name.equals("url")) {
583          this.url = TypeConvertor.castToUrl(value); // UrlType
584        } else
585          return super.setProperty(name, value);
586        return value;
587      }
588
589      @Override
590      public Base makeProperty(int hash, String name) throws FHIRException {
591        switch (hash) {
592        case -925155509:  return getReference();
593        case 116079:  return getUrlElement();
594        default: return super.makeProperty(hash, name);
595        }
596
597      }
598
599      @Override
600      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
601        switch (hash) {
602        case -925155509: /*reference*/ return new String[] {"Reference"};
603        case 116079: /*url*/ return new String[] {"url"};
604        default: return super.getTypesForProperty(hash, name);
605        }
606
607      }
608
609      @Override
610      public Base addChild(String name) throws FHIRException {
611        if (name.equals("reference")) {
612          this.reference = new Reference();
613          return this.reference;
614        }
615        else if (name.equals("url")) {
616          throw new FHIRException("Cannot call addChild on a primitive type Consent.policyBasis.url");
617        }
618        else
619          return super.addChild(name);
620      }
621
622      public ConsentPolicyBasisComponent copy() {
623        ConsentPolicyBasisComponent dst = new ConsentPolicyBasisComponent();
624        copyValues(dst);
625        return dst;
626      }
627
628      public void copyValues(ConsentPolicyBasisComponent dst) {
629        super.copyValues(dst);
630        dst.reference = reference == null ? null : reference.copy();
631        dst.url = url == null ? null : url.copy();
632      }
633
634      @Override
635      public boolean equalsDeep(Base other_) {
636        if (!super.equalsDeep(other_))
637          return false;
638        if (!(other_ instanceof ConsentPolicyBasisComponent))
639          return false;
640        ConsentPolicyBasisComponent o = (ConsentPolicyBasisComponent) other_;
641        return compareDeep(reference, o.reference, true) && compareDeep(url, o.url, true);
642      }
643
644      @Override
645      public boolean equalsShallow(Base other_) {
646        if (!super.equalsShallow(other_))
647          return false;
648        if (!(other_ instanceof ConsentPolicyBasisComponent))
649          return false;
650        ConsentPolicyBasisComponent o = (ConsentPolicyBasisComponent) other_;
651        return compareValues(url, o.url, true);
652      }
653
654      public boolean isEmpty() {
655        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(reference, url);
656      }
657
658  public String fhirType() {
659    return "Consent.policyBasis";
660
661  }
662
663  }
664
665    @Block()
666    public static class ConsentVerificationComponent extends BackboneElement implements IBaseBackboneElement {
667        /**
668         * Has the instruction been verified.
669         */
670        @Child(name = "verified", type = {BooleanType.class}, order=1, min=1, max=1, modifier=false, summary=true)
671        @Description(shortDefinition="Has been verified", formalDefinition="Has the instruction been verified." )
672        protected BooleanType verified;
673
674        /**
675         * Extensible list of verification type starting with verification and re-validation.
676         */
677        @Child(name = "verificationType", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
678        @Description(shortDefinition="Business case of verification", formalDefinition="Extensible list of verification type starting with verification and re-validation." )
679        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-verification")
680        protected CodeableConcept verificationType;
681
682        /**
683         * The person who conducted the verification/validation of the Grantor decision.
684         */
685        @Child(name = "verifiedBy", type = {Organization.class, Practitioner.class, PractitionerRole.class}, order=3, min=0, max=1, modifier=false, summary=false)
686        @Description(shortDefinition="Person conducting verification", formalDefinition="The person who conducted the verification/validation of the Grantor decision." )
687        protected Reference verifiedBy;
688
689        /**
690         * Who verified the instruction (Patient, Relative or other Authorized Person).
691         */
692        @Child(name = "verifiedWith", type = {Patient.class, RelatedPerson.class}, order=4, min=0, max=1, modifier=false, summary=false)
693        @Description(shortDefinition="Person who verified", formalDefinition="Who verified the instruction (Patient, Relative or other Authorized Person)." )
694        protected Reference verifiedWith;
695
696        /**
697         * Date(s) verification was collected.
698         */
699        @Child(name = "verificationDate", type = {DateTimeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
700        @Description(shortDefinition="When consent verified", formalDefinition="Date(s) verification was collected." )
701        protected List<DateTimeType> verificationDate;
702
703        private static final long serialVersionUID = -1266157329L;
704
705    /**
706     * Constructor
707     */
708      public ConsentVerificationComponent() {
709        super();
710      }
711
712    /**
713     * Constructor
714     */
715      public ConsentVerificationComponent(boolean verified) {
716        super();
717        this.setVerified(verified);
718      }
719
720        /**
721         * @return {@link #verified} (Has the instruction been verified.). This is the underlying object with id, value and extensions. The accessor "getVerified" gives direct access to the value
722         */
723        public BooleanType getVerifiedElement() { 
724          if (this.verified == null)
725            if (Configuration.errorOnAutoCreate())
726              throw new Error("Attempt to auto-create ConsentVerificationComponent.verified");
727            else if (Configuration.doAutoCreate())
728              this.verified = new BooleanType(); // bb
729          return this.verified;
730        }
731
732        public boolean hasVerifiedElement() { 
733          return this.verified != null && !this.verified.isEmpty();
734        }
735
736        public boolean hasVerified() { 
737          return this.verified != null && !this.verified.isEmpty();
738        }
739
740        /**
741         * @param value {@link #verified} (Has the instruction been verified.). This is the underlying object with id, value and extensions. The accessor "getVerified" gives direct access to the value
742         */
743        public ConsentVerificationComponent setVerifiedElement(BooleanType value) { 
744          this.verified = value;
745          return this;
746        }
747
748        /**
749         * @return Has the instruction been verified.
750         */
751        public boolean getVerified() { 
752          return this.verified == null || this.verified.isEmpty() ? false : this.verified.getValue();
753        }
754
755        /**
756         * @param value Has the instruction been verified.
757         */
758        public ConsentVerificationComponent setVerified(boolean value) { 
759            if (this.verified == null)
760              this.verified = new BooleanType();
761            this.verified.setValue(value);
762          return this;
763        }
764
765        /**
766         * @return {@link #verificationType} (Extensible list of verification type starting with verification and re-validation.)
767         */
768        public CodeableConcept getVerificationType() { 
769          if (this.verificationType == null)
770            if (Configuration.errorOnAutoCreate())
771              throw new Error("Attempt to auto-create ConsentVerificationComponent.verificationType");
772            else if (Configuration.doAutoCreate())
773              this.verificationType = new CodeableConcept(); // cc
774          return this.verificationType;
775        }
776
777        public boolean hasVerificationType() { 
778          return this.verificationType != null && !this.verificationType.isEmpty();
779        }
780
781        /**
782         * @param value {@link #verificationType} (Extensible list of verification type starting with verification and re-validation.)
783         */
784        public ConsentVerificationComponent setVerificationType(CodeableConcept value) { 
785          this.verificationType = value;
786          return this;
787        }
788
789        /**
790         * @return {@link #verifiedBy} (The person who conducted the verification/validation of the Grantor decision.)
791         */
792        public Reference getVerifiedBy() { 
793          if (this.verifiedBy == null)
794            if (Configuration.errorOnAutoCreate())
795              throw new Error("Attempt to auto-create ConsentVerificationComponent.verifiedBy");
796            else if (Configuration.doAutoCreate())
797              this.verifiedBy = new Reference(); // cc
798          return this.verifiedBy;
799        }
800
801        public boolean hasVerifiedBy() { 
802          return this.verifiedBy != null && !this.verifiedBy.isEmpty();
803        }
804
805        /**
806         * @param value {@link #verifiedBy} (The person who conducted the verification/validation of the Grantor decision.)
807         */
808        public ConsentVerificationComponent setVerifiedBy(Reference value) { 
809          this.verifiedBy = value;
810          return this;
811        }
812
813        /**
814         * @return {@link #verifiedWith} (Who verified the instruction (Patient, Relative or other Authorized Person).)
815         */
816        public Reference getVerifiedWith() { 
817          if (this.verifiedWith == null)
818            if (Configuration.errorOnAutoCreate())
819              throw new Error("Attempt to auto-create ConsentVerificationComponent.verifiedWith");
820            else if (Configuration.doAutoCreate())
821              this.verifiedWith = new Reference(); // cc
822          return this.verifiedWith;
823        }
824
825        public boolean hasVerifiedWith() { 
826          return this.verifiedWith != null && !this.verifiedWith.isEmpty();
827        }
828
829        /**
830         * @param value {@link #verifiedWith} (Who verified the instruction (Patient, Relative or other Authorized Person).)
831         */
832        public ConsentVerificationComponent setVerifiedWith(Reference value) { 
833          this.verifiedWith = value;
834          return this;
835        }
836
837        /**
838         * @return {@link #verificationDate} (Date(s) verification was collected.)
839         */
840        public List<DateTimeType> getVerificationDate() { 
841          if (this.verificationDate == null)
842            this.verificationDate = new ArrayList<DateTimeType>();
843          return this.verificationDate;
844        }
845
846        /**
847         * @return Returns a reference to <code>this</code> for easy method chaining
848         */
849        public ConsentVerificationComponent setVerificationDate(List<DateTimeType> theVerificationDate) { 
850          this.verificationDate = theVerificationDate;
851          return this;
852        }
853
854        public boolean hasVerificationDate() { 
855          if (this.verificationDate == null)
856            return false;
857          for (DateTimeType item : this.verificationDate)
858            if (!item.isEmpty())
859              return true;
860          return false;
861        }
862
863        /**
864         * @return {@link #verificationDate} (Date(s) verification was collected.)
865         */
866        public DateTimeType addVerificationDateElement() {//2 
867          DateTimeType t = new DateTimeType();
868          if (this.verificationDate == null)
869            this.verificationDate = new ArrayList<DateTimeType>();
870          this.verificationDate.add(t);
871          return t;
872        }
873
874        /**
875         * @param value {@link #verificationDate} (Date(s) verification was collected.)
876         */
877        public ConsentVerificationComponent addVerificationDate(Date value) { //1
878          DateTimeType t = new DateTimeType();
879          t.setValue(value);
880          if (this.verificationDate == null)
881            this.verificationDate = new ArrayList<DateTimeType>();
882          this.verificationDate.add(t);
883          return this;
884        }
885
886        /**
887         * @param value {@link #verificationDate} (Date(s) verification was collected.)
888         */
889        public boolean hasVerificationDate(Date value) { 
890          if (this.verificationDate == null)
891            return false;
892          for (DateTimeType v : this.verificationDate)
893            if (v.getValue().equals(value)) // dateTime
894              return true;
895          return false;
896        }
897
898        protected void listChildren(List<Property> children) {
899          super.listChildren(children);
900          children.add(new Property("verified", "boolean", "Has the instruction been verified.", 0, 1, verified));
901          children.add(new Property("verificationType", "CodeableConcept", "Extensible list of verification type starting with verification and re-validation.", 0, 1, verificationType));
902          children.add(new Property("verifiedBy", "Reference(Organization|Practitioner|PractitionerRole)", "The person who conducted the verification/validation of the Grantor decision.", 0, 1, verifiedBy));
903          children.add(new Property("verifiedWith", "Reference(Patient|RelatedPerson)", "Who verified the instruction (Patient, Relative or other Authorized Person).", 0, 1, verifiedWith));
904          children.add(new Property("verificationDate", "dateTime", "Date(s) verification was collected.", 0, java.lang.Integer.MAX_VALUE, verificationDate));
905        }
906
907        @Override
908        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
909          switch (_hash) {
910          case -1994383672: /*verified*/  return new Property("verified", "boolean", "Has the instruction been verified.", 0, 1, verified);
911          case 642733045: /*verificationType*/  return new Property("verificationType", "CodeableConcept", "Extensible list of verification type starting with verification and re-validation.", 0, 1, verificationType);
912          case -1047292609: /*verifiedBy*/  return new Property("verifiedBy", "Reference(Organization|Practitioner|PractitionerRole)", "The person who conducted the verification/validation of the Grantor decision.", 0, 1, verifiedBy);
913          case -1425236050: /*verifiedWith*/  return new Property("verifiedWith", "Reference(Patient|RelatedPerson)", "Who verified the instruction (Patient, Relative or other Authorized Person).", 0, 1, verifiedWith);
914          case 642233449: /*verificationDate*/  return new Property("verificationDate", "dateTime", "Date(s) verification was collected.", 0, java.lang.Integer.MAX_VALUE, verificationDate);
915          default: return super.getNamedProperty(_hash, _name, _checkValid);
916          }
917
918        }
919
920      @Override
921      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
922        switch (hash) {
923        case -1994383672: /*verified*/ return this.verified == null ? new Base[0] : new Base[] {this.verified}; // BooleanType
924        case 642733045: /*verificationType*/ return this.verificationType == null ? new Base[0] : new Base[] {this.verificationType}; // CodeableConcept
925        case -1047292609: /*verifiedBy*/ return this.verifiedBy == null ? new Base[0] : new Base[] {this.verifiedBy}; // Reference
926        case -1425236050: /*verifiedWith*/ return this.verifiedWith == null ? new Base[0] : new Base[] {this.verifiedWith}; // Reference
927        case 642233449: /*verificationDate*/ return this.verificationDate == null ? new Base[0] : this.verificationDate.toArray(new Base[this.verificationDate.size()]); // DateTimeType
928        default: return super.getProperty(hash, name, checkValid);
929        }
930
931      }
932
933      @Override
934      public Base setProperty(int hash, String name, Base value) throws FHIRException {
935        switch (hash) {
936        case -1994383672: // verified
937          this.verified = TypeConvertor.castToBoolean(value); // BooleanType
938          return value;
939        case 642733045: // verificationType
940          this.verificationType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
941          return value;
942        case -1047292609: // verifiedBy
943          this.verifiedBy = TypeConvertor.castToReference(value); // Reference
944          return value;
945        case -1425236050: // verifiedWith
946          this.verifiedWith = TypeConvertor.castToReference(value); // Reference
947          return value;
948        case 642233449: // verificationDate
949          this.getVerificationDate().add(TypeConvertor.castToDateTime(value)); // DateTimeType
950          return value;
951        default: return super.setProperty(hash, name, value);
952        }
953
954      }
955
956      @Override
957      public Base setProperty(String name, Base value) throws FHIRException {
958        if (name.equals("verified")) {
959          this.verified = TypeConvertor.castToBoolean(value); // BooleanType
960        } else if (name.equals("verificationType")) {
961          this.verificationType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
962        } else if (name.equals("verifiedBy")) {
963          this.verifiedBy = TypeConvertor.castToReference(value); // Reference
964        } else if (name.equals("verifiedWith")) {
965          this.verifiedWith = TypeConvertor.castToReference(value); // Reference
966        } else if (name.equals("verificationDate")) {
967          this.getVerificationDate().add(TypeConvertor.castToDateTime(value));
968        } else
969          return super.setProperty(name, value);
970        return value;
971      }
972
973      @Override
974      public Base makeProperty(int hash, String name) throws FHIRException {
975        switch (hash) {
976        case -1994383672:  return getVerifiedElement();
977        case 642733045:  return getVerificationType();
978        case -1047292609:  return getVerifiedBy();
979        case -1425236050:  return getVerifiedWith();
980        case 642233449:  return addVerificationDateElement();
981        default: return super.makeProperty(hash, name);
982        }
983
984      }
985
986      @Override
987      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
988        switch (hash) {
989        case -1994383672: /*verified*/ return new String[] {"boolean"};
990        case 642733045: /*verificationType*/ return new String[] {"CodeableConcept"};
991        case -1047292609: /*verifiedBy*/ return new String[] {"Reference"};
992        case -1425236050: /*verifiedWith*/ return new String[] {"Reference"};
993        case 642233449: /*verificationDate*/ return new String[] {"dateTime"};
994        default: return super.getTypesForProperty(hash, name);
995        }
996
997      }
998
999      @Override
1000      public Base addChild(String name) throws FHIRException {
1001        if (name.equals("verified")) {
1002          throw new FHIRException("Cannot call addChild on a primitive type Consent.verification.verified");
1003        }
1004        else if (name.equals("verificationType")) {
1005          this.verificationType = new CodeableConcept();
1006          return this.verificationType;
1007        }
1008        else if (name.equals("verifiedBy")) {
1009          this.verifiedBy = new Reference();
1010          return this.verifiedBy;
1011        }
1012        else if (name.equals("verifiedWith")) {
1013          this.verifiedWith = new Reference();
1014          return this.verifiedWith;
1015        }
1016        else if (name.equals("verificationDate")) {
1017          throw new FHIRException("Cannot call addChild on a primitive type Consent.verification.verificationDate");
1018        }
1019        else
1020          return super.addChild(name);
1021      }
1022
1023      public ConsentVerificationComponent copy() {
1024        ConsentVerificationComponent dst = new ConsentVerificationComponent();
1025        copyValues(dst);
1026        return dst;
1027      }
1028
1029      public void copyValues(ConsentVerificationComponent dst) {
1030        super.copyValues(dst);
1031        dst.verified = verified == null ? null : verified.copy();
1032        dst.verificationType = verificationType == null ? null : verificationType.copy();
1033        dst.verifiedBy = verifiedBy == null ? null : verifiedBy.copy();
1034        dst.verifiedWith = verifiedWith == null ? null : verifiedWith.copy();
1035        if (verificationDate != null) {
1036          dst.verificationDate = new ArrayList<DateTimeType>();
1037          for (DateTimeType i : verificationDate)
1038            dst.verificationDate.add(i.copy());
1039        };
1040      }
1041
1042      @Override
1043      public boolean equalsDeep(Base other_) {
1044        if (!super.equalsDeep(other_))
1045          return false;
1046        if (!(other_ instanceof ConsentVerificationComponent))
1047          return false;
1048        ConsentVerificationComponent o = (ConsentVerificationComponent) other_;
1049        return compareDeep(verified, o.verified, true) && compareDeep(verificationType, o.verificationType, true)
1050           && compareDeep(verifiedBy, o.verifiedBy, true) && compareDeep(verifiedWith, o.verifiedWith, true)
1051           && compareDeep(verificationDate, o.verificationDate, true);
1052      }
1053
1054      @Override
1055      public boolean equalsShallow(Base other_) {
1056        if (!super.equalsShallow(other_))
1057          return false;
1058        if (!(other_ instanceof ConsentVerificationComponent))
1059          return false;
1060        ConsentVerificationComponent o = (ConsentVerificationComponent) other_;
1061        return compareValues(verified, o.verified, true) && compareValues(verificationDate, o.verificationDate, true)
1062          ;
1063      }
1064
1065      public boolean isEmpty() {
1066        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(verified, verificationType
1067          , verifiedBy, verifiedWith, verificationDate);
1068      }
1069
1070  public String fhirType() {
1071    return "Consent.verification";
1072
1073  }
1074
1075  }
1076
1077    @Block()
1078    public static class ProvisionComponent extends BackboneElement implements IBaseBackboneElement {
1079        /**
1080         * Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules.
1081         */
1082        @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true)
1083        @Description(shortDefinition="deny | permit", formalDefinition="Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules." )
1084        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-provision-type")
1085        protected Enumeration<ConsentProvisionType> type;
1086
1087        /**
1088         * The timeframe in this rule is valid.
1089         */
1090        @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true)
1091        @Description(shortDefinition="Timeframe for this rule", formalDefinition="The timeframe in this rule is valid." )
1092        protected Period period;
1093
1094        /**
1095         * Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers').
1096         */
1097        @Child(name = "actor", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1098        @Description(shortDefinition="Who|what controlled by this rule (or group, by role)", formalDefinition="Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers')." )
1099        protected List<ProvisionActorComponent> actor;
1100
1101        /**
1102         * Actions controlled by this Rule.
1103         */
1104        @Child(name = "action", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1105        @Description(shortDefinition="Actions controlled by this rule", formalDefinition="Actions controlled by this Rule." )
1106        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-action")
1107        protected List<CodeableConcept> action;
1108
1109        /**
1110         * A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception.
1111         */
1112        @Child(name = "securityLabel", type = {Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1113        @Description(shortDefinition="Security Labels that define affected resources", formalDefinition="A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception." )
1114        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/security-label-examples")
1115        protected List<Coding> securityLabel;
1116
1117        /**
1118         * The context of the activities a user is taking - why the user is accessing the data - that are controlled by this rule.
1119         */
1120        @Child(name = "purpose", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1121        @Description(shortDefinition="Context of activities covered by this rule", formalDefinition="The context of the activities a user is taking - why the user is accessing the data - that are controlled by this rule." )
1122        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-PurposeOfUse")
1123        protected List<Coding> purpose;
1124
1125        /**
1126         * The class of information covered by this rule. The type can be a FHIR resource type, a profile on a type, or a CDA document, or some other type that indicates what sort of information the consent relates to.
1127         */
1128        @Child(name = "class", type = {Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1129        @Description(shortDefinition="e.g. Resource Type, Profile, CDA, etc.", formalDefinition="The class of information covered by this rule. The type can be a FHIR resource type, a profile on a type, or a CDA document, or some other type that indicates what sort of information the consent relates to." )
1130        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-content-class")
1131        protected List<Coding> class_;
1132
1133        /**
1134         * If this code is found in an instance, then the rule applies.
1135         */
1136        @Child(name = "code", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1137        @Description(shortDefinition="e.g. LOINC or SNOMED CT code, etc. in the content", formalDefinition="If this code is found in an instance, then the rule applies." )
1138        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-content-code")
1139        protected List<CodeableConcept> code;
1140
1141        /**
1142         * Clinical or Operational Relevant period of time that bounds the data controlled by this rule.
1143         */
1144        @Child(name = "dataPeriod", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=true)
1145        @Description(shortDefinition="Timeframe for data controlled by this rule", formalDefinition="Clinical or Operational Relevant period of time that bounds the data controlled by this rule." )
1146        protected Period dataPeriod;
1147
1148        /**
1149         * The resources controlled by this rule if specific resources are referenced.
1150         */
1151        @Child(name = "data", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1152        @Description(shortDefinition="Data controlled by this rule", formalDefinition="The resources controlled by this rule if specific resources are referenced." )
1153        protected List<ProvisionDataComponent> data;
1154
1155        /**
1156         * A computable (FHIRPath or other) definition of what is controlled by this consent.
1157         */
1158        @Child(name = "expression", type = {Expression.class}, order=11, min=0, max=1, modifier=false, summary=false)
1159        @Description(shortDefinition="A computable expression of the consent", formalDefinition="A computable (FHIRPath or other) definition of what is controlled by this consent." )
1160        protected Expression expression;
1161
1162        /**
1163         * Rules which provide exceptions to the base rule or subrules.
1164         */
1165        @Child(name = "provision", type = {ProvisionComponent.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1166        @Description(shortDefinition="Nested Exception Rules", formalDefinition="Rules which provide exceptions to the base rule or subrules." )
1167        protected List<ProvisionComponent> provision;
1168
1169        private static final long serialVersionUID = 649023539L;
1170
1171    /**
1172     * Constructor
1173     */
1174      public ProvisionComponent() {
1175        super();
1176      }
1177
1178        /**
1179         * @return {@link #type} (Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1180         */
1181        public Enumeration<ConsentProvisionType> getTypeElement() { 
1182          if (this.type == null)
1183            if (Configuration.errorOnAutoCreate())
1184              throw new Error("Attempt to auto-create ProvisionComponent.type");
1185            else if (Configuration.doAutoCreate())
1186              this.type = new Enumeration<ConsentProvisionType>(new ConsentProvisionTypeEnumFactory()); // bb
1187          return this.type;
1188        }
1189
1190        public boolean hasTypeElement() { 
1191          return this.type != null && !this.type.isEmpty();
1192        }
1193
1194        public boolean hasType() { 
1195          return this.type != null && !this.type.isEmpty();
1196        }
1197
1198        /**
1199         * @param value {@link #type} (Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1200         */
1201        public ProvisionComponent setTypeElement(Enumeration<ConsentProvisionType> value) { 
1202          this.type = value;
1203          return this;
1204        }
1205
1206        /**
1207         * @return Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules.
1208         */
1209        public ConsentProvisionType getType() { 
1210          return this.type == null ? null : this.type.getValue();
1211        }
1212
1213        /**
1214         * @param value Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules.
1215         */
1216        public ProvisionComponent setType(ConsentProvisionType value) { 
1217          if (value == null)
1218            this.type = null;
1219          else {
1220            if (this.type == null)
1221              this.type = new Enumeration<ConsentProvisionType>(new ConsentProvisionTypeEnumFactory());
1222            this.type.setValue(value);
1223          }
1224          return this;
1225        }
1226
1227        /**
1228         * @return {@link #period} (The timeframe in this rule is valid.)
1229         */
1230        public Period getPeriod() { 
1231          if (this.period == null)
1232            if (Configuration.errorOnAutoCreate())
1233              throw new Error("Attempt to auto-create ProvisionComponent.period");
1234            else if (Configuration.doAutoCreate())
1235              this.period = new Period(); // cc
1236          return this.period;
1237        }
1238
1239        public boolean hasPeriod() { 
1240          return this.period != null && !this.period.isEmpty();
1241        }
1242
1243        /**
1244         * @param value {@link #period} (The timeframe in this rule is valid.)
1245         */
1246        public ProvisionComponent setPeriod(Period value) { 
1247          this.period = value;
1248          return this;
1249        }
1250
1251        /**
1252         * @return {@link #actor} (Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers').)
1253         */
1254        public List<ProvisionActorComponent> getActor() { 
1255          if (this.actor == null)
1256            this.actor = new ArrayList<ProvisionActorComponent>();
1257          return this.actor;
1258        }
1259
1260        /**
1261         * @return Returns a reference to <code>this</code> for easy method chaining
1262         */
1263        public ProvisionComponent setActor(List<ProvisionActorComponent> theActor) { 
1264          this.actor = theActor;
1265          return this;
1266        }
1267
1268        public boolean hasActor() { 
1269          if (this.actor == null)
1270            return false;
1271          for (ProvisionActorComponent item : this.actor)
1272            if (!item.isEmpty())
1273              return true;
1274          return false;
1275        }
1276
1277        public ProvisionActorComponent addActor() { //3
1278          ProvisionActorComponent t = new ProvisionActorComponent();
1279          if (this.actor == null)
1280            this.actor = new ArrayList<ProvisionActorComponent>();
1281          this.actor.add(t);
1282          return t;
1283        }
1284
1285        public ProvisionComponent addActor(ProvisionActorComponent t) { //3
1286          if (t == null)
1287            return this;
1288          if (this.actor == null)
1289            this.actor = new ArrayList<ProvisionActorComponent>();
1290          this.actor.add(t);
1291          return this;
1292        }
1293
1294        /**
1295         * @return The first repetition of repeating field {@link #actor}, creating it if it does not already exist {3}
1296         */
1297        public ProvisionActorComponent getActorFirstRep() { 
1298          if (getActor().isEmpty()) {
1299            addActor();
1300          }
1301          return getActor().get(0);
1302        }
1303
1304        /**
1305         * @return {@link #action} (Actions controlled by this Rule.)
1306         */
1307        public List<CodeableConcept> getAction() { 
1308          if (this.action == null)
1309            this.action = new ArrayList<CodeableConcept>();
1310          return this.action;
1311        }
1312
1313        /**
1314         * @return Returns a reference to <code>this</code> for easy method chaining
1315         */
1316        public ProvisionComponent setAction(List<CodeableConcept> theAction) { 
1317          this.action = theAction;
1318          return this;
1319        }
1320
1321        public boolean hasAction() { 
1322          if (this.action == null)
1323            return false;
1324          for (CodeableConcept item : this.action)
1325            if (!item.isEmpty())
1326              return true;
1327          return false;
1328        }
1329
1330        public CodeableConcept addAction() { //3
1331          CodeableConcept t = new CodeableConcept();
1332          if (this.action == null)
1333            this.action = new ArrayList<CodeableConcept>();
1334          this.action.add(t);
1335          return t;
1336        }
1337
1338        public ProvisionComponent addAction(CodeableConcept t) { //3
1339          if (t == null)
1340            return this;
1341          if (this.action == null)
1342            this.action = new ArrayList<CodeableConcept>();
1343          this.action.add(t);
1344          return this;
1345        }
1346
1347        /**
1348         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist {3}
1349         */
1350        public CodeableConcept getActionFirstRep() { 
1351          if (getAction().isEmpty()) {
1352            addAction();
1353          }
1354          return getAction().get(0);
1355        }
1356
1357        /**
1358         * @return {@link #securityLabel} (A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception.)
1359         */
1360        public List<Coding> getSecurityLabel() { 
1361          if (this.securityLabel == null)
1362            this.securityLabel = new ArrayList<Coding>();
1363          return this.securityLabel;
1364        }
1365
1366        /**
1367         * @return Returns a reference to <code>this</code> for easy method chaining
1368         */
1369        public ProvisionComponent setSecurityLabel(List<Coding> theSecurityLabel) { 
1370          this.securityLabel = theSecurityLabel;
1371          return this;
1372        }
1373
1374        public boolean hasSecurityLabel() { 
1375          if (this.securityLabel == null)
1376            return false;
1377          for (Coding item : this.securityLabel)
1378            if (!item.isEmpty())
1379              return true;
1380          return false;
1381        }
1382
1383        public Coding addSecurityLabel() { //3
1384          Coding t = new Coding();
1385          if (this.securityLabel == null)
1386            this.securityLabel = new ArrayList<Coding>();
1387          this.securityLabel.add(t);
1388          return t;
1389        }
1390
1391        public ProvisionComponent addSecurityLabel(Coding t) { //3
1392          if (t == null)
1393            return this;
1394          if (this.securityLabel == null)
1395            this.securityLabel = new ArrayList<Coding>();
1396          this.securityLabel.add(t);
1397          return this;
1398        }
1399
1400        /**
1401         * @return The first repetition of repeating field {@link #securityLabel}, creating it if it does not already exist {3}
1402         */
1403        public Coding getSecurityLabelFirstRep() { 
1404          if (getSecurityLabel().isEmpty()) {
1405            addSecurityLabel();
1406          }
1407          return getSecurityLabel().get(0);
1408        }
1409
1410        /**
1411         * @return {@link #purpose} (The context of the activities a user is taking - why the user is accessing the data - that are controlled by this rule.)
1412         */
1413        public List<Coding> getPurpose() { 
1414          if (this.purpose == null)
1415            this.purpose = new ArrayList<Coding>();
1416          return this.purpose;
1417        }
1418
1419        /**
1420         * @return Returns a reference to <code>this</code> for easy method chaining
1421         */
1422        public ProvisionComponent setPurpose(List<Coding> thePurpose) { 
1423          this.purpose = thePurpose;
1424          return this;
1425        }
1426
1427        public boolean hasPurpose() { 
1428          if (this.purpose == null)
1429            return false;
1430          for (Coding item : this.purpose)
1431            if (!item.isEmpty())
1432              return true;
1433          return false;
1434        }
1435
1436        public Coding addPurpose() { //3
1437          Coding t = new Coding();
1438          if (this.purpose == null)
1439            this.purpose = new ArrayList<Coding>();
1440          this.purpose.add(t);
1441          return t;
1442        }
1443
1444        public ProvisionComponent addPurpose(Coding t) { //3
1445          if (t == null)
1446            return this;
1447          if (this.purpose == null)
1448            this.purpose = new ArrayList<Coding>();
1449          this.purpose.add(t);
1450          return this;
1451        }
1452
1453        /**
1454         * @return The first repetition of repeating field {@link #purpose}, creating it if it does not already exist {3}
1455         */
1456        public Coding getPurposeFirstRep() { 
1457          if (getPurpose().isEmpty()) {
1458            addPurpose();
1459          }
1460          return getPurpose().get(0);
1461        }
1462
1463        /**
1464         * @return {@link #class_} (The class of information covered by this rule. The type can be a FHIR resource type, a profile on a type, or a CDA document, or some other type that indicates what sort of information the consent relates to.)
1465         */
1466        public List<Coding> getClass_() { 
1467          if (this.class_ == null)
1468            this.class_ = new ArrayList<Coding>();
1469          return this.class_;
1470        }
1471
1472        /**
1473         * @return Returns a reference to <code>this</code> for easy method chaining
1474         */
1475        public ProvisionComponent setClass_(List<Coding> theClass_) { 
1476          this.class_ = theClass_;
1477          return this;
1478        }
1479
1480        public boolean hasClass_() { 
1481          if (this.class_ == null)
1482            return false;
1483          for (Coding item : this.class_)
1484            if (!item.isEmpty())
1485              return true;
1486          return false;
1487        }
1488
1489        public Coding addClass_() { //3
1490          Coding t = new Coding();
1491          if (this.class_ == null)
1492            this.class_ = new ArrayList<Coding>();
1493          this.class_.add(t);
1494          return t;
1495        }
1496
1497        public ProvisionComponent addClass_(Coding t) { //3
1498          if (t == null)
1499            return this;
1500          if (this.class_ == null)
1501            this.class_ = new ArrayList<Coding>();
1502          this.class_.add(t);
1503          return this;
1504        }
1505
1506        /**
1507         * @return The first repetition of repeating field {@link #class_}, creating it if it does not already exist {3}
1508         */
1509        public Coding getClass_FirstRep() { 
1510          if (getClass_().isEmpty()) {
1511            addClass_();
1512          }
1513          return getClass_().get(0);
1514        }
1515
1516        /**
1517         * @return {@link #code} (If this code is found in an instance, then the rule applies.)
1518         */
1519        public List<CodeableConcept> getCode() { 
1520          if (this.code == null)
1521            this.code = new ArrayList<CodeableConcept>();
1522          return this.code;
1523        }
1524
1525        /**
1526         * @return Returns a reference to <code>this</code> for easy method chaining
1527         */
1528        public ProvisionComponent setCode(List<CodeableConcept> theCode) { 
1529          this.code = theCode;
1530          return this;
1531        }
1532
1533        public boolean hasCode() { 
1534          if (this.code == null)
1535            return false;
1536          for (CodeableConcept item : this.code)
1537            if (!item.isEmpty())
1538              return true;
1539          return false;
1540        }
1541
1542        public CodeableConcept addCode() { //3
1543          CodeableConcept t = new CodeableConcept();
1544          if (this.code == null)
1545            this.code = new ArrayList<CodeableConcept>();
1546          this.code.add(t);
1547          return t;
1548        }
1549
1550        public ProvisionComponent addCode(CodeableConcept t) { //3
1551          if (t == null)
1552            return this;
1553          if (this.code == null)
1554            this.code = new ArrayList<CodeableConcept>();
1555          this.code.add(t);
1556          return this;
1557        }
1558
1559        /**
1560         * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist {3}
1561         */
1562        public CodeableConcept getCodeFirstRep() { 
1563          if (getCode().isEmpty()) {
1564            addCode();
1565          }
1566          return getCode().get(0);
1567        }
1568
1569        /**
1570         * @return {@link #dataPeriod} (Clinical or Operational Relevant period of time that bounds the data controlled by this rule.)
1571         */
1572        public Period getDataPeriod() { 
1573          if (this.dataPeriod == null)
1574            if (Configuration.errorOnAutoCreate())
1575              throw new Error("Attempt to auto-create ProvisionComponent.dataPeriod");
1576            else if (Configuration.doAutoCreate())
1577              this.dataPeriod = new Period(); // cc
1578          return this.dataPeriod;
1579        }
1580
1581        public boolean hasDataPeriod() { 
1582          return this.dataPeriod != null && !this.dataPeriod.isEmpty();
1583        }
1584
1585        /**
1586         * @param value {@link #dataPeriod} (Clinical or Operational Relevant period of time that bounds the data controlled by this rule.)
1587         */
1588        public ProvisionComponent setDataPeriod(Period value) { 
1589          this.dataPeriod = value;
1590          return this;
1591        }
1592
1593        /**
1594         * @return {@link #data} (The resources controlled by this rule if specific resources are referenced.)
1595         */
1596        public List<ProvisionDataComponent> getData() { 
1597          if (this.data == null)
1598            this.data = new ArrayList<ProvisionDataComponent>();
1599          return this.data;
1600        }
1601
1602        /**
1603         * @return Returns a reference to <code>this</code> for easy method chaining
1604         */
1605        public ProvisionComponent setData(List<ProvisionDataComponent> theData) { 
1606          this.data = theData;
1607          return this;
1608        }
1609
1610        public boolean hasData() { 
1611          if (this.data == null)
1612            return false;
1613          for (ProvisionDataComponent item : this.data)
1614            if (!item.isEmpty())
1615              return true;
1616          return false;
1617        }
1618
1619        public ProvisionDataComponent addData() { //3
1620          ProvisionDataComponent t = new ProvisionDataComponent();
1621          if (this.data == null)
1622            this.data = new ArrayList<ProvisionDataComponent>();
1623          this.data.add(t);
1624          return t;
1625        }
1626
1627        public ProvisionComponent addData(ProvisionDataComponent t) { //3
1628          if (t == null)
1629            return this;
1630          if (this.data == null)
1631            this.data = new ArrayList<ProvisionDataComponent>();
1632          this.data.add(t);
1633          return this;
1634        }
1635
1636        /**
1637         * @return The first repetition of repeating field {@link #data}, creating it if it does not already exist {3}
1638         */
1639        public ProvisionDataComponent getDataFirstRep() { 
1640          if (getData().isEmpty()) {
1641            addData();
1642          }
1643          return getData().get(0);
1644        }
1645
1646        /**
1647         * @return {@link #expression} (A computable (FHIRPath or other) definition of what is controlled by this consent.)
1648         */
1649        public Expression getExpression() { 
1650          if (this.expression == null)
1651            if (Configuration.errorOnAutoCreate())
1652              throw new Error("Attempt to auto-create ProvisionComponent.expression");
1653            else if (Configuration.doAutoCreate())
1654              this.expression = new Expression(); // cc
1655          return this.expression;
1656        }
1657
1658        public boolean hasExpression() { 
1659          return this.expression != null && !this.expression.isEmpty();
1660        }
1661
1662        /**
1663         * @param value {@link #expression} (A computable (FHIRPath or other) definition of what is controlled by this consent.)
1664         */
1665        public ProvisionComponent setExpression(Expression value) { 
1666          this.expression = value;
1667          return this;
1668        }
1669
1670        /**
1671         * @return {@link #provision} (Rules which provide exceptions to the base rule or subrules.)
1672         */
1673        public List<ProvisionComponent> getProvision() { 
1674          if (this.provision == null)
1675            this.provision = new ArrayList<ProvisionComponent>();
1676          return this.provision;
1677        }
1678
1679        /**
1680         * @return Returns a reference to <code>this</code> for easy method chaining
1681         */
1682        public ProvisionComponent setProvision(List<ProvisionComponent> theProvision) { 
1683          this.provision = theProvision;
1684          return this;
1685        }
1686
1687        public boolean hasProvision() { 
1688          if (this.provision == null)
1689            return false;
1690          for (ProvisionComponent item : this.provision)
1691            if (!item.isEmpty())
1692              return true;
1693          return false;
1694        }
1695
1696        public ProvisionComponent addProvision() { //3
1697          ProvisionComponent t = new ProvisionComponent();
1698          if (this.provision == null)
1699            this.provision = new ArrayList<ProvisionComponent>();
1700          this.provision.add(t);
1701          return t;
1702        }
1703
1704        public ProvisionComponent addProvision(ProvisionComponent t) { //3
1705          if (t == null)
1706            return this;
1707          if (this.provision == null)
1708            this.provision = new ArrayList<ProvisionComponent>();
1709          this.provision.add(t);
1710          return this;
1711        }
1712
1713        /**
1714         * @return The first repetition of repeating field {@link #provision}, creating it if it does not already exist {3}
1715         */
1716        public ProvisionComponent getProvisionFirstRep() { 
1717          if (getProvision().isEmpty()) {
1718            addProvision();
1719          }
1720          return getProvision().get(0);
1721        }
1722
1723        protected void listChildren(List<Property> children) {
1724          super.listChildren(children);
1725          children.add(new Property("type", "code", "Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules.", 0, 1, type));
1726          children.add(new Property("period", "Period", "The timeframe in this rule is valid.", 0, 1, period));
1727          children.add(new Property("actor", "", "Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers').", 0, java.lang.Integer.MAX_VALUE, actor));
1728          children.add(new Property("action", "CodeableConcept", "Actions controlled by this Rule.", 0, java.lang.Integer.MAX_VALUE, action));
1729          children.add(new Property("securityLabel", "Coding", "A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception.", 0, java.lang.Integer.MAX_VALUE, securityLabel));
1730          children.add(new Property("purpose", "Coding", "The context of the activities a user is taking - why the user is accessing the data - that are controlled by this rule.", 0, java.lang.Integer.MAX_VALUE, purpose));
1731          children.add(new Property("class", "Coding", "The class of information covered by this rule. The type can be a FHIR resource type, a profile on a type, or a CDA document, or some other type that indicates what sort of information the consent relates to.", 0, java.lang.Integer.MAX_VALUE, class_));
1732          children.add(new Property("code", "CodeableConcept", "If this code is found in an instance, then the rule applies.", 0, java.lang.Integer.MAX_VALUE, code));
1733          children.add(new Property("dataPeriod", "Period", "Clinical or Operational Relevant period of time that bounds the data controlled by this rule.", 0, 1, dataPeriod));
1734          children.add(new Property("data", "", "The resources controlled by this rule if specific resources are referenced.", 0, java.lang.Integer.MAX_VALUE, data));
1735          children.add(new Property("expression", "Expression", "A computable (FHIRPath or other) definition of what is controlled by this consent.", 0, 1, expression));
1736          children.add(new Property("provision", "@Consent.provision", "Rules which provide exceptions to the base rule or subrules.", 0, java.lang.Integer.MAX_VALUE, provision));
1737        }
1738
1739        @Override
1740        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1741          switch (_hash) {
1742          case 3575610: /*type*/  return new Property("type", "code", "Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules.", 0, 1, type);
1743          case -991726143: /*period*/  return new Property("period", "Period", "The timeframe in this rule is valid.", 0, 1, period);
1744          case 92645877: /*actor*/  return new Property("actor", "", "Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers').", 0, java.lang.Integer.MAX_VALUE, actor);
1745          case -1422950858: /*action*/  return new Property("action", "CodeableConcept", "Actions controlled by this Rule.", 0, java.lang.Integer.MAX_VALUE, action);
1746          case -722296940: /*securityLabel*/  return new Property("securityLabel", "Coding", "A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception.", 0, java.lang.Integer.MAX_VALUE, securityLabel);
1747          case -220463842: /*purpose*/  return new Property("purpose", "Coding", "The context of the activities a user is taking - why the user is accessing the data - that are controlled by this rule.", 0, java.lang.Integer.MAX_VALUE, purpose);
1748          case 94742904: /*class*/  return new Property("class", "Coding", "The class of information covered by this rule. The type can be a FHIR resource type, a profile on a type, or a CDA document, or some other type that indicates what sort of information the consent relates to.", 0, java.lang.Integer.MAX_VALUE, class_);
1749          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "If this code is found in an instance, then the rule applies.", 0, java.lang.Integer.MAX_VALUE, code);
1750          case 1177250315: /*dataPeriod*/  return new Property("dataPeriod", "Period", "Clinical or Operational Relevant period of time that bounds the data controlled by this rule.", 0, 1, dataPeriod);
1751          case 3076010: /*data*/  return new Property("data", "", "The resources controlled by this rule if specific resources are referenced.", 0, java.lang.Integer.MAX_VALUE, data);
1752          case -1795452264: /*expression*/  return new Property("expression", "Expression", "A computable (FHIRPath or other) definition of what is controlled by this consent.", 0, 1, expression);
1753          case -547120939: /*provision*/  return new Property("provision", "@Consent.provision", "Rules which provide exceptions to the base rule or subrules.", 0, java.lang.Integer.MAX_VALUE, provision);
1754          default: return super.getNamedProperty(_hash, _name, _checkValid);
1755          }
1756
1757        }
1758
1759      @Override
1760      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1761        switch (hash) {
1762        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<ConsentProvisionType>
1763        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1764        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : this.actor.toArray(new Base[this.actor.size()]); // ProvisionActorComponent
1765        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // CodeableConcept
1766        case -722296940: /*securityLabel*/ return this.securityLabel == null ? new Base[0] : this.securityLabel.toArray(new Base[this.securityLabel.size()]); // Coding
1767        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : this.purpose.toArray(new Base[this.purpose.size()]); // Coding
1768        case 94742904: /*class*/ return this.class_ == null ? new Base[0] : this.class_.toArray(new Base[this.class_.size()]); // Coding
1769        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept
1770        case 1177250315: /*dataPeriod*/ return this.dataPeriod == null ? new Base[0] : new Base[] {this.dataPeriod}; // Period
1771        case 3076010: /*data*/ return this.data == null ? new Base[0] : this.data.toArray(new Base[this.data.size()]); // ProvisionDataComponent
1772        case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // Expression
1773        case -547120939: /*provision*/ return this.provision == null ? new Base[0] : this.provision.toArray(new Base[this.provision.size()]); // ProvisionComponent
1774        default: return super.getProperty(hash, name, checkValid);
1775        }
1776
1777      }
1778
1779      @Override
1780      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1781        switch (hash) {
1782        case 3575610: // type
1783          value = new ConsentProvisionTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1784          this.type = (Enumeration) value; // Enumeration<ConsentProvisionType>
1785          return value;
1786        case -991726143: // period
1787          this.period = TypeConvertor.castToPeriod(value); // Period
1788          return value;
1789        case 92645877: // actor
1790          this.getActor().add((ProvisionActorComponent) value); // ProvisionActorComponent
1791          return value;
1792        case -1422950858: // action
1793          this.getAction().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1794          return value;
1795        case -722296940: // securityLabel
1796          this.getSecurityLabel().add(TypeConvertor.castToCoding(value)); // Coding
1797          return value;
1798        case -220463842: // purpose
1799          this.getPurpose().add(TypeConvertor.castToCoding(value)); // Coding
1800          return value;
1801        case 94742904: // class
1802          this.getClass_().add(TypeConvertor.castToCoding(value)); // Coding
1803          return value;
1804        case 3059181: // code
1805          this.getCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1806          return value;
1807        case 1177250315: // dataPeriod
1808          this.dataPeriod = TypeConvertor.castToPeriod(value); // Period
1809          return value;
1810        case 3076010: // data
1811          this.getData().add((ProvisionDataComponent) value); // ProvisionDataComponent
1812          return value;
1813        case -1795452264: // expression
1814          this.expression = TypeConvertor.castToExpression(value); // Expression
1815          return value;
1816        case -547120939: // provision
1817          this.getProvision().add((ProvisionComponent) value); // ProvisionComponent
1818          return value;
1819        default: return super.setProperty(hash, name, value);
1820        }
1821
1822      }
1823
1824      @Override
1825      public Base setProperty(String name, Base value) throws FHIRException {
1826        if (name.equals("type")) {
1827          value = new ConsentProvisionTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1828          this.type = (Enumeration) value; // Enumeration<ConsentProvisionType>
1829        } else if (name.equals("period")) {
1830          this.period = TypeConvertor.castToPeriod(value); // Period
1831        } else if (name.equals("actor")) {
1832          this.getActor().add((ProvisionActorComponent) value);
1833        } else if (name.equals("action")) {
1834          this.getAction().add(TypeConvertor.castToCodeableConcept(value));
1835        } else if (name.equals("securityLabel")) {
1836          this.getSecurityLabel().add(TypeConvertor.castToCoding(value));
1837        } else if (name.equals("purpose")) {
1838          this.getPurpose().add(TypeConvertor.castToCoding(value));
1839        } else if (name.equals("class")) {
1840          this.getClass_().add(TypeConvertor.castToCoding(value));
1841        } else if (name.equals("code")) {
1842          this.getCode().add(TypeConvertor.castToCodeableConcept(value));
1843        } else if (name.equals("dataPeriod")) {
1844          this.dataPeriod = TypeConvertor.castToPeriod(value); // Period
1845        } else if (name.equals("data")) {
1846          this.getData().add((ProvisionDataComponent) value);
1847        } else if (name.equals("expression")) {
1848          this.expression = TypeConvertor.castToExpression(value); // Expression
1849        } else if (name.equals("provision")) {
1850          this.getProvision().add((ProvisionComponent) value);
1851        } else
1852          return super.setProperty(name, value);
1853        return value;
1854      }
1855
1856      @Override
1857      public Base makeProperty(int hash, String name) throws FHIRException {
1858        switch (hash) {
1859        case 3575610:  return getTypeElement();
1860        case -991726143:  return getPeriod();
1861        case 92645877:  return addActor(); 
1862        case -1422950858:  return addAction(); 
1863        case -722296940:  return addSecurityLabel(); 
1864        case -220463842:  return addPurpose(); 
1865        case 94742904:  return addClass_(); 
1866        case 3059181:  return addCode(); 
1867        case 1177250315:  return getDataPeriod();
1868        case 3076010:  return addData(); 
1869        case -1795452264:  return getExpression();
1870        case -547120939:  return addProvision(); 
1871        default: return super.makeProperty(hash, name);
1872        }
1873
1874      }
1875
1876      @Override
1877      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1878        switch (hash) {
1879        case 3575610: /*type*/ return new String[] {"code"};
1880        case -991726143: /*period*/ return new String[] {"Period"};
1881        case 92645877: /*actor*/ return new String[] {};
1882        case -1422950858: /*action*/ return new String[] {"CodeableConcept"};
1883        case -722296940: /*securityLabel*/ return new String[] {"Coding"};
1884        case -220463842: /*purpose*/ return new String[] {"Coding"};
1885        case 94742904: /*class*/ return new String[] {"Coding"};
1886        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1887        case 1177250315: /*dataPeriod*/ return new String[] {"Period"};
1888        case 3076010: /*data*/ return new String[] {};
1889        case -1795452264: /*expression*/ return new String[] {"Expression"};
1890        case -547120939: /*provision*/ return new String[] {"@Consent.provision"};
1891        default: return super.getTypesForProperty(hash, name);
1892        }
1893
1894      }
1895
1896      @Override
1897      public Base addChild(String name) throws FHIRException {
1898        if (name.equals("type")) {
1899          throw new FHIRException("Cannot call addChild on a primitive type Consent.provision.type");
1900        }
1901        else if (name.equals("period")) {
1902          this.period = new Period();
1903          return this.period;
1904        }
1905        else if (name.equals("actor")) {
1906          return addActor();
1907        }
1908        else if (name.equals("action")) {
1909          return addAction();
1910        }
1911        else if (name.equals("securityLabel")) {
1912          return addSecurityLabel();
1913        }
1914        else if (name.equals("purpose")) {
1915          return addPurpose();
1916        }
1917        else if (name.equals("class")) {
1918          return addClass_();
1919        }
1920        else if (name.equals("code")) {
1921          return addCode();
1922        }
1923        else if (name.equals("dataPeriod")) {
1924          this.dataPeriod = new Period();
1925          return this.dataPeriod;
1926        }
1927        else if (name.equals("data")) {
1928          return addData();
1929        }
1930        else if (name.equals("expression")) {
1931          this.expression = new Expression();
1932          return this.expression;
1933        }
1934        else if (name.equals("provision")) {
1935          return addProvision();
1936        }
1937        else
1938          return super.addChild(name);
1939      }
1940
1941      public ProvisionComponent copy() {
1942        ProvisionComponent dst = new ProvisionComponent();
1943        copyValues(dst);
1944        return dst;
1945      }
1946
1947      public void copyValues(ProvisionComponent dst) {
1948        super.copyValues(dst);
1949        dst.type = type == null ? null : type.copy();
1950        dst.period = period == null ? null : period.copy();
1951        if (actor != null) {
1952          dst.actor = new ArrayList<ProvisionActorComponent>();
1953          for (ProvisionActorComponent i : actor)
1954            dst.actor.add(i.copy());
1955        };
1956        if (action != null) {
1957          dst.action = new ArrayList<CodeableConcept>();
1958          for (CodeableConcept i : action)
1959            dst.action.add(i.copy());
1960        };
1961        if (securityLabel != null) {
1962          dst.securityLabel = new ArrayList<Coding>();
1963          for (Coding i : securityLabel)
1964            dst.securityLabel.add(i.copy());
1965        };
1966        if (purpose != null) {
1967          dst.purpose = new ArrayList<Coding>();
1968          for (Coding i : purpose)
1969            dst.purpose.add(i.copy());
1970        };
1971        if (class_ != null) {
1972          dst.class_ = new ArrayList<Coding>();
1973          for (Coding i : class_)
1974            dst.class_.add(i.copy());
1975        };
1976        if (code != null) {
1977          dst.code = new ArrayList<CodeableConcept>();
1978          for (CodeableConcept i : code)
1979            dst.code.add(i.copy());
1980        };
1981        dst.dataPeriod = dataPeriod == null ? null : dataPeriod.copy();
1982        if (data != null) {
1983          dst.data = new ArrayList<ProvisionDataComponent>();
1984          for (ProvisionDataComponent i : data)
1985            dst.data.add(i.copy());
1986        };
1987        dst.expression = expression == null ? null : expression.copy();
1988        if (provision != null) {
1989          dst.provision = new ArrayList<ProvisionComponent>();
1990          for (ProvisionComponent i : provision)
1991            dst.provision.add(i.copy());
1992        };
1993      }
1994
1995      @Override
1996      public boolean equalsDeep(Base other_) {
1997        if (!super.equalsDeep(other_))
1998          return false;
1999        if (!(other_ instanceof ProvisionComponent))
2000          return false;
2001        ProvisionComponent o = (ProvisionComponent) other_;
2002        return compareDeep(type, o.type, true) && compareDeep(period, o.period, true) && compareDeep(actor, o.actor, true)
2003           && compareDeep(action, o.action, true) && compareDeep(securityLabel, o.securityLabel, true) && compareDeep(purpose, o.purpose, true)
2004           && compareDeep(class_, o.class_, true) && compareDeep(code, o.code, true) && compareDeep(dataPeriod, o.dataPeriod, true)
2005           && compareDeep(data, o.data, true) && compareDeep(expression, o.expression, true) && compareDeep(provision, o.provision, true)
2006          ;
2007      }
2008
2009      @Override
2010      public boolean equalsShallow(Base other_) {
2011        if (!super.equalsShallow(other_))
2012          return false;
2013        if (!(other_ instanceof ProvisionComponent))
2014          return false;
2015        ProvisionComponent o = (ProvisionComponent) other_;
2016        return compareValues(type, o.type, true);
2017      }
2018
2019      public boolean isEmpty() {
2020        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, period, actor, action
2021          , securityLabel, purpose, class_, code, dataPeriod, data, expression, provision
2022          );
2023      }
2024
2025  public String fhirType() {
2026    return "Consent.provision";
2027
2028  }
2029
2030  }
2031
2032    @Block()
2033    public static class ProvisionActorComponent extends BackboneElement implements IBaseBackboneElement {
2034        /**
2035         * How the individual is involved in the resources content that is described in the exception.
2036         */
2037        @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
2038        @Description(shortDefinition="How the actor is involved", formalDefinition="How the individual is involved in the resources content that is described in the exception." )
2039        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/participation-role-type")
2040        protected CodeableConcept role;
2041
2042        /**
2043         * The resource that identifies the actor. To identify actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers').
2044         */
2045        @Child(name = "reference", type = {Device.class, Group.class, CareTeam.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, PractitionerRole.class}, order=2, min=0, max=1, modifier=false, summary=false)
2046        @Description(shortDefinition="Resource for the actor (or group, by role)", formalDefinition="The resource that identifies the actor. To identify actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers')." )
2047        protected Reference reference;
2048
2049        private static final long serialVersionUID = -1992921787L;
2050
2051    /**
2052     * Constructor
2053     */
2054      public ProvisionActorComponent() {
2055        super();
2056      }
2057
2058        /**
2059         * @return {@link #role} (How the individual is involved in the resources content that is described in the exception.)
2060         */
2061        public CodeableConcept getRole() { 
2062          if (this.role == null)
2063            if (Configuration.errorOnAutoCreate())
2064              throw new Error("Attempt to auto-create ProvisionActorComponent.role");
2065            else if (Configuration.doAutoCreate())
2066              this.role = new CodeableConcept(); // cc
2067          return this.role;
2068        }
2069
2070        public boolean hasRole() { 
2071          return this.role != null && !this.role.isEmpty();
2072        }
2073
2074        /**
2075         * @param value {@link #role} (How the individual is involved in the resources content that is described in the exception.)
2076         */
2077        public ProvisionActorComponent setRole(CodeableConcept value) { 
2078          this.role = value;
2079          return this;
2080        }
2081
2082        /**
2083         * @return {@link #reference} (The resource that identifies the actor. To identify actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers').)
2084         */
2085        public Reference getReference() { 
2086          if (this.reference == null)
2087            if (Configuration.errorOnAutoCreate())
2088              throw new Error("Attempt to auto-create ProvisionActorComponent.reference");
2089            else if (Configuration.doAutoCreate())
2090              this.reference = new Reference(); // cc
2091          return this.reference;
2092        }
2093
2094        public boolean hasReference() { 
2095          return this.reference != null && !this.reference.isEmpty();
2096        }
2097
2098        /**
2099         * @param value {@link #reference} (The resource that identifies the actor. To identify actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers').)
2100         */
2101        public ProvisionActorComponent setReference(Reference value) { 
2102          this.reference = value;
2103          return this;
2104        }
2105
2106        protected void listChildren(List<Property> children) {
2107          super.listChildren(children);
2108          children.add(new Property("role", "CodeableConcept", "How the individual is involved in the resources content that is described in the exception.", 0, 1, role));
2109          children.add(new Property("reference", "Reference(Device|Group|CareTeam|Organization|Patient|Practitioner|RelatedPerson|PractitionerRole)", "The resource that identifies the actor. To identify actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers').", 0, 1, reference));
2110        }
2111
2112        @Override
2113        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2114          switch (_hash) {
2115          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "How the individual is involved in the resources content that is described in the exception.", 0, 1, role);
2116          case -925155509: /*reference*/  return new Property("reference", "Reference(Device|Group|CareTeam|Organization|Patient|Practitioner|RelatedPerson|PractitionerRole)", "The resource that identifies the actor. To identify actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers').", 0, 1, reference);
2117          default: return super.getNamedProperty(_hash, _name, _checkValid);
2118          }
2119
2120        }
2121
2122      @Override
2123      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2124        switch (hash) {
2125        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
2126        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
2127        default: return super.getProperty(hash, name, checkValid);
2128        }
2129
2130      }
2131
2132      @Override
2133      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2134        switch (hash) {
2135        case 3506294: // role
2136          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2137          return value;
2138        case -925155509: // reference
2139          this.reference = TypeConvertor.castToReference(value); // Reference
2140          return value;
2141        default: return super.setProperty(hash, name, value);
2142        }
2143
2144      }
2145
2146      @Override
2147      public Base setProperty(String name, Base value) throws FHIRException {
2148        if (name.equals("role")) {
2149          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2150        } else if (name.equals("reference")) {
2151          this.reference = TypeConvertor.castToReference(value); // Reference
2152        } else
2153          return super.setProperty(name, value);
2154        return value;
2155      }
2156
2157      @Override
2158      public Base makeProperty(int hash, String name) throws FHIRException {
2159        switch (hash) {
2160        case 3506294:  return getRole();
2161        case -925155509:  return getReference();
2162        default: return super.makeProperty(hash, name);
2163        }
2164
2165      }
2166
2167      @Override
2168      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2169        switch (hash) {
2170        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
2171        case -925155509: /*reference*/ return new String[] {"Reference"};
2172        default: return super.getTypesForProperty(hash, name);
2173        }
2174
2175      }
2176
2177      @Override
2178      public Base addChild(String name) throws FHIRException {
2179        if (name.equals("role")) {
2180          this.role = new CodeableConcept();
2181          return this.role;
2182        }
2183        else if (name.equals("reference")) {
2184          this.reference = new Reference();
2185          return this.reference;
2186        }
2187        else
2188          return super.addChild(name);
2189      }
2190
2191      public ProvisionActorComponent copy() {
2192        ProvisionActorComponent dst = new ProvisionActorComponent();
2193        copyValues(dst);
2194        return dst;
2195      }
2196
2197      public void copyValues(ProvisionActorComponent dst) {
2198        super.copyValues(dst);
2199        dst.role = role == null ? null : role.copy();
2200        dst.reference = reference == null ? null : reference.copy();
2201      }
2202
2203      @Override
2204      public boolean equalsDeep(Base other_) {
2205        if (!super.equalsDeep(other_))
2206          return false;
2207        if (!(other_ instanceof ProvisionActorComponent))
2208          return false;
2209        ProvisionActorComponent o = (ProvisionActorComponent) other_;
2210        return compareDeep(role, o.role, true) && compareDeep(reference, o.reference, true);
2211      }
2212
2213      @Override
2214      public boolean equalsShallow(Base other_) {
2215        if (!super.equalsShallow(other_))
2216          return false;
2217        if (!(other_ instanceof ProvisionActorComponent))
2218          return false;
2219        ProvisionActorComponent o = (ProvisionActorComponent) other_;
2220        return true;
2221      }
2222
2223      public boolean isEmpty() {
2224        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(role, reference);
2225      }
2226
2227  public String fhirType() {
2228    return "Consent.provision.actor";
2229
2230  }
2231
2232  }
2233
2234    @Block()
2235    public static class ProvisionDataComponent extends BackboneElement implements IBaseBackboneElement {
2236        /**
2237         * How the resource reference is interpreted when testing consent restrictions.
2238         */
2239        @Child(name = "meaning", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2240        @Description(shortDefinition="instance | related | dependents | authoredby", formalDefinition="How the resource reference is interpreted when testing consent restrictions." )
2241        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-data-meaning")
2242        protected Enumeration<ConsentDataMeaning> meaning;
2243
2244        /**
2245         * A reference to a specific resource that defines which resources are covered by this consent.
2246         */
2247        @Child(name = "reference", type = {Reference.class}, order=2, min=1, max=1, modifier=false, summary=true)
2248        @Description(shortDefinition="The actual data reference", formalDefinition="A reference to a specific resource that defines which resources are covered by this consent." )
2249        protected Reference reference;
2250
2251        private static final long serialVersionUID = 1735979153L;
2252
2253    /**
2254     * Constructor
2255     */
2256      public ProvisionDataComponent() {
2257        super();
2258      }
2259
2260    /**
2261     * Constructor
2262     */
2263      public ProvisionDataComponent(ConsentDataMeaning meaning, Reference reference) {
2264        super();
2265        this.setMeaning(meaning);
2266        this.setReference(reference);
2267      }
2268
2269        /**
2270         * @return {@link #meaning} (How the resource reference is interpreted when testing consent restrictions.). This is the underlying object with id, value and extensions. The accessor "getMeaning" gives direct access to the value
2271         */
2272        public Enumeration<ConsentDataMeaning> getMeaningElement() { 
2273          if (this.meaning == null)
2274            if (Configuration.errorOnAutoCreate())
2275              throw new Error("Attempt to auto-create ProvisionDataComponent.meaning");
2276            else if (Configuration.doAutoCreate())
2277              this.meaning = new Enumeration<ConsentDataMeaning>(new ConsentDataMeaningEnumFactory()); // bb
2278          return this.meaning;
2279        }
2280
2281        public boolean hasMeaningElement() { 
2282          return this.meaning != null && !this.meaning.isEmpty();
2283        }
2284
2285        public boolean hasMeaning() { 
2286          return this.meaning != null && !this.meaning.isEmpty();
2287        }
2288
2289        /**
2290         * @param value {@link #meaning} (How the resource reference is interpreted when testing consent restrictions.). This is the underlying object with id, value and extensions. The accessor "getMeaning" gives direct access to the value
2291         */
2292        public ProvisionDataComponent setMeaningElement(Enumeration<ConsentDataMeaning> value) { 
2293          this.meaning = value;
2294          return this;
2295        }
2296
2297        /**
2298         * @return How the resource reference is interpreted when testing consent restrictions.
2299         */
2300        public ConsentDataMeaning getMeaning() { 
2301          return this.meaning == null ? null : this.meaning.getValue();
2302        }
2303
2304        /**
2305         * @param value How the resource reference is interpreted when testing consent restrictions.
2306         */
2307        public ProvisionDataComponent setMeaning(ConsentDataMeaning value) { 
2308            if (this.meaning == null)
2309              this.meaning = new Enumeration<ConsentDataMeaning>(new ConsentDataMeaningEnumFactory());
2310            this.meaning.setValue(value);
2311          return this;
2312        }
2313
2314        /**
2315         * @return {@link #reference} (A reference to a specific resource that defines which resources are covered by this consent.)
2316         */
2317        public Reference getReference() { 
2318          if (this.reference == null)
2319            if (Configuration.errorOnAutoCreate())
2320              throw new Error("Attempt to auto-create ProvisionDataComponent.reference");
2321            else if (Configuration.doAutoCreate())
2322              this.reference = new Reference(); // cc
2323          return this.reference;
2324        }
2325
2326        public boolean hasReference() { 
2327          return this.reference != null && !this.reference.isEmpty();
2328        }
2329
2330        /**
2331         * @param value {@link #reference} (A reference to a specific resource that defines which resources are covered by this consent.)
2332         */
2333        public ProvisionDataComponent setReference(Reference value) { 
2334          this.reference = value;
2335          return this;
2336        }
2337
2338        protected void listChildren(List<Property> children) {
2339          super.listChildren(children);
2340          children.add(new Property("meaning", "code", "How the resource reference is interpreted when testing consent restrictions.", 0, 1, meaning));
2341          children.add(new Property("reference", "Reference(Any)", "A reference to a specific resource that defines which resources are covered by this consent.", 0, 1, reference));
2342        }
2343
2344        @Override
2345        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2346          switch (_hash) {
2347          case 938160637: /*meaning*/  return new Property("meaning", "code", "How the resource reference is interpreted when testing consent restrictions.", 0, 1, meaning);
2348          case -925155509: /*reference*/  return new Property("reference", "Reference(Any)", "A reference to a specific resource that defines which resources are covered by this consent.", 0, 1, reference);
2349          default: return super.getNamedProperty(_hash, _name, _checkValid);
2350          }
2351
2352        }
2353
2354      @Override
2355      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2356        switch (hash) {
2357        case 938160637: /*meaning*/ return this.meaning == null ? new Base[0] : new Base[] {this.meaning}; // Enumeration<ConsentDataMeaning>
2358        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
2359        default: return super.getProperty(hash, name, checkValid);
2360        }
2361
2362      }
2363
2364      @Override
2365      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2366        switch (hash) {
2367        case 938160637: // meaning
2368          value = new ConsentDataMeaningEnumFactory().fromType(TypeConvertor.castToCode(value));
2369          this.meaning = (Enumeration) value; // Enumeration<ConsentDataMeaning>
2370          return value;
2371        case -925155509: // reference
2372          this.reference = TypeConvertor.castToReference(value); // Reference
2373          return value;
2374        default: return super.setProperty(hash, name, value);
2375        }
2376
2377      }
2378
2379      @Override
2380      public Base setProperty(String name, Base value) throws FHIRException {
2381        if (name.equals("meaning")) {
2382          value = new ConsentDataMeaningEnumFactory().fromType(TypeConvertor.castToCode(value));
2383          this.meaning = (Enumeration) value; // Enumeration<ConsentDataMeaning>
2384        } else if (name.equals("reference")) {
2385          this.reference = TypeConvertor.castToReference(value); // Reference
2386        } else
2387          return super.setProperty(name, value);
2388        return value;
2389      }
2390
2391      @Override
2392      public Base makeProperty(int hash, String name) throws FHIRException {
2393        switch (hash) {
2394        case 938160637:  return getMeaningElement();
2395        case -925155509:  return getReference();
2396        default: return super.makeProperty(hash, name);
2397        }
2398
2399      }
2400
2401      @Override
2402      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2403        switch (hash) {
2404        case 938160637: /*meaning*/ return new String[] {"code"};
2405        case -925155509: /*reference*/ return new String[] {"Reference"};
2406        default: return super.getTypesForProperty(hash, name);
2407        }
2408
2409      }
2410
2411      @Override
2412      public Base addChild(String name) throws FHIRException {
2413        if (name.equals("meaning")) {
2414          throw new FHIRException("Cannot call addChild on a primitive type Consent.provision.data.meaning");
2415        }
2416        else if (name.equals("reference")) {
2417          this.reference = new Reference();
2418          return this.reference;
2419        }
2420        else
2421          return super.addChild(name);
2422      }
2423
2424      public ProvisionDataComponent copy() {
2425        ProvisionDataComponent dst = new ProvisionDataComponent();
2426        copyValues(dst);
2427        return dst;
2428      }
2429
2430      public void copyValues(ProvisionDataComponent dst) {
2431        super.copyValues(dst);
2432        dst.meaning = meaning == null ? null : meaning.copy();
2433        dst.reference = reference == null ? null : reference.copy();
2434      }
2435
2436      @Override
2437      public boolean equalsDeep(Base other_) {
2438        if (!super.equalsDeep(other_))
2439          return false;
2440        if (!(other_ instanceof ProvisionDataComponent))
2441          return false;
2442        ProvisionDataComponent o = (ProvisionDataComponent) other_;
2443        return compareDeep(meaning, o.meaning, true) && compareDeep(reference, o.reference, true);
2444      }
2445
2446      @Override
2447      public boolean equalsShallow(Base other_) {
2448        if (!super.equalsShallow(other_))
2449          return false;
2450        if (!(other_ instanceof ProvisionDataComponent))
2451          return false;
2452        ProvisionDataComponent o = (ProvisionDataComponent) other_;
2453        return compareValues(meaning, o.meaning, true);
2454      }
2455
2456      public boolean isEmpty() {
2457        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(meaning, reference);
2458      }
2459
2460  public String fhirType() {
2461    return "Consent.provision.data";
2462
2463  }
2464
2465  }
2466
2467    /**
2468     * Unique identifier for this copy of the Consent Statement.
2469     */
2470    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2471    @Description(shortDefinition="Identifier for this record (external references)", formalDefinition="Unique identifier for this copy of the Consent Statement." )
2472    protected List<Identifier> identifier;
2473
2474    /**
2475     * Indicates the current state of this Consent resource.
2476     */
2477    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
2478    @Description(shortDefinition="draft | active | inactive | not-done | entered-in-error | unknown", formalDefinition="Indicates the current state of this Consent resource." )
2479    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-state-codes")
2480    protected Enumeration<ConsentState> status;
2481
2482    /**
2483     * A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements.
2484     */
2485    @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2486    @Description(shortDefinition="Classification of the consent statement - for indexing/retrieval", formalDefinition="A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements." )
2487    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-category")
2488    protected List<CodeableConcept> category;
2489
2490    /**
2491     * The patient/healthcare practitioner or group of persons to whom this consent applies.
2492     */
2493    @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class}, order=3, min=0, max=1, modifier=false, summary=true)
2494    @Description(shortDefinition="Who the consent applies to", formalDefinition="The patient/healthcare practitioner or group of persons to whom this consent applies." )
2495    protected Reference subject;
2496
2497    /**
2498     * Date and time the consent instance was agreed to.
2499     */
2500    @Child(name = "dateTime", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=true)
2501    @Description(shortDefinition="When consent was agreed to", formalDefinition="Date and time the consent instance was agreed to." )
2502    protected DateTimeType dateTime;
2503
2504    /**
2505     * The entity responsible for granting the rights listed in a Consent Directive.
2506     */
2507    @Child(name = "grantor", type = {CareTeam.class, HealthcareService.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, PractitionerRole.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2508    @Description(shortDefinition="Who is granting rights according to the policy and rules", formalDefinition="The entity responsible for granting the rights listed in a Consent Directive." )
2509    protected List<Reference> grantor;
2510
2511    /**
2512     * The entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions.
2513     */
2514    @Child(name = "grantee", type = {CareTeam.class, HealthcareService.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, PractitionerRole.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2515    @Description(shortDefinition="Who is agreeing to the policy and rules", formalDefinition="The entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions." )
2516    protected List<Reference> grantee;
2517
2518    /**
2519     * The actor that manages the consent through its lifecycle.
2520     */
2521    @Child(name = "manager", type = {HealthcareService.class, Organization.class, Patient.class, Practitioner.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2522    @Description(shortDefinition="Consent workflow management", formalDefinition="The actor that manages the consent through its lifecycle." )
2523    protected List<Reference> manager;
2524
2525    /**
2526     * The actor that controls/enforces the access according to the consent.
2527     */
2528    @Child(name = "controller", type = {HealthcareService.class, Organization.class, Patient.class, Practitioner.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2529    @Description(shortDefinition="Consent Enforcer", formalDefinition="The actor that controls/enforces the access according to the consent." )
2530    protected List<Reference> controller;
2531
2532    /**
2533     * The source on which this consent statement is based. The source might be a scanned original paper form.
2534     */
2535    @Child(name = "sourceAttachment", type = {Attachment.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2536    @Description(shortDefinition="Source from which this consent is taken", formalDefinition="The source on which this consent statement is based. The source might be a scanned original paper form." )
2537    protected List<Attachment> sourceAttachment;
2538
2539    /**
2540     * A reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document.
2541     */
2542    @Child(name = "sourceReference", type = {Consent.class, DocumentReference.class, Contract.class, QuestionnaireResponse.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2543    @Description(shortDefinition="Source from which this consent is taken", formalDefinition="A reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document." )
2544    protected List<Reference> sourceReference;
2545
2546    /**
2547     * A set of codes that indicate the regulatory basis (if any) that this consent supports.
2548     */
2549    @Child(name = "regulatoryBasis", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2550    @Description(shortDefinition="Regulations establishing base Consent", formalDefinition="A set of codes that indicate the regulatory basis (if any) that this consent supports." )
2551    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-policy")
2552    protected List<CodeableConcept> regulatoryBasis;
2553
2554    /**
2555     * A Reference or URL used to uniquely identify the policy the organization will enforce for this Consent. This Reference or URL should be specific to the version of the policy and should be dereferencable to a computable policy of some form.
2556     */
2557    @Child(name = "policyBasis", type = {}, order=12, min=0, max=1, modifier=false, summary=false)
2558    @Description(shortDefinition="Computable version of the backing policy", formalDefinition="A Reference or URL used to uniquely identify the policy the organization will enforce for this Consent. This Reference or URL should be specific to the version of the policy and should be dereferencable to a computable policy of some form." )
2559    protected ConsentPolicyBasisComponent policyBasis;
2560
2561    /**
2562     * A Reference to the human readable policy explaining the basis for the Consent.
2563     */
2564    @Child(name = "policyText", type = {DocumentReference.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2565    @Description(shortDefinition="Human Readable Policy", formalDefinition="A Reference to the human readable policy explaining the basis for the Consent." )
2566    protected List<Reference> policyText;
2567
2568    /**
2569     * Whether a treatment instruction (e.g. artificial respiration: yes or no) was verified with the patient, his/her family or another authorized person.
2570     */
2571    @Child(name = "verification", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2572    @Description(shortDefinition="Consent Verified by patient or family", formalDefinition="Whether a treatment instruction (e.g. artificial respiration: yes or no) was verified with the patient, his/her family or another authorized person." )
2573    protected List<ConsentVerificationComponent> verification;
2574
2575    /**
2576     * An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.
2577     */
2578    @Child(name = "provision", type = {}, order=15, min=0, max=1, modifier=false, summary=true)
2579    @Description(shortDefinition="Constraints to the base Consent.policyRule/Consent.policy", formalDefinition="An exception to the base policy of this consent. An exception can be an addition or removal of access permissions." )
2580    protected ProvisionComponent provision;
2581
2582    private static final long serialVersionUID = 1252772004L;
2583
2584  /**
2585   * Constructor
2586   */
2587    public Consent() {
2588      super();
2589    }
2590
2591  /**
2592   * Constructor
2593   */
2594    public Consent(ConsentState status) {
2595      super();
2596      this.setStatus(status);
2597    }
2598
2599    /**
2600     * @return {@link #identifier} (Unique identifier for this copy of the Consent Statement.)
2601     */
2602    public List<Identifier> getIdentifier() { 
2603      if (this.identifier == null)
2604        this.identifier = new ArrayList<Identifier>();
2605      return this.identifier;
2606    }
2607
2608    /**
2609     * @return Returns a reference to <code>this</code> for easy method chaining
2610     */
2611    public Consent setIdentifier(List<Identifier> theIdentifier) { 
2612      this.identifier = theIdentifier;
2613      return this;
2614    }
2615
2616    public boolean hasIdentifier() { 
2617      if (this.identifier == null)
2618        return false;
2619      for (Identifier item : this.identifier)
2620        if (!item.isEmpty())
2621          return true;
2622      return false;
2623    }
2624
2625    public Identifier addIdentifier() { //3
2626      Identifier t = new Identifier();
2627      if (this.identifier == null)
2628        this.identifier = new ArrayList<Identifier>();
2629      this.identifier.add(t);
2630      return t;
2631    }
2632
2633    public Consent addIdentifier(Identifier t) { //3
2634      if (t == null)
2635        return this;
2636      if (this.identifier == null)
2637        this.identifier = new ArrayList<Identifier>();
2638      this.identifier.add(t);
2639      return this;
2640    }
2641
2642    /**
2643     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2644     */
2645    public Identifier getIdentifierFirstRep() { 
2646      if (getIdentifier().isEmpty()) {
2647        addIdentifier();
2648      }
2649      return getIdentifier().get(0);
2650    }
2651
2652    /**
2653     * @return {@link #status} (Indicates the current state of this Consent resource.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2654     */
2655    public Enumeration<ConsentState> getStatusElement() { 
2656      if (this.status == null)
2657        if (Configuration.errorOnAutoCreate())
2658          throw new Error("Attempt to auto-create Consent.status");
2659        else if (Configuration.doAutoCreate())
2660          this.status = new Enumeration<ConsentState>(new ConsentStateEnumFactory()); // bb
2661      return this.status;
2662    }
2663
2664    public boolean hasStatusElement() { 
2665      return this.status != null && !this.status.isEmpty();
2666    }
2667
2668    public boolean hasStatus() { 
2669      return this.status != null && !this.status.isEmpty();
2670    }
2671
2672    /**
2673     * @param value {@link #status} (Indicates the current state of this Consent resource.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2674     */
2675    public Consent setStatusElement(Enumeration<ConsentState> value) { 
2676      this.status = value;
2677      return this;
2678    }
2679
2680    /**
2681     * @return Indicates the current state of this Consent resource.
2682     */
2683    public ConsentState getStatus() { 
2684      return this.status == null ? null : this.status.getValue();
2685    }
2686
2687    /**
2688     * @param value Indicates the current state of this Consent resource.
2689     */
2690    public Consent setStatus(ConsentState value) { 
2691        if (this.status == null)
2692          this.status = new Enumeration<ConsentState>(new ConsentStateEnumFactory());
2693        this.status.setValue(value);
2694      return this;
2695    }
2696
2697    /**
2698     * @return {@link #category} (A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements.)
2699     */
2700    public List<CodeableConcept> getCategory() { 
2701      if (this.category == null)
2702        this.category = new ArrayList<CodeableConcept>();
2703      return this.category;
2704    }
2705
2706    /**
2707     * @return Returns a reference to <code>this</code> for easy method chaining
2708     */
2709    public Consent setCategory(List<CodeableConcept> theCategory) { 
2710      this.category = theCategory;
2711      return this;
2712    }
2713
2714    public boolean hasCategory() { 
2715      if (this.category == null)
2716        return false;
2717      for (CodeableConcept item : this.category)
2718        if (!item.isEmpty())
2719          return true;
2720      return false;
2721    }
2722
2723    public CodeableConcept addCategory() { //3
2724      CodeableConcept t = new CodeableConcept();
2725      if (this.category == null)
2726        this.category = new ArrayList<CodeableConcept>();
2727      this.category.add(t);
2728      return t;
2729    }
2730
2731    public Consent addCategory(CodeableConcept t) { //3
2732      if (t == null)
2733        return this;
2734      if (this.category == null)
2735        this.category = new ArrayList<CodeableConcept>();
2736      this.category.add(t);
2737      return this;
2738    }
2739
2740    /**
2741     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
2742     */
2743    public CodeableConcept getCategoryFirstRep() { 
2744      if (getCategory().isEmpty()) {
2745        addCategory();
2746      }
2747      return getCategory().get(0);
2748    }
2749
2750    /**
2751     * @return {@link #subject} (The patient/healthcare practitioner or group of persons to whom this consent applies.)
2752     */
2753    public Reference getSubject() { 
2754      if (this.subject == null)
2755        if (Configuration.errorOnAutoCreate())
2756          throw new Error("Attempt to auto-create Consent.subject");
2757        else if (Configuration.doAutoCreate())
2758          this.subject = new Reference(); // cc
2759      return this.subject;
2760    }
2761
2762    public boolean hasSubject() { 
2763      return this.subject != null && !this.subject.isEmpty();
2764    }
2765
2766    /**
2767     * @param value {@link #subject} (The patient/healthcare practitioner or group of persons to whom this consent applies.)
2768     */
2769    public Consent setSubject(Reference value) { 
2770      this.subject = value;
2771      return this;
2772    }
2773
2774    /**
2775     * @return {@link #dateTime} (Date and time the consent instance was agreed to.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value
2776     */
2777    public DateTimeType getDateTimeElement() { 
2778      if (this.dateTime == null)
2779        if (Configuration.errorOnAutoCreate())
2780          throw new Error("Attempt to auto-create Consent.dateTime");
2781        else if (Configuration.doAutoCreate())
2782          this.dateTime = new DateTimeType(); // bb
2783      return this.dateTime;
2784    }
2785
2786    public boolean hasDateTimeElement() { 
2787      return this.dateTime != null && !this.dateTime.isEmpty();
2788    }
2789
2790    public boolean hasDateTime() { 
2791      return this.dateTime != null && !this.dateTime.isEmpty();
2792    }
2793
2794    /**
2795     * @param value {@link #dateTime} (Date and time the consent instance was agreed to.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value
2796     */
2797    public Consent setDateTimeElement(DateTimeType value) { 
2798      this.dateTime = value;
2799      return this;
2800    }
2801
2802    /**
2803     * @return Date and time the consent instance was agreed to.
2804     */
2805    public Date getDateTime() { 
2806      return this.dateTime == null ? null : this.dateTime.getValue();
2807    }
2808
2809    /**
2810     * @param value Date and time the consent instance was agreed to.
2811     */
2812    public Consent setDateTime(Date value) { 
2813      if (value == null)
2814        this.dateTime = null;
2815      else {
2816        if (this.dateTime == null)
2817          this.dateTime = new DateTimeType();
2818        this.dateTime.setValue(value);
2819      }
2820      return this;
2821    }
2822
2823    /**
2824     * @return {@link #grantor} (The entity responsible for granting the rights listed in a Consent Directive.)
2825     */
2826    public List<Reference> getGrantor() { 
2827      if (this.grantor == null)
2828        this.grantor = new ArrayList<Reference>();
2829      return this.grantor;
2830    }
2831
2832    /**
2833     * @return Returns a reference to <code>this</code> for easy method chaining
2834     */
2835    public Consent setGrantor(List<Reference> theGrantor) { 
2836      this.grantor = theGrantor;
2837      return this;
2838    }
2839
2840    public boolean hasGrantor() { 
2841      if (this.grantor == null)
2842        return false;
2843      for (Reference item : this.grantor)
2844        if (!item.isEmpty())
2845          return true;
2846      return false;
2847    }
2848
2849    public Reference addGrantor() { //3
2850      Reference t = new Reference();
2851      if (this.grantor == null)
2852        this.grantor = new ArrayList<Reference>();
2853      this.grantor.add(t);
2854      return t;
2855    }
2856
2857    public Consent addGrantor(Reference t) { //3
2858      if (t == null)
2859        return this;
2860      if (this.grantor == null)
2861        this.grantor = new ArrayList<Reference>();
2862      this.grantor.add(t);
2863      return this;
2864    }
2865
2866    /**
2867     * @return The first repetition of repeating field {@link #grantor}, creating it if it does not already exist {3}
2868     */
2869    public Reference getGrantorFirstRep() { 
2870      if (getGrantor().isEmpty()) {
2871        addGrantor();
2872      }
2873      return getGrantor().get(0);
2874    }
2875
2876    /**
2877     * @return {@link #grantee} (The entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions.)
2878     */
2879    public List<Reference> getGrantee() { 
2880      if (this.grantee == null)
2881        this.grantee = new ArrayList<Reference>();
2882      return this.grantee;
2883    }
2884
2885    /**
2886     * @return Returns a reference to <code>this</code> for easy method chaining
2887     */
2888    public Consent setGrantee(List<Reference> theGrantee) { 
2889      this.grantee = theGrantee;
2890      return this;
2891    }
2892
2893    public boolean hasGrantee() { 
2894      if (this.grantee == null)
2895        return false;
2896      for (Reference item : this.grantee)
2897        if (!item.isEmpty())
2898          return true;
2899      return false;
2900    }
2901
2902    public Reference addGrantee() { //3
2903      Reference t = new Reference();
2904      if (this.grantee == null)
2905        this.grantee = new ArrayList<Reference>();
2906      this.grantee.add(t);
2907      return t;
2908    }
2909
2910    public Consent addGrantee(Reference t) { //3
2911      if (t == null)
2912        return this;
2913      if (this.grantee == null)
2914        this.grantee = new ArrayList<Reference>();
2915      this.grantee.add(t);
2916      return this;
2917    }
2918
2919    /**
2920     * @return The first repetition of repeating field {@link #grantee}, creating it if it does not already exist {3}
2921     */
2922    public Reference getGranteeFirstRep() { 
2923      if (getGrantee().isEmpty()) {
2924        addGrantee();
2925      }
2926      return getGrantee().get(0);
2927    }
2928
2929    /**
2930     * @return {@link #manager} (The actor that manages the consent through its lifecycle.)
2931     */
2932    public List<Reference> getManager() { 
2933      if (this.manager == null)
2934        this.manager = new ArrayList<Reference>();
2935      return this.manager;
2936    }
2937
2938    /**
2939     * @return Returns a reference to <code>this</code> for easy method chaining
2940     */
2941    public Consent setManager(List<Reference> theManager) { 
2942      this.manager = theManager;
2943      return this;
2944    }
2945
2946    public boolean hasManager() { 
2947      if (this.manager == null)
2948        return false;
2949      for (Reference item : this.manager)
2950        if (!item.isEmpty())
2951          return true;
2952      return false;
2953    }
2954
2955    public Reference addManager() { //3
2956      Reference t = new Reference();
2957      if (this.manager == null)
2958        this.manager = new ArrayList<Reference>();
2959      this.manager.add(t);
2960      return t;
2961    }
2962
2963    public Consent addManager(Reference t) { //3
2964      if (t == null)
2965        return this;
2966      if (this.manager == null)
2967        this.manager = new ArrayList<Reference>();
2968      this.manager.add(t);
2969      return this;
2970    }
2971
2972    /**
2973     * @return The first repetition of repeating field {@link #manager}, creating it if it does not already exist {3}
2974     */
2975    public Reference getManagerFirstRep() { 
2976      if (getManager().isEmpty()) {
2977        addManager();
2978      }
2979      return getManager().get(0);
2980    }
2981
2982    /**
2983     * @return {@link #controller} (The actor that controls/enforces the access according to the consent.)
2984     */
2985    public List<Reference> getController() { 
2986      if (this.controller == null)
2987        this.controller = new ArrayList<Reference>();
2988      return this.controller;
2989    }
2990
2991    /**
2992     * @return Returns a reference to <code>this</code> for easy method chaining
2993     */
2994    public Consent setController(List<Reference> theController) { 
2995      this.controller = theController;
2996      return this;
2997    }
2998
2999    public boolean hasController() { 
3000      if (this.controller == null)
3001        return false;
3002      for (Reference item : this.controller)
3003        if (!item.isEmpty())
3004          return true;
3005      return false;
3006    }
3007
3008    public Reference addController() { //3
3009      Reference t = new Reference();
3010      if (this.controller == null)
3011        this.controller = new ArrayList<Reference>();
3012      this.controller.add(t);
3013      return t;
3014    }
3015
3016    public Consent addController(Reference t) { //3
3017      if (t == null)
3018        return this;
3019      if (this.controller == null)
3020        this.controller = new ArrayList<Reference>();
3021      this.controller.add(t);
3022      return this;
3023    }
3024
3025    /**
3026     * @return The first repetition of repeating field {@link #controller}, creating it if it does not already exist {3}
3027     */
3028    public Reference getControllerFirstRep() { 
3029      if (getController().isEmpty()) {
3030        addController();
3031      }
3032      return getController().get(0);
3033    }
3034
3035    /**
3036     * @return {@link #sourceAttachment} (The source on which this consent statement is based. The source might be a scanned original paper form.)
3037     */
3038    public List<Attachment> getSourceAttachment() { 
3039      if (this.sourceAttachment == null)
3040        this.sourceAttachment = new ArrayList<Attachment>();
3041      return this.sourceAttachment;
3042    }
3043
3044    /**
3045     * @return Returns a reference to <code>this</code> for easy method chaining
3046     */
3047    public Consent setSourceAttachment(List<Attachment> theSourceAttachment) { 
3048      this.sourceAttachment = theSourceAttachment;
3049      return this;
3050    }
3051
3052    public boolean hasSourceAttachment() { 
3053      if (this.sourceAttachment == null)
3054        return false;
3055      for (Attachment item : this.sourceAttachment)
3056        if (!item.isEmpty())
3057          return true;
3058      return false;
3059    }
3060
3061    public Attachment addSourceAttachment() { //3
3062      Attachment t = new Attachment();
3063      if (this.sourceAttachment == null)
3064        this.sourceAttachment = new ArrayList<Attachment>();
3065      this.sourceAttachment.add(t);
3066      return t;
3067    }
3068
3069    public Consent addSourceAttachment(Attachment t) { //3
3070      if (t == null)
3071        return this;
3072      if (this.sourceAttachment == null)
3073        this.sourceAttachment = new ArrayList<Attachment>();
3074      this.sourceAttachment.add(t);
3075      return this;
3076    }
3077
3078    /**
3079     * @return The first repetition of repeating field {@link #sourceAttachment}, creating it if it does not already exist {3}
3080     */
3081    public Attachment getSourceAttachmentFirstRep() { 
3082      if (getSourceAttachment().isEmpty()) {
3083        addSourceAttachment();
3084      }
3085      return getSourceAttachment().get(0);
3086    }
3087
3088    /**
3089     * @return {@link #sourceReference} (A reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document.)
3090     */
3091    public List<Reference> getSourceReference() { 
3092      if (this.sourceReference == null)
3093        this.sourceReference = new ArrayList<Reference>();
3094      return this.sourceReference;
3095    }
3096
3097    /**
3098     * @return Returns a reference to <code>this</code> for easy method chaining
3099     */
3100    public Consent setSourceReference(List<Reference> theSourceReference) { 
3101      this.sourceReference = theSourceReference;
3102      return this;
3103    }
3104
3105    public boolean hasSourceReference() { 
3106      if (this.sourceReference == null)
3107        return false;
3108      for (Reference item : this.sourceReference)
3109        if (!item.isEmpty())
3110          return true;
3111      return false;
3112    }
3113
3114    public Reference addSourceReference() { //3
3115      Reference t = new Reference();
3116      if (this.sourceReference == null)
3117        this.sourceReference = new ArrayList<Reference>();
3118      this.sourceReference.add(t);
3119      return t;
3120    }
3121
3122    public Consent addSourceReference(Reference t) { //3
3123      if (t == null)
3124        return this;
3125      if (this.sourceReference == null)
3126        this.sourceReference = new ArrayList<Reference>();
3127      this.sourceReference.add(t);
3128      return this;
3129    }
3130
3131    /**
3132     * @return The first repetition of repeating field {@link #sourceReference}, creating it if it does not already exist {3}
3133     */
3134    public Reference getSourceReferenceFirstRep() { 
3135      if (getSourceReference().isEmpty()) {
3136        addSourceReference();
3137      }
3138      return getSourceReference().get(0);
3139    }
3140
3141    /**
3142     * @return {@link #regulatoryBasis} (A set of codes that indicate the regulatory basis (if any) that this consent supports.)
3143     */
3144    public List<CodeableConcept> getRegulatoryBasis() { 
3145      if (this.regulatoryBasis == null)
3146        this.regulatoryBasis = new ArrayList<CodeableConcept>();
3147      return this.regulatoryBasis;
3148    }
3149
3150    /**
3151     * @return Returns a reference to <code>this</code> for easy method chaining
3152     */
3153    public Consent setRegulatoryBasis(List<CodeableConcept> theRegulatoryBasis) { 
3154      this.regulatoryBasis = theRegulatoryBasis;
3155      return this;
3156    }
3157
3158    public boolean hasRegulatoryBasis() { 
3159      if (this.regulatoryBasis == null)
3160        return false;
3161      for (CodeableConcept item : this.regulatoryBasis)
3162        if (!item.isEmpty())
3163          return true;
3164      return false;
3165    }
3166
3167    public CodeableConcept addRegulatoryBasis() { //3
3168      CodeableConcept t = new CodeableConcept();
3169      if (this.regulatoryBasis == null)
3170        this.regulatoryBasis = new ArrayList<CodeableConcept>();
3171      this.regulatoryBasis.add(t);
3172      return t;
3173    }
3174
3175    public Consent addRegulatoryBasis(CodeableConcept t) { //3
3176      if (t == null)
3177        return this;
3178      if (this.regulatoryBasis == null)
3179        this.regulatoryBasis = new ArrayList<CodeableConcept>();
3180      this.regulatoryBasis.add(t);
3181      return this;
3182    }
3183
3184    /**
3185     * @return The first repetition of repeating field {@link #regulatoryBasis}, creating it if it does not already exist {3}
3186     */
3187    public CodeableConcept getRegulatoryBasisFirstRep() { 
3188      if (getRegulatoryBasis().isEmpty()) {
3189        addRegulatoryBasis();
3190      }
3191      return getRegulatoryBasis().get(0);
3192    }
3193
3194    /**
3195     * @return {@link #policyBasis} (A Reference or URL used to uniquely identify the policy the organization will enforce for this Consent. This Reference or URL should be specific to the version of the policy and should be dereferencable to a computable policy of some form.)
3196     */
3197    public ConsentPolicyBasisComponent getPolicyBasis() { 
3198      if (this.policyBasis == null)
3199        if (Configuration.errorOnAutoCreate())
3200          throw new Error("Attempt to auto-create Consent.policyBasis");
3201        else if (Configuration.doAutoCreate())
3202          this.policyBasis = new ConsentPolicyBasisComponent(); // cc
3203      return this.policyBasis;
3204    }
3205
3206    public boolean hasPolicyBasis() { 
3207      return this.policyBasis != null && !this.policyBasis.isEmpty();
3208    }
3209
3210    /**
3211     * @param value {@link #policyBasis} (A Reference or URL used to uniquely identify the policy the organization will enforce for this Consent. This Reference or URL should be specific to the version of the policy and should be dereferencable to a computable policy of some form.)
3212     */
3213    public Consent setPolicyBasis(ConsentPolicyBasisComponent value) { 
3214      this.policyBasis = value;
3215      return this;
3216    }
3217
3218    /**
3219     * @return {@link #policyText} (A Reference to the human readable policy explaining the basis for the Consent.)
3220     */
3221    public List<Reference> getPolicyText() { 
3222      if (this.policyText == null)
3223        this.policyText = new ArrayList<Reference>();
3224      return this.policyText;
3225    }
3226
3227    /**
3228     * @return Returns a reference to <code>this</code> for easy method chaining
3229     */
3230    public Consent setPolicyText(List<Reference> thePolicyText) { 
3231      this.policyText = thePolicyText;
3232      return this;
3233    }
3234
3235    public boolean hasPolicyText() { 
3236      if (this.policyText == null)
3237        return false;
3238      for (Reference item : this.policyText)
3239        if (!item.isEmpty())
3240          return true;
3241      return false;
3242    }
3243
3244    public Reference addPolicyText() { //3
3245      Reference t = new Reference();
3246      if (this.policyText == null)
3247        this.policyText = new ArrayList<Reference>();
3248      this.policyText.add(t);
3249      return t;
3250    }
3251
3252    public Consent addPolicyText(Reference t) { //3
3253      if (t == null)
3254        return this;
3255      if (this.policyText == null)
3256        this.policyText = new ArrayList<Reference>();
3257      this.policyText.add(t);
3258      return this;
3259    }
3260
3261    /**
3262     * @return The first repetition of repeating field {@link #policyText}, creating it if it does not already exist {3}
3263     */
3264    public Reference getPolicyTextFirstRep() { 
3265      if (getPolicyText().isEmpty()) {
3266        addPolicyText();
3267      }
3268      return getPolicyText().get(0);
3269    }
3270
3271    /**
3272     * @return {@link #verification} (Whether a treatment instruction (e.g. artificial respiration: yes or no) was verified with the patient, his/her family or another authorized person.)
3273     */
3274    public List<ConsentVerificationComponent> getVerification() { 
3275      if (this.verification == null)
3276        this.verification = new ArrayList<ConsentVerificationComponent>();
3277      return this.verification;
3278    }
3279
3280    /**
3281     * @return Returns a reference to <code>this</code> for easy method chaining
3282     */
3283    public Consent setVerification(List<ConsentVerificationComponent> theVerification) { 
3284      this.verification = theVerification;
3285      return this;
3286    }
3287
3288    public boolean hasVerification() { 
3289      if (this.verification == null)
3290        return false;
3291      for (ConsentVerificationComponent item : this.verification)
3292        if (!item.isEmpty())
3293          return true;
3294      return false;
3295    }
3296
3297    public ConsentVerificationComponent addVerification() { //3
3298      ConsentVerificationComponent t = new ConsentVerificationComponent();
3299      if (this.verification == null)
3300        this.verification = new ArrayList<ConsentVerificationComponent>();
3301      this.verification.add(t);
3302      return t;
3303    }
3304
3305    public Consent addVerification(ConsentVerificationComponent t) { //3
3306      if (t == null)
3307        return this;
3308      if (this.verification == null)
3309        this.verification = new ArrayList<ConsentVerificationComponent>();
3310      this.verification.add(t);
3311      return this;
3312    }
3313
3314    /**
3315     * @return The first repetition of repeating field {@link #verification}, creating it if it does not already exist {3}
3316     */
3317    public ConsentVerificationComponent getVerificationFirstRep() { 
3318      if (getVerification().isEmpty()) {
3319        addVerification();
3320      }
3321      return getVerification().get(0);
3322    }
3323
3324    /**
3325     * @return {@link #provision} (An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.)
3326     */
3327    public ProvisionComponent getProvision() { 
3328      if (this.provision == null)
3329        if (Configuration.errorOnAutoCreate())
3330          throw new Error("Attempt to auto-create Consent.provision");
3331        else if (Configuration.doAutoCreate())
3332          this.provision = new ProvisionComponent(); // cc
3333      return this.provision;
3334    }
3335
3336    public boolean hasProvision() { 
3337      return this.provision != null && !this.provision.isEmpty();
3338    }
3339
3340    /**
3341     * @param value {@link #provision} (An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.)
3342     */
3343    public Consent setProvision(ProvisionComponent value) { 
3344      this.provision = value;
3345      return this;
3346    }
3347
3348      protected void listChildren(List<Property> children) {
3349        super.listChildren(children);
3350        children.add(new Property("identifier", "Identifier", "Unique identifier for this copy of the Consent Statement.", 0, java.lang.Integer.MAX_VALUE, identifier));
3351        children.add(new Property("status", "code", "Indicates the current state of this Consent resource.", 0, 1, status));
3352        children.add(new Property("category", "CodeableConcept", "A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements.", 0, java.lang.Integer.MAX_VALUE, category));
3353        children.add(new Property("subject", "Reference(Patient|Practitioner|Group)", "The patient/healthcare practitioner or group of persons to whom this consent applies.", 0, 1, subject));
3354        children.add(new Property("dateTime", "dateTime", "Date and time the consent instance was agreed to.", 0, 1, dateTime));
3355        children.add(new Property("grantor", "Reference(CareTeam|HealthcareService|Organization|Patient|Practitioner|RelatedPerson|PractitionerRole)", "The entity responsible for granting the rights listed in a Consent Directive.", 0, java.lang.Integer.MAX_VALUE, grantor));
3356        children.add(new Property("grantee", "Reference(CareTeam|HealthcareService|Organization|Patient|Practitioner|RelatedPerson|PractitionerRole)", "The entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions.", 0, java.lang.Integer.MAX_VALUE, grantee));
3357        children.add(new Property("manager", "Reference(HealthcareService|Organization|Patient|Practitioner)", "The actor that manages the consent through its lifecycle.", 0, java.lang.Integer.MAX_VALUE, manager));
3358        children.add(new Property("controller", "Reference(HealthcareService|Organization|Patient|Practitioner)", "The actor that controls/enforces the access according to the consent.", 0, java.lang.Integer.MAX_VALUE, controller));
3359        children.add(new Property("sourceAttachment", "Attachment", "The source on which this consent statement is based. The source might be a scanned original paper form.", 0, java.lang.Integer.MAX_VALUE, sourceAttachment));
3360        children.add(new Property("sourceReference", "Reference(Consent|DocumentReference|Contract|QuestionnaireResponse)", "A reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document.", 0, java.lang.Integer.MAX_VALUE, sourceReference));
3361        children.add(new Property("regulatoryBasis", "CodeableConcept", "A set of codes that indicate the regulatory basis (if any) that this consent supports.", 0, java.lang.Integer.MAX_VALUE, regulatoryBasis));
3362        children.add(new Property("policyBasis", "", "A Reference or URL used to uniquely identify the policy the organization will enforce for this Consent. This Reference or URL should be specific to the version of the policy and should be dereferencable to a computable policy of some form.", 0, 1, policyBasis));
3363        children.add(new Property("policyText", "Reference(DocumentReference)", "A Reference to the human readable policy explaining the basis for the Consent.", 0, java.lang.Integer.MAX_VALUE, policyText));
3364        children.add(new Property("verification", "", "Whether a treatment instruction (e.g. artificial respiration: yes or no) was verified with the patient, his/her family or another authorized person.", 0, java.lang.Integer.MAX_VALUE, verification));
3365        children.add(new Property("provision", "", "An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.", 0, 1, provision));
3366      }
3367
3368      @Override
3369      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3370        switch (_hash) {
3371        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique identifier for this copy of the Consent Statement.", 0, java.lang.Integer.MAX_VALUE, identifier);
3372        case -892481550: /*status*/  return new Property("status", "code", "Indicates the current state of this Consent resource.", 0, 1, status);
3373        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements.", 0, java.lang.Integer.MAX_VALUE, category);
3374        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Practitioner|Group)", "The patient/healthcare practitioner or group of persons to whom this consent applies.", 0, 1, subject);
3375        case 1792749467: /*dateTime*/  return new Property("dateTime", "dateTime", "Date and time the consent instance was agreed to.", 0, 1, dateTime);
3376        case 280295423: /*grantor*/  return new Property("grantor", "Reference(CareTeam|HealthcareService|Organization|Patient|Practitioner|RelatedPerson|PractitionerRole)", "The entity responsible for granting the rights listed in a Consent Directive.", 0, java.lang.Integer.MAX_VALUE, grantor);
3377        case 280295100: /*grantee*/  return new Property("grantee", "Reference(CareTeam|HealthcareService|Organization|Patient|Practitioner|RelatedPerson|PractitionerRole)", "The entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions.", 0, java.lang.Integer.MAX_VALUE, grantee);
3378        case 835260333: /*manager*/  return new Property("manager", "Reference(HealthcareService|Organization|Patient|Practitioner)", "The actor that manages the consent through its lifecycle.", 0, java.lang.Integer.MAX_VALUE, manager);
3379        case 637428636: /*controller*/  return new Property("controller", "Reference(HealthcareService|Organization|Patient|Practitioner)", "The actor that controls/enforces the access according to the consent.", 0, java.lang.Integer.MAX_VALUE, controller);
3380        case 1964406686: /*sourceAttachment*/  return new Property("sourceAttachment", "Attachment", "The source on which this consent statement is based. The source might be a scanned original paper form.", 0, java.lang.Integer.MAX_VALUE, sourceAttachment);
3381        case -244259472: /*sourceReference*/  return new Property("sourceReference", "Reference(Consent|DocumentReference|Contract|QuestionnaireResponse)", "A reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document.", 0, java.lang.Integer.MAX_VALUE, sourceReference);
3382        case -1780301690: /*regulatoryBasis*/  return new Property("regulatoryBasis", "CodeableConcept", "A set of codes that indicate the regulatory basis (if any) that this consent supports.", 0, java.lang.Integer.MAX_VALUE, regulatoryBasis);
3383        case 2138287660: /*policyBasis*/  return new Property("policyBasis", "", "A Reference or URL used to uniquely identify the policy the organization will enforce for this Consent. This Reference or URL should be specific to the version of the policy and should be dereferencable to a computable policy of some form.", 0, 1, policyBasis);
3384        case 1593537919: /*policyText*/  return new Property("policyText", "Reference(DocumentReference)", "A Reference to the human readable policy explaining the basis for the Consent.", 0, java.lang.Integer.MAX_VALUE, policyText);
3385        case -1484401125: /*verification*/  return new Property("verification", "", "Whether a treatment instruction (e.g. artificial respiration: yes or no) was verified with the patient, his/her family or another authorized person.", 0, java.lang.Integer.MAX_VALUE, verification);
3386        case -547120939: /*provision*/  return new Property("provision", "", "An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.", 0, 1, provision);
3387        default: return super.getNamedProperty(_hash, _name, _checkValid);
3388        }
3389
3390      }
3391
3392      @Override
3393      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3394        switch (hash) {
3395        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3396        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ConsentState>
3397        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
3398        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
3399        case 1792749467: /*dateTime*/ return this.dateTime == null ? new Base[0] : new Base[] {this.dateTime}; // DateTimeType
3400        case 280295423: /*grantor*/ return this.grantor == null ? new Base[0] : this.grantor.toArray(new Base[this.grantor.size()]); // Reference
3401        case 280295100: /*grantee*/ return this.grantee == null ? new Base[0] : this.grantee.toArray(new Base[this.grantee.size()]); // Reference
3402        case 835260333: /*manager*/ return this.manager == null ? new Base[0] : this.manager.toArray(new Base[this.manager.size()]); // Reference
3403        case 637428636: /*controller*/ return this.controller == null ? new Base[0] : this.controller.toArray(new Base[this.controller.size()]); // Reference
3404        case 1964406686: /*sourceAttachment*/ return this.sourceAttachment == null ? new Base[0] : this.sourceAttachment.toArray(new Base[this.sourceAttachment.size()]); // Attachment
3405        case -244259472: /*sourceReference*/ return this.sourceReference == null ? new Base[0] : this.sourceReference.toArray(new Base[this.sourceReference.size()]); // Reference
3406        case -1780301690: /*regulatoryBasis*/ return this.regulatoryBasis == null ? new Base[0] : this.regulatoryBasis.toArray(new Base[this.regulatoryBasis.size()]); // CodeableConcept
3407        case 2138287660: /*policyBasis*/ return this.policyBasis == null ? new Base[0] : new Base[] {this.policyBasis}; // ConsentPolicyBasisComponent
3408        case 1593537919: /*policyText*/ return this.policyText == null ? new Base[0] : this.policyText.toArray(new Base[this.policyText.size()]); // Reference
3409        case -1484401125: /*verification*/ return this.verification == null ? new Base[0] : this.verification.toArray(new Base[this.verification.size()]); // ConsentVerificationComponent
3410        case -547120939: /*provision*/ return this.provision == null ? new Base[0] : new Base[] {this.provision}; // ProvisionComponent
3411        default: return super.getProperty(hash, name, checkValid);
3412        }
3413
3414      }
3415
3416      @Override
3417      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3418        switch (hash) {
3419        case -1618432855: // identifier
3420          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
3421          return value;
3422        case -892481550: // status
3423          value = new ConsentStateEnumFactory().fromType(TypeConvertor.castToCode(value));
3424          this.status = (Enumeration) value; // Enumeration<ConsentState>
3425          return value;
3426        case 50511102: // category
3427          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3428          return value;
3429        case -1867885268: // subject
3430          this.subject = TypeConvertor.castToReference(value); // Reference
3431          return value;
3432        case 1792749467: // dateTime
3433          this.dateTime = TypeConvertor.castToDateTime(value); // DateTimeType
3434          return value;
3435        case 280295423: // grantor
3436          this.getGrantor().add(TypeConvertor.castToReference(value)); // Reference
3437          return value;
3438        case 280295100: // grantee
3439          this.getGrantee().add(TypeConvertor.castToReference(value)); // Reference
3440          return value;
3441        case 835260333: // manager
3442          this.getManager().add(TypeConvertor.castToReference(value)); // Reference
3443          return value;
3444        case 637428636: // controller
3445          this.getController().add(TypeConvertor.castToReference(value)); // Reference
3446          return value;
3447        case 1964406686: // sourceAttachment
3448          this.getSourceAttachment().add(TypeConvertor.castToAttachment(value)); // Attachment
3449          return value;
3450        case -244259472: // sourceReference
3451          this.getSourceReference().add(TypeConvertor.castToReference(value)); // Reference
3452          return value;
3453        case -1780301690: // regulatoryBasis
3454          this.getRegulatoryBasis().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3455          return value;
3456        case 2138287660: // policyBasis
3457          this.policyBasis = (ConsentPolicyBasisComponent) value; // ConsentPolicyBasisComponent
3458          return value;
3459        case 1593537919: // policyText
3460          this.getPolicyText().add(TypeConvertor.castToReference(value)); // Reference
3461          return value;
3462        case -1484401125: // verification
3463          this.getVerification().add((ConsentVerificationComponent) value); // ConsentVerificationComponent
3464          return value;
3465        case -547120939: // provision
3466          this.provision = (ProvisionComponent) value; // ProvisionComponent
3467          return value;
3468        default: return super.setProperty(hash, name, value);
3469        }
3470
3471      }
3472
3473      @Override
3474      public Base setProperty(String name, Base value) throws FHIRException {
3475        if (name.equals("identifier")) {
3476          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
3477        } else if (name.equals("status")) {
3478          value = new ConsentStateEnumFactory().fromType(TypeConvertor.castToCode(value));
3479          this.status = (Enumeration) value; // Enumeration<ConsentState>
3480        } else if (name.equals("category")) {
3481          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
3482        } else if (name.equals("subject")) {
3483          this.subject = TypeConvertor.castToReference(value); // Reference
3484        } else if (name.equals("dateTime")) {
3485          this.dateTime = TypeConvertor.castToDateTime(value); // DateTimeType
3486        } else if (name.equals("grantor")) {
3487          this.getGrantor().add(TypeConvertor.castToReference(value));
3488        } else if (name.equals("grantee")) {
3489          this.getGrantee().add(TypeConvertor.castToReference(value));
3490        } else if (name.equals("manager")) {
3491          this.getManager().add(TypeConvertor.castToReference(value));
3492        } else if (name.equals("controller")) {
3493          this.getController().add(TypeConvertor.castToReference(value));
3494        } else if (name.equals("sourceAttachment")) {
3495          this.getSourceAttachment().add(TypeConvertor.castToAttachment(value));
3496        } else if (name.equals("sourceReference")) {
3497          this.getSourceReference().add(TypeConvertor.castToReference(value));
3498        } else if (name.equals("regulatoryBasis")) {
3499          this.getRegulatoryBasis().add(TypeConvertor.castToCodeableConcept(value));
3500        } else if (name.equals("policyBasis")) {
3501          this.policyBasis = (ConsentPolicyBasisComponent) value; // ConsentPolicyBasisComponent
3502        } else if (name.equals("policyText")) {
3503          this.getPolicyText().add(TypeConvertor.castToReference(value));
3504        } else if (name.equals("verification")) {
3505          this.getVerification().add((ConsentVerificationComponent) value);
3506        } else if (name.equals("provision")) {
3507          this.provision = (ProvisionComponent) value; // ProvisionComponent
3508        } else
3509          return super.setProperty(name, value);
3510        return value;
3511      }
3512
3513      @Override
3514      public Base makeProperty(int hash, String name) throws FHIRException {
3515        switch (hash) {
3516        case -1618432855:  return addIdentifier(); 
3517        case -892481550:  return getStatusElement();
3518        case 50511102:  return addCategory(); 
3519        case -1867885268:  return getSubject();
3520        case 1792749467:  return getDateTimeElement();
3521        case 280295423:  return addGrantor(); 
3522        case 280295100:  return addGrantee(); 
3523        case 835260333:  return addManager(); 
3524        case 637428636:  return addController(); 
3525        case 1964406686:  return addSourceAttachment(); 
3526        case -244259472:  return addSourceReference(); 
3527        case -1780301690:  return addRegulatoryBasis(); 
3528        case 2138287660:  return getPolicyBasis();
3529        case 1593537919:  return addPolicyText(); 
3530        case -1484401125:  return addVerification(); 
3531        case -547120939:  return getProvision();
3532        default: return super.makeProperty(hash, name);
3533        }
3534
3535      }
3536
3537      @Override
3538      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3539        switch (hash) {
3540        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3541        case -892481550: /*status*/ return new String[] {"code"};
3542        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
3543        case -1867885268: /*subject*/ return new String[] {"Reference"};
3544        case 1792749467: /*dateTime*/ return new String[] {"dateTime"};
3545        case 280295423: /*grantor*/ return new String[] {"Reference"};
3546        case 280295100: /*grantee*/ return new String[] {"Reference"};
3547        case 835260333: /*manager*/ return new String[] {"Reference"};
3548        case 637428636: /*controller*/ return new String[] {"Reference"};
3549        case 1964406686: /*sourceAttachment*/ return new String[] {"Attachment"};
3550        case -244259472: /*sourceReference*/ return new String[] {"Reference"};
3551        case -1780301690: /*regulatoryBasis*/ return new String[] {"CodeableConcept"};
3552        case 2138287660: /*policyBasis*/ return new String[] {};
3553        case 1593537919: /*policyText*/ return new String[] {"Reference"};
3554        case -1484401125: /*verification*/ return new String[] {};
3555        case -547120939: /*provision*/ return new String[] {};
3556        default: return super.getTypesForProperty(hash, name);
3557        }
3558
3559      }
3560
3561      @Override
3562      public Base addChild(String name) throws FHIRException {
3563        if (name.equals("identifier")) {
3564          return addIdentifier();
3565        }
3566        else if (name.equals("status")) {
3567          throw new FHIRException("Cannot call addChild on a primitive type Consent.status");
3568        }
3569        else if (name.equals("category")) {
3570          return addCategory();
3571        }
3572        else if (name.equals("subject")) {
3573          this.subject = new Reference();
3574          return this.subject;
3575        }
3576        else if (name.equals("dateTime")) {
3577          throw new FHIRException("Cannot call addChild on a primitive type Consent.dateTime");
3578        }
3579        else if (name.equals("grantor")) {
3580          return addGrantor();
3581        }
3582        else if (name.equals("grantee")) {
3583          return addGrantee();
3584        }
3585        else if (name.equals("manager")) {
3586          return addManager();
3587        }
3588        else if (name.equals("controller")) {
3589          return addController();
3590        }
3591        else if (name.equals("sourceAttachment")) {
3592          return addSourceAttachment();
3593        }
3594        else if (name.equals("sourceReference")) {
3595          return addSourceReference();
3596        }
3597        else if (name.equals("regulatoryBasis")) {
3598          return addRegulatoryBasis();
3599        }
3600        else if (name.equals("policyBasis")) {
3601          this.policyBasis = new ConsentPolicyBasisComponent();
3602          return this.policyBasis;
3603        }
3604        else if (name.equals("policyText")) {
3605          return addPolicyText();
3606        }
3607        else if (name.equals("verification")) {
3608          return addVerification();
3609        }
3610        else if (name.equals("provision")) {
3611          this.provision = new ProvisionComponent();
3612          return this.provision;
3613        }
3614        else
3615          return super.addChild(name);
3616      }
3617
3618  public String fhirType() {
3619    return "Consent";
3620
3621  }
3622
3623      public Consent copy() {
3624        Consent dst = new Consent();
3625        copyValues(dst);
3626        return dst;
3627      }
3628
3629      public void copyValues(Consent dst) {
3630        super.copyValues(dst);
3631        if (identifier != null) {
3632          dst.identifier = new ArrayList<Identifier>();
3633          for (Identifier i : identifier)
3634            dst.identifier.add(i.copy());
3635        };
3636        dst.status = status == null ? null : status.copy();
3637        if (category != null) {
3638          dst.category = new ArrayList<CodeableConcept>();
3639          for (CodeableConcept i : category)
3640            dst.category.add(i.copy());
3641        };
3642        dst.subject = subject == null ? null : subject.copy();
3643        dst.dateTime = dateTime == null ? null : dateTime.copy();
3644        if (grantor != null) {
3645          dst.grantor = new ArrayList<Reference>();
3646          for (Reference i : grantor)
3647            dst.grantor.add(i.copy());
3648        };
3649        if (grantee != null) {
3650          dst.grantee = new ArrayList<Reference>();
3651          for (Reference i : grantee)
3652            dst.grantee.add(i.copy());
3653        };
3654        if (manager != null) {
3655          dst.manager = new ArrayList<Reference>();
3656          for (Reference i : manager)
3657            dst.manager.add(i.copy());
3658        };
3659        if (controller != null) {
3660          dst.controller = new ArrayList<Reference>();
3661          for (Reference i : controller)
3662            dst.controller.add(i.copy());
3663        };
3664        if (sourceAttachment != null) {
3665          dst.sourceAttachment = new ArrayList<Attachment>();
3666          for (Attachment i : sourceAttachment)
3667            dst.sourceAttachment.add(i.copy());
3668        };
3669        if (sourceReference != null) {
3670          dst.sourceReference = new ArrayList<Reference>();
3671          for (Reference i : sourceReference)
3672            dst.sourceReference.add(i.copy());
3673        };
3674        if (regulatoryBasis != null) {
3675          dst.regulatoryBasis = new ArrayList<CodeableConcept>();
3676          for (CodeableConcept i : regulatoryBasis)
3677            dst.regulatoryBasis.add(i.copy());
3678        };
3679        dst.policyBasis = policyBasis == null ? null : policyBasis.copy();
3680        if (policyText != null) {
3681          dst.policyText = new ArrayList<Reference>();
3682          for (Reference i : policyText)
3683            dst.policyText.add(i.copy());
3684        };
3685        if (verification != null) {
3686          dst.verification = new ArrayList<ConsentVerificationComponent>();
3687          for (ConsentVerificationComponent i : verification)
3688            dst.verification.add(i.copy());
3689        };
3690        dst.provision = provision == null ? null : provision.copy();
3691      }
3692
3693      protected Consent typedCopy() {
3694        return copy();
3695      }
3696
3697      @Override
3698      public boolean equalsDeep(Base other_) {
3699        if (!super.equalsDeep(other_))
3700          return false;
3701        if (!(other_ instanceof Consent))
3702          return false;
3703        Consent o = (Consent) other_;
3704        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(category, o.category, true)
3705           && compareDeep(subject, o.subject, true) && compareDeep(dateTime, o.dateTime, true) && compareDeep(grantor, o.grantor, true)
3706           && compareDeep(grantee, o.grantee, true) && compareDeep(manager, o.manager, true) && compareDeep(controller, o.controller, true)
3707           && compareDeep(sourceAttachment, o.sourceAttachment, true) && compareDeep(sourceReference, o.sourceReference, true)
3708           && compareDeep(regulatoryBasis, o.regulatoryBasis, true) && compareDeep(policyBasis, o.policyBasis, true)
3709           && compareDeep(policyText, o.policyText, true) && compareDeep(verification, o.verification, true)
3710           && compareDeep(provision, o.provision, true);
3711      }
3712
3713      @Override
3714      public boolean equalsShallow(Base other_) {
3715        if (!super.equalsShallow(other_))
3716          return false;
3717        if (!(other_ instanceof Consent))
3718          return false;
3719        Consent o = (Consent) other_;
3720        return compareValues(status, o.status, true) && compareValues(dateTime, o.dateTime, true);
3721      }
3722
3723      public boolean isEmpty() {
3724        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, category
3725          , subject, dateTime, grantor, grantee, manager, controller, sourceAttachment, sourceReference
3726          , regulatoryBasis, policyBasis, policyText, verification, provision);
3727      }
3728
3729  @Override
3730  public ResourceType getResourceType() {
3731    return ResourceType.Consent;
3732   }
3733
3734 /**
3735   * Search parameter: <b>action</b>
3736   * <p>
3737   * Description: <b>Actions controlled by this rule</b><br>
3738   * Type: <b>token</b><br>
3739   * Path: <b>Consent.provision.action</b><br>
3740   * </p>
3741   */
3742  @SearchParamDefinition(name="action", path="Consent.provision.action", description="Actions controlled by this rule", type="token" )
3743  public static final String SP_ACTION = "action";
3744 /**
3745   * <b>Fluent Client</b> search parameter constant for <b>action</b>
3746   * <p>
3747   * Description: <b>Actions controlled by this rule</b><br>
3748   * Type: <b>token</b><br>
3749   * Path: <b>Consent.provision.action</b><br>
3750   * </p>
3751   */
3752  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTION);
3753
3754 /**
3755   * Search parameter: <b>actor</b>
3756   * <p>
3757   * Description: <b>Resource for the actor (or group, by role)</b><br>
3758   * Type: <b>reference</b><br>
3759   * Path: <b>Consent.provision.actor.reference</b><br>
3760   * </p>
3761   */
3762  @SearchParamDefinition(name="actor", path="Consent.provision.actor.reference", description="Resource for the actor (or group, by role)", type="reference", target={CareTeam.class, Device.class, Group.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
3763  public static final String SP_ACTOR = "actor";
3764 /**
3765   * <b>Fluent Client</b> search parameter constant for <b>actor</b>
3766   * <p>
3767   * Description: <b>Resource for the actor (or group, by role)</b><br>
3768   * Type: <b>reference</b><br>
3769   * Path: <b>Consent.provision.actor.reference</b><br>
3770   * </p>
3771   */
3772  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTOR);
3773
3774/**
3775   * Constant for fluent queries to be used to add include statements. Specifies
3776   * the path value of "<b>Consent:actor</b>".
3777   */
3778  public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTOR = new ca.uhn.fhir.model.api.Include("Consent:actor").toLocked();
3779
3780 /**
3781   * Search parameter: <b>category</b>
3782   * <p>
3783   * Description: <b>Classification of the consent statement - for indexing/retrieval</b><br>
3784   * Type: <b>token</b><br>
3785   * Path: <b>Consent.category</b><br>
3786   * </p>
3787   */
3788  @SearchParamDefinition(name="category", path="Consent.category", description="Classification of the consent statement - for indexing/retrieval", type="token" )
3789  public static final String SP_CATEGORY = "category";
3790 /**
3791   * <b>Fluent Client</b> search parameter constant for <b>category</b>
3792   * <p>
3793   * Description: <b>Classification of the consent statement - for indexing/retrieval</b><br>
3794   * Type: <b>token</b><br>
3795   * Path: <b>Consent.category</b><br>
3796   * </p>
3797   */
3798  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
3799
3800 /**
3801   * Search parameter: <b>controller</b>
3802   * <p>
3803   * Description: <b>Consent Enforcer</b><br>
3804   * Type: <b>reference</b><br>
3805   * Path: <b>Consent.controller</b><br>
3806   * </p>
3807   */
3808  @SearchParamDefinition(name="controller", path="Consent.controller", description="Consent Enforcer", type="reference", target={HealthcareService.class, Organization.class, Patient.class, Practitioner.class } )
3809  public static final String SP_CONTROLLER = "controller";
3810 /**
3811   * <b>Fluent Client</b> search parameter constant for <b>controller</b>
3812   * <p>
3813   * Description: <b>Consent Enforcer</b><br>
3814   * Type: <b>reference</b><br>
3815   * Path: <b>Consent.controller</b><br>
3816   * </p>
3817   */
3818  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTROLLER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTROLLER);
3819
3820/**
3821   * Constant for fluent queries to be used to add include statements. Specifies
3822   * the path value of "<b>Consent:controller</b>".
3823   */
3824  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTROLLER = new ca.uhn.fhir.model.api.Include("Consent:controller").toLocked();
3825
3826 /**
3827   * Search parameter: <b>data</b>
3828   * <p>
3829   * Description: <b>The actual data reference</b><br>
3830   * Type: <b>reference</b><br>
3831   * Path: <b>Consent.provision.data.reference</b><br>
3832   * </p>
3833   */
3834  @SearchParamDefinition(name="data", path="Consent.provision.data.reference", description="The actual data reference", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, ArtifactAssessment.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceDispense.class, DeviceMetric.class, DeviceRequest.class, DeviceUsage.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceReport.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, FormularyItem.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingSelection.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, InventoryReport.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Permission.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, Transport.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
3835  public static final String SP_DATA = "data";
3836 /**
3837   * <b>Fluent Client</b> search parameter constant for <b>data</b>
3838   * <p>
3839   * Description: <b>The actual data reference</b><br>
3840   * Type: <b>reference</b><br>
3841   * Path: <b>Consent.provision.data.reference</b><br>
3842   * </p>
3843   */
3844  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DATA = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DATA);
3845
3846/**
3847   * Constant for fluent queries to be used to add include statements. Specifies
3848   * the path value of "<b>Consent:data</b>".
3849   */
3850  public static final ca.uhn.fhir.model.api.Include INCLUDE_DATA = new ca.uhn.fhir.model.api.Include("Consent:data").toLocked();
3851
3852 /**
3853   * Search parameter: <b>grantee</b>
3854   * <p>
3855   * Description: <b>Who is agreeing to the policy and rules</b><br>
3856   * Type: <b>reference</b><br>
3857   * Path: <b>Consent.grantee</b><br>
3858   * </p>
3859   */
3860  @SearchParamDefinition(name="grantee", path="Consent.grantee", description="Who is agreeing to the policy and rules", type="reference", target={CareTeam.class, HealthcareService.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
3861  public static final String SP_GRANTEE = "grantee";
3862 /**
3863   * <b>Fluent Client</b> search parameter constant for <b>grantee</b>
3864   * <p>
3865   * Description: <b>Who is agreeing to the policy and rules</b><br>
3866   * Type: <b>reference</b><br>
3867   * Path: <b>Consent.grantee</b><br>
3868   * </p>
3869   */
3870  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam GRANTEE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_GRANTEE);
3871
3872/**
3873   * Constant for fluent queries to be used to add include statements. Specifies
3874   * the path value of "<b>Consent:grantee</b>".
3875   */
3876  public static final ca.uhn.fhir.model.api.Include INCLUDE_GRANTEE = new ca.uhn.fhir.model.api.Include("Consent:grantee").toLocked();
3877
3878 /**
3879   * Search parameter: <b>manager</b>
3880   * <p>
3881   * Description: <b>Consent workflow management</b><br>
3882   * Type: <b>reference</b><br>
3883   * Path: <b>Consent.manager</b><br>
3884   * </p>
3885   */
3886  @SearchParamDefinition(name="manager", path="Consent.manager", description="Consent workflow management", type="reference", target={HealthcareService.class, Organization.class, Patient.class, Practitioner.class } )
3887  public static final String SP_MANAGER = "manager";
3888 /**
3889   * <b>Fluent Client</b> search parameter constant for <b>manager</b>
3890   * <p>
3891   * Description: <b>Consent workflow management</b><br>
3892   * Type: <b>reference</b><br>
3893   * Path: <b>Consent.manager</b><br>
3894   * </p>
3895   */
3896  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MANAGER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MANAGER);
3897
3898/**
3899   * Constant for fluent queries to be used to add include statements. Specifies
3900   * the path value of "<b>Consent:manager</b>".
3901   */
3902  public static final ca.uhn.fhir.model.api.Include INCLUDE_MANAGER = new ca.uhn.fhir.model.api.Include("Consent:manager").toLocked();
3903
3904 /**
3905   * Search parameter: <b>period</b>
3906   * <p>
3907   * Description: <b>Timeframe for this rule</b><br>
3908   * Type: <b>date</b><br>
3909   * Path: <b>Consent.provision.period</b><br>
3910   * </p>
3911   */
3912  @SearchParamDefinition(name="period", path="Consent.provision.period", description="Timeframe for this rule", type="date" )
3913  public static final String SP_PERIOD = "period";
3914 /**
3915   * <b>Fluent Client</b> search parameter constant for <b>period</b>
3916   * <p>
3917   * Description: <b>Timeframe for this rule</b><br>
3918   * Type: <b>date</b><br>
3919   * Path: <b>Consent.provision.period</b><br>
3920   * </p>
3921   */
3922  public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD);
3923
3924 /**
3925   * Search parameter: <b>purpose</b>
3926   * <p>
3927   * Description: <b>Context of activities covered by this rule</b><br>
3928   * Type: <b>token</b><br>
3929   * Path: <b>Consent.provision.purpose</b><br>
3930   * </p>
3931   */
3932  @SearchParamDefinition(name="purpose", path="Consent.provision.purpose", description="Context of activities covered by this rule", type="token" )
3933  public static final String SP_PURPOSE = "purpose";
3934 /**
3935   * <b>Fluent Client</b> search parameter constant for <b>purpose</b>
3936   * <p>
3937   * Description: <b>Context of activities covered by this rule</b><br>
3938   * Type: <b>token</b><br>
3939   * Path: <b>Consent.provision.purpose</b><br>
3940   * </p>
3941   */
3942  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PURPOSE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PURPOSE);
3943
3944 /**
3945   * Search parameter: <b>security-label</b>
3946   * <p>
3947   * Description: <b>Security Labels that define affected resources</b><br>
3948   * Type: <b>token</b><br>
3949   * Path: <b>Consent.provision.securityLabel</b><br>
3950   * </p>
3951   */
3952  @SearchParamDefinition(name="security-label", path="Consent.provision.securityLabel", description="Security Labels that define affected resources", type="token" )
3953  public static final String SP_SECURITY_LABEL = "security-label";
3954 /**
3955   * <b>Fluent Client</b> search parameter constant for <b>security-label</b>
3956   * <p>
3957   * Description: <b>Security Labels that define affected resources</b><br>
3958   * Type: <b>token</b><br>
3959   * Path: <b>Consent.provision.securityLabel</b><br>
3960   * </p>
3961   */
3962  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SECURITY_LABEL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SECURITY_LABEL);
3963
3964 /**
3965   * Search parameter: <b>source-reference</b>
3966   * <p>
3967   * Description: <b>Search by reference to a Consent, DocumentReference, Contract  or QuestionnaireResponse</b><br>
3968   * Type: <b>reference</b><br>
3969   * Path: <b>Consent.sourceReference</b><br>
3970   * </p>
3971   */
3972  @SearchParamDefinition(name="source-reference", path="Consent.sourceReference", description="Search by reference to a Consent, DocumentReference, Contract  or QuestionnaireResponse", type="reference", target={Consent.class, Contract.class, DocumentReference.class, QuestionnaireResponse.class } )
3973  public static final String SP_SOURCE_REFERENCE = "source-reference";
3974 /**
3975   * <b>Fluent Client</b> search parameter constant for <b>source-reference</b>
3976   * <p>
3977   * Description: <b>Search by reference to a Consent, DocumentReference, Contract  or QuestionnaireResponse</b><br>
3978   * Type: <b>reference</b><br>
3979   * Path: <b>Consent.sourceReference</b><br>
3980   * </p>
3981   */
3982  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE_REFERENCE);
3983
3984/**
3985   * Constant for fluent queries to be used to add include statements. Specifies
3986   * the path value of "<b>Consent:source-reference</b>".
3987   */
3988  public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE_REFERENCE = new ca.uhn.fhir.model.api.Include("Consent:source-reference").toLocked();
3989
3990 /**
3991   * Search parameter: <b>status</b>
3992   * <p>
3993   * Description: <b>draft | active | inactive | entered-in-error | unknown</b><br>
3994   * Type: <b>token</b><br>
3995   * Path: <b>Consent.status</b><br>
3996   * </p>
3997   */
3998  @SearchParamDefinition(name="status", path="Consent.status", description="draft | active | inactive | entered-in-error | unknown", type="token" )
3999  public static final String SP_STATUS = "status";
4000 /**
4001   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4002   * <p>
4003   * Description: <b>draft | active | inactive | entered-in-error | unknown</b><br>
4004   * Type: <b>token</b><br>
4005   * Path: <b>Consent.status</b><br>
4006   * </p>
4007   */
4008  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4009
4010 /**
4011   * Search parameter: <b>subject</b>
4012   * <p>
4013   * Description: <b>Who the consent applies to</b><br>
4014   * Type: <b>reference</b><br>
4015   * Path: <b>Consent.subject</b><br>
4016   * </p>
4017   */
4018  @SearchParamDefinition(name="subject", path="Consent.subject", description="Who the consent applies to", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Group.class, Patient.class, Practitioner.class } )
4019  public static final String SP_SUBJECT = "subject";
4020 /**
4021   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
4022   * <p>
4023   * Description: <b>Who the consent applies to</b><br>
4024   * Type: <b>reference</b><br>
4025   * Path: <b>Consent.subject</b><br>
4026   * </p>
4027   */
4028  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
4029
4030/**
4031   * Constant for fluent queries to be used to add include statements. Specifies
4032   * the path value of "<b>Consent:subject</b>".
4033   */
4034  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Consent:subject").toLocked();
4035
4036 /**
4037   * Search parameter: <b>verified-date</b>
4038   * <p>
4039   * Description: <b>When consent verified</b><br>
4040   * Type: <b>date</b><br>
4041   * Path: <b>Consent.verification.verificationDate</b><br>
4042   * </p>
4043   */
4044  @SearchParamDefinition(name="verified-date", path="Consent.verification.verificationDate", description="When consent verified", type="date" )
4045  public static final String SP_VERIFIED_DATE = "verified-date";
4046 /**
4047   * <b>Fluent Client</b> search parameter constant for <b>verified-date</b>
4048   * <p>
4049   * Description: <b>When consent verified</b><br>
4050   * Type: <b>date</b><br>
4051   * Path: <b>Consent.verification.verificationDate</b><br>
4052   * </p>
4053   */
4054  public static final ca.uhn.fhir.rest.gclient.DateClientParam VERIFIED_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_VERIFIED_DATE);
4055
4056 /**
4057   * Search parameter: <b>verified</b>
4058   * <p>
4059   * Description: <b>Has been verified</b><br>
4060   * Type: <b>token</b><br>
4061   * Path: <b>Consent.verification.verified</b><br>
4062   * </p>
4063   */
4064  @SearchParamDefinition(name="verified", path="Consent.verification.verified", description="Has been verified", type="token" )
4065  public static final String SP_VERIFIED = "verified";
4066 /**
4067   * <b>Fluent Client</b> search parameter constant for <b>verified</b>
4068   * <p>
4069   * Description: <b>Has been verified</b><br>
4070   * Type: <b>token</b><br>
4071   * Path: <b>Consent.verification.verified</b><br>
4072   * </p>
4073   */
4074  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERIFIED = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERIFIED);
4075
4076 /**
4077   * Search parameter: <b>date</b>
4078   * <p>
4079   * Description: <b>Multiple Resources: 
4080
4081* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
4082* [CarePlan](careplan.html): Time period plan covers
4083* [CareTeam](careteam.html): A date within the coverage time period.
4084* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
4085* [Composition](composition.html): Composition editing time
4086* [Consent](consent.html): When consent was agreed to
4087* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
4088* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
4089* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
4090* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
4091* [Flag](flag.html): Time period when flag is active
4092* [Immunization](immunization.html): Vaccination  (non)-Administration Date
4093* [List](list.html): When the list was prepared
4094* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
4095* [Procedure](procedure.html): When the procedure occurred or is occurring
4096* [RiskAssessment](riskassessment.html): When was assessment made?
4097* [SupplyRequest](supplyrequest.html): When the request was made
4098</b><br>
4099   * Type: <b>date</b><br>
4100   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
4101   * </p>
4102   */
4103  @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded\r\n* [CarePlan](careplan.html): Time period plan covers\r\n* [CareTeam](careteam.html): A date within the coverage time period.\r\n* [ClinicalImpression](clinicalimpression.html): When the assessment was documented\r\n* [Composition](composition.html): Composition editing time\r\n* [Consent](consent.html): When consent was agreed to\r\n* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report\r\n* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted\r\n* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period\r\n* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated\r\n* [Flag](flag.html): Time period when flag is active\r\n* [Immunization](immunization.html): Vaccination  (non)-Administration Date\r\n* [List](list.html): When the list was prepared\r\n* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period\r\n* [Procedure](procedure.html): When the procedure occurred or is occurring\r\n* [RiskAssessment](riskassessment.html): When was assessment made?\r\n* [SupplyRequest](supplyrequest.html): When the request was made\r\n", type="date" )
4104  public static final String SP_DATE = "date";
4105 /**
4106   * <b>Fluent Client</b> search parameter constant for <b>date</b>
4107   * <p>
4108   * Description: <b>Multiple Resources: 
4109
4110* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
4111* [CarePlan](careplan.html): Time period plan covers
4112* [CareTeam](careteam.html): A date within the coverage time period.
4113* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
4114* [Composition](composition.html): Composition editing time
4115* [Consent](consent.html): When consent was agreed to
4116* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
4117* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
4118* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
4119* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
4120* [Flag](flag.html): Time period when flag is active
4121* [Immunization](immunization.html): Vaccination  (non)-Administration Date
4122* [List](list.html): When the list was prepared
4123* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
4124* [Procedure](procedure.html): When the procedure occurred or is occurring
4125* [RiskAssessment](riskassessment.html): When was assessment made?
4126* [SupplyRequest](supplyrequest.html): When the request was made
4127</b><br>
4128   * Type: <b>date</b><br>
4129   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
4130   * </p>
4131   */
4132  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
4133
4134 /**
4135   * Search parameter: <b>identifier</b>
4136   * <p>
4137   * Description: <b>Multiple Resources: 
4138
4139* [AllergyIntolerance](allergyintolerance.html): External ids for this item
4140* [CarePlan](careplan.html): External Ids for this plan
4141* [CareTeam](careteam.html): External Ids for this team
4142* [Composition](composition.html): Version-independent identifier for the Composition
4143* [Condition](condition.html): A unique identifier of the condition record
4144* [Consent](consent.html): Identifier for this record (external references)
4145* [DetectedIssue](detectedissue.html): Unique id for the detected issue
4146* [DeviceRequest](devicerequest.html): Business identifier for request/order
4147* [DiagnosticReport](diagnosticreport.html): An identifier for the report
4148* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
4149* [DocumentReference](documentreference.html): Identifier of the attachment binary
4150* [Encounter](encounter.html): Identifier(s) by which this encounter is known
4151* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
4152* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
4153* [Goal](goal.html): External Ids for this goal
4154* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
4155* [Immunization](immunization.html): Business identifier
4156* [List](list.html): Business identifier
4157* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
4158* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
4159* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
4160* [MedicationUsage](medicationusage.html): Return statements with this external identifier
4161* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
4162* [Observation](observation.html): The unique id for a particular observation
4163* [Procedure](procedure.html): A unique identifier for a procedure
4164* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
4165* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
4166* [SupplyDelivery](supplydelivery.html): External identifier
4167* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
4168* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
4169</b><br>
4170   * Type: <b>token</b><br>
4171   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
4172   * </p>
4173   */
4174  @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [List](list.html): Business identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationUsage](medicationusage.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
4175  public static final String SP_IDENTIFIER = "identifier";
4176 /**
4177   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4178   * <p>
4179   * Description: <b>Multiple Resources: 
4180
4181* [AllergyIntolerance](allergyintolerance.html): External ids for this item
4182* [CarePlan](careplan.html): External Ids for this plan
4183* [CareTeam](careteam.html): External Ids for this team
4184* [Composition](composition.html): Version-independent identifier for the Composition
4185* [Condition](condition.html): A unique identifier of the condition record
4186* [Consent](consent.html): Identifier for this record (external references)
4187* [DetectedIssue](detectedissue.html): Unique id for the detected issue
4188* [DeviceRequest](devicerequest.html): Business identifier for request/order
4189* [DiagnosticReport](diagnosticreport.html): An identifier for the report
4190* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
4191* [DocumentReference](documentreference.html): Identifier of the attachment binary
4192* [Encounter](encounter.html): Identifier(s) by which this encounter is known
4193* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
4194* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
4195* [Goal](goal.html): External Ids for this goal
4196* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
4197* [Immunization](immunization.html): Business identifier
4198* [List](list.html): Business identifier
4199* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
4200* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
4201* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
4202* [MedicationUsage](medicationusage.html): Return statements with this external identifier
4203* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
4204* [Observation](observation.html): The unique id for a particular observation
4205* [Procedure](procedure.html): A unique identifier for a procedure
4206* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
4207* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
4208* [SupplyDelivery](supplydelivery.html): External identifier
4209* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
4210* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
4211</b><br>
4212   * Type: <b>token</b><br>
4213   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
4214   * </p>
4215   */
4216  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4217
4218 /**
4219   * Search parameter: <b>patient</b>
4220   * <p>
4221   * Description: <b>Multiple Resources: 
4222
4223* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
4224* [CarePlan](careplan.html): Who the care plan is for
4225* [CareTeam](careteam.html): Who care team is for
4226* [ClinicalImpression](clinicalimpression.html): Patient assessed
4227* [Composition](composition.html): Who and/or what the composition is about
4228* [Condition](condition.html): Who has the condition?
4229* [Consent](consent.html): Who the consent applies to
4230* [DetectedIssue](detectedissue.html): Associated patient
4231* [DeviceRequest](devicerequest.html): Individual the service is ordered for
4232* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
4233* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
4234* [DocumentManifest](documentmanifest.html): The subject of the set of documents
4235* [DocumentReference](documentreference.html): Who/what is the subject of the document
4236* [Encounter](encounter.html): The patient present at the encounter
4237* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
4238* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
4239* [Flag](flag.html): The identity of a subject to list flags for
4240* [Goal](goal.html): Who this goal is intended for
4241* [ImagingStudy](imagingstudy.html): Who the study is about
4242* [Immunization](immunization.html): The patient for the vaccination record
4243* [List](list.html): If all resources have the same subject
4244* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
4245* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
4246* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
4247* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
4248* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
4249* [Observation](observation.html): The subject that the observation is about (if patient)
4250* [Procedure](procedure.html): Search by subject - a patient
4251* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
4252* [ServiceRequest](servicerequest.html): Search by subject - a patient
4253* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
4254* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
4255</b><br>
4256   * Type: <b>reference</b><br>
4257   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
4258   * </p>
4259   */
4260  @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentManifest](documentmanifest.html): The subject of the set of documents\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [List](list.html): If all resources have the same subject\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", target={Patient.class } )
4261  public static final String SP_PATIENT = "patient";
4262 /**
4263   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
4264   * <p>
4265   * Description: <b>Multiple Resources: 
4266
4267* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
4268* [CarePlan](careplan.html): Who the care plan is for
4269* [CareTeam](careteam.html): Who care team is for
4270* [ClinicalImpression](clinicalimpression.html): Patient assessed
4271* [Composition](composition.html): Who and/or what the composition is about
4272* [Condition](condition.html): Who has the condition?
4273* [Consent](consent.html): Who the consent applies to
4274* [DetectedIssue](detectedissue.html): Associated patient
4275* [DeviceRequest](devicerequest.html): Individual the service is ordered for
4276* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
4277* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
4278* [DocumentManifest](documentmanifest.html): The subject of the set of documents
4279* [DocumentReference](documentreference.html): Who/what is the subject of the document
4280* [Encounter](encounter.html): The patient present at the encounter
4281* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
4282* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
4283* [Flag](flag.html): The identity of a subject to list flags for
4284* [Goal](goal.html): Who this goal is intended for
4285* [ImagingStudy](imagingstudy.html): Who the study is about
4286* [Immunization](immunization.html): The patient for the vaccination record
4287* [List](list.html): If all resources have the same subject
4288* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
4289* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
4290* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
4291* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
4292* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
4293* [Observation](observation.html): The subject that the observation is about (if patient)
4294* [Procedure](procedure.html): Search by subject - a patient
4295* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
4296* [ServiceRequest](servicerequest.html): Search by subject - a patient
4297* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
4298* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
4299</b><br>
4300   * Type: <b>reference</b><br>
4301   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
4302   * </p>
4303   */
4304  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
4305
4306/**
4307   * Constant for fluent queries to be used to add include statements. Specifies
4308   * the path value of "<b>Consent:patient</b>".
4309   */
4310  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Consent:patient").toLocked();
4311
4312
4313}
4314