001package org.hl7.fhir.r4b.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, Dec 31, 2021 05:58+1100 for FHIR v4.3.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r4b.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, 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 "Opt Out";
236            case PERMIT: return "Opt In";
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 has been proposed but not yet agreed to by all parties. The negotiation stage.
287         */
288        PROPOSED, 
289        /**
290         * The consent is to be followed and enforced.
291         */
292        ACTIVE, 
293        /**
294         * The consent has been rejected by one or more of the parties.
295         */
296        REJECTED, 
297        /**
298         * The consent is terminated or replaced.
299         */
300        INACTIVE, 
301        /**
302         * The consent was created wrongly (e.g. wrong patient) and should be ignored.
303         */
304        ENTEREDINERROR, 
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 ("proposed".equals(codeString))
315          return PROPOSED;
316        if ("active".equals(codeString))
317          return ACTIVE;
318        if ("rejected".equals(codeString))
319          return REJECTED;
320        if ("inactive".equals(codeString))
321          return INACTIVE;
322        if ("entered-in-error".equals(codeString))
323          return ENTEREDINERROR;
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 PROPOSED: return "proposed";
333            case ACTIVE: return "active";
334            case REJECTED: return "rejected";
335            case INACTIVE: return "inactive";
336            case ENTEREDINERROR: return "entered-in-error";
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 PROPOSED: return "http://hl7.org/fhir/consent-state-codes";
345            case ACTIVE: return "http://hl7.org/fhir/consent-state-codes";
346            case REJECTED: return "http://hl7.org/fhir/consent-state-codes";
347            case INACTIVE: return "http://hl7.org/fhir/consent-state-codes";
348            case ENTEREDINERROR: 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 PROPOSED: return "The consent has been proposed but not yet agreed to by all parties. The negotiation stage.";
357            case ACTIVE: return "The consent is to be followed and enforced.";
358            case REJECTED: return "The consent has been rejected by one or more of the parties.";
359            case INACTIVE: return "The consent is terminated or replaced.";
360            case ENTEREDINERROR: return "The consent was created wrongly (e.g. wrong patient) and should be ignored.";
361            case NULL: return null;
362            default: return "?";
363          }
364        }
365        public String getDisplay() {
366          switch (this) {
367            case DRAFT: return "Pending";
368            case PROPOSED: return "Proposed";
369            case ACTIVE: return "Active";
370            case REJECTED: return "Rejected";
371            case INACTIVE: return "Inactive";
372            case ENTEREDINERROR: return "Entered in Error";
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 ("proposed".equals(codeString))
387          return ConsentState.PROPOSED;
388        if ("active".equals(codeString))
389          return ConsentState.ACTIVE;
390        if ("rejected".equals(codeString))
391          return ConsentState.REJECTED;
392        if ("inactive".equals(codeString))
393          return ConsentState.INACTIVE;
394        if ("entered-in-error".equals(codeString))
395          return ConsentState.ENTEREDINERROR;
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 ("proposed".equals(codeString))
409          return new Enumeration<ConsentState>(this, ConsentState.PROPOSED);
410        if ("active".equals(codeString))
411          return new Enumeration<ConsentState>(this, ConsentState.ACTIVE);
412        if ("rejected".equals(codeString))
413          return new Enumeration<ConsentState>(this, ConsentState.REJECTED);
414        if ("inactive".equals(codeString))
415          return new Enumeration<ConsentState>(this, ConsentState.INACTIVE);
416        if ("entered-in-error".equals(codeString))
417          return new Enumeration<ConsentState>(this, ConsentState.ENTEREDINERROR);
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.PROPOSED)
424        return "proposed";
425      if (code == ConsentState.ACTIVE)
426        return "active";
427      if (code == ConsentState.REJECTED)
428        return "rejected";
429      if (code == ConsentState.INACTIVE)
430        return "inactive";
431      if (code == ConsentState.ENTEREDINERROR)
432        return "entered-in-error";
433      return "?";
434      }
435    public String toSystem(ConsentState code) {
436      return code.getSystem();
437      }
438    }
439
440    @Block()
441    public static class ConsentPolicyComponent extends BackboneElement implements IBaseBackboneElement {
442        /**
443         * Entity or Organization having regulatory jurisdiction or accountability for  enforcing policies pertaining to Consent Directives.
444         */
445        @Child(name = "authority", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=false)
446        @Description(shortDefinition="Enforcement source for policy", formalDefinition="Entity or Organization having regulatory jurisdiction or accountability for  enforcing policies pertaining to Consent Directives." )
447        protected UriType authority;
448
449        /**
450         * The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.
451         */
452        @Child(name = "uri", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false)
453        @Description(shortDefinition="Specific policy covered by this consent", formalDefinition="The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law." )
454        protected UriType uri;
455
456        private static final long serialVersionUID = 672275705L;
457
458    /**
459     * Constructor
460     */
461      public ConsentPolicyComponent() {
462        super();
463      }
464
465        /**
466         * @return {@link #authority} (Entity or Organization having regulatory jurisdiction or accountability for  enforcing policies pertaining to Consent Directives.). This is the underlying object with id, value and extensions. The accessor "getAuthority" gives direct access to the value
467         */
468        public UriType getAuthorityElement() { 
469          if (this.authority == null)
470            if (Configuration.errorOnAutoCreate())
471              throw new Error("Attempt to auto-create ConsentPolicyComponent.authority");
472            else if (Configuration.doAutoCreate())
473              this.authority = new UriType(); // bb
474          return this.authority;
475        }
476
477        public boolean hasAuthorityElement() { 
478          return this.authority != null && !this.authority.isEmpty();
479        }
480
481        public boolean hasAuthority() { 
482          return this.authority != null && !this.authority.isEmpty();
483        }
484
485        /**
486         * @param value {@link #authority} (Entity or Organization having regulatory jurisdiction or accountability for  enforcing policies pertaining to Consent Directives.). This is the underlying object with id, value and extensions. The accessor "getAuthority" gives direct access to the value
487         */
488        public ConsentPolicyComponent setAuthorityElement(UriType value) { 
489          this.authority = value;
490          return this;
491        }
492
493        /**
494         * @return Entity or Organization having regulatory jurisdiction or accountability for  enforcing policies pertaining to Consent Directives.
495         */
496        public String getAuthority() { 
497          return this.authority == null ? null : this.authority.getValue();
498        }
499
500        /**
501         * @param value Entity or Organization having regulatory jurisdiction or accountability for  enforcing policies pertaining to Consent Directives.
502         */
503        public ConsentPolicyComponent setAuthority(String value) { 
504          if (Utilities.noString(value))
505            this.authority = null;
506          else {
507            if (this.authority == null)
508              this.authority = new UriType();
509            this.authority.setValue(value);
510          }
511          return this;
512        }
513
514        /**
515         * @return {@link #uri} (The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
516         */
517        public UriType getUriElement() { 
518          if (this.uri == null)
519            if (Configuration.errorOnAutoCreate())
520              throw new Error("Attempt to auto-create ConsentPolicyComponent.uri");
521            else if (Configuration.doAutoCreate())
522              this.uri = new UriType(); // bb
523          return this.uri;
524        }
525
526        public boolean hasUriElement() { 
527          return this.uri != null && !this.uri.isEmpty();
528        }
529
530        public boolean hasUri() { 
531          return this.uri != null && !this.uri.isEmpty();
532        }
533
534        /**
535         * @param value {@link #uri} (The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
536         */
537        public ConsentPolicyComponent setUriElement(UriType value) { 
538          this.uri = value;
539          return this;
540        }
541
542        /**
543         * @return The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.
544         */
545        public String getUri() { 
546          return this.uri == null ? null : this.uri.getValue();
547        }
548
549        /**
550         * @param value The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.
551         */
552        public ConsentPolicyComponent setUri(String value) { 
553          if (Utilities.noString(value))
554            this.uri = null;
555          else {
556            if (this.uri == null)
557              this.uri = new UriType();
558            this.uri.setValue(value);
559          }
560          return this;
561        }
562
563        protected void listChildren(List<Property> children) {
564          super.listChildren(children);
565          children.add(new Property("authority", "uri", "Entity or Organization having regulatory jurisdiction or accountability for  enforcing policies pertaining to Consent Directives.", 0, 1, authority));
566          children.add(new Property("uri", "uri", "The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.", 0, 1, uri));
567        }
568
569        @Override
570        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
571          switch (_hash) {
572          case 1475610435: /*authority*/  return new Property("authority", "uri", "Entity or Organization having regulatory jurisdiction or accountability for  enforcing policies pertaining to Consent Directives.", 0, 1, authority);
573          case 116076: /*uri*/  return new Property("uri", "uri", "The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.", 0, 1, uri);
574          default: return super.getNamedProperty(_hash, _name, _checkValid);
575          }
576
577        }
578
579      @Override
580      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
581        switch (hash) {
582        case 1475610435: /*authority*/ return this.authority == null ? new Base[0] : new Base[] {this.authority}; // UriType
583        case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // UriType
584        default: return super.getProperty(hash, name, checkValid);
585        }
586
587      }
588
589      @Override
590      public Base setProperty(int hash, String name, Base value) throws FHIRException {
591        switch (hash) {
592        case 1475610435: // authority
593          this.authority = TypeConvertor.castToUri(value); // UriType
594          return value;
595        case 116076: // uri
596          this.uri = TypeConvertor.castToUri(value); // UriType
597          return value;
598        default: return super.setProperty(hash, name, value);
599        }
600
601      }
602
603      @Override
604      public Base setProperty(String name, Base value) throws FHIRException {
605        if (name.equals("authority")) {
606          this.authority = TypeConvertor.castToUri(value); // UriType
607        } else if (name.equals("uri")) {
608          this.uri = TypeConvertor.castToUri(value); // UriType
609        } else
610          return super.setProperty(name, value);
611        return value;
612      }
613
614      @Override
615      public Base makeProperty(int hash, String name) throws FHIRException {
616        switch (hash) {
617        case 1475610435:  return getAuthorityElement();
618        case 116076:  return getUriElement();
619        default: return super.makeProperty(hash, name);
620        }
621
622      }
623
624      @Override
625      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
626        switch (hash) {
627        case 1475610435: /*authority*/ return new String[] {"uri"};
628        case 116076: /*uri*/ return new String[] {"uri"};
629        default: return super.getTypesForProperty(hash, name);
630        }
631
632      }
633
634      @Override
635      public Base addChild(String name) throws FHIRException {
636        if (name.equals("authority")) {
637          throw new FHIRException("Cannot call addChild on a primitive type Consent.policy.authority");
638        }
639        else if (name.equals("uri")) {
640          throw new FHIRException("Cannot call addChild on a primitive type Consent.policy.uri");
641        }
642        else
643          return super.addChild(name);
644      }
645
646      public ConsentPolicyComponent copy() {
647        ConsentPolicyComponent dst = new ConsentPolicyComponent();
648        copyValues(dst);
649        return dst;
650      }
651
652      public void copyValues(ConsentPolicyComponent dst) {
653        super.copyValues(dst);
654        dst.authority = authority == null ? null : authority.copy();
655        dst.uri = uri == null ? null : uri.copy();
656      }
657
658      @Override
659      public boolean equalsDeep(Base other_) {
660        if (!super.equalsDeep(other_))
661          return false;
662        if (!(other_ instanceof ConsentPolicyComponent))
663          return false;
664        ConsentPolicyComponent o = (ConsentPolicyComponent) other_;
665        return compareDeep(authority, o.authority, true) && compareDeep(uri, o.uri, true);
666      }
667
668      @Override
669      public boolean equalsShallow(Base other_) {
670        if (!super.equalsShallow(other_))
671          return false;
672        if (!(other_ instanceof ConsentPolicyComponent))
673          return false;
674        ConsentPolicyComponent o = (ConsentPolicyComponent) other_;
675        return compareValues(authority, o.authority, true) && compareValues(uri, o.uri, true);
676      }
677
678      public boolean isEmpty() {
679        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(authority, uri);
680      }
681
682  public String fhirType() {
683    return "Consent.policy";
684
685  }
686
687  }
688
689    @Block()
690    public static class ConsentVerificationComponent extends BackboneElement implements IBaseBackboneElement {
691        /**
692         * Has the instruction been verified.
693         */
694        @Child(name = "verified", type = {BooleanType.class}, order=1, min=1, max=1, modifier=false, summary=true)
695        @Description(shortDefinition="Has been verified", formalDefinition="Has the instruction been verified." )
696        protected BooleanType verified;
697
698        /**
699         * Who verified the instruction (Patient, Relative or other Authorized Person).
700         */
701        @Child(name = "verifiedWith", type = {Patient.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=false)
702        @Description(shortDefinition="Person who verified", formalDefinition="Who verified the instruction (Patient, Relative or other Authorized Person)." )
703        protected Reference verifiedWith;
704
705        /**
706         * Date verification was collected.
707         */
708        @Child(name = "verificationDate", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
709        @Description(shortDefinition="When consent verified", formalDefinition="Date verification was collected." )
710        protected DateTimeType verificationDate;
711
712        private static final long serialVersionUID = 2114191641L;
713
714    /**
715     * Constructor
716     */
717      public ConsentVerificationComponent() {
718        super();
719      }
720
721    /**
722     * Constructor
723     */
724      public ConsentVerificationComponent(boolean verified) {
725        super();
726        this.setVerified(verified);
727      }
728
729        /**
730         * @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
731         */
732        public BooleanType getVerifiedElement() { 
733          if (this.verified == null)
734            if (Configuration.errorOnAutoCreate())
735              throw new Error("Attempt to auto-create ConsentVerificationComponent.verified");
736            else if (Configuration.doAutoCreate())
737              this.verified = new BooleanType(); // bb
738          return this.verified;
739        }
740
741        public boolean hasVerifiedElement() { 
742          return this.verified != null && !this.verified.isEmpty();
743        }
744
745        public boolean hasVerified() { 
746          return this.verified != null && !this.verified.isEmpty();
747        }
748
749        /**
750         * @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
751         */
752        public ConsentVerificationComponent setVerifiedElement(BooleanType value) { 
753          this.verified = value;
754          return this;
755        }
756
757        /**
758         * @return Has the instruction been verified.
759         */
760        public boolean getVerified() { 
761          return this.verified == null || this.verified.isEmpty() ? false : this.verified.getValue();
762        }
763
764        /**
765         * @param value Has the instruction been verified.
766         */
767        public ConsentVerificationComponent setVerified(boolean value) { 
768            if (this.verified == null)
769              this.verified = new BooleanType();
770            this.verified.setValue(value);
771          return this;
772        }
773
774        /**
775         * @return {@link #verifiedWith} (Who verified the instruction (Patient, Relative or other Authorized Person).)
776         */
777        public Reference getVerifiedWith() { 
778          if (this.verifiedWith == null)
779            if (Configuration.errorOnAutoCreate())
780              throw new Error("Attempt to auto-create ConsentVerificationComponent.verifiedWith");
781            else if (Configuration.doAutoCreate())
782              this.verifiedWith = new Reference(); // cc
783          return this.verifiedWith;
784        }
785
786        public boolean hasVerifiedWith() { 
787          return this.verifiedWith != null && !this.verifiedWith.isEmpty();
788        }
789
790        /**
791         * @param value {@link #verifiedWith} (Who verified the instruction (Patient, Relative or other Authorized Person).)
792         */
793        public ConsentVerificationComponent setVerifiedWith(Reference value) { 
794          this.verifiedWith = value;
795          return this;
796        }
797
798        /**
799         * @return {@link #verificationDate} (Date verification was collected.). This is the underlying object with id, value and extensions. The accessor "getVerificationDate" gives direct access to the value
800         */
801        public DateTimeType getVerificationDateElement() { 
802          if (this.verificationDate == null)
803            if (Configuration.errorOnAutoCreate())
804              throw new Error("Attempt to auto-create ConsentVerificationComponent.verificationDate");
805            else if (Configuration.doAutoCreate())
806              this.verificationDate = new DateTimeType(); // bb
807          return this.verificationDate;
808        }
809
810        public boolean hasVerificationDateElement() { 
811          return this.verificationDate != null && !this.verificationDate.isEmpty();
812        }
813
814        public boolean hasVerificationDate() { 
815          return this.verificationDate != null && !this.verificationDate.isEmpty();
816        }
817
818        /**
819         * @param value {@link #verificationDate} (Date verification was collected.). This is the underlying object with id, value and extensions. The accessor "getVerificationDate" gives direct access to the value
820         */
821        public ConsentVerificationComponent setVerificationDateElement(DateTimeType value) { 
822          this.verificationDate = value;
823          return this;
824        }
825
826        /**
827         * @return Date verification was collected.
828         */
829        public Date getVerificationDate() { 
830          return this.verificationDate == null ? null : this.verificationDate.getValue();
831        }
832
833        /**
834         * @param value Date verification was collected.
835         */
836        public ConsentVerificationComponent setVerificationDate(Date value) { 
837          if (value == null)
838            this.verificationDate = null;
839          else {
840            if (this.verificationDate == null)
841              this.verificationDate = new DateTimeType();
842            this.verificationDate.setValue(value);
843          }
844          return this;
845        }
846
847        protected void listChildren(List<Property> children) {
848          super.listChildren(children);
849          children.add(new Property("verified", "boolean", "Has the instruction been verified.", 0, 1, verified));
850          children.add(new Property("verifiedWith", "Reference(Patient|RelatedPerson)", "Who verified the instruction (Patient, Relative or other Authorized Person).", 0, 1, verifiedWith));
851          children.add(new Property("verificationDate", "dateTime", "Date verification was collected.", 0, 1, verificationDate));
852        }
853
854        @Override
855        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
856          switch (_hash) {
857          case -1994383672: /*verified*/  return new Property("verified", "boolean", "Has the instruction been verified.", 0, 1, verified);
858          case -1425236050: /*verifiedWith*/  return new Property("verifiedWith", "Reference(Patient|RelatedPerson)", "Who verified the instruction (Patient, Relative or other Authorized Person).", 0, 1, verifiedWith);
859          case 642233449: /*verificationDate*/  return new Property("verificationDate", "dateTime", "Date verification was collected.", 0, 1, verificationDate);
860          default: return super.getNamedProperty(_hash, _name, _checkValid);
861          }
862
863        }
864
865      @Override
866      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
867        switch (hash) {
868        case -1994383672: /*verified*/ return this.verified == null ? new Base[0] : new Base[] {this.verified}; // BooleanType
869        case -1425236050: /*verifiedWith*/ return this.verifiedWith == null ? new Base[0] : new Base[] {this.verifiedWith}; // Reference
870        case 642233449: /*verificationDate*/ return this.verificationDate == null ? new Base[0] : new Base[] {this.verificationDate}; // DateTimeType
871        default: return super.getProperty(hash, name, checkValid);
872        }
873
874      }
875
876      @Override
877      public Base setProperty(int hash, String name, Base value) throws FHIRException {
878        switch (hash) {
879        case -1994383672: // verified
880          this.verified = TypeConvertor.castToBoolean(value); // BooleanType
881          return value;
882        case -1425236050: // verifiedWith
883          this.verifiedWith = TypeConvertor.castToReference(value); // Reference
884          return value;
885        case 642233449: // verificationDate
886          this.verificationDate = TypeConvertor.castToDateTime(value); // DateTimeType
887          return value;
888        default: return super.setProperty(hash, name, value);
889        }
890
891      }
892
893      @Override
894      public Base setProperty(String name, Base value) throws FHIRException {
895        if (name.equals("verified")) {
896          this.verified = TypeConvertor.castToBoolean(value); // BooleanType
897        } else if (name.equals("verifiedWith")) {
898          this.verifiedWith = TypeConvertor.castToReference(value); // Reference
899        } else if (name.equals("verificationDate")) {
900          this.verificationDate = TypeConvertor.castToDateTime(value); // DateTimeType
901        } else
902          return super.setProperty(name, value);
903        return value;
904      }
905
906      @Override
907      public Base makeProperty(int hash, String name) throws FHIRException {
908        switch (hash) {
909        case -1994383672:  return getVerifiedElement();
910        case -1425236050:  return getVerifiedWith();
911        case 642233449:  return getVerificationDateElement();
912        default: return super.makeProperty(hash, name);
913        }
914
915      }
916
917      @Override
918      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
919        switch (hash) {
920        case -1994383672: /*verified*/ return new String[] {"boolean"};
921        case -1425236050: /*verifiedWith*/ return new String[] {"Reference"};
922        case 642233449: /*verificationDate*/ return new String[] {"dateTime"};
923        default: return super.getTypesForProperty(hash, name);
924        }
925
926      }
927
928      @Override
929      public Base addChild(String name) throws FHIRException {
930        if (name.equals("verified")) {
931          throw new FHIRException("Cannot call addChild on a primitive type Consent.verification.verified");
932        }
933        else if (name.equals("verifiedWith")) {
934          this.verifiedWith = new Reference();
935          return this.verifiedWith;
936        }
937        else if (name.equals("verificationDate")) {
938          throw new FHIRException("Cannot call addChild on a primitive type Consent.verification.verificationDate");
939        }
940        else
941          return super.addChild(name);
942      }
943
944      public ConsentVerificationComponent copy() {
945        ConsentVerificationComponent dst = new ConsentVerificationComponent();
946        copyValues(dst);
947        return dst;
948      }
949
950      public void copyValues(ConsentVerificationComponent dst) {
951        super.copyValues(dst);
952        dst.verified = verified == null ? null : verified.copy();
953        dst.verifiedWith = verifiedWith == null ? null : verifiedWith.copy();
954        dst.verificationDate = verificationDate == null ? null : verificationDate.copy();
955      }
956
957      @Override
958      public boolean equalsDeep(Base other_) {
959        if (!super.equalsDeep(other_))
960          return false;
961        if (!(other_ instanceof ConsentVerificationComponent))
962          return false;
963        ConsentVerificationComponent o = (ConsentVerificationComponent) other_;
964        return compareDeep(verified, o.verified, true) && compareDeep(verifiedWith, o.verifiedWith, true)
965           && compareDeep(verificationDate, o.verificationDate, true);
966      }
967
968      @Override
969      public boolean equalsShallow(Base other_) {
970        if (!super.equalsShallow(other_))
971          return false;
972        if (!(other_ instanceof ConsentVerificationComponent))
973          return false;
974        ConsentVerificationComponent o = (ConsentVerificationComponent) other_;
975        return compareValues(verified, o.verified, true) && compareValues(verificationDate, o.verificationDate, true)
976          ;
977      }
978
979      public boolean isEmpty() {
980        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(verified, verifiedWith, verificationDate
981          );
982      }
983
984  public String fhirType() {
985    return "Consent.verification";
986
987  }
988
989  }
990
991    @Block()
992    public static class ProvisionComponent extends BackboneElement implements IBaseBackboneElement {
993        /**
994         * Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules.
995         */
996        @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true)
997        @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." )
998        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-provision-type")
999        protected Enumeration<ConsentProvisionType> type;
1000
1001        /**
1002         * The timeframe in this rule is valid.
1003         */
1004        @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true)
1005        @Description(shortDefinition="Timeframe for this rule", formalDefinition="The timeframe in this rule is valid." )
1006        protected Period period;
1007
1008        /**
1009         * 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').
1010         */
1011        @Child(name = "actor", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1012        @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')." )
1013        protected List<ProvisionActorComponent> actor;
1014
1015        /**
1016         * Actions controlled by this Rule.
1017         */
1018        @Child(name = "action", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1019        @Description(shortDefinition="Actions controlled by this rule", formalDefinition="Actions controlled by this Rule." )
1020        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-action")
1021        protected List<CodeableConcept> action;
1022
1023        /**
1024         * A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception.
1025         */
1026        @Child(name = "securityLabel", type = {Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1027        @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." )
1028        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/security-labels")
1029        protected List<Coding> securityLabel;
1030
1031        /**
1032         * The context of the activities a user is taking - why the user is accessing the data - that are controlled by this rule.
1033         */
1034        @Child(name = "purpose", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1035        @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." )
1036        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-PurposeOfUse")
1037        protected List<Coding> purpose;
1038
1039        /**
1040         * 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.
1041         */
1042        @Child(name = "class", type = {Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1043        @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." )
1044        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-content-class")
1045        protected List<Coding> class_;
1046
1047        /**
1048         * If this code is found in an instance, then the rule applies.
1049         */
1050        @Child(name = "code", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1051        @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." )
1052        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-content-code")
1053        protected List<CodeableConcept> code;
1054
1055        /**
1056         * Clinical or Operational Relevant period of time that bounds the data controlled by this rule.
1057         */
1058        @Child(name = "dataPeriod", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=true)
1059        @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." )
1060        protected Period dataPeriod;
1061
1062        /**
1063         * The resources controlled by this rule if specific resources are referenced.
1064         */
1065        @Child(name = "data", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1066        @Description(shortDefinition="Data controlled by this rule", formalDefinition="The resources controlled by this rule if specific resources are referenced." )
1067        protected List<ProvisionDataComponent> data;
1068
1069        /**
1070         * Rules which provide exceptions to the base rule or subrules.
1071         */
1072        @Child(name = "provision", type = {ProvisionComponent.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1073        @Description(shortDefinition="Nested Exception Rules", formalDefinition="Rules which provide exceptions to the base rule or subrules." )
1074        protected List<ProvisionComponent> provision;
1075
1076        private static final long serialVersionUID = 924910269L;
1077
1078    /**
1079     * Constructor
1080     */
1081      public ProvisionComponent() {
1082        super();
1083      }
1084
1085        /**
1086         * @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
1087         */
1088        public Enumeration<ConsentProvisionType> getTypeElement() { 
1089          if (this.type == null)
1090            if (Configuration.errorOnAutoCreate())
1091              throw new Error("Attempt to auto-create ProvisionComponent.type");
1092            else if (Configuration.doAutoCreate())
1093              this.type = new Enumeration<ConsentProvisionType>(new ConsentProvisionTypeEnumFactory()); // bb
1094          return this.type;
1095        }
1096
1097        public boolean hasTypeElement() { 
1098          return this.type != null && !this.type.isEmpty();
1099        }
1100
1101        public boolean hasType() { 
1102          return this.type != null && !this.type.isEmpty();
1103        }
1104
1105        /**
1106         * @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
1107         */
1108        public ProvisionComponent setTypeElement(Enumeration<ConsentProvisionType> value) { 
1109          this.type = value;
1110          return this;
1111        }
1112
1113        /**
1114         * @return Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules.
1115         */
1116        public ConsentProvisionType getType() { 
1117          return this.type == null ? null : this.type.getValue();
1118        }
1119
1120        /**
1121         * @param value Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules.
1122         */
1123        public ProvisionComponent setType(ConsentProvisionType value) { 
1124          if (value == null)
1125            this.type = null;
1126          else {
1127            if (this.type == null)
1128              this.type = new Enumeration<ConsentProvisionType>(new ConsentProvisionTypeEnumFactory());
1129            this.type.setValue(value);
1130          }
1131          return this;
1132        }
1133
1134        /**
1135         * @return {@link #period} (The timeframe in this rule is valid.)
1136         */
1137        public Period getPeriod() { 
1138          if (this.period == null)
1139            if (Configuration.errorOnAutoCreate())
1140              throw new Error("Attempt to auto-create ProvisionComponent.period");
1141            else if (Configuration.doAutoCreate())
1142              this.period = new Period(); // cc
1143          return this.period;
1144        }
1145
1146        public boolean hasPeriod() { 
1147          return this.period != null && !this.period.isEmpty();
1148        }
1149
1150        /**
1151         * @param value {@link #period} (The timeframe in this rule is valid.)
1152         */
1153        public ProvisionComponent setPeriod(Period value) { 
1154          this.period = value;
1155          return this;
1156        }
1157
1158        /**
1159         * @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').)
1160         */
1161        public List<ProvisionActorComponent> getActor() { 
1162          if (this.actor == null)
1163            this.actor = new ArrayList<ProvisionActorComponent>();
1164          return this.actor;
1165        }
1166
1167        /**
1168         * @return Returns a reference to <code>this</code> for easy method chaining
1169         */
1170        public ProvisionComponent setActor(List<ProvisionActorComponent> theActor) { 
1171          this.actor = theActor;
1172          return this;
1173        }
1174
1175        public boolean hasActor() { 
1176          if (this.actor == null)
1177            return false;
1178          for (ProvisionActorComponent item : this.actor)
1179            if (!item.isEmpty())
1180              return true;
1181          return false;
1182        }
1183
1184        public ProvisionActorComponent addActor() { //3
1185          ProvisionActorComponent t = new ProvisionActorComponent();
1186          if (this.actor == null)
1187            this.actor = new ArrayList<ProvisionActorComponent>();
1188          this.actor.add(t);
1189          return t;
1190        }
1191
1192        public ProvisionComponent addActor(ProvisionActorComponent t) { //3
1193          if (t == null)
1194            return this;
1195          if (this.actor == null)
1196            this.actor = new ArrayList<ProvisionActorComponent>();
1197          this.actor.add(t);
1198          return this;
1199        }
1200
1201        /**
1202         * @return The first repetition of repeating field {@link #actor}, creating it if it does not already exist {3}
1203         */
1204        public ProvisionActorComponent getActorFirstRep() { 
1205          if (getActor().isEmpty()) {
1206            addActor();
1207          }
1208          return getActor().get(0);
1209        }
1210
1211        /**
1212         * @return {@link #action} (Actions controlled by this Rule.)
1213         */
1214        public List<CodeableConcept> getAction() { 
1215          if (this.action == null)
1216            this.action = new ArrayList<CodeableConcept>();
1217          return this.action;
1218        }
1219
1220        /**
1221         * @return Returns a reference to <code>this</code> for easy method chaining
1222         */
1223        public ProvisionComponent setAction(List<CodeableConcept> theAction) { 
1224          this.action = theAction;
1225          return this;
1226        }
1227
1228        public boolean hasAction() { 
1229          if (this.action == null)
1230            return false;
1231          for (CodeableConcept item : this.action)
1232            if (!item.isEmpty())
1233              return true;
1234          return false;
1235        }
1236
1237        public CodeableConcept addAction() { //3
1238          CodeableConcept t = new CodeableConcept();
1239          if (this.action == null)
1240            this.action = new ArrayList<CodeableConcept>();
1241          this.action.add(t);
1242          return t;
1243        }
1244
1245        public ProvisionComponent addAction(CodeableConcept t) { //3
1246          if (t == null)
1247            return this;
1248          if (this.action == null)
1249            this.action = new ArrayList<CodeableConcept>();
1250          this.action.add(t);
1251          return this;
1252        }
1253
1254        /**
1255         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist {3}
1256         */
1257        public CodeableConcept getActionFirstRep() { 
1258          if (getAction().isEmpty()) {
1259            addAction();
1260          }
1261          return getAction().get(0);
1262        }
1263
1264        /**
1265         * @return {@link #securityLabel} (A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception.)
1266         */
1267        public List<Coding> getSecurityLabel() { 
1268          if (this.securityLabel == null)
1269            this.securityLabel = new ArrayList<Coding>();
1270          return this.securityLabel;
1271        }
1272
1273        /**
1274         * @return Returns a reference to <code>this</code> for easy method chaining
1275         */
1276        public ProvisionComponent setSecurityLabel(List<Coding> theSecurityLabel) { 
1277          this.securityLabel = theSecurityLabel;
1278          return this;
1279        }
1280
1281        public boolean hasSecurityLabel() { 
1282          if (this.securityLabel == null)
1283            return false;
1284          for (Coding item : this.securityLabel)
1285            if (!item.isEmpty())
1286              return true;
1287          return false;
1288        }
1289
1290        public Coding addSecurityLabel() { //3
1291          Coding t = new Coding();
1292          if (this.securityLabel == null)
1293            this.securityLabel = new ArrayList<Coding>();
1294          this.securityLabel.add(t);
1295          return t;
1296        }
1297
1298        public ProvisionComponent addSecurityLabel(Coding t) { //3
1299          if (t == null)
1300            return this;
1301          if (this.securityLabel == null)
1302            this.securityLabel = new ArrayList<Coding>();
1303          this.securityLabel.add(t);
1304          return this;
1305        }
1306
1307        /**
1308         * @return The first repetition of repeating field {@link #securityLabel}, creating it if it does not already exist {3}
1309         */
1310        public Coding getSecurityLabelFirstRep() { 
1311          if (getSecurityLabel().isEmpty()) {
1312            addSecurityLabel();
1313          }
1314          return getSecurityLabel().get(0);
1315        }
1316
1317        /**
1318         * @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.)
1319         */
1320        public List<Coding> getPurpose() { 
1321          if (this.purpose == null)
1322            this.purpose = new ArrayList<Coding>();
1323          return this.purpose;
1324        }
1325
1326        /**
1327         * @return Returns a reference to <code>this</code> for easy method chaining
1328         */
1329        public ProvisionComponent setPurpose(List<Coding> thePurpose) { 
1330          this.purpose = thePurpose;
1331          return this;
1332        }
1333
1334        public boolean hasPurpose() { 
1335          if (this.purpose == null)
1336            return false;
1337          for (Coding item : this.purpose)
1338            if (!item.isEmpty())
1339              return true;
1340          return false;
1341        }
1342
1343        public Coding addPurpose() { //3
1344          Coding t = new Coding();
1345          if (this.purpose == null)
1346            this.purpose = new ArrayList<Coding>();
1347          this.purpose.add(t);
1348          return t;
1349        }
1350
1351        public ProvisionComponent addPurpose(Coding t) { //3
1352          if (t == null)
1353            return this;
1354          if (this.purpose == null)
1355            this.purpose = new ArrayList<Coding>();
1356          this.purpose.add(t);
1357          return this;
1358        }
1359
1360        /**
1361         * @return The first repetition of repeating field {@link #purpose}, creating it if it does not already exist {3}
1362         */
1363        public Coding getPurposeFirstRep() { 
1364          if (getPurpose().isEmpty()) {
1365            addPurpose();
1366          }
1367          return getPurpose().get(0);
1368        }
1369
1370        /**
1371         * @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.)
1372         */
1373        public List<Coding> getClass_() { 
1374          if (this.class_ == null)
1375            this.class_ = new ArrayList<Coding>();
1376          return this.class_;
1377        }
1378
1379        /**
1380         * @return Returns a reference to <code>this</code> for easy method chaining
1381         */
1382        public ProvisionComponent setClass_(List<Coding> theClass_) { 
1383          this.class_ = theClass_;
1384          return this;
1385        }
1386
1387        public boolean hasClass_() { 
1388          if (this.class_ == null)
1389            return false;
1390          for (Coding item : this.class_)
1391            if (!item.isEmpty())
1392              return true;
1393          return false;
1394        }
1395
1396        public Coding addClass_() { //3
1397          Coding t = new Coding();
1398          if (this.class_ == null)
1399            this.class_ = new ArrayList<Coding>();
1400          this.class_.add(t);
1401          return t;
1402        }
1403
1404        public ProvisionComponent addClass_(Coding t) { //3
1405          if (t == null)
1406            return this;
1407          if (this.class_ == null)
1408            this.class_ = new ArrayList<Coding>();
1409          this.class_.add(t);
1410          return this;
1411        }
1412
1413        /**
1414         * @return The first repetition of repeating field {@link #class_}, creating it if it does not already exist {3}
1415         */
1416        public Coding getClass_FirstRep() { 
1417          if (getClass_().isEmpty()) {
1418            addClass_();
1419          }
1420          return getClass_().get(0);
1421        }
1422
1423        /**
1424         * @return {@link #code} (If this code is found in an instance, then the rule applies.)
1425         */
1426        public List<CodeableConcept> getCode() { 
1427          if (this.code == null)
1428            this.code = new ArrayList<CodeableConcept>();
1429          return this.code;
1430        }
1431
1432        /**
1433         * @return Returns a reference to <code>this</code> for easy method chaining
1434         */
1435        public ProvisionComponent setCode(List<CodeableConcept> theCode) { 
1436          this.code = theCode;
1437          return this;
1438        }
1439
1440        public boolean hasCode() { 
1441          if (this.code == null)
1442            return false;
1443          for (CodeableConcept item : this.code)
1444            if (!item.isEmpty())
1445              return true;
1446          return false;
1447        }
1448
1449        public CodeableConcept addCode() { //3
1450          CodeableConcept t = new CodeableConcept();
1451          if (this.code == null)
1452            this.code = new ArrayList<CodeableConcept>();
1453          this.code.add(t);
1454          return t;
1455        }
1456
1457        public ProvisionComponent addCode(CodeableConcept t) { //3
1458          if (t == null)
1459            return this;
1460          if (this.code == null)
1461            this.code = new ArrayList<CodeableConcept>();
1462          this.code.add(t);
1463          return this;
1464        }
1465
1466        /**
1467         * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist {3}
1468         */
1469        public CodeableConcept getCodeFirstRep() { 
1470          if (getCode().isEmpty()) {
1471            addCode();
1472          }
1473          return getCode().get(0);
1474        }
1475
1476        /**
1477         * @return {@link #dataPeriod} (Clinical or Operational Relevant period of time that bounds the data controlled by this rule.)
1478         */
1479        public Period getDataPeriod() { 
1480          if (this.dataPeriod == null)
1481            if (Configuration.errorOnAutoCreate())
1482              throw new Error("Attempt to auto-create ProvisionComponent.dataPeriod");
1483            else if (Configuration.doAutoCreate())
1484              this.dataPeriod = new Period(); // cc
1485          return this.dataPeriod;
1486        }
1487
1488        public boolean hasDataPeriod() { 
1489          return this.dataPeriod != null && !this.dataPeriod.isEmpty();
1490        }
1491
1492        /**
1493         * @param value {@link #dataPeriod} (Clinical or Operational Relevant period of time that bounds the data controlled by this rule.)
1494         */
1495        public ProvisionComponent setDataPeriod(Period value) { 
1496          this.dataPeriod = value;
1497          return this;
1498        }
1499
1500        /**
1501         * @return {@link #data} (The resources controlled by this rule if specific resources are referenced.)
1502         */
1503        public List<ProvisionDataComponent> getData() { 
1504          if (this.data == null)
1505            this.data = new ArrayList<ProvisionDataComponent>();
1506          return this.data;
1507        }
1508
1509        /**
1510         * @return Returns a reference to <code>this</code> for easy method chaining
1511         */
1512        public ProvisionComponent setData(List<ProvisionDataComponent> theData) { 
1513          this.data = theData;
1514          return this;
1515        }
1516
1517        public boolean hasData() { 
1518          if (this.data == null)
1519            return false;
1520          for (ProvisionDataComponent item : this.data)
1521            if (!item.isEmpty())
1522              return true;
1523          return false;
1524        }
1525
1526        public ProvisionDataComponent addData() { //3
1527          ProvisionDataComponent t = new ProvisionDataComponent();
1528          if (this.data == null)
1529            this.data = new ArrayList<ProvisionDataComponent>();
1530          this.data.add(t);
1531          return t;
1532        }
1533
1534        public ProvisionComponent addData(ProvisionDataComponent t) { //3
1535          if (t == null)
1536            return this;
1537          if (this.data == null)
1538            this.data = new ArrayList<ProvisionDataComponent>();
1539          this.data.add(t);
1540          return this;
1541        }
1542
1543        /**
1544         * @return The first repetition of repeating field {@link #data}, creating it if it does not already exist {3}
1545         */
1546        public ProvisionDataComponent getDataFirstRep() { 
1547          if (getData().isEmpty()) {
1548            addData();
1549          }
1550          return getData().get(0);
1551        }
1552
1553        /**
1554         * @return {@link #provision} (Rules which provide exceptions to the base rule or subrules.)
1555         */
1556        public List<ProvisionComponent> getProvision() { 
1557          if (this.provision == null)
1558            this.provision = new ArrayList<ProvisionComponent>();
1559          return this.provision;
1560        }
1561
1562        /**
1563         * @return Returns a reference to <code>this</code> for easy method chaining
1564         */
1565        public ProvisionComponent setProvision(List<ProvisionComponent> theProvision) { 
1566          this.provision = theProvision;
1567          return this;
1568        }
1569
1570        public boolean hasProvision() { 
1571          if (this.provision == null)
1572            return false;
1573          for (ProvisionComponent item : this.provision)
1574            if (!item.isEmpty())
1575              return true;
1576          return false;
1577        }
1578
1579        public ProvisionComponent addProvision() { //3
1580          ProvisionComponent t = new ProvisionComponent();
1581          if (this.provision == null)
1582            this.provision = new ArrayList<ProvisionComponent>();
1583          this.provision.add(t);
1584          return t;
1585        }
1586
1587        public ProvisionComponent addProvision(ProvisionComponent t) { //3
1588          if (t == null)
1589            return this;
1590          if (this.provision == null)
1591            this.provision = new ArrayList<ProvisionComponent>();
1592          this.provision.add(t);
1593          return this;
1594        }
1595
1596        /**
1597         * @return The first repetition of repeating field {@link #provision}, creating it if it does not already exist {3}
1598         */
1599        public ProvisionComponent getProvisionFirstRep() { 
1600          if (getProvision().isEmpty()) {
1601            addProvision();
1602          }
1603          return getProvision().get(0);
1604        }
1605
1606        protected void listChildren(List<Property> children) {
1607          super.listChildren(children);
1608          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));
1609          children.add(new Property("period", "Period", "The timeframe in this rule is valid.", 0, 1, period));
1610          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));
1611          children.add(new Property("action", "CodeableConcept", "Actions controlled by this Rule.", 0, java.lang.Integer.MAX_VALUE, action));
1612          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));
1613          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));
1614          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_));
1615          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));
1616          children.add(new Property("dataPeriod", "Period", "Clinical or Operational Relevant period of time that bounds the data controlled by this rule.", 0, 1, dataPeriod));
1617          children.add(new Property("data", "", "The resources controlled by this rule if specific resources are referenced.", 0, java.lang.Integer.MAX_VALUE, data));
1618          children.add(new Property("provision", "@Consent.provision", "Rules which provide exceptions to the base rule or subrules.", 0, java.lang.Integer.MAX_VALUE, provision));
1619        }
1620
1621        @Override
1622        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1623          switch (_hash) {
1624          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);
1625          case -991726143: /*period*/  return new Property("period", "Period", "The timeframe in this rule is valid.", 0, 1, period);
1626          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);
1627          case -1422950858: /*action*/  return new Property("action", "CodeableConcept", "Actions controlled by this Rule.", 0, java.lang.Integer.MAX_VALUE, action);
1628          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);
1629          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);
1630          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_);
1631          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);
1632          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);
1633          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);
1634          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);
1635          default: return super.getNamedProperty(_hash, _name, _checkValid);
1636          }
1637
1638        }
1639
1640      @Override
1641      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1642        switch (hash) {
1643        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<ConsentProvisionType>
1644        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1645        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : this.actor.toArray(new Base[this.actor.size()]); // ProvisionActorComponent
1646        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // CodeableConcept
1647        case -722296940: /*securityLabel*/ return this.securityLabel == null ? new Base[0] : this.securityLabel.toArray(new Base[this.securityLabel.size()]); // Coding
1648        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : this.purpose.toArray(new Base[this.purpose.size()]); // Coding
1649        case 94742904: /*class*/ return this.class_ == null ? new Base[0] : this.class_.toArray(new Base[this.class_.size()]); // Coding
1650        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept
1651        case 1177250315: /*dataPeriod*/ return this.dataPeriod == null ? new Base[0] : new Base[] {this.dataPeriod}; // Period
1652        case 3076010: /*data*/ return this.data == null ? new Base[0] : this.data.toArray(new Base[this.data.size()]); // ProvisionDataComponent
1653        case -547120939: /*provision*/ return this.provision == null ? new Base[0] : this.provision.toArray(new Base[this.provision.size()]); // ProvisionComponent
1654        default: return super.getProperty(hash, name, checkValid);
1655        }
1656
1657      }
1658
1659      @Override
1660      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1661        switch (hash) {
1662        case 3575610: // type
1663          value = new ConsentProvisionTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1664          this.type = (Enumeration) value; // Enumeration<ConsentProvisionType>
1665          return value;
1666        case -991726143: // period
1667          this.period = TypeConvertor.castToPeriod(value); // Period
1668          return value;
1669        case 92645877: // actor
1670          this.getActor().add((ProvisionActorComponent) value); // ProvisionActorComponent
1671          return value;
1672        case -1422950858: // action
1673          this.getAction().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1674          return value;
1675        case -722296940: // securityLabel
1676          this.getSecurityLabel().add(TypeConvertor.castToCoding(value)); // Coding
1677          return value;
1678        case -220463842: // purpose
1679          this.getPurpose().add(TypeConvertor.castToCoding(value)); // Coding
1680          return value;
1681        case 94742904: // class
1682          this.getClass_().add(TypeConvertor.castToCoding(value)); // Coding
1683          return value;
1684        case 3059181: // code
1685          this.getCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1686          return value;
1687        case 1177250315: // dataPeriod
1688          this.dataPeriod = TypeConvertor.castToPeriod(value); // Period
1689          return value;
1690        case 3076010: // data
1691          this.getData().add((ProvisionDataComponent) value); // ProvisionDataComponent
1692          return value;
1693        case -547120939: // provision
1694          this.getProvision().add((ProvisionComponent) value); // ProvisionComponent
1695          return value;
1696        default: return super.setProperty(hash, name, value);
1697        }
1698
1699      }
1700
1701      @Override
1702      public Base setProperty(String name, Base value) throws FHIRException {
1703        if (name.equals("type")) {
1704          value = new ConsentProvisionTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1705          this.type = (Enumeration) value; // Enumeration<ConsentProvisionType>
1706        } else if (name.equals("period")) {
1707          this.period = TypeConvertor.castToPeriod(value); // Period
1708        } else if (name.equals("actor")) {
1709          this.getActor().add((ProvisionActorComponent) value);
1710        } else if (name.equals("action")) {
1711          this.getAction().add(TypeConvertor.castToCodeableConcept(value));
1712        } else if (name.equals("securityLabel")) {
1713          this.getSecurityLabel().add(TypeConvertor.castToCoding(value));
1714        } else if (name.equals("purpose")) {
1715          this.getPurpose().add(TypeConvertor.castToCoding(value));
1716        } else if (name.equals("class")) {
1717          this.getClass_().add(TypeConvertor.castToCoding(value));
1718        } else if (name.equals("code")) {
1719          this.getCode().add(TypeConvertor.castToCodeableConcept(value));
1720        } else if (name.equals("dataPeriod")) {
1721          this.dataPeriod = TypeConvertor.castToPeriod(value); // Period
1722        } else if (name.equals("data")) {
1723          this.getData().add((ProvisionDataComponent) value);
1724        } else if (name.equals("provision")) {
1725          this.getProvision().add((ProvisionComponent) value);
1726        } else
1727          return super.setProperty(name, value);
1728        return value;
1729      }
1730
1731      @Override
1732      public Base makeProperty(int hash, String name) throws FHIRException {
1733        switch (hash) {
1734        case 3575610:  return getTypeElement();
1735        case -991726143:  return getPeriod();
1736        case 92645877:  return addActor(); 
1737        case -1422950858:  return addAction(); 
1738        case -722296940:  return addSecurityLabel(); 
1739        case -220463842:  return addPurpose(); 
1740        case 94742904:  return addClass_(); 
1741        case 3059181:  return addCode(); 
1742        case 1177250315:  return getDataPeriod();
1743        case 3076010:  return addData(); 
1744        case -547120939:  return addProvision(); 
1745        default: return super.makeProperty(hash, name);
1746        }
1747
1748      }
1749
1750      @Override
1751      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1752        switch (hash) {
1753        case 3575610: /*type*/ return new String[] {"code"};
1754        case -991726143: /*period*/ return new String[] {"Period"};
1755        case 92645877: /*actor*/ return new String[] {};
1756        case -1422950858: /*action*/ return new String[] {"CodeableConcept"};
1757        case -722296940: /*securityLabel*/ return new String[] {"Coding"};
1758        case -220463842: /*purpose*/ return new String[] {"Coding"};
1759        case 94742904: /*class*/ return new String[] {"Coding"};
1760        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1761        case 1177250315: /*dataPeriod*/ return new String[] {"Period"};
1762        case 3076010: /*data*/ return new String[] {};
1763        case -547120939: /*provision*/ return new String[] {"@Consent.provision"};
1764        default: return super.getTypesForProperty(hash, name);
1765        }
1766
1767      }
1768
1769      @Override
1770      public Base addChild(String name) throws FHIRException {
1771        if (name.equals("type")) {
1772          throw new FHIRException("Cannot call addChild on a primitive type Consent.provision.type");
1773        }
1774        else if (name.equals("period")) {
1775          this.period = new Period();
1776          return this.period;
1777        }
1778        else if (name.equals("actor")) {
1779          return addActor();
1780        }
1781        else if (name.equals("action")) {
1782          return addAction();
1783        }
1784        else if (name.equals("securityLabel")) {
1785          return addSecurityLabel();
1786        }
1787        else if (name.equals("purpose")) {
1788          return addPurpose();
1789        }
1790        else if (name.equals("class")) {
1791          return addClass_();
1792        }
1793        else if (name.equals("code")) {
1794          return addCode();
1795        }
1796        else if (name.equals("dataPeriod")) {
1797          this.dataPeriod = new Period();
1798          return this.dataPeriod;
1799        }
1800        else if (name.equals("data")) {
1801          return addData();
1802        }
1803        else if (name.equals("provision")) {
1804          return addProvision();
1805        }
1806        else
1807          return super.addChild(name);
1808      }
1809
1810      public ProvisionComponent copy() {
1811        ProvisionComponent dst = new ProvisionComponent();
1812        copyValues(dst);
1813        return dst;
1814      }
1815
1816      public void copyValues(ProvisionComponent dst) {
1817        super.copyValues(dst);
1818        dst.type = type == null ? null : type.copy();
1819        dst.period = period == null ? null : period.copy();
1820        if (actor != null) {
1821          dst.actor = new ArrayList<ProvisionActorComponent>();
1822          for (ProvisionActorComponent i : actor)
1823            dst.actor.add(i.copy());
1824        };
1825        if (action != null) {
1826          dst.action = new ArrayList<CodeableConcept>();
1827          for (CodeableConcept i : action)
1828            dst.action.add(i.copy());
1829        };
1830        if (securityLabel != null) {
1831          dst.securityLabel = new ArrayList<Coding>();
1832          for (Coding i : securityLabel)
1833            dst.securityLabel.add(i.copy());
1834        };
1835        if (purpose != null) {
1836          dst.purpose = new ArrayList<Coding>();
1837          for (Coding i : purpose)
1838            dst.purpose.add(i.copy());
1839        };
1840        if (class_ != null) {
1841          dst.class_ = new ArrayList<Coding>();
1842          for (Coding i : class_)
1843            dst.class_.add(i.copy());
1844        };
1845        if (code != null) {
1846          dst.code = new ArrayList<CodeableConcept>();
1847          for (CodeableConcept i : code)
1848            dst.code.add(i.copy());
1849        };
1850        dst.dataPeriod = dataPeriod == null ? null : dataPeriod.copy();
1851        if (data != null) {
1852          dst.data = new ArrayList<ProvisionDataComponent>();
1853          for (ProvisionDataComponent i : data)
1854            dst.data.add(i.copy());
1855        };
1856        if (provision != null) {
1857          dst.provision = new ArrayList<ProvisionComponent>();
1858          for (ProvisionComponent i : provision)
1859            dst.provision.add(i.copy());
1860        };
1861      }
1862
1863      @Override
1864      public boolean equalsDeep(Base other_) {
1865        if (!super.equalsDeep(other_))
1866          return false;
1867        if (!(other_ instanceof ProvisionComponent))
1868          return false;
1869        ProvisionComponent o = (ProvisionComponent) other_;
1870        return compareDeep(type, o.type, true) && compareDeep(period, o.period, true) && compareDeep(actor, o.actor, true)
1871           && compareDeep(action, o.action, true) && compareDeep(securityLabel, o.securityLabel, true) && compareDeep(purpose, o.purpose, true)
1872           && compareDeep(class_, o.class_, true) && compareDeep(code, o.code, true) && compareDeep(dataPeriod, o.dataPeriod, true)
1873           && compareDeep(data, o.data, true) && compareDeep(provision, o.provision, true);
1874      }
1875
1876      @Override
1877      public boolean equalsShallow(Base other_) {
1878        if (!super.equalsShallow(other_))
1879          return false;
1880        if (!(other_ instanceof ProvisionComponent))
1881          return false;
1882        ProvisionComponent o = (ProvisionComponent) other_;
1883        return compareValues(type, o.type, true);
1884      }
1885
1886      public boolean isEmpty() {
1887        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, period, actor, action
1888          , securityLabel, purpose, class_, code, dataPeriod, data, provision);
1889      }
1890
1891  public String fhirType() {
1892    return "Consent.provision";
1893
1894  }
1895
1896  }
1897
1898    @Block()
1899    public static class ProvisionActorComponent extends BackboneElement implements IBaseBackboneElement {
1900        /**
1901         * How the individual is involved in the resources content that is described in the exception.
1902         */
1903        @Child(name = "role", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1904        @Description(shortDefinition="How the actor is involved", formalDefinition="How the individual is involved in the resources content that is described in the exception." )
1905        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/security-role-type")
1906        protected CodeableConcept role;
1907
1908        /**
1909         * 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').
1910         */
1911        @Child(name = "reference", type = {Device.class, Group.class, CareTeam.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, PractitionerRole.class}, order=2, min=1, max=1, modifier=false, summary=false)
1912        @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')." )
1913        protected Reference reference;
1914
1915        private static final long serialVersionUID = -1992921787L;
1916
1917    /**
1918     * Constructor
1919     */
1920      public ProvisionActorComponent() {
1921        super();
1922      }
1923
1924    /**
1925     * Constructor
1926     */
1927      public ProvisionActorComponent(CodeableConcept role, Reference reference) {
1928        super();
1929        this.setRole(role);
1930        this.setReference(reference);
1931      }
1932
1933        /**
1934         * @return {@link #role} (How the individual is involved in the resources content that is described in the exception.)
1935         */
1936        public CodeableConcept getRole() { 
1937          if (this.role == null)
1938            if (Configuration.errorOnAutoCreate())
1939              throw new Error("Attempt to auto-create ProvisionActorComponent.role");
1940            else if (Configuration.doAutoCreate())
1941              this.role = new CodeableConcept(); // cc
1942          return this.role;
1943        }
1944
1945        public boolean hasRole() { 
1946          return this.role != null && !this.role.isEmpty();
1947        }
1948
1949        /**
1950         * @param value {@link #role} (How the individual is involved in the resources content that is described in the exception.)
1951         */
1952        public ProvisionActorComponent setRole(CodeableConcept value) { 
1953          this.role = value;
1954          return this;
1955        }
1956
1957        /**
1958         * @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').)
1959         */
1960        public Reference getReference() { 
1961          if (this.reference == null)
1962            if (Configuration.errorOnAutoCreate())
1963              throw new Error("Attempt to auto-create ProvisionActorComponent.reference");
1964            else if (Configuration.doAutoCreate())
1965              this.reference = new Reference(); // cc
1966          return this.reference;
1967        }
1968
1969        public boolean hasReference() { 
1970          return this.reference != null && !this.reference.isEmpty();
1971        }
1972
1973        /**
1974         * @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').)
1975         */
1976        public ProvisionActorComponent setReference(Reference value) { 
1977          this.reference = value;
1978          return this;
1979        }
1980
1981        protected void listChildren(List<Property> children) {
1982          super.listChildren(children);
1983          children.add(new Property("role", "CodeableConcept", "How the individual is involved in the resources content that is described in the exception.", 0, 1, role));
1984          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));
1985        }
1986
1987        @Override
1988        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1989          switch (_hash) {
1990          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);
1991          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);
1992          default: return super.getNamedProperty(_hash, _name, _checkValid);
1993          }
1994
1995        }
1996
1997      @Override
1998      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1999        switch (hash) {
2000        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
2001        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
2002        default: return super.getProperty(hash, name, checkValid);
2003        }
2004
2005      }
2006
2007      @Override
2008      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2009        switch (hash) {
2010        case 3506294: // role
2011          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2012          return value;
2013        case -925155509: // reference
2014          this.reference = TypeConvertor.castToReference(value); // Reference
2015          return value;
2016        default: return super.setProperty(hash, name, value);
2017        }
2018
2019      }
2020
2021      @Override
2022      public Base setProperty(String name, Base value) throws FHIRException {
2023        if (name.equals("role")) {
2024          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2025        } else if (name.equals("reference")) {
2026          this.reference = TypeConvertor.castToReference(value); // Reference
2027        } else
2028          return super.setProperty(name, value);
2029        return value;
2030      }
2031
2032      @Override
2033      public Base makeProperty(int hash, String name) throws FHIRException {
2034        switch (hash) {
2035        case 3506294:  return getRole();
2036        case -925155509:  return getReference();
2037        default: return super.makeProperty(hash, name);
2038        }
2039
2040      }
2041
2042      @Override
2043      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2044        switch (hash) {
2045        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
2046        case -925155509: /*reference*/ return new String[] {"Reference"};
2047        default: return super.getTypesForProperty(hash, name);
2048        }
2049
2050      }
2051
2052      @Override
2053      public Base addChild(String name) throws FHIRException {
2054        if (name.equals("role")) {
2055          this.role = new CodeableConcept();
2056          return this.role;
2057        }
2058        else if (name.equals("reference")) {
2059          this.reference = new Reference();
2060          return this.reference;
2061        }
2062        else
2063          return super.addChild(name);
2064      }
2065
2066      public ProvisionActorComponent copy() {
2067        ProvisionActorComponent dst = new ProvisionActorComponent();
2068        copyValues(dst);
2069        return dst;
2070      }
2071
2072      public void copyValues(ProvisionActorComponent dst) {
2073        super.copyValues(dst);
2074        dst.role = role == null ? null : role.copy();
2075        dst.reference = reference == null ? null : reference.copy();
2076      }
2077
2078      @Override
2079      public boolean equalsDeep(Base other_) {
2080        if (!super.equalsDeep(other_))
2081          return false;
2082        if (!(other_ instanceof ProvisionActorComponent))
2083          return false;
2084        ProvisionActorComponent o = (ProvisionActorComponent) other_;
2085        return compareDeep(role, o.role, true) && compareDeep(reference, o.reference, true);
2086      }
2087
2088      @Override
2089      public boolean equalsShallow(Base other_) {
2090        if (!super.equalsShallow(other_))
2091          return false;
2092        if (!(other_ instanceof ProvisionActorComponent))
2093          return false;
2094        ProvisionActorComponent o = (ProvisionActorComponent) other_;
2095        return true;
2096      }
2097
2098      public boolean isEmpty() {
2099        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(role, reference);
2100      }
2101
2102  public String fhirType() {
2103    return "Consent.provision.actor";
2104
2105  }
2106
2107  }
2108
2109    @Block()
2110    public static class ProvisionDataComponent extends BackboneElement implements IBaseBackboneElement {
2111        /**
2112         * How the resource reference is interpreted when testing consent restrictions.
2113         */
2114        @Child(name = "meaning", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2115        @Description(shortDefinition="instance | related | dependents | authoredby", formalDefinition="How the resource reference is interpreted when testing consent restrictions." )
2116        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-data-meaning")
2117        protected Enumeration<ConsentDataMeaning> meaning;
2118
2119        /**
2120         * A reference to a specific resource that defines which resources are covered by this consent.
2121         */
2122        @Child(name = "reference", type = {Reference.class}, order=2, min=1, max=1, modifier=false, summary=true)
2123        @Description(shortDefinition="The actual data reference", formalDefinition="A reference to a specific resource that defines which resources are covered by this consent." )
2124        protected Reference reference;
2125
2126        private static final long serialVersionUID = 1735979153L;
2127
2128    /**
2129     * Constructor
2130     */
2131      public ProvisionDataComponent() {
2132        super();
2133      }
2134
2135    /**
2136     * Constructor
2137     */
2138      public ProvisionDataComponent(ConsentDataMeaning meaning, Reference reference) {
2139        super();
2140        this.setMeaning(meaning);
2141        this.setReference(reference);
2142      }
2143
2144        /**
2145         * @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
2146         */
2147        public Enumeration<ConsentDataMeaning> getMeaningElement() { 
2148          if (this.meaning == null)
2149            if (Configuration.errorOnAutoCreate())
2150              throw new Error("Attempt to auto-create ProvisionDataComponent.meaning");
2151            else if (Configuration.doAutoCreate())
2152              this.meaning = new Enumeration<ConsentDataMeaning>(new ConsentDataMeaningEnumFactory()); // bb
2153          return this.meaning;
2154        }
2155
2156        public boolean hasMeaningElement() { 
2157          return this.meaning != null && !this.meaning.isEmpty();
2158        }
2159
2160        public boolean hasMeaning() { 
2161          return this.meaning != null && !this.meaning.isEmpty();
2162        }
2163
2164        /**
2165         * @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
2166         */
2167        public ProvisionDataComponent setMeaningElement(Enumeration<ConsentDataMeaning> value) { 
2168          this.meaning = value;
2169          return this;
2170        }
2171
2172        /**
2173         * @return How the resource reference is interpreted when testing consent restrictions.
2174         */
2175        public ConsentDataMeaning getMeaning() { 
2176          return this.meaning == null ? null : this.meaning.getValue();
2177        }
2178
2179        /**
2180         * @param value How the resource reference is interpreted when testing consent restrictions.
2181         */
2182        public ProvisionDataComponent setMeaning(ConsentDataMeaning value) { 
2183            if (this.meaning == null)
2184              this.meaning = new Enumeration<ConsentDataMeaning>(new ConsentDataMeaningEnumFactory());
2185            this.meaning.setValue(value);
2186          return this;
2187        }
2188
2189        /**
2190         * @return {@link #reference} (A reference to a specific resource that defines which resources are covered by this consent.)
2191         */
2192        public Reference getReference() { 
2193          if (this.reference == null)
2194            if (Configuration.errorOnAutoCreate())
2195              throw new Error("Attempt to auto-create ProvisionDataComponent.reference");
2196            else if (Configuration.doAutoCreate())
2197              this.reference = new Reference(); // cc
2198          return this.reference;
2199        }
2200
2201        public boolean hasReference() { 
2202          return this.reference != null && !this.reference.isEmpty();
2203        }
2204
2205        /**
2206         * @param value {@link #reference} (A reference to a specific resource that defines which resources are covered by this consent.)
2207         */
2208        public ProvisionDataComponent setReference(Reference value) { 
2209          this.reference = value;
2210          return this;
2211        }
2212
2213        protected void listChildren(List<Property> children) {
2214          super.listChildren(children);
2215          children.add(new Property("meaning", "code", "How the resource reference is interpreted when testing consent restrictions.", 0, 1, meaning));
2216          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));
2217        }
2218
2219        @Override
2220        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2221          switch (_hash) {
2222          case 938160637: /*meaning*/  return new Property("meaning", "code", "How the resource reference is interpreted when testing consent restrictions.", 0, 1, meaning);
2223          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);
2224          default: return super.getNamedProperty(_hash, _name, _checkValid);
2225          }
2226
2227        }
2228
2229      @Override
2230      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2231        switch (hash) {
2232        case 938160637: /*meaning*/ return this.meaning == null ? new Base[0] : new Base[] {this.meaning}; // Enumeration<ConsentDataMeaning>
2233        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
2234        default: return super.getProperty(hash, name, checkValid);
2235        }
2236
2237      }
2238
2239      @Override
2240      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2241        switch (hash) {
2242        case 938160637: // meaning
2243          value = new ConsentDataMeaningEnumFactory().fromType(TypeConvertor.castToCode(value));
2244          this.meaning = (Enumeration) value; // Enumeration<ConsentDataMeaning>
2245          return value;
2246        case -925155509: // reference
2247          this.reference = TypeConvertor.castToReference(value); // Reference
2248          return value;
2249        default: return super.setProperty(hash, name, value);
2250        }
2251
2252      }
2253
2254      @Override
2255      public Base setProperty(String name, Base value) throws FHIRException {
2256        if (name.equals("meaning")) {
2257          value = new ConsentDataMeaningEnumFactory().fromType(TypeConvertor.castToCode(value));
2258          this.meaning = (Enumeration) value; // Enumeration<ConsentDataMeaning>
2259        } else if (name.equals("reference")) {
2260          this.reference = TypeConvertor.castToReference(value); // Reference
2261        } else
2262          return super.setProperty(name, value);
2263        return value;
2264      }
2265
2266      @Override
2267      public Base makeProperty(int hash, String name) throws FHIRException {
2268        switch (hash) {
2269        case 938160637:  return getMeaningElement();
2270        case -925155509:  return getReference();
2271        default: return super.makeProperty(hash, name);
2272        }
2273
2274      }
2275
2276      @Override
2277      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2278        switch (hash) {
2279        case 938160637: /*meaning*/ return new String[] {"code"};
2280        case -925155509: /*reference*/ return new String[] {"Reference"};
2281        default: return super.getTypesForProperty(hash, name);
2282        }
2283
2284      }
2285
2286      @Override
2287      public Base addChild(String name) throws FHIRException {
2288        if (name.equals("meaning")) {
2289          throw new FHIRException("Cannot call addChild on a primitive type Consent.provision.data.meaning");
2290        }
2291        else if (name.equals("reference")) {
2292          this.reference = new Reference();
2293          return this.reference;
2294        }
2295        else
2296          return super.addChild(name);
2297      }
2298
2299      public ProvisionDataComponent copy() {
2300        ProvisionDataComponent dst = new ProvisionDataComponent();
2301        copyValues(dst);
2302        return dst;
2303      }
2304
2305      public void copyValues(ProvisionDataComponent dst) {
2306        super.copyValues(dst);
2307        dst.meaning = meaning == null ? null : meaning.copy();
2308        dst.reference = reference == null ? null : reference.copy();
2309      }
2310
2311      @Override
2312      public boolean equalsDeep(Base other_) {
2313        if (!super.equalsDeep(other_))
2314          return false;
2315        if (!(other_ instanceof ProvisionDataComponent))
2316          return false;
2317        ProvisionDataComponent o = (ProvisionDataComponent) other_;
2318        return compareDeep(meaning, o.meaning, true) && compareDeep(reference, o.reference, true);
2319      }
2320
2321      @Override
2322      public boolean equalsShallow(Base other_) {
2323        if (!super.equalsShallow(other_))
2324          return false;
2325        if (!(other_ instanceof ProvisionDataComponent))
2326          return false;
2327        ProvisionDataComponent o = (ProvisionDataComponent) other_;
2328        return compareValues(meaning, o.meaning, true);
2329      }
2330
2331      public boolean isEmpty() {
2332        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(meaning, reference);
2333      }
2334
2335  public String fhirType() {
2336    return "Consent.provision.data";
2337
2338  }
2339
2340  }
2341
2342    /**
2343     * Unique identifier for this copy of the Consent Statement.
2344     */
2345    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2346    @Description(shortDefinition="Identifier for this record (external references)", formalDefinition="Unique identifier for this copy of the Consent Statement." )
2347    protected List<Identifier> identifier;
2348
2349    /**
2350     * Indicates the current state of this consent.
2351     */
2352    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
2353    @Description(shortDefinition="draft | proposed | active | rejected | inactive | entered-in-error", formalDefinition="Indicates the current state of this consent." )
2354    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-state-codes")
2355    protected Enumeration<ConsentState> status;
2356
2357    /**
2358     * A selector of the type of consent being presented: ADR, Privacy, Treatment, Research.  This list is now extensible.
2359     */
2360    @Child(name = "scope", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=true, summary=true)
2361    @Description(shortDefinition="Which of the four areas this resource covers (extensible)", formalDefinition="A selector of the type of consent being presented: ADR, Privacy, Treatment, Research.  This list is now extensible." )
2362    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-scope")
2363    protected CodeableConcept scope;
2364
2365    /**
2366     * A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements.
2367     */
2368    @Child(name = "category", type = {CodeableConcept.class}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2369    @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." )
2370    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-category")
2371    protected List<CodeableConcept> category;
2372
2373    /**
2374     * The patient/healthcare consumer to whom this consent applies.
2375     */
2376    @Child(name = "patient", type = {Patient.class}, order=4, min=0, max=1, modifier=false, summary=true)
2377    @Description(shortDefinition="Who the consent applies to", formalDefinition="The patient/healthcare consumer to whom this consent applies." )
2378    protected Reference patient;
2379
2380    /**
2381     * When this  Consent was issued / created / indexed.
2382     */
2383    @Child(name = "dateTime", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true)
2384    @Description(shortDefinition="When this Consent was created or indexed", formalDefinition="When this  Consent was issued / created / indexed." )
2385    protected DateTimeType dateTime;
2386
2387    /**
2388     * Either the Grantor, which is the entity responsible for granting the rights listed in a Consent Directive or the Grantee, which is the entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions.
2389     */
2390    @Child(name = "performer", type = {Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, PractitionerRole.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2391    @Description(shortDefinition="Who is agreeing to the policy and rules", formalDefinition="Either the Grantor, which is the entity responsible for granting the rights listed in a Consent Directive or the Grantee, which is the entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions." )
2392    protected List<Reference> performer;
2393
2394    /**
2395     * The organization that manages the consent, and the framework within which it is executed.
2396     */
2397    @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2398    @Description(shortDefinition="Custodian of the consent", formalDefinition="The organization that manages the consent, and the framework within which it is executed." )
2399    protected List<Reference> organization;
2400
2401    /**
2402     * The source on which this consent statement is based. The source might be a scanned original paper form, or 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.
2403     */
2404    @Child(name = "source", type = {Attachment.class, Consent.class, DocumentReference.class, Contract.class, QuestionnaireResponse.class}, order=8, min=0, max=1, modifier=false, summary=true)
2405    @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, or 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." )
2406    protected DataType source;
2407
2408    /**
2409     * The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.
2410     */
2411    @Child(name = "policy", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2412    @Description(shortDefinition="Policies covered by this consent", formalDefinition="The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law." )
2413    protected List<ConsentPolicyComponent> policy;
2414
2415    /**
2416     * A reference to the specific base computable regulation or policy.
2417     */
2418    @Child(name = "policyRule", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true)
2419    @Description(shortDefinition="Regulation that this consents to", formalDefinition="A reference to the specific base computable regulation or policy." )
2420    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-policy")
2421    protected CodeableConcept policyRule;
2422
2423    /**
2424     * Whether a treatment instruction (e.g. artificial respiration yes or no) was verified with the patient, his/her family or another authorized person.
2425     */
2426    @Child(name = "verification", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2427    @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." )
2428    protected List<ConsentVerificationComponent> verification;
2429
2430    /**
2431     * An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.
2432     */
2433    @Child(name = "provision", type = {}, order=12, min=0, max=1, modifier=false, summary=true)
2434    @Description(shortDefinition="Constraints to the base Consent.policyRule", formalDefinition="An exception to the base policy of this consent. An exception can be an addition or removal of access permissions." )
2435    protected ProvisionComponent provision;
2436
2437    private static final long serialVersionUID = 2061814558L;
2438
2439  /**
2440   * Constructor
2441   */
2442    public Consent() {
2443      super();
2444    }
2445
2446  /**
2447   * Constructor
2448   */
2449    public Consent(ConsentState status, CodeableConcept scope, CodeableConcept category) {
2450      super();
2451      this.setStatus(status);
2452      this.setScope(scope);
2453      this.addCategory(category);
2454    }
2455
2456    /**
2457     * @return {@link #identifier} (Unique identifier for this copy of the Consent Statement.)
2458     */
2459    public List<Identifier> getIdentifier() { 
2460      if (this.identifier == null)
2461        this.identifier = new ArrayList<Identifier>();
2462      return this.identifier;
2463    }
2464
2465    /**
2466     * @return Returns a reference to <code>this</code> for easy method chaining
2467     */
2468    public Consent setIdentifier(List<Identifier> theIdentifier) { 
2469      this.identifier = theIdentifier;
2470      return this;
2471    }
2472
2473    public boolean hasIdentifier() { 
2474      if (this.identifier == null)
2475        return false;
2476      for (Identifier item : this.identifier)
2477        if (!item.isEmpty())
2478          return true;
2479      return false;
2480    }
2481
2482    public Identifier addIdentifier() { //3
2483      Identifier t = new Identifier();
2484      if (this.identifier == null)
2485        this.identifier = new ArrayList<Identifier>();
2486      this.identifier.add(t);
2487      return t;
2488    }
2489
2490    public Consent addIdentifier(Identifier t) { //3
2491      if (t == null)
2492        return this;
2493      if (this.identifier == null)
2494        this.identifier = new ArrayList<Identifier>();
2495      this.identifier.add(t);
2496      return this;
2497    }
2498
2499    /**
2500     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2501     */
2502    public Identifier getIdentifierFirstRep() { 
2503      if (getIdentifier().isEmpty()) {
2504        addIdentifier();
2505      }
2506      return getIdentifier().get(0);
2507    }
2508
2509    /**
2510     * @return {@link #status} (Indicates the current state of this consent.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2511     */
2512    public Enumeration<ConsentState> getStatusElement() { 
2513      if (this.status == null)
2514        if (Configuration.errorOnAutoCreate())
2515          throw new Error("Attempt to auto-create Consent.status");
2516        else if (Configuration.doAutoCreate())
2517          this.status = new Enumeration<ConsentState>(new ConsentStateEnumFactory()); // bb
2518      return this.status;
2519    }
2520
2521    public boolean hasStatusElement() { 
2522      return this.status != null && !this.status.isEmpty();
2523    }
2524
2525    public boolean hasStatus() { 
2526      return this.status != null && !this.status.isEmpty();
2527    }
2528
2529    /**
2530     * @param value {@link #status} (Indicates the current state of this consent.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2531     */
2532    public Consent setStatusElement(Enumeration<ConsentState> value) { 
2533      this.status = value;
2534      return this;
2535    }
2536
2537    /**
2538     * @return Indicates the current state of this consent.
2539     */
2540    public ConsentState getStatus() { 
2541      return this.status == null ? null : this.status.getValue();
2542    }
2543
2544    /**
2545     * @param value Indicates the current state of this consent.
2546     */
2547    public Consent setStatus(ConsentState value) { 
2548        if (this.status == null)
2549          this.status = new Enumeration<ConsentState>(new ConsentStateEnumFactory());
2550        this.status.setValue(value);
2551      return this;
2552    }
2553
2554    /**
2555     * @return {@link #scope} (A selector of the type of consent being presented: ADR, Privacy, Treatment, Research.  This list is now extensible.)
2556     */
2557    public CodeableConcept getScope() { 
2558      if (this.scope == null)
2559        if (Configuration.errorOnAutoCreate())
2560          throw new Error("Attempt to auto-create Consent.scope");
2561        else if (Configuration.doAutoCreate())
2562          this.scope = new CodeableConcept(); // cc
2563      return this.scope;
2564    }
2565
2566    public boolean hasScope() { 
2567      return this.scope != null && !this.scope.isEmpty();
2568    }
2569
2570    /**
2571     * @param value {@link #scope} (A selector of the type of consent being presented: ADR, Privacy, Treatment, Research.  This list is now extensible.)
2572     */
2573    public Consent setScope(CodeableConcept value) { 
2574      this.scope = value;
2575      return this;
2576    }
2577
2578    /**
2579     * @return {@link #category} (A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements.)
2580     */
2581    public List<CodeableConcept> getCategory() { 
2582      if (this.category == null)
2583        this.category = new ArrayList<CodeableConcept>();
2584      return this.category;
2585    }
2586
2587    /**
2588     * @return Returns a reference to <code>this</code> for easy method chaining
2589     */
2590    public Consent setCategory(List<CodeableConcept> theCategory) { 
2591      this.category = theCategory;
2592      return this;
2593    }
2594
2595    public boolean hasCategory() { 
2596      if (this.category == null)
2597        return false;
2598      for (CodeableConcept item : this.category)
2599        if (!item.isEmpty())
2600          return true;
2601      return false;
2602    }
2603
2604    public CodeableConcept addCategory() { //3
2605      CodeableConcept t = new CodeableConcept();
2606      if (this.category == null)
2607        this.category = new ArrayList<CodeableConcept>();
2608      this.category.add(t);
2609      return t;
2610    }
2611
2612    public Consent addCategory(CodeableConcept t) { //3
2613      if (t == null)
2614        return this;
2615      if (this.category == null)
2616        this.category = new ArrayList<CodeableConcept>();
2617      this.category.add(t);
2618      return this;
2619    }
2620
2621    /**
2622     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
2623     */
2624    public CodeableConcept getCategoryFirstRep() { 
2625      if (getCategory().isEmpty()) {
2626        addCategory();
2627      }
2628      return getCategory().get(0);
2629    }
2630
2631    /**
2632     * @return {@link #patient} (The patient/healthcare consumer to whom this consent applies.)
2633     */
2634    public Reference getPatient() { 
2635      if (this.patient == null)
2636        if (Configuration.errorOnAutoCreate())
2637          throw new Error("Attempt to auto-create Consent.patient");
2638        else if (Configuration.doAutoCreate())
2639          this.patient = new Reference(); // cc
2640      return this.patient;
2641    }
2642
2643    public boolean hasPatient() { 
2644      return this.patient != null && !this.patient.isEmpty();
2645    }
2646
2647    /**
2648     * @param value {@link #patient} (The patient/healthcare consumer to whom this consent applies.)
2649     */
2650    public Consent setPatient(Reference value) { 
2651      this.patient = value;
2652      return this;
2653    }
2654
2655    /**
2656     * @return {@link #dateTime} (When this  Consent was issued / created / indexed.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value
2657     */
2658    public DateTimeType getDateTimeElement() { 
2659      if (this.dateTime == null)
2660        if (Configuration.errorOnAutoCreate())
2661          throw new Error("Attempt to auto-create Consent.dateTime");
2662        else if (Configuration.doAutoCreate())
2663          this.dateTime = new DateTimeType(); // bb
2664      return this.dateTime;
2665    }
2666
2667    public boolean hasDateTimeElement() { 
2668      return this.dateTime != null && !this.dateTime.isEmpty();
2669    }
2670
2671    public boolean hasDateTime() { 
2672      return this.dateTime != null && !this.dateTime.isEmpty();
2673    }
2674
2675    /**
2676     * @param value {@link #dateTime} (When this  Consent was issued / created / indexed.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value
2677     */
2678    public Consent setDateTimeElement(DateTimeType value) { 
2679      this.dateTime = value;
2680      return this;
2681    }
2682
2683    /**
2684     * @return When this  Consent was issued / created / indexed.
2685     */
2686    public Date getDateTime() { 
2687      return this.dateTime == null ? null : this.dateTime.getValue();
2688    }
2689
2690    /**
2691     * @param value When this  Consent was issued / created / indexed.
2692     */
2693    public Consent setDateTime(Date value) { 
2694      if (value == null)
2695        this.dateTime = null;
2696      else {
2697        if (this.dateTime == null)
2698          this.dateTime = new DateTimeType();
2699        this.dateTime.setValue(value);
2700      }
2701      return this;
2702    }
2703
2704    /**
2705     * @return {@link #performer} (Either the Grantor, which is the entity responsible for granting the rights listed in a Consent Directive or the Grantee, which is the entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions.)
2706     */
2707    public List<Reference> getPerformer() { 
2708      if (this.performer == null)
2709        this.performer = new ArrayList<Reference>();
2710      return this.performer;
2711    }
2712
2713    /**
2714     * @return Returns a reference to <code>this</code> for easy method chaining
2715     */
2716    public Consent setPerformer(List<Reference> thePerformer) { 
2717      this.performer = thePerformer;
2718      return this;
2719    }
2720
2721    public boolean hasPerformer() { 
2722      if (this.performer == null)
2723        return false;
2724      for (Reference item : this.performer)
2725        if (!item.isEmpty())
2726          return true;
2727      return false;
2728    }
2729
2730    public Reference addPerformer() { //3
2731      Reference t = new Reference();
2732      if (this.performer == null)
2733        this.performer = new ArrayList<Reference>();
2734      this.performer.add(t);
2735      return t;
2736    }
2737
2738    public Consent addPerformer(Reference t) { //3
2739      if (t == null)
2740        return this;
2741      if (this.performer == null)
2742        this.performer = new ArrayList<Reference>();
2743      this.performer.add(t);
2744      return this;
2745    }
2746
2747    /**
2748     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist {3}
2749     */
2750    public Reference getPerformerFirstRep() { 
2751      if (getPerformer().isEmpty()) {
2752        addPerformer();
2753      }
2754      return getPerformer().get(0);
2755    }
2756
2757    /**
2758     * @return {@link #organization} (The organization that manages the consent, and the framework within which it is executed.)
2759     */
2760    public List<Reference> getOrganization() { 
2761      if (this.organization == null)
2762        this.organization = new ArrayList<Reference>();
2763      return this.organization;
2764    }
2765
2766    /**
2767     * @return Returns a reference to <code>this</code> for easy method chaining
2768     */
2769    public Consent setOrganization(List<Reference> theOrganization) { 
2770      this.organization = theOrganization;
2771      return this;
2772    }
2773
2774    public boolean hasOrganization() { 
2775      if (this.organization == null)
2776        return false;
2777      for (Reference item : this.organization)
2778        if (!item.isEmpty())
2779          return true;
2780      return false;
2781    }
2782
2783    public Reference addOrganization() { //3
2784      Reference t = new Reference();
2785      if (this.organization == null)
2786        this.organization = new ArrayList<Reference>();
2787      this.organization.add(t);
2788      return t;
2789    }
2790
2791    public Consent addOrganization(Reference t) { //3
2792      if (t == null)
2793        return this;
2794      if (this.organization == null)
2795        this.organization = new ArrayList<Reference>();
2796      this.organization.add(t);
2797      return this;
2798    }
2799
2800    /**
2801     * @return The first repetition of repeating field {@link #organization}, creating it if it does not already exist {3}
2802     */
2803    public Reference getOrganizationFirstRep() { 
2804      if (getOrganization().isEmpty()) {
2805        addOrganization();
2806      }
2807      return getOrganization().get(0);
2808    }
2809
2810    /**
2811     * @return {@link #source} (The source on which this consent statement is based. The source might be a scanned original paper form, or 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.)
2812     */
2813    public DataType getSource() { 
2814      return this.source;
2815    }
2816
2817    /**
2818     * @return {@link #source} (The source on which this consent statement is based. The source might be a scanned original paper form, or 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.)
2819     */
2820    public Attachment getSourceAttachment() throws FHIRException { 
2821      if (this.source == null)
2822        this.source = new Attachment();
2823      if (!(this.source instanceof Attachment))
2824        throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.source.getClass().getName()+" was encountered");
2825      return (Attachment) this.source;
2826    }
2827
2828    public boolean hasSourceAttachment() { 
2829      return this != null && this.source instanceof Attachment;
2830    }
2831
2832    /**
2833     * @return {@link #source} (The source on which this consent statement is based. The source might be a scanned original paper form, or 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.)
2834     */
2835    public Reference getSourceReference() throws FHIRException { 
2836      if (this.source == null)
2837        this.source = new Reference();
2838      if (!(this.source instanceof Reference))
2839        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.source.getClass().getName()+" was encountered");
2840      return (Reference) this.source;
2841    }
2842
2843    public boolean hasSourceReference() { 
2844      return this != null && this.source instanceof Reference;
2845    }
2846
2847    public boolean hasSource() { 
2848      return this.source != null && !this.source.isEmpty();
2849    }
2850
2851    /**
2852     * @param value {@link #source} (The source on which this consent statement is based. The source might be a scanned original paper form, or 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.)
2853     */
2854    public Consent setSource(DataType value) { 
2855      if (value != null && !(value instanceof Attachment || value instanceof Reference))
2856        throw new Error("Not the right type for Consent.source[x]: "+value.fhirType());
2857      this.source = value;
2858      return this;
2859    }
2860
2861    /**
2862     * @return {@link #policy} (The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.)
2863     */
2864    public List<ConsentPolicyComponent> getPolicy() { 
2865      if (this.policy == null)
2866        this.policy = new ArrayList<ConsentPolicyComponent>();
2867      return this.policy;
2868    }
2869
2870    /**
2871     * @return Returns a reference to <code>this</code> for easy method chaining
2872     */
2873    public Consent setPolicy(List<ConsentPolicyComponent> thePolicy) { 
2874      this.policy = thePolicy;
2875      return this;
2876    }
2877
2878    public boolean hasPolicy() { 
2879      if (this.policy == null)
2880        return false;
2881      for (ConsentPolicyComponent item : this.policy)
2882        if (!item.isEmpty())
2883          return true;
2884      return false;
2885    }
2886
2887    public ConsentPolicyComponent addPolicy() { //3
2888      ConsentPolicyComponent t = new ConsentPolicyComponent();
2889      if (this.policy == null)
2890        this.policy = new ArrayList<ConsentPolicyComponent>();
2891      this.policy.add(t);
2892      return t;
2893    }
2894
2895    public Consent addPolicy(ConsentPolicyComponent t) { //3
2896      if (t == null)
2897        return this;
2898      if (this.policy == null)
2899        this.policy = new ArrayList<ConsentPolicyComponent>();
2900      this.policy.add(t);
2901      return this;
2902    }
2903
2904    /**
2905     * @return The first repetition of repeating field {@link #policy}, creating it if it does not already exist {3}
2906     */
2907    public ConsentPolicyComponent getPolicyFirstRep() { 
2908      if (getPolicy().isEmpty()) {
2909        addPolicy();
2910      }
2911      return getPolicy().get(0);
2912    }
2913
2914    /**
2915     * @return {@link #policyRule} (A reference to the specific base computable regulation or policy.)
2916     */
2917    public CodeableConcept getPolicyRule() { 
2918      if (this.policyRule == null)
2919        if (Configuration.errorOnAutoCreate())
2920          throw new Error("Attempt to auto-create Consent.policyRule");
2921        else if (Configuration.doAutoCreate())
2922          this.policyRule = new CodeableConcept(); // cc
2923      return this.policyRule;
2924    }
2925
2926    public boolean hasPolicyRule() { 
2927      return this.policyRule != null && !this.policyRule.isEmpty();
2928    }
2929
2930    /**
2931     * @param value {@link #policyRule} (A reference to the specific base computable regulation or policy.)
2932     */
2933    public Consent setPolicyRule(CodeableConcept value) { 
2934      this.policyRule = value;
2935      return this;
2936    }
2937
2938    /**
2939     * @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.)
2940     */
2941    public List<ConsentVerificationComponent> getVerification() { 
2942      if (this.verification == null)
2943        this.verification = new ArrayList<ConsentVerificationComponent>();
2944      return this.verification;
2945    }
2946
2947    /**
2948     * @return Returns a reference to <code>this</code> for easy method chaining
2949     */
2950    public Consent setVerification(List<ConsentVerificationComponent> theVerification) { 
2951      this.verification = theVerification;
2952      return this;
2953    }
2954
2955    public boolean hasVerification() { 
2956      if (this.verification == null)
2957        return false;
2958      for (ConsentVerificationComponent item : this.verification)
2959        if (!item.isEmpty())
2960          return true;
2961      return false;
2962    }
2963
2964    public ConsentVerificationComponent addVerification() { //3
2965      ConsentVerificationComponent t = new ConsentVerificationComponent();
2966      if (this.verification == null)
2967        this.verification = new ArrayList<ConsentVerificationComponent>();
2968      this.verification.add(t);
2969      return t;
2970    }
2971
2972    public Consent addVerification(ConsentVerificationComponent t) { //3
2973      if (t == null)
2974        return this;
2975      if (this.verification == null)
2976        this.verification = new ArrayList<ConsentVerificationComponent>();
2977      this.verification.add(t);
2978      return this;
2979    }
2980
2981    /**
2982     * @return The first repetition of repeating field {@link #verification}, creating it if it does not already exist {3}
2983     */
2984    public ConsentVerificationComponent getVerificationFirstRep() { 
2985      if (getVerification().isEmpty()) {
2986        addVerification();
2987      }
2988      return getVerification().get(0);
2989    }
2990
2991    /**
2992     * @return {@link #provision} (An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.)
2993     */
2994    public ProvisionComponent getProvision() { 
2995      if (this.provision == null)
2996        if (Configuration.errorOnAutoCreate())
2997          throw new Error("Attempt to auto-create Consent.provision");
2998        else if (Configuration.doAutoCreate())
2999          this.provision = new ProvisionComponent(); // cc
3000      return this.provision;
3001    }
3002
3003    public boolean hasProvision() { 
3004      return this.provision != null && !this.provision.isEmpty();
3005    }
3006
3007    /**
3008     * @param value {@link #provision} (An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.)
3009     */
3010    public Consent setProvision(ProvisionComponent value) { 
3011      this.provision = value;
3012      return this;
3013    }
3014
3015      protected void listChildren(List<Property> children) {
3016        super.listChildren(children);
3017        children.add(new Property("identifier", "Identifier", "Unique identifier for this copy of the Consent Statement.", 0, java.lang.Integer.MAX_VALUE, identifier));
3018        children.add(new Property("status", "code", "Indicates the current state of this consent.", 0, 1, status));
3019        children.add(new Property("scope", "CodeableConcept", "A selector of the type of consent being presented: ADR, Privacy, Treatment, Research.  This list is now extensible.", 0, 1, scope));
3020        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));
3021        children.add(new Property("patient", "Reference(Patient)", "The patient/healthcare consumer to whom this consent applies.", 0, 1, patient));
3022        children.add(new Property("dateTime", "dateTime", "When this  Consent was issued / created / indexed.", 0, 1, dateTime));
3023        children.add(new Property("performer", "Reference(Organization|Patient|Practitioner|RelatedPerson|PractitionerRole)", "Either the Grantor, which is the entity responsible for granting the rights listed in a Consent Directive or the Grantee, which is 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, performer));
3024        children.add(new Property("organization", "Reference(Organization)", "The organization that manages the consent, and the framework within which it is executed.", 0, java.lang.Integer.MAX_VALUE, organization));
3025        children.add(new Property("source[x]", "Attachment|Reference(Consent|DocumentReference|Contract|QuestionnaireResponse)", "The source on which this consent statement is based. The source might be a scanned original paper form, or 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, 1, source));
3026        children.add(new Property("policy", "", "The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.", 0, java.lang.Integer.MAX_VALUE, policy));
3027        children.add(new Property("policyRule", "CodeableConcept", "A reference to the specific base computable regulation or policy.", 0, 1, policyRule));
3028        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));
3029        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));
3030      }
3031
3032      @Override
3033      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3034        switch (_hash) {
3035        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique identifier for this copy of the Consent Statement.", 0, java.lang.Integer.MAX_VALUE, identifier);
3036        case -892481550: /*status*/  return new Property("status", "code", "Indicates the current state of this consent.", 0, 1, status);
3037        case 109264468: /*scope*/  return new Property("scope", "CodeableConcept", "A selector of the type of consent being presented: ADR, Privacy, Treatment, Research.  This list is now extensible.", 0, 1, scope);
3038        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);
3039        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "The patient/healthcare consumer to whom this consent applies.", 0, 1, patient);
3040        case 1792749467: /*dateTime*/  return new Property("dateTime", "dateTime", "When this  Consent was issued / created / indexed.", 0, 1, dateTime);
3041        case 481140686: /*performer*/  return new Property("performer", "Reference(Organization|Patient|Practitioner|RelatedPerson|PractitionerRole)", "Either the Grantor, which is the entity responsible for granting the rights listed in a Consent Directive or the Grantee, which is 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, performer);
3042        case 1178922291: /*organization*/  return new Property("organization", "Reference(Organization)", "The organization that manages the consent, and the framework within which it is executed.", 0, java.lang.Integer.MAX_VALUE, organization);
3043        case -1698413947: /*source[x]*/  return new Property("source[x]", "Attachment|Reference(Consent|DocumentReference|Contract|QuestionnaireResponse)", "The source on which this consent statement is based. The source might be a scanned original paper form, or 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, 1, source);
3044        case -896505829: /*source*/  return new Property("source[x]", "Attachment|Reference(Consent|DocumentReference|Contract|QuestionnaireResponse)", "The source on which this consent statement is based. The source might be a scanned original paper form, or 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, 1, source);
3045        case 1964406686: /*sourceAttachment*/  return new Property("source[x]", "Attachment", "The source on which this consent statement is based. The source might be a scanned original paper form, or 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, 1, source);
3046        case -244259472: /*sourceReference*/  return new Property("source[x]", "Reference(Consent|DocumentReference|Contract|QuestionnaireResponse)", "The source on which this consent statement is based. The source might be a scanned original paper form, or 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, 1, source);
3047        case -982670030: /*policy*/  return new Property("policy", "", "The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.", 0, java.lang.Integer.MAX_VALUE, policy);
3048        case 1593493326: /*policyRule*/  return new Property("policyRule", "CodeableConcept", "A reference to the specific base computable regulation or policy.", 0, 1, policyRule);
3049        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);
3050        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);
3051        default: return super.getNamedProperty(_hash, _name, _checkValid);
3052        }
3053
3054      }
3055
3056      @Override
3057      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3058        switch (hash) {
3059        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3060        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ConsentState>
3061        case 109264468: /*scope*/ return this.scope == null ? new Base[0] : new Base[] {this.scope}; // CodeableConcept
3062        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
3063        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
3064        case 1792749467: /*dateTime*/ return this.dateTime == null ? new Base[0] : new Base[] {this.dateTime}; // DateTimeType
3065        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // Reference
3066        case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : this.organization.toArray(new Base[this.organization.size()]); // Reference
3067        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // DataType
3068        case -982670030: /*policy*/ return this.policy == null ? new Base[0] : this.policy.toArray(new Base[this.policy.size()]); // ConsentPolicyComponent
3069        case 1593493326: /*policyRule*/ return this.policyRule == null ? new Base[0] : new Base[] {this.policyRule}; // CodeableConcept
3070        case -1484401125: /*verification*/ return this.verification == null ? new Base[0] : this.verification.toArray(new Base[this.verification.size()]); // ConsentVerificationComponent
3071        case -547120939: /*provision*/ return this.provision == null ? new Base[0] : new Base[] {this.provision}; // ProvisionComponent
3072        default: return super.getProperty(hash, name, checkValid);
3073        }
3074
3075      }
3076
3077      @Override
3078      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3079        switch (hash) {
3080        case -1618432855: // identifier
3081          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
3082          return value;
3083        case -892481550: // status
3084          value = new ConsentStateEnumFactory().fromType(TypeConvertor.castToCode(value));
3085          this.status = (Enumeration) value; // Enumeration<ConsentState>
3086          return value;
3087        case 109264468: // scope
3088          this.scope = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3089          return value;
3090        case 50511102: // category
3091          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3092          return value;
3093        case -791418107: // patient
3094          this.patient = TypeConvertor.castToReference(value); // Reference
3095          return value;
3096        case 1792749467: // dateTime
3097          this.dateTime = TypeConvertor.castToDateTime(value); // DateTimeType
3098          return value;
3099        case 481140686: // performer
3100          this.getPerformer().add(TypeConvertor.castToReference(value)); // Reference
3101          return value;
3102        case 1178922291: // organization
3103          this.getOrganization().add(TypeConvertor.castToReference(value)); // Reference
3104          return value;
3105        case -896505829: // source
3106          this.source = TypeConvertor.castToType(value); // DataType
3107          return value;
3108        case -982670030: // policy
3109          this.getPolicy().add((ConsentPolicyComponent) value); // ConsentPolicyComponent
3110          return value;
3111        case 1593493326: // policyRule
3112          this.policyRule = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3113          return value;
3114        case -1484401125: // verification
3115          this.getVerification().add((ConsentVerificationComponent) value); // ConsentVerificationComponent
3116          return value;
3117        case -547120939: // provision
3118          this.provision = (ProvisionComponent) value; // ProvisionComponent
3119          return value;
3120        default: return super.setProperty(hash, name, value);
3121        }
3122
3123      }
3124
3125      @Override
3126      public Base setProperty(String name, Base value) throws FHIRException {
3127        if (name.equals("identifier")) {
3128          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
3129        } else if (name.equals("status")) {
3130          value = new ConsentStateEnumFactory().fromType(TypeConvertor.castToCode(value));
3131          this.status = (Enumeration) value; // Enumeration<ConsentState>
3132        } else if (name.equals("scope")) {
3133          this.scope = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3134        } else if (name.equals("category")) {
3135          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
3136        } else if (name.equals("patient")) {
3137          this.patient = TypeConvertor.castToReference(value); // Reference
3138        } else if (name.equals("dateTime")) {
3139          this.dateTime = TypeConvertor.castToDateTime(value); // DateTimeType
3140        } else if (name.equals("performer")) {
3141          this.getPerformer().add(TypeConvertor.castToReference(value));
3142        } else if (name.equals("organization")) {
3143          this.getOrganization().add(TypeConvertor.castToReference(value));
3144        } else if (name.equals("source[x]")) {
3145          this.source = TypeConvertor.castToType(value); // DataType
3146        } else if (name.equals("policy")) {
3147          this.getPolicy().add((ConsentPolicyComponent) value);
3148        } else if (name.equals("policyRule")) {
3149          this.policyRule = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3150        } else if (name.equals("verification")) {
3151          this.getVerification().add((ConsentVerificationComponent) value);
3152        } else if (name.equals("provision")) {
3153          this.provision = (ProvisionComponent) value; // ProvisionComponent
3154        } else
3155          return super.setProperty(name, value);
3156        return value;
3157      }
3158
3159      @Override
3160      public Base makeProperty(int hash, String name) throws FHIRException {
3161        switch (hash) {
3162        case -1618432855:  return addIdentifier(); 
3163        case -892481550:  return getStatusElement();
3164        case 109264468:  return getScope();
3165        case 50511102:  return addCategory(); 
3166        case -791418107:  return getPatient();
3167        case 1792749467:  return getDateTimeElement();
3168        case 481140686:  return addPerformer(); 
3169        case 1178922291:  return addOrganization(); 
3170        case -1698413947:  return getSource();
3171        case -896505829:  return getSource();
3172        case -982670030:  return addPolicy(); 
3173        case 1593493326:  return getPolicyRule();
3174        case -1484401125:  return addVerification(); 
3175        case -547120939:  return getProvision();
3176        default: return super.makeProperty(hash, name);
3177        }
3178
3179      }
3180
3181      @Override
3182      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3183        switch (hash) {
3184        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3185        case -892481550: /*status*/ return new String[] {"code"};
3186        case 109264468: /*scope*/ return new String[] {"CodeableConcept"};
3187        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
3188        case -791418107: /*patient*/ return new String[] {"Reference"};
3189        case 1792749467: /*dateTime*/ return new String[] {"dateTime"};
3190        case 481140686: /*performer*/ return new String[] {"Reference"};
3191        case 1178922291: /*organization*/ return new String[] {"Reference"};
3192        case -896505829: /*source*/ return new String[] {"Attachment", "Reference"};
3193        case -982670030: /*policy*/ return new String[] {};
3194        case 1593493326: /*policyRule*/ return new String[] {"CodeableConcept"};
3195        case -1484401125: /*verification*/ return new String[] {};
3196        case -547120939: /*provision*/ return new String[] {};
3197        default: return super.getTypesForProperty(hash, name);
3198        }
3199
3200      }
3201
3202      @Override
3203      public Base addChild(String name) throws FHIRException {
3204        if (name.equals("identifier")) {
3205          return addIdentifier();
3206        }
3207        else if (name.equals("status")) {
3208          throw new FHIRException("Cannot call addChild on a primitive type Consent.status");
3209        }
3210        else if (name.equals("scope")) {
3211          this.scope = new CodeableConcept();
3212          return this.scope;
3213        }
3214        else if (name.equals("category")) {
3215          return addCategory();
3216        }
3217        else if (name.equals("patient")) {
3218          this.patient = new Reference();
3219          return this.patient;
3220        }
3221        else if (name.equals("dateTime")) {
3222          throw new FHIRException("Cannot call addChild on a primitive type Consent.dateTime");
3223        }
3224        else if (name.equals("performer")) {
3225          return addPerformer();
3226        }
3227        else if (name.equals("organization")) {
3228          return addOrganization();
3229        }
3230        else if (name.equals("sourceAttachment")) {
3231          this.source = new Attachment();
3232          return this.source;
3233        }
3234        else if (name.equals("sourceReference")) {
3235          this.source = new Reference();
3236          return this.source;
3237        }
3238        else if (name.equals("policy")) {
3239          return addPolicy();
3240        }
3241        else if (name.equals("policyRule")) {
3242          this.policyRule = new CodeableConcept();
3243          return this.policyRule;
3244        }
3245        else if (name.equals("verification")) {
3246          return addVerification();
3247        }
3248        else if (name.equals("provision")) {
3249          this.provision = new ProvisionComponent();
3250          return this.provision;
3251        }
3252        else
3253          return super.addChild(name);
3254      }
3255
3256  public String fhirType() {
3257    return "Consent";
3258
3259  }
3260
3261      public Consent copy() {
3262        Consent dst = new Consent();
3263        copyValues(dst);
3264        return dst;
3265      }
3266
3267      public void copyValues(Consent dst) {
3268        super.copyValues(dst);
3269        if (identifier != null) {
3270          dst.identifier = new ArrayList<Identifier>();
3271          for (Identifier i : identifier)
3272            dst.identifier.add(i.copy());
3273        };
3274        dst.status = status == null ? null : status.copy();
3275        dst.scope = scope == null ? null : scope.copy();
3276        if (category != null) {
3277          dst.category = new ArrayList<CodeableConcept>();
3278          for (CodeableConcept i : category)
3279            dst.category.add(i.copy());
3280        };
3281        dst.patient = patient == null ? null : patient.copy();
3282        dst.dateTime = dateTime == null ? null : dateTime.copy();
3283        if (performer != null) {
3284          dst.performer = new ArrayList<Reference>();
3285          for (Reference i : performer)
3286            dst.performer.add(i.copy());
3287        };
3288        if (organization != null) {
3289          dst.organization = new ArrayList<Reference>();
3290          for (Reference i : organization)
3291            dst.organization.add(i.copy());
3292        };
3293        dst.source = source == null ? null : source.copy();
3294        if (policy != null) {
3295          dst.policy = new ArrayList<ConsentPolicyComponent>();
3296          for (ConsentPolicyComponent i : policy)
3297            dst.policy.add(i.copy());
3298        };
3299        dst.policyRule = policyRule == null ? null : policyRule.copy();
3300        if (verification != null) {
3301          dst.verification = new ArrayList<ConsentVerificationComponent>();
3302          for (ConsentVerificationComponent i : verification)
3303            dst.verification.add(i.copy());
3304        };
3305        dst.provision = provision == null ? null : provision.copy();
3306      }
3307
3308      protected Consent typedCopy() {
3309        return copy();
3310      }
3311
3312      @Override
3313      public boolean equalsDeep(Base other_) {
3314        if (!super.equalsDeep(other_))
3315          return false;
3316        if (!(other_ instanceof Consent))
3317          return false;
3318        Consent o = (Consent) other_;
3319        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(scope, o.scope, true)
3320           && compareDeep(category, o.category, true) && compareDeep(patient, o.patient, true) && compareDeep(dateTime, o.dateTime, true)
3321           && compareDeep(performer, o.performer, true) && compareDeep(organization, o.organization, true)
3322           && compareDeep(source, o.source, true) && compareDeep(policy, o.policy, true) && compareDeep(policyRule, o.policyRule, true)
3323           && compareDeep(verification, o.verification, true) && compareDeep(provision, o.provision, true)
3324          ;
3325      }
3326
3327      @Override
3328      public boolean equalsShallow(Base other_) {
3329        if (!super.equalsShallow(other_))
3330          return false;
3331        if (!(other_ instanceof Consent))
3332          return false;
3333        Consent o = (Consent) other_;
3334        return compareValues(status, o.status, true) && compareValues(dateTime, o.dateTime, true);
3335      }
3336
3337      public boolean isEmpty() {
3338        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, scope
3339          , category, patient, dateTime, performer, organization, source, policy, policyRule
3340          , verification, provision);
3341      }
3342
3343  @Override
3344  public ResourceType getResourceType() {
3345    return ResourceType.Consent;
3346   }
3347
3348 /**
3349   * Search parameter: <b>action</b>
3350   * <p>
3351   * Description: <b>Actions controlled by this rule</b><br>
3352   * Type: <b>token</b><br>
3353   * Path: <b>Consent.provision.action</b><br>
3354   * </p>
3355   */
3356  @SearchParamDefinition(name="action", path="Consent.provision.action", description="Actions controlled by this rule", type="token" )
3357  public static final String SP_ACTION = "action";
3358 /**
3359   * <b>Fluent Client</b> search parameter constant for <b>action</b>
3360   * <p>
3361   * Description: <b>Actions controlled by this rule</b><br>
3362   * Type: <b>token</b><br>
3363   * Path: <b>Consent.provision.action</b><br>
3364   * </p>
3365   */
3366  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTION);
3367
3368 /**
3369   * Search parameter: <b>actor</b>
3370   * <p>
3371   * Description: <b>Resource for the actor (or group, by role)</b><br>
3372   * Type: <b>reference</b><br>
3373   * Path: <b>Consent.provision.actor.reference</b><br>
3374   * </p>
3375   */
3376  @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 } )
3377  public static final String SP_ACTOR = "actor";
3378 /**
3379   * <b>Fluent Client</b> search parameter constant for <b>actor</b>
3380   * <p>
3381   * Description: <b>Resource for the actor (or group, by role)</b><br>
3382   * Type: <b>reference</b><br>
3383   * Path: <b>Consent.provision.actor.reference</b><br>
3384   * </p>
3385   */
3386  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTOR);
3387
3388/**
3389   * Constant for fluent queries to be used to add include statements. Specifies
3390   * the path value of "<b>Consent:actor</b>".
3391   */
3392  public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTOR = new ca.uhn.fhir.model.api.Include("Consent:actor").toLocked();
3393
3394 /**
3395   * Search parameter: <b>category</b>
3396   * <p>
3397   * Description: <b>Classification of the consent statement - for indexing/retrieval</b><br>
3398   * Type: <b>token</b><br>
3399   * Path: <b>Consent.category</b><br>
3400   * </p>
3401   */
3402  @SearchParamDefinition(name="category", path="Consent.category", description="Classification of the consent statement - for indexing/retrieval", type="token" )
3403  public static final String SP_CATEGORY = "category";
3404 /**
3405   * <b>Fluent Client</b> search parameter constant for <b>category</b>
3406   * <p>
3407   * Description: <b>Classification of the consent statement - for indexing/retrieval</b><br>
3408   * Type: <b>token</b><br>
3409   * Path: <b>Consent.category</b><br>
3410   * </p>
3411   */
3412  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
3413
3414 /**
3415   * Search parameter: <b>consentor</b>
3416   * <p>
3417   * Description: <b>Who is agreeing to the policy and rules</b><br>
3418   * Type: <b>reference</b><br>
3419   * Path: <b>Consent.performer</b><br>
3420   * </p>
3421   */
3422  @SearchParamDefinition(name="consentor", path="Consent.performer", description="Who is agreeing to the policy and rules", type="reference", target={Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
3423  public static final String SP_CONSENTOR = "consentor";
3424 /**
3425   * <b>Fluent Client</b> search parameter constant for <b>consentor</b>
3426   * <p>
3427   * Description: <b>Who is agreeing to the policy and rules</b><br>
3428   * Type: <b>reference</b><br>
3429   * Path: <b>Consent.performer</b><br>
3430   * </p>
3431   */
3432  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONSENTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONSENTOR);
3433
3434/**
3435   * Constant for fluent queries to be used to add include statements. Specifies
3436   * the path value of "<b>Consent:consentor</b>".
3437   */
3438  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONSENTOR = new ca.uhn.fhir.model.api.Include("Consent:consentor").toLocked();
3439
3440 /**
3441   * Search parameter: <b>data</b>
3442   * <p>
3443   * Description: <b>The actual data reference</b><br>
3444   * Type: <b>reference</b><br>
3445   * Path: <b>Consent.provision.data.reference</b><br>
3446   * </p>
3447   */
3448  @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, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CarePlan.class, CareTeam.class, CatalogEntry.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, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceMetric.class, DeviceRequest.class, DeviceUseStatement.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, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Media.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationStatement.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.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, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchDefinition.class, ResearchElementDefinition.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, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
3449  public static final String SP_DATA = "data";
3450 /**
3451   * <b>Fluent Client</b> search parameter constant for <b>data</b>
3452   * <p>
3453   * Description: <b>The actual data reference</b><br>
3454   * Type: <b>reference</b><br>
3455   * Path: <b>Consent.provision.data.reference</b><br>
3456   * </p>
3457   */
3458  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DATA = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DATA);
3459
3460/**
3461   * Constant for fluent queries to be used to add include statements. Specifies
3462   * the path value of "<b>Consent:data</b>".
3463   */
3464  public static final ca.uhn.fhir.model.api.Include INCLUDE_DATA = new ca.uhn.fhir.model.api.Include("Consent:data").toLocked();
3465
3466 /**
3467   * Search parameter: <b>organization</b>
3468   * <p>
3469   * Description: <b>Custodian of the consent</b><br>
3470   * Type: <b>reference</b><br>
3471   * Path: <b>Consent.organization</b><br>
3472   * </p>
3473   */
3474  @SearchParamDefinition(name="organization", path="Consent.organization", description="Custodian of the consent", type="reference", target={Organization.class } )
3475  public static final String SP_ORGANIZATION = "organization";
3476 /**
3477   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
3478   * <p>
3479   * Description: <b>Custodian of the consent</b><br>
3480   * Type: <b>reference</b><br>
3481   * Path: <b>Consent.organization</b><br>
3482   * </p>
3483   */
3484  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
3485
3486/**
3487   * Constant for fluent queries to be used to add include statements. Specifies
3488   * the path value of "<b>Consent:organization</b>".
3489   */
3490  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Consent:organization").toLocked();
3491
3492 /**
3493   * Search parameter: <b>period</b>
3494   * <p>
3495   * Description: <b>Timeframe for this rule</b><br>
3496   * Type: <b>date</b><br>
3497   * Path: <b>Consent.provision.period</b><br>
3498   * </p>
3499   */
3500  @SearchParamDefinition(name="period", path="Consent.provision.period", description="Timeframe for this rule", type="date" )
3501  public static final String SP_PERIOD = "period";
3502 /**
3503   * <b>Fluent Client</b> search parameter constant for <b>period</b>
3504   * <p>
3505   * Description: <b>Timeframe for this rule</b><br>
3506   * Type: <b>date</b><br>
3507   * Path: <b>Consent.provision.period</b><br>
3508   * </p>
3509   */
3510  public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD);
3511
3512 /**
3513   * Search parameter: <b>purpose</b>
3514   * <p>
3515   * Description: <b>Context of activities covered by this rule</b><br>
3516   * Type: <b>token</b><br>
3517   * Path: <b>Consent.provision.purpose</b><br>
3518   * </p>
3519   */
3520  @SearchParamDefinition(name="purpose", path="Consent.provision.purpose", description="Context of activities covered by this rule", type="token" )
3521  public static final String SP_PURPOSE = "purpose";
3522 /**
3523   * <b>Fluent Client</b> search parameter constant for <b>purpose</b>
3524   * <p>
3525   * Description: <b>Context of activities covered by this rule</b><br>
3526   * Type: <b>token</b><br>
3527   * Path: <b>Consent.provision.purpose</b><br>
3528   * </p>
3529   */
3530  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PURPOSE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PURPOSE);
3531
3532 /**
3533   * Search parameter: <b>scope</b>
3534   * <p>
3535   * Description: <b>Which of the four areas this resource covers (extensible)</b><br>
3536   * Type: <b>token</b><br>
3537   * Path: <b>Consent.scope</b><br>
3538   * </p>
3539   */
3540  @SearchParamDefinition(name="scope", path="Consent.scope", description="Which of the four areas this resource covers (extensible)", type="token" )
3541  public static final String SP_SCOPE = "scope";
3542 /**
3543   * <b>Fluent Client</b> search parameter constant for <b>scope</b>
3544   * <p>
3545   * Description: <b>Which of the four areas this resource covers (extensible)</b><br>
3546   * Type: <b>token</b><br>
3547   * Path: <b>Consent.scope</b><br>
3548   * </p>
3549   */
3550  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SCOPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SCOPE);
3551
3552 /**
3553   * Search parameter: <b>security-label</b>
3554   * <p>
3555   * Description: <b>Security Labels that define affected resources</b><br>
3556   * Type: <b>token</b><br>
3557   * Path: <b>Consent.provision.securityLabel</b><br>
3558   * </p>
3559   */
3560  @SearchParamDefinition(name="security-label", path="Consent.provision.securityLabel", description="Security Labels that define affected resources", type="token" )
3561  public static final String SP_SECURITY_LABEL = "security-label";
3562 /**
3563   * <b>Fluent Client</b> search parameter constant for <b>security-label</b>
3564   * <p>
3565   * Description: <b>Security Labels that define affected resources</b><br>
3566   * Type: <b>token</b><br>
3567   * Path: <b>Consent.provision.securityLabel</b><br>
3568   * </p>
3569   */
3570  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SECURITY_LABEL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SECURITY_LABEL);
3571
3572 /**
3573   * Search parameter: <b>source-reference</b>
3574   * <p>
3575   * Description: <b>Search by reference to a Consent, DocumentReference, Contract  or QuestionnaireResponse</b><br>
3576   * Type: <b>reference</b><br>
3577   * Path: <b>Consent.source</b><br>
3578   * </p>
3579   */
3580  @SearchParamDefinition(name="source-reference", path="Consent.source", description="Search by reference to a Consent, DocumentReference, Contract  or QuestionnaireResponse", type="reference", target={Consent.class, Contract.class, DocumentReference.class, QuestionnaireResponse.class } )
3581  public static final String SP_SOURCE_REFERENCE = "source-reference";
3582 /**
3583   * <b>Fluent Client</b> search parameter constant for <b>source-reference</b>
3584   * <p>
3585   * Description: <b>Search by reference to a Consent, DocumentReference, Contract  or QuestionnaireResponse</b><br>
3586   * Type: <b>reference</b><br>
3587   * Path: <b>Consent.source</b><br>
3588   * </p>
3589   */
3590  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE_REFERENCE);
3591
3592/**
3593   * Constant for fluent queries to be used to add include statements. Specifies
3594   * the path value of "<b>Consent:source-reference</b>".
3595   */
3596  public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE_REFERENCE = new ca.uhn.fhir.model.api.Include("Consent:source-reference").toLocked();
3597
3598 /**
3599   * Search parameter: <b>status</b>
3600   * <p>
3601   * Description: <b>draft | proposed | active | rejected | inactive | entered-in-error</b><br>
3602   * Type: <b>token</b><br>
3603   * Path: <b>Consent.status</b><br>
3604   * </p>
3605   */
3606  @SearchParamDefinition(name="status", path="Consent.status", description="draft | proposed | active | rejected | inactive | entered-in-error", type="token" )
3607  public static final String SP_STATUS = "status";
3608 /**
3609   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3610   * <p>
3611   * Description: <b>draft | proposed | active | rejected | inactive | entered-in-error</b><br>
3612   * Type: <b>token</b><br>
3613   * Path: <b>Consent.status</b><br>
3614   * </p>
3615   */
3616  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3617
3618 /**
3619   * Search parameter: <b>date</b>
3620   * <p>
3621   * Description: <b>Multiple Resources: 
3622
3623* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
3624* [CarePlan](careplan.html): Time period plan covers
3625* [CareTeam](careteam.html): Time period team covers
3626* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
3627* [Composition](composition.html): Composition editing time
3628* [Consent](consent.html): When this Consent was created or indexed
3629* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
3630* [Encounter](encounter.html): A date within the period the Encounter lasted
3631* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
3632* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
3633* [Flag](flag.html): Time period when flag is active
3634* [Immunization](immunization.html): Vaccination  (non)-Administration Date
3635* [List](list.html): When the list was prepared
3636* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
3637* [Procedure](procedure.html): When the procedure was performed
3638* [RiskAssessment](riskassessment.html): When was assessment made?
3639* [SupplyRequest](supplyrequest.html): When the request was made
3640</b><br>
3641   * Type: <b>date</b><br>
3642   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | Immunization.occurrence | List.date | Observation.effective | Procedure.performed | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
3643   * </p>
3644   */
3645  @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | Immunization.occurrence | List.date | Observation.effective | Procedure.performed | (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): Time period team covers\r\n* [ClinicalImpression](clinicalimpression.html): When the assessment was documented\r\n* [Composition](composition.html): Composition editing time\r\n* [Consent](consent.html): When this Consent was created or indexed\r\n* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report\r\n* [Encounter](encounter.html): A date within the period 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 was performed\r\n* [RiskAssessment](riskassessment.html): When was assessment made?\r\n* [SupplyRequest](supplyrequest.html): When the request was made\r\n", type="date" )
3646  public static final String SP_DATE = "date";
3647 /**
3648   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3649   * <p>
3650   * Description: <b>Multiple Resources: 
3651
3652* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
3653* [CarePlan](careplan.html): Time period plan covers
3654* [CareTeam](careteam.html): Time period team covers
3655* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
3656* [Composition](composition.html): Composition editing time
3657* [Consent](consent.html): When this Consent was created or indexed
3658* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
3659* [Encounter](encounter.html): A date within the period the Encounter lasted
3660* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
3661* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
3662* [Flag](flag.html): Time period when flag is active
3663* [Immunization](immunization.html): Vaccination  (non)-Administration Date
3664* [List](list.html): When the list was prepared
3665* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
3666* [Procedure](procedure.html): When the procedure was performed
3667* [RiskAssessment](riskassessment.html): When was assessment made?
3668* [SupplyRequest](supplyrequest.html): When the request was made
3669</b><br>
3670   * Type: <b>date</b><br>
3671   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | Immunization.occurrence | List.date | Observation.effective | Procedure.performed | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
3672   * </p>
3673   */
3674  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
3675
3676 /**
3677   * Search parameter: <b>identifier</b>
3678   * <p>
3679   * Description: <b>Multiple Resources: 
3680
3681* [AllergyIntolerance](allergyintolerance.html): External ids for this item
3682* [CarePlan](careplan.html): External Ids for this plan
3683* [CareTeam](careteam.html): External Ids for this team
3684* [Composition](composition.html): Version-independent identifier for the Composition
3685* [Condition](condition.html): A unique identifier of the condition record
3686* [Consent](consent.html): Identifier for this record (external references)
3687* [DetectedIssue](detectedissue.html): Unique id for the detected issue
3688* [DeviceRequest](devicerequest.html): Business identifier for request/order
3689* [DiagnosticReport](diagnosticreport.html): An identifier for the report
3690* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
3691* [DocumentReference](documentreference.html): Master Version Specific Identifier
3692* [Encounter](encounter.html): Identifier(s) by which this encounter is known
3693* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
3694* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
3695* [Goal](goal.html): External Ids for this goal
3696* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID and Accession number
3697* [Immunization](immunization.html): Business identifier
3698* [List](list.html): Business identifier
3699* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
3700* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
3701* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
3702* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
3703* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
3704* [Observation](observation.html): The unique id for a particular observation
3705* [Procedure](procedure.html): A unique identifier for a procedure
3706* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
3707* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
3708* [SupplyDelivery](supplydelivery.html): External identifier
3709* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
3710* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
3711</b><br>
3712   * Type: <b>token</b><br>
3713   * 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.masterIdentifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
3714   * </p>
3715   */
3716  @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.masterIdentifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.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): Master Version Specific Identifier\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 and Accession number\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* [MedicationStatement](medicationstatement.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" )
3717  public static final String SP_IDENTIFIER = "identifier";
3718 /**
3719   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3720   * <p>
3721   * Description: <b>Multiple Resources: 
3722
3723* [AllergyIntolerance](allergyintolerance.html): External ids for this item
3724* [CarePlan](careplan.html): External Ids for this plan
3725* [CareTeam](careteam.html): External Ids for this team
3726* [Composition](composition.html): Version-independent identifier for the Composition
3727* [Condition](condition.html): A unique identifier of the condition record
3728* [Consent](consent.html): Identifier for this record (external references)
3729* [DetectedIssue](detectedissue.html): Unique id for the detected issue
3730* [DeviceRequest](devicerequest.html): Business identifier for request/order
3731* [DiagnosticReport](diagnosticreport.html): An identifier for the report
3732* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
3733* [DocumentReference](documentreference.html): Master Version Specific Identifier
3734* [Encounter](encounter.html): Identifier(s) by which this encounter is known
3735* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
3736* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
3737* [Goal](goal.html): External Ids for this goal
3738* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID and Accession number
3739* [Immunization](immunization.html): Business identifier
3740* [List](list.html): Business identifier
3741* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
3742* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
3743* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
3744* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
3745* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
3746* [Observation](observation.html): The unique id for a particular observation
3747* [Procedure](procedure.html): A unique identifier for a procedure
3748* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
3749* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
3750* [SupplyDelivery](supplydelivery.html): External identifier
3751* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
3752* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
3753</b><br>
3754   * Type: <b>token</b><br>
3755   * 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.masterIdentifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
3756   * </p>
3757   */
3758  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3759
3760 /**
3761   * Search parameter: <b>patient</b>
3762   * <p>
3763   * Description: <b>Multiple Resources: 
3764
3765* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
3766* [CarePlan](careplan.html): Who the care plan is for
3767* [CareTeam](careteam.html): Who care team is for
3768* [ClinicalImpression](clinicalimpression.html): Patient or group assessed
3769* [Composition](composition.html): Who and/or what the composition is about
3770* [Condition](condition.html): Who has the condition?
3771* [Consent](consent.html): Who the consent applies to
3772* [DetectedIssue](detectedissue.html): Associated patient
3773* [DeviceRequest](devicerequest.html): Individual the service is ordered for
3774* [DeviceUseStatement](deviceusestatement.html): Search by subject - a patient
3775* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
3776* [DocumentManifest](documentmanifest.html): The subject of the set of documents
3777* [DocumentReference](documentreference.html): Who/what is the subject of the document
3778* [Encounter](encounter.html): The patient or group present at the encounter
3779* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
3780* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
3781* [Flag](flag.html): The identity of a subject to list flags for
3782* [Goal](goal.html): Who this goal is intended for
3783* [ImagingStudy](imagingstudy.html): Who the study is about
3784* [Immunization](immunization.html): The patient for the vaccination record
3785* [List](list.html): If all resources have the same subject
3786* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
3787* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
3788* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
3789* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
3790* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
3791* [Observation](observation.html): The subject that the observation is about (if patient)
3792* [Procedure](procedure.html): Search by subject - a patient
3793* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
3794* [ServiceRequest](servicerequest.html): Search by subject - a patient
3795* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
3796* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
3797</b><br>
3798   * Type: <b>reference</b><br>
3799   * 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.patient | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUseStatement.subject.where(resolve() is 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) | MedicationStatement.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>
3800   * </p>
3801   */
3802  @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.patient | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUseStatement.subject.where(resolve() is 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) | MedicationStatement.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 or group 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* [DeviceUseStatement](deviceusestatement.html): Search by subject - a patient\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 or group 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* [MedicationStatement](medicationstatement.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", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CarePlan.class, CareTeam.class, CatalogEntry.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, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceMetric.class, DeviceRequest.class, DeviceUseStatement.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, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Media.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationStatement.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.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, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchDefinition.class, ResearchElementDefinition.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, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
3803  public static final String SP_PATIENT = "patient";
3804 /**
3805   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3806   * <p>
3807   * Description: <b>Multiple Resources: 
3808
3809* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
3810* [CarePlan](careplan.html): Who the care plan is for
3811* [CareTeam](careteam.html): Who care team is for
3812* [ClinicalImpression](clinicalimpression.html): Patient or group assessed
3813* [Composition](composition.html): Who and/or what the composition is about
3814* [Condition](condition.html): Who has the condition?
3815* [Consent](consent.html): Who the consent applies to
3816* [DetectedIssue](detectedissue.html): Associated patient
3817* [DeviceRequest](devicerequest.html): Individual the service is ordered for
3818* [DeviceUseStatement](deviceusestatement.html): Search by subject - a patient
3819* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
3820* [DocumentManifest](documentmanifest.html): The subject of the set of documents
3821* [DocumentReference](documentreference.html): Who/what is the subject of the document
3822* [Encounter](encounter.html): The patient or group present at the encounter
3823* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
3824* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
3825* [Flag](flag.html): The identity of a subject to list flags for
3826* [Goal](goal.html): Who this goal is intended for
3827* [ImagingStudy](imagingstudy.html): Who the study is about
3828* [Immunization](immunization.html): The patient for the vaccination record
3829* [List](list.html): If all resources have the same subject
3830* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
3831* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
3832* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
3833* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
3834* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
3835* [Observation](observation.html): The subject that the observation is about (if patient)
3836* [Procedure](procedure.html): Search by subject - a patient
3837* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
3838* [ServiceRequest](servicerequest.html): Search by subject - a patient
3839* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
3840* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
3841</b><br>
3842   * Type: <b>reference</b><br>
3843   * 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.patient | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUseStatement.subject.where(resolve() is 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) | MedicationStatement.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>
3844   * </p>
3845   */
3846  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3847
3848/**
3849   * Constant for fluent queries to be used to add include statements. Specifies
3850   * the path value of "<b>Consent:patient</b>".
3851   */
3852  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Consent:patient").toLocked();
3853
3854
3855}
3856