001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 13, 2022 17:53+1100 for FHIR vcurrent
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * A reference to a document of any kind for any purpose. While the term “document” implies a more narrow focus, for this resource this "document" encompasses *any* serialized object with a mime-type, it includes formal patient-centric documents (CDA), clinical notes, scanned paper, non-patient specific documents like policy text, as well as a photo, video, or audio recording acquired or used in healthcare.  The DocumentReference resource provides metadata about the document so that the document can be discovered and managed.  The actual content may be inline base64 encoded data or provided by direct reference.
052 */
053@ResourceDef(name="DocumentReference", profile="http://hl7.org/fhir/StructureDefinition/DocumentReference")
054public class DocumentReference extends DomainResource {
055
056    @Block()
057    public static class DocumentReferenceAttesterComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * The type of attestation the authenticator offers.
060         */
061        @Child(name = "mode", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
062        @Description(shortDefinition="personal | professional | legal | official", formalDefinition="The type of attestation the authenticator offers." )
063        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/composition-attestation-mode")
064        protected CodeableConcept mode;
065
066        /**
067         * When the document was attested by the party.
068         */
069        @Child(name = "time", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
070        @Description(shortDefinition="When the document was attested", formalDefinition="When the document was attested by the party." )
071        protected DateTimeType time;
072
073        /**
074         * Who attested the document in the specified way.
075         */
076        @Child(name = "party", type = {Patient.class, RelatedPerson.class, Practitioner.class, PractitionerRole.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=false)
077        @Description(shortDefinition="Who attested the document", formalDefinition="Who attested the document in the specified way." )
078        protected Reference party;
079
080        private static final long serialVersionUID = 545132751L;
081
082    /**
083     * Constructor
084     */
085      public DocumentReferenceAttesterComponent() {
086        super();
087      }
088
089    /**
090     * Constructor
091     */
092      public DocumentReferenceAttesterComponent(CodeableConcept mode) {
093        super();
094        this.setMode(mode);
095      }
096
097        /**
098         * @return {@link #mode} (The type of attestation the authenticator offers.)
099         */
100        public CodeableConcept getMode() { 
101          if (this.mode == null)
102            if (Configuration.errorOnAutoCreate())
103              throw new Error("Attempt to auto-create DocumentReferenceAttesterComponent.mode");
104            else if (Configuration.doAutoCreate())
105              this.mode = new CodeableConcept(); // cc
106          return this.mode;
107        }
108
109        public boolean hasMode() { 
110          return this.mode != null && !this.mode.isEmpty();
111        }
112
113        /**
114         * @param value {@link #mode} (The type of attestation the authenticator offers.)
115         */
116        public DocumentReferenceAttesterComponent setMode(CodeableConcept value) { 
117          this.mode = value;
118          return this;
119        }
120
121        /**
122         * @return {@link #time} (When the document was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value
123         */
124        public DateTimeType getTimeElement() { 
125          if (this.time == null)
126            if (Configuration.errorOnAutoCreate())
127              throw new Error("Attempt to auto-create DocumentReferenceAttesterComponent.time");
128            else if (Configuration.doAutoCreate())
129              this.time = new DateTimeType(); // bb
130          return this.time;
131        }
132
133        public boolean hasTimeElement() { 
134          return this.time != null && !this.time.isEmpty();
135        }
136
137        public boolean hasTime() { 
138          return this.time != null && !this.time.isEmpty();
139        }
140
141        /**
142         * @param value {@link #time} (When the document was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value
143         */
144        public DocumentReferenceAttesterComponent setTimeElement(DateTimeType value) { 
145          this.time = value;
146          return this;
147        }
148
149        /**
150         * @return When the document was attested by the party.
151         */
152        public Date getTime() { 
153          return this.time == null ? null : this.time.getValue();
154        }
155
156        /**
157         * @param value When the document was attested by the party.
158         */
159        public DocumentReferenceAttesterComponent setTime(Date value) { 
160          if (value == null)
161            this.time = null;
162          else {
163            if (this.time == null)
164              this.time = new DateTimeType();
165            this.time.setValue(value);
166          }
167          return this;
168        }
169
170        /**
171         * @return {@link #party} (Who attested the document in the specified way.)
172         */
173        public Reference getParty() { 
174          if (this.party == null)
175            if (Configuration.errorOnAutoCreate())
176              throw new Error("Attempt to auto-create DocumentReferenceAttesterComponent.party");
177            else if (Configuration.doAutoCreate())
178              this.party = new Reference(); // cc
179          return this.party;
180        }
181
182        public boolean hasParty() { 
183          return this.party != null && !this.party.isEmpty();
184        }
185
186        /**
187         * @param value {@link #party} (Who attested the document in the specified way.)
188         */
189        public DocumentReferenceAttesterComponent setParty(Reference value) { 
190          this.party = value;
191          return this;
192        }
193
194        protected void listChildren(List<Property> children) {
195          super.listChildren(children);
196          children.add(new Property("mode", "CodeableConcept", "The type of attestation the authenticator offers.", 0, 1, mode));
197          children.add(new Property("time", "dateTime", "When the document was attested by the party.", 0, 1, time));
198          children.add(new Property("party", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Organization)", "Who attested the document in the specified way.", 0, 1, party));
199        }
200
201        @Override
202        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
203          switch (_hash) {
204          case 3357091: /*mode*/  return new Property("mode", "CodeableConcept", "The type of attestation the authenticator offers.", 0, 1, mode);
205          case 3560141: /*time*/  return new Property("time", "dateTime", "When the document was attested by the party.", 0, 1, time);
206          case 106437350: /*party*/  return new Property("party", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Organization)", "Who attested the document in the specified way.", 0, 1, party);
207          default: return super.getNamedProperty(_hash, _name, _checkValid);
208          }
209
210        }
211
212      @Override
213      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
214        switch (hash) {
215        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // CodeableConcept
216        case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // DateTimeType
217        case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference
218        default: return super.getProperty(hash, name, checkValid);
219        }
220
221      }
222
223      @Override
224      public Base setProperty(int hash, String name, Base value) throws FHIRException {
225        switch (hash) {
226        case 3357091: // mode
227          this.mode = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
228          return value;
229        case 3560141: // time
230          this.time = TypeConvertor.castToDateTime(value); // DateTimeType
231          return value;
232        case 106437350: // party
233          this.party = TypeConvertor.castToReference(value); // Reference
234          return value;
235        default: return super.setProperty(hash, name, value);
236        }
237
238      }
239
240      @Override
241      public Base setProperty(String name, Base value) throws FHIRException {
242        if (name.equals("mode")) {
243          this.mode = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
244        } else if (name.equals("time")) {
245          this.time = TypeConvertor.castToDateTime(value); // DateTimeType
246        } else if (name.equals("party")) {
247          this.party = TypeConvertor.castToReference(value); // Reference
248        } else
249          return super.setProperty(name, value);
250        return value;
251      }
252
253      @Override
254      public Base makeProperty(int hash, String name) throws FHIRException {
255        switch (hash) {
256        case 3357091:  return getMode();
257        case 3560141:  return getTimeElement();
258        case 106437350:  return getParty();
259        default: return super.makeProperty(hash, name);
260        }
261
262      }
263
264      @Override
265      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
266        switch (hash) {
267        case 3357091: /*mode*/ return new String[] {"CodeableConcept"};
268        case 3560141: /*time*/ return new String[] {"dateTime"};
269        case 106437350: /*party*/ return new String[] {"Reference"};
270        default: return super.getTypesForProperty(hash, name);
271        }
272
273      }
274
275      @Override
276      public Base addChild(String name) throws FHIRException {
277        if (name.equals("mode")) {
278          this.mode = new CodeableConcept();
279          return this.mode;
280        }
281        else if (name.equals("time")) {
282          throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.attester.time");
283        }
284        else if (name.equals("party")) {
285          this.party = new Reference();
286          return this.party;
287        }
288        else
289          return super.addChild(name);
290      }
291
292      public DocumentReferenceAttesterComponent copy() {
293        DocumentReferenceAttesterComponent dst = new DocumentReferenceAttesterComponent();
294        copyValues(dst);
295        return dst;
296      }
297
298      public void copyValues(DocumentReferenceAttesterComponent dst) {
299        super.copyValues(dst);
300        dst.mode = mode == null ? null : mode.copy();
301        dst.time = time == null ? null : time.copy();
302        dst.party = party == null ? null : party.copy();
303      }
304
305      @Override
306      public boolean equalsDeep(Base other_) {
307        if (!super.equalsDeep(other_))
308          return false;
309        if (!(other_ instanceof DocumentReferenceAttesterComponent))
310          return false;
311        DocumentReferenceAttesterComponent o = (DocumentReferenceAttesterComponent) other_;
312        return compareDeep(mode, o.mode, true) && compareDeep(time, o.time, true) && compareDeep(party, o.party, true)
313          ;
314      }
315
316      @Override
317      public boolean equalsShallow(Base other_) {
318        if (!super.equalsShallow(other_))
319          return false;
320        if (!(other_ instanceof DocumentReferenceAttesterComponent))
321          return false;
322        DocumentReferenceAttesterComponent o = (DocumentReferenceAttesterComponent) other_;
323        return compareValues(time, o.time, true);
324      }
325
326      public boolean isEmpty() {
327        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mode, time, party);
328      }
329
330  public String fhirType() {
331    return "DocumentReference.attester";
332
333  }
334
335  }
336
337    @Block()
338    public static class DocumentReferenceRelatesToComponent extends BackboneElement implements IBaseBackboneElement {
339        /**
340         * The type of relationship that this document has with anther document.
341         */
342        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
343        @Description(shortDefinition="The relationship type with another document", formalDefinition="The type of relationship that this document has with anther document." )
344        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/document-relationship-type")
345        protected CodeableConcept code;
346
347        /**
348         * The target document of this relationship.
349         */
350        @Child(name = "target", type = {DocumentReference.class}, order=2, min=1, max=1, modifier=false, summary=true)
351        @Description(shortDefinition="Target of the relationship", formalDefinition="The target document of this relationship." )
352        protected Reference target;
353
354        private static final long serialVersionUID = -372012026L;
355
356    /**
357     * Constructor
358     */
359      public DocumentReferenceRelatesToComponent() {
360        super();
361      }
362
363    /**
364     * Constructor
365     */
366      public DocumentReferenceRelatesToComponent(CodeableConcept code, Reference target) {
367        super();
368        this.setCode(code);
369        this.setTarget(target);
370      }
371
372        /**
373         * @return {@link #code} (The type of relationship that this document has with anther document.)
374         */
375        public CodeableConcept getCode() { 
376          if (this.code == null)
377            if (Configuration.errorOnAutoCreate())
378              throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.code");
379            else if (Configuration.doAutoCreate())
380              this.code = new CodeableConcept(); // cc
381          return this.code;
382        }
383
384        public boolean hasCode() { 
385          return this.code != null && !this.code.isEmpty();
386        }
387
388        /**
389         * @param value {@link #code} (The type of relationship that this document has with anther document.)
390         */
391        public DocumentReferenceRelatesToComponent setCode(CodeableConcept value) { 
392          this.code = value;
393          return this;
394        }
395
396        /**
397         * @return {@link #target} (The target document of this relationship.)
398         */
399        public Reference getTarget() { 
400          if (this.target == null)
401            if (Configuration.errorOnAutoCreate())
402              throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.target");
403            else if (Configuration.doAutoCreate())
404              this.target = new Reference(); // cc
405          return this.target;
406        }
407
408        public boolean hasTarget() { 
409          return this.target != null && !this.target.isEmpty();
410        }
411
412        /**
413         * @param value {@link #target} (The target document of this relationship.)
414         */
415        public DocumentReferenceRelatesToComponent setTarget(Reference value) { 
416          this.target = value;
417          return this;
418        }
419
420        protected void listChildren(List<Property> children) {
421          super.listChildren(children);
422          children.add(new Property("code", "CodeableConcept", "The type of relationship that this document has with anther document.", 0, 1, code));
423          children.add(new Property("target", "Reference(DocumentReference)", "The target document of this relationship.", 0, 1, target));
424        }
425
426        @Override
427        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
428          switch (_hash) {
429          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The type of relationship that this document has with anther document.", 0, 1, code);
430          case -880905839: /*target*/  return new Property("target", "Reference(DocumentReference)", "The target document of this relationship.", 0, 1, target);
431          default: return super.getNamedProperty(_hash, _name, _checkValid);
432          }
433
434        }
435
436      @Override
437      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
438        switch (hash) {
439        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
440        case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference
441        default: return super.getProperty(hash, name, checkValid);
442        }
443
444      }
445
446      @Override
447      public Base setProperty(int hash, String name, Base value) throws FHIRException {
448        switch (hash) {
449        case 3059181: // code
450          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
451          return value;
452        case -880905839: // target
453          this.target = TypeConvertor.castToReference(value); // Reference
454          return value;
455        default: return super.setProperty(hash, name, value);
456        }
457
458      }
459
460      @Override
461      public Base setProperty(String name, Base value) throws FHIRException {
462        if (name.equals("code")) {
463          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
464        } else if (name.equals("target")) {
465          this.target = TypeConvertor.castToReference(value); // Reference
466        } else
467          return super.setProperty(name, value);
468        return value;
469      }
470
471      @Override
472      public Base makeProperty(int hash, String name) throws FHIRException {
473        switch (hash) {
474        case 3059181:  return getCode();
475        case -880905839:  return getTarget();
476        default: return super.makeProperty(hash, name);
477        }
478
479      }
480
481      @Override
482      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
483        switch (hash) {
484        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
485        case -880905839: /*target*/ return new String[] {"Reference"};
486        default: return super.getTypesForProperty(hash, name);
487        }
488
489      }
490
491      @Override
492      public Base addChild(String name) throws FHIRException {
493        if (name.equals("code")) {
494          this.code = new CodeableConcept();
495          return this.code;
496        }
497        else if (name.equals("target")) {
498          this.target = new Reference();
499          return this.target;
500        }
501        else
502          return super.addChild(name);
503      }
504
505      public DocumentReferenceRelatesToComponent copy() {
506        DocumentReferenceRelatesToComponent dst = new DocumentReferenceRelatesToComponent();
507        copyValues(dst);
508        return dst;
509      }
510
511      public void copyValues(DocumentReferenceRelatesToComponent dst) {
512        super.copyValues(dst);
513        dst.code = code == null ? null : code.copy();
514        dst.target = target == null ? null : target.copy();
515      }
516
517      @Override
518      public boolean equalsDeep(Base other_) {
519        if (!super.equalsDeep(other_))
520          return false;
521        if (!(other_ instanceof DocumentReferenceRelatesToComponent))
522          return false;
523        DocumentReferenceRelatesToComponent o = (DocumentReferenceRelatesToComponent) other_;
524        return compareDeep(code, o.code, true) && compareDeep(target, o.target, true);
525      }
526
527      @Override
528      public boolean equalsShallow(Base other_) {
529        if (!super.equalsShallow(other_))
530          return false;
531        if (!(other_ instanceof DocumentReferenceRelatesToComponent))
532          return false;
533        DocumentReferenceRelatesToComponent o = (DocumentReferenceRelatesToComponent) other_;
534        return true;
535      }
536
537      public boolean isEmpty() {
538        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, target);
539      }
540
541  public String fhirType() {
542    return "DocumentReference.relatesTo";
543
544  }
545
546  }
547
548    @Block()
549    public static class DocumentReferenceContentComponent extends BackboneElement implements IBaseBackboneElement {
550        /**
551         * The document or URL of the document along with critical metadata to prove content has integrity.
552         */
553        @Child(name = "attachment", type = {Attachment.class}, order=1, min=1, max=1, modifier=false, summary=true)
554        @Description(shortDefinition="Where to access the document", formalDefinition="The document or URL of the document along with critical metadata to prove content has integrity." )
555        protected Attachment attachment;
556
557        /**
558         * An identifier of the document constraints, encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.
559         */
560        @Child(name = "profile", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
561        @Description(shortDefinition="Content profile rules for the document", formalDefinition="An identifier of the document constraints, encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType." )
562        protected List<DocumentReferenceContentProfileComponent> profile;
563
564        private static final long serialVersionUID = 174089424L;
565
566    /**
567     * Constructor
568     */
569      public DocumentReferenceContentComponent() {
570        super();
571      }
572
573    /**
574     * Constructor
575     */
576      public DocumentReferenceContentComponent(Attachment attachment) {
577        super();
578        this.setAttachment(attachment);
579      }
580
581        /**
582         * @return {@link #attachment} (The document or URL of the document along with critical metadata to prove content has integrity.)
583         */
584        public Attachment getAttachment() { 
585          if (this.attachment == null)
586            if (Configuration.errorOnAutoCreate())
587              throw new Error("Attempt to auto-create DocumentReferenceContentComponent.attachment");
588            else if (Configuration.doAutoCreate())
589              this.attachment = new Attachment(); // cc
590          return this.attachment;
591        }
592
593        public boolean hasAttachment() { 
594          return this.attachment != null && !this.attachment.isEmpty();
595        }
596
597        /**
598         * @param value {@link #attachment} (The document or URL of the document along with critical metadata to prove content has integrity.)
599         */
600        public DocumentReferenceContentComponent setAttachment(Attachment value) { 
601          this.attachment = value;
602          return this;
603        }
604
605        /**
606         * @return {@link #profile} (An identifier of the document constraints, encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.)
607         */
608        public List<DocumentReferenceContentProfileComponent> getProfile() { 
609          if (this.profile == null)
610            this.profile = new ArrayList<DocumentReferenceContentProfileComponent>();
611          return this.profile;
612        }
613
614        /**
615         * @return Returns a reference to <code>this</code> for easy method chaining
616         */
617        public DocumentReferenceContentComponent setProfile(List<DocumentReferenceContentProfileComponent> theProfile) { 
618          this.profile = theProfile;
619          return this;
620        }
621
622        public boolean hasProfile() { 
623          if (this.profile == null)
624            return false;
625          for (DocumentReferenceContentProfileComponent item : this.profile)
626            if (!item.isEmpty())
627              return true;
628          return false;
629        }
630
631        public DocumentReferenceContentProfileComponent addProfile() { //3
632          DocumentReferenceContentProfileComponent t = new DocumentReferenceContentProfileComponent();
633          if (this.profile == null)
634            this.profile = new ArrayList<DocumentReferenceContentProfileComponent>();
635          this.profile.add(t);
636          return t;
637        }
638
639        public DocumentReferenceContentComponent addProfile(DocumentReferenceContentProfileComponent t) { //3
640          if (t == null)
641            return this;
642          if (this.profile == null)
643            this.profile = new ArrayList<DocumentReferenceContentProfileComponent>();
644          this.profile.add(t);
645          return this;
646        }
647
648        /**
649         * @return The first repetition of repeating field {@link #profile}, creating it if it does not already exist {3}
650         */
651        public DocumentReferenceContentProfileComponent getProfileFirstRep() { 
652          if (getProfile().isEmpty()) {
653            addProfile();
654          }
655          return getProfile().get(0);
656        }
657
658        protected void listChildren(List<Property> children) {
659          super.listChildren(children);
660          children.add(new Property("attachment", "Attachment", "The document or URL of the document along with critical metadata to prove content has integrity.", 0, 1, attachment));
661          children.add(new Property("profile", "", "An identifier of the document constraints, encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.", 0, java.lang.Integer.MAX_VALUE, profile));
662        }
663
664        @Override
665        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
666          switch (_hash) {
667          case -1963501277: /*attachment*/  return new Property("attachment", "Attachment", "The document or URL of the document along with critical metadata to prove content has integrity.", 0, 1, attachment);
668          case -309425751: /*profile*/  return new Property("profile", "", "An identifier of the document constraints, encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.", 0, java.lang.Integer.MAX_VALUE, profile);
669          default: return super.getNamedProperty(_hash, _name, _checkValid);
670          }
671
672        }
673
674      @Override
675      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
676        switch (hash) {
677        case -1963501277: /*attachment*/ return this.attachment == null ? new Base[0] : new Base[] {this.attachment}; // Attachment
678        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // DocumentReferenceContentProfileComponent
679        default: return super.getProperty(hash, name, checkValid);
680        }
681
682      }
683
684      @Override
685      public Base setProperty(int hash, String name, Base value) throws FHIRException {
686        switch (hash) {
687        case -1963501277: // attachment
688          this.attachment = TypeConvertor.castToAttachment(value); // Attachment
689          return value;
690        case -309425751: // profile
691          this.getProfile().add((DocumentReferenceContentProfileComponent) value); // DocumentReferenceContentProfileComponent
692          return value;
693        default: return super.setProperty(hash, name, value);
694        }
695
696      }
697
698      @Override
699      public Base setProperty(String name, Base value) throws FHIRException {
700        if (name.equals("attachment")) {
701          this.attachment = TypeConvertor.castToAttachment(value); // Attachment
702        } else if (name.equals("profile")) {
703          this.getProfile().add((DocumentReferenceContentProfileComponent) value);
704        } else
705          return super.setProperty(name, value);
706        return value;
707      }
708
709      @Override
710      public Base makeProperty(int hash, String name) throws FHIRException {
711        switch (hash) {
712        case -1963501277:  return getAttachment();
713        case -309425751:  return addProfile(); 
714        default: return super.makeProperty(hash, name);
715        }
716
717      }
718
719      @Override
720      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
721        switch (hash) {
722        case -1963501277: /*attachment*/ return new String[] {"Attachment"};
723        case -309425751: /*profile*/ return new String[] {};
724        default: return super.getTypesForProperty(hash, name);
725        }
726
727      }
728
729      @Override
730      public Base addChild(String name) throws FHIRException {
731        if (name.equals("attachment")) {
732          this.attachment = new Attachment();
733          return this.attachment;
734        }
735        else if (name.equals("profile")) {
736          return addProfile();
737        }
738        else
739          return super.addChild(name);
740      }
741
742      public DocumentReferenceContentComponent copy() {
743        DocumentReferenceContentComponent dst = new DocumentReferenceContentComponent();
744        copyValues(dst);
745        return dst;
746      }
747
748      public void copyValues(DocumentReferenceContentComponent dst) {
749        super.copyValues(dst);
750        dst.attachment = attachment == null ? null : attachment.copy();
751        if (profile != null) {
752          dst.profile = new ArrayList<DocumentReferenceContentProfileComponent>();
753          for (DocumentReferenceContentProfileComponent i : profile)
754            dst.profile.add(i.copy());
755        };
756      }
757
758      @Override
759      public boolean equalsDeep(Base other_) {
760        if (!super.equalsDeep(other_))
761          return false;
762        if (!(other_ instanceof DocumentReferenceContentComponent))
763          return false;
764        DocumentReferenceContentComponent o = (DocumentReferenceContentComponent) other_;
765        return compareDeep(attachment, o.attachment, true) && compareDeep(profile, o.profile, true);
766      }
767
768      @Override
769      public boolean equalsShallow(Base other_) {
770        if (!super.equalsShallow(other_))
771          return false;
772        if (!(other_ instanceof DocumentReferenceContentComponent))
773          return false;
774        DocumentReferenceContentComponent o = (DocumentReferenceContentComponent) other_;
775        return true;
776      }
777
778      public boolean isEmpty() {
779        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(attachment, profile);
780      }
781
782  public String fhirType() {
783    return "DocumentReference.content";
784
785  }
786
787  }
788
789    @Block()
790    public static class DocumentReferenceContentProfileComponent extends BackboneElement implements IBaseBackboneElement {
791        /**
792         * Code|uri|canonical.
793         */
794        @Child(name = "value", type = {Coding.class, UriType.class, CanonicalType.class}, order=1, min=1, max=1, modifier=false, summary=true)
795        @Description(shortDefinition="Code|uri|canonical", formalDefinition="Code|uri|canonical." )
796        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-HL7FormatCodes")
797        protected DataType value;
798
799        private static final long serialVersionUID = -1135414639L;
800
801    /**
802     * Constructor
803     */
804      public DocumentReferenceContentProfileComponent() {
805        super();
806      }
807
808    /**
809     * Constructor
810     */
811      public DocumentReferenceContentProfileComponent(DataType value) {
812        super();
813        this.setValue(value);
814      }
815
816        /**
817         * @return {@link #value} (Code|uri|canonical.)
818         */
819        public DataType getValue() { 
820          return this.value;
821        }
822
823        /**
824         * @return {@link #value} (Code|uri|canonical.)
825         */
826        public Coding getValueCoding() throws FHIRException { 
827          if (this.value == null)
828            this.value = new Coding();
829          if (!(this.value instanceof Coding))
830            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered");
831          return (Coding) this.value;
832        }
833
834        public boolean hasValueCoding() { 
835          return this != null && this.value instanceof Coding;
836        }
837
838        /**
839         * @return {@link #value} (Code|uri|canonical.)
840         */
841        public UriType getValueUriType() throws FHIRException { 
842          if (this.value == null)
843            this.value = new UriType();
844          if (!(this.value instanceof UriType))
845            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered");
846          return (UriType) this.value;
847        }
848
849        public boolean hasValueUriType() { 
850          return this != null && this.value instanceof UriType;
851        }
852
853        /**
854         * @return {@link #value} (Code|uri|canonical.)
855         */
856        public CanonicalType getValueCanonicalType() throws FHIRException { 
857          if (this.value == null)
858            this.value = new CanonicalType();
859          if (!(this.value instanceof CanonicalType))
860            throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.value.getClass().getName()+" was encountered");
861          return (CanonicalType) this.value;
862        }
863
864        public boolean hasValueCanonicalType() { 
865          return this != null && this.value instanceof CanonicalType;
866        }
867
868        public boolean hasValue() { 
869          return this.value != null && !this.value.isEmpty();
870        }
871
872        /**
873         * @param value {@link #value} (Code|uri|canonical.)
874         */
875        public DocumentReferenceContentProfileComponent setValue(DataType value) { 
876          if (value != null && !(value instanceof Coding || value instanceof UriType || value instanceof CanonicalType))
877            throw new Error("Not the right type for DocumentReference.content.profile.value[x]: "+value.fhirType());
878          this.value = value;
879          return this;
880        }
881
882        protected void listChildren(List<Property> children) {
883          super.listChildren(children);
884          children.add(new Property("value[x]", "Coding|uri|canonical", "Code|uri|canonical.", 0, 1, value));
885        }
886
887        @Override
888        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
889          switch (_hash) {
890          case -1410166417: /*value[x]*/  return new Property("value[x]", "Coding|uri|canonical", "Code|uri|canonical.", 0, 1, value);
891          case 111972721: /*value*/  return new Property("value[x]", "Coding|uri|canonical", "Code|uri|canonical.", 0, 1, value);
892          case -1887705029: /*valueCoding*/  return new Property("value[x]", "Coding", "Code|uri|canonical.", 0, 1, value);
893          case -1410172357: /*valueUri*/  return new Property("value[x]", "uri", "Code|uri|canonical.", 0, 1, value);
894          case -786218365: /*valueCanonical*/  return new Property("value[x]", "canonical", "Code|uri|canonical.", 0, 1, value);
895          default: return super.getNamedProperty(_hash, _name, _checkValid);
896          }
897
898        }
899
900      @Override
901      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
902        switch (hash) {
903        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
904        default: return super.getProperty(hash, name, checkValid);
905        }
906
907      }
908
909      @Override
910      public Base setProperty(int hash, String name, Base value) throws FHIRException {
911        switch (hash) {
912        case 111972721: // value
913          this.value = TypeConvertor.castToType(value); // DataType
914          return value;
915        default: return super.setProperty(hash, name, value);
916        }
917
918      }
919
920      @Override
921      public Base setProperty(String name, Base value) throws FHIRException {
922        if (name.equals("value[x]")) {
923          this.value = TypeConvertor.castToType(value); // DataType
924        } else
925          return super.setProperty(name, value);
926        return value;
927      }
928
929      @Override
930      public Base makeProperty(int hash, String name) throws FHIRException {
931        switch (hash) {
932        case -1410166417:  return getValue();
933        case 111972721:  return getValue();
934        default: return super.makeProperty(hash, name);
935        }
936
937      }
938
939      @Override
940      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
941        switch (hash) {
942        case 111972721: /*value*/ return new String[] {"Coding", "uri", "canonical"};
943        default: return super.getTypesForProperty(hash, name);
944        }
945
946      }
947
948      @Override
949      public Base addChild(String name) throws FHIRException {
950        if (name.equals("valueCoding")) {
951          this.value = new Coding();
952          return this.value;
953        }
954        else if (name.equals("valueUri")) {
955          this.value = new UriType();
956          return this.value;
957        }
958        else if (name.equals("valueCanonical")) {
959          this.value = new CanonicalType();
960          return this.value;
961        }
962        else
963          return super.addChild(name);
964      }
965
966      public DocumentReferenceContentProfileComponent copy() {
967        DocumentReferenceContentProfileComponent dst = new DocumentReferenceContentProfileComponent();
968        copyValues(dst);
969        return dst;
970      }
971
972      public void copyValues(DocumentReferenceContentProfileComponent dst) {
973        super.copyValues(dst);
974        dst.value = value == null ? null : value.copy();
975      }
976
977      @Override
978      public boolean equalsDeep(Base other_) {
979        if (!super.equalsDeep(other_))
980          return false;
981        if (!(other_ instanceof DocumentReferenceContentProfileComponent))
982          return false;
983        DocumentReferenceContentProfileComponent o = (DocumentReferenceContentProfileComponent) other_;
984        return compareDeep(value, o.value, true);
985      }
986
987      @Override
988      public boolean equalsShallow(Base other_) {
989        if (!super.equalsShallow(other_))
990          return false;
991        if (!(other_ instanceof DocumentReferenceContentProfileComponent))
992          return false;
993        DocumentReferenceContentProfileComponent o = (DocumentReferenceContentProfileComponent) other_;
994        return true;
995      }
996
997      public boolean isEmpty() {
998        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value);
999      }
1000
1001  public String fhirType() {
1002    return "DocumentReference.content.profile";
1003
1004  }
1005
1006  }
1007
1008    /**
1009     * Other business identifiers associated with the document, including version independent identifiers.
1010     */
1011    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1012    @Description(shortDefinition="Business identifiers for the document", formalDefinition="Other business identifiers associated with the document, including version independent identifiers." )
1013    protected List<Identifier> identifier;
1014
1015    /**
1016     * A procedure that is fulfilled in whole or in part by the creation of this media.
1017     */
1018    @Child(name = "basedOn", type = {Appointment.class, AppointmentResponse.class, CarePlan.class, Claim.class, CommunicationRequest.class, Contract.class, CoverageEligibilityRequest.class, DeviceRequest.class, EnrollmentRequest.class, EpisodeOfCare.class, ImmunizationRecommendation.class, MedicationRequest.class, NutritionOrder.class, RequestOrchestration.class, ServiceRequest.class, SupplyRequest.class, VisionPrescription.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1019    @Description(shortDefinition="Procedure that caused this media to be created", formalDefinition="A procedure that is fulfilled in whole or in part by the creation of this media." )
1020    protected List<Reference> basedOn;
1021
1022    /**
1023     * The status of this document reference.
1024     */
1025    @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true)
1026    @Description(shortDefinition="current | superseded | entered-in-error", formalDefinition="The status of this document reference." )
1027    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/document-reference-status")
1028    protected Enumeration<DocumentReferenceStatus> status;
1029
1030    /**
1031     * The status of the underlying document.
1032     */
1033    @Child(name = "docStatus", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1034    @Description(shortDefinition="registered | partial | preliminary | final | amended | corrected | appended | cancelled | entered-in-error | deprecated | unknown", formalDefinition="The status of the underlying document." )
1035    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/composition-status")
1036    protected Enumeration<CompositionStatus> docStatus;
1037
1038    /**
1039     * Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.
1040     */
1041    @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
1042    @Description(shortDefinition="Kind of document (LOINC if possible)", formalDefinition="Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced." )
1043    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/doc-typecodes")
1044    protected CodeableConcept type;
1045
1046    /**
1047     * A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.
1048     */
1049    @Child(name = "category", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1050    @Description(shortDefinition="Categorization of document", formalDefinition="A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type." )
1051    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/referenced-item-category")
1052    protected List<CodeableConcept> category;
1053
1054    /**
1055     * Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).
1056     */
1057    @Child(name = "subject", type = {Reference.class}, order=6, min=0, max=1, modifier=false, summary=true)
1058    @Description(shortDefinition="Who/what is the subject of the document", formalDefinition="Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)." )
1059    protected Reference subject;
1060
1061    /**
1062     * Describes the clinical encounter or type of care that the document content is associated with.
1063     */
1064    @Child(name = "context", type = {Appointment.class, Encounter.class, EpisodeOfCare.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1065    @Description(shortDefinition="Context of the document content", formalDefinition="Describes the clinical encounter or type of care that the document content is associated with." )
1066    protected List<Reference> context;
1067
1068    /**
1069     * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the type Code, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.
1070     */
1071    @Child(name = "event", type = {CodeableReference.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1072    @Description(shortDefinition="Main clinical acts documented", formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the type Code, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act." )
1073    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-ActCode")
1074    protected List<CodeableReference> event;
1075
1076    /**
1077     * The kind of facility where the patient was seen.
1078     */
1079    @Child(name = "facilityType", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false)
1080    @Description(shortDefinition="Kind of facility where patient was seen", formalDefinition="The kind of facility where the patient was seen." )
1081    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/c80-facilitycodes")
1082    protected CodeableConcept facilityType;
1083
1084    /**
1085     * This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.
1086     */
1087    @Child(name = "practiceSetting", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=false)
1088    @Description(shortDefinition="Additional details about where the content was created (e.g. clinical specialty)", formalDefinition="This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty." )
1089    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/c80-practice-codes")
1090    protected CodeableConcept practiceSetting;
1091
1092    /**
1093     * The time period over which the service that is described by the document was provided.
1094     */
1095    @Child(name = "period", type = {Period.class}, order=11, min=0, max=1, modifier=false, summary=true)
1096    @Description(shortDefinition="Time of service that is being documented", formalDefinition="The time period over which the service that is described by the document was provided." )
1097    protected Period period;
1098
1099    /**
1100     * When the document reference was created.
1101     */
1102    @Child(name = "date", type = {InstantType.class}, order=12, min=0, max=1, modifier=false, summary=true)
1103    @Description(shortDefinition="When this document reference was created", formalDefinition="When the document reference was created." )
1104    protected InstantType date;
1105
1106    /**
1107     * Identifies who is responsible for adding the information to the document.
1108     */
1109    @Child(name = "author", type = {Practitioner.class, PractitionerRole.class, Organization.class, Device.class, Patient.class, RelatedPerson.class, CareTeam.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1110    @Description(shortDefinition="Who and/or what authored the document", formalDefinition="Identifies who is responsible for adding the information to the document." )
1111    protected List<Reference> author;
1112
1113    /**
1114     * A participant who has authenticated the accuracy of the document.
1115     */
1116    @Child(name = "attester", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1117    @Description(shortDefinition="Attests to accuracy of the document", formalDefinition="A participant who has authenticated the accuracy of the document." )
1118    protected List<DocumentReferenceAttesterComponent> attester;
1119
1120    /**
1121     * Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.
1122     */
1123    @Child(name = "custodian", type = {Organization.class}, order=15, min=0, max=1, modifier=false, summary=false)
1124    @Description(shortDefinition="Organization which maintains the document", formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the document." )
1125    protected Reference custodian;
1126
1127    /**
1128     * Relationships that this document has with other document references that already exist.
1129     */
1130    @Child(name = "relatesTo", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1131    @Description(shortDefinition="Relationships to other documents", formalDefinition="Relationships that this document has with other document references that already exist." )
1132    protected List<DocumentReferenceRelatesToComponent> relatesTo;
1133
1134    /**
1135     * Human-readable description of the source document.
1136     */
1137    @Child(name = "description", type = {MarkdownType.class}, order=17, min=0, max=1, modifier=false, summary=true)
1138    @Description(shortDefinition="Human-readable description", formalDefinition="Human-readable description of the source document." )
1139    protected MarkdownType description;
1140
1141    /**
1142     * A set of Security-Tag codes specifying the level of privacy/security of the Document found at DocumentReference.content.attachment.url. Note that DocumentReference.meta.security contains the security labels of the data elements in DocumentReference, while DocumentReference.securityLabel contains the security labels for the document the reference refers to. The distinction recognizes that the document may contain sensitive information, while the DocumentReference is metadata about the document and thus might not be as sensitive as the document. For example: a psychotherapy episode may contain highly sensitive information, while the metadata may simply indicate that some episode happened.
1143     */
1144    @Child(name = "securityLabel", type = {CodeableConcept.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1145    @Description(shortDefinition="Document security-tags", formalDefinition="A set of Security-Tag codes specifying the level of privacy/security of the Document found at DocumentReference.content.attachment.url. Note that DocumentReference.meta.security contains the security labels of the data elements in DocumentReference, while DocumentReference.securityLabel contains the security labels for the document the reference refers to. The distinction recognizes that the document may contain sensitive information, while the DocumentReference is metadata about the document and thus might not be as sensitive as the document. For example: a psychotherapy episode may contain highly sensitive information, while the metadata may simply indicate that some episode happened." )
1146    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/security-label-examples")
1147    protected List<CodeableConcept> securityLabel;
1148
1149    /**
1150     * The document and format referenced.  If there are multiple content element repetitions, these must all represent the same document in different format, or attachment metadata.
1151     */
1152    @Child(name = "content", type = {}, order=19, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1153    @Description(shortDefinition="Document referenced", formalDefinition="The document and format referenced.  If there are multiple content element repetitions, these must all represent the same document in different format, or attachment metadata." )
1154    protected List<DocumentReferenceContentComponent> content;
1155
1156    private static final long serialVersionUID = -1268760339L;
1157
1158  /**
1159   * Constructor
1160   */
1161    public DocumentReference() {
1162      super();
1163    }
1164
1165  /**
1166   * Constructor
1167   */
1168    public DocumentReference(DocumentReferenceStatus status, DocumentReferenceContentComponent content) {
1169      super();
1170      this.setStatus(status);
1171      this.addContent(content);
1172    }
1173
1174    /**
1175     * @return {@link #identifier} (Other business identifiers associated with the document, including version independent identifiers.)
1176     */
1177    public List<Identifier> getIdentifier() { 
1178      if (this.identifier == null)
1179        this.identifier = new ArrayList<Identifier>();
1180      return this.identifier;
1181    }
1182
1183    /**
1184     * @return Returns a reference to <code>this</code> for easy method chaining
1185     */
1186    public DocumentReference setIdentifier(List<Identifier> theIdentifier) { 
1187      this.identifier = theIdentifier;
1188      return this;
1189    }
1190
1191    public boolean hasIdentifier() { 
1192      if (this.identifier == null)
1193        return false;
1194      for (Identifier item : this.identifier)
1195        if (!item.isEmpty())
1196          return true;
1197      return false;
1198    }
1199
1200    public Identifier addIdentifier() { //3
1201      Identifier t = new Identifier();
1202      if (this.identifier == null)
1203        this.identifier = new ArrayList<Identifier>();
1204      this.identifier.add(t);
1205      return t;
1206    }
1207
1208    public DocumentReference addIdentifier(Identifier t) { //3
1209      if (t == null)
1210        return this;
1211      if (this.identifier == null)
1212        this.identifier = new ArrayList<Identifier>();
1213      this.identifier.add(t);
1214      return this;
1215    }
1216
1217    /**
1218     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1219     */
1220    public Identifier getIdentifierFirstRep() { 
1221      if (getIdentifier().isEmpty()) {
1222        addIdentifier();
1223      }
1224      return getIdentifier().get(0);
1225    }
1226
1227    /**
1228     * @return {@link #basedOn} (A procedure that is fulfilled in whole or in part by the creation of this media.)
1229     */
1230    public List<Reference> getBasedOn() { 
1231      if (this.basedOn == null)
1232        this.basedOn = new ArrayList<Reference>();
1233      return this.basedOn;
1234    }
1235
1236    /**
1237     * @return Returns a reference to <code>this</code> for easy method chaining
1238     */
1239    public DocumentReference setBasedOn(List<Reference> theBasedOn) { 
1240      this.basedOn = theBasedOn;
1241      return this;
1242    }
1243
1244    public boolean hasBasedOn() { 
1245      if (this.basedOn == null)
1246        return false;
1247      for (Reference item : this.basedOn)
1248        if (!item.isEmpty())
1249          return true;
1250      return false;
1251    }
1252
1253    public Reference addBasedOn() { //3
1254      Reference t = new Reference();
1255      if (this.basedOn == null)
1256        this.basedOn = new ArrayList<Reference>();
1257      this.basedOn.add(t);
1258      return t;
1259    }
1260
1261    public DocumentReference addBasedOn(Reference t) { //3
1262      if (t == null)
1263        return this;
1264      if (this.basedOn == null)
1265        this.basedOn = new ArrayList<Reference>();
1266      this.basedOn.add(t);
1267      return this;
1268    }
1269
1270    /**
1271     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
1272     */
1273    public Reference getBasedOnFirstRep() { 
1274      if (getBasedOn().isEmpty()) {
1275        addBasedOn();
1276      }
1277      return getBasedOn().get(0);
1278    }
1279
1280    /**
1281     * @return {@link #status} (The status of this document reference.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1282     */
1283    public Enumeration<DocumentReferenceStatus> getStatusElement() { 
1284      if (this.status == null)
1285        if (Configuration.errorOnAutoCreate())
1286          throw new Error("Attempt to auto-create DocumentReference.status");
1287        else if (Configuration.doAutoCreate())
1288          this.status = new Enumeration<DocumentReferenceStatus>(new DocumentReferenceStatusEnumFactory()); // bb
1289      return this.status;
1290    }
1291
1292    public boolean hasStatusElement() { 
1293      return this.status != null && !this.status.isEmpty();
1294    }
1295
1296    public boolean hasStatus() { 
1297      return this.status != null && !this.status.isEmpty();
1298    }
1299
1300    /**
1301     * @param value {@link #status} (The status of this document reference.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1302     */
1303    public DocumentReference setStatusElement(Enumeration<DocumentReferenceStatus> value) { 
1304      this.status = value;
1305      return this;
1306    }
1307
1308    /**
1309     * @return The status of this document reference.
1310     */
1311    public DocumentReferenceStatus getStatus() { 
1312      return this.status == null ? null : this.status.getValue();
1313    }
1314
1315    /**
1316     * @param value The status of this document reference.
1317     */
1318    public DocumentReference setStatus(DocumentReferenceStatus value) { 
1319        if (this.status == null)
1320          this.status = new Enumeration<DocumentReferenceStatus>(new DocumentReferenceStatusEnumFactory());
1321        this.status.setValue(value);
1322      return this;
1323    }
1324
1325    /**
1326     * @return {@link #docStatus} (The status of the underlying document.). This is the underlying object with id, value and extensions. The accessor "getDocStatus" gives direct access to the value
1327     */
1328    public Enumeration<CompositionStatus> getDocStatusElement() { 
1329      if (this.docStatus == null)
1330        if (Configuration.errorOnAutoCreate())
1331          throw new Error("Attempt to auto-create DocumentReference.docStatus");
1332        else if (Configuration.doAutoCreate())
1333          this.docStatus = new Enumeration<CompositionStatus>(new CompositionStatusEnumFactory()); // bb
1334      return this.docStatus;
1335    }
1336
1337    public boolean hasDocStatusElement() { 
1338      return this.docStatus != null && !this.docStatus.isEmpty();
1339    }
1340
1341    public boolean hasDocStatus() { 
1342      return this.docStatus != null && !this.docStatus.isEmpty();
1343    }
1344
1345    /**
1346     * @param value {@link #docStatus} (The status of the underlying document.). This is the underlying object with id, value and extensions. The accessor "getDocStatus" gives direct access to the value
1347     */
1348    public DocumentReference setDocStatusElement(Enumeration<CompositionStatus> value) { 
1349      this.docStatus = value;
1350      return this;
1351    }
1352
1353    /**
1354     * @return The status of the underlying document.
1355     */
1356    public CompositionStatus getDocStatus() { 
1357      return this.docStatus == null ? null : this.docStatus.getValue();
1358    }
1359
1360    /**
1361     * @param value The status of the underlying document.
1362     */
1363    public DocumentReference setDocStatus(CompositionStatus value) { 
1364      if (value == null)
1365        this.docStatus = null;
1366      else {
1367        if (this.docStatus == null)
1368          this.docStatus = new Enumeration<CompositionStatus>(new CompositionStatusEnumFactory());
1369        this.docStatus.setValue(value);
1370      }
1371      return this;
1372    }
1373
1374    /**
1375     * @return {@link #type} (Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.)
1376     */
1377    public CodeableConcept getType() { 
1378      if (this.type == null)
1379        if (Configuration.errorOnAutoCreate())
1380          throw new Error("Attempt to auto-create DocumentReference.type");
1381        else if (Configuration.doAutoCreate())
1382          this.type = new CodeableConcept(); // cc
1383      return this.type;
1384    }
1385
1386    public boolean hasType() { 
1387      return this.type != null && !this.type.isEmpty();
1388    }
1389
1390    /**
1391     * @param value {@link #type} (Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.)
1392     */
1393    public DocumentReference setType(CodeableConcept value) { 
1394      this.type = value;
1395      return this;
1396    }
1397
1398    /**
1399     * @return {@link #category} (A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.)
1400     */
1401    public List<CodeableConcept> getCategory() { 
1402      if (this.category == null)
1403        this.category = new ArrayList<CodeableConcept>();
1404      return this.category;
1405    }
1406
1407    /**
1408     * @return Returns a reference to <code>this</code> for easy method chaining
1409     */
1410    public DocumentReference setCategory(List<CodeableConcept> theCategory) { 
1411      this.category = theCategory;
1412      return this;
1413    }
1414
1415    public boolean hasCategory() { 
1416      if (this.category == null)
1417        return false;
1418      for (CodeableConcept item : this.category)
1419        if (!item.isEmpty())
1420          return true;
1421      return false;
1422    }
1423
1424    public CodeableConcept addCategory() { //3
1425      CodeableConcept t = new CodeableConcept();
1426      if (this.category == null)
1427        this.category = new ArrayList<CodeableConcept>();
1428      this.category.add(t);
1429      return t;
1430    }
1431
1432    public DocumentReference addCategory(CodeableConcept t) { //3
1433      if (t == null)
1434        return this;
1435      if (this.category == null)
1436        this.category = new ArrayList<CodeableConcept>();
1437      this.category.add(t);
1438      return this;
1439    }
1440
1441    /**
1442     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
1443     */
1444    public CodeableConcept getCategoryFirstRep() { 
1445      if (getCategory().isEmpty()) {
1446        addCategory();
1447      }
1448      return getCategory().get(0);
1449    }
1450
1451    /**
1452     * @return {@link #subject} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).)
1453     */
1454    public Reference getSubject() { 
1455      if (this.subject == null)
1456        if (Configuration.errorOnAutoCreate())
1457          throw new Error("Attempt to auto-create DocumentReference.subject");
1458        else if (Configuration.doAutoCreate())
1459          this.subject = new Reference(); // cc
1460      return this.subject;
1461    }
1462
1463    public boolean hasSubject() { 
1464      return this.subject != null && !this.subject.isEmpty();
1465    }
1466
1467    /**
1468     * @param value {@link #subject} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).)
1469     */
1470    public DocumentReference setSubject(Reference value) { 
1471      this.subject = value;
1472      return this;
1473    }
1474
1475    /**
1476     * @return {@link #context} (Describes the clinical encounter or type of care that the document content is associated with.)
1477     */
1478    public List<Reference> getContext() { 
1479      if (this.context == null)
1480        this.context = new ArrayList<Reference>();
1481      return this.context;
1482    }
1483
1484    /**
1485     * @return Returns a reference to <code>this</code> for easy method chaining
1486     */
1487    public DocumentReference setContext(List<Reference> theContext) { 
1488      this.context = theContext;
1489      return this;
1490    }
1491
1492    public boolean hasContext() { 
1493      if (this.context == null)
1494        return false;
1495      for (Reference item : this.context)
1496        if (!item.isEmpty())
1497          return true;
1498      return false;
1499    }
1500
1501    public Reference addContext() { //3
1502      Reference t = new Reference();
1503      if (this.context == null)
1504        this.context = new ArrayList<Reference>();
1505      this.context.add(t);
1506      return t;
1507    }
1508
1509    public DocumentReference addContext(Reference t) { //3
1510      if (t == null)
1511        return this;
1512      if (this.context == null)
1513        this.context = new ArrayList<Reference>();
1514      this.context.add(t);
1515      return this;
1516    }
1517
1518    /**
1519     * @return The first repetition of repeating field {@link #context}, creating it if it does not already exist {3}
1520     */
1521    public Reference getContextFirstRep() { 
1522      if (getContext().isEmpty()) {
1523        addContext();
1524      }
1525      return getContext().get(0);
1526    }
1527
1528    /**
1529     * @return {@link #event} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the type Code, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.)
1530     */
1531    public List<CodeableReference> getEvent() { 
1532      if (this.event == null)
1533        this.event = new ArrayList<CodeableReference>();
1534      return this.event;
1535    }
1536
1537    /**
1538     * @return Returns a reference to <code>this</code> for easy method chaining
1539     */
1540    public DocumentReference setEvent(List<CodeableReference> theEvent) { 
1541      this.event = theEvent;
1542      return this;
1543    }
1544
1545    public boolean hasEvent() { 
1546      if (this.event == null)
1547        return false;
1548      for (CodeableReference item : this.event)
1549        if (!item.isEmpty())
1550          return true;
1551      return false;
1552    }
1553
1554    public CodeableReference addEvent() { //3
1555      CodeableReference t = new CodeableReference();
1556      if (this.event == null)
1557        this.event = new ArrayList<CodeableReference>();
1558      this.event.add(t);
1559      return t;
1560    }
1561
1562    public DocumentReference addEvent(CodeableReference t) { //3
1563      if (t == null)
1564        return this;
1565      if (this.event == null)
1566        this.event = new ArrayList<CodeableReference>();
1567      this.event.add(t);
1568      return this;
1569    }
1570
1571    /**
1572     * @return The first repetition of repeating field {@link #event}, creating it if it does not already exist {3}
1573     */
1574    public CodeableReference getEventFirstRep() { 
1575      if (getEvent().isEmpty()) {
1576        addEvent();
1577      }
1578      return getEvent().get(0);
1579    }
1580
1581    /**
1582     * @return {@link #facilityType} (The kind of facility where the patient was seen.)
1583     */
1584    public CodeableConcept getFacilityType() { 
1585      if (this.facilityType == null)
1586        if (Configuration.errorOnAutoCreate())
1587          throw new Error("Attempt to auto-create DocumentReference.facilityType");
1588        else if (Configuration.doAutoCreate())
1589          this.facilityType = new CodeableConcept(); // cc
1590      return this.facilityType;
1591    }
1592
1593    public boolean hasFacilityType() { 
1594      return this.facilityType != null && !this.facilityType.isEmpty();
1595    }
1596
1597    /**
1598     * @param value {@link #facilityType} (The kind of facility where the patient was seen.)
1599     */
1600    public DocumentReference setFacilityType(CodeableConcept value) { 
1601      this.facilityType = value;
1602      return this;
1603    }
1604
1605    /**
1606     * @return {@link #practiceSetting} (This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.)
1607     */
1608    public CodeableConcept getPracticeSetting() { 
1609      if (this.practiceSetting == null)
1610        if (Configuration.errorOnAutoCreate())
1611          throw new Error("Attempt to auto-create DocumentReference.practiceSetting");
1612        else if (Configuration.doAutoCreate())
1613          this.practiceSetting = new CodeableConcept(); // cc
1614      return this.practiceSetting;
1615    }
1616
1617    public boolean hasPracticeSetting() { 
1618      return this.practiceSetting != null && !this.practiceSetting.isEmpty();
1619    }
1620
1621    /**
1622     * @param value {@link #practiceSetting} (This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.)
1623     */
1624    public DocumentReference setPracticeSetting(CodeableConcept value) { 
1625      this.practiceSetting = value;
1626      return this;
1627    }
1628
1629    /**
1630     * @return {@link #period} (The time period over which the service that is described by the document was provided.)
1631     */
1632    public Period getPeriod() { 
1633      if (this.period == null)
1634        if (Configuration.errorOnAutoCreate())
1635          throw new Error("Attempt to auto-create DocumentReference.period");
1636        else if (Configuration.doAutoCreate())
1637          this.period = new Period(); // cc
1638      return this.period;
1639    }
1640
1641    public boolean hasPeriod() { 
1642      return this.period != null && !this.period.isEmpty();
1643    }
1644
1645    /**
1646     * @param value {@link #period} (The time period over which the service that is described by the document was provided.)
1647     */
1648    public DocumentReference setPeriod(Period value) { 
1649      this.period = value;
1650      return this;
1651    }
1652
1653    /**
1654     * @return {@link #date} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1655     */
1656    public InstantType getDateElement() { 
1657      if (this.date == null)
1658        if (Configuration.errorOnAutoCreate())
1659          throw new Error("Attempt to auto-create DocumentReference.date");
1660        else if (Configuration.doAutoCreate())
1661          this.date = new InstantType(); // bb
1662      return this.date;
1663    }
1664
1665    public boolean hasDateElement() { 
1666      return this.date != null && !this.date.isEmpty();
1667    }
1668
1669    public boolean hasDate() { 
1670      return this.date != null && !this.date.isEmpty();
1671    }
1672
1673    /**
1674     * @param value {@link #date} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1675     */
1676    public DocumentReference setDateElement(InstantType value) { 
1677      this.date = value;
1678      return this;
1679    }
1680
1681    /**
1682     * @return When the document reference was created.
1683     */
1684    public Date getDate() { 
1685      return this.date == null ? null : this.date.getValue();
1686    }
1687
1688    /**
1689     * @param value When the document reference was created.
1690     */
1691    public DocumentReference setDate(Date value) { 
1692      if (value == null)
1693        this.date = null;
1694      else {
1695        if (this.date == null)
1696          this.date = new InstantType();
1697        this.date.setValue(value);
1698      }
1699      return this;
1700    }
1701
1702    /**
1703     * @return {@link #author} (Identifies who is responsible for adding the information to the document.)
1704     */
1705    public List<Reference> getAuthor() { 
1706      if (this.author == null)
1707        this.author = new ArrayList<Reference>();
1708      return this.author;
1709    }
1710
1711    /**
1712     * @return Returns a reference to <code>this</code> for easy method chaining
1713     */
1714    public DocumentReference setAuthor(List<Reference> theAuthor) { 
1715      this.author = theAuthor;
1716      return this;
1717    }
1718
1719    public boolean hasAuthor() { 
1720      if (this.author == null)
1721        return false;
1722      for (Reference item : this.author)
1723        if (!item.isEmpty())
1724          return true;
1725      return false;
1726    }
1727
1728    public Reference addAuthor() { //3
1729      Reference t = new Reference();
1730      if (this.author == null)
1731        this.author = new ArrayList<Reference>();
1732      this.author.add(t);
1733      return t;
1734    }
1735
1736    public DocumentReference addAuthor(Reference t) { //3
1737      if (t == null)
1738        return this;
1739      if (this.author == null)
1740        this.author = new ArrayList<Reference>();
1741      this.author.add(t);
1742      return this;
1743    }
1744
1745    /**
1746     * @return The first repetition of repeating field {@link #author}, creating it if it does not already exist {3}
1747     */
1748    public Reference getAuthorFirstRep() { 
1749      if (getAuthor().isEmpty()) {
1750        addAuthor();
1751      }
1752      return getAuthor().get(0);
1753    }
1754
1755    /**
1756     * @return {@link #attester} (A participant who has authenticated the accuracy of the document.)
1757     */
1758    public List<DocumentReferenceAttesterComponent> getAttester() { 
1759      if (this.attester == null)
1760        this.attester = new ArrayList<DocumentReferenceAttesterComponent>();
1761      return this.attester;
1762    }
1763
1764    /**
1765     * @return Returns a reference to <code>this</code> for easy method chaining
1766     */
1767    public DocumentReference setAttester(List<DocumentReferenceAttesterComponent> theAttester) { 
1768      this.attester = theAttester;
1769      return this;
1770    }
1771
1772    public boolean hasAttester() { 
1773      if (this.attester == null)
1774        return false;
1775      for (DocumentReferenceAttesterComponent item : this.attester)
1776        if (!item.isEmpty())
1777          return true;
1778      return false;
1779    }
1780
1781    public DocumentReferenceAttesterComponent addAttester() { //3
1782      DocumentReferenceAttesterComponent t = new DocumentReferenceAttesterComponent();
1783      if (this.attester == null)
1784        this.attester = new ArrayList<DocumentReferenceAttesterComponent>();
1785      this.attester.add(t);
1786      return t;
1787    }
1788
1789    public DocumentReference addAttester(DocumentReferenceAttesterComponent t) { //3
1790      if (t == null)
1791        return this;
1792      if (this.attester == null)
1793        this.attester = new ArrayList<DocumentReferenceAttesterComponent>();
1794      this.attester.add(t);
1795      return this;
1796    }
1797
1798    /**
1799     * @return The first repetition of repeating field {@link #attester}, creating it if it does not already exist {3}
1800     */
1801    public DocumentReferenceAttesterComponent getAttesterFirstRep() { 
1802      if (getAttester().isEmpty()) {
1803        addAttester();
1804      }
1805      return getAttester().get(0);
1806    }
1807
1808    /**
1809     * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.)
1810     */
1811    public Reference getCustodian() { 
1812      if (this.custodian == null)
1813        if (Configuration.errorOnAutoCreate())
1814          throw new Error("Attempt to auto-create DocumentReference.custodian");
1815        else if (Configuration.doAutoCreate())
1816          this.custodian = new Reference(); // cc
1817      return this.custodian;
1818    }
1819
1820    public boolean hasCustodian() { 
1821      return this.custodian != null && !this.custodian.isEmpty();
1822    }
1823
1824    /**
1825     * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.)
1826     */
1827    public DocumentReference setCustodian(Reference value) { 
1828      this.custodian = value;
1829      return this;
1830    }
1831
1832    /**
1833     * @return {@link #relatesTo} (Relationships that this document has with other document references that already exist.)
1834     */
1835    public List<DocumentReferenceRelatesToComponent> getRelatesTo() { 
1836      if (this.relatesTo == null)
1837        this.relatesTo = new ArrayList<DocumentReferenceRelatesToComponent>();
1838      return this.relatesTo;
1839    }
1840
1841    /**
1842     * @return Returns a reference to <code>this</code> for easy method chaining
1843     */
1844    public DocumentReference setRelatesTo(List<DocumentReferenceRelatesToComponent> theRelatesTo) { 
1845      this.relatesTo = theRelatesTo;
1846      return this;
1847    }
1848
1849    public boolean hasRelatesTo() { 
1850      if (this.relatesTo == null)
1851        return false;
1852      for (DocumentReferenceRelatesToComponent item : this.relatesTo)
1853        if (!item.isEmpty())
1854          return true;
1855      return false;
1856    }
1857
1858    public DocumentReferenceRelatesToComponent addRelatesTo() { //3
1859      DocumentReferenceRelatesToComponent t = new DocumentReferenceRelatesToComponent();
1860      if (this.relatesTo == null)
1861        this.relatesTo = new ArrayList<DocumentReferenceRelatesToComponent>();
1862      this.relatesTo.add(t);
1863      return t;
1864    }
1865
1866    public DocumentReference addRelatesTo(DocumentReferenceRelatesToComponent t) { //3
1867      if (t == null)
1868        return this;
1869      if (this.relatesTo == null)
1870        this.relatesTo = new ArrayList<DocumentReferenceRelatesToComponent>();
1871      this.relatesTo.add(t);
1872      return this;
1873    }
1874
1875    /**
1876     * @return The first repetition of repeating field {@link #relatesTo}, creating it if it does not already exist {3}
1877     */
1878    public DocumentReferenceRelatesToComponent getRelatesToFirstRep() { 
1879      if (getRelatesTo().isEmpty()) {
1880        addRelatesTo();
1881      }
1882      return getRelatesTo().get(0);
1883    }
1884
1885    /**
1886     * @return {@link #description} (Human-readable description of the source document.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1887     */
1888    public MarkdownType getDescriptionElement() { 
1889      if (this.description == null)
1890        if (Configuration.errorOnAutoCreate())
1891          throw new Error("Attempt to auto-create DocumentReference.description");
1892        else if (Configuration.doAutoCreate())
1893          this.description = new MarkdownType(); // bb
1894      return this.description;
1895    }
1896
1897    public boolean hasDescriptionElement() { 
1898      return this.description != null && !this.description.isEmpty();
1899    }
1900
1901    public boolean hasDescription() { 
1902      return this.description != null && !this.description.isEmpty();
1903    }
1904
1905    /**
1906     * @param value {@link #description} (Human-readable description of the source document.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1907     */
1908    public DocumentReference setDescriptionElement(MarkdownType value) { 
1909      this.description = value;
1910      return this;
1911    }
1912
1913    /**
1914     * @return Human-readable description of the source document.
1915     */
1916    public String getDescription() { 
1917      return this.description == null ? null : this.description.getValue();
1918    }
1919
1920    /**
1921     * @param value Human-readable description of the source document.
1922     */
1923    public DocumentReference setDescription(String value) { 
1924      if (value == null)
1925        this.description = null;
1926      else {
1927        if (this.description == null)
1928          this.description = new MarkdownType();
1929        this.description.setValue(value);
1930      }
1931      return this;
1932    }
1933
1934    /**
1935     * @return {@link #securityLabel} (A set of Security-Tag codes specifying the level of privacy/security of the Document found at DocumentReference.content.attachment.url. Note that DocumentReference.meta.security contains the security labels of the data elements in DocumentReference, while DocumentReference.securityLabel contains the security labels for the document the reference refers to. The distinction recognizes that the document may contain sensitive information, while the DocumentReference is metadata about the document and thus might not be as sensitive as the document. For example: a psychotherapy episode may contain highly sensitive information, while the metadata may simply indicate that some episode happened.)
1936     */
1937    public List<CodeableConcept> getSecurityLabel() { 
1938      if (this.securityLabel == null)
1939        this.securityLabel = new ArrayList<CodeableConcept>();
1940      return this.securityLabel;
1941    }
1942
1943    /**
1944     * @return Returns a reference to <code>this</code> for easy method chaining
1945     */
1946    public DocumentReference setSecurityLabel(List<CodeableConcept> theSecurityLabel) { 
1947      this.securityLabel = theSecurityLabel;
1948      return this;
1949    }
1950
1951    public boolean hasSecurityLabel() { 
1952      if (this.securityLabel == null)
1953        return false;
1954      for (CodeableConcept item : this.securityLabel)
1955        if (!item.isEmpty())
1956          return true;
1957      return false;
1958    }
1959
1960    public CodeableConcept addSecurityLabel() { //3
1961      CodeableConcept t = new CodeableConcept();
1962      if (this.securityLabel == null)
1963        this.securityLabel = new ArrayList<CodeableConcept>();
1964      this.securityLabel.add(t);
1965      return t;
1966    }
1967
1968    public DocumentReference addSecurityLabel(CodeableConcept t) { //3
1969      if (t == null)
1970        return this;
1971      if (this.securityLabel == null)
1972        this.securityLabel = new ArrayList<CodeableConcept>();
1973      this.securityLabel.add(t);
1974      return this;
1975    }
1976
1977    /**
1978     * @return The first repetition of repeating field {@link #securityLabel}, creating it if it does not already exist {3}
1979     */
1980    public CodeableConcept getSecurityLabelFirstRep() { 
1981      if (getSecurityLabel().isEmpty()) {
1982        addSecurityLabel();
1983      }
1984      return getSecurityLabel().get(0);
1985    }
1986
1987    /**
1988     * @return {@link #content} (The document and format referenced.  If there are multiple content element repetitions, these must all represent the same document in different format, or attachment metadata.)
1989     */
1990    public List<DocumentReferenceContentComponent> getContent() { 
1991      if (this.content == null)
1992        this.content = new ArrayList<DocumentReferenceContentComponent>();
1993      return this.content;
1994    }
1995
1996    /**
1997     * @return Returns a reference to <code>this</code> for easy method chaining
1998     */
1999    public DocumentReference setContent(List<DocumentReferenceContentComponent> theContent) { 
2000      this.content = theContent;
2001      return this;
2002    }
2003
2004    public boolean hasContent() { 
2005      if (this.content == null)
2006        return false;
2007      for (DocumentReferenceContentComponent item : this.content)
2008        if (!item.isEmpty())
2009          return true;
2010      return false;
2011    }
2012
2013    public DocumentReferenceContentComponent addContent() { //3
2014      DocumentReferenceContentComponent t = new DocumentReferenceContentComponent();
2015      if (this.content == null)
2016        this.content = new ArrayList<DocumentReferenceContentComponent>();
2017      this.content.add(t);
2018      return t;
2019    }
2020
2021    public DocumentReference addContent(DocumentReferenceContentComponent t) { //3
2022      if (t == null)
2023        return this;
2024      if (this.content == null)
2025        this.content = new ArrayList<DocumentReferenceContentComponent>();
2026      this.content.add(t);
2027      return this;
2028    }
2029
2030    /**
2031     * @return The first repetition of repeating field {@link #content}, creating it if it does not already exist {3}
2032     */
2033    public DocumentReferenceContentComponent getContentFirstRep() { 
2034      if (getContent().isEmpty()) {
2035        addContent();
2036      }
2037      return getContent().get(0);
2038    }
2039
2040      protected void listChildren(List<Property> children) {
2041        super.listChildren(children);
2042        children.add(new Property("identifier", "Identifier", "Other business identifiers associated with the document, including version independent identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier));
2043        children.add(new Property("basedOn", "Reference(Appointment|AppointmentResponse|CarePlan|Claim|CommunicationRequest|Contract|CoverageEligibilityRequest|DeviceRequest|EnrollmentRequest|EpisodeOfCare|ImmunizationRecommendation|MedicationRequest|NutritionOrder|RequestOrchestration|ServiceRequest|SupplyRequest|VisionPrescription)", "A procedure that is fulfilled in whole or in part by the creation of this media.", 0, java.lang.Integer.MAX_VALUE, basedOn));
2044        children.add(new Property("status", "code", "The status of this document reference.", 0, 1, status));
2045        children.add(new Property("docStatus", "code", "The status of the underlying document.", 0, 1, docStatus));
2046        children.add(new Property("type", "CodeableConcept", "Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.", 0, 1, type));
2047        children.add(new Property("category", "CodeableConcept", "A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.", 0, java.lang.Integer.MAX_VALUE, category));
2048        children.add(new Property("subject", "Reference(Any)", "Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).", 0, 1, subject));
2049        children.add(new Property("context", "Reference(Appointment|Encounter|EpisodeOfCare)", "Describes the clinical encounter or type of care that the document content is associated with.", 0, java.lang.Integer.MAX_VALUE, context));
2050        children.add(new Property("event", "CodeableReference", "This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the type Code, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act.", 0, java.lang.Integer.MAX_VALUE, event));
2051        children.add(new Property("facilityType", "CodeableConcept", "The kind of facility where the patient was seen.", 0, 1, facilityType));
2052        children.add(new Property("practiceSetting", "CodeableConcept", "This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.", 0, 1, practiceSetting));
2053        children.add(new Property("period", "Period", "The time period over which the service that is described by the document was provided.", 0, 1, period));
2054        children.add(new Property("date", "instant", "When the document reference was created.", 0, 1, date));
2055        children.add(new Property("author", "Reference(Practitioner|PractitionerRole|Organization|Device|Patient|RelatedPerson|CareTeam)", "Identifies who is responsible for adding the information to the document.", 0, java.lang.Integer.MAX_VALUE, author));
2056        children.add(new Property("attester", "", "A participant who has authenticated the accuracy of the document.", 0, java.lang.Integer.MAX_VALUE, attester));
2057        children.add(new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.", 0, 1, custodian));
2058        children.add(new Property("relatesTo", "", "Relationships that this document has with other document references that already exist.", 0, java.lang.Integer.MAX_VALUE, relatesTo));
2059        children.add(new Property("description", "markdown", "Human-readable description of the source document.", 0, 1, description));
2060        children.add(new Property("securityLabel", "CodeableConcept", "A set of Security-Tag codes specifying the level of privacy/security of the Document found at DocumentReference.content.attachment.url. Note that DocumentReference.meta.security contains the security labels of the data elements in DocumentReference, while DocumentReference.securityLabel contains the security labels for the document the reference refers to. The distinction recognizes that the document may contain sensitive information, while the DocumentReference is metadata about the document and thus might not be as sensitive as the document. For example: a psychotherapy episode may contain highly sensitive information, while the metadata may simply indicate that some episode happened.", 0, java.lang.Integer.MAX_VALUE, securityLabel));
2061        children.add(new Property("content", "", "The document and format referenced.  If there are multiple content element repetitions, these must all represent the same document in different format, or attachment metadata.", 0, java.lang.Integer.MAX_VALUE, content));
2062      }
2063
2064      @Override
2065      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2066        switch (_hash) {
2067        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Other business identifiers associated with the document, including version independent identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier);
2068        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(Appointment|AppointmentResponse|CarePlan|Claim|CommunicationRequest|Contract|CoverageEligibilityRequest|DeviceRequest|EnrollmentRequest|EpisodeOfCare|ImmunizationRecommendation|MedicationRequest|NutritionOrder|RequestOrchestration|ServiceRequest|SupplyRequest|VisionPrescription)", "A procedure that is fulfilled in whole or in part by the creation of this media.", 0, java.lang.Integer.MAX_VALUE, basedOn);
2069        case -892481550: /*status*/  return new Property("status", "code", "The status of this document reference.", 0, 1, status);
2070        case -23496886: /*docStatus*/  return new Property("docStatus", "code", "The status of the underlying document.", 0, 1, docStatus);
2071        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.", 0, 1, type);
2072        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.", 0, java.lang.Integer.MAX_VALUE, category);
2073        case -1867885268: /*subject*/  return new Property("subject", "Reference(Any)", "Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).", 0, 1, subject);
2074        case 951530927: /*context*/  return new Property("context", "Reference(Appointment|Encounter|EpisodeOfCare)", "Describes the clinical encounter or type of care that the document content is associated with.", 0, java.lang.Integer.MAX_VALUE, context);
2075        case 96891546: /*event*/  return new Property("event", "CodeableReference", "This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the type Code, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act.", 0, java.lang.Integer.MAX_VALUE, event);
2076        case 370698365: /*facilityType*/  return new Property("facilityType", "CodeableConcept", "The kind of facility where the patient was seen.", 0, 1, facilityType);
2077        case 331373717: /*practiceSetting*/  return new Property("practiceSetting", "CodeableConcept", "This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.", 0, 1, practiceSetting);
2078        case -991726143: /*period*/  return new Property("period", "Period", "The time period over which the service that is described by the document was provided.", 0, 1, period);
2079        case 3076014: /*date*/  return new Property("date", "instant", "When the document reference was created.", 0, 1, date);
2080        case -1406328437: /*author*/  return new Property("author", "Reference(Practitioner|PractitionerRole|Organization|Device|Patient|RelatedPerson|CareTeam)", "Identifies who is responsible for adding the information to the document.", 0, java.lang.Integer.MAX_VALUE, author);
2081        case 542920370: /*attester*/  return new Property("attester", "", "A participant who has authenticated the accuracy of the document.", 0, java.lang.Integer.MAX_VALUE, attester);
2082        case 1611297262: /*custodian*/  return new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.", 0, 1, custodian);
2083        case -7765931: /*relatesTo*/  return new Property("relatesTo", "", "Relationships that this document has with other document references that already exist.", 0, java.lang.Integer.MAX_VALUE, relatesTo);
2084        case -1724546052: /*description*/  return new Property("description", "markdown", "Human-readable description of the source document.", 0, 1, description);
2085        case -722296940: /*securityLabel*/  return new Property("securityLabel", "CodeableConcept", "A set of Security-Tag codes specifying the level of privacy/security of the Document found at DocumentReference.content.attachment.url. Note that DocumentReference.meta.security contains the security labels of the data elements in DocumentReference, while DocumentReference.securityLabel contains the security labels for the document the reference refers to. The distinction recognizes that the document may contain sensitive information, while the DocumentReference is metadata about the document and thus might not be as sensitive as the document. For example: a psychotherapy episode may contain highly sensitive information, while the metadata may simply indicate that some episode happened.", 0, java.lang.Integer.MAX_VALUE, securityLabel);
2086        case 951530617: /*content*/  return new Property("content", "", "The document and format referenced.  If there are multiple content element repetitions, these must all represent the same document in different format, or attachment metadata.", 0, java.lang.Integer.MAX_VALUE, content);
2087        default: return super.getNamedProperty(_hash, _name, _checkValid);
2088        }
2089
2090      }
2091
2092      @Override
2093      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2094        switch (hash) {
2095        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2096        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2097        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<DocumentReferenceStatus>
2098        case -23496886: /*docStatus*/ return this.docStatus == null ? new Base[0] : new Base[] {this.docStatus}; // Enumeration<CompositionStatus>
2099        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2100        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
2101        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2102        case 951530927: /*context*/ return this.context == null ? new Base[0] : this.context.toArray(new Base[this.context.size()]); // Reference
2103        case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // CodeableReference
2104        case 370698365: /*facilityType*/ return this.facilityType == null ? new Base[0] : new Base[] {this.facilityType}; // CodeableConcept
2105        case 331373717: /*practiceSetting*/ return this.practiceSetting == null ? new Base[0] : new Base[] {this.practiceSetting}; // CodeableConcept
2106        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
2107        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // InstantType
2108        case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // Reference
2109        case 542920370: /*attester*/ return this.attester == null ? new Base[0] : this.attester.toArray(new Base[this.attester.size()]); // DocumentReferenceAttesterComponent
2110        case 1611297262: /*custodian*/ return this.custodian == null ? new Base[0] : new Base[] {this.custodian}; // Reference
2111        case -7765931: /*relatesTo*/ return this.relatesTo == null ? new Base[0] : this.relatesTo.toArray(new Base[this.relatesTo.size()]); // DocumentReferenceRelatesToComponent
2112        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2113        case -722296940: /*securityLabel*/ return this.securityLabel == null ? new Base[0] : this.securityLabel.toArray(new Base[this.securityLabel.size()]); // CodeableConcept
2114        case 951530617: /*content*/ return this.content == null ? new Base[0] : this.content.toArray(new Base[this.content.size()]); // DocumentReferenceContentComponent
2115        default: return super.getProperty(hash, name, checkValid);
2116        }
2117
2118      }
2119
2120      @Override
2121      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2122        switch (hash) {
2123        case -1618432855: // identifier
2124          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2125          return value;
2126        case -332612366: // basedOn
2127          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
2128          return value;
2129        case -892481550: // status
2130          value = new DocumentReferenceStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2131          this.status = (Enumeration) value; // Enumeration<DocumentReferenceStatus>
2132          return value;
2133        case -23496886: // docStatus
2134          value = new CompositionStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2135          this.docStatus = (Enumeration) value; // Enumeration<CompositionStatus>
2136          return value;
2137        case 3575610: // type
2138          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2139          return value;
2140        case 50511102: // category
2141          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2142          return value;
2143        case -1867885268: // subject
2144          this.subject = TypeConvertor.castToReference(value); // Reference
2145          return value;
2146        case 951530927: // context
2147          this.getContext().add(TypeConvertor.castToReference(value)); // Reference
2148          return value;
2149        case 96891546: // event
2150          this.getEvent().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
2151          return value;
2152        case 370698365: // facilityType
2153          this.facilityType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2154          return value;
2155        case 331373717: // practiceSetting
2156          this.practiceSetting = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2157          return value;
2158        case -991726143: // period
2159          this.period = TypeConvertor.castToPeriod(value); // Period
2160          return value;
2161        case 3076014: // date
2162          this.date = TypeConvertor.castToInstant(value); // InstantType
2163          return value;
2164        case -1406328437: // author
2165          this.getAuthor().add(TypeConvertor.castToReference(value)); // Reference
2166          return value;
2167        case 542920370: // attester
2168          this.getAttester().add((DocumentReferenceAttesterComponent) value); // DocumentReferenceAttesterComponent
2169          return value;
2170        case 1611297262: // custodian
2171          this.custodian = TypeConvertor.castToReference(value); // Reference
2172          return value;
2173        case -7765931: // relatesTo
2174          this.getRelatesTo().add((DocumentReferenceRelatesToComponent) value); // DocumentReferenceRelatesToComponent
2175          return value;
2176        case -1724546052: // description
2177          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2178          return value;
2179        case -722296940: // securityLabel
2180          this.getSecurityLabel().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2181          return value;
2182        case 951530617: // content
2183          this.getContent().add((DocumentReferenceContentComponent) value); // DocumentReferenceContentComponent
2184          return value;
2185        default: return super.setProperty(hash, name, value);
2186        }
2187
2188      }
2189
2190      @Override
2191      public Base setProperty(String name, Base value) throws FHIRException {
2192        if (name.equals("identifier")) {
2193          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2194        } else if (name.equals("basedOn")) {
2195          this.getBasedOn().add(TypeConvertor.castToReference(value));
2196        } else if (name.equals("status")) {
2197          value = new DocumentReferenceStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2198          this.status = (Enumeration) value; // Enumeration<DocumentReferenceStatus>
2199        } else if (name.equals("docStatus")) {
2200          value = new CompositionStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2201          this.docStatus = (Enumeration) value; // Enumeration<CompositionStatus>
2202        } else if (name.equals("type")) {
2203          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2204        } else if (name.equals("category")) {
2205          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
2206        } else if (name.equals("subject")) {
2207          this.subject = TypeConvertor.castToReference(value); // Reference
2208        } else if (name.equals("context")) {
2209          this.getContext().add(TypeConvertor.castToReference(value));
2210        } else if (name.equals("event")) {
2211          this.getEvent().add(TypeConvertor.castToCodeableReference(value));
2212        } else if (name.equals("facilityType")) {
2213          this.facilityType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2214        } else if (name.equals("practiceSetting")) {
2215          this.practiceSetting = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2216        } else if (name.equals("period")) {
2217          this.period = TypeConvertor.castToPeriod(value); // Period
2218        } else if (name.equals("date")) {
2219          this.date = TypeConvertor.castToInstant(value); // InstantType
2220        } else if (name.equals("author")) {
2221          this.getAuthor().add(TypeConvertor.castToReference(value));
2222        } else if (name.equals("attester")) {
2223          this.getAttester().add((DocumentReferenceAttesterComponent) value);
2224        } else if (name.equals("custodian")) {
2225          this.custodian = TypeConvertor.castToReference(value); // Reference
2226        } else if (name.equals("relatesTo")) {
2227          this.getRelatesTo().add((DocumentReferenceRelatesToComponent) value);
2228        } else if (name.equals("description")) {
2229          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2230        } else if (name.equals("securityLabel")) {
2231          this.getSecurityLabel().add(TypeConvertor.castToCodeableConcept(value));
2232        } else if (name.equals("content")) {
2233          this.getContent().add((DocumentReferenceContentComponent) value);
2234        } else
2235          return super.setProperty(name, value);
2236        return value;
2237      }
2238
2239      @Override
2240      public Base makeProperty(int hash, String name) throws FHIRException {
2241        switch (hash) {
2242        case -1618432855:  return addIdentifier(); 
2243        case -332612366:  return addBasedOn(); 
2244        case -892481550:  return getStatusElement();
2245        case -23496886:  return getDocStatusElement();
2246        case 3575610:  return getType();
2247        case 50511102:  return addCategory(); 
2248        case -1867885268:  return getSubject();
2249        case 951530927:  return addContext(); 
2250        case 96891546:  return addEvent(); 
2251        case 370698365:  return getFacilityType();
2252        case 331373717:  return getPracticeSetting();
2253        case -991726143:  return getPeriod();
2254        case 3076014:  return getDateElement();
2255        case -1406328437:  return addAuthor(); 
2256        case 542920370:  return addAttester(); 
2257        case 1611297262:  return getCustodian();
2258        case -7765931:  return addRelatesTo(); 
2259        case -1724546052:  return getDescriptionElement();
2260        case -722296940:  return addSecurityLabel(); 
2261        case 951530617:  return addContent(); 
2262        default: return super.makeProperty(hash, name);
2263        }
2264
2265      }
2266
2267      @Override
2268      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2269        switch (hash) {
2270        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2271        case -332612366: /*basedOn*/ return new String[] {"Reference"};
2272        case -892481550: /*status*/ return new String[] {"code"};
2273        case -23496886: /*docStatus*/ return new String[] {"code"};
2274        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2275        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2276        case -1867885268: /*subject*/ return new String[] {"Reference"};
2277        case 951530927: /*context*/ return new String[] {"Reference"};
2278        case 96891546: /*event*/ return new String[] {"CodeableReference"};
2279        case 370698365: /*facilityType*/ return new String[] {"CodeableConcept"};
2280        case 331373717: /*practiceSetting*/ return new String[] {"CodeableConcept"};
2281        case -991726143: /*period*/ return new String[] {"Period"};
2282        case 3076014: /*date*/ return new String[] {"instant"};
2283        case -1406328437: /*author*/ return new String[] {"Reference"};
2284        case 542920370: /*attester*/ return new String[] {};
2285        case 1611297262: /*custodian*/ return new String[] {"Reference"};
2286        case -7765931: /*relatesTo*/ return new String[] {};
2287        case -1724546052: /*description*/ return new String[] {"markdown"};
2288        case -722296940: /*securityLabel*/ return new String[] {"CodeableConcept"};
2289        case 951530617: /*content*/ return new String[] {};
2290        default: return super.getTypesForProperty(hash, name);
2291        }
2292
2293      }
2294
2295      @Override
2296      public Base addChild(String name) throws FHIRException {
2297        if (name.equals("identifier")) {
2298          return addIdentifier();
2299        }
2300        else if (name.equals("basedOn")) {
2301          return addBasedOn();
2302        }
2303        else if (name.equals("status")) {
2304          throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.status");
2305        }
2306        else if (name.equals("docStatus")) {
2307          throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.docStatus");
2308        }
2309        else if (name.equals("type")) {
2310          this.type = new CodeableConcept();
2311          return this.type;
2312        }
2313        else if (name.equals("category")) {
2314          return addCategory();
2315        }
2316        else if (name.equals("subject")) {
2317          this.subject = new Reference();
2318          return this.subject;
2319        }
2320        else if (name.equals("context")) {
2321          return addContext();
2322        }
2323        else if (name.equals("event")) {
2324          return addEvent();
2325        }
2326        else if (name.equals("facilityType")) {
2327          this.facilityType = new CodeableConcept();
2328          return this.facilityType;
2329        }
2330        else if (name.equals("practiceSetting")) {
2331          this.practiceSetting = new CodeableConcept();
2332          return this.practiceSetting;
2333        }
2334        else if (name.equals("period")) {
2335          this.period = new Period();
2336          return this.period;
2337        }
2338        else if (name.equals("date")) {
2339          throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.date");
2340        }
2341        else if (name.equals("author")) {
2342          return addAuthor();
2343        }
2344        else if (name.equals("attester")) {
2345          return addAttester();
2346        }
2347        else if (name.equals("custodian")) {
2348          this.custodian = new Reference();
2349          return this.custodian;
2350        }
2351        else if (name.equals("relatesTo")) {
2352          return addRelatesTo();
2353        }
2354        else if (name.equals("description")) {
2355          throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.description");
2356        }
2357        else if (name.equals("securityLabel")) {
2358          return addSecurityLabel();
2359        }
2360        else if (name.equals("content")) {
2361          return addContent();
2362        }
2363        else
2364          return super.addChild(name);
2365      }
2366
2367  public String fhirType() {
2368    return "DocumentReference";
2369
2370  }
2371
2372      public DocumentReference copy() {
2373        DocumentReference dst = new DocumentReference();
2374        copyValues(dst);
2375        return dst;
2376      }
2377
2378      public void copyValues(DocumentReference dst) {
2379        super.copyValues(dst);
2380        if (identifier != null) {
2381          dst.identifier = new ArrayList<Identifier>();
2382          for (Identifier i : identifier)
2383            dst.identifier.add(i.copy());
2384        };
2385        if (basedOn != null) {
2386          dst.basedOn = new ArrayList<Reference>();
2387          for (Reference i : basedOn)
2388            dst.basedOn.add(i.copy());
2389        };
2390        dst.status = status == null ? null : status.copy();
2391        dst.docStatus = docStatus == null ? null : docStatus.copy();
2392        dst.type = type == null ? null : type.copy();
2393        if (category != null) {
2394          dst.category = new ArrayList<CodeableConcept>();
2395          for (CodeableConcept i : category)
2396            dst.category.add(i.copy());
2397        };
2398        dst.subject = subject == null ? null : subject.copy();
2399        if (context != null) {
2400          dst.context = new ArrayList<Reference>();
2401          for (Reference i : context)
2402            dst.context.add(i.copy());
2403        };
2404        if (event != null) {
2405          dst.event = new ArrayList<CodeableReference>();
2406          for (CodeableReference i : event)
2407            dst.event.add(i.copy());
2408        };
2409        dst.facilityType = facilityType == null ? null : facilityType.copy();
2410        dst.practiceSetting = practiceSetting == null ? null : practiceSetting.copy();
2411        dst.period = period == null ? null : period.copy();
2412        dst.date = date == null ? null : date.copy();
2413        if (author != null) {
2414          dst.author = new ArrayList<Reference>();
2415          for (Reference i : author)
2416            dst.author.add(i.copy());
2417        };
2418        if (attester != null) {
2419          dst.attester = new ArrayList<DocumentReferenceAttesterComponent>();
2420          for (DocumentReferenceAttesterComponent i : attester)
2421            dst.attester.add(i.copy());
2422        };
2423        dst.custodian = custodian == null ? null : custodian.copy();
2424        if (relatesTo != null) {
2425          dst.relatesTo = new ArrayList<DocumentReferenceRelatesToComponent>();
2426          for (DocumentReferenceRelatesToComponent i : relatesTo)
2427            dst.relatesTo.add(i.copy());
2428        };
2429        dst.description = description == null ? null : description.copy();
2430        if (securityLabel != null) {
2431          dst.securityLabel = new ArrayList<CodeableConcept>();
2432          for (CodeableConcept i : securityLabel)
2433            dst.securityLabel.add(i.copy());
2434        };
2435        if (content != null) {
2436          dst.content = new ArrayList<DocumentReferenceContentComponent>();
2437          for (DocumentReferenceContentComponent i : content)
2438            dst.content.add(i.copy());
2439        };
2440      }
2441
2442      protected DocumentReference typedCopy() {
2443        return copy();
2444      }
2445
2446      @Override
2447      public boolean equalsDeep(Base other_) {
2448        if (!super.equalsDeep(other_))
2449          return false;
2450        if (!(other_ instanceof DocumentReference))
2451          return false;
2452        DocumentReference o = (DocumentReference) other_;
2453        return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(status, o.status, true)
2454           && compareDeep(docStatus, o.docStatus, true) && compareDeep(type, o.type, true) && compareDeep(category, o.category, true)
2455           && compareDeep(subject, o.subject, true) && compareDeep(context, o.context, true) && compareDeep(event, o.event, true)
2456           && compareDeep(facilityType, o.facilityType, true) && compareDeep(practiceSetting, o.practiceSetting, true)
2457           && compareDeep(period, o.period, true) && compareDeep(date, o.date, true) && compareDeep(author, o.author, true)
2458           && compareDeep(attester, o.attester, true) && compareDeep(custodian, o.custodian, true) && compareDeep(relatesTo, o.relatesTo, true)
2459           && compareDeep(description, o.description, true) && compareDeep(securityLabel, o.securityLabel, true)
2460           && compareDeep(content, o.content, true);
2461      }
2462
2463      @Override
2464      public boolean equalsShallow(Base other_) {
2465        if (!super.equalsShallow(other_))
2466          return false;
2467        if (!(other_ instanceof DocumentReference))
2468          return false;
2469        DocumentReference o = (DocumentReference) other_;
2470        return compareValues(status, o.status, true) && compareValues(docStatus, o.docStatus, true) && compareValues(date, o.date, true)
2471           && compareValues(description, o.description, true);
2472      }
2473
2474      public boolean isEmpty() {
2475        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, status
2476          , docStatus, type, category, subject, context, event, facilityType, practiceSetting
2477          , period, date, author, attester, custodian, relatesTo, description, securityLabel
2478          , content);
2479      }
2480
2481  @Override
2482  public ResourceType getResourceType() {
2483    return ResourceType.DocumentReference;
2484   }
2485
2486 /**
2487   * Search parameter: <b>attester</b>
2488   * <p>
2489   * Description: <b>Who attested the document</b><br>
2490   * Type: <b>reference</b><br>
2491   * Path: <b>DocumentReference.attester.party</b><br>
2492   * </p>
2493   */
2494  @SearchParamDefinition(name="attester", path="DocumentReference.attester.party", description="Who attested the document", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2495  public static final String SP_ATTESTER = "attester";
2496 /**
2497   * <b>Fluent Client</b> search parameter constant for <b>attester</b>
2498   * <p>
2499   * Description: <b>Who attested the document</b><br>
2500   * Type: <b>reference</b><br>
2501   * Path: <b>DocumentReference.attester.party</b><br>
2502   * </p>
2503   */
2504  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ATTESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ATTESTER);
2505
2506/**
2507   * Constant for fluent queries to be used to add include statements. Specifies
2508   * the path value of "<b>DocumentReference:attester</b>".
2509   */
2510  public static final ca.uhn.fhir.model.api.Include INCLUDE_ATTESTER = new ca.uhn.fhir.model.api.Include("DocumentReference:attester").toLocked();
2511
2512 /**
2513   * Search parameter: <b>author</b>
2514   * <p>
2515   * Description: <b>Who and/or what authored the document</b><br>
2516   * Type: <b>reference</b><br>
2517   * Path: <b>DocumentReference.author</b><br>
2518   * </p>
2519   */
2520  @SearchParamDefinition(name="author", path="DocumentReference.author", description="Who and/or what authored the document", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for RelatedPerson") }, target={CareTeam.class, Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2521  public static final String SP_AUTHOR = "author";
2522 /**
2523   * <b>Fluent Client</b> search parameter constant for <b>author</b>
2524   * <p>
2525   * Description: <b>Who and/or what authored the document</b><br>
2526   * Type: <b>reference</b><br>
2527   * Path: <b>DocumentReference.author</b><br>
2528   * </p>
2529   */
2530  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR);
2531
2532/**
2533   * Constant for fluent queries to be used to add include statements. Specifies
2534   * the path value of "<b>DocumentReference:author</b>".
2535   */
2536  public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("DocumentReference:author").toLocked();
2537
2538 /**
2539   * Search parameter: <b>based-on</b>
2540   * <p>
2541   * Description: <b>Procedure that caused this media to be created</b><br>
2542   * Type: <b>reference</b><br>
2543   * Path: <b>DocumentReference.basedOn</b><br>
2544   * </p>
2545   */
2546  @SearchParamDefinition(name="based-on", path="DocumentReference.basedOn", description="Procedure that caused this media to be created", type="reference", target={Appointment.class, AppointmentResponse.class, CarePlan.class, Claim.class, CommunicationRequest.class, Contract.class, CoverageEligibilityRequest.class, DeviceRequest.class, EnrollmentRequest.class, EpisodeOfCare.class, ImmunizationRecommendation.class, MedicationRequest.class, NutritionOrder.class, RequestOrchestration.class, ServiceRequest.class, SupplyRequest.class, VisionPrescription.class } )
2547  public static final String SP_BASED_ON = "based-on";
2548 /**
2549   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
2550   * <p>
2551   * Description: <b>Procedure that caused this media to be created</b><br>
2552   * Type: <b>reference</b><br>
2553   * Path: <b>DocumentReference.basedOn</b><br>
2554   * </p>
2555   */
2556  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
2557
2558/**
2559   * Constant for fluent queries to be used to add include statements. Specifies
2560   * the path value of "<b>DocumentReference:based-on</b>".
2561   */
2562  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("DocumentReference:based-on").toLocked();
2563
2564 /**
2565   * Search parameter: <b>category</b>
2566   * <p>
2567   * Description: <b>Categorization of document</b><br>
2568   * Type: <b>token</b><br>
2569   * Path: <b>DocumentReference.category</b><br>
2570   * </p>
2571   */
2572  @SearchParamDefinition(name="category", path="DocumentReference.category", description="Categorization of document", type="token" )
2573  public static final String SP_CATEGORY = "category";
2574 /**
2575   * <b>Fluent Client</b> search parameter constant for <b>category</b>
2576   * <p>
2577   * Description: <b>Categorization of document</b><br>
2578   * Type: <b>token</b><br>
2579   * Path: <b>DocumentReference.category</b><br>
2580   * </p>
2581   */
2582  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
2583
2584 /**
2585   * Search parameter: <b>contenttype</b>
2586   * <p>
2587   * Description: <b>Mime type of the content, with charset etc.</b><br>
2588   * Type: <b>token</b><br>
2589   * Path: <b>DocumentReference.content.attachment.contentType</b><br>
2590   * </p>
2591   */
2592  @SearchParamDefinition(name="contenttype", path="DocumentReference.content.attachment.contentType", description="Mime type of the content, with charset etc.", type="token" )
2593  public static final String SP_CONTENTTYPE = "contenttype";
2594 /**
2595   * <b>Fluent Client</b> search parameter constant for <b>contenttype</b>
2596   * <p>
2597   * Description: <b>Mime type of the content, with charset etc.</b><br>
2598   * Type: <b>token</b><br>
2599   * Path: <b>DocumentReference.content.attachment.contentType</b><br>
2600   * </p>
2601   */
2602  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTENTTYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTENTTYPE);
2603
2604 /**
2605   * Search parameter: <b>context</b>
2606   * <p>
2607   * Description: <b>Context of the document content</b><br>
2608   * Type: <b>reference</b><br>
2609   * Path: <b>DocumentReference.context</b><br>
2610   * </p>
2611   */
2612  @SearchParamDefinition(name="context", path="DocumentReference.context", description="Context of the document content", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Encounter") }, target={Appointment.class, Encounter.class, EpisodeOfCare.class } )
2613  public static final String SP_CONTEXT = "context";
2614 /**
2615   * <b>Fluent Client</b> search parameter constant for <b>context</b>
2616   * <p>
2617   * Description: <b>Context of the document content</b><br>
2618   * Type: <b>reference</b><br>
2619   * Path: <b>DocumentReference.context</b><br>
2620   * </p>
2621   */
2622  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTEXT);
2623
2624/**
2625   * Constant for fluent queries to be used to add include statements. Specifies
2626   * the path value of "<b>DocumentReference:context</b>".
2627   */
2628  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTEXT = new ca.uhn.fhir.model.api.Include("DocumentReference:context").toLocked();
2629
2630 /**
2631   * Search parameter: <b>creation</b>
2632   * <p>
2633   * Description: <b>Date attachment was first created</b><br>
2634   * Type: <b>date</b><br>
2635   * Path: <b>DocumentReference.content.attachment.creation</b><br>
2636   * </p>
2637   */
2638  @SearchParamDefinition(name="creation", path="DocumentReference.content.attachment.creation", description="Date attachment was first created", type="date" )
2639  public static final String SP_CREATION = "creation";
2640 /**
2641   * <b>Fluent Client</b> search parameter constant for <b>creation</b>
2642   * <p>
2643   * Description: <b>Date attachment was first created</b><br>
2644   * Type: <b>date</b><br>
2645   * Path: <b>DocumentReference.content.attachment.creation</b><br>
2646   * </p>
2647   */
2648  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATION = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATION);
2649
2650 /**
2651   * Search parameter: <b>custodian</b>
2652   * <p>
2653   * Description: <b>Organization which maintains the document</b><br>
2654   * Type: <b>reference</b><br>
2655   * Path: <b>DocumentReference.custodian</b><br>
2656   * </p>
2657   */
2658  @SearchParamDefinition(name="custodian", path="DocumentReference.custodian", description="Organization which maintains the document", type="reference", target={Organization.class } )
2659  public static final String SP_CUSTODIAN = "custodian";
2660 /**
2661   * <b>Fluent Client</b> search parameter constant for <b>custodian</b>
2662   * <p>
2663   * Description: <b>Organization which maintains the document</b><br>
2664   * Type: <b>reference</b><br>
2665   * Path: <b>DocumentReference.custodian</b><br>
2666   * </p>
2667   */
2668  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CUSTODIAN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CUSTODIAN);
2669
2670/**
2671   * Constant for fluent queries to be used to add include statements. Specifies
2672   * the path value of "<b>DocumentReference:custodian</b>".
2673   */
2674  public static final ca.uhn.fhir.model.api.Include INCLUDE_CUSTODIAN = new ca.uhn.fhir.model.api.Include("DocumentReference:custodian").toLocked();
2675
2676 /**
2677   * Search parameter: <b>date</b>
2678   * <p>
2679   * Description: <b>When this document reference was created</b><br>
2680   * Type: <b>date</b><br>
2681   * Path: <b>DocumentReference.date</b><br>
2682   * </p>
2683   */
2684  @SearchParamDefinition(name="date", path="DocumentReference.date", description="When this document reference was created", type="date" )
2685  public static final String SP_DATE = "date";
2686 /**
2687   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2688   * <p>
2689   * Description: <b>When this document reference was created</b><br>
2690   * Type: <b>date</b><br>
2691   * Path: <b>DocumentReference.date</b><br>
2692   * </p>
2693   */
2694  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2695
2696 /**
2697   * Search parameter: <b>description</b>
2698   * <p>
2699   * Description: <b>Human-readable description</b><br>
2700   * Type: <b>string</b><br>
2701   * Path: <b>DocumentReference.description</b><br>
2702   * </p>
2703   */
2704  @SearchParamDefinition(name="description", path="DocumentReference.description", description="Human-readable description", type="string" )
2705  public static final String SP_DESCRIPTION = "description";
2706 /**
2707   * <b>Fluent Client</b> search parameter constant for <b>description</b>
2708   * <p>
2709   * Description: <b>Human-readable description</b><br>
2710   * Type: <b>string</b><br>
2711   * Path: <b>DocumentReference.description</b><br>
2712   * </p>
2713   */
2714  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
2715
2716 /**
2717   * Search parameter: <b>doc-status</b>
2718   * <p>
2719   * Description: <b>preliminary | final | amended | entered-in-error</b><br>
2720   * Type: <b>token</b><br>
2721   * Path: <b>DocumentReference.docStatus</b><br>
2722   * </p>
2723   */
2724  @SearchParamDefinition(name="doc-status", path="DocumentReference.docStatus", description="preliminary | final | amended | entered-in-error", type="token" )
2725  public static final String SP_DOC_STATUS = "doc-status";
2726 /**
2727   * <b>Fluent Client</b> search parameter constant for <b>doc-status</b>
2728   * <p>
2729   * Description: <b>preliminary | final | amended | entered-in-error</b><br>
2730   * Type: <b>token</b><br>
2731   * Path: <b>DocumentReference.docStatus</b><br>
2732   * </p>
2733   */
2734  public static final ca.uhn.fhir.rest.gclient.TokenClientParam DOC_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DOC_STATUS);
2735
2736 /**
2737   * Search parameter: <b>event-code</b>
2738   * <p>
2739   * Description: <b>Main clinical acts documented</b><br>
2740   * Type: <b>token</b><br>
2741   * Path: <b>DocumentReference.event.concept</b><br>
2742   * </p>
2743   */
2744  @SearchParamDefinition(name="event-code", path="DocumentReference.event.concept", description="Main clinical acts documented", type="token" )
2745  public static final String SP_EVENT_CODE = "event-code";
2746 /**
2747   * <b>Fluent Client</b> search parameter constant for <b>event-code</b>
2748   * <p>
2749   * Description: <b>Main clinical acts documented</b><br>
2750   * Type: <b>token</b><br>
2751   * Path: <b>DocumentReference.event.concept</b><br>
2752   * </p>
2753   */
2754  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT_CODE);
2755
2756 /**
2757   * Search parameter: <b>event-reference</b>
2758   * <p>
2759   * Description: <b>Main clinical acts documented</b><br>
2760   * Type: <b>reference</b><br>
2761   * Path: <b>DocumentReference.event.reference</b><br>
2762   * </p>
2763   */
2764  @SearchParamDefinition(name="event-reference", path="DocumentReference.event.reference", description="Main clinical acts documented", type="reference" )
2765  public static final String SP_EVENT_REFERENCE = "event-reference";
2766 /**
2767   * <b>Fluent Client</b> search parameter constant for <b>event-reference</b>
2768   * <p>
2769   * Description: <b>Main clinical acts documented</b><br>
2770   * Type: <b>reference</b><br>
2771   * Path: <b>DocumentReference.event.reference</b><br>
2772   * </p>
2773   */
2774  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam EVENT_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_EVENT_REFERENCE);
2775
2776/**
2777   * Constant for fluent queries to be used to add include statements. Specifies
2778   * the path value of "<b>DocumentReference:event-reference</b>".
2779   */
2780  public static final ca.uhn.fhir.model.api.Include INCLUDE_EVENT_REFERENCE = new ca.uhn.fhir.model.api.Include("DocumentReference:event-reference").toLocked();
2781
2782 /**
2783   * Search parameter: <b>facility</b>
2784   * <p>
2785   * Description: <b>Kind of facility where patient was seen</b><br>
2786   * Type: <b>token</b><br>
2787   * Path: <b>DocumentReference.facilityType</b><br>
2788   * </p>
2789   */
2790  @SearchParamDefinition(name="facility", path="DocumentReference.facilityType", description="Kind of facility where patient was seen", type="token" )
2791  public static final String SP_FACILITY = "facility";
2792 /**
2793   * <b>Fluent Client</b> search parameter constant for <b>facility</b>
2794   * <p>
2795   * Description: <b>Kind of facility where patient was seen</b><br>
2796   * Type: <b>token</b><br>
2797   * Path: <b>DocumentReference.facilityType</b><br>
2798   * </p>
2799   */
2800  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FACILITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FACILITY);
2801
2802 /**
2803   * Search parameter: <b>format-canonical</b>
2804   * <p>
2805   * Description: <b>Profile canonical content rules for the document</b><br>
2806   * Type: <b>reference</b><br>
2807   * Path: <b>(DocumentReference.content.profile.value as canonical)</b><br>
2808   * </p>
2809   */
2810  @SearchParamDefinition(name="format-canonical", path="(DocumentReference.content.profile.value as canonical)", description="Profile canonical content rules for the document", type="reference" )
2811  public static final String SP_FORMAT_CANONICAL = "format-canonical";
2812 /**
2813   * <b>Fluent Client</b> search parameter constant for <b>format-canonical</b>
2814   * <p>
2815   * Description: <b>Profile canonical content rules for the document</b><br>
2816   * Type: <b>reference</b><br>
2817   * Path: <b>(DocumentReference.content.profile.value as canonical)</b><br>
2818   * </p>
2819   */
2820  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FORMAT_CANONICAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FORMAT_CANONICAL);
2821
2822/**
2823   * Constant for fluent queries to be used to add include statements. Specifies
2824   * the path value of "<b>DocumentReference:format-canonical</b>".
2825   */
2826  public static final ca.uhn.fhir.model.api.Include INCLUDE_FORMAT_CANONICAL = new ca.uhn.fhir.model.api.Include("DocumentReference:format-canonical").toLocked();
2827
2828 /**
2829   * Search parameter: <b>format-code</b>
2830   * <p>
2831   * Description: <b>Format code content rules for the document</b><br>
2832   * Type: <b>token</b><br>
2833   * Path: <b>(DocumentReference.content.profile.value as Coding)</b><br>
2834   * </p>
2835   */
2836  @SearchParamDefinition(name="format-code", path="(DocumentReference.content.profile.value as Coding)", description="Format code content rules for the document", type="token" )
2837  public static final String SP_FORMAT_CODE = "format-code";
2838 /**
2839   * <b>Fluent Client</b> search parameter constant for <b>format-code</b>
2840   * <p>
2841   * Description: <b>Format code content rules for the document</b><br>
2842   * Type: <b>token</b><br>
2843   * Path: <b>(DocumentReference.content.profile.value as Coding)</b><br>
2844   * </p>
2845   */
2846  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORMAT_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORMAT_CODE);
2847
2848 /**
2849   * Search parameter: <b>format-uri</b>
2850   * <p>
2851   * Description: <b>Profile URI content rules for the document</b><br>
2852   * Type: <b>uri</b><br>
2853   * Path: <b>(DocumentReference.content.profile.value as uri)</b><br>
2854   * </p>
2855   */
2856  @SearchParamDefinition(name="format-uri", path="(DocumentReference.content.profile.value as uri)", description="Profile URI content rules for the document", type="uri" )
2857  public static final String SP_FORMAT_URI = "format-uri";
2858 /**
2859   * <b>Fluent Client</b> search parameter constant for <b>format-uri</b>
2860   * <p>
2861   * Description: <b>Profile URI content rules for the document</b><br>
2862   * Type: <b>uri</b><br>
2863   * Path: <b>(DocumentReference.content.profile.value as uri)</b><br>
2864   * </p>
2865   */
2866  public static final ca.uhn.fhir.rest.gclient.UriClientParam FORMAT_URI = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_FORMAT_URI);
2867
2868 /**
2869   * Search parameter: <b>language</b>
2870   * <p>
2871   * Description: <b>Human language of the content (BCP-47)</b><br>
2872   * Type: <b>token</b><br>
2873   * Path: <b>DocumentReference.content.attachment.language</b><br>
2874   * </p>
2875   */
2876  @SearchParamDefinition(name="language", path="DocumentReference.content.attachment.language", description="Human language of the content (BCP-47)", type="token" )
2877  public static final String SP_LANGUAGE = "language";
2878 /**
2879   * <b>Fluent Client</b> search parameter constant for <b>language</b>
2880   * <p>
2881   * Description: <b>Human language of the content (BCP-47)</b><br>
2882   * Type: <b>token</b><br>
2883   * Path: <b>DocumentReference.content.attachment.language</b><br>
2884   * </p>
2885   */
2886  public static final ca.uhn.fhir.rest.gclient.TokenClientParam LANGUAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_LANGUAGE);
2887
2888 /**
2889   * Search parameter: <b>location</b>
2890   * <p>
2891   * Description: <b>Uri where the data can be found</b><br>
2892   * Type: <b>uri</b><br>
2893   * Path: <b>DocumentReference.content.attachment.url</b><br>
2894   * </p>
2895   */
2896  @SearchParamDefinition(name="location", path="DocumentReference.content.attachment.url", description="Uri where the data can be found", type="uri" )
2897  public static final String SP_LOCATION = "location";
2898 /**
2899   * <b>Fluent Client</b> search parameter constant for <b>location</b>
2900   * <p>
2901   * Description: <b>Uri where the data can be found</b><br>
2902   * Type: <b>uri</b><br>
2903   * Path: <b>DocumentReference.content.attachment.url</b><br>
2904   * </p>
2905   */
2906  public static final ca.uhn.fhir.rest.gclient.UriClientParam LOCATION = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_LOCATION);
2907
2908 /**
2909   * Search parameter: <b>period</b>
2910   * <p>
2911   * Description: <b>Time of service that is being documented</b><br>
2912   * Type: <b>date</b><br>
2913   * Path: <b>DocumentReference.period</b><br>
2914   * </p>
2915   */
2916  @SearchParamDefinition(name="period", path="DocumentReference.period", description="Time of service that is being documented", type="date" )
2917  public static final String SP_PERIOD = "period";
2918 /**
2919   * <b>Fluent Client</b> search parameter constant for <b>period</b>
2920   * <p>
2921   * Description: <b>Time of service that is being documented</b><br>
2922   * Type: <b>date</b><br>
2923   * Path: <b>DocumentReference.period</b><br>
2924   * </p>
2925   */
2926  public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD);
2927
2928 /**
2929   * Search parameter: <b>relatesto</b>
2930   * <p>
2931   * Description: <b>Target of the relationship</b><br>
2932   * Type: <b>reference</b><br>
2933   * Path: <b>DocumentReference.relatesTo.target</b><br>
2934   * </p>
2935   */
2936  @SearchParamDefinition(name="relatesto", path="DocumentReference.relatesTo.target", description="Target of the relationship", type="reference", target={DocumentReference.class } )
2937  public static final String SP_RELATESTO = "relatesto";
2938 /**
2939   * <b>Fluent Client</b> search parameter constant for <b>relatesto</b>
2940   * <p>
2941   * Description: <b>Target of the relationship</b><br>
2942   * Type: <b>reference</b><br>
2943   * Path: <b>DocumentReference.relatesTo.target</b><br>
2944   * </p>
2945   */
2946  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATESTO = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATESTO);
2947
2948/**
2949   * Constant for fluent queries to be used to add include statements. Specifies
2950   * the path value of "<b>DocumentReference:relatesto</b>".
2951   */
2952  public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATESTO = new ca.uhn.fhir.model.api.Include("DocumentReference:relatesto").toLocked();
2953
2954 /**
2955   * Search parameter: <b>relation</b>
2956   * <p>
2957   * Description: <b>replaces | transforms | signs | appends</b><br>
2958   * Type: <b>token</b><br>
2959   * Path: <b>DocumentReference.relatesTo.code</b><br>
2960   * </p>
2961   */
2962  @SearchParamDefinition(name="relation", path="DocumentReference.relatesTo.code", description="replaces | transforms | signs | appends", type="token" )
2963  public static final String SP_RELATION = "relation";
2964 /**
2965   * <b>Fluent Client</b> search parameter constant for <b>relation</b>
2966   * <p>
2967   * Description: <b>replaces | transforms | signs | appends</b><br>
2968   * Type: <b>token</b><br>
2969   * Path: <b>DocumentReference.relatesTo.code</b><br>
2970   * </p>
2971   */
2972  public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATION);
2973
2974 /**
2975   * Search parameter: <b>relationship</b>
2976   * <p>
2977   * Description: <b>Combination of relation and relatesTo</b><br>
2978   * Type: <b>composite</b><br>
2979   * Path: <b>DocumentReference.relatesTo</b><br>
2980   * </p>
2981   */
2982  @SearchParamDefinition(name="relationship", path="DocumentReference.relatesTo", description="Combination of relation and relatesTo", type="composite", compositeOf={"relatesto", "relation"} )
2983  public static final String SP_RELATIONSHIP = "relationship";
2984 /**
2985   * <b>Fluent Client</b> search parameter constant for <b>relationship</b>
2986   * <p>
2987   * Description: <b>Combination of relation and relatesTo</b><br>
2988   * Type: <b>composite</b><br>
2989   * Path: <b>DocumentReference.relatesTo</b><br>
2990   * </p>
2991   */
2992  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.ReferenceClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> RELATIONSHIP = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.ReferenceClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(SP_RELATIONSHIP);
2993
2994 /**
2995   * Search parameter: <b>security-label</b>
2996   * <p>
2997   * Description: <b>Document security-tags</b><br>
2998   * Type: <b>token</b><br>
2999   * Path: <b>DocumentReference.securityLabel</b><br>
3000   * </p>
3001   */
3002  @SearchParamDefinition(name="security-label", path="DocumentReference.securityLabel", description="Document security-tags", type="token" )
3003  public static final String SP_SECURITY_LABEL = "security-label";
3004 /**
3005   * <b>Fluent Client</b> search parameter constant for <b>security-label</b>
3006   * <p>
3007   * Description: <b>Document security-tags</b><br>
3008   * Type: <b>token</b><br>
3009   * Path: <b>DocumentReference.securityLabel</b><br>
3010   * </p>
3011   */
3012  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SECURITY_LABEL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SECURITY_LABEL);
3013
3014 /**
3015   * Search parameter: <b>setting</b>
3016   * <p>
3017   * Description: <b>Additional details about where the content was created (e.g. clinical specialty)</b><br>
3018   * Type: <b>token</b><br>
3019   * Path: <b>DocumentReference.practiceSetting</b><br>
3020   * </p>
3021   */
3022  @SearchParamDefinition(name="setting", path="DocumentReference.practiceSetting", description="Additional details about where the content was created (e.g. clinical specialty)", type="token" )
3023  public static final String SP_SETTING = "setting";
3024 /**
3025   * <b>Fluent Client</b> search parameter constant for <b>setting</b>
3026   * <p>
3027   * Description: <b>Additional details about where the content was created (e.g. clinical specialty)</b><br>
3028   * Type: <b>token</b><br>
3029   * Path: <b>DocumentReference.practiceSetting</b><br>
3030   * </p>
3031   */
3032  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SETTING = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SETTING);
3033
3034 /**
3035   * Search parameter: <b>status</b>
3036   * <p>
3037   * Description: <b>current | superseded | entered-in-error</b><br>
3038   * Type: <b>token</b><br>
3039   * Path: <b>DocumentReference.status</b><br>
3040   * </p>
3041   */
3042  @SearchParamDefinition(name="status", path="DocumentReference.status", description="current | superseded | entered-in-error", type="token" )
3043  public static final String SP_STATUS = "status";
3044 /**
3045   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3046   * <p>
3047   * Description: <b>current | superseded | entered-in-error</b><br>
3048   * Type: <b>token</b><br>
3049   * Path: <b>DocumentReference.status</b><br>
3050   * </p>
3051   */
3052  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3053
3054 /**
3055   * Search parameter: <b>subject</b>
3056   * <p>
3057   * Description: <b>Who/what is the subject of the document</b><br>
3058   * Type: <b>reference</b><br>
3059   * Path: <b>DocumentReference.subject</b><br>
3060   * </p>
3061   */
3062  @SearchParamDefinition(name="subject", path="DocumentReference.subject", description="Who/what is the subject of the document", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Account.class, ActivityDefinition.class, ActorDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, ArtifactAssessment.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CarePlan.class, CareTeam.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceDispense.class, DeviceMetric.class, DeviceRequest.class, DeviceUsage.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceReport.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, FormularyItem.class, GenomicStudy.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingSelection.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, InventoryReport.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Permission.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestOrchestration.class, Requirements.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, Transport.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
3063  public static final String SP_SUBJECT = "subject";
3064 /**
3065   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
3066   * <p>
3067   * Description: <b>Who/what is the subject of the document</b><br>
3068   * Type: <b>reference</b><br>
3069   * Path: <b>DocumentReference.subject</b><br>
3070   * </p>
3071   */
3072  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
3073
3074/**
3075   * Constant for fluent queries to be used to add include statements. Specifies
3076   * the path value of "<b>DocumentReference:subject</b>".
3077   */
3078  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DocumentReference:subject").toLocked();
3079
3080 /**
3081   * Search parameter: <b>identifier</b>
3082   * <p>
3083   * Description: <b>Multiple Resources: 
3084
3085* [AllergyIntolerance](allergyintolerance.html): External ids for this item
3086* [CarePlan](careplan.html): External Ids for this plan
3087* [CareTeam](careteam.html): External Ids for this team
3088* [Composition](composition.html): Version-independent identifier for the Composition
3089* [Condition](condition.html): A unique identifier of the condition record
3090* [Consent](consent.html): Identifier for this record (external references)
3091* [DetectedIssue](detectedissue.html): Unique id for the detected issue
3092* [DeviceRequest](devicerequest.html): Business identifier for request/order
3093* [DiagnosticReport](diagnosticreport.html): An identifier for the report
3094* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
3095* [DocumentReference](documentreference.html): Identifier of the attachment binary
3096* [Encounter](encounter.html): Identifier(s) by which this encounter is known
3097* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
3098* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
3099* [Goal](goal.html): External Ids for this goal
3100* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
3101* [Immunization](immunization.html): Business identifier
3102* [List](list.html): Business identifier
3103* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
3104* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
3105* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
3106* [MedicationUsage](medicationusage.html): Return statements with this external identifier
3107* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
3108* [Observation](observation.html): The unique id for a particular observation
3109* [Procedure](procedure.html): A unique identifier for a procedure
3110* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
3111* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
3112* [SupplyDelivery](supplydelivery.html): External identifier
3113* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
3114* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
3115</b><br>
3116   * Type: <b>token</b><br>
3117   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
3118   * </p>
3119   */
3120  @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [List](list.html): Business identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationUsage](medicationusage.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
3121  public static final String SP_IDENTIFIER = "identifier";
3122 /**
3123   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3124   * <p>
3125   * Description: <b>Multiple Resources: 
3126
3127* [AllergyIntolerance](allergyintolerance.html): External ids for this item
3128* [CarePlan](careplan.html): External Ids for this plan
3129* [CareTeam](careteam.html): External Ids for this team
3130* [Composition](composition.html): Version-independent identifier for the Composition
3131* [Condition](condition.html): A unique identifier of the condition record
3132* [Consent](consent.html): Identifier for this record (external references)
3133* [DetectedIssue](detectedissue.html): Unique id for the detected issue
3134* [DeviceRequest](devicerequest.html): Business identifier for request/order
3135* [DiagnosticReport](diagnosticreport.html): An identifier for the report
3136* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
3137* [DocumentReference](documentreference.html): Identifier of the attachment binary
3138* [Encounter](encounter.html): Identifier(s) by which this encounter is known
3139* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
3140* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
3141* [Goal](goal.html): External Ids for this goal
3142* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
3143* [Immunization](immunization.html): Business identifier
3144* [List](list.html): Business identifier
3145* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
3146* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
3147* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
3148* [MedicationUsage](medicationusage.html): Return statements with this external identifier
3149* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
3150* [Observation](observation.html): The unique id for a particular observation
3151* [Procedure](procedure.html): A unique identifier for a procedure
3152* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
3153* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
3154* [SupplyDelivery](supplydelivery.html): External identifier
3155* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
3156* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
3157</b><br>
3158   * Type: <b>token</b><br>
3159   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
3160   * </p>
3161   */
3162  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3163
3164 /**
3165   * Search parameter: <b>patient</b>
3166   * <p>
3167   * Description: <b>Multiple Resources: 
3168
3169* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
3170* [CarePlan](careplan.html): Who the care plan is for
3171* [CareTeam](careteam.html): Who care team is for
3172* [ClinicalImpression](clinicalimpression.html): Patient assessed
3173* [Composition](composition.html): Who and/or what the composition is about
3174* [Condition](condition.html): Who has the condition?
3175* [Consent](consent.html): Who the consent applies to
3176* [DetectedIssue](detectedissue.html): Associated patient
3177* [DeviceRequest](devicerequest.html): Individual the service is ordered for
3178* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
3179* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
3180* [DocumentManifest](documentmanifest.html): The subject of the set of documents
3181* [DocumentReference](documentreference.html): Who/what is the subject of the document
3182* [Encounter](encounter.html): The patient present at the encounter
3183* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
3184* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
3185* [Flag](flag.html): The identity of a subject to list flags for
3186* [Goal](goal.html): Who this goal is intended for
3187* [ImagingStudy](imagingstudy.html): Who the study is about
3188* [Immunization](immunization.html): The patient for the vaccination record
3189* [List](list.html): If all resources have the same subject
3190* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
3191* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
3192* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
3193* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
3194* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
3195* [Observation](observation.html): The subject that the observation is about (if patient)
3196* [Procedure](procedure.html): Search by subject - a patient
3197* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
3198* [ServiceRequest](servicerequest.html): Search by subject - a patient
3199* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
3200* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
3201* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
3202</b><br>
3203   * Type: <b>reference</b><br>
3204   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.subject | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | VisionPrescription.patient</b><br>
3205   * </p>
3206   */
3207  @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.subject | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentManifest](documentmanifest.html): The subject of the set of documents\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [List](list.html): If all resources have the same subject\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", target={BiologicallyDerivedProduct.class, Device.class, Group.class, Location.class, Medication.class, NutritionProduct.class, Organization.class, Patient.class, Practitioner.class, Procedure.class, Substance.class } )
3208  public static final String SP_PATIENT = "patient";
3209 /**
3210   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3211   * <p>
3212   * Description: <b>Multiple Resources: 
3213
3214* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
3215* [CarePlan](careplan.html): Who the care plan is for
3216* [CareTeam](careteam.html): Who care team is for
3217* [ClinicalImpression](clinicalimpression.html): Patient assessed
3218* [Composition](composition.html): Who and/or what the composition is about
3219* [Condition](condition.html): Who has the condition?
3220* [Consent](consent.html): Who the consent applies to
3221* [DetectedIssue](detectedissue.html): Associated patient
3222* [DeviceRequest](devicerequest.html): Individual the service is ordered for
3223* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
3224* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
3225* [DocumentManifest](documentmanifest.html): The subject of the set of documents
3226* [DocumentReference](documentreference.html): Who/what is the subject of the document
3227* [Encounter](encounter.html): The patient present at the encounter
3228* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
3229* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
3230* [Flag](flag.html): The identity of a subject to list flags for
3231* [Goal](goal.html): Who this goal is intended for
3232* [ImagingStudy](imagingstudy.html): Who the study is about
3233* [Immunization](immunization.html): The patient for the vaccination record
3234* [List](list.html): If all resources have the same subject
3235* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
3236* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
3237* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
3238* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
3239* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
3240* [Observation](observation.html): The subject that the observation is about (if patient)
3241* [Procedure](procedure.html): Search by subject - a patient
3242* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
3243* [ServiceRequest](servicerequest.html): Search by subject - a patient
3244* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
3245* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
3246* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
3247</b><br>
3248   * Type: <b>reference</b><br>
3249   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.subject | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | VisionPrescription.patient</b><br>
3250   * </p>
3251   */
3252  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3253
3254/**
3255   * Constant for fluent queries to be used to add include statements. Specifies
3256   * the path value of "<b>DocumentReference:patient</b>".
3257   */
3258  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DocumentReference:patient").toLocked();
3259
3260 /**
3261   * Search parameter: <b>type</b>
3262   * <p>
3263   * Description: <b>Multiple Resources: 
3264
3265* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
3266* [Composition](composition.html): Kind of composition (LOINC if possible)
3267* [DocumentManifest](documentmanifest.html): Kind of document set
3268* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
3269* [Encounter](encounter.html): Specific type of encounter
3270* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
3271</b><br>
3272   * Type: <b>token</b><br>
3273   * Path: <b>AllergyIntolerance.type | Composition.type | DocumentManifest.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type</b><br>
3274   * </p>
3275   */
3276  @SearchParamDefinition(name="type", path="AllergyIntolerance.type | Composition.type | DocumentManifest.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)\r\n* [Composition](composition.html): Kind of composition (LOINC if possible)\r\n* [DocumentManifest](documentmanifest.html): Kind of document set\r\n* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)\r\n* [Encounter](encounter.html): Specific type of encounter\r\n* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management\r\n", type="token" )
3277  public static final String SP_TYPE = "type";
3278 /**
3279   * <b>Fluent Client</b> search parameter constant for <b>type</b>
3280   * <p>
3281   * Description: <b>Multiple Resources: 
3282
3283* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
3284* [Composition](composition.html): Kind of composition (LOINC if possible)
3285* [DocumentManifest](documentmanifest.html): Kind of document set
3286* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
3287* [Encounter](encounter.html): Specific type of encounter
3288* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
3289</b><br>
3290   * Type: <b>token</b><br>
3291   * Path: <b>AllergyIntolerance.type | Composition.type | DocumentManifest.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type</b><br>
3292   * </p>
3293   */
3294  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
3295
3296
3297}
3298