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