001package org.hl7.fhir.dstu2016may.model;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0
036import java.util.ArrayList;
037import java.util.Date;
038import java.util.List;
039
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
042import org.hl7.fhir.utilities.Utilities;
043
044import ca.uhn.fhir.model.api.annotation.Block;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.Description;
047import ca.uhn.fhir.model.api.annotation.ResourceDef;
048import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
049/**
050 * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.
051 */
052@ResourceDef(name="Provenance", profile="http://hl7.org/fhir/Profile/Provenance")
053public class Provenance extends DomainResource {
054
055    public enum ProvenanceEntityRole {
056        /**
057         * A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity.
058         */
059        DERIVATION, 
060        /**
061         * A derivation for which the resulting entity is a revised version of some original.
062         */
063        REVISION, 
064        /**
065         * The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author.
066         */
067        QUOTATION, 
068        /**
069         * A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight.
070         */
071        SOURCE, 
072        /**
073         * A derivation for which the entity is removed from accessibility usually through the use of the Delete operation.
074         */
075        REMOVAL, 
076        /**
077         * added to help the parsers
078         */
079        NULL;
080        public static ProvenanceEntityRole fromCode(String codeString) throws FHIRException {
081            if (codeString == null || "".equals(codeString))
082                return null;
083        if ("derivation".equals(codeString))
084          return DERIVATION;
085        if ("revision".equals(codeString))
086          return REVISION;
087        if ("quotation".equals(codeString))
088          return QUOTATION;
089        if ("source".equals(codeString))
090          return SOURCE;
091        if ("removal".equals(codeString))
092          return REMOVAL;
093        throw new FHIRException("Unknown ProvenanceEntityRole code '"+codeString+"'");
094        }
095        public String toCode() {
096          switch (this) {
097            case DERIVATION: return "derivation";
098            case REVISION: return "revision";
099            case QUOTATION: return "quotation";
100            case SOURCE: return "source";
101            case REMOVAL: return "removal";
102            case NULL: return null;
103            default: return "?";
104          }
105        }
106        public String getSystem() {
107          switch (this) {
108            case DERIVATION: return "http://hl7.org/fhir/provenance-entity-role";
109            case REVISION: return "http://hl7.org/fhir/provenance-entity-role";
110            case QUOTATION: return "http://hl7.org/fhir/provenance-entity-role";
111            case SOURCE: return "http://hl7.org/fhir/provenance-entity-role";
112            case REMOVAL: return "http://hl7.org/fhir/provenance-entity-role";
113            case NULL: return null;
114            default: return "?";
115          }
116        }
117        public String getDefinition() {
118          switch (this) {
119            case DERIVATION: return "A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity.";
120            case REVISION: return "A derivation for which the resulting entity is a revised version of some original.";
121            case QUOTATION: return "The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author.";
122            case SOURCE: return "A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight.";
123            case REMOVAL: return "A derivation for which the entity is removed from accessibility usually through the use of the Delete operation.";
124            case NULL: return null;
125            default: return "?";
126          }
127        }
128        public String getDisplay() {
129          switch (this) {
130            case DERIVATION: return "Derivation";
131            case REVISION: return "Revision";
132            case QUOTATION: return "Quotation";
133            case SOURCE: return "Source";
134            case REMOVAL: return "Removal";
135            case NULL: return null;
136            default: return "?";
137          }
138        }
139    }
140
141  public static class ProvenanceEntityRoleEnumFactory implements EnumFactory<ProvenanceEntityRole> {
142    public ProvenanceEntityRole fromCode(String codeString) throws IllegalArgumentException {
143      if (codeString == null || "".equals(codeString))
144            if (codeString == null || "".equals(codeString))
145                return null;
146        if ("derivation".equals(codeString))
147          return ProvenanceEntityRole.DERIVATION;
148        if ("revision".equals(codeString))
149          return ProvenanceEntityRole.REVISION;
150        if ("quotation".equals(codeString))
151          return ProvenanceEntityRole.QUOTATION;
152        if ("source".equals(codeString))
153          return ProvenanceEntityRole.SOURCE;
154        if ("removal".equals(codeString))
155          return ProvenanceEntityRole.REMOVAL;
156        throw new IllegalArgumentException("Unknown ProvenanceEntityRole code '"+codeString+"'");
157        }
158        public Enumeration<ProvenanceEntityRole> fromType(Base code) throws FHIRException {
159          if (code == null || code.isEmpty())
160            return null;
161          String codeString = ((PrimitiveType) code).asStringValue();
162          if (codeString == null || "".equals(codeString))
163            return null;
164        if ("derivation".equals(codeString))
165          return new Enumeration<ProvenanceEntityRole>(this, ProvenanceEntityRole.DERIVATION);
166        if ("revision".equals(codeString))
167          return new Enumeration<ProvenanceEntityRole>(this, ProvenanceEntityRole.REVISION);
168        if ("quotation".equals(codeString))
169          return new Enumeration<ProvenanceEntityRole>(this, ProvenanceEntityRole.QUOTATION);
170        if ("source".equals(codeString))
171          return new Enumeration<ProvenanceEntityRole>(this, ProvenanceEntityRole.SOURCE);
172        if ("removal".equals(codeString))
173          return new Enumeration<ProvenanceEntityRole>(this, ProvenanceEntityRole.REMOVAL);
174        throw new FHIRException("Unknown ProvenanceEntityRole code '"+codeString+"'");
175        }
176    public String toCode(ProvenanceEntityRole code) {
177      if (code == ProvenanceEntityRole.DERIVATION)
178        return "derivation";
179      if (code == ProvenanceEntityRole.REVISION)
180        return "revision";
181      if (code == ProvenanceEntityRole.QUOTATION)
182        return "quotation";
183      if (code == ProvenanceEntityRole.SOURCE)
184        return "source";
185      if (code == ProvenanceEntityRole.REMOVAL)
186        return "removal";
187      return "?";
188      }
189    public String toSystem(ProvenanceEntityRole code) {
190      return code.getSystem();
191      }
192    }
193
194    @Block()
195    public static class ProvenanceAgentComponent extends BackboneElement implements IBaseBackboneElement {
196        /**
197         * The function of the agent with respect to the activity.
198         */
199        @Child(name = "role", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true)
200        @Description(shortDefinition="What the agents involvement was", formalDefinition="The function of the agent with respect to the activity." )
201        protected Coding role;
202
203        /**
204         * The individual, device or organization that participated in the event.
205         */
206        @Child(name = "actor", type = {Practitioner.class, RelatedPerson.class, Patient.class, Device.class, Organization.class}, order=2, min=0, max=1, modifier=false, summary=true)
207        @Description(shortDefinition="Individual, device or organization playing role", formalDefinition="The individual, device or organization that participated in the event." )
208        protected Reference actor;
209
210        /**
211         * The actual object that is the target of the reference (The individual, device or organization that participated in the event.)
212         */
213        protected Resource actorTarget;
214
215        /**
216         * The identity of the agent as known by the authorization system.
217         */
218        @Child(name = "userId", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true)
219        @Description(shortDefinition="Authorization-system identifier for the agent", formalDefinition="The identity of the agent as known by the authorization system." )
220        protected Identifier userId;
221
222        /**
223         * A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents.  For example, this human author used this device, or one person acted on another's behest.
224         */
225        @Child(name = "relatedAgent", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
226        @Description(shortDefinition="Track delegation between agents", formalDefinition="A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents.  For example, this human author used this device, or one person acted on another's behest." )
227        protected List<ProvenanceAgentRelatedAgentComponent> relatedAgent;
228
229        private static final long serialVersionUID = 1792758952L;
230
231    /**
232     * Constructor
233     */
234      public ProvenanceAgentComponent() {
235        super();
236      }
237
238    /**
239     * Constructor
240     */
241      public ProvenanceAgentComponent(Coding role) {
242        super();
243        this.role = role;
244      }
245
246        /**
247         * @return {@link #role} (The function of the agent with respect to the activity.)
248         */
249        public Coding getRole() { 
250          if (this.role == null)
251            if (Configuration.errorOnAutoCreate())
252              throw new Error("Attempt to auto-create ProvenanceAgentComponent.role");
253            else if (Configuration.doAutoCreate())
254              this.role = new Coding(); // cc
255          return this.role;
256        }
257
258        public boolean hasRole() { 
259          return this.role != null && !this.role.isEmpty();
260        }
261
262        /**
263         * @param value {@link #role} (The function of the agent with respect to the activity.)
264         */
265        public ProvenanceAgentComponent setRole(Coding value) { 
266          this.role = value;
267          return this;
268        }
269
270        /**
271         * @return {@link #actor} (The individual, device or organization that participated in the event.)
272         */
273        public Reference getActor() { 
274          if (this.actor == null)
275            if (Configuration.errorOnAutoCreate())
276              throw new Error("Attempt to auto-create ProvenanceAgentComponent.actor");
277            else if (Configuration.doAutoCreate())
278              this.actor = new Reference(); // cc
279          return this.actor;
280        }
281
282        public boolean hasActor() { 
283          return this.actor != null && !this.actor.isEmpty();
284        }
285
286        /**
287         * @param value {@link #actor} (The individual, device or organization that participated in the event.)
288         */
289        public ProvenanceAgentComponent setActor(Reference value) { 
290          this.actor = value;
291          return this;
292        }
293
294        /**
295         * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual, device or organization that participated in the event.)
296         */
297        public Resource getActorTarget() { 
298          return this.actorTarget;
299        }
300
301        /**
302         * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual, device or organization that participated in the event.)
303         */
304        public ProvenanceAgentComponent setActorTarget(Resource value) { 
305          this.actorTarget = value;
306          return this;
307        }
308
309        /**
310         * @return {@link #userId} (The identity of the agent as known by the authorization system.)
311         */
312        public Identifier getUserId() { 
313          if (this.userId == null)
314            if (Configuration.errorOnAutoCreate())
315              throw new Error("Attempt to auto-create ProvenanceAgentComponent.userId");
316            else if (Configuration.doAutoCreate())
317              this.userId = new Identifier(); // cc
318          return this.userId;
319        }
320
321        public boolean hasUserId() { 
322          return this.userId != null && !this.userId.isEmpty();
323        }
324
325        /**
326         * @param value {@link #userId} (The identity of the agent as known by the authorization system.)
327         */
328        public ProvenanceAgentComponent setUserId(Identifier value) { 
329          this.userId = value;
330          return this;
331        }
332
333        /**
334         * @return {@link #relatedAgent} (A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents.  For example, this human author used this device, or one person acted on another's behest.)
335         */
336        public List<ProvenanceAgentRelatedAgentComponent> getRelatedAgent() { 
337          if (this.relatedAgent == null)
338            this.relatedAgent = new ArrayList<ProvenanceAgentRelatedAgentComponent>();
339          return this.relatedAgent;
340        }
341
342        public boolean hasRelatedAgent() { 
343          if (this.relatedAgent == null)
344            return false;
345          for (ProvenanceAgentRelatedAgentComponent item : this.relatedAgent)
346            if (!item.isEmpty())
347              return true;
348          return false;
349        }
350
351        /**
352         * @return {@link #relatedAgent} (A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents.  For example, this human author used this device, or one person acted on another's behest.)
353         */
354    // syntactic sugar
355        public ProvenanceAgentRelatedAgentComponent addRelatedAgent() { //3
356          ProvenanceAgentRelatedAgentComponent t = new ProvenanceAgentRelatedAgentComponent();
357          if (this.relatedAgent == null)
358            this.relatedAgent = new ArrayList<ProvenanceAgentRelatedAgentComponent>();
359          this.relatedAgent.add(t);
360          return t;
361        }
362
363    // syntactic sugar
364        public ProvenanceAgentComponent addRelatedAgent(ProvenanceAgentRelatedAgentComponent t) { //3
365          if (t == null)
366            return this;
367          if (this.relatedAgent == null)
368            this.relatedAgent = new ArrayList<ProvenanceAgentRelatedAgentComponent>();
369          this.relatedAgent.add(t);
370          return this;
371        }
372
373        protected void listChildren(List<Property> childrenList) {
374          super.listChildren(childrenList);
375          childrenList.add(new Property("role", "Coding", "The function of the agent with respect to the activity.", 0, java.lang.Integer.MAX_VALUE, role));
376          childrenList.add(new Property("actor", "Reference(Practitioner|RelatedPerson|Patient|Device|Organization)", "The individual, device or organization that participated in the event.", 0, java.lang.Integer.MAX_VALUE, actor));
377          childrenList.add(new Property("userId", "Identifier", "The identity of the agent as known by the authorization system.", 0, java.lang.Integer.MAX_VALUE, userId));
378          childrenList.add(new Property("relatedAgent", "", "A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents.  For example, this human author used this device, or one person acted on another's behest.", 0, java.lang.Integer.MAX_VALUE, relatedAgent));
379        }
380
381      @Override
382      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
383        switch (hash) {
384        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // Coding
385        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
386        case -836030906: /*userId*/ return this.userId == null ? new Base[0] : new Base[] {this.userId}; // Identifier
387        case 126261658: /*relatedAgent*/ return this.relatedAgent == null ? new Base[0] : this.relatedAgent.toArray(new Base[this.relatedAgent.size()]); // ProvenanceAgentRelatedAgentComponent
388        default: return super.getProperty(hash, name, checkValid);
389        }
390
391      }
392
393      @Override
394      public void setProperty(int hash, String name, Base value) throws FHIRException {
395        switch (hash) {
396        case 3506294: // role
397          this.role = castToCoding(value); // Coding
398          break;
399        case 92645877: // actor
400          this.actor = castToReference(value); // Reference
401          break;
402        case -836030906: // userId
403          this.userId = castToIdentifier(value); // Identifier
404          break;
405        case 126261658: // relatedAgent
406          this.getRelatedAgent().add((ProvenanceAgentRelatedAgentComponent) value); // ProvenanceAgentRelatedAgentComponent
407          break;
408        default: super.setProperty(hash, name, value);
409        }
410
411      }
412
413      @Override
414      public void setProperty(String name, Base value) throws FHIRException {
415        if (name.equals("role"))
416          this.role = castToCoding(value); // Coding
417        else if (name.equals("actor"))
418          this.actor = castToReference(value); // Reference
419        else if (name.equals("userId"))
420          this.userId = castToIdentifier(value); // Identifier
421        else if (name.equals("relatedAgent"))
422          this.getRelatedAgent().add((ProvenanceAgentRelatedAgentComponent) value);
423        else
424          super.setProperty(name, value);
425      }
426
427      @Override
428      public Base makeProperty(int hash, String name) throws FHIRException {
429        switch (hash) {
430        case 3506294:  return getRole(); // Coding
431        case 92645877:  return getActor(); // Reference
432        case -836030906:  return getUserId(); // Identifier
433        case 126261658:  return addRelatedAgent(); // ProvenanceAgentRelatedAgentComponent
434        default: return super.makeProperty(hash, name);
435        }
436
437      }
438
439      @Override
440      public Base addChild(String name) throws FHIRException {
441        if (name.equals("role")) {
442          this.role = new Coding();
443          return this.role;
444        }
445        else if (name.equals("actor")) {
446          this.actor = new Reference();
447          return this.actor;
448        }
449        else if (name.equals("userId")) {
450          this.userId = new Identifier();
451          return this.userId;
452        }
453        else if (name.equals("relatedAgent")) {
454          return addRelatedAgent();
455        }
456        else
457          return super.addChild(name);
458      }
459
460      public ProvenanceAgentComponent copy() {
461        ProvenanceAgentComponent dst = new ProvenanceAgentComponent();
462        copyValues(dst);
463        dst.role = role == null ? null : role.copy();
464        dst.actor = actor == null ? null : actor.copy();
465        dst.userId = userId == null ? null : userId.copy();
466        if (relatedAgent != null) {
467          dst.relatedAgent = new ArrayList<ProvenanceAgentRelatedAgentComponent>();
468          for (ProvenanceAgentRelatedAgentComponent i : relatedAgent)
469            dst.relatedAgent.add(i.copy());
470        };
471        return dst;
472      }
473
474      @Override
475      public boolean equalsDeep(Base other) {
476        if (!super.equalsDeep(other))
477          return false;
478        if (!(other instanceof ProvenanceAgentComponent))
479          return false;
480        ProvenanceAgentComponent o = (ProvenanceAgentComponent) other;
481        return compareDeep(role, o.role, true) && compareDeep(actor, o.actor, true) && compareDeep(userId, o.userId, true)
482           && compareDeep(relatedAgent, o.relatedAgent, true);
483      }
484
485      @Override
486      public boolean equalsShallow(Base other) {
487        if (!super.equalsShallow(other))
488          return false;
489        if (!(other instanceof ProvenanceAgentComponent))
490          return false;
491        ProvenanceAgentComponent o = (ProvenanceAgentComponent) other;
492        return true;
493      }
494
495      public boolean isEmpty() {
496        return super.isEmpty() && (role == null || role.isEmpty()) && (actor == null || actor.isEmpty())
497           && (userId == null || userId.isEmpty()) && (relatedAgent == null || relatedAgent.isEmpty())
498          ;
499      }
500
501  public String fhirType() {
502    return "Provenance.agent";
503
504  }
505
506  }
507
508    @Block()
509    public static class ProvenanceAgentRelatedAgentComponent extends BackboneElement implements IBaseBackboneElement {
510        /**
511         * The type of relationship between agents.
512         */
513        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
514        @Description(shortDefinition="Type of relationship between agents", formalDefinition="The type of relationship between agents." )
515        protected CodeableConcept type;
516
517        /**
518         * An internal reference to another agent listed in this provenance by its identifier.
519         */
520        @Child(name = "target", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true)
521        @Description(shortDefinition="Reference to other agent in this resource by identifier", formalDefinition="An internal reference to another agent listed in this provenance by its identifier." )
522        protected UriType target;
523
524        private static final long serialVersionUID = 794181198L;
525
526    /**
527     * Constructor
528     */
529      public ProvenanceAgentRelatedAgentComponent() {
530        super();
531      }
532
533    /**
534     * Constructor
535     */
536      public ProvenanceAgentRelatedAgentComponent(CodeableConcept type, UriType target) {
537        super();
538        this.type = type;
539        this.target = target;
540      }
541
542        /**
543         * @return {@link #type} (The type of relationship between agents.)
544         */
545        public CodeableConcept getType() { 
546          if (this.type == null)
547            if (Configuration.errorOnAutoCreate())
548              throw new Error("Attempt to auto-create ProvenanceAgentRelatedAgentComponent.type");
549            else if (Configuration.doAutoCreate())
550              this.type = new CodeableConcept(); // cc
551          return this.type;
552        }
553
554        public boolean hasType() { 
555          return this.type != null && !this.type.isEmpty();
556        }
557
558        /**
559         * @param value {@link #type} (The type of relationship between agents.)
560         */
561        public ProvenanceAgentRelatedAgentComponent setType(CodeableConcept value) { 
562          this.type = value;
563          return this;
564        }
565
566        /**
567         * @return {@link #target} (An internal reference to another agent listed in this provenance by its identifier.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value
568         */
569        public UriType getTargetElement() { 
570          if (this.target == null)
571            if (Configuration.errorOnAutoCreate())
572              throw new Error("Attempt to auto-create ProvenanceAgentRelatedAgentComponent.target");
573            else if (Configuration.doAutoCreate())
574              this.target = new UriType(); // bb
575          return this.target;
576        }
577
578        public boolean hasTargetElement() { 
579          return this.target != null && !this.target.isEmpty();
580        }
581
582        public boolean hasTarget() { 
583          return this.target != null && !this.target.isEmpty();
584        }
585
586        /**
587         * @param value {@link #target} (An internal reference to another agent listed in this provenance by its identifier.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value
588         */
589        public ProvenanceAgentRelatedAgentComponent setTargetElement(UriType value) { 
590          this.target = value;
591          return this;
592        }
593
594        /**
595         * @return An internal reference to another agent listed in this provenance by its identifier.
596         */
597        public String getTarget() { 
598          return this.target == null ? null : this.target.getValue();
599        }
600
601        /**
602         * @param value An internal reference to another agent listed in this provenance by its identifier.
603         */
604        public ProvenanceAgentRelatedAgentComponent setTarget(String value) { 
605            if (this.target == null)
606              this.target = new UriType();
607            this.target.setValue(value);
608          return this;
609        }
610
611        protected void listChildren(List<Property> childrenList) {
612          super.listChildren(childrenList);
613          childrenList.add(new Property("type", "CodeableConcept", "The type of relationship between agents.", 0, java.lang.Integer.MAX_VALUE, type));
614          childrenList.add(new Property("target", "uri", "An internal reference to another agent listed in this provenance by its identifier.", 0, java.lang.Integer.MAX_VALUE, target));
615        }
616
617      @Override
618      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
619        switch (hash) {
620        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
621        case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // UriType
622        default: return super.getProperty(hash, name, checkValid);
623        }
624
625      }
626
627      @Override
628      public void setProperty(int hash, String name, Base value) throws FHIRException {
629        switch (hash) {
630        case 3575610: // type
631          this.type = castToCodeableConcept(value); // CodeableConcept
632          break;
633        case -880905839: // target
634          this.target = castToUri(value); // UriType
635          break;
636        default: super.setProperty(hash, name, value);
637        }
638
639      }
640
641      @Override
642      public void setProperty(String name, Base value) throws FHIRException {
643        if (name.equals("type"))
644          this.type = castToCodeableConcept(value); // CodeableConcept
645        else if (name.equals("target"))
646          this.target = castToUri(value); // UriType
647        else
648          super.setProperty(name, value);
649      }
650
651      @Override
652      public Base makeProperty(int hash, String name) throws FHIRException {
653        switch (hash) {
654        case 3575610:  return getType(); // CodeableConcept
655        case -880905839: throw new FHIRException("Cannot make property target as it is not a complex type"); // UriType
656        default: return super.makeProperty(hash, name);
657        }
658
659      }
660
661      @Override
662      public Base addChild(String name) throws FHIRException {
663        if (name.equals("type")) {
664          this.type = new CodeableConcept();
665          return this.type;
666        }
667        else if (name.equals("target")) {
668          throw new FHIRException("Cannot call addChild on a primitive type Provenance.target");
669        }
670        else
671          return super.addChild(name);
672      }
673
674      public ProvenanceAgentRelatedAgentComponent copy() {
675        ProvenanceAgentRelatedAgentComponent dst = new ProvenanceAgentRelatedAgentComponent();
676        copyValues(dst);
677        dst.type = type == null ? null : type.copy();
678        dst.target = target == null ? null : target.copy();
679        return dst;
680      }
681
682      @Override
683      public boolean equalsDeep(Base other) {
684        if (!super.equalsDeep(other))
685          return false;
686        if (!(other instanceof ProvenanceAgentRelatedAgentComponent))
687          return false;
688        ProvenanceAgentRelatedAgentComponent o = (ProvenanceAgentRelatedAgentComponent) other;
689        return compareDeep(type, o.type, true) && compareDeep(target, o.target, true);
690      }
691
692      @Override
693      public boolean equalsShallow(Base other) {
694        if (!super.equalsShallow(other))
695          return false;
696        if (!(other instanceof ProvenanceAgentRelatedAgentComponent))
697          return false;
698        ProvenanceAgentRelatedAgentComponent o = (ProvenanceAgentRelatedAgentComponent) other;
699        return compareValues(target, o.target, true);
700      }
701
702      public boolean isEmpty() {
703        return super.isEmpty() && (type == null || type.isEmpty()) && (target == null || target.isEmpty())
704          ;
705      }
706
707  public String fhirType() {
708    return "Provenance.agent.relatedAgent";
709
710  }
711
712  }
713
714    @Block()
715    public static class ProvenanceEntityComponent extends BackboneElement implements IBaseBackboneElement {
716        /**
717         * How the entity was used during the activity.
718         */
719        @Child(name = "role", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
720        @Description(shortDefinition="derivation | revision | quotation | source | removal", formalDefinition="How the entity was used during the activity." )
721        protected Enumeration<ProvenanceEntityRole> role;
722
723        /**
724         * The type of the entity. If the entity is a resource, then this is a resource type.
725         */
726        @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true)
727        @Description(shortDefinition="The type of resource in this entity", formalDefinition="The type of the entity. If the entity is a resource, then this is a resource type." )
728        protected Coding type;
729
730        /**
731         * Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative.
732         */
733        @Child(name = "reference", type = {UriType.class}, order=3, min=1, max=1, modifier=false, summary=true)
734        @Description(shortDefinition="Identity of entity", formalDefinition="Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative." )
735        protected UriType reference;
736
737        /**
738         * Human-readable description of the entity.
739         */
740        @Child(name = "display", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
741        @Description(shortDefinition="Human description of entity", formalDefinition="Human-readable description of the entity." )
742        protected StringType display;
743
744        /**
745         * The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.
746         */
747        @Child(name = "agent", type = {ProvenanceAgentComponent.class}, order=5, min=0, max=1, modifier=false, summary=true)
748        @Description(shortDefinition="Entity is attributed to this agent", formalDefinition="The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity." )
749        protected ProvenanceAgentComponent agent;
750
751        private static final long serialVersionUID = 1533729633L;
752
753    /**
754     * Constructor
755     */
756      public ProvenanceEntityComponent() {
757        super();
758      }
759
760    /**
761     * Constructor
762     */
763      public ProvenanceEntityComponent(Enumeration<ProvenanceEntityRole> role, Coding type, UriType reference) {
764        super();
765        this.role = role;
766        this.type = type;
767        this.reference = reference;
768      }
769
770        /**
771         * @return {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value
772         */
773        public Enumeration<ProvenanceEntityRole> getRoleElement() { 
774          if (this.role == null)
775            if (Configuration.errorOnAutoCreate())
776              throw new Error("Attempt to auto-create ProvenanceEntityComponent.role");
777            else if (Configuration.doAutoCreate())
778              this.role = new Enumeration<ProvenanceEntityRole>(new ProvenanceEntityRoleEnumFactory()); // bb
779          return this.role;
780        }
781
782        public boolean hasRoleElement() { 
783          return this.role != null && !this.role.isEmpty();
784        }
785
786        public boolean hasRole() { 
787          return this.role != null && !this.role.isEmpty();
788        }
789
790        /**
791         * @param value {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value
792         */
793        public ProvenanceEntityComponent setRoleElement(Enumeration<ProvenanceEntityRole> value) { 
794          this.role = value;
795          return this;
796        }
797
798        /**
799         * @return How the entity was used during the activity.
800         */
801        public ProvenanceEntityRole getRole() { 
802          return this.role == null ? null : this.role.getValue();
803        }
804
805        /**
806         * @param value How the entity was used during the activity.
807         */
808        public ProvenanceEntityComponent setRole(ProvenanceEntityRole value) { 
809            if (this.role == null)
810              this.role = new Enumeration<ProvenanceEntityRole>(new ProvenanceEntityRoleEnumFactory());
811            this.role.setValue(value);
812          return this;
813        }
814
815        /**
816         * @return {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.)
817         */
818        public Coding getType() { 
819          if (this.type == null)
820            if (Configuration.errorOnAutoCreate())
821              throw new Error("Attempt to auto-create ProvenanceEntityComponent.type");
822            else if (Configuration.doAutoCreate())
823              this.type = new Coding(); // cc
824          return this.type;
825        }
826
827        public boolean hasType() { 
828          return this.type != null && !this.type.isEmpty();
829        }
830
831        /**
832         * @param value {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.)
833         */
834        public ProvenanceEntityComponent setType(Coding value) { 
835          this.type = value;
836          return this;
837        }
838
839        /**
840         * @return {@link #reference} (Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value
841         */
842        public UriType getReferenceElement() { 
843          if (this.reference == null)
844            if (Configuration.errorOnAutoCreate())
845              throw new Error("Attempt to auto-create ProvenanceEntityComponent.reference");
846            else if (Configuration.doAutoCreate())
847              this.reference = new UriType(); // bb
848          return this.reference;
849        }
850
851        public boolean hasReferenceElement() { 
852          return this.reference != null && !this.reference.isEmpty();
853        }
854
855        public boolean hasReference() { 
856          return this.reference != null && !this.reference.isEmpty();
857        }
858
859        /**
860         * @param value {@link #reference} (Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value
861         */
862        public ProvenanceEntityComponent setReferenceElement(UriType value) { 
863          this.reference = value;
864          return this;
865        }
866
867        /**
868         * @return Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative.
869         */
870        public String getReference() { 
871          return this.reference == null ? null : this.reference.getValue();
872        }
873
874        /**
875         * @param value Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative.
876         */
877        public ProvenanceEntityComponent setReference(String value) { 
878            if (this.reference == null)
879              this.reference = new UriType();
880            this.reference.setValue(value);
881          return this;
882        }
883
884        /**
885         * @return {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
886         */
887        public StringType getDisplayElement() { 
888          if (this.display == null)
889            if (Configuration.errorOnAutoCreate())
890              throw new Error("Attempt to auto-create ProvenanceEntityComponent.display");
891            else if (Configuration.doAutoCreate())
892              this.display = new StringType(); // bb
893          return this.display;
894        }
895
896        public boolean hasDisplayElement() { 
897          return this.display != null && !this.display.isEmpty();
898        }
899
900        public boolean hasDisplay() { 
901          return this.display != null && !this.display.isEmpty();
902        }
903
904        /**
905         * @param value {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
906         */
907        public ProvenanceEntityComponent setDisplayElement(StringType value) { 
908          this.display = value;
909          return this;
910        }
911
912        /**
913         * @return Human-readable description of the entity.
914         */
915        public String getDisplay() { 
916          return this.display == null ? null : this.display.getValue();
917        }
918
919        /**
920         * @param value Human-readable description of the entity.
921         */
922        public ProvenanceEntityComponent setDisplay(String value) { 
923          if (Utilities.noString(value))
924            this.display = null;
925          else {
926            if (this.display == null)
927              this.display = new StringType();
928            this.display.setValue(value);
929          }
930          return this;
931        }
932
933        /**
934         * @return {@link #agent} (The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.)
935         */
936        public ProvenanceAgentComponent getAgent() { 
937          if (this.agent == null)
938            if (Configuration.errorOnAutoCreate())
939              throw new Error("Attempt to auto-create ProvenanceEntityComponent.agent");
940            else if (Configuration.doAutoCreate())
941              this.agent = new ProvenanceAgentComponent(); // cc
942          return this.agent;
943        }
944
945        public boolean hasAgent() { 
946          return this.agent != null && !this.agent.isEmpty();
947        }
948
949        /**
950         * @param value {@link #agent} (The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.)
951         */
952        public ProvenanceEntityComponent setAgent(ProvenanceAgentComponent value) { 
953          this.agent = value;
954          return this;
955        }
956
957        protected void listChildren(List<Property> childrenList) {
958          super.listChildren(childrenList);
959          childrenList.add(new Property("role", "code", "How the entity was used during the activity.", 0, java.lang.Integer.MAX_VALUE, role));
960          childrenList.add(new Property("type", "Coding", "The type of the entity. If the entity is a resource, then this is a resource type.", 0, java.lang.Integer.MAX_VALUE, type));
961          childrenList.add(new Property("reference", "uri", "Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative.", 0, java.lang.Integer.MAX_VALUE, reference));
962          childrenList.add(new Property("display", "string", "Human-readable description of the entity.", 0, java.lang.Integer.MAX_VALUE, display));
963          childrenList.add(new Property("agent", "@Provenance.agent", "The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.", 0, java.lang.Integer.MAX_VALUE, agent));
964        }
965
966      @Override
967      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
968        switch (hash) {
969        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // Enumeration<ProvenanceEntityRole>
970        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
971        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // UriType
972        case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType
973        case 92750597: /*agent*/ return this.agent == null ? new Base[0] : new Base[] {this.agent}; // ProvenanceAgentComponent
974        default: return super.getProperty(hash, name, checkValid);
975        }
976
977      }
978
979      @Override
980      public void setProperty(int hash, String name, Base value) throws FHIRException {
981        switch (hash) {
982        case 3506294: // role
983          this.role = new ProvenanceEntityRoleEnumFactory().fromType(value); // Enumeration<ProvenanceEntityRole>
984          break;
985        case 3575610: // type
986          this.type = castToCoding(value); // Coding
987          break;
988        case -925155509: // reference
989          this.reference = castToUri(value); // UriType
990          break;
991        case 1671764162: // display
992          this.display = castToString(value); // StringType
993          break;
994        case 92750597: // agent
995          this.agent = (ProvenanceAgentComponent) value; // ProvenanceAgentComponent
996          break;
997        default: super.setProperty(hash, name, value);
998        }
999
1000      }
1001
1002      @Override
1003      public void setProperty(String name, Base value) throws FHIRException {
1004        if (name.equals("role"))
1005          this.role = new ProvenanceEntityRoleEnumFactory().fromType(value); // Enumeration<ProvenanceEntityRole>
1006        else if (name.equals("type"))
1007          this.type = castToCoding(value); // Coding
1008        else if (name.equals("reference"))
1009          this.reference = castToUri(value); // UriType
1010        else if (name.equals("display"))
1011          this.display = castToString(value); // StringType
1012        else if (name.equals("agent"))
1013          this.agent = (ProvenanceAgentComponent) value; // ProvenanceAgentComponent
1014        else
1015          super.setProperty(name, value);
1016      }
1017
1018      @Override
1019      public Base makeProperty(int hash, String name) throws FHIRException {
1020        switch (hash) {
1021        case 3506294: throw new FHIRException("Cannot make property role as it is not a complex type"); // Enumeration<ProvenanceEntityRole>
1022        case 3575610:  return getType(); // Coding
1023        case -925155509: throw new FHIRException("Cannot make property reference as it is not a complex type"); // UriType
1024        case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType
1025        case 92750597:  return getAgent(); // ProvenanceAgentComponent
1026        default: return super.makeProperty(hash, name);
1027        }
1028
1029      }
1030
1031      @Override
1032      public Base addChild(String name) throws FHIRException {
1033        if (name.equals("role")) {
1034          throw new FHIRException("Cannot call addChild on a primitive type Provenance.role");
1035        }
1036        else if (name.equals("type")) {
1037          this.type = new Coding();
1038          return this.type;
1039        }
1040        else if (name.equals("reference")) {
1041          throw new FHIRException("Cannot call addChild on a primitive type Provenance.reference");
1042        }
1043        else if (name.equals("display")) {
1044          throw new FHIRException("Cannot call addChild on a primitive type Provenance.display");
1045        }
1046        else if (name.equals("agent")) {
1047          this.agent = new ProvenanceAgentComponent();
1048          return this.agent;
1049        }
1050        else
1051          return super.addChild(name);
1052      }
1053
1054      public ProvenanceEntityComponent copy() {
1055        ProvenanceEntityComponent dst = new ProvenanceEntityComponent();
1056        copyValues(dst);
1057        dst.role = role == null ? null : role.copy();
1058        dst.type = type == null ? null : type.copy();
1059        dst.reference = reference == null ? null : reference.copy();
1060        dst.display = display == null ? null : display.copy();
1061        dst.agent = agent == null ? null : agent.copy();
1062        return dst;
1063      }
1064
1065      @Override
1066      public boolean equalsDeep(Base other) {
1067        if (!super.equalsDeep(other))
1068          return false;
1069        if (!(other instanceof ProvenanceEntityComponent))
1070          return false;
1071        ProvenanceEntityComponent o = (ProvenanceEntityComponent) other;
1072        return compareDeep(role, o.role, true) && compareDeep(type, o.type, true) && compareDeep(reference, o.reference, true)
1073           && compareDeep(display, o.display, true) && compareDeep(agent, o.agent, true);
1074      }
1075
1076      @Override
1077      public boolean equalsShallow(Base other) {
1078        if (!super.equalsShallow(other))
1079          return false;
1080        if (!(other instanceof ProvenanceEntityComponent))
1081          return false;
1082        ProvenanceEntityComponent o = (ProvenanceEntityComponent) other;
1083        return compareValues(role, o.role, true) && compareValues(reference, o.reference, true) && compareValues(display, o.display, true)
1084          ;
1085      }
1086
1087      public boolean isEmpty() {
1088        return super.isEmpty() && (role == null || role.isEmpty()) && (type == null || type.isEmpty())
1089           && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()) && (agent == null || agent.isEmpty())
1090          ;
1091      }
1092
1093  public String fhirType() {
1094    return "Provenance.entity";
1095
1096  }
1097
1098  }
1099
1100    /**
1101     * The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.
1102     */
1103    @Child(name = "target", type = {}, order=0, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1104    @Description(shortDefinition="Target Reference(s) (usually version specific)", formalDefinition="The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity." )
1105    protected List<Reference> target;
1106    /**
1107     * The actual objects that are the target of the reference (The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.)
1108     */
1109    protected List<Resource> targetTarget;
1110
1111
1112    /**
1113     * The period during which the activity occurred.
1114     */
1115    @Child(name = "period", type = {Period.class}, order=1, min=0, max=1, modifier=false, summary=true)
1116    @Description(shortDefinition="When the activity occurred", formalDefinition="The period during which the activity occurred." )
1117    protected Period period;
1118
1119    /**
1120     * The instant of time at which the activity was recorded.
1121     */
1122    @Child(name = "recorded", type = {InstantType.class}, order=2, min=1, max=1, modifier=false, summary=true)
1123    @Description(shortDefinition="When the activity was recorded / updated", formalDefinition="The instant of time at which the activity was recorded." )
1124    protected InstantType recorded;
1125
1126    /**
1127     * The reason that the activity was taking place.
1128     */
1129    @Child(name = "reason", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1130    @Description(shortDefinition="Reason the activity is occurring", formalDefinition="The reason that the activity was taking place." )
1131    protected List<Coding> reason;
1132
1133    /**
1134     * An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.
1135     */
1136    @Child(name = "activity", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true)
1137    @Description(shortDefinition="Activity that occurred", formalDefinition="An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities." )
1138    protected Coding activity;
1139
1140    /**
1141     * Where the activity occurred, if relevant.
1142     */
1143    @Child(name = "location", type = {Location.class}, order=5, min=0, max=1, modifier=false, summary=true)
1144    @Description(shortDefinition="Where the activity occurred, if relevant", formalDefinition="Where the activity occurred, if relevant." )
1145    protected Reference location;
1146
1147    /**
1148     * The actual object that is the target of the reference (Where the activity occurred, if relevant.)
1149     */
1150    protected Location locationTarget;
1151
1152    /**
1153     * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.
1154     */
1155    @Child(name = "policy", type = {UriType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1156    @Description(shortDefinition="Policy or plan the activity was defined by", formalDefinition="Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc." )
1157    protected List<UriType> policy;
1158
1159    /**
1160     * An actor taking a role in an activity  for which it can be assigned some degree of responsibility for the activity taking place.
1161     */
1162    @Child(name = "agent", type = {}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1163    @Description(shortDefinition="Actor involved", formalDefinition="An actor taking a role in an activity  for which it can be assigned some degree of responsibility for the activity taking place." )
1164    protected List<ProvenanceAgentComponent> agent;
1165
1166    /**
1167     * An entity used in this activity.
1168     */
1169    @Child(name = "entity", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1170    @Description(shortDefinition="An entity used in this activity", formalDefinition="An entity used in this activity." )
1171    protected List<ProvenanceEntityComponent> entity;
1172
1173    /**
1174     * A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.
1175     */
1176    @Child(name = "signature", type = {Signature.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1177    @Description(shortDefinition="Signature on target", formalDefinition="A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated." )
1178    protected List<Signature> signature;
1179
1180    private static final long serialVersionUID = -436783145L;
1181
1182  /**
1183   * Constructor
1184   */
1185    public Provenance() {
1186      super();
1187    }
1188
1189  /**
1190   * Constructor
1191   */
1192    public Provenance(InstantType recorded) {
1193      super();
1194      this.recorded = recorded;
1195    }
1196
1197    /**
1198     * @return {@link #target} (The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.)
1199     */
1200    public List<Reference> getTarget() { 
1201      if (this.target == null)
1202        this.target = new ArrayList<Reference>();
1203      return this.target;
1204    }
1205
1206    public boolean hasTarget() { 
1207      if (this.target == null)
1208        return false;
1209      for (Reference item : this.target)
1210        if (!item.isEmpty())
1211          return true;
1212      return false;
1213    }
1214
1215    /**
1216     * @return {@link #target} (The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.)
1217     */
1218    // syntactic sugar
1219    public Reference addTarget() { //3
1220      Reference t = new Reference();
1221      if (this.target == null)
1222        this.target = new ArrayList<Reference>();
1223      this.target.add(t);
1224      return t;
1225    }
1226
1227    // syntactic sugar
1228    public Provenance addTarget(Reference t) { //3
1229      if (t == null)
1230        return this;
1231      if (this.target == null)
1232        this.target = new ArrayList<Reference>();
1233      this.target.add(t);
1234      return this;
1235    }
1236
1237    /**
1238     * @return {@link #target} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.)
1239     */
1240    public List<Resource> getTargetTarget() { 
1241      if (this.targetTarget == null)
1242        this.targetTarget = new ArrayList<Resource>();
1243      return this.targetTarget;
1244    }
1245
1246    /**
1247     * @return {@link #period} (The period during which the activity occurred.)
1248     */
1249    public Period getPeriod() { 
1250      if (this.period == null)
1251        if (Configuration.errorOnAutoCreate())
1252          throw new Error("Attempt to auto-create Provenance.period");
1253        else if (Configuration.doAutoCreate())
1254          this.period = new Period(); // cc
1255      return this.period;
1256    }
1257
1258    public boolean hasPeriod() { 
1259      return this.period != null && !this.period.isEmpty();
1260    }
1261
1262    /**
1263     * @param value {@link #period} (The period during which the activity occurred.)
1264     */
1265    public Provenance setPeriod(Period value) { 
1266      this.period = value;
1267      return this;
1268    }
1269
1270    /**
1271     * @return {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value
1272     */
1273    public InstantType getRecordedElement() { 
1274      if (this.recorded == null)
1275        if (Configuration.errorOnAutoCreate())
1276          throw new Error("Attempt to auto-create Provenance.recorded");
1277        else if (Configuration.doAutoCreate())
1278          this.recorded = new InstantType(); // bb
1279      return this.recorded;
1280    }
1281
1282    public boolean hasRecordedElement() { 
1283      return this.recorded != null && !this.recorded.isEmpty();
1284    }
1285
1286    public boolean hasRecorded() { 
1287      return this.recorded != null && !this.recorded.isEmpty();
1288    }
1289
1290    /**
1291     * @param value {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value
1292     */
1293    public Provenance setRecordedElement(InstantType value) { 
1294      this.recorded = value;
1295      return this;
1296    }
1297
1298    /**
1299     * @return The instant of time at which the activity was recorded.
1300     */
1301    public Date getRecorded() { 
1302      return this.recorded == null ? null : this.recorded.getValue();
1303    }
1304
1305    /**
1306     * @param value The instant of time at which the activity was recorded.
1307     */
1308    public Provenance setRecorded(Date value) { 
1309        if (this.recorded == null)
1310          this.recorded = new InstantType();
1311        this.recorded.setValue(value);
1312      return this;
1313    }
1314
1315    /**
1316     * @return {@link #reason} (The reason that the activity was taking place.)
1317     */
1318    public List<Coding> getReason() { 
1319      if (this.reason == null)
1320        this.reason = new ArrayList<Coding>();
1321      return this.reason;
1322    }
1323
1324    public boolean hasReason() { 
1325      if (this.reason == null)
1326        return false;
1327      for (Coding item : this.reason)
1328        if (!item.isEmpty())
1329          return true;
1330      return false;
1331    }
1332
1333    /**
1334     * @return {@link #reason} (The reason that the activity was taking place.)
1335     */
1336    // syntactic sugar
1337    public Coding addReason() { //3
1338      Coding t = new Coding();
1339      if (this.reason == null)
1340        this.reason = new ArrayList<Coding>();
1341      this.reason.add(t);
1342      return t;
1343    }
1344
1345    // syntactic sugar
1346    public Provenance addReason(Coding t) { //3
1347      if (t == null)
1348        return this;
1349      if (this.reason == null)
1350        this.reason = new ArrayList<Coding>();
1351      this.reason.add(t);
1352      return this;
1353    }
1354
1355    /**
1356     * @return {@link #activity} (An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.)
1357     */
1358    public Coding getActivity() { 
1359      if (this.activity == null)
1360        if (Configuration.errorOnAutoCreate())
1361          throw new Error("Attempt to auto-create Provenance.activity");
1362        else if (Configuration.doAutoCreate())
1363          this.activity = new Coding(); // cc
1364      return this.activity;
1365    }
1366
1367    public boolean hasActivity() { 
1368      return this.activity != null && !this.activity.isEmpty();
1369    }
1370
1371    /**
1372     * @param value {@link #activity} (An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.)
1373     */
1374    public Provenance setActivity(Coding value) { 
1375      this.activity = value;
1376      return this;
1377    }
1378
1379    /**
1380     * @return {@link #location} (Where the activity occurred, if relevant.)
1381     */
1382    public Reference getLocation() { 
1383      if (this.location == null)
1384        if (Configuration.errorOnAutoCreate())
1385          throw new Error("Attempt to auto-create Provenance.location");
1386        else if (Configuration.doAutoCreate())
1387          this.location = new Reference(); // cc
1388      return this.location;
1389    }
1390
1391    public boolean hasLocation() { 
1392      return this.location != null && !this.location.isEmpty();
1393    }
1394
1395    /**
1396     * @param value {@link #location} (Where the activity occurred, if relevant.)
1397     */
1398    public Provenance setLocation(Reference value) { 
1399      this.location = value;
1400      return this;
1401    }
1402
1403    /**
1404     * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the activity occurred, if relevant.)
1405     */
1406    public Location getLocationTarget() { 
1407      if (this.locationTarget == null)
1408        if (Configuration.errorOnAutoCreate())
1409          throw new Error("Attempt to auto-create Provenance.location");
1410        else if (Configuration.doAutoCreate())
1411          this.locationTarget = new Location(); // aa
1412      return this.locationTarget;
1413    }
1414
1415    /**
1416     * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the activity occurred, if relevant.)
1417     */
1418    public Provenance setLocationTarget(Location value) { 
1419      this.locationTarget = value;
1420      return this;
1421    }
1422
1423    /**
1424     * @return {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.)
1425     */
1426    public List<UriType> getPolicy() { 
1427      if (this.policy == null)
1428        this.policy = new ArrayList<UriType>();
1429      return this.policy;
1430    }
1431
1432    public boolean hasPolicy() { 
1433      if (this.policy == null)
1434        return false;
1435      for (UriType item : this.policy)
1436        if (!item.isEmpty())
1437          return true;
1438      return false;
1439    }
1440
1441    /**
1442     * @return {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.)
1443     */
1444    // syntactic sugar
1445    public UriType addPolicyElement() {//2 
1446      UriType t = new UriType();
1447      if (this.policy == null)
1448        this.policy = new ArrayList<UriType>();
1449      this.policy.add(t);
1450      return t;
1451    }
1452
1453    /**
1454     * @param value {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.)
1455     */
1456    public Provenance addPolicy(String value) { //1
1457      UriType t = new UriType();
1458      t.setValue(value);
1459      if (this.policy == null)
1460        this.policy = new ArrayList<UriType>();
1461      this.policy.add(t);
1462      return this;
1463    }
1464
1465    /**
1466     * @param value {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.)
1467     */
1468    public boolean hasPolicy(String value) { 
1469      if (this.policy == null)
1470        return false;
1471      for (UriType v : this.policy)
1472        if (v.equals(value)) // uri
1473          return true;
1474      return false;
1475    }
1476
1477    /**
1478     * @return {@link #agent} (An actor taking a role in an activity  for which it can be assigned some degree of responsibility for the activity taking place.)
1479     */
1480    public List<ProvenanceAgentComponent> getAgent() { 
1481      if (this.agent == null)
1482        this.agent = new ArrayList<ProvenanceAgentComponent>();
1483      return this.agent;
1484    }
1485
1486    public boolean hasAgent() { 
1487      if (this.agent == null)
1488        return false;
1489      for (ProvenanceAgentComponent item : this.agent)
1490        if (!item.isEmpty())
1491          return true;
1492      return false;
1493    }
1494
1495    /**
1496     * @return {@link #agent} (An actor taking a role in an activity  for which it can be assigned some degree of responsibility for the activity taking place.)
1497     */
1498    // syntactic sugar
1499    public ProvenanceAgentComponent addAgent() { //3
1500      ProvenanceAgentComponent t = new ProvenanceAgentComponent();
1501      if (this.agent == null)
1502        this.agent = new ArrayList<ProvenanceAgentComponent>();
1503      this.agent.add(t);
1504      return t;
1505    }
1506
1507    // syntactic sugar
1508    public Provenance addAgent(ProvenanceAgentComponent t) { //3
1509      if (t == null)
1510        return this;
1511      if (this.agent == null)
1512        this.agent = new ArrayList<ProvenanceAgentComponent>();
1513      this.agent.add(t);
1514      return this;
1515    }
1516
1517    /**
1518     * @return {@link #entity} (An entity used in this activity.)
1519     */
1520    public List<ProvenanceEntityComponent> getEntity() { 
1521      if (this.entity == null)
1522        this.entity = new ArrayList<ProvenanceEntityComponent>();
1523      return this.entity;
1524    }
1525
1526    public boolean hasEntity() { 
1527      if (this.entity == null)
1528        return false;
1529      for (ProvenanceEntityComponent item : this.entity)
1530        if (!item.isEmpty())
1531          return true;
1532      return false;
1533    }
1534
1535    /**
1536     * @return {@link #entity} (An entity used in this activity.)
1537     */
1538    // syntactic sugar
1539    public ProvenanceEntityComponent addEntity() { //3
1540      ProvenanceEntityComponent t = new ProvenanceEntityComponent();
1541      if (this.entity == null)
1542        this.entity = new ArrayList<ProvenanceEntityComponent>();
1543      this.entity.add(t);
1544      return t;
1545    }
1546
1547    // syntactic sugar
1548    public Provenance addEntity(ProvenanceEntityComponent t) { //3
1549      if (t == null)
1550        return this;
1551      if (this.entity == null)
1552        this.entity = new ArrayList<ProvenanceEntityComponent>();
1553      this.entity.add(t);
1554      return this;
1555    }
1556
1557    /**
1558     * @return {@link #signature} (A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.)
1559     */
1560    public List<Signature> getSignature() { 
1561      if (this.signature == null)
1562        this.signature = new ArrayList<Signature>();
1563      return this.signature;
1564    }
1565
1566    public boolean hasSignature() { 
1567      if (this.signature == null)
1568        return false;
1569      for (Signature item : this.signature)
1570        if (!item.isEmpty())
1571          return true;
1572      return false;
1573    }
1574
1575    /**
1576     * @return {@link #signature} (A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.)
1577     */
1578    // syntactic sugar
1579    public Signature addSignature() { //3
1580      Signature t = new Signature();
1581      if (this.signature == null)
1582        this.signature = new ArrayList<Signature>();
1583      this.signature.add(t);
1584      return t;
1585    }
1586
1587    // syntactic sugar
1588    public Provenance addSignature(Signature t) { //3
1589      if (t == null)
1590        return this;
1591      if (this.signature == null)
1592        this.signature = new ArrayList<Signature>();
1593      this.signature.add(t);
1594      return this;
1595    }
1596
1597      protected void listChildren(List<Property> childrenList) {
1598        super.listChildren(childrenList);
1599        childrenList.add(new Property("target", "Reference(Any)", "The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.", 0, java.lang.Integer.MAX_VALUE, target));
1600        childrenList.add(new Property("period", "Period", "The period during which the activity occurred.", 0, java.lang.Integer.MAX_VALUE, period));
1601        childrenList.add(new Property("recorded", "instant", "The instant of time at which the activity was recorded.", 0, java.lang.Integer.MAX_VALUE, recorded));
1602        childrenList.add(new Property("reason", "Coding", "The reason that the activity was taking place.", 0, java.lang.Integer.MAX_VALUE, reason));
1603        childrenList.add(new Property("activity", "Coding", "An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.", 0, java.lang.Integer.MAX_VALUE, activity));
1604        childrenList.add(new Property("location", "Reference(Location)", "Where the activity occurred, if relevant.", 0, java.lang.Integer.MAX_VALUE, location));
1605        childrenList.add(new Property("policy", "uri", "Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.", 0, java.lang.Integer.MAX_VALUE, policy));
1606        childrenList.add(new Property("agent", "", "An actor taking a role in an activity  for which it can be assigned some degree of responsibility for the activity taking place.", 0, java.lang.Integer.MAX_VALUE, agent));
1607        childrenList.add(new Property("entity", "", "An entity used in this activity.", 0, java.lang.Integer.MAX_VALUE, entity));
1608        childrenList.add(new Property("signature", "Signature", "A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.", 0, java.lang.Integer.MAX_VALUE, signature));
1609      }
1610
1611      @Override
1612      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1613        switch (hash) {
1614        case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // Reference
1615        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1616        case -799233872: /*recorded*/ return this.recorded == null ? new Base[0] : new Base[] {this.recorded}; // InstantType
1617        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // Coding
1618        case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : new Base[] {this.activity}; // Coding
1619        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
1620        case -982670030: /*policy*/ return this.policy == null ? new Base[0] : this.policy.toArray(new Base[this.policy.size()]); // UriType
1621        case 92750597: /*agent*/ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // ProvenanceAgentComponent
1622        case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : this.entity.toArray(new Base[this.entity.size()]); // ProvenanceEntityComponent
1623        case 1073584312: /*signature*/ return this.signature == null ? new Base[0] : this.signature.toArray(new Base[this.signature.size()]); // Signature
1624        default: return super.getProperty(hash, name, checkValid);
1625        }
1626
1627      }
1628
1629      @Override
1630      public void setProperty(int hash, String name, Base value) throws FHIRException {
1631        switch (hash) {
1632        case -880905839: // target
1633          this.getTarget().add(castToReference(value)); // Reference
1634          break;
1635        case -991726143: // period
1636          this.period = castToPeriod(value); // Period
1637          break;
1638        case -799233872: // recorded
1639          this.recorded = castToInstant(value); // InstantType
1640          break;
1641        case -934964668: // reason
1642          this.getReason().add(castToCoding(value)); // Coding
1643          break;
1644        case -1655966961: // activity
1645          this.activity = castToCoding(value); // Coding
1646          break;
1647        case 1901043637: // location
1648          this.location = castToReference(value); // Reference
1649          break;
1650        case -982670030: // policy
1651          this.getPolicy().add(castToUri(value)); // UriType
1652          break;
1653        case 92750597: // agent
1654          this.getAgent().add((ProvenanceAgentComponent) value); // ProvenanceAgentComponent
1655          break;
1656        case -1298275357: // entity
1657          this.getEntity().add((ProvenanceEntityComponent) value); // ProvenanceEntityComponent
1658          break;
1659        case 1073584312: // signature
1660          this.getSignature().add(castToSignature(value)); // Signature
1661          break;
1662        default: super.setProperty(hash, name, value);
1663        }
1664
1665      }
1666
1667      @Override
1668      public void setProperty(String name, Base value) throws FHIRException {
1669        if (name.equals("target"))
1670          this.getTarget().add(castToReference(value));
1671        else if (name.equals("period"))
1672          this.period = castToPeriod(value); // Period
1673        else if (name.equals("recorded"))
1674          this.recorded = castToInstant(value); // InstantType
1675        else if (name.equals("reason"))
1676          this.getReason().add(castToCoding(value));
1677        else if (name.equals("activity"))
1678          this.activity = castToCoding(value); // Coding
1679        else if (name.equals("location"))
1680          this.location = castToReference(value); // Reference
1681        else if (name.equals("policy"))
1682          this.getPolicy().add(castToUri(value));
1683        else if (name.equals("agent"))
1684          this.getAgent().add((ProvenanceAgentComponent) value);
1685        else if (name.equals("entity"))
1686          this.getEntity().add((ProvenanceEntityComponent) value);
1687        else if (name.equals("signature"))
1688          this.getSignature().add(castToSignature(value));
1689        else
1690          super.setProperty(name, value);
1691      }
1692
1693      @Override
1694      public Base makeProperty(int hash, String name) throws FHIRException {
1695        switch (hash) {
1696        case -880905839:  return addTarget(); // Reference
1697        case -991726143:  return getPeriod(); // Period
1698        case -799233872: throw new FHIRException("Cannot make property recorded as it is not a complex type"); // InstantType
1699        case -934964668:  return addReason(); // Coding
1700        case -1655966961:  return getActivity(); // Coding
1701        case 1901043637:  return getLocation(); // Reference
1702        case -982670030: throw new FHIRException("Cannot make property policy as it is not a complex type"); // UriType
1703        case 92750597:  return addAgent(); // ProvenanceAgentComponent
1704        case -1298275357:  return addEntity(); // ProvenanceEntityComponent
1705        case 1073584312:  return addSignature(); // Signature
1706        default: return super.makeProperty(hash, name);
1707        }
1708
1709      }
1710
1711      @Override
1712      public Base addChild(String name) throws FHIRException {
1713        if (name.equals("target")) {
1714          return addTarget();
1715        }
1716        else if (name.equals("period")) {
1717          this.period = new Period();
1718          return this.period;
1719        }
1720        else if (name.equals("recorded")) {
1721          throw new FHIRException("Cannot call addChild on a primitive type Provenance.recorded");
1722        }
1723        else if (name.equals("reason")) {
1724          return addReason();
1725        }
1726        else if (name.equals("activity")) {
1727          this.activity = new Coding();
1728          return this.activity;
1729        }
1730        else if (name.equals("location")) {
1731          this.location = new Reference();
1732          return this.location;
1733        }
1734        else if (name.equals("policy")) {
1735          throw new FHIRException("Cannot call addChild on a primitive type Provenance.policy");
1736        }
1737        else if (name.equals("agent")) {
1738          return addAgent();
1739        }
1740        else if (name.equals("entity")) {
1741          return addEntity();
1742        }
1743        else if (name.equals("signature")) {
1744          return addSignature();
1745        }
1746        else
1747          return super.addChild(name);
1748      }
1749
1750  public String fhirType() {
1751    return "Provenance";
1752
1753  }
1754
1755      public Provenance copy() {
1756        Provenance dst = new Provenance();
1757        copyValues(dst);
1758        if (target != null) {
1759          dst.target = new ArrayList<Reference>();
1760          for (Reference i : target)
1761            dst.target.add(i.copy());
1762        };
1763        dst.period = period == null ? null : period.copy();
1764        dst.recorded = recorded == null ? null : recorded.copy();
1765        if (reason != null) {
1766          dst.reason = new ArrayList<Coding>();
1767          for (Coding i : reason)
1768            dst.reason.add(i.copy());
1769        };
1770        dst.activity = activity == null ? null : activity.copy();
1771        dst.location = location == null ? null : location.copy();
1772        if (policy != null) {
1773          dst.policy = new ArrayList<UriType>();
1774          for (UriType i : policy)
1775            dst.policy.add(i.copy());
1776        };
1777        if (agent != null) {
1778          dst.agent = new ArrayList<ProvenanceAgentComponent>();
1779          for (ProvenanceAgentComponent i : agent)
1780            dst.agent.add(i.copy());
1781        };
1782        if (entity != null) {
1783          dst.entity = new ArrayList<ProvenanceEntityComponent>();
1784          for (ProvenanceEntityComponent i : entity)
1785            dst.entity.add(i.copy());
1786        };
1787        if (signature != null) {
1788          dst.signature = new ArrayList<Signature>();
1789          for (Signature i : signature)
1790            dst.signature.add(i.copy());
1791        };
1792        return dst;
1793      }
1794
1795      protected Provenance typedCopy() {
1796        return copy();
1797      }
1798
1799      @Override
1800      public boolean equalsDeep(Base other) {
1801        if (!super.equalsDeep(other))
1802          return false;
1803        if (!(other instanceof Provenance))
1804          return false;
1805        Provenance o = (Provenance) other;
1806        return compareDeep(target, o.target, true) && compareDeep(period, o.period, true) && compareDeep(recorded, o.recorded, true)
1807           && compareDeep(reason, o.reason, true) && compareDeep(activity, o.activity, true) && compareDeep(location, o.location, true)
1808           && compareDeep(policy, o.policy, true) && compareDeep(agent, o.agent, true) && compareDeep(entity, o.entity, true)
1809           && compareDeep(signature, o.signature, true);
1810      }
1811
1812      @Override
1813      public boolean equalsShallow(Base other) {
1814        if (!super.equalsShallow(other))
1815          return false;
1816        if (!(other instanceof Provenance))
1817          return false;
1818        Provenance o = (Provenance) other;
1819        return compareValues(recorded, o.recorded, true) && compareValues(policy, o.policy, true);
1820      }
1821
1822      public boolean isEmpty() {
1823        return super.isEmpty() && (target == null || target.isEmpty()) && (period == null || period.isEmpty())
1824           && (recorded == null || recorded.isEmpty()) && (reason == null || reason.isEmpty()) && (activity == null || activity.isEmpty())
1825           && (location == null || location.isEmpty()) && (policy == null || policy.isEmpty()) && (agent == null || agent.isEmpty())
1826           && (entity == null || entity.isEmpty()) && (signature == null || signature.isEmpty());
1827      }
1828
1829  @Override
1830  public ResourceType getResourceType() {
1831    return ResourceType.Provenance;
1832   }
1833
1834 /**
1835   * Search parameter: <b>patient</b>
1836   * <p>
1837   * Description: <b>Target Reference(s) (usually version specific)</b><br>
1838   * Type: <b>reference</b><br>
1839   * Path: <b>Provenance.target</b><br>
1840   * </p>
1841   */
1842  @SearchParamDefinition(name="patient", path="Provenance.target", description="Target Reference(s) (usually version specific)", type="reference" )
1843  public static final String SP_PATIENT = "patient";
1844 /**
1845   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1846   * <p>
1847   * Description: <b>Target Reference(s) (usually version specific)</b><br>
1848   * Type: <b>reference</b><br>
1849   * Path: <b>Provenance.target</b><br>
1850   * </p>
1851   */
1852  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
1853
1854/**
1855   * Constant for fluent queries to be used to add include statements. Specifies
1856   * the path value of "<b>Provenance:patient</b>".
1857   */
1858  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Provenance:patient").toLocked();
1859
1860 /**
1861   * Search parameter: <b>location</b>
1862   * <p>
1863   * Description: <b>Where the activity occurred, if relevant</b><br>
1864   * Type: <b>reference</b><br>
1865   * Path: <b>Provenance.location</b><br>
1866   * </p>
1867   */
1868  @SearchParamDefinition(name="location", path="Provenance.location", description="Where the activity occurred, if relevant", type="reference" )
1869  public static final String SP_LOCATION = "location";
1870 /**
1871   * <b>Fluent Client</b> search parameter constant for <b>location</b>
1872   * <p>
1873   * Description: <b>Where the activity occurred, if relevant</b><br>
1874   * Type: <b>reference</b><br>
1875   * Path: <b>Provenance.location</b><br>
1876   * </p>
1877   */
1878  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION);
1879
1880/**
1881   * Constant for fluent queries to be used to add include statements. Specifies
1882   * the path value of "<b>Provenance:location</b>".
1883   */
1884  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Provenance:location").toLocked();
1885
1886 /**
1887   * Search parameter: <b>start</b>
1888   * <p>
1889   * Description: <b>Starting time with inclusive boundary</b><br>
1890   * Type: <b>date</b><br>
1891   * Path: <b>Provenance.period.start</b><br>
1892   * </p>
1893   */
1894  @SearchParamDefinition(name="start", path="Provenance.period.start", description="Starting time with inclusive boundary", type="date" )
1895  public static final String SP_START = "start";
1896 /**
1897   * <b>Fluent Client</b> search parameter constant for <b>start</b>
1898   * <p>
1899   * Description: <b>Starting time with inclusive boundary</b><br>
1900   * Type: <b>date</b><br>
1901   * Path: <b>Provenance.period.start</b><br>
1902   * </p>
1903   */
1904  public static final ca.uhn.fhir.rest.gclient.DateClientParam START = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_START);
1905
1906 /**
1907   * Search parameter: <b>entity</b>
1908   * <p>
1909   * Description: <b>Identity of entity</b><br>
1910   * Type: <b>uri</b><br>
1911   * Path: <b>Provenance.entity.reference</b><br>
1912   * </p>
1913   */
1914  @SearchParamDefinition(name="entity", path="Provenance.entity.reference", description="Identity of entity", type="uri" )
1915  public static final String SP_ENTITY = "entity";
1916 /**
1917   * <b>Fluent Client</b> search parameter constant for <b>entity</b>
1918   * <p>
1919   * Description: <b>Identity of entity</b><br>
1920   * Type: <b>uri</b><br>
1921   * Path: <b>Provenance.entity.reference</b><br>
1922   * </p>
1923   */
1924  public static final ca.uhn.fhir.rest.gclient.UriClientParam ENTITY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_ENTITY);
1925
1926 /**
1927   * Search parameter: <b>userid</b>
1928   * <p>
1929   * Description: <b>Authorization-system identifier for the agent</b><br>
1930   * Type: <b>token</b><br>
1931   * Path: <b>Provenance.agent.userId</b><br>
1932   * </p>
1933   */
1934  @SearchParamDefinition(name="userid", path="Provenance.agent.userId", description="Authorization-system identifier for the agent", type="token" )
1935  public static final String SP_USERID = "userid";
1936 /**
1937   * <b>Fluent Client</b> search parameter constant for <b>userid</b>
1938   * <p>
1939   * Description: <b>Authorization-system identifier for the agent</b><br>
1940   * Type: <b>token</b><br>
1941   * Path: <b>Provenance.agent.userId</b><br>
1942   * </p>
1943   */
1944  public static final ca.uhn.fhir.rest.gclient.TokenClientParam USERID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_USERID);
1945
1946 /**
1947   * Search parameter: <b>target</b>
1948   * <p>
1949   * Description: <b>Target Reference(s) (usually version specific)</b><br>
1950   * Type: <b>reference</b><br>
1951   * Path: <b>Provenance.target</b><br>
1952   * </p>
1953   */
1954  @SearchParamDefinition(name="target", path="Provenance.target", description="Target Reference(s) (usually version specific)", type="reference" )
1955  public static final String SP_TARGET = "target";
1956 /**
1957   * <b>Fluent Client</b> search parameter constant for <b>target</b>
1958   * <p>
1959   * Description: <b>Target Reference(s) (usually version specific)</b><br>
1960   * Type: <b>reference</b><br>
1961   * Path: <b>Provenance.target</b><br>
1962   * </p>
1963   */
1964  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGET);
1965
1966/**
1967   * Constant for fluent queries to be used to add include statements. Specifies
1968   * the path value of "<b>Provenance:target</b>".
1969   */
1970  public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGET = new ca.uhn.fhir.model.api.Include("Provenance:target").toLocked();
1971
1972 /**
1973   * Search parameter: <b>entity-type</b>
1974   * <p>
1975   * Description: <b>The type of resource in this entity</b><br>
1976   * Type: <b>token</b><br>
1977   * Path: <b>Provenance.entity.type</b><br>
1978   * </p>
1979   */
1980  @SearchParamDefinition(name="entity-type", path="Provenance.entity.type", description="The type of resource in this entity", type="token" )
1981  public static final String SP_ENTITY_TYPE = "entity-type";
1982 /**
1983   * <b>Fluent Client</b> search parameter constant for <b>entity-type</b>
1984   * <p>
1985   * Description: <b>The type of resource in this entity</b><br>
1986   * Type: <b>token</b><br>
1987   * Path: <b>Provenance.entity.type</b><br>
1988   * </p>
1989   */
1990  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ENTITY_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ENTITY_TYPE);
1991
1992 /**
1993   * Search parameter: <b>agent</b>
1994   * <p>
1995   * Description: <b>Individual, device or organization playing role</b><br>
1996   * Type: <b>reference</b><br>
1997   * Path: <b>Provenance.agent.actor</b><br>
1998   * </p>
1999   */
2000  @SearchParamDefinition(name="agent", path="Provenance.agent.actor", description="Individual, device or organization playing role", type="reference" )
2001  public static final String SP_AGENT = "agent";
2002 /**
2003   * <b>Fluent Client</b> search parameter constant for <b>agent</b>
2004   * <p>
2005   * Description: <b>Individual, device or organization playing role</b><br>
2006   * Type: <b>reference</b><br>
2007   * Path: <b>Provenance.agent.actor</b><br>
2008   * </p>
2009   */
2010  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AGENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AGENT);
2011
2012/**
2013   * Constant for fluent queries to be used to add include statements. Specifies
2014   * the path value of "<b>Provenance:agent</b>".
2015   */
2016  public static final ca.uhn.fhir.model.api.Include INCLUDE_AGENT = new ca.uhn.fhir.model.api.Include("Provenance:agent").toLocked();
2017
2018 /**
2019   * Search parameter: <b>end</b>
2020   * <p>
2021   * Description: <b>End time with inclusive boundary, if not ongoing</b><br>
2022   * Type: <b>date</b><br>
2023   * Path: <b>Provenance.period.end</b><br>
2024   * </p>
2025   */
2026  @SearchParamDefinition(name="end", path="Provenance.period.end", description="End time with inclusive boundary, if not ongoing", type="date" )
2027  public static final String SP_END = "end";
2028 /**
2029   * <b>Fluent Client</b> search parameter constant for <b>end</b>
2030   * <p>
2031   * Description: <b>End time with inclusive boundary, if not ongoing</b><br>
2032   * Type: <b>date</b><br>
2033   * Path: <b>Provenance.period.end</b><br>
2034   * </p>
2035   */
2036  public static final ca.uhn.fhir.rest.gclient.DateClientParam END = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_END);
2037
2038 /**
2039   * Search parameter: <b>sig</b>
2040   * <p>
2041   * Description: <b>Indication of the reason the entity signed the object(s)</b><br>
2042   * Type: <b>token</b><br>
2043   * Path: <b>Provenance.signature.type</b><br>
2044   * </p>
2045   */
2046  @SearchParamDefinition(name="sig", path="Provenance.signature.type", description="Indication of the reason the entity signed the object(s)", type="token" )
2047  public static final String SP_SIG = "sig";
2048 /**
2049   * <b>Fluent Client</b> search parameter constant for <b>sig</b>
2050   * <p>
2051   * Description: <b>Indication of the reason the entity signed the object(s)</b><br>
2052   * Type: <b>token</b><br>
2053   * Path: <b>Provenance.signature.type</b><br>
2054   * </p>
2055   */
2056  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SIG = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SIG);
2057
2058
2059}