001package org.hl7.fhir.r4.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import org.hl7.fhir.utilities.Utilities;
040import ca.uhn.fhir.model.api.annotation.ResourceDef;
041import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.ChildOrder;
044import ca.uhn.fhir.model.api.annotation.Description;
045import ca.uhn.fhir.model.api.annotation.Block;
046import org.hl7.fhir.instance.model.api.*;
047import org.hl7.fhir.exceptions.FHIRException;
048/**
049 * 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.).
050 */
051@ResourceDef(name="Composition", profile="http://hl7.org/fhir/StructureDefinition/Composition")
052public class Composition extends DomainResource {
053
054    public enum CompositionStatus {
055        /**
056         * This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified.
057         */
058        PRELIMINARY, 
059        /**
060         * This version of the composition is complete and verified by an appropriate person and no further work is planned. Any subsequent updates would be on a new version of the composition.
061         */
062        FINAL, 
063        /**
064         * The composition content or the referenced resources have been modified (edited or added to) subsequent to being released as "final" and the composition is complete and verified by an authorized person.
065         */
066        AMENDED, 
067        /**
068         * The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid.
069         */
070        ENTEREDINERROR, 
071        /**
072         * added to help the parsers with the generic types
073         */
074        NULL;
075        public static CompositionStatus fromCode(String codeString) throws FHIRException {
076            if (codeString == null || "".equals(codeString))
077                return null;
078        if ("preliminary".equals(codeString))
079          return PRELIMINARY;
080        if ("final".equals(codeString))
081          return FINAL;
082        if ("amended".equals(codeString))
083          return AMENDED;
084        if ("entered-in-error".equals(codeString))
085          return ENTEREDINERROR;
086        if (Configuration.isAcceptInvalidEnums())
087          return null;
088        else
089          throw new FHIRException("Unknown CompositionStatus code '"+codeString+"'");
090        }
091        public String toCode() {
092          switch (this) {
093            case PRELIMINARY: return "preliminary";
094            case FINAL: return "final";
095            case AMENDED: return "amended";
096            case ENTEREDINERROR: return "entered-in-error";
097            default: return "?";
098          }
099        }
100        public String getSystem() {
101          switch (this) {
102            case PRELIMINARY: return "http://hl7.org/fhir/composition-status";
103            case FINAL: return "http://hl7.org/fhir/composition-status";
104            case AMENDED: return "http://hl7.org/fhir/composition-status";
105            case ENTEREDINERROR: return "http://hl7.org/fhir/composition-status";
106            default: return "?";
107          }
108        }
109        public String getDefinition() {
110          switch (this) {
111            case PRELIMINARY: return "This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified.";
112            case FINAL: return "This version of the composition is complete and verified by an appropriate person and no further work is planned. Any subsequent updates would be on a new version of the composition.";
113            case AMENDED: return "The composition content or the referenced resources have been modified (edited or added to) subsequent to being released as \"final\" and the composition is complete and verified by an authorized person.";
114            case ENTEREDINERROR: return "The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid.";
115            default: return "?";
116          }
117        }
118        public String getDisplay() {
119          switch (this) {
120            case PRELIMINARY: return "Preliminary";
121            case FINAL: return "Final";
122            case AMENDED: return "Amended";
123            case ENTEREDINERROR: return "Entered in Error";
124            default: return "?";
125          }
126        }
127    }
128
129  public static class CompositionStatusEnumFactory implements EnumFactory<CompositionStatus> {
130    public CompositionStatus fromCode(String codeString) throws IllegalArgumentException {
131      if (codeString == null || "".equals(codeString))
132            if (codeString == null || "".equals(codeString))
133                return null;
134        if ("preliminary".equals(codeString))
135          return CompositionStatus.PRELIMINARY;
136        if ("final".equals(codeString))
137          return CompositionStatus.FINAL;
138        if ("amended".equals(codeString))
139          return CompositionStatus.AMENDED;
140        if ("entered-in-error".equals(codeString))
141          return CompositionStatus.ENTEREDINERROR;
142        throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'");
143        }
144        public Enumeration<CompositionStatus> fromType(Base code) throws FHIRException {
145          if (code == null)
146            return null;
147          if (code.isEmpty())
148            return new Enumeration<CompositionStatus>(this);
149          String codeString = ((PrimitiveType) code).asStringValue();
150          if (codeString == null || "".equals(codeString))
151            return null;
152        if ("preliminary".equals(codeString))
153          return new Enumeration<CompositionStatus>(this, CompositionStatus.PRELIMINARY);
154        if ("final".equals(codeString))
155          return new Enumeration<CompositionStatus>(this, CompositionStatus.FINAL);
156        if ("amended".equals(codeString))
157          return new Enumeration<CompositionStatus>(this, CompositionStatus.AMENDED);
158        if ("entered-in-error".equals(codeString))
159          return new Enumeration<CompositionStatus>(this, CompositionStatus.ENTEREDINERROR);
160        throw new FHIRException("Unknown CompositionStatus code '"+codeString+"'");
161        }
162    public String toCode(CompositionStatus code) {
163      if (code == CompositionStatus.PRELIMINARY)
164        return "preliminary";
165      if (code == CompositionStatus.FINAL)
166        return "final";
167      if (code == CompositionStatus.AMENDED)
168        return "amended";
169      if (code == CompositionStatus.ENTEREDINERROR)
170        return "entered-in-error";
171      return "?";
172      }
173    public String toSystem(CompositionStatus code) {
174      return code.getSystem();
175      }
176    }
177
178    public enum DocumentConfidentiality {
179        /**
180         * null
181         */
182        U, 
183        /**
184         * null
185         */
186        L, 
187        /**
188         * null
189         */
190        M, 
191        /**
192         * null
193         */
194        N, 
195        /**
196         * null
197         */
198        R, 
199        /**
200         * null
201         */
202        V, 
203        /**
204         * added to help the parsers with the generic types
205         */
206        NULL;
207        public static DocumentConfidentiality fromCode(String codeString) throws FHIRException {
208            if (codeString == null || "".equals(codeString))
209                return null;
210        if ("U".equals(codeString))
211          return U;
212        if ("L".equals(codeString))
213          return L;
214        if ("M".equals(codeString))
215          return M;
216        if ("N".equals(codeString))
217          return N;
218        if ("R".equals(codeString))
219          return R;
220        if ("V".equals(codeString))
221          return V;
222        if (Configuration.isAcceptInvalidEnums())
223          return null;
224        else
225          throw new FHIRException("Unknown DocumentConfidentiality code '"+codeString+"'");
226        }
227        public String toCode() {
228          switch (this) {
229            case U: return "U";
230            case L: return "L";
231            case M: return "M";
232            case N: return "N";
233            case R: return "R";
234            case V: return "V";
235            default: return "?";
236          }
237        }
238        public String getSystem() {
239          switch (this) {
240            case U: return "http://terminology.hl7.org/CodeSystem/v3-Confidentiality";
241            case L: return "http://terminology.hl7.org/CodeSystem/v3-Confidentiality";
242            case M: return "http://terminology.hl7.org/CodeSystem/v3-Confidentiality";
243            case N: return "http://terminology.hl7.org/CodeSystem/v3-Confidentiality";
244            case R: return "http://terminology.hl7.org/CodeSystem/v3-Confidentiality";
245            case V: return "http://terminology.hl7.org/CodeSystem/v3-Confidentiality";
246            default: return "?";
247          }
248        }
249        public String getDefinition() {
250          switch (this) {
251            case U: return "";
252            case L: return "";
253            case M: return "";
254            case N: return "";
255            case R: return "";
256            case V: return "";
257            default: return "?";
258          }
259        }
260        public String getDisplay() {
261          switch (this) {
262            case U: return "U";
263            case L: return "L";
264            case M: return "M";
265            case N: return "N";
266            case R: return "R";
267            case V: return "V";
268            default: return "?";
269          }
270        }
271    }
272
273  public static class DocumentConfidentialityEnumFactory implements EnumFactory<DocumentConfidentiality> {
274    public DocumentConfidentiality fromCode(String codeString) throws IllegalArgumentException {
275      if (codeString == null || "".equals(codeString))
276            if (codeString == null || "".equals(codeString))
277                return null;
278        if ("U".equals(codeString))
279          return DocumentConfidentiality.U;
280        if ("L".equals(codeString))
281          return DocumentConfidentiality.L;
282        if ("M".equals(codeString))
283          return DocumentConfidentiality.M;
284        if ("N".equals(codeString))
285          return DocumentConfidentiality.N;
286        if ("R".equals(codeString))
287          return DocumentConfidentiality.R;
288        if ("V".equals(codeString))
289          return DocumentConfidentiality.V;
290        throw new IllegalArgumentException("Unknown DocumentConfidentiality code '"+codeString+"'");
291        }
292        public Enumeration<DocumentConfidentiality> fromType(Base code) throws FHIRException {
293          if (code == null)
294            return null;
295          if (code.isEmpty())
296            return new Enumeration<DocumentConfidentiality>(this);
297          String codeString = ((PrimitiveType) code).asStringValue();
298          if (codeString == null || "".equals(codeString))
299            return null;
300        if ("U".equals(codeString))
301          return new Enumeration<DocumentConfidentiality>(this, DocumentConfidentiality.U);
302        if ("L".equals(codeString))
303          return new Enumeration<DocumentConfidentiality>(this, DocumentConfidentiality.L);
304        if ("M".equals(codeString))
305          return new Enumeration<DocumentConfidentiality>(this, DocumentConfidentiality.M);
306        if ("N".equals(codeString))
307          return new Enumeration<DocumentConfidentiality>(this, DocumentConfidentiality.N);
308        if ("R".equals(codeString))
309          return new Enumeration<DocumentConfidentiality>(this, DocumentConfidentiality.R);
310        if ("V".equals(codeString))
311          return new Enumeration<DocumentConfidentiality>(this, DocumentConfidentiality.V);
312        throw new FHIRException("Unknown DocumentConfidentiality code '"+codeString+"'");
313        }
314    public String toCode(DocumentConfidentiality code) {
315      if (code == DocumentConfidentiality.U)
316        return "U";
317      if (code == DocumentConfidentiality.L)
318        return "L";
319      if (code == DocumentConfidentiality.M)
320        return "M";
321      if (code == DocumentConfidentiality.N)
322        return "N";
323      if (code == DocumentConfidentiality.R)
324        return "R";
325      if (code == DocumentConfidentiality.V)
326        return "V";
327      return "?";
328      }
329    public String toSystem(DocumentConfidentiality code) {
330      return code.getSystem();
331      }
332    }
333
334    public enum CompositionAttestationMode {
335        /**
336         * The person authenticated the content in their personal capacity.
337         */
338        PERSONAL, 
339        /**
340         * The person authenticated the content in their professional capacity.
341         */
342        PROFESSIONAL, 
343        /**
344         * The person authenticated the content and accepted legal responsibility for its content.
345         */
346        LEGAL, 
347        /**
348         * The organization authenticated the content as consistent with their policies and procedures.
349         */
350        OFFICIAL, 
351        /**
352         * added to help the parsers with the generic types
353         */
354        NULL;
355        public static CompositionAttestationMode fromCode(String codeString) throws FHIRException {
356            if (codeString == null || "".equals(codeString))
357                return null;
358        if ("personal".equals(codeString))
359          return PERSONAL;
360        if ("professional".equals(codeString))
361          return PROFESSIONAL;
362        if ("legal".equals(codeString))
363          return LEGAL;
364        if ("official".equals(codeString))
365          return OFFICIAL;
366        if (Configuration.isAcceptInvalidEnums())
367          return null;
368        else
369          throw new FHIRException("Unknown CompositionAttestationMode code '"+codeString+"'");
370        }
371        public String toCode() {
372          switch (this) {
373            case PERSONAL: return "personal";
374            case PROFESSIONAL: return "professional";
375            case LEGAL: return "legal";
376            case OFFICIAL: return "official";
377            default: return "?";
378          }
379        }
380        public String getSystem() {
381          switch (this) {
382            case PERSONAL: return "http://hl7.org/fhir/composition-attestation-mode";
383            case PROFESSIONAL: return "http://hl7.org/fhir/composition-attestation-mode";
384            case LEGAL: return "http://hl7.org/fhir/composition-attestation-mode";
385            case OFFICIAL: return "http://hl7.org/fhir/composition-attestation-mode";
386            default: return "?";
387          }
388        }
389        public String getDefinition() {
390          switch (this) {
391            case PERSONAL: return "The person authenticated the content in their personal capacity.";
392            case PROFESSIONAL: return "The person authenticated the content in their professional capacity.";
393            case LEGAL: return "The person authenticated the content and accepted legal responsibility for its content.";
394            case OFFICIAL: return "The organization authenticated the content as consistent with their policies and procedures.";
395            default: return "?";
396          }
397        }
398        public String getDisplay() {
399          switch (this) {
400            case PERSONAL: return "Personal";
401            case PROFESSIONAL: return "Professional";
402            case LEGAL: return "Legal";
403            case OFFICIAL: return "Official";
404            default: return "?";
405          }
406        }
407    }
408
409  public static class CompositionAttestationModeEnumFactory implements EnumFactory<CompositionAttestationMode> {
410    public CompositionAttestationMode fromCode(String codeString) throws IllegalArgumentException {
411      if (codeString == null || "".equals(codeString))
412            if (codeString == null || "".equals(codeString))
413                return null;
414        if ("personal".equals(codeString))
415          return CompositionAttestationMode.PERSONAL;
416        if ("professional".equals(codeString))
417          return CompositionAttestationMode.PROFESSIONAL;
418        if ("legal".equals(codeString))
419          return CompositionAttestationMode.LEGAL;
420        if ("official".equals(codeString))
421          return CompositionAttestationMode.OFFICIAL;
422        throw new IllegalArgumentException("Unknown CompositionAttestationMode code '"+codeString+"'");
423        }
424        public Enumeration<CompositionAttestationMode> fromType(Base code) throws FHIRException {
425          if (code == null)
426            return null;
427          if (code.isEmpty())
428            return new Enumeration<CompositionAttestationMode>(this);
429          String codeString = ((PrimitiveType) code).asStringValue();
430          if (codeString == null || "".equals(codeString))
431            return null;
432        if ("personal".equals(codeString))
433          return new Enumeration<CompositionAttestationMode>(this, CompositionAttestationMode.PERSONAL);
434        if ("professional".equals(codeString))
435          return new Enumeration<CompositionAttestationMode>(this, CompositionAttestationMode.PROFESSIONAL);
436        if ("legal".equals(codeString))
437          return new Enumeration<CompositionAttestationMode>(this, CompositionAttestationMode.LEGAL);
438        if ("official".equals(codeString))
439          return new Enumeration<CompositionAttestationMode>(this, CompositionAttestationMode.OFFICIAL);
440        throw new FHIRException("Unknown CompositionAttestationMode code '"+codeString+"'");
441        }
442    public String toCode(CompositionAttestationMode code) {
443      if (code == CompositionAttestationMode.PERSONAL)
444        return "personal";
445      if (code == CompositionAttestationMode.PROFESSIONAL)
446        return "professional";
447      if (code == CompositionAttestationMode.LEGAL)
448        return "legal";
449      if (code == CompositionAttestationMode.OFFICIAL)
450        return "official";
451      return "?";
452      }
453    public String toSystem(CompositionAttestationMode code) {
454      return code.getSystem();
455      }
456    }
457
458    public enum DocumentRelationshipType {
459        /**
460         * This document logically replaces or supersedes the target document.
461         */
462        REPLACES, 
463        /**
464         * This document was generated by transforming the target document (e.g. format or language conversion).
465         */
466        TRANSFORMS, 
467        /**
468         * This document is a signature of the target document.
469         */
470        SIGNS, 
471        /**
472         * This document adds additional information to the target document.
473         */
474        APPENDS, 
475        /**
476         * added to help the parsers with the generic types
477         */
478        NULL;
479        public static DocumentRelationshipType fromCode(String codeString) throws FHIRException {
480            if (codeString == null || "".equals(codeString))
481                return null;
482        if ("replaces".equals(codeString))
483          return REPLACES;
484        if ("transforms".equals(codeString))
485          return TRANSFORMS;
486        if ("signs".equals(codeString))
487          return SIGNS;
488        if ("appends".equals(codeString))
489          return APPENDS;
490        if (Configuration.isAcceptInvalidEnums())
491          return null;
492        else
493          throw new FHIRException("Unknown DocumentRelationshipType code '"+codeString+"'");
494        }
495        public String toCode() {
496          switch (this) {
497            case REPLACES: return "replaces";
498            case TRANSFORMS: return "transforms";
499            case SIGNS: return "signs";
500            case APPENDS: return "appends";
501            default: return "?";
502          }
503        }
504        public String getSystem() {
505          switch (this) {
506            case REPLACES: return "http://hl7.org/fhir/document-relationship-type";
507            case TRANSFORMS: return "http://hl7.org/fhir/document-relationship-type";
508            case SIGNS: return "http://hl7.org/fhir/document-relationship-type";
509            case APPENDS: return "http://hl7.org/fhir/document-relationship-type";
510            default: return "?";
511          }
512        }
513        public String getDefinition() {
514          switch (this) {
515            case REPLACES: return "This document logically replaces or supersedes the target document.";
516            case TRANSFORMS: return "This document was generated by transforming the target document (e.g. format or language conversion).";
517            case SIGNS: return "This document is a signature of the target document.";
518            case APPENDS: return "This document adds additional information to the target document.";
519            default: return "?";
520          }
521        }
522        public String getDisplay() {
523          switch (this) {
524            case REPLACES: return "Replaces";
525            case TRANSFORMS: return "Transforms";
526            case SIGNS: return "Signs";
527            case APPENDS: return "Appends";
528            default: return "?";
529          }
530        }
531    }
532
533  public static class DocumentRelationshipTypeEnumFactory implements EnumFactory<DocumentRelationshipType> {
534    public DocumentRelationshipType fromCode(String codeString) throws IllegalArgumentException {
535      if (codeString == null || "".equals(codeString))
536            if (codeString == null || "".equals(codeString))
537                return null;
538        if ("replaces".equals(codeString))
539          return DocumentRelationshipType.REPLACES;
540        if ("transforms".equals(codeString))
541          return DocumentRelationshipType.TRANSFORMS;
542        if ("signs".equals(codeString))
543          return DocumentRelationshipType.SIGNS;
544        if ("appends".equals(codeString))
545          return DocumentRelationshipType.APPENDS;
546        throw new IllegalArgumentException("Unknown DocumentRelationshipType code '"+codeString+"'");
547        }
548        public Enumeration<DocumentRelationshipType> fromType(Base code) throws FHIRException {
549          if (code == null)
550            return null;
551          if (code.isEmpty())
552            return new Enumeration<DocumentRelationshipType>(this);
553          String codeString = ((PrimitiveType) code).asStringValue();
554          if (codeString == null || "".equals(codeString))
555            return null;
556        if ("replaces".equals(codeString))
557          return new Enumeration<DocumentRelationshipType>(this, DocumentRelationshipType.REPLACES);
558        if ("transforms".equals(codeString))
559          return new Enumeration<DocumentRelationshipType>(this, DocumentRelationshipType.TRANSFORMS);
560        if ("signs".equals(codeString))
561          return new Enumeration<DocumentRelationshipType>(this, DocumentRelationshipType.SIGNS);
562        if ("appends".equals(codeString))
563          return new Enumeration<DocumentRelationshipType>(this, DocumentRelationshipType.APPENDS);
564        throw new FHIRException("Unknown DocumentRelationshipType code '"+codeString+"'");
565        }
566    public String toCode(DocumentRelationshipType code) {
567      if (code == DocumentRelationshipType.REPLACES)
568        return "replaces";
569      if (code == DocumentRelationshipType.TRANSFORMS)
570        return "transforms";
571      if (code == DocumentRelationshipType.SIGNS)
572        return "signs";
573      if (code == DocumentRelationshipType.APPENDS)
574        return "appends";
575      return "?";
576      }
577    public String toSystem(DocumentRelationshipType code) {
578      return code.getSystem();
579      }
580    }
581
582    public enum SectionMode {
583        /**
584         * This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes.
585         */
586        WORKING, 
587        /**
588         * This list was prepared as a snapshot. It should not be assumed to be current.
589         */
590        SNAPSHOT, 
591        /**
592         * A point-in-time list that shows what changes have been made or recommended.  E.g. a discharge medication list showing what was added and removed during an encounter.
593         */
594        CHANGES, 
595        /**
596         * added to help the parsers with the generic types
597         */
598        NULL;
599        public static SectionMode fromCode(String codeString) throws FHIRException {
600            if (codeString == null || "".equals(codeString))
601                return null;
602        if ("working".equals(codeString))
603          return WORKING;
604        if ("snapshot".equals(codeString))
605          return SNAPSHOT;
606        if ("changes".equals(codeString))
607          return CHANGES;
608        if (Configuration.isAcceptInvalidEnums())
609          return null;
610        else
611          throw new FHIRException("Unknown SectionMode code '"+codeString+"'");
612        }
613        public String toCode() {
614          switch (this) {
615            case WORKING: return "working";
616            case SNAPSHOT: return "snapshot";
617            case CHANGES: return "changes";
618            default: return "?";
619          }
620        }
621        public String getSystem() {
622          switch (this) {
623            case WORKING: return "http://hl7.org/fhir/list-mode";
624            case SNAPSHOT: return "http://hl7.org/fhir/list-mode";
625            case CHANGES: return "http://hl7.org/fhir/list-mode";
626            default: return "?";
627          }
628        }
629        public String getDefinition() {
630          switch (this) {
631            case WORKING: return "This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes.";
632            case SNAPSHOT: return "This list was prepared as a snapshot. It should not be assumed to be current.";
633            case CHANGES: return "A point-in-time list that shows what changes have been made or recommended.  E.g. a discharge medication list showing what was added and removed during an encounter.";
634            default: return "?";
635          }
636        }
637        public String getDisplay() {
638          switch (this) {
639            case WORKING: return "Working List";
640            case SNAPSHOT: return "Snapshot List";
641            case CHANGES: return "Change List";
642            default: return "?";
643          }
644        }
645    }
646
647  public static class SectionModeEnumFactory implements EnumFactory<SectionMode> {
648    public SectionMode fromCode(String codeString) throws IllegalArgumentException {
649      if (codeString == null || "".equals(codeString))
650            if (codeString == null || "".equals(codeString))
651                return null;
652        if ("working".equals(codeString))
653          return SectionMode.WORKING;
654        if ("snapshot".equals(codeString))
655          return SectionMode.SNAPSHOT;
656        if ("changes".equals(codeString))
657          return SectionMode.CHANGES;
658        throw new IllegalArgumentException("Unknown SectionMode code '"+codeString+"'");
659        }
660        public Enumeration<SectionMode> fromType(Base code) throws FHIRException {
661          if (code == null)
662            return null;
663          if (code.isEmpty())
664            return new Enumeration<SectionMode>(this);
665          String codeString = ((PrimitiveType) code).asStringValue();
666          if (codeString == null || "".equals(codeString))
667            return null;
668        if ("working".equals(codeString))
669          return new Enumeration<SectionMode>(this, SectionMode.WORKING);
670        if ("snapshot".equals(codeString))
671          return new Enumeration<SectionMode>(this, SectionMode.SNAPSHOT);
672        if ("changes".equals(codeString))
673          return new Enumeration<SectionMode>(this, SectionMode.CHANGES);
674        throw new FHIRException("Unknown SectionMode code '"+codeString+"'");
675        }
676    public String toCode(SectionMode code) {
677      if (code == SectionMode.WORKING)
678        return "working";
679      if (code == SectionMode.SNAPSHOT)
680        return "snapshot";
681      if (code == SectionMode.CHANGES)
682        return "changes";
683      return "?";
684      }
685    public String toSystem(SectionMode code) {
686      return code.getSystem();
687      }
688    }
689
690    @Block()
691    public static class CompositionAttesterComponent extends BackboneElement implements IBaseBackboneElement {
692        /**
693         * The type of attestation the authenticator offers.
694         */
695        @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
696        @Description(shortDefinition="personal | professional | legal | official", formalDefinition="The type of attestation the authenticator offers." )
697        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/composition-attestation-mode")
698        protected Enumeration<CompositionAttestationMode> mode;
699
700        /**
701         * When the composition was attested by the party.
702         */
703        @Child(name = "time", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
704        @Description(shortDefinition="When the composition was attested", formalDefinition="When the composition was attested by the party." )
705        protected DateTimeType time;
706
707        /**
708         * Who attested the composition in the specified way.
709         */
710        @Child(name = "party", type = {Patient.class, RelatedPerson.class, Practitioner.class, PractitionerRole.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=false)
711        @Description(shortDefinition="Who attested the composition", formalDefinition="Who attested the composition in the specified way." )
712        protected Reference party;
713
714        /**
715         * The actual object that is the target of the reference (Who attested the composition in the specified way.)
716         */
717        protected Resource partyTarget;
718
719        private static final long serialVersionUID = -1917768205L;
720
721    /**
722     * Constructor
723     */
724      public CompositionAttesterComponent() {
725        super();
726      }
727
728    /**
729     * Constructor
730     */
731      public CompositionAttesterComponent(Enumeration<CompositionAttestationMode> mode) {
732        super();
733        this.mode = mode;
734      }
735
736        /**
737         * @return {@link #mode} (The type of attestation the authenticator offers.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
738         */
739        public Enumeration<CompositionAttestationMode> getModeElement() { 
740          if (this.mode == null)
741            if (Configuration.errorOnAutoCreate())
742              throw new Error("Attempt to auto-create CompositionAttesterComponent.mode");
743            else if (Configuration.doAutoCreate())
744              this.mode = new Enumeration<CompositionAttestationMode>(new CompositionAttestationModeEnumFactory()); // bb
745          return this.mode;
746        }
747
748        public boolean hasModeElement() { 
749          return this.mode != null && !this.mode.isEmpty();
750        }
751
752        public boolean hasMode() { 
753          return this.mode != null && !this.mode.isEmpty();
754        }
755
756        /**
757         * @param value {@link #mode} (The type of attestation the authenticator offers.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
758         */
759        public CompositionAttesterComponent setModeElement(Enumeration<CompositionAttestationMode> value) { 
760          this.mode = value;
761          return this;
762        }
763
764        /**
765         * @return The type of attestation the authenticator offers.
766         */
767        public CompositionAttestationMode getMode() { 
768          return this.mode == null ? null : this.mode.getValue();
769        }
770
771        /**
772         * @param value The type of attestation the authenticator offers.
773         */
774        public CompositionAttesterComponent setMode(CompositionAttestationMode value) { 
775            if (this.mode == null)
776              this.mode = new Enumeration<CompositionAttestationMode>(new CompositionAttestationModeEnumFactory());
777            this.mode.setValue(value);
778          return this;
779        }
780
781        /**
782         * @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
783         */
784        public DateTimeType getTimeElement() { 
785          if (this.time == null)
786            if (Configuration.errorOnAutoCreate())
787              throw new Error("Attempt to auto-create CompositionAttesterComponent.time");
788            else if (Configuration.doAutoCreate())
789              this.time = new DateTimeType(); // bb
790          return this.time;
791        }
792
793        public boolean hasTimeElement() { 
794          return this.time != null && !this.time.isEmpty();
795        }
796
797        public boolean hasTime() { 
798          return this.time != null && !this.time.isEmpty();
799        }
800
801        /**
802         * @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
803         */
804        public CompositionAttesterComponent setTimeElement(DateTimeType value) { 
805          this.time = value;
806          return this;
807        }
808
809        /**
810         * @return When the composition was attested by the party.
811         */
812        public Date getTime() { 
813          return this.time == null ? null : this.time.getValue();
814        }
815
816        /**
817         * @param value When the composition was attested by the party.
818         */
819        public CompositionAttesterComponent setTime(Date value) { 
820          if (value == null)
821            this.time = null;
822          else {
823            if (this.time == null)
824              this.time = new DateTimeType();
825            this.time.setValue(value);
826          }
827          return this;
828        }
829
830        /**
831         * @return {@link #party} (Who attested the composition in the specified way.)
832         */
833        public Reference getParty() { 
834          if (this.party == null)
835            if (Configuration.errorOnAutoCreate())
836              throw new Error("Attempt to auto-create CompositionAttesterComponent.party");
837            else if (Configuration.doAutoCreate())
838              this.party = new Reference(); // cc
839          return this.party;
840        }
841
842        public boolean hasParty() { 
843          return this.party != null && !this.party.isEmpty();
844        }
845
846        /**
847         * @param value {@link #party} (Who attested the composition in the specified way.)
848         */
849        public CompositionAttesterComponent setParty(Reference value) { 
850          this.party = value;
851          return this;
852        }
853
854        /**
855         * @return {@link #party} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who attested the composition in the specified way.)
856         */
857        public Resource getPartyTarget() { 
858          return this.partyTarget;
859        }
860
861        /**
862         * @param value {@link #party} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who attested the composition in the specified way.)
863         */
864        public CompositionAttesterComponent setPartyTarget(Resource value) { 
865          this.partyTarget = value;
866          return this;
867        }
868
869        protected void listChildren(List<Property> children) {
870          super.listChildren(children);
871          children.add(new Property("mode", "code", "The type of attestation the authenticator offers.", 0, 1, mode));
872          children.add(new Property("time", "dateTime", "When the composition was attested by the party.", 0, 1, time));
873          children.add(new Property("party", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Organization)", "Who attested the composition in the specified way.", 0, 1, party));
874        }
875
876        @Override
877        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
878          switch (_hash) {
879          case 3357091: /*mode*/  return new Property("mode", "code", "The type of attestation the authenticator offers.", 0, 1, mode);
880          case 3560141: /*time*/  return new Property("time", "dateTime", "When the composition was attested by the party.", 0, 1, time);
881          case 106437350: /*party*/  return new Property("party", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Organization)", "Who attested the composition in the specified way.", 0, 1, party);
882          default: return super.getNamedProperty(_hash, _name, _checkValid);
883          }
884
885        }
886
887      @Override
888      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
889        switch (hash) {
890        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<CompositionAttestationMode>
891        case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // DateTimeType
892        case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference
893        default: return super.getProperty(hash, name, checkValid);
894        }
895
896      }
897
898      @Override
899      public Base setProperty(int hash, String name, Base value) throws FHIRException {
900        switch (hash) {
901        case 3357091: // mode
902          value = new CompositionAttestationModeEnumFactory().fromType(castToCode(value));
903          this.mode = (Enumeration) value; // Enumeration<CompositionAttestationMode>
904          return value;
905        case 3560141: // time
906          this.time = castToDateTime(value); // DateTimeType
907          return value;
908        case 106437350: // party
909          this.party = castToReference(value); // Reference
910          return value;
911        default: return super.setProperty(hash, name, value);
912        }
913
914      }
915
916      @Override
917      public Base setProperty(String name, Base value) throws FHIRException {
918        if (name.equals("mode")) {
919          value = new CompositionAttestationModeEnumFactory().fromType(castToCode(value));
920          this.mode = (Enumeration) value; // Enumeration<CompositionAttestationMode>
921        } else if (name.equals("time")) {
922          this.time = castToDateTime(value); // DateTimeType
923        } else if (name.equals("party")) {
924          this.party = castToReference(value); // Reference
925        } else
926          return super.setProperty(name, value);
927        return value;
928      }
929
930      @Override
931      public Base makeProperty(int hash, String name) throws FHIRException {
932        switch (hash) {
933        case 3357091:  return getModeElement();
934        case 3560141:  return getTimeElement();
935        case 106437350:  return getParty(); 
936        default: return super.makeProperty(hash, name);
937        }
938
939      }
940
941      @Override
942      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
943        switch (hash) {
944        case 3357091: /*mode*/ return new String[] {"code"};
945        case 3560141: /*time*/ return new String[] {"dateTime"};
946        case 106437350: /*party*/ return new String[] {"Reference"};
947        default: return super.getTypesForProperty(hash, name);
948        }
949
950      }
951
952      @Override
953      public Base addChild(String name) throws FHIRException {
954        if (name.equals("mode")) {
955          throw new FHIRException("Cannot call addChild on a primitive type Composition.mode");
956        }
957        else if (name.equals("time")) {
958          throw new FHIRException("Cannot call addChild on a primitive type Composition.time");
959        }
960        else if (name.equals("party")) {
961          this.party = new Reference();
962          return this.party;
963        }
964        else
965          return super.addChild(name);
966      }
967
968      public CompositionAttesterComponent copy() {
969        CompositionAttesterComponent dst = new CompositionAttesterComponent();
970        copyValues(dst);
971        return dst;
972      }
973
974      public void copyValues(CompositionAttesterComponent dst) {
975        super.copyValues(dst);
976        dst.mode = mode == null ? null : mode.copy();
977        dst.time = time == null ? null : time.copy();
978        dst.party = party == null ? null : party.copy();
979      }
980
981      @Override
982      public boolean equalsDeep(Base other_) {
983        if (!super.equalsDeep(other_))
984          return false;
985        if (!(other_ instanceof CompositionAttesterComponent))
986          return false;
987        CompositionAttesterComponent o = (CompositionAttesterComponent) other_;
988        return compareDeep(mode, o.mode, true) && compareDeep(time, o.time, true) && compareDeep(party, o.party, true)
989          ;
990      }
991
992      @Override
993      public boolean equalsShallow(Base other_) {
994        if (!super.equalsShallow(other_))
995          return false;
996        if (!(other_ instanceof CompositionAttesterComponent))
997          return false;
998        CompositionAttesterComponent o = (CompositionAttesterComponent) other_;
999        return compareValues(mode, o.mode, true) && compareValues(time, o.time, true);
1000      }
1001
1002      public boolean isEmpty() {
1003        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mode, time, party);
1004      }
1005
1006  public String fhirType() {
1007    return "Composition.attester";
1008
1009  }
1010
1011  }
1012
1013    @Block()
1014    public static class CompositionRelatesToComponent extends BackboneElement implements IBaseBackboneElement {
1015        /**
1016         * The type of relationship that this composition has with anther composition or document.
1017         */
1018        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1019        @Description(shortDefinition="replaces | transforms | signs | appends", formalDefinition="The type of relationship that this composition has with anther composition or document." )
1020        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/document-relationship-type")
1021        protected Enumeration<DocumentRelationshipType> code;
1022
1023        /**
1024         * The target composition/document of this relationship.
1025         */
1026        @Child(name = "target", type = {Identifier.class, Composition.class}, order=2, min=1, max=1, modifier=false, summary=false)
1027        @Description(shortDefinition="Target of the relationship", formalDefinition="The target composition/document of this relationship." )
1028        protected Type target;
1029
1030        private static final long serialVersionUID = 1536930280L;
1031
1032    /**
1033     * Constructor
1034     */
1035      public CompositionRelatesToComponent() {
1036        super();
1037      }
1038
1039    /**
1040     * Constructor
1041     */
1042      public CompositionRelatesToComponent(Enumeration<DocumentRelationshipType> code, Type target) {
1043        super();
1044        this.code = code;
1045        this.target = target;
1046      }
1047
1048        /**
1049         * @return {@link #code} (The type of relationship that this composition has with anther composition or document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
1050         */
1051        public Enumeration<DocumentRelationshipType> getCodeElement() { 
1052          if (this.code == null)
1053            if (Configuration.errorOnAutoCreate())
1054              throw new Error("Attempt to auto-create CompositionRelatesToComponent.code");
1055            else if (Configuration.doAutoCreate())
1056              this.code = new Enumeration<DocumentRelationshipType>(new DocumentRelationshipTypeEnumFactory()); // bb
1057          return this.code;
1058        }
1059
1060        public boolean hasCodeElement() { 
1061          return this.code != null && !this.code.isEmpty();
1062        }
1063
1064        public boolean hasCode() { 
1065          return this.code != null && !this.code.isEmpty();
1066        }
1067
1068        /**
1069         * @param value {@link #code} (The type of relationship that this composition has with anther composition or document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
1070         */
1071        public CompositionRelatesToComponent setCodeElement(Enumeration<DocumentRelationshipType> value) { 
1072          this.code = value;
1073          return this;
1074        }
1075
1076        /**
1077         * @return The type of relationship that this composition has with anther composition or document.
1078         */
1079        public DocumentRelationshipType getCode() { 
1080          return this.code == null ? null : this.code.getValue();
1081        }
1082
1083        /**
1084         * @param value The type of relationship that this composition has with anther composition or document.
1085         */
1086        public CompositionRelatesToComponent setCode(DocumentRelationshipType value) { 
1087            if (this.code == null)
1088              this.code = new Enumeration<DocumentRelationshipType>(new DocumentRelationshipTypeEnumFactory());
1089            this.code.setValue(value);
1090          return this;
1091        }
1092
1093        /**
1094         * @return {@link #target} (The target composition/document of this relationship.)
1095         */
1096        public Type getTarget() { 
1097          return this.target;
1098        }
1099
1100        /**
1101         * @return {@link #target} (The target composition/document of this relationship.)
1102         */
1103        public Identifier getTargetIdentifier() throws FHIRException { 
1104          if (this.target == null)
1105            this.target = new Identifier();
1106          if (!(this.target instanceof Identifier))
1107            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.target.getClass().getName()+" was encountered");
1108          return (Identifier) this.target;
1109        }
1110
1111        public boolean hasTargetIdentifier() { 
1112          return this != null && this.target instanceof Identifier;
1113        }
1114
1115        /**
1116         * @return {@link #target} (The target composition/document of this relationship.)
1117         */
1118        public Reference getTargetReference() throws FHIRException { 
1119          if (this.target == null)
1120            this.target = new Reference();
1121          if (!(this.target instanceof Reference))
1122            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered");
1123          return (Reference) this.target;
1124        }
1125
1126        public boolean hasTargetReference() { 
1127          return this != null && this.target instanceof Reference;
1128        }
1129
1130        public boolean hasTarget() { 
1131          return this.target != null && !this.target.isEmpty();
1132        }
1133
1134        /**
1135         * @param value {@link #target} (The target composition/document of this relationship.)
1136         */
1137        public CompositionRelatesToComponent setTarget(Type value) { 
1138          if (value != null && !(value instanceof Identifier || value instanceof Reference))
1139            throw new Error("Not the right type for Composition.relatesTo.target[x]: "+value.fhirType());
1140          this.target = value;
1141          return this;
1142        }
1143
1144        protected void listChildren(List<Property> children) {
1145          super.listChildren(children);
1146          children.add(new Property("code", "code", "The type of relationship that this composition has with anther composition or document.", 0, 1, code));
1147          children.add(new Property("target[x]", "Identifier|Reference(Composition)", "The target composition/document of this relationship.", 0, 1, target));
1148        }
1149
1150        @Override
1151        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1152          switch (_hash) {
1153          case 3059181: /*code*/  return new Property("code", "code", "The type of relationship that this composition has with anther composition or document.", 0, 1, code);
1154          case -815579825: /*target[x]*/  return new Property("target[x]", "Identifier|Reference(Composition)", "The target composition/document of this relationship.", 0, 1, target);
1155          case -880905839: /*target*/  return new Property("target[x]", "Identifier|Reference(Composition)", "The target composition/document of this relationship.", 0, 1, target);
1156          case 1690892570: /*targetIdentifier*/  return new Property("target[x]", "Identifier|Reference(Composition)", "The target composition/document of this relationship.", 0, 1, target);
1157          case 1259806906: /*targetReference*/  return new Property("target[x]", "Identifier|Reference(Composition)", "The target composition/document of this relationship.", 0, 1, target);
1158          default: return super.getNamedProperty(_hash, _name, _checkValid);
1159          }
1160
1161        }
1162
1163      @Override
1164      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1165        switch (hash) {
1166        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration<DocumentRelationshipType>
1167        case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type
1168        default: return super.getProperty(hash, name, checkValid);
1169        }
1170
1171      }
1172
1173      @Override
1174      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1175        switch (hash) {
1176        case 3059181: // code
1177          value = new DocumentRelationshipTypeEnumFactory().fromType(castToCode(value));
1178          this.code = (Enumeration) value; // Enumeration<DocumentRelationshipType>
1179          return value;
1180        case -880905839: // target
1181          this.target = castToType(value); // Type
1182          return value;
1183        default: return super.setProperty(hash, name, value);
1184        }
1185
1186      }
1187
1188      @Override
1189      public Base setProperty(String name, Base value) throws FHIRException {
1190        if (name.equals("code")) {
1191          value = new DocumentRelationshipTypeEnumFactory().fromType(castToCode(value));
1192          this.code = (Enumeration) value; // Enumeration<DocumentRelationshipType>
1193        } else if (name.equals("target[x]")) {
1194          this.target = castToType(value); // Type
1195        } else
1196          return super.setProperty(name, value);
1197        return value;
1198      }
1199
1200      @Override
1201      public Base makeProperty(int hash, String name) throws FHIRException {
1202        switch (hash) {
1203        case 3059181:  return getCodeElement();
1204        case -815579825:  return getTarget(); 
1205        case -880905839:  return getTarget(); 
1206        default: return super.makeProperty(hash, name);
1207        }
1208
1209      }
1210
1211      @Override
1212      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1213        switch (hash) {
1214        case 3059181: /*code*/ return new String[] {"code"};
1215        case -880905839: /*target*/ return new String[] {"Identifier", "Reference"};
1216        default: return super.getTypesForProperty(hash, name);
1217        }
1218
1219      }
1220
1221      @Override
1222      public Base addChild(String name) throws FHIRException {
1223        if (name.equals("code")) {
1224          throw new FHIRException("Cannot call addChild on a primitive type Composition.code");
1225        }
1226        else if (name.equals("targetIdentifier")) {
1227          this.target = new Identifier();
1228          return this.target;
1229        }
1230        else if (name.equals("targetReference")) {
1231          this.target = new Reference();
1232          return this.target;
1233        }
1234        else
1235          return super.addChild(name);
1236      }
1237
1238      public CompositionRelatesToComponent copy() {
1239        CompositionRelatesToComponent dst = new CompositionRelatesToComponent();
1240        copyValues(dst);
1241        return dst;
1242      }
1243
1244      public void copyValues(CompositionRelatesToComponent dst) {
1245        super.copyValues(dst);
1246        dst.code = code == null ? null : code.copy();
1247        dst.target = target == null ? null : target.copy();
1248      }
1249
1250      @Override
1251      public boolean equalsDeep(Base other_) {
1252        if (!super.equalsDeep(other_))
1253          return false;
1254        if (!(other_ instanceof CompositionRelatesToComponent))
1255          return false;
1256        CompositionRelatesToComponent o = (CompositionRelatesToComponent) other_;
1257        return compareDeep(code, o.code, true) && compareDeep(target, o.target, true);
1258      }
1259
1260      @Override
1261      public boolean equalsShallow(Base other_) {
1262        if (!super.equalsShallow(other_))
1263          return false;
1264        if (!(other_ instanceof CompositionRelatesToComponent))
1265          return false;
1266        CompositionRelatesToComponent o = (CompositionRelatesToComponent) other_;
1267        return compareValues(code, o.code, true);
1268      }
1269
1270      public boolean isEmpty() {
1271        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, target);
1272      }
1273
1274  public String fhirType() {
1275    return "Composition.relatesTo";
1276
1277  }
1278
1279  }
1280
1281    @Block()
1282    public static class CompositionEventComponent extends BackboneElement implements IBaseBackboneElement {
1283        /**
1284         * 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.
1285         */
1286        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1287        @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." )
1288        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-ActCode")
1289        protected List<CodeableConcept> code;
1290
1291        /**
1292         * 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.
1293         */
1294        @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true)
1295        @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." )
1296        protected Period period;
1297
1298        /**
1299         * 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.
1300         */
1301        @Child(name = "detail", type = {Reference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1302        @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." )
1303        protected List<Reference> detail;
1304        /**
1305         * The actual objects that are the target of the reference (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.)
1306         */
1307        protected List<Resource> detailTarget;
1308
1309
1310        private static final long serialVersionUID = -1581379774L;
1311
1312    /**
1313     * Constructor
1314     */
1315      public CompositionEventComponent() {
1316        super();
1317      }
1318
1319        /**
1320         * @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.)
1321         */
1322        public List<CodeableConcept> getCode() { 
1323          if (this.code == null)
1324            this.code = new ArrayList<CodeableConcept>();
1325          return this.code;
1326        }
1327
1328        /**
1329         * @return Returns a reference to <code>this</code> for easy method chaining
1330         */
1331        public CompositionEventComponent setCode(List<CodeableConcept> theCode) { 
1332          this.code = theCode;
1333          return this;
1334        }
1335
1336        public boolean hasCode() { 
1337          if (this.code == null)
1338            return false;
1339          for (CodeableConcept item : this.code)
1340            if (!item.isEmpty())
1341              return true;
1342          return false;
1343        }
1344
1345        public CodeableConcept addCode() { //3
1346          CodeableConcept t = new CodeableConcept();
1347          if (this.code == null)
1348            this.code = new ArrayList<CodeableConcept>();
1349          this.code.add(t);
1350          return t;
1351        }
1352
1353        public CompositionEventComponent addCode(CodeableConcept t) { //3
1354          if (t == null)
1355            return this;
1356          if (this.code == null)
1357            this.code = new ArrayList<CodeableConcept>();
1358          this.code.add(t);
1359          return this;
1360        }
1361
1362        /**
1363         * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist
1364         */
1365        public CodeableConcept getCodeFirstRep() { 
1366          if (getCode().isEmpty()) {
1367            addCode();
1368          }
1369          return getCode().get(0);
1370        }
1371
1372        /**
1373         * @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.)
1374         */
1375        public Period getPeriod() { 
1376          if (this.period == null)
1377            if (Configuration.errorOnAutoCreate())
1378              throw new Error("Attempt to auto-create CompositionEventComponent.period");
1379            else if (Configuration.doAutoCreate())
1380              this.period = new Period(); // cc
1381          return this.period;
1382        }
1383
1384        public boolean hasPeriod() { 
1385          return this.period != null && !this.period.isEmpty();
1386        }
1387
1388        /**
1389         * @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.)
1390         */
1391        public CompositionEventComponent setPeriod(Period value) { 
1392          this.period = value;
1393          return this;
1394        }
1395
1396        /**
1397         * @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.)
1398         */
1399        public List<Reference> getDetail() { 
1400          if (this.detail == null)
1401            this.detail = new ArrayList<Reference>();
1402          return this.detail;
1403        }
1404
1405        /**
1406         * @return Returns a reference to <code>this</code> for easy method chaining
1407         */
1408        public CompositionEventComponent setDetail(List<Reference> theDetail) { 
1409          this.detail = theDetail;
1410          return this;
1411        }
1412
1413        public boolean hasDetail() { 
1414          if (this.detail == null)
1415            return false;
1416          for (Reference item : this.detail)
1417            if (!item.isEmpty())
1418              return true;
1419          return false;
1420        }
1421
1422        public Reference addDetail() { //3
1423          Reference t = new Reference();
1424          if (this.detail == null)
1425            this.detail = new ArrayList<Reference>();
1426          this.detail.add(t);
1427          return t;
1428        }
1429
1430        public CompositionEventComponent addDetail(Reference t) { //3
1431          if (t == null)
1432            return this;
1433          if (this.detail == null)
1434            this.detail = new ArrayList<Reference>();
1435          this.detail.add(t);
1436          return this;
1437        }
1438
1439        /**
1440         * @return The first repetition of repeating field {@link #detail}, creating it if it does not already exist
1441         */
1442        public Reference getDetailFirstRep() { 
1443          if (getDetail().isEmpty()) {
1444            addDetail();
1445          }
1446          return getDetail().get(0);
1447        }
1448
1449        /**
1450         * @deprecated Use Reference#setResource(IBaseResource) instead
1451         */
1452        @Deprecated
1453        public List<Resource> getDetailTarget() { 
1454          if (this.detailTarget == null)
1455            this.detailTarget = new ArrayList<Resource>();
1456          return this.detailTarget;
1457        }
1458
1459        protected void listChildren(List<Property> children) {
1460          super.listChildren(children);
1461          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));
1462          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));
1463          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));
1464        }
1465
1466        @Override
1467        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1468          switch (_hash) {
1469          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);
1470          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);
1471          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);
1472          default: return super.getNamedProperty(_hash, _name, _checkValid);
1473          }
1474
1475        }
1476
1477      @Override
1478      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1479        switch (hash) {
1480        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept
1481        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1482        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // Reference
1483        default: return super.getProperty(hash, name, checkValid);
1484        }
1485
1486      }
1487
1488      @Override
1489      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1490        switch (hash) {
1491        case 3059181: // code
1492          this.getCode().add(castToCodeableConcept(value)); // CodeableConcept
1493          return value;
1494        case -991726143: // period
1495          this.period = castToPeriod(value); // Period
1496          return value;
1497        case -1335224239: // detail
1498          this.getDetail().add(castToReference(value)); // Reference
1499          return value;
1500        default: return super.setProperty(hash, name, value);
1501        }
1502
1503      }
1504
1505      @Override
1506      public Base setProperty(String name, Base value) throws FHIRException {
1507        if (name.equals("code")) {
1508          this.getCode().add(castToCodeableConcept(value));
1509        } else if (name.equals("period")) {
1510          this.period = castToPeriod(value); // Period
1511        } else if (name.equals("detail")) {
1512          this.getDetail().add(castToReference(value));
1513        } else
1514          return super.setProperty(name, value);
1515        return value;
1516      }
1517
1518      @Override
1519      public Base makeProperty(int hash, String name) throws FHIRException {
1520        switch (hash) {
1521        case 3059181:  return addCode(); 
1522        case -991726143:  return getPeriod(); 
1523        case -1335224239:  return addDetail(); 
1524        default: return super.makeProperty(hash, name);
1525        }
1526
1527      }
1528
1529      @Override
1530      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1531        switch (hash) {
1532        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1533        case -991726143: /*period*/ return new String[] {"Period"};
1534        case -1335224239: /*detail*/ return new String[] {"Reference"};
1535        default: return super.getTypesForProperty(hash, name);
1536        }
1537
1538      }
1539
1540      @Override
1541      public Base addChild(String name) throws FHIRException {
1542        if (name.equals("code")) {
1543          return addCode();
1544        }
1545        else if (name.equals("period")) {
1546          this.period = new Period();
1547          return this.period;
1548        }
1549        else if (name.equals("detail")) {
1550          return addDetail();
1551        }
1552        else
1553          return super.addChild(name);
1554      }
1555
1556      public CompositionEventComponent copy() {
1557        CompositionEventComponent dst = new CompositionEventComponent();
1558        copyValues(dst);
1559        return dst;
1560      }
1561
1562      public void copyValues(CompositionEventComponent dst) {
1563        super.copyValues(dst);
1564        if (code != null) {
1565          dst.code = new ArrayList<CodeableConcept>();
1566          for (CodeableConcept i : code)
1567            dst.code.add(i.copy());
1568        };
1569        dst.period = period == null ? null : period.copy();
1570        if (detail != null) {
1571          dst.detail = new ArrayList<Reference>();
1572          for (Reference i : detail)
1573            dst.detail.add(i.copy());
1574        };
1575      }
1576
1577      @Override
1578      public boolean equalsDeep(Base other_) {
1579        if (!super.equalsDeep(other_))
1580          return false;
1581        if (!(other_ instanceof CompositionEventComponent))
1582          return false;
1583        CompositionEventComponent o = (CompositionEventComponent) other_;
1584        return compareDeep(code, o.code, true) && compareDeep(period, o.period, true) && compareDeep(detail, o.detail, true)
1585          ;
1586      }
1587
1588      @Override
1589      public boolean equalsShallow(Base other_) {
1590        if (!super.equalsShallow(other_))
1591          return false;
1592        if (!(other_ instanceof CompositionEventComponent))
1593          return false;
1594        CompositionEventComponent o = (CompositionEventComponent) other_;
1595        return true;
1596      }
1597
1598      public boolean isEmpty() {
1599        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, period, detail);
1600      }
1601
1602  public String fhirType() {
1603    return "Composition.event";
1604
1605  }
1606
1607  }
1608
1609    @Block()
1610    public static class SectionComponent extends BackboneElement implements IBaseBackboneElement {
1611        /**
1612         * 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.
1613         */
1614        @Child(name = "title", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1615        @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." )
1616        protected StringType title;
1617
1618        /**
1619         * A code identifying the kind of content contained within the section. This must be consistent with the section title.
1620         */
1621        @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
1622        @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." )
1623        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/doc-section-codes")
1624        protected CodeableConcept code;
1625
1626        /**
1627         * Identifies who is responsible for the information in this section, not necessarily who typed it in.
1628         */
1629        @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)
1630        @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." )
1631        protected List<Reference> author;
1632        /**
1633         * The actual objects that are the target of the reference (Identifies who is responsible for the information in this section, not necessarily who typed it in.)
1634         */
1635        protected List<Resource> authorTarget;
1636
1637
1638        /**
1639         * 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).
1640         */
1641        @Child(name = "focus", type = {Reference.class}, order=4, min=0, max=1, modifier=false, summary=false)
1642        @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)." )
1643        protected Reference focus;
1644
1645        /**
1646         * The actual object that is the target of the reference (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).)
1647         */
1648        protected Resource focusTarget;
1649
1650        /**
1651         * 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.
1652         */
1653        @Child(name = "text", type = {Narrative.class}, order=5, min=0, max=1, modifier=false, summary=false)
1654        @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." )
1655        protected Narrative text;
1656
1657        /**
1658         * 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.
1659         */
1660        @Child(name = "mode", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false)
1661        @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." )
1662        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/list-mode")
1663        protected Enumeration<SectionMode> mode;
1664
1665        /**
1666         * Specifies the order applied to the items in the section entries.
1667         */
1668        @Child(name = "orderedBy", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false)
1669        @Description(shortDefinition="Order of section entries", formalDefinition="Specifies the order applied to the items in the section entries." )
1670        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/list-order")
1671        protected CodeableConcept orderedBy;
1672
1673        /**
1674         * A reference to the actual resource from which the narrative in the section is derived.
1675         */
1676        @Child(name = "entry", type = {Reference.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1677        @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." )
1678        protected List<Reference> entry;
1679        /**
1680         * The actual objects that are the target of the reference (A reference to the actual resource from which the narrative in the section is derived.)
1681         */
1682        protected List<Resource> entryTarget;
1683
1684
1685        /**
1686         * If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.
1687         */
1688        @Child(name = "emptyReason", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false)
1689        @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." )
1690        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/list-empty-reason")
1691        protected CodeableConcept emptyReason;
1692
1693        /**
1694         * A nested sub-section within this section.
1695         */
1696        @Child(name = "section", type = {SectionComponent.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1697        @Description(shortDefinition="Nested Section", formalDefinition="A nested sub-section within this section." )
1698        protected List<SectionComponent> section;
1699
1700        private static final long serialVersionUID = -797396954L;
1701
1702    /**
1703     * Constructor
1704     */
1705      public SectionComponent() {
1706        super();
1707      }
1708
1709        /**
1710         * @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
1711         */
1712        public StringType getTitleElement() { 
1713          if (this.title == null)
1714            if (Configuration.errorOnAutoCreate())
1715              throw new Error("Attempt to auto-create SectionComponent.title");
1716            else if (Configuration.doAutoCreate())
1717              this.title = new StringType(); // bb
1718          return this.title;
1719        }
1720
1721        public boolean hasTitleElement() { 
1722          return this.title != null && !this.title.isEmpty();
1723        }
1724
1725        public boolean hasTitle() { 
1726          return this.title != null && !this.title.isEmpty();
1727        }
1728
1729        /**
1730         * @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
1731         */
1732        public SectionComponent setTitleElement(StringType value) { 
1733          this.title = value;
1734          return this;
1735        }
1736
1737        /**
1738         * @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.
1739         */
1740        public String getTitle() { 
1741          return this.title == null ? null : this.title.getValue();
1742        }
1743
1744        /**
1745         * @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.
1746         */
1747        public SectionComponent setTitle(String value) { 
1748          if (Utilities.noString(value))
1749            this.title = null;
1750          else {
1751            if (this.title == null)
1752              this.title = new StringType();
1753            this.title.setValue(value);
1754          }
1755          return this;
1756        }
1757
1758        /**
1759         * @return {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.)
1760         */
1761        public CodeableConcept getCode() { 
1762          if (this.code == null)
1763            if (Configuration.errorOnAutoCreate())
1764              throw new Error("Attempt to auto-create SectionComponent.code");
1765            else if (Configuration.doAutoCreate())
1766              this.code = new CodeableConcept(); // cc
1767          return this.code;
1768        }
1769
1770        public boolean hasCode() { 
1771          return this.code != null && !this.code.isEmpty();
1772        }
1773
1774        /**
1775         * @param value {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.)
1776         */
1777        public SectionComponent setCode(CodeableConcept value) { 
1778          this.code = value;
1779          return this;
1780        }
1781
1782        /**
1783         * @return {@link #author} (Identifies who is responsible for the information in this section, not necessarily who typed it in.)
1784         */
1785        public List<Reference> getAuthor() { 
1786          if (this.author == null)
1787            this.author = new ArrayList<Reference>();
1788          return this.author;
1789        }
1790
1791        /**
1792         * @return Returns a reference to <code>this</code> for easy method chaining
1793         */
1794        public SectionComponent setAuthor(List<Reference> theAuthor) { 
1795          this.author = theAuthor;
1796          return this;
1797        }
1798
1799        public boolean hasAuthor() { 
1800          if (this.author == null)
1801            return false;
1802          for (Reference item : this.author)
1803            if (!item.isEmpty())
1804              return true;
1805          return false;
1806        }
1807
1808        public Reference addAuthor() { //3
1809          Reference t = new Reference();
1810          if (this.author == null)
1811            this.author = new ArrayList<Reference>();
1812          this.author.add(t);
1813          return t;
1814        }
1815
1816        public SectionComponent addAuthor(Reference t) { //3
1817          if (t == null)
1818            return this;
1819          if (this.author == null)
1820            this.author = new ArrayList<Reference>();
1821          this.author.add(t);
1822          return this;
1823        }
1824
1825        /**
1826         * @return The first repetition of repeating field {@link #author}, creating it if it does not already exist
1827         */
1828        public Reference getAuthorFirstRep() { 
1829          if (getAuthor().isEmpty()) {
1830            addAuthor();
1831          }
1832          return getAuthor().get(0);
1833        }
1834
1835        /**
1836         * @deprecated Use Reference#setResource(IBaseResource) instead
1837         */
1838        @Deprecated
1839        public List<Resource> getAuthorTarget() { 
1840          if (this.authorTarget == null)
1841            this.authorTarget = new ArrayList<Resource>();
1842          return this.authorTarget;
1843        }
1844
1845        /**
1846         * @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).)
1847         */
1848        public Reference getFocus() { 
1849          if (this.focus == null)
1850            if (Configuration.errorOnAutoCreate())
1851              throw new Error("Attempt to auto-create SectionComponent.focus");
1852            else if (Configuration.doAutoCreate())
1853              this.focus = new Reference(); // cc
1854          return this.focus;
1855        }
1856
1857        public boolean hasFocus() { 
1858          return this.focus != null && !this.focus.isEmpty();
1859        }
1860
1861        /**
1862         * @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).)
1863         */
1864        public SectionComponent setFocus(Reference value) { 
1865          this.focus = value;
1866          return this;
1867        }
1868
1869        /**
1870         * @return {@link #focus} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The 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).)
1871         */
1872        public Resource getFocusTarget() { 
1873          return this.focusTarget;
1874        }
1875
1876        /**
1877         * @param value {@link #focus} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The 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).)
1878         */
1879        public SectionComponent setFocusTarget(Resource value) { 
1880          this.focusTarget = value;
1881          return this;
1882        }
1883
1884        /**
1885         * @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.)
1886         */
1887        public Narrative getText() { 
1888          if (this.text == null)
1889            if (Configuration.errorOnAutoCreate())
1890              throw new Error("Attempt to auto-create SectionComponent.text");
1891            else if (Configuration.doAutoCreate())
1892              this.text = new Narrative(); // cc
1893          return this.text;
1894        }
1895
1896        public boolean hasText() { 
1897          return this.text != null && !this.text.isEmpty();
1898        }
1899
1900        /**
1901         * @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.)
1902         */
1903        public SectionComponent setText(Narrative value) { 
1904          this.text = value;
1905          return this;
1906        }
1907
1908        /**
1909         * @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
1910         */
1911        public Enumeration<SectionMode> getModeElement() { 
1912          if (this.mode == null)
1913            if (Configuration.errorOnAutoCreate())
1914              throw new Error("Attempt to auto-create SectionComponent.mode");
1915            else if (Configuration.doAutoCreate())
1916              this.mode = new Enumeration<SectionMode>(new SectionModeEnumFactory()); // bb
1917          return this.mode;
1918        }
1919
1920        public boolean hasModeElement() { 
1921          return this.mode != null && !this.mode.isEmpty();
1922        }
1923
1924        public boolean hasMode() { 
1925          return this.mode != null && !this.mode.isEmpty();
1926        }
1927
1928        /**
1929         * @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
1930         */
1931        public SectionComponent setModeElement(Enumeration<SectionMode> value) { 
1932          this.mode = value;
1933          return this;
1934        }
1935
1936        /**
1937         * @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.
1938         */
1939        public SectionMode getMode() { 
1940          return this.mode == null ? null : this.mode.getValue();
1941        }
1942
1943        /**
1944         * @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.
1945         */
1946        public SectionComponent setMode(SectionMode value) { 
1947          if (value == null)
1948            this.mode = null;
1949          else {
1950            if (this.mode == null)
1951              this.mode = new Enumeration<SectionMode>(new SectionModeEnumFactory());
1952            this.mode.setValue(value);
1953          }
1954          return this;
1955        }
1956
1957        /**
1958         * @return {@link #orderedBy} (Specifies the order applied to the items in the section entries.)
1959         */
1960        public CodeableConcept getOrderedBy() { 
1961          if (this.orderedBy == null)
1962            if (Configuration.errorOnAutoCreate())
1963              throw new Error("Attempt to auto-create SectionComponent.orderedBy");
1964            else if (Configuration.doAutoCreate())
1965              this.orderedBy = new CodeableConcept(); // cc
1966          return this.orderedBy;
1967        }
1968
1969        public boolean hasOrderedBy() { 
1970          return this.orderedBy != null && !this.orderedBy.isEmpty();
1971        }
1972
1973        /**
1974         * @param value {@link #orderedBy} (Specifies the order applied to the items in the section entries.)
1975         */
1976        public SectionComponent setOrderedBy(CodeableConcept value) { 
1977          this.orderedBy = value;
1978          return this;
1979        }
1980
1981        /**
1982         * @return {@link #entry} (A reference to the actual resource from which the narrative in the section is derived.)
1983         */
1984        public List<Reference> getEntry() { 
1985          if (this.entry == null)
1986            this.entry = new ArrayList<Reference>();
1987          return this.entry;
1988        }
1989
1990        /**
1991         * @return Returns a reference to <code>this</code> for easy method chaining
1992         */
1993        public SectionComponent setEntry(List<Reference> theEntry) { 
1994          this.entry = theEntry;
1995          return this;
1996        }
1997
1998        public boolean hasEntry() { 
1999          if (this.entry == null)
2000            return false;
2001          for (Reference item : this.entry)
2002            if (!item.isEmpty())
2003              return true;
2004          return false;
2005        }
2006
2007        public Reference addEntry() { //3
2008          Reference t = new Reference();
2009          if (this.entry == null)
2010            this.entry = new ArrayList<Reference>();
2011          this.entry.add(t);
2012          return t;
2013        }
2014
2015        public SectionComponent addEntry(Reference t) { //3
2016          if (t == null)
2017            return this;
2018          if (this.entry == null)
2019            this.entry = new ArrayList<Reference>();
2020          this.entry.add(t);
2021          return this;
2022        }
2023
2024        /**
2025         * @return The first repetition of repeating field {@link #entry}, creating it if it does not already exist
2026         */
2027        public Reference getEntryFirstRep() { 
2028          if (getEntry().isEmpty()) {
2029            addEntry();
2030          }
2031          return getEntry().get(0);
2032        }
2033
2034        /**
2035         * @deprecated Use Reference#setResource(IBaseResource) instead
2036         */
2037        @Deprecated
2038        public List<Resource> getEntryTarget() { 
2039          if (this.entryTarget == null)
2040            this.entryTarget = new ArrayList<Resource>();
2041          return this.entryTarget;
2042        }
2043
2044        /**
2045         * @return {@link #emptyReason} (If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.)
2046         */
2047        public CodeableConcept getEmptyReason() { 
2048          if (this.emptyReason == null)
2049            if (Configuration.errorOnAutoCreate())
2050              throw new Error("Attempt to auto-create SectionComponent.emptyReason");
2051            else if (Configuration.doAutoCreate())
2052              this.emptyReason = new CodeableConcept(); // cc
2053          return this.emptyReason;
2054        }
2055
2056        public boolean hasEmptyReason() { 
2057          return this.emptyReason != null && !this.emptyReason.isEmpty();
2058        }
2059
2060        /**
2061         * @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.)
2062         */
2063        public SectionComponent setEmptyReason(CodeableConcept value) { 
2064          this.emptyReason = value;
2065          return this;
2066        }
2067
2068        /**
2069         * @return {@link #section} (A nested sub-section within this section.)
2070         */
2071        public List<SectionComponent> getSection() { 
2072          if (this.section == null)
2073            this.section = new ArrayList<SectionComponent>();
2074          return this.section;
2075        }
2076
2077        /**
2078         * @return Returns a reference to <code>this</code> for easy method chaining
2079         */
2080        public SectionComponent setSection(List<SectionComponent> theSection) { 
2081          this.section = theSection;
2082          return this;
2083        }
2084
2085        public boolean hasSection() { 
2086          if (this.section == null)
2087            return false;
2088          for (SectionComponent item : this.section)
2089            if (!item.isEmpty())
2090              return true;
2091          return false;
2092        }
2093
2094        public SectionComponent addSection() { //3
2095          SectionComponent t = new SectionComponent();
2096          if (this.section == null)
2097            this.section = new ArrayList<SectionComponent>();
2098          this.section.add(t);
2099          return t;
2100        }
2101
2102        public SectionComponent addSection(SectionComponent t) { //3
2103          if (t == null)
2104            return this;
2105          if (this.section == null)
2106            this.section = new ArrayList<SectionComponent>();
2107          this.section.add(t);
2108          return this;
2109        }
2110
2111        /**
2112         * @return The first repetition of repeating field {@link #section}, creating it if it does not already exist
2113         */
2114        public SectionComponent getSectionFirstRep() { 
2115          if (getSection().isEmpty()) {
2116            addSection();
2117          }
2118          return getSection().get(0);
2119        }
2120
2121        protected void listChildren(List<Property> children) {
2122          super.listChildren(children);
2123          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));
2124          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));
2125          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));
2126          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));
2127          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));
2128          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));
2129          children.add(new Property("orderedBy", "CodeableConcept", "Specifies the order applied to the items in the section entries.", 0, 1, orderedBy));
2130          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));
2131          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));
2132          children.add(new Property("section", "@Composition.section", "A nested sub-section within this section.", 0, java.lang.Integer.MAX_VALUE, section));
2133        }
2134
2135        @Override
2136        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2137          switch (_hash) {
2138          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);
2139          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);
2140          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);
2141          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);
2142          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);
2143          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);
2144          case -391079516: /*orderedBy*/  return new Property("orderedBy", "CodeableConcept", "Specifies the order applied to the items in the section entries.", 0, 1, orderedBy);
2145          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);
2146          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);
2147          case 1970241253: /*section*/  return new Property("section", "@Composition.section", "A nested sub-section within this section.", 0, java.lang.Integer.MAX_VALUE, section);
2148          default: return super.getNamedProperty(_hash, _name, _checkValid);
2149          }
2150
2151        }
2152
2153      @Override
2154      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2155        switch (hash) {
2156        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
2157        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
2158        case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // Reference
2159        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : new Base[] {this.focus}; // Reference
2160        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // Narrative
2161        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<SectionMode>
2162        case -391079516: /*orderedBy*/ return this.orderedBy == null ? new Base[0] : new Base[] {this.orderedBy}; // CodeableConcept
2163        case 96667762: /*entry*/ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // Reference
2164        case 1140135409: /*emptyReason*/ return this.emptyReason == null ? new Base[0] : new Base[] {this.emptyReason}; // CodeableConcept
2165        case 1970241253: /*section*/ return this.section == null ? new Base[0] : this.section.toArray(new Base[this.section.size()]); // SectionComponent
2166        default: return super.getProperty(hash, name, checkValid);
2167        }
2168
2169      }
2170
2171      @Override
2172      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2173        switch (hash) {
2174        case 110371416: // title
2175          this.title = castToString(value); // StringType
2176          return value;
2177        case 3059181: // code
2178          this.code = castToCodeableConcept(value); // CodeableConcept
2179          return value;
2180        case -1406328437: // author
2181          this.getAuthor().add(castToReference(value)); // Reference
2182          return value;
2183        case 97604824: // focus
2184          this.focus = castToReference(value); // Reference
2185          return value;
2186        case 3556653: // text
2187          this.text = castToNarrative(value); // Narrative
2188          return value;
2189        case 3357091: // mode
2190          value = new SectionModeEnumFactory().fromType(castToCode(value));
2191          this.mode = (Enumeration) value; // Enumeration<SectionMode>
2192          return value;
2193        case -391079516: // orderedBy
2194          this.orderedBy = castToCodeableConcept(value); // CodeableConcept
2195          return value;
2196        case 96667762: // entry
2197          this.getEntry().add(castToReference(value)); // Reference
2198          return value;
2199        case 1140135409: // emptyReason
2200          this.emptyReason = castToCodeableConcept(value); // CodeableConcept
2201          return value;
2202        case 1970241253: // section
2203          this.getSection().add((SectionComponent) value); // SectionComponent
2204          return value;
2205        default: return super.setProperty(hash, name, value);
2206        }
2207
2208      }
2209
2210      @Override
2211      public Base setProperty(String name, Base value) throws FHIRException {
2212        if (name.equals("title")) {
2213          this.title = castToString(value); // StringType
2214        } else if (name.equals("code")) {
2215          this.code = castToCodeableConcept(value); // CodeableConcept
2216        } else if (name.equals("author")) {
2217          this.getAuthor().add(castToReference(value));
2218        } else if (name.equals("focus")) {
2219          this.focus = castToReference(value); // Reference
2220        } else if (name.equals("text")) {
2221          this.text = castToNarrative(value); // Narrative
2222        } else if (name.equals("mode")) {
2223          value = new SectionModeEnumFactory().fromType(castToCode(value));
2224          this.mode = (Enumeration) value; // Enumeration<SectionMode>
2225        } else if (name.equals("orderedBy")) {
2226          this.orderedBy = castToCodeableConcept(value); // CodeableConcept
2227        } else if (name.equals("entry")) {
2228          this.getEntry().add(castToReference(value));
2229        } else if (name.equals("emptyReason")) {
2230          this.emptyReason = castToCodeableConcept(value); // CodeableConcept
2231        } else if (name.equals("section")) {
2232          this.getSection().add((SectionComponent) value);
2233        } else
2234          return super.setProperty(name, value);
2235        return value;
2236      }
2237
2238      @Override
2239      public Base makeProperty(int hash, String name) throws FHIRException {
2240        switch (hash) {
2241        case 110371416:  return getTitleElement();
2242        case 3059181:  return getCode(); 
2243        case -1406328437:  return addAuthor(); 
2244        case 97604824:  return getFocus(); 
2245        case 3556653:  return getText(); 
2246        case 3357091:  return getModeElement();
2247        case -391079516:  return getOrderedBy(); 
2248        case 96667762:  return addEntry(); 
2249        case 1140135409:  return getEmptyReason(); 
2250        case 1970241253:  return addSection(); 
2251        default: return super.makeProperty(hash, name);
2252        }
2253
2254      }
2255
2256      @Override
2257      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2258        switch (hash) {
2259        case 110371416: /*title*/ return new String[] {"string"};
2260        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2261        case -1406328437: /*author*/ return new String[] {"Reference"};
2262        case 97604824: /*focus*/ return new String[] {"Reference"};
2263        case 3556653: /*text*/ return new String[] {"Narrative"};
2264        case 3357091: /*mode*/ return new String[] {"code"};
2265        case -391079516: /*orderedBy*/ return new String[] {"CodeableConcept"};
2266        case 96667762: /*entry*/ return new String[] {"Reference"};
2267        case 1140135409: /*emptyReason*/ return new String[] {"CodeableConcept"};
2268        case 1970241253: /*section*/ return new String[] {"@Composition.section"};
2269        default: return super.getTypesForProperty(hash, name);
2270        }
2271
2272      }
2273
2274      @Override
2275      public Base addChild(String name) throws FHIRException {
2276        if (name.equals("title")) {
2277          throw new FHIRException("Cannot call addChild on a primitive type Composition.title");
2278        }
2279        else if (name.equals("code")) {
2280          this.code = new CodeableConcept();
2281          return this.code;
2282        }
2283        else if (name.equals("author")) {
2284          return addAuthor();
2285        }
2286        else if (name.equals("focus")) {
2287          this.focus = new Reference();
2288          return this.focus;
2289        }
2290        else if (name.equals("text")) {
2291          this.text = new Narrative();
2292          return this.text;
2293        }
2294        else if (name.equals("mode")) {
2295          throw new FHIRException("Cannot call addChild on a primitive type Composition.mode");
2296        }
2297        else if (name.equals("orderedBy")) {
2298          this.orderedBy = new CodeableConcept();
2299          return this.orderedBy;
2300        }
2301        else if (name.equals("entry")) {
2302          return addEntry();
2303        }
2304        else if (name.equals("emptyReason")) {
2305          this.emptyReason = new CodeableConcept();
2306          return this.emptyReason;
2307        }
2308        else if (name.equals("section")) {
2309          return addSection();
2310        }
2311        else
2312          return super.addChild(name);
2313      }
2314
2315      public SectionComponent copy() {
2316        SectionComponent dst = new SectionComponent();
2317        copyValues(dst);
2318        return dst;
2319      }
2320
2321      public void copyValues(SectionComponent dst) {
2322        super.copyValues(dst);
2323        dst.title = title == null ? null : title.copy();
2324        dst.code = code == null ? null : code.copy();
2325        if (author != null) {
2326          dst.author = new ArrayList<Reference>();
2327          for (Reference i : author)
2328            dst.author.add(i.copy());
2329        };
2330        dst.focus = focus == null ? null : focus.copy();
2331        dst.text = text == null ? null : text.copy();
2332        dst.mode = mode == null ? null : mode.copy();
2333        dst.orderedBy = orderedBy == null ? null : orderedBy.copy();
2334        if (entry != null) {
2335          dst.entry = new ArrayList<Reference>();
2336          for (Reference i : entry)
2337            dst.entry.add(i.copy());
2338        };
2339        dst.emptyReason = emptyReason == null ? null : emptyReason.copy();
2340        if (section != null) {
2341          dst.section = new ArrayList<SectionComponent>();
2342          for (SectionComponent i : section)
2343            dst.section.add(i.copy());
2344        };
2345      }
2346
2347      @Override
2348      public boolean equalsDeep(Base other_) {
2349        if (!super.equalsDeep(other_))
2350          return false;
2351        if (!(other_ instanceof SectionComponent))
2352          return false;
2353        SectionComponent o = (SectionComponent) other_;
2354        return compareDeep(title, o.title, true) && compareDeep(code, o.code, true) && compareDeep(author, o.author, true)
2355           && compareDeep(focus, o.focus, true) && compareDeep(text, o.text, true) && compareDeep(mode, o.mode, true)
2356           && compareDeep(orderedBy, o.orderedBy, true) && compareDeep(entry, o.entry, true) && compareDeep(emptyReason, o.emptyReason, true)
2357           && compareDeep(section, o.section, true);
2358      }
2359
2360      @Override
2361      public boolean equalsShallow(Base other_) {
2362        if (!super.equalsShallow(other_))
2363          return false;
2364        if (!(other_ instanceof SectionComponent))
2365          return false;
2366        SectionComponent o = (SectionComponent) other_;
2367        return compareValues(title, o.title, true) && compareValues(mode, o.mode, true);
2368      }
2369
2370      public boolean isEmpty() {
2371        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(title, code, author, focus
2372          , text, mode, orderedBy, entry, emptyReason, section);
2373      }
2374
2375  public String fhirType() {
2376    return "Composition.section";
2377
2378  }
2379
2380  }
2381
2382    /**
2383     * A version-independent identifier for the Composition. This identifier stays constant as the composition is changed over time.
2384     */
2385    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true)
2386    @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." )
2387    protected Identifier identifier;
2388
2389    /**
2390     * The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.
2391     */
2392    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
2393    @Description(shortDefinition="preliminary | final | amended | entered-in-error", formalDefinition="The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document." )
2394    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/composition-status")
2395    protected Enumeration<CompositionStatus> status;
2396
2397    /**
2398     * 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.
2399     */
2400    @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true)
2401    @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." )
2402    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/doc-typecodes")
2403    protected CodeableConcept type;
2404
2405    /**
2406     * 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.
2407     */
2408    @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2409    @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." )
2410    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/document-classcodes")
2411    protected List<CodeableConcept> category;
2412
2413    /**
2414     * 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).
2415     */
2416    @Child(name = "subject", type = {Reference.class}, order=4, min=0, max=1, modifier=false, summary=true)
2417    @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)." )
2418    protected Reference subject;
2419
2420    /**
2421     * The actual object that is the target of the reference (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).)
2422     */
2423    protected Resource subjectTarget;
2424
2425    /**
2426     * Describes the clinical encounter or type of care this documentation is associated with.
2427     */
2428    @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1, modifier=false, summary=true)
2429    @Description(shortDefinition="Context of the Composition", formalDefinition="Describes the clinical encounter or type of care this documentation is associated with." )
2430    protected Reference encounter;
2431
2432    /**
2433     * The actual object that is the target of the reference (Describes the clinical encounter or type of care this documentation is associated with.)
2434     */
2435    protected Encounter encounterTarget;
2436
2437    /**
2438     * The composition editing time, when the composition was last logically changed by the author.
2439     */
2440    @Child(name = "date", type = {DateTimeType.class}, order=6, min=1, max=1, modifier=false, summary=true)
2441    @Description(shortDefinition="Composition editing time", formalDefinition="The composition editing time, when the composition was last logically changed by the author." )
2442    protected DateTimeType date;
2443
2444    /**
2445     * Identifies who is responsible for the information in the composition, not necessarily who typed it in.
2446     */
2447    @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)
2448    @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." )
2449    protected List<Reference> author;
2450    /**
2451     * The actual objects that are the target of the reference (Identifies who is responsible for the information in the composition, not necessarily who typed it in.)
2452     */
2453    protected List<Resource> authorTarget;
2454
2455
2456    /**
2457     * Official human-readable label for the composition.
2458     */
2459    @Child(name = "title", type = {StringType.class}, order=8, min=1, max=1, modifier=false, summary=true)
2460    @Description(shortDefinition="Human Readable name/title", formalDefinition="Official human-readable label for the composition." )
2461    protected StringType title;
2462
2463    /**
2464     * The code specifying the level of confidentiality of the Composition.
2465     */
2466    @Child(name = "confidentiality", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=true)
2467    @Description(shortDefinition="As defined by affinity domain", formalDefinition="The code specifying the level of confidentiality of the Composition." )
2468    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-ConfidentialityClassification")
2469    protected Enumeration<DocumentConfidentiality> confidentiality;
2470
2471    /**
2472     * A participant who has attested to the accuracy of the composition/document.
2473     */
2474    @Child(name = "attester", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2475    @Description(shortDefinition="Attests to accuracy of composition", formalDefinition="A participant who has attested to the accuracy of the composition/document." )
2476    protected List<CompositionAttesterComponent> attester;
2477
2478    /**
2479     * Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.
2480     */
2481    @Child(name = "custodian", type = {Organization.class}, order=11, min=0, max=1, modifier=false, summary=true)
2482    @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." )
2483    protected Reference custodian;
2484
2485    /**
2486     * The actual object that is the target of the reference (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.)
2487     */
2488    protected Organization custodianTarget;
2489
2490    /**
2491     * Relationships that this composition has with other compositions or documents that already exist.
2492     */
2493    @Child(name = "relatesTo", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2494    @Description(shortDefinition="Relationships to other compositions/documents", formalDefinition="Relationships that this composition has with other compositions or documents that already exist." )
2495    protected List<CompositionRelatesToComponent> relatesTo;
2496
2497    /**
2498     * The clinical service, such as a colonoscopy or an appendectomy, being documented.
2499     */
2500    @Child(name = "event", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2501    @Description(shortDefinition="The clinical service(s) being documented", formalDefinition="The clinical service, such as a colonoscopy or an appendectomy, being documented." )
2502    protected List<CompositionEventComponent> event;
2503
2504    /**
2505     * The root of the sections that make up the composition.
2506     */
2507    @Child(name = "section", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2508    @Description(shortDefinition="Composition is broken into sections", formalDefinition="The root of the sections that make up the composition." )
2509    protected List<SectionComponent> section;
2510
2511    private static final long serialVersionUID = -1490206663L;
2512
2513  /**
2514   * Constructor
2515   */
2516    public Composition() {
2517      super();
2518    }
2519
2520  /**
2521   * Constructor
2522   */
2523    public Composition(Enumeration<CompositionStatus> status, CodeableConcept type, DateTimeType date, StringType title) {
2524      super();
2525      this.status = status;
2526      this.type = type;
2527      this.date = date;
2528      this.title = title;
2529    }
2530
2531    /**
2532     * @return {@link #identifier} (A version-independent identifier for the Composition. This identifier stays constant as the composition is changed over time.)
2533     */
2534    public Identifier getIdentifier() { 
2535      if (this.identifier == null)
2536        if (Configuration.errorOnAutoCreate())
2537          throw new Error("Attempt to auto-create Composition.identifier");
2538        else if (Configuration.doAutoCreate())
2539          this.identifier = new Identifier(); // cc
2540      return this.identifier;
2541    }
2542
2543    public boolean hasIdentifier() { 
2544      return this.identifier != null && !this.identifier.isEmpty();
2545    }
2546
2547    /**
2548     * @param value {@link #identifier} (A version-independent identifier for the Composition. This identifier stays constant as the composition is changed over time.)
2549     */
2550    public Composition setIdentifier(Identifier value) { 
2551      this.identifier = value;
2552      return this;
2553    }
2554
2555    /**
2556     * @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
2557     */
2558    public Enumeration<CompositionStatus> getStatusElement() { 
2559      if (this.status == null)
2560        if (Configuration.errorOnAutoCreate())
2561          throw new Error("Attempt to auto-create Composition.status");
2562        else if (Configuration.doAutoCreate())
2563          this.status = new Enumeration<CompositionStatus>(new CompositionStatusEnumFactory()); // bb
2564      return this.status;
2565    }
2566
2567    public boolean hasStatusElement() { 
2568      return this.status != null && !this.status.isEmpty();
2569    }
2570
2571    public boolean hasStatus() { 
2572      return this.status != null && !this.status.isEmpty();
2573    }
2574
2575    /**
2576     * @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
2577     */
2578    public Composition setStatusElement(Enumeration<CompositionStatus> value) { 
2579      this.status = value;
2580      return this;
2581    }
2582
2583    /**
2584     * @return The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.
2585     */
2586    public CompositionStatus getStatus() { 
2587      return this.status == null ? null : this.status.getValue();
2588    }
2589
2590    /**
2591     * @param value The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.
2592     */
2593    public Composition setStatus(CompositionStatus value) { 
2594        if (this.status == null)
2595          this.status = new Enumeration<CompositionStatus>(new CompositionStatusEnumFactory());
2596        this.status.setValue(value);
2597      return this;
2598    }
2599
2600    /**
2601     * @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.)
2602     */
2603    public CodeableConcept getType() { 
2604      if (this.type == null)
2605        if (Configuration.errorOnAutoCreate())
2606          throw new Error("Attempt to auto-create Composition.type");
2607        else if (Configuration.doAutoCreate())
2608          this.type = new CodeableConcept(); // cc
2609      return this.type;
2610    }
2611
2612    public boolean hasType() { 
2613      return this.type != null && !this.type.isEmpty();
2614    }
2615
2616    /**
2617     * @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.)
2618     */
2619    public Composition setType(CodeableConcept value) { 
2620      this.type = value;
2621      return this;
2622    }
2623
2624    /**
2625     * @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.)
2626     */
2627    public List<CodeableConcept> getCategory() { 
2628      if (this.category == null)
2629        this.category = new ArrayList<CodeableConcept>();
2630      return this.category;
2631    }
2632
2633    /**
2634     * @return Returns a reference to <code>this</code> for easy method chaining
2635     */
2636    public Composition setCategory(List<CodeableConcept> theCategory) { 
2637      this.category = theCategory;
2638      return this;
2639    }
2640
2641    public boolean hasCategory() { 
2642      if (this.category == null)
2643        return false;
2644      for (CodeableConcept item : this.category)
2645        if (!item.isEmpty())
2646          return true;
2647      return false;
2648    }
2649
2650    public CodeableConcept addCategory() { //3
2651      CodeableConcept t = new CodeableConcept();
2652      if (this.category == null)
2653        this.category = new ArrayList<CodeableConcept>();
2654      this.category.add(t);
2655      return t;
2656    }
2657
2658    public Composition addCategory(CodeableConcept t) { //3
2659      if (t == null)
2660        return this;
2661      if (this.category == null)
2662        this.category = new ArrayList<CodeableConcept>();
2663      this.category.add(t);
2664      return this;
2665    }
2666
2667    /**
2668     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist
2669     */
2670    public CodeableConcept getCategoryFirstRep() { 
2671      if (getCategory().isEmpty()) {
2672        addCategory();
2673      }
2674      return getCategory().get(0);
2675    }
2676
2677    /**
2678     * @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).)
2679     */
2680    public Reference getSubject() { 
2681      if (this.subject == null)
2682        if (Configuration.errorOnAutoCreate())
2683          throw new Error("Attempt to auto-create Composition.subject");
2684        else if (Configuration.doAutoCreate())
2685          this.subject = new Reference(); // cc
2686      return this.subject;
2687    }
2688
2689    public boolean hasSubject() { 
2690      return this.subject != null && !this.subject.isEmpty();
2691    }
2692
2693    /**
2694     * @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).)
2695     */
2696    public Composition setSubject(Reference value) { 
2697      this.subject = value;
2698      return this;
2699    }
2700
2701    /**
2702     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what the 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).)
2703     */
2704    public Resource getSubjectTarget() { 
2705      return this.subjectTarget;
2706    }
2707
2708    /**
2709     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what the 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).)
2710     */
2711    public Composition setSubjectTarget(Resource value) { 
2712      this.subjectTarget = value;
2713      return this;
2714    }
2715
2716    /**
2717     * @return {@link #encounter} (Describes the clinical encounter or type of care this documentation is associated with.)
2718     */
2719    public Reference getEncounter() { 
2720      if (this.encounter == null)
2721        if (Configuration.errorOnAutoCreate())
2722          throw new Error("Attempt to auto-create Composition.encounter");
2723        else if (Configuration.doAutoCreate())
2724          this.encounter = new Reference(); // cc
2725      return this.encounter;
2726    }
2727
2728    public boolean hasEncounter() { 
2729      return this.encounter != null && !this.encounter.isEmpty();
2730    }
2731
2732    /**
2733     * @param value {@link #encounter} (Describes the clinical encounter or type of care this documentation is associated with.)
2734     */
2735    public Composition setEncounter(Reference value) { 
2736      this.encounter = value;
2737      return this;
2738    }
2739
2740    /**
2741     * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the clinical encounter or type of care this documentation is associated with.)
2742     */
2743    public Encounter getEncounterTarget() { 
2744      if (this.encounterTarget == null)
2745        if (Configuration.errorOnAutoCreate())
2746          throw new Error("Attempt to auto-create Composition.encounter");
2747        else if (Configuration.doAutoCreate())
2748          this.encounterTarget = new Encounter(); // aa
2749      return this.encounterTarget;
2750    }
2751
2752    /**
2753     * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the clinical encounter or type of care this documentation is associated with.)
2754     */
2755    public Composition setEncounterTarget(Encounter value) { 
2756      this.encounterTarget = value;
2757      return this;
2758    }
2759
2760    /**
2761     * @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
2762     */
2763    public DateTimeType getDateElement() { 
2764      if (this.date == null)
2765        if (Configuration.errorOnAutoCreate())
2766          throw new Error("Attempt to auto-create Composition.date");
2767        else if (Configuration.doAutoCreate())
2768          this.date = new DateTimeType(); // bb
2769      return this.date;
2770    }
2771
2772    public boolean hasDateElement() { 
2773      return this.date != null && !this.date.isEmpty();
2774    }
2775
2776    public boolean hasDate() { 
2777      return this.date != null && !this.date.isEmpty();
2778    }
2779
2780    /**
2781     * @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
2782     */
2783    public Composition setDateElement(DateTimeType value) { 
2784      this.date = value;
2785      return this;
2786    }
2787
2788    /**
2789     * @return The composition editing time, when the composition was last logically changed by the author.
2790     */
2791    public Date getDate() { 
2792      return this.date == null ? null : this.date.getValue();
2793    }
2794
2795    /**
2796     * @param value The composition editing time, when the composition was last logically changed by the author.
2797     */
2798    public Composition setDate(Date value) { 
2799        if (this.date == null)
2800          this.date = new DateTimeType();
2801        this.date.setValue(value);
2802      return this;
2803    }
2804
2805    /**
2806     * @return {@link #author} (Identifies who is responsible for the information in the composition, not necessarily who typed it in.)
2807     */
2808    public List<Reference> getAuthor() { 
2809      if (this.author == null)
2810        this.author = new ArrayList<Reference>();
2811      return this.author;
2812    }
2813
2814    /**
2815     * @return Returns a reference to <code>this</code> for easy method chaining
2816     */
2817    public Composition setAuthor(List<Reference> theAuthor) { 
2818      this.author = theAuthor;
2819      return this;
2820    }
2821
2822    public boolean hasAuthor() { 
2823      if (this.author == null)
2824        return false;
2825      for (Reference item : this.author)
2826        if (!item.isEmpty())
2827          return true;
2828      return false;
2829    }
2830
2831    public Reference addAuthor() { //3
2832      Reference t = new Reference();
2833      if (this.author == null)
2834        this.author = new ArrayList<Reference>();
2835      this.author.add(t);
2836      return t;
2837    }
2838
2839    public Composition addAuthor(Reference t) { //3
2840      if (t == null)
2841        return this;
2842      if (this.author == null)
2843        this.author = new ArrayList<Reference>();
2844      this.author.add(t);
2845      return this;
2846    }
2847
2848    /**
2849     * @return The first repetition of repeating field {@link #author}, creating it if it does not already exist
2850     */
2851    public Reference getAuthorFirstRep() { 
2852      if (getAuthor().isEmpty()) {
2853        addAuthor();
2854      }
2855      return getAuthor().get(0);
2856    }
2857
2858    /**
2859     * @deprecated Use Reference#setResource(IBaseResource) instead
2860     */
2861    @Deprecated
2862    public List<Resource> getAuthorTarget() { 
2863      if (this.authorTarget == null)
2864        this.authorTarget = new ArrayList<Resource>();
2865      return this.authorTarget;
2866    }
2867
2868    /**
2869     * @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
2870     */
2871    public StringType getTitleElement() { 
2872      if (this.title == null)
2873        if (Configuration.errorOnAutoCreate())
2874          throw new Error("Attempt to auto-create Composition.title");
2875        else if (Configuration.doAutoCreate())
2876          this.title = new StringType(); // bb
2877      return this.title;
2878    }
2879
2880    public boolean hasTitleElement() { 
2881      return this.title != null && !this.title.isEmpty();
2882    }
2883
2884    public boolean hasTitle() { 
2885      return this.title != null && !this.title.isEmpty();
2886    }
2887
2888    /**
2889     * @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
2890     */
2891    public Composition setTitleElement(StringType value) { 
2892      this.title = value;
2893      return this;
2894    }
2895
2896    /**
2897     * @return Official human-readable label for the composition.
2898     */
2899    public String getTitle() { 
2900      return this.title == null ? null : this.title.getValue();
2901    }
2902
2903    /**
2904     * @param value Official human-readable label for the composition.
2905     */
2906    public Composition setTitle(String value) { 
2907        if (this.title == null)
2908          this.title = new StringType();
2909        this.title.setValue(value);
2910      return this;
2911    }
2912
2913    /**
2914     * @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
2915     */
2916    public Enumeration<DocumentConfidentiality> getConfidentialityElement() { 
2917      if (this.confidentiality == null)
2918        if (Configuration.errorOnAutoCreate())
2919          throw new Error("Attempt to auto-create Composition.confidentiality");
2920        else if (Configuration.doAutoCreate())
2921          this.confidentiality = new Enumeration<DocumentConfidentiality>(new DocumentConfidentialityEnumFactory()); // bb
2922      return this.confidentiality;
2923    }
2924
2925    public boolean hasConfidentialityElement() { 
2926      return this.confidentiality != null && !this.confidentiality.isEmpty();
2927    }
2928
2929    public boolean hasConfidentiality() { 
2930      return this.confidentiality != null && !this.confidentiality.isEmpty();
2931    }
2932
2933    /**
2934     * @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
2935     */
2936    public Composition setConfidentialityElement(Enumeration<DocumentConfidentiality> value) { 
2937      this.confidentiality = value;
2938      return this;
2939    }
2940
2941    /**
2942     * @return The code specifying the level of confidentiality of the Composition.
2943     */
2944    public DocumentConfidentiality getConfidentiality() { 
2945      return this.confidentiality == null ? null : this.confidentiality.getValue();
2946    }
2947
2948    /**
2949     * @param value The code specifying the level of confidentiality of the Composition.
2950     */
2951    public Composition setConfidentiality(DocumentConfidentiality value) { 
2952      if (value == null)
2953        this.confidentiality = null;
2954      else {
2955        if (this.confidentiality == null)
2956          this.confidentiality = new Enumeration<DocumentConfidentiality>(new DocumentConfidentialityEnumFactory());
2957        this.confidentiality.setValue(value);
2958      }
2959      return this;
2960    }
2961
2962    /**
2963     * @return {@link #attester} (A participant who has attested to the accuracy of the composition/document.)
2964     */
2965    public List<CompositionAttesterComponent> getAttester() { 
2966      if (this.attester == null)
2967        this.attester = new ArrayList<CompositionAttesterComponent>();
2968      return this.attester;
2969    }
2970
2971    /**
2972     * @return Returns a reference to <code>this</code> for easy method chaining
2973     */
2974    public Composition setAttester(List<CompositionAttesterComponent> theAttester) { 
2975      this.attester = theAttester;
2976      return this;
2977    }
2978
2979    public boolean hasAttester() { 
2980      if (this.attester == null)
2981        return false;
2982      for (CompositionAttesterComponent item : this.attester)
2983        if (!item.isEmpty())
2984          return true;
2985      return false;
2986    }
2987
2988    public CompositionAttesterComponent addAttester() { //3
2989      CompositionAttesterComponent t = new CompositionAttesterComponent();
2990      if (this.attester == null)
2991        this.attester = new ArrayList<CompositionAttesterComponent>();
2992      this.attester.add(t);
2993      return t;
2994    }
2995
2996    public Composition addAttester(CompositionAttesterComponent t) { //3
2997      if (t == null)
2998        return this;
2999      if (this.attester == null)
3000        this.attester = new ArrayList<CompositionAttesterComponent>();
3001      this.attester.add(t);
3002      return this;
3003    }
3004
3005    /**
3006     * @return The first repetition of repeating field {@link #attester}, creating it if it does not already exist
3007     */
3008    public CompositionAttesterComponent getAttesterFirstRep() { 
3009      if (getAttester().isEmpty()) {
3010        addAttester();
3011      }
3012      return getAttester().get(0);
3013    }
3014
3015    /**
3016     * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.)
3017     */
3018    public Reference getCustodian() { 
3019      if (this.custodian == null)
3020        if (Configuration.errorOnAutoCreate())
3021          throw new Error("Attempt to auto-create Composition.custodian");
3022        else if (Configuration.doAutoCreate())
3023          this.custodian = new Reference(); // cc
3024      return this.custodian;
3025    }
3026
3027    public boolean hasCustodian() { 
3028      return this.custodian != null && !this.custodian.isEmpty();
3029    }
3030
3031    /**
3032     * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.)
3033     */
3034    public Composition setCustodian(Reference value) { 
3035      this.custodian = value;
3036      return this;
3037    }
3038
3039    /**
3040     * @return {@link #custodian} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.)
3041     */
3042    public Organization getCustodianTarget() { 
3043      if (this.custodianTarget == null)
3044        if (Configuration.errorOnAutoCreate())
3045          throw new Error("Attempt to auto-create Composition.custodian");
3046        else if (Configuration.doAutoCreate())
3047          this.custodianTarget = new Organization(); // aa
3048      return this.custodianTarget;
3049    }
3050
3051    /**
3052     * @param value {@link #custodian} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.)
3053     */
3054    public Composition setCustodianTarget(Organization value) { 
3055      this.custodianTarget = value;
3056      return this;
3057    }
3058
3059    /**
3060     * @return {@link #relatesTo} (Relationships that this composition has with other compositions or documents that already exist.)
3061     */
3062    public List<CompositionRelatesToComponent> getRelatesTo() { 
3063      if (this.relatesTo == null)
3064        this.relatesTo = new ArrayList<CompositionRelatesToComponent>();
3065      return this.relatesTo;
3066    }
3067
3068    /**
3069     * @return Returns a reference to <code>this</code> for easy method chaining
3070     */
3071    public Composition setRelatesTo(List<CompositionRelatesToComponent> theRelatesTo) { 
3072      this.relatesTo = theRelatesTo;
3073      return this;
3074    }
3075
3076    public boolean hasRelatesTo() { 
3077      if (this.relatesTo == null)
3078        return false;
3079      for (CompositionRelatesToComponent item : this.relatesTo)
3080        if (!item.isEmpty())
3081          return true;
3082      return false;
3083    }
3084
3085    public CompositionRelatesToComponent addRelatesTo() { //3
3086      CompositionRelatesToComponent t = new CompositionRelatesToComponent();
3087      if (this.relatesTo == null)
3088        this.relatesTo = new ArrayList<CompositionRelatesToComponent>();
3089      this.relatesTo.add(t);
3090      return t;
3091    }
3092
3093    public Composition addRelatesTo(CompositionRelatesToComponent t) { //3
3094      if (t == null)
3095        return this;
3096      if (this.relatesTo == null)
3097        this.relatesTo = new ArrayList<CompositionRelatesToComponent>();
3098      this.relatesTo.add(t);
3099      return this;
3100    }
3101
3102    /**
3103     * @return The first repetition of repeating field {@link #relatesTo}, creating it if it does not already exist
3104     */
3105    public CompositionRelatesToComponent getRelatesToFirstRep() { 
3106      if (getRelatesTo().isEmpty()) {
3107        addRelatesTo();
3108      }
3109      return getRelatesTo().get(0);
3110    }
3111
3112    /**
3113     * @return {@link #event} (The clinical service, such as a colonoscopy or an appendectomy, being documented.)
3114     */
3115    public List<CompositionEventComponent> getEvent() { 
3116      if (this.event == null)
3117        this.event = new ArrayList<CompositionEventComponent>();
3118      return this.event;
3119    }
3120
3121    /**
3122     * @return Returns a reference to <code>this</code> for easy method chaining
3123     */
3124    public Composition setEvent(List<CompositionEventComponent> theEvent) { 
3125      this.event = theEvent;
3126      return this;
3127    }
3128
3129    public boolean hasEvent() { 
3130      if (this.event == null)
3131        return false;
3132      for (CompositionEventComponent item : this.event)
3133        if (!item.isEmpty())
3134          return true;
3135      return false;
3136    }
3137
3138    public CompositionEventComponent addEvent() { //3
3139      CompositionEventComponent t = new CompositionEventComponent();
3140      if (this.event == null)
3141        this.event = new ArrayList<CompositionEventComponent>();
3142      this.event.add(t);
3143      return t;
3144    }
3145
3146    public Composition addEvent(CompositionEventComponent t) { //3
3147      if (t == null)
3148        return this;
3149      if (this.event == null)
3150        this.event = new ArrayList<CompositionEventComponent>();
3151      this.event.add(t);
3152      return this;
3153    }
3154
3155    /**
3156     * @return The first repetition of repeating field {@link #event}, creating it if it does not already exist
3157     */
3158    public CompositionEventComponent getEventFirstRep() { 
3159      if (getEvent().isEmpty()) {
3160        addEvent();
3161      }
3162      return getEvent().get(0);
3163    }
3164
3165    /**
3166     * @return {@link #section} (The root of the sections that make up the composition.)
3167     */
3168    public List<SectionComponent> getSection() { 
3169      if (this.section == null)
3170        this.section = new ArrayList<SectionComponent>();
3171      return this.section;
3172    }
3173
3174    /**
3175     * @return Returns a reference to <code>this</code> for easy method chaining
3176     */
3177    public Composition setSection(List<SectionComponent> theSection) { 
3178      this.section = theSection;
3179      return this;
3180    }
3181
3182    public boolean hasSection() { 
3183      if (this.section == null)
3184        return false;
3185      for (SectionComponent item : this.section)
3186        if (!item.isEmpty())
3187          return true;
3188      return false;
3189    }
3190
3191    public SectionComponent addSection() { //3
3192      SectionComponent t = new SectionComponent();
3193      if (this.section == null)
3194        this.section = new ArrayList<SectionComponent>();
3195      this.section.add(t);
3196      return t;
3197    }
3198
3199    public Composition addSection(SectionComponent t) { //3
3200      if (t == null)
3201        return this;
3202      if (this.section == null)
3203        this.section = new ArrayList<SectionComponent>();
3204      this.section.add(t);
3205      return this;
3206    }
3207
3208    /**
3209     * @return The first repetition of repeating field {@link #section}, creating it if it does not already exist
3210     */
3211    public SectionComponent getSectionFirstRep() { 
3212      if (getSection().isEmpty()) {
3213        addSection();
3214      }
3215      return getSection().get(0);
3216    }
3217
3218      protected void listChildren(List<Property> children) {
3219        super.listChildren(children);
3220        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));
3221        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));
3222        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));
3223        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));
3224        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));
3225        children.add(new Property("encounter", "Reference(Encounter)", "Describes the clinical encounter or type of care this documentation is associated with.", 0, 1, encounter));
3226        children.add(new Property("date", "dateTime", "The composition editing time, when the composition was last logically changed by the author.", 0, 1, date));
3227        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));
3228        children.add(new Property("title", "string", "Official human-readable label for the composition.", 0, 1, title));
3229        children.add(new Property("confidentiality", "code", "The code specifying the level of confidentiality of the Composition.", 0, 1, confidentiality));
3230        children.add(new Property("attester", "", "A participant who has attested to the accuracy of the composition/document.", 0, java.lang.Integer.MAX_VALUE, attester));
3231        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));
3232        children.add(new Property("relatesTo", "", "Relationships that this composition has with other compositions or documents that already exist.", 0, java.lang.Integer.MAX_VALUE, relatesTo));
3233        children.add(new Property("event", "", "The clinical service, such as a colonoscopy or an appendectomy, being documented.", 0, java.lang.Integer.MAX_VALUE, event));
3234        children.add(new Property("section", "", "The root of the sections that make up the composition.", 0, java.lang.Integer.MAX_VALUE, section));
3235      }
3236
3237      @Override
3238      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3239        switch (_hash) {
3240        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);
3241        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);
3242        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);
3243        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);
3244        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);
3245        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);
3246        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);
3247        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);
3248        case 110371416: /*title*/  return new Property("title", "string", "Official human-readable label for the composition.", 0, 1, title);
3249        case -1923018202: /*confidentiality*/  return new Property("confidentiality", "code", "The code specifying the level of confidentiality of the Composition.", 0, 1, confidentiality);
3250        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);
3251        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);
3252        case -7765931: /*relatesTo*/  return new Property("relatesTo", "", "Relationships that this composition has with other compositions or documents that already exist.", 0, java.lang.Integer.MAX_VALUE, relatesTo);
3253        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);
3254        case 1970241253: /*section*/  return new Property("section", "", "The root of the sections that make up the composition.", 0, java.lang.Integer.MAX_VALUE, section);
3255        default: return super.getNamedProperty(_hash, _name, _checkValid);
3256        }
3257
3258      }
3259
3260      @Override
3261      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3262        switch (hash) {
3263        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
3264        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<CompositionStatus>
3265        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3266        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
3267        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
3268        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
3269        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
3270        case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // Reference
3271        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
3272        case -1923018202: /*confidentiality*/ return this.confidentiality == null ? new Base[0] : new Base[] {this.confidentiality}; // Enumeration<DocumentConfidentiality>
3273        case 542920370: /*attester*/ return this.attester == null ? new Base[0] : this.attester.toArray(new Base[this.attester.size()]); // CompositionAttesterComponent
3274        case 1611297262: /*custodian*/ return this.custodian == null ? new Base[0] : new Base[] {this.custodian}; // Reference
3275        case -7765931: /*relatesTo*/ return this.relatesTo == null ? new Base[0] : this.relatesTo.toArray(new Base[this.relatesTo.size()]); // CompositionRelatesToComponent
3276        case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // CompositionEventComponent
3277        case 1970241253: /*section*/ return this.section == null ? new Base[0] : this.section.toArray(new Base[this.section.size()]); // SectionComponent
3278        default: return super.getProperty(hash, name, checkValid);
3279        }
3280
3281      }
3282
3283      @Override
3284      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3285        switch (hash) {
3286        case -1618432855: // identifier
3287          this.identifier = castToIdentifier(value); // Identifier
3288          return value;
3289        case -892481550: // status
3290          value = new CompositionStatusEnumFactory().fromType(castToCode(value));
3291          this.status = (Enumeration) value; // Enumeration<CompositionStatus>
3292          return value;
3293        case 3575610: // type
3294          this.type = castToCodeableConcept(value); // CodeableConcept
3295          return value;
3296        case 50511102: // category
3297          this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept
3298          return value;
3299        case -1867885268: // subject
3300          this.subject = castToReference(value); // Reference
3301          return value;
3302        case 1524132147: // encounter
3303          this.encounter = castToReference(value); // Reference
3304          return value;
3305        case 3076014: // date
3306          this.date = castToDateTime(value); // DateTimeType
3307          return value;
3308        case -1406328437: // author
3309          this.getAuthor().add(castToReference(value)); // Reference
3310          return value;
3311        case 110371416: // title
3312          this.title = castToString(value); // StringType
3313          return value;
3314        case -1923018202: // confidentiality
3315          value = new DocumentConfidentialityEnumFactory().fromType(castToCode(value));
3316          this.confidentiality = (Enumeration) value; // Enumeration<DocumentConfidentiality>
3317          return value;
3318        case 542920370: // attester
3319          this.getAttester().add((CompositionAttesterComponent) value); // CompositionAttesterComponent
3320          return value;
3321        case 1611297262: // custodian
3322          this.custodian = castToReference(value); // Reference
3323          return value;
3324        case -7765931: // relatesTo
3325          this.getRelatesTo().add((CompositionRelatesToComponent) value); // CompositionRelatesToComponent
3326          return value;
3327        case 96891546: // event
3328          this.getEvent().add((CompositionEventComponent) value); // CompositionEventComponent
3329          return value;
3330        case 1970241253: // section
3331          this.getSection().add((SectionComponent) value); // SectionComponent
3332          return value;
3333        default: return super.setProperty(hash, name, value);
3334        }
3335
3336      }
3337
3338      @Override
3339      public Base setProperty(String name, Base value) throws FHIRException {
3340        if (name.equals("identifier")) {
3341          this.identifier = castToIdentifier(value); // Identifier
3342        } else if (name.equals("status")) {
3343          value = new CompositionStatusEnumFactory().fromType(castToCode(value));
3344          this.status = (Enumeration) value; // Enumeration<CompositionStatus>
3345        } else if (name.equals("type")) {
3346          this.type = castToCodeableConcept(value); // CodeableConcept
3347        } else if (name.equals("category")) {
3348          this.getCategory().add(castToCodeableConcept(value));
3349        } else if (name.equals("subject")) {
3350          this.subject = castToReference(value); // Reference
3351        } else if (name.equals("encounter")) {
3352          this.encounter = castToReference(value); // Reference
3353        } else if (name.equals("date")) {
3354          this.date = castToDateTime(value); // DateTimeType
3355        } else if (name.equals("author")) {
3356          this.getAuthor().add(castToReference(value));
3357        } else if (name.equals("title")) {
3358          this.title = castToString(value); // StringType
3359        } else if (name.equals("confidentiality")) {
3360          value = new DocumentConfidentialityEnumFactory().fromType(castToCode(value));
3361          this.confidentiality = (Enumeration) value; // Enumeration<DocumentConfidentiality>
3362        } else if (name.equals("attester")) {
3363          this.getAttester().add((CompositionAttesterComponent) value);
3364        } else if (name.equals("custodian")) {
3365          this.custodian = castToReference(value); // Reference
3366        } else if (name.equals("relatesTo")) {
3367          this.getRelatesTo().add((CompositionRelatesToComponent) value);
3368        } else if (name.equals("event")) {
3369          this.getEvent().add((CompositionEventComponent) value);
3370        } else if (name.equals("section")) {
3371          this.getSection().add((SectionComponent) value);
3372        } else
3373          return super.setProperty(name, value);
3374        return value;
3375      }
3376
3377      @Override
3378      public Base makeProperty(int hash, String name) throws FHIRException {
3379        switch (hash) {
3380        case -1618432855:  return getIdentifier(); 
3381        case -892481550:  return getStatusElement();
3382        case 3575610:  return getType(); 
3383        case 50511102:  return addCategory(); 
3384        case -1867885268:  return getSubject(); 
3385        case 1524132147:  return getEncounter(); 
3386        case 3076014:  return getDateElement();
3387        case -1406328437:  return addAuthor(); 
3388        case 110371416:  return getTitleElement();
3389        case -1923018202:  return getConfidentialityElement();
3390        case 542920370:  return addAttester(); 
3391        case 1611297262:  return getCustodian(); 
3392        case -7765931:  return addRelatesTo(); 
3393        case 96891546:  return addEvent(); 
3394        case 1970241253:  return addSection(); 
3395        default: return super.makeProperty(hash, name);
3396        }
3397
3398      }
3399
3400      @Override
3401      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3402        switch (hash) {
3403        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3404        case -892481550: /*status*/ return new String[] {"code"};
3405        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3406        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
3407        case -1867885268: /*subject*/ return new String[] {"Reference"};
3408        case 1524132147: /*encounter*/ return new String[] {"Reference"};
3409        case 3076014: /*date*/ return new String[] {"dateTime"};
3410        case -1406328437: /*author*/ return new String[] {"Reference"};
3411        case 110371416: /*title*/ return new String[] {"string"};
3412        case -1923018202: /*confidentiality*/ return new String[] {"code"};
3413        case 542920370: /*attester*/ return new String[] {};
3414        case 1611297262: /*custodian*/ return new String[] {"Reference"};
3415        case -7765931: /*relatesTo*/ return new String[] {};
3416        case 96891546: /*event*/ return new String[] {};
3417        case 1970241253: /*section*/ return new String[] {};
3418        default: return super.getTypesForProperty(hash, name);
3419        }
3420
3421      }
3422
3423      @Override
3424      public Base addChild(String name) throws FHIRException {
3425        if (name.equals("identifier")) {
3426          this.identifier = new Identifier();
3427          return this.identifier;
3428        }
3429        else if (name.equals("status")) {
3430          throw new FHIRException("Cannot call addChild on a primitive type Composition.status");
3431        }
3432        else if (name.equals("type")) {
3433          this.type = new CodeableConcept();
3434          return this.type;
3435        }
3436        else if (name.equals("category")) {
3437          return addCategory();
3438        }
3439        else if (name.equals("subject")) {
3440          this.subject = new Reference();
3441          return this.subject;
3442        }
3443        else if (name.equals("encounter")) {
3444          this.encounter = new Reference();
3445          return this.encounter;
3446        }
3447        else if (name.equals("date")) {
3448          throw new FHIRException("Cannot call addChild on a primitive type Composition.date");
3449        }
3450        else if (name.equals("author")) {
3451          return addAuthor();
3452        }
3453        else if (name.equals("title")) {
3454          throw new FHIRException("Cannot call addChild on a primitive type Composition.title");
3455        }
3456        else if (name.equals("confidentiality")) {
3457          throw new FHIRException("Cannot call addChild on a primitive type Composition.confidentiality");
3458        }
3459        else if (name.equals("attester")) {
3460          return addAttester();
3461        }
3462        else if (name.equals("custodian")) {
3463          this.custodian = new Reference();
3464          return this.custodian;
3465        }
3466        else if (name.equals("relatesTo")) {
3467          return addRelatesTo();
3468        }
3469        else if (name.equals("event")) {
3470          return addEvent();
3471        }
3472        else if (name.equals("section")) {
3473          return addSection();
3474        }
3475        else
3476          return super.addChild(name);
3477      }
3478
3479  public String fhirType() {
3480    return "Composition";
3481
3482  }
3483
3484      public Composition copy() {
3485        Composition dst = new Composition();
3486        copyValues(dst);
3487        return dst;
3488      }
3489
3490      public void copyValues(Composition dst) {
3491        super.copyValues(dst);
3492        dst.identifier = identifier == null ? null : identifier.copy();
3493        dst.status = status == null ? null : status.copy();
3494        dst.type = type == null ? null : type.copy();
3495        if (category != null) {
3496          dst.category = new ArrayList<CodeableConcept>();
3497          for (CodeableConcept i : category)
3498            dst.category.add(i.copy());
3499        };
3500        dst.subject = subject == null ? null : subject.copy();
3501        dst.encounter = encounter == null ? null : encounter.copy();
3502        dst.date = date == null ? null : date.copy();
3503        if (author != null) {
3504          dst.author = new ArrayList<Reference>();
3505          for (Reference i : author)
3506            dst.author.add(i.copy());
3507        };
3508        dst.title = title == null ? null : title.copy();
3509        dst.confidentiality = confidentiality == null ? null : confidentiality.copy();
3510        if (attester != null) {
3511          dst.attester = new ArrayList<CompositionAttesterComponent>();
3512          for (CompositionAttesterComponent i : attester)
3513            dst.attester.add(i.copy());
3514        };
3515        dst.custodian = custodian == null ? null : custodian.copy();
3516        if (relatesTo != null) {
3517          dst.relatesTo = new ArrayList<CompositionRelatesToComponent>();
3518          for (CompositionRelatesToComponent i : relatesTo)
3519            dst.relatesTo.add(i.copy());
3520        };
3521        if (event != null) {
3522          dst.event = new ArrayList<CompositionEventComponent>();
3523          for (CompositionEventComponent i : event)
3524            dst.event.add(i.copy());
3525        };
3526        if (section != null) {
3527          dst.section = new ArrayList<SectionComponent>();
3528          for (SectionComponent i : section)
3529            dst.section.add(i.copy());
3530        };
3531      }
3532
3533      protected Composition typedCopy() {
3534        return copy();
3535      }
3536
3537      @Override
3538      public boolean equalsDeep(Base other_) {
3539        if (!super.equalsDeep(other_))
3540          return false;
3541        if (!(other_ instanceof Composition))
3542          return false;
3543        Composition o = (Composition) other_;
3544        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true)
3545           && compareDeep(category, o.category, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true)
3546           && compareDeep(date, o.date, true) && compareDeep(author, o.author, true) && compareDeep(title, o.title, true)
3547           && compareDeep(confidentiality, o.confidentiality, true) && compareDeep(attester, o.attester, true)
3548           && compareDeep(custodian, o.custodian, true) && compareDeep(relatesTo, o.relatesTo, true) && compareDeep(event, o.event, true)
3549           && compareDeep(section, o.section, true);
3550      }
3551
3552      @Override
3553      public boolean equalsShallow(Base other_) {
3554        if (!super.equalsShallow(other_))
3555          return false;
3556        if (!(other_ instanceof Composition))
3557          return false;
3558        Composition o = (Composition) other_;
3559        return compareValues(status, o.status, true) && compareValues(date, o.date, true) && compareValues(title, o.title, true)
3560           && compareValues(confidentiality, o.confidentiality, true);
3561      }
3562
3563      public boolean isEmpty() {
3564        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, type
3565          , category, subject, encounter, date, author, title, confidentiality, attester
3566          , custodian, relatesTo, event, section);
3567      }
3568
3569  @Override
3570  public ResourceType getResourceType() {
3571    return ResourceType.Composition;
3572   }
3573
3574 /**
3575   * Search parameter: <b>date</b>
3576   * <p>
3577   * Description: <b>Composition editing time</b><br>
3578   * Type: <b>date</b><br>
3579   * Path: <b>Composition.date</b><br>
3580   * </p>
3581   */
3582  @SearchParamDefinition(name="date", path="Composition.date", description="Composition editing time", type="date" )
3583  public static final String SP_DATE = "date";
3584 /**
3585   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3586   * <p>
3587   * Description: <b>Composition editing time</b><br>
3588   * Type: <b>date</b><br>
3589   * Path: <b>Composition.date</b><br>
3590   * </p>
3591   */
3592  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
3593
3594 /**
3595   * Search parameter: <b>identifier</b>
3596   * <p>
3597   * Description: <b>Version-independent identifier for the Composition</b><br>
3598   * Type: <b>token</b><br>
3599   * Path: <b>Composition.identifier</b><br>
3600   * </p>
3601   */
3602  @SearchParamDefinition(name="identifier", path="Composition.identifier", description="Version-independent identifier for the Composition", type="token" )
3603  public static final String SP_IDENTIFIER = "identifier";
3604 /**
3605   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3606   * <p>
3607   * Description: <b>Version-independent identifier for the Composition</b><br>
3608   * Type: <b>token</b><br>
3609   * Path: <b>Composition.identifier</b><br>
3610   * </p>
3611   */
3612  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3613
3614 /**
3615   * Search parameter: <b>period</b>
3616   * <p>
3617   * Description: <b>The period covered by the documentation</b><br>
3618   * Type: <b>date</b><br>
3619   * Path: <b>Composition.event.period</b><br>
3620   * </p>
3621   */
3622  @SearchParamDefinition(name="period", path="Composition.event.period", description="The period covered by the documentation", type="date" )
3623  public static final String SP_PERIOD = "period";
3624 /**
3625   * <b>Fluent Client</b> search parameter constant for <b>period</b>
3626   * <p>
3627   * Description: <b>The period covered by the documentation</b><br>
3628   * Type: <b>date</b><br>
3629   * Path: <b>Composition.event.period</b><br>
3630   * </p>
3631   */
3632  public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD);
3633
3634 /**
3635   * Search parameter: <b>related-id</b>
3636   * <p>
3637   * Description: <b>Target of the relationship</b><br>
3638   * Type: <b>token</b><br>
3639   * Path: <b>Composition.relatesTo.targetIdentifier</b><br>
3640   * </p>
3641   */
3642  @SearchParamDefinition(name="related-id", path="(Composition.relatesTo.target as Identifier)", description="Target of the relationship", type="token" )
3643  public static final String SP_RELATED_ID = "related-id";
3644 /**
3645   * <b>Fluent Client</b> search parameter constant for <b>related-id</b>
3646   * <p>
3647   * Description: <b>Target of the relationship</b><br>
3648   * Type: <b>token</b><br>
3649   * Path: <b>Composition.relatesTo.targetIdentifier</b><br>
3650   * </p>
3651   */
3652  public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATED_ID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATED_ID);
3653
3654 /**
3655   * Search parameter: <b>subject</b>
3656   * <p>
3657   * Description: <b>Who and/or what the composition is about</b><br>
3658   * Type: <b>reference</b><br>
3659   * Path: <b>Composition.subject</b><br>
3660   * </p>
3661   */
3662  @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="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") } )
3663  public static final String SP_SUBJECT = "subject";
3664 /**
3665   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
3666   * <p>
3667   * Description: <b>Who and/or what the composition is about</b><br>
3668   * Type: <b>reference</b><br>
3669   * Path: <b>Composition.subject</b><br>
3670   * </p>
3671   */
3672  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
3673
3674/**
3675   * Constant for fluent queries to be used to add include statements. Specifies
3676   * the path value of "<b>Composition:subject</b>".
3677   */
3678  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Composition:subject").toLocked();
3679
3680 /**
3681   * Search parameter: <b>author</b>
3682   * <p>
3683   * Description: <b>Who and/or what authored the composition</b><br>
3684   * Type: <b>reference</b><br>
3685   * Path: <b>Composition.author</b><br>
3686   * </p>
3687   */
3688  @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="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
3689  public static final String SP_AUTHOR = "author";
3690 /**
3691   * <b>Fluent Client</b> search parameter constant for <b>author</b>
3692   * <p>
3693   * Description: <b>Who and/or what authored the composition</b><br>
3694   * Type: <b>reference</b><br>
3695   * Path: <b>Composition.author</b><br>
3696   * </p>
3697   */
3698  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR);
3699
3700/**
3701   * Constant for fluent queries to be used to add include statements. Specifies
3702   * the path value of "<b>Composition:author</b>".
3703   */
3704  public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("Composition:author").toLocked();
3705
3706 /**
3707   * Search parameter: <b>confidentiality</b>
3708   * <p>
3709   * Description: <b>As defined by affinity domain</b><br>
3710   * Type: <b>token</b><br>
3711   * Path: <b>Composition.confidentiality</b><br>
3712   * </p>
3713   */
3714  @SearchParamDefinition(name="confidentiality", path="Composition.confidentiality", description="As defined by affinity domain", type="token" )
3715  public static final String SP_CONFIDENTIALITY = "confidentiality";
3716 /**
3717   * <b>Fluent Client</b> search parameter constant for <b>confidentiality</b>
3718   * <p>
3719   * Description: <b>As defined by affinity domain</b><br>
3720   * Type: <b>token</b><br>
3721   * Path: <b>Composition.confidentiality</b><br>
3722   * </p>
3723   */
3724  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONFIDENTIALITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONFIDENTIALITY);
3725
3726 /**
3727   * Search parameter: <b>section</b>
3728   * <p>
3729   * Description: <b>Classification of section (recommended)</b><br>
3730   * Type: <b>token</b><br>
3731   * Path: <b>Composition.section.code</b><br>
3732   * </p>
3733   */
3734  @SearchParamDefinition(name="section", path="Composition.section.code", description="Classification of section (recommended)", type="token" )
3735  public static final String SP_SECTION = "section";
3736 /**
3737   * <b>Fluent Client</b> search parameter constant for <b>section</b>
3738   * <p>
3739   * Description: <b>Classification of section (recommended)</b><br>
3740   * Type: <b>token</b><br>
3741   * Path: <b>Composition.section.code</b><br>
3742   * </p>
3743   */
3744  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SECTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SECTION);
3745
3746 /**
3747   * Search parameter: <b>encounter</b>
3748   * <p>
3749   * Description: <b>Context of the Composition</b><br>
3750   * Type: <b>reference</b><br>
3751   * Path: <b>Composition.encounter</b><br>
3752   * </p>
3753   */
3754  @SearchParamDefinition(name="encounter", path="Composition.encounter", description="Context of the Composition", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Encounter") }, target={Encounter.class } )
3755  public static final String SP_ENCOUNTER = "encounter";
3756 /**
3757   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
3758   * <p>
3759   * Description: <b>Context of the Composition</b><br>
3760   * Type: <b>reference</b><br>
3761   * Path: <b>Composition.encounter</b><br>
3762   * </p>
3763   */
3764  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
3765
3766/**
3767   * Constant for fluent queries to be used to add include statements. Specifies
3768   * the path value of "<b>Composition:encounter</b>".
3769   */
3770  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Composition:encounter").toLocked();
3771
3772 /**
3773   * Search parameter: <b>type</b>
3774   * <p>
3775   * Description: <b>Kind of composition (LOINC if possible)</b><br>
3776   * Type: <b>token</b><br>
3777   * Path: <b>Composition.type</b><br>
3778   * </p>
3779   */
3780  @SearchParamDefinition(name="type", path="Composition.type", description="Kind of composition (LOINC if possible)", type="token" )
3781  public static final String SP_TYPE = "type";
3782 /**
3783   * <b>Fluent Client</b> search parameter constant for <b>type</b>
3784   * <p>
3785   * Description: <b>Kind of composition (LOINC if possible)</b><br>
3786   * Type: <b>token</b><br>
3787   * Path: <b>Composition.type</b><br>
3788   * </p>
3789   */
3790  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
3791
3792 /**
3793   * Search parameter: <b>title</b>
3794   * <p>
3795   * Description: <b>Human Readable name/title</b><br>
3796   * Type: <b>string</b><br>
3797   * Path: <b>Composition.title</b><br>
3798   * </p>
3799   */
3800  @SearchParamDefinition(name="title", path="Composition.title", description="Human Readable name/title", type="string" )
3801  public static final String SP_TITLE = "title";
3802 /**
3803   * <b>Fluent Client</b> search parameter constant for <b>title</b>
3804   * <p>
3805   * Description: <b>Human Readable name/title</b><br>
3806   * Type: <b>string</b><br>
3807   * Path: <b>Composition.title</b><br>
3808   * </p>
3809   */
3810  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
3811
3812 /**
3813   * Search parameter: <b>attester</b>
3814   * <p>
3815   * Description: <b>Who attested the composition</b><br>
3816   * Type: <b>reference</b><br>
3817   * Path: <b>Composition.attester.party</b><br>
3818   * </p>
3819   */
3820  @SearchParamDefinition(name="attester", path="Composition.attester.party", description="Who attested the composition", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
3821  public static final String SP_ATTESTER = "attester";
3822 /**
3823   * <b>Fluent Client</b> search parameter constant for <b>attester</b>
3824   * <p>
3825   * Description: <b>Who attested the composition</b><br>
3826   * Type: <b>reference</b><br>
3827   * Path: <b>Composition.attester.party</b><br>
3828   * </p>
3829   */
3830  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ATTESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ATTESTER);
3831
3832/**
3833   * Constant for fluent queries to be used to add include statements. Specifies
3834   * the path value of "<b>Composition:attester</b>".
3835   */
3836  public static final ca.uhn.fhir.model.api.Include INCLUDE_ATTESTER = new ca.uhn.fhir.model.api.Include("Composition:attester").toLocked();
3837
3838 /**
3839   * Search parameter: <b>entry</b>
3840   * <p>
3841   * Description: <b>A reference to data that supports this section</b><br>
3842   * Type: <b>reference</b><br>
3843   * Path: <b>Composition.section.entry</b><br>
3844   * </p>
3845   */
3846  @SearchParamDefinition(name="entry", path="Composition.section.entry", description="A reference to data that supports this section", type="reference" )
3847  public static final String SP_ENTRY = "entry";
3848 /**
3849   * <b>Fluent Client</b> search parameter constant for <b>entry</b>
3850   * <p>
3851   * Description: <b>A reference to data that supports this section</b><br>
3852   * Type: <b>reference</b><br>
3853   * Path: <b>Composition.section.entry</b><br>
3854   * </p>
3855   */
3856  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENTRY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENTRY);
3857
3858/**
3859   * Constant for fluent queries to be used to add include statements. Specifies
3860   * the path value of "<b>Composition:entry</b>".
3861   */
3862  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENTRY = new ca.uhn.fhir.model.api.Include("Composition:entry").toLocked();
3863
3864 /**
3865   * Search parameter: <b>related-ref</b>
3866   * <p>
3867   * Description: <b>Target of the relationship</b><br>
3868   * Type: <b>reference</b><br>
3869   * Path: <b>Composition.relatesTo.targetReference</b><br>
3870   * </p>
3871   */
3872  @SearchParamDefinition(name="related-ref", path="(Composition.relatesTo.target as Reference)", description="Target of the relationship", type="reference", target={Composition.class } )
3873  public static final String SP_RELATED_REF = "related-ref";
3874 /**
3875   * <b>Fluent Client</b> search parameter constant for <b>related-ref</b>
3876   * <p>
3877   * Description: <b>Target of the relationship</b><br>
3878   * Type: <b>reference</b><br>
3879   * Path: <b>Composition.relatesTo.targetReference</b><br>
3880   * </p>
3881   */
3882  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATED_REF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATED_REF);
3883
3884/**
3885   * Constant for fluent queries to be used to add include statements. Specifies
3886   * the path value of "<b>Composition:related-ref</b>".
3887   */
3888  public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATED_REF = new ca.uhn.fhir.model.api.Include("Composition:related-ref").toLocked();
3889
3890 /**
3891   * Search parameter: <b>patient</b>
3892   * <p>
3893   * Description: <b>Who and/or what the composition is about</b><br>
3894   * Type: <b>reference</b><br>
3895   * Path: <b>Composition.subject</b><br>
3896   * </p>
3897   */
3898  @SearchParamDefinition(name="patient", path="Composition.subject.where(resolve() is Patient)", description="Who and/or what the composition is about", type="reference", target={Patient.class } )
3899  public static final String SP_PATIENT = "patient";
3900 /**
3901   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3902   * <p>
3903   * Description: <b>Who and/or what the composition is about</b><br>
3904   * Type: <b>reference</b><br>
3905   * Path: <b>Composition.subject</b><br>
3906   * </p>
3907   */
3908  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3909
3910/**
3911   * Constant for fluent queries to be used to add include statements. Specifies
3912   * the path value of "<b>Composition:patient</b>".
3913   */
3914  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Composition:patient").toLocked();
3915
3916 /**
3917   * Search parameter: <b>context</b>
3918   * <p>
3919   * Description: <b>Code(s) that apply to the event being documented</b><br>
3920   * Type: <b>token</b><br>
3921   * Path: <b>Composition.event.code</b><br>
3922   * </p>
3923   */
3924  @SearchParamDefinition(name="context", path="Composition.event.code", description="Code(s) that apply to the event being documented", type="token" )
3925  public static final String SP_CONTEXT = "context";
3926 /**
3927   * <b>Fluent Client</b> search parameter constant for <b>context</b>
3928   * <p>
3929   * Description: <b>Code(s) that apply to the event being documented</b><br>
3930   * Type: <b>token</b><br>
3931   * Path: <b>Composition.event.code</b><br>
3932   * </p>
3933   */
3934  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT);
3935
3936 /**
3937   * Search parameter: <b>category</b>
3938   * <p>
3939   * Description: <b>Categorization of Composition</b><br>
3940   * Type: <b>token</b><br>
3941   * Path: <b>Composition.category</b><br>
3942   * </p>
3943   */
3944  @SearchParamDefinition(name="category", path="Composition.category", description="Categorization of Composition", type="token" )
3945  public static final String SP_CATEGORY = "category";
3946 /**
3947   * <b>Fluent Client</b> search parameter constant for <b>category</b>
3948   * <p>
3949   * Description: <b>Categorization of Composition</b><br>
3950   * Type: <b>token</b><br>
3951   * Path: <b>Composition.category</b><br>
3952   * </p>
3953   */
3954  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
3955
3956 /**
3957   * Search parameter: <b>status</b>
3958   * <p>
3959   * Description: <b>preliminary | final | amended | entered-in-error</b><br>
3960   * Type: <b>token</b><br>
3961   * Path: <b>Composition.status</b><br>
3962   * </p>
3963   */
3964  @SearchParamDefinition(name="status", path="Composition.status", description="preliminary | final | amended | entered-in-error", type="token" )
3965  public static final String SP_STATUS = "status";
3966 /**
3967   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3968   * <p>
3969   * Description: <b>preliminary | final | amended | entered-in-error</b><br>
3970   * Type: <b>token</b><br>
3971   * Path: <b>Composition.status</b><br>
3972   * </p>
3973   */
3974  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3975
3976
3977}