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