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