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