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