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