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