001package org.hl7.fhir.r4b.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Fri, Dec 31, 2021 05:58+1100 for FHIR v4.3.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import java.math.*;
038import org.hl7.fhir.utilities.Utilities;
039import org.hl7.fhir.r4b.model.Enumerations.*;
040import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
041import org.hl7.fhir.exceptions.FHIRException;
042import org.hl7.fhir.instance.model.api.ICompositeType;
043import ca.uhn.fhir.model.api.annotation.ResourceDef;
044import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
045import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.ChildOrder;
048import ca.uhn.fhir.model.api.annotation.Description;
049import ca.uhn.fhir.model.api.annotation.Block;
050
051/**
052 * Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.
053 */
054@ResourceDef(name="Contract", profile="http://hl7.org/fhir/StructureDefinition/Contract")
055public class Contract extends DomainResource {
056
057    public enum ContractResourcePublicationStatusCodes {
058        /**
059         * Contract is augmented with additional information to correct errors in a predecessor or to updated values in a predecessor. Usage: Contract altered within effective time. Precedence Order = 9. Comparable FHIR and v.3 status codes: revised; replaced.
060         */
061        AMENDED, 
062        /**
063         * Contract is augmented with additional information that was missing from a predecessor Contract. Usage: Contract altered within effective time. Precedence Order = 9. Comparable FHIR and v.3 status codes: updated, replaced.
064         */
065        APPENDED, 
066        /**
067         * Contract is terminated due to failure of the Grantor and/or the Grantee to fulfil one or more contract provisions. Usage: Abnormal contract termination. Precedence Order = 10. Comparable FHIR and v.3 status codes: stopped; failed; aborted.
068         */
069        CANCELLED, 
070        /**
071         * Contract is pended to rectify failure of the Grantor or the Grantee to fulfil contract provision(s). E.g., Grantee complaint about Grantor's failure to comply with contract provisions. Usage: Contract pended. Precedence Order = 7. Comparable FHIR and v.3 status codes: on hold; pended; suspended.
072         */
073        DISPUTED, 
074        /**
075         * Contract was created in error. No Precedence Order.  Status may be applied to a Contract with any status.
076         */
077        ENTEREDINERROR, 
078        /**
079         * Contract execution pending; may be executed when either the Grantor or the Grantee accepts the contract provisions by signing. I.e., where either the Grantor or the Grantee has signed, but not both. E.g., when an insurance applicant signs the insurers application, which references the policy. Usage: Optional first step of contract execution activity.  May be skipped and contracting activity moves directly to executed state. Precedence Order = 3. Comparable FHIR and v.3 status codes: draft; preliminary; planned; intended; active.
080         */
081        EXECUTABLE, 
082        /**
083         * Contract is activated for period stipulated when both the Grantor and Grantee have signed it. Usage: Required state for normal completion of contracting activity.  Precedence Order = 6. Comparable FHIR and v.3 status codes: accepted; completed.
084         */
085        EXECUTED, 
086        /**
087         * Contract execution is suspended while either or both the Grantor and Grantee propose and consider new or revised contract provisions. I.e., where the party which has not signed proposes changes to the terms.  E .g., a life insurer declines to agree to the signed application because the life insurer has evidence that the applicant, who asserted to being younger or a non-smoker to get a lower premium rate - but offers instead to agree to a higher premium based on the applicants actual age or smoking status. Usage: Optional contract activity between executable and executed state. Precedence Order = 4. Comparable FHIR and v.3 status codes: in progress; review; held.
088         */
089        NEGOTIABLE, 
090        /**
091         * Contract is a proposal by either the Grantor or the Grantee. Aka - A Contract hard copy or electronic 'template', 'form' or 'application'. E.g., health insurance application; consent directive form. Usage: Beginning of contract negotiation, which may have been completed as a precondition because used for 0..* contracts. Precedence Order = 2. Comparable FHIR and v.3 status codes: requested; new.
092         */
093        OFFERED, 
094        /**
095         * Contract template is available as the basis for an application or offer by the Grantor or Grantee. E.g., health insurance policy; consent directive policy.  Usage: Required initial contract activity, which may have been completed as a precondition because used for 0..* contracts. Precedence Order = 1. Comparable FHIR and v.3 status codes: proposed; intended.
096         */
097        POLICY, 
098        /**
099         *  Execution of the Contract is not completed because either or both the Grantor and Grantee decline to accept some or all of the contract provisions. Usage: Optional contract activity between executable and abnormal termination. Precedence Order = 5. Comparable FHIR and v.3 status codes:  stopped; cancelled.
100         */
101        REJECTED, 
102        /**
103         * Beginning of a successor Contract at the termination of predecessor Contract lifecycle. Usage: Follows termination of a preceding Contract that has reached its expiry date. Precedence Order = 13. Comparable FHIR and v.3 status codes: superseded.
104         */
105        RENEWED, 
106        /**
107         * A Contract that is rescinded.  May be required prior to replacing with an updated Contract. Comparable FHIR and v.3 status codes: nullified.
108         */
109        REVOKED, 
110        /**
111         * Contract is reactivated after being pended because of faulty execution. *E.g., competency of the signer(s), or where the policy is substantially different from and did not accompany the application/form so that the applicant could not compare them. Aka - ''reactivated''. Usage: Optional stage where a pended contract is reactivated. Precedence Order = 8. Comparable FHIR and v.3 status codes: reactivated.
112         */
113        RESOLVED, 
114        /**
115         * Contract reaches its expiry date. It might or might not be renewed or renegotiated. Usage: Normal end of contract period. Precedence Order = 12. Comparable FHIR and v.3 status codes: Obsoleted.
116         */
117        TERMINATED, 
118        /**
119         * added to help the parsers with the generic types
120         */
121        NULL;
122        public static ContractResourcePublicationStatusCodes fromCode(String codeString) throws FHIRException {
123            if (codeString == null || "".equals(codeString))
124                return null;
125        if ("amended".equals(codeString))
126          return AMENDED;
127        if ("appended".equals(codeString))
128          return APPENDED;
129        if ("cancelled".equals(codeString))
130          return CANCELLED;
131        if ("disputed".equals(codeString))
132          return DISPUTED;
133        if ("entered-in-error".equals(codeString))
134          return ENTEREDINERROR;
135        if ("executable".equals(codeString))
136          return EXECUTABLE;
137        if ("executed".equals(codeString))
138          return EXECUTED;
139        if ("negotiable".equals(codeString))
140          return NEGOTIABLE;
141        if ("offered".equals(codeString))
142          return OFFERED;
143        if ("policy".equals(codeString))
144          return POLICY;
145        if ("rejected".equals(codeString))
146          return REJECTED;
147        if ("renewed".equals(codeString))
148          return RENEWED;
149        if ("revoked".equals(codeString))
150          return REVOKED;
151        if ("resolved".equals(codeString))
152          return RESOLVED;
153        if ("terminated".equals(codeString))
154          return TERMINATED;
155        if (Configuration.isAcceptInvalidEnums())
156          return null;
157        else
158          throw new FHIRException("Unknown ContractResourcePublicationStatusCodes code '"+codeString+"'");
159        }
160        public String toCode() {
161          switch (this) {
162            case AMENDED: return "amended";
163            case APPENDED: return "appended";
164            case CANCELLED: return "cancelled";
165            case DISPUTED: return "disputed";
166            case ENTEREDINERROR: return "entered-in-error";
167            case EXECUTABLE: return "executable";
168            case EXECUTED: return "executed";
169            case NEGOTIABLE: return "negotiable";
170            case OFFERED: return "offered";
171            case POLICY: return "policy";
172            case REJECTED: return "rejected";
173            case RENEWED: return "renewed";
174            case REVOKED: return "revoked";
175            case RESOLVED: return "resolved";
176            case TERMINATED: return "terminated";
177            case NULL: return null;
178            default: return "?";
179          }
180        }
181        public String getSystem() {
182          switch (this) {
183            case AMENDED: return "http://hl7.org/fhir/contract-publicationstatus";
184            case APPENDED: return "http://hl7.org/fhir/contract-publicationstatus";
185            case CANCELLED: return "http://hl7.org/fhir/contract-publicationstatus";
186            case DISPUTED: return "http://hl7.org/fhir/contract-publicationstatus";
187            case ENTEREDINERROR: return "http://hl7.org/fhir/contract-publicationstatus";
188            case EXECUTABLE: return "http://hl7.org/fhir/contract-publicationstatus";
189            case EXECUTED: return "http://hl7.org/fhir/contract-publicationstatus";
190            case NEGOTIABLE: return "http://hl7.org/fhir/contract-publicationstatus";
191            case OFFERED: return "http://hl7.org/fhir/contract-publicationstatus";
192            case POLICY: return "http://hl7.org/fhir/contract-publicationstatus";
193            case REJECTED: return "http://hl7.org/fhir/contract-publicationstatus";
194            case RENEWED: return "http://hl7.org/fhir/contract-publicationstatus";
195            case REVOKED: return "http://hl7.org/fhir/contract-publicationstatus";
196            case RESOLVED: return "http://hl7.org/fhir/contract-publicationstatus";
197            case TERMINATED: return "http://hl7.org/fhir/contract-publicationstatus";
198            case NULL: return null;
199            default: return "?";
200          }
201        }
202        public String getDefinition() {
203          switch (this) {
204            case AMENDED: return "Contract is augmented with additional information to correct errors in a predecessor or to updated values in a predecessor. Usage: Contract altered within effective time. Precedence Order = 9. Comparable FHIR and v.3 status codes: revised; replaced.";
205            case APPENDED: return "Contract is augmented with additional information that was missing from a predecessor Contract. Usage: Contract altered within effective time. Precedence Order = 9. Comparable FHIR and v.3 status codes: updated, replaced.";
206            case CANCELLED: return "Contract is terminated due to failure of the Grantor and/or the Grantee to fulfil one or more contract provisions. Usage: Abnormal contract termination. Precedence Order = 10. Comparable FHIR and v.3 status codes: stopped; failed; aborted.";
207            case DISPUTED: return "Contract is pended to rectify failure of the Grantor or the Grantee to fulfil contract provision(s). E.g., Grantee complaint about Grantor's failure to comply with contract provisions. Usage: Contract pended. Precedence Order = 7. Comparable FHIR and v.3 status codes: on hold; pended; suspended.";
208            case ENTEREDINERROR: return "Contract was created in error. No Precedence Order.  Status may be applied to a Contract with any status.";
209            case EXECUTABLE: return "Contract execution pending; may be executed when either the Grantor or the Grantee accepts the contract provisions by signing. I.e., where either the Grantor or the Grantee has signed, but not both. E.g., when an insurance applicant signs the insurers application, which references the policy. Usage: Optional first step of contract execution activity.  May be skipped and contracting activity moves directly to executed state. Precedence Order = 3. Comparable FHIR and v.3 status codes: draft; preliminary; planned; intended; active.";
210            case EXECUTED: return "Contract is activated for period stipulated when both the Grantor and Grantee have signed it. Usage: Required state for normal completion of contracting activity.  Precedence Order = 6. Comparable FHIR and v.3 status codes: accepted; completed.";
211            case NEGOTIABLE: return "Contract execution is suspended while either or both the Grantor and Grantee propose and consider new or revised contract provisions. I.e., where the party which has not signed proposes changes to the terms.  E .g., a life insurer declines to agree to the signed application because the life insurer has evidence that the applicant, who asserted to being younger or a non-smoker to get a lower premium rate - but offers instead to agree to a higher premium based on the applicants actual age or smoking status. Usage: Optional contract activity between executable and executed state. Precedence Order = 4. Comparable FHIR and v.3 status codes: in progress; review; held.";
212            case OFFERED: return "Contract is a proposal by either the Grantor or the Grantee. Aka - A Contract hard copy or electronic 'template', 'form' or 'application'. E.g., health insurance application; consent directive form. Usage: Beginning of contract negotiation, which may have been completed as a precondition because used for 0..* contracts. Precedence Order = 2. Comparable FHIR and v.3 status codes: requested; new.";
213            case POLICY: return "Contract template is available as the basis for an application or offer by the Grantor or Grantee. E.g., health insurance policy; consent directive policy.  Usage: Required initial contract activity, which may have been completed as a precondition because used for 0..* contracts. Precedence Order = 1. Comparable FHIR and v.3 status codes: proposed; intended.";
214            case REJECTED: return " Execution of the Contract is not completed because either or both the Grantor and Grantee decline to accept some or all of the contract provisions. Usage: Optional contract activity between executable and abnormal termination. Precedence Order = 5. Comparable FHIR and v.3 status codes:  stopped; cancelled.";
215            case RENEWED: return "Beginning of a successor Contract at the termination of predecessor Contract lifecycle. Usage: Follows termination of a preceding Contract that has reached its expiry date. Precedence Order = 13. Comparable FHIR and v.3 status codes: superseded.";
216            case REVOKED: return "A Contract that is rescinded.  May be required prior to replacing with an updated Contract. Comparable FHIR and v.3 status codes: nullified.";
217            case RESOLVED: return "Contract is reactivated after being pended because of faulty execution. *E.g., competency of the signer(s), or where the policy is substantially different from and did not accompany the application/form so that the applicant could not compare them. Aka - ''reactivated''. Usage: Optional stage where a pended contract is reactivated. Precedence Order = 8. Comparable FHIR and v.3 status codes: reactivated.";
218            case TERMINATED: return "Contract reaches its expiry date. It might or might not be renewed or renegotiated. Usage: Normal end of contract period. Precedence Order = 12. Comparable FHIR and v.3 status codes: Obsoleted.";
219            case NULL: return null;
220            default: return "?";
221          }
222        }
223        public String getDisplay() {
224          switch (this) {
225            case AMENDED: return "Amended";
226            case APPENDED: return "Appended";
227            case CANCELLED: return "Cancelled";
228            case DISPUTED: return "Disputed";
229            case ENTEREDINERROR: return "Entered in Error";
230            case EXECUTABLE: return "Executable";
231            case EXECUTED: return "Executed";
232            case NEGOTIABLE: return "Negotiable";
233            case OFFERED: return "Offered";
234            case POLICY: return "Policy";
235            case REJECTED: return "Rejected";
236            case RENEWED: return "Renewed";
237            case REVOKED: return "Revoked";
238            case RESOLVED: return "Resolved";
239            case TERMINATED: return "Terminated";
240            case NULL: return null;
241            default: return "?";
242          }
243        }
244    }
245
246  public static class ContractResourcePublicationStatusCodesEnumFactory implements EnumFactory<ContractResourcePublicationStatusCodes> {
247    public ContractResourcePublicationStatusCodes fromCode(String codeString) throws IllegalArgumentException {
248      if (codeString == null || "".equals(codeString))
249            if (codeString == null || "".equals(codeString))
250                return null;
251        if ("amended".equals(codeString))
252          return ContractResourcePublicationStatusCodes.AMENDED;
253        if ("appended".equals(codeString))
254          return ContractResourcePublicationStatusCodes.APPENDED;
255        if ("cancelled".equals(codeString))
256          return ContractResourcePublicationStatusCodes.CANCELLED;
257        if ("disputed".equals(codeString))
258          return ContractResourcePublicationStatusCodes.DISPUTED;
259        if ("entered-in-error".equals(codeString))
260          return ContractResourcePublicationStatusCodes.ENTEREDINERROR;
261        if ("executable".equals(codeString))
262          return ContractResourcePublicationStatusCodes.EXECUTABLE;
263        if ("executed".equals(codeString))
264          return ContractResourcePublicationStatusCodes.EXECUTED;
265        if ("negotiable".equals(codeString))
266          return ContractResourcePublicationStatusCodes.NEGOTIABLE;
267        if ("offered".equals(codeString))
268          return ContractResourcePublicationStatusCodes.OFFERED;
269        if ("policy".equals(codeString))
270          return ContractResourcePublicationStatusCodes.POLICY;
271        if ("rejected".equals(codeString))
272          return ContractResourcePublicationStatusCodes.REJECTED;
273        if ("renewed".equals(codeString))
274          return ContractResourcePublicationStatusCodes.RENEWED;
275        if ("revoked".equals(codeString))
276          return ContractResourcePublicationStatusCodes.REVOKED;
277        if ("resolved".equals(codeString))
278          return ContractResourcePublicationStatusCodes.RESOLVED;
279        if ("terminated".equals(codeString))
280          return ContractResourcePublicationStatusCodes.TERMINATED;
281        throw new IllegalArgumentException("Unknown ContractResourcePublicationStatusCodes code '"+codeString+"'");
282        }
283        public Enumeration<ContractResourcePublicationStatusCodes> fromType(Base code) throws FHIRException {
284          if (code == null)
285            return null;
286          if (code.isEmpty())
287            return new Enumeration<ContractResourcePublicationStatusCodes>(this);
288          String codeString = ((PrimitiveType) code).asStringValue();
289          if (codeString == null || "".equals(codeString))
290            return null;
291        if ("amended".equals(codeString))
292          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.AMENDED);
293        if ("appended".equals(codeString))
294          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.APPENDED);
295        if ("cancelled".equals(codeString))
296          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.CANCELLED);
297        if ("disputed".equals(codeString))
298          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.DISPUTED);
299        if ("entered-in-error".equals(codeString))
300          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.ENTEREDINERROR);
301        if ("executable".equals(codeString))
302          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.EXECUTABLE);
303        if ("executed".equals(codeString))
304          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.EXECUTED);
305        if ("negotiable".equals(codeString))
306          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.NEGOTIABLE);
307        if ("offered".equals(codeString))
308          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.OFFERED);
309        if ("policy".equals(codeString))
310          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.POLICY);
311        if ("rejected".equals(codeString))
312          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.REJECTED);
313        if ("renewed".equals(codeString))
314          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.RENEWED);
315        if ("revoked".equals(codeString))
316          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.REVOKED);
317        if ("resolved".equals(codeString))
318          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.RESOLVED);
319        if ("terminated".equals(codeString))
320          return new Enumeration<ContractResourcePublicationStatusCodes>(this, ContractResourcePublicationStatusCodes.TERMINATED);
321        throw new FHIRException("Unknown ContractResourcePublicationStatusCodes code '"+codeString+"'");
322        }
323    public String toCode(ContractResourcePublicationStatusCodes code) {
324      if (code == ContractResourcePublicationStatusCodes.AMENDED)
325        return "amended";
326      if (code == ContractResourcePublicationStatusCodes.APPENDED)
327        return "appended";
328      if (code == ContractResourcePublicationStatusCodes.CANCELLED)
329        return "cancelled";
330      if (code == ContractResourcePublicationStatusCodes.DISPUTED)
331        return "disputed";
332      if (code == ContractResourcePublicationStatusCodes.ENTEREDINERROR)
333        return "entered-in-error";
334      if (code == ContractResourcePublicationStatusCodes.EXECUTABLE)
335        return "executable";
336      if (code == ContractResourcePublicationStatusCodes.EXECUTED)
337        return "executed";
338      if (code == ContractResourcePublicationStatusCodes.NEGOTIABLE)
339        return "negotiable";
340      if (code == ContractResourcePublicationStatusCodes.OFFERED)
341        return "offered";
342      if (code == ContractResourcePublicationStatusCodes.POLICY)
343        return "policy";
344      if (code == ContractResourcePublicationStatusCodes.REJECTED)
345        return "rejected";
346      if (code == ContractResourcePublicationStatusCodes.RENEWED)
347        return "renewed";
348      if (code == ContractResourcePublicationStatusCodes.REVOKED)
349        return "revoked";
350      if (code == ContractResourcePublicationStatusCodes.RESOLVED)
351        return "resolved";
352      if (code == ContractResourcePublicationStatusCodes.TERMINATED)
353        return "terminated";
354      return "?";
355      }
356    public String toSystem(ContractResourcePublicationStatusCodes code) {
357      return code.getSystem();
358      }
359    }
360
361    public enum ContractResourceStatusCodes {
362        /**
363         * Contract is augmented with additional information to correct errors in a predecessor or to updated values in a predecessor. Usage: Contract altered within effective time. Precedence Order = 9. Comparable FHIR and v.3 status codes: revised; replaced.
364         */
365        AMENDED, 
366        /**
367         * Contract is augmented with additional information that was missing from a predecessor Contract. Usage: Contract altered within effective time. Precedence Order = 9. Comparable FHIR and v.3 status codes: updated, replaced.
368         */
369        APPENDED, 
370        /**
371         * Contract is terminated due to failure of the Grantor and/or the Grantee to fulfil one or more contract provisions. Usage: Abnormal contract termination. Precedence Order = 10. Comparable FHIR and v.3 status codes: stopped; failed; aborted.
372         */
373        CANCELLED, 
374        /**
375         * Contract is pended to rectify failure of the Grantor or the Grantee to fulfil contract provision(s). E.g., Grantee complaint about Grantor's failure to comply with contract provisions. Usage: Contract pended. Precedence Order = 7. Comparable FHIR and v.3 status codes: on hold; pended; suspended.
376         */
377        DISPUTED, 
378        /**
379         * Contract was created in error. No Precedence Order.  Status may be applied to a Contract with any status.
380         */
381        ENTEREDINERROR, 
382        /**
383         * Contract execution pending; may be executed when either the Grantor or the Grantee accepts the contract provisions by signing. I.e., where either the Grantor or the Grantee has signed, but not both. E.g., when an insurance applicant signs the insurers application, which references the policy. Usage: Optional first step of contract execution activity.  May be skipped and contracting activity moves directly to executed state. Precedence Order = 3. Comparable FHIR and v.3 status codes: draft; preliminary; planned; intended; active.
384         */
385        EXECUTABLE, 
386        /**
387         * Contract is activated for period stipulated when both the Grantor and Grantee have signed it. Usage: Required state for normal completion of contracting activity.  Precedence Order = 6. Comparable FHIR and v.3 status codes: accepted; completed.
388         */
389        EXECUTED, 
390        /**
391         * Contract execution is suspended while either or both the Grantor and Grantee propose and consider new or revised contract provisions. I.e., where the party which has not signed proposes changes to the terms.  E .g., a life insurer declines to agree to the signed application because the life insurer has evidence that the applicant, who asserted to being younger or a non-smoker to get a lower premium rate - but offers instead to agree to a higher premium based on the applicants actual age or smoking status. Usage: Optional contract activity between executable and executed state. Precedence Order = 4. Comparable FHIR and v.3 status codes: in progress; review; held.
392         */
393        NEGOTIABLE, 
394        /**
395         * Contract is a proposal by either the Grantor or the Grantee. Aka - A Contract hard copy or electronic 'template', 'form' or 'application'. E.g., health insurance application; consent directive form. Usage: Beginning of contract negotiation, which may have been completed as a precondition because used for 0..* contracts. Precedence Order = 2. Comparable FHIR and v.3 status codes: requested; new.
396         */
397        OFFERED, 
398        /**
399         * Contract template is available as the basis for an application or offer by the Grantor or Grantee. E.g., health insurance policy; consent directive policy.  Usage: Required initial contract activity, which may have been completed as a precondition because used for 0..* contracts. Precedence Order = 1. Comparable FHIR and v.3 status codes: proposed; intended.
400         */
401        POLICY, 
402        /**
403         *  Execution of the Contract is not completed because either or both the Grantor and Grantee decline to accept some or all of the contract provisions. Usage: Optional contract activity between executable and abnormal termination. Precedence Order = 5. Comparable FHIR and v.3 status codes:  stopped; cancelled.
404         */
405        REJECTED, 
406        /**
407         * Beginning of a successor Contract at the termination of predecessor Contract lifecycle. Usage: Follows termination of a preceding Contract that has reached its expiry date. Precedence Order = 13. Comparable FHIR and v.3 status codes: superseded.
408         */
409        RENEWED, 
410        /**
411         * A Contract that is rescinded.  May be required prior to replacing with an updated Contract. Comparable FHIR and v.3 status codes: nullified.
412         */
413        REVOKED, 
414        /**
415         * Contract is reactivated after being pended because of faulty execution. *E.g., competency of the signer(s), or where the policy is substantially different from and did not accompany the application/form so that the applicant could not compare them. Aka - ''reactivated''. Usage: Optional stage where a pended contract is reactivated. Precedence Order = 8. Comparable FHIR and v.3 status codes: reactivated.
416         */
417        RESOLVED, 
418        /**
419         * Contract reaches its expiry date. It might or might not be renewed or renegotiated. Usage: Normal end of contract period. Precedence Order = 12. Comparable FHIR and v.3 status codes: Obsoleted.
420         */
421        TERMINATED, 
422        /**
423         * added to help the parsers with the generic types
424         */
425        NULL;
426        public static ContractResourceStatusCodes fromCode(String codeString) throws FHIRException {
427            if (codeString == null || "".equals(codeString))
428                return null;
429        if ("amended".equals(codeString))
430          return AMENDED;
431        if ("appended".equals(codeString))
432          return APPENDED;
433        if ("cancelled".equals(codeString))
434          return CANCELLED;
435        if ("disputed".equals(codeString))
436          return DISPUTED;
437        if ("entered-in-error".equals(codeString))
438          return ENTEREDINERROR;
439        if ("executable".equals(codeString))
440          return EXECUTABLE;
441        if ("executed".equals(codeString))
442          return EXECUTED;
443        if ("negotiable".equals(codeString))
444          return NEGOTIABLE;
445        if ("offered".equals(codeString))
446          return OFFERED;
447        if ("policy".equals(codeString))
448          return POLICY;
449        if ("rejected".equals(codeString))
450          return REJECTED;
451        if ("renewed".equals(codeString))
452          return RENEWED;
453        if ("revoked".equals(codeString))
454          return REVOKED;
455        if ("resolved".equals(codeString))
456          return RESOLVED;
457        if ("terminated".equals(codeString))
458          return TERMINATED;
459        if (Configuration.isAcceptInvalidEnums())
460          return null;
461        else
462          throw new FHIRException("Unknown ContractResourceStatusCodes code '"+codeString+"'");
463        }
464        public String toCode() {
465          switch (this) {
466            case AMENDED: return "amended";
467            case APPENDED: return "appended";
468            case CANCELLED: return "cancelled";
469            case DISPUTED: return "disputed";
470            case ENTEREDINERROR: return "entered-in-error";
471            case EXECUTABLE: return "executable";
472            case EXECUTED: return "executed";
473            case NEGOTIABLE: return "negotiable";
474            case OFFERED: return "offered";
475            case POLICY: return "policy";
476            case REJECTED: return "rejected";
477            case RENEWED: return "renewed";
478            case REVOKED: return "revoked";
479            case RESOLVED: return "resolved";
480            case TERMINATED: return "terminated";
481            case NULL: return null;
482            default: return "?";
483          }
484        }
485        public String getSystem() {
486          switch (this) {
487            case AMENDED: return "http://hl7.org/fhir/contract-status";
488            case APPENDED: return "http://hl7.org/fhir/contract-status";
489            case CANCELLED: return "http://hl7.org/fhir/contract-status";
490            case DISPUTED: return "http://hl7.org/fhir/contract-status";
491            case ENTEREDINERROR: return "http://hl7.org/fhir/contract-status";
492            case EXECUTABLE: return "http://hl7.org/fhir/contract-status";
493            case EXECUTED: return "http://hl7.org/fhir/contract-status";
494            case NEGOTIABLE: return "http://hl7.org/fhir/contract-status";
495            case OFFERED: return "http://hl7.org/fhir/contract-status";
496            case POLICY: return "http://hl7.org/fhir/contract-status";
497            case REJECTED: return "http://hl7.org/fhir/contract-status";
498            case RENEWED: return "http://hl7.org/fhir/contract-status";
499            case REVOKED: return "http://hl7.org/fhir/contract-status";
500            case RESOLVED: return "http://hl7.org/fhir/contract-status";
501            case TERMINATED: return "http://hl7.org/fhir/contract-status";
502            case NULL: return null;
503            default: return "?";
504          }
505        }
506        public String getDefinition() {
507          switch (this) {
508            case AMENDED: return "Contract is augmented with additional information to correct errors in a predecessor or to updated values in a predecessor. Usage: Contract altered within effective time. Precedence Order = 9. Comparable FHIR and v.3 status codes: revised; replaced.";
509            case APPENDED: return "Contract is augmented with additional information that was missing from a predecessor Contract. Usage: Contract altered within effective time. Precedence Order = 9. Comparable FHIR and v.3 status codes: updated, replaced.";
510            case CANCELLED: return "Contract is terminated due to failure of the Grantor and/or the Grantee to fulfil one or more contract provisions. Usage: Abnormal contract termination. Precedence Order = 10. Comparable FHIR and v.3 status codes: stopped; failed; aborted.";
511            case DISPUTED: return "Contract is pended to rectify failure of the Grantor or the Grantee to fulfil contract provision(s). E.g., Grantee complaint about Grantor's failure to comply with contract provisions. Usage: Contract pended. Precedence Order = 7. Comparable FHIR and v.3 status codes: on hold; pended; suspended.";
512            case ENTEREDINERROR: return "Contract was created in error. No Precedence Order.  Status may be applied to a Contract with any status.";
513            case EXECUTABLE: return "Contract execution pending; may be executed when either the Grantor or the Grantee accepts the contract provisions by signing. I.e., where either the Grantor or the Grantee has signed, but not both. E.g., when an insurance applicant signs the insurers application, which references the policy. Usage: Optional first step of contract execution activity.  May be skipped and contracting activity moves directly to executed state. Precedence Order = 3. Comparable FHIR and v.3 status codes: draft; preliminary; planned; intended; active.";
514            case EXECUTED: return "Contract is activated for period stipulated when both the Grantor and Grantee have signed it. Usage: Required state for normal completion of contracting activity.  Precedence Order = 6. Comparable FHIR and v.3 status codes: accepted; completed.";
515            case NEGOTIABLE: return "Contract execution is suspended while either or both the Grantor and Grantee propose and consider new or revised contract provisions. I.e., where the party which has not signed proposes changes to the terms.  E .g., a life insurer declines to agree to the signed application because the life insurer has evidence that the applicant, who asserted to being younger or a non-smoker to get a lower premium rate - but offers instead to agree to a higher premium based on the applicants actual age or smoking status. Usage: Optional contract activity between executable and executed state. Precedence Order = 4. Comparable FHIR and v.3 status codes: in progress; review; held.";
516            case OFFERED: return "Contract is a proposal by either the Grantor or the Grantee. Aka - A Contract hard copy or electronic 'template', 'form' or 'application'. E.g., health insurance application; consent directive form. Usage: Beginning of contract negotiation, which may have been completed as a precondition because used for 0..* contracts. Precedence Order = 2. Comparable FHIR and v.3 status codes: requested; new.";
517            case POLICY: return "Contract template is available as the basis for an application or offer by the Grantor or Grantee. E.g., health insurance policy; consent directive policy.  Usage: Required initial contract activity, which may have been completed as a precondition because used for 0..* contracts. Precedence Order = 1. Comparable FHIR and v.3 status codes: proposed; intended.";
518            case REJECTED: return " Execution of the Contract is not completed because either or both the Grantor and Grantee decline to accept some or all of the contract provisions. Usage: Optional contract activity between executable and abnormal termination. Precedence Order = 5. Comparable FHIR and v.3 status codes:  stopped; cancelled.";
519            case RENEWED: return "Beginning of a successor Contract at the termination of predecessor Contract lifecycle. Usage: Follows termination of a preceding Contract that has reached its expiry date. Precedence Order = 13. Comparable FHIR and v.3 status codes: superseded.";
520            case REVOKED: return "A Contract that is rescinded.  May be required prior to replacing with an updated Contract. Comparable FHIR and v.3 status codes: nullified.";
521            case RESOLVED: return "Contract is reactivated after being pended because of faulty execution. *E.g., competency of the signer(s), or where the policy is substantially different from and did not accompany the application/form so that the applicant could not compare them. Aka - ''reactivated''. Usage: Optional stage where a pended contract is reactivated. Precedence Order = 8. Comparable FHIR and v.3 status codes: reactivated.";
522            case TERMINATED: return "Contract reaches its expiry date. It might or might not be renewed or renegotiated. Usage: Normal end of contract period. Precedence Order = 12. Comparable FHIR and v.3 status codes: Obsoleted.";
523            case NULL: return null;
524            default: return "?";
525          }
526        }
527        public String getDisplay() {
528          switch (this) {
529            case AMENDED: return "Amended";
530            case APPENDED: return "Appended";
531            case CANCELLED: return "Cancelled";
532            case DISPUTED: return "Disputed";
533            case ENTEREDINERROR: return "Entered in Error";
534            case EXECUTABLE: return "Executable";
535            case EXECUTED: return "Executed";
536            case NEGOTIABLE: return "Negotiable";
537            case OFFERED: return "Offered";
538            case POLICY: return "Policy";
539            case REJECTED: return "Rejected";
540            case RENEWED: return "Renewed";
541            case REVOKED: return "Revoked";
542            case RESOLVED: return "Resolved";
543            case TERMINATED: return "Terminated";
544            case NULL: return null;
545            default: return "?";
546          }
547        }
548    }
549
550  public static class ContractResourceStatusCodesEnumFactory implements EnumFactory<ContractResourceStatusCodes> {
551    public ContractResourceStatusCodes fromCode(String codeString) throws IllegalArgumentException {
552      if (codeString == null || "".equals(codeString))
553            if (codeString == null || "".equals(codeString))
554                return null;
555        if ("amended".equals(codeString))
556          return ContractResourceStatusCodes.AMENDED;
557        if ("appended".equals(codeString))
558          return ContractResourceStatusCodes.APPENDED;
559        if ("cancelled".equals(codeString))
560          return ContractResourceStatusCodes.CANCELLED;
561        if ("disputed".equals(codeString))
562          return ContractResourceStatusCodes.DISPUTED;
563        if ("entered-in-error".equals(codeString))
564          return ContractResourceStatusCodes.ENTEREDINERROR;
565        if ("executable".equals(codeString))
566          return ContractResourceStatusCodes.EXECUTABLE;
567        if ("executed".equals(codeString))
568          return ContractResourceStatusCodes.EXECUTED;
569        if ("negotiable".equals(codeString))
570          return ContractResourceStatusCodes.NEGOTIABLE;
571        if ("offered".equals(codeString))
572          return ContractResourceStatusCodes.OFFERED;
573        if ("policy".equals(codeString))
574          return ContractResourceStatusCodes.POLICY;
575        if ("rejected".equals(codeString))
576          return ContractResourceStatusCodes.REJECTED;
577        if ("renewed".equals(codeString))
578          return ContractResourceStatusCodes.RENEWED;
579        if ("revoked".equals(codeString))
580          return ContractResourceStatusCodes.REVOKED;
581        if ("resolved".equals(codeString))
582          return ContractResourceStatusCodes.RESOLVED;
583        if ("terminated".equals(codeString))
584          return ContractResourceStatusCodes.TERMINATED;
585        throw new IllegalArgumentException("Unknown ContractResourceStatusCodes code '"+codeString+"'");
586        }
587        public Enumeration<ContractResourceStatusCodes> fromType(Base code) throws FHIRException {
588          if (code == null)
589            return null;
590          if (code.isEmpty())
591            return new Enumeration<ContractResourceStatusCodes>(this);
592          String codeString = ((PrimitiveType) code).asStringValue();
593          if (codeString == null || "".equals(codeString))
594            return null;
595        if ("amended".equals(codeString))
596          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.AMENDED);
597        if ("appended".equals(codeString))
598          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.APPENDED);
599        if ("cancelled".equals(codeString))
600          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.CANCELLED);
601        if ("disputed".equals(codeString))
602          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.DISPUTED);
603        if ("entered-in-error".equals(codeString))
604          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.ENTEREDINERROR);
605        if ("executable".equals(codeString))
606          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.EXECUTABLE);
607        if ("executed".equals(codeString))
608          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.EXECUTED);
609        if ("negotiable".equals(codeString))
610          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.NEGOTIABLE);
611        if ("offered".equals(codeString))
612          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.OFFERED);
613        if ("policy".equals(codeString))
614          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.POLICY);
615        if ("rejected".equals(codeString))
616          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.REJECTED);
617        if ("renewed".equals(codeString))
618          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.RENEWED);
619        if ("revoked".equals(codeString))
620          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.REVOKED);
621        if ("resolved".equals(codeString))
622          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.RESOLVED);
623        if ("terminated".equals(codeString))
624          return new Enumeration<ContractResourceStatusCodes>(this, ContractResourceStatusCodes.TERMINATED);
625        throw new FHIRException("Unknown ContractResourceStatusCodes code '"+codeString+"'");
626        }
627    public String toCode(ContractResourceStatusCodes code) {
628      if (code == ContractResourceStatusCodes.AMENDED)
629        return "amended";
630      if (code == ContractResourceStatusCodes.APPENDED)
631        return "appended";
632      if (code == ContractResourceStatusCodes.CANCELLED)
633        return "cancelled";
634      if (code == ContractResourceStatusCodes.DISPUTED)
635        return "disputed";
636      if (code == ContractResourceStatusCodes.ENTEREDINERROR)
637        return "entered-in-error";
638      if (code == ContractResourceStatusCodes.EXECUTABLE)
639        return "executable";
640      if (code == ContractResourceStatusCodes.EXECUTED)
641        return "executed";
642      if (code == ContractResourceStatusCodes.NEGOTIABLE)
643        return "negotiable";
644      if (code == ContractResourceStatusCodes.OFFERED)
645        return "offered";
646      if (code == ContractResourceStatusCodes.POLICY)
647        return "policy";
648      if (code == ContractResourceStatusCodes.REJECTED)
649        return "rejected";
650      if (code == ContractResourceStatusCodes.RENEWED)
651        return "renewed";
652      if (code == ContractResourceStatusCodes.REVOKED)
653        return "revoked";
654      if (code == ContractResourceStatusCodes.RESOLVED)
655        return "resolved";
656      if (code == ContractResourceStatusCodes.TERMINATED)
657        return "terminated";
658      return "?";
659      }
660    public String toSystem(ContractResourceStatusCodes code) {
661      return code.getSystem();
662      }
663    }
664
665    @Block()
666    public static class ContentDefinitionComponent extends BackboneElement implements IBaseBackboneElement {
667        /**
668         * Precusory content structure and use, i.e., a boilerplate, template, application for a contract such as an insurance policy or benefits under a program, e.g., workers compensation.
669         */
670        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
671        @Description(shortDefinition="Content structure and use", formalDefinition="Precusory content structure and use, i.e., a boilerplate, template, application for a contract such as an insurance policy or benefits under a program, e.g., workers compensation." )
672        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-definition-type")
673        protected CodeableConcept type;
674
675        /**
676         * Detailed Precusory content type.
677         */
678        @Child(name = "subType", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
679        @Description(shortDefinition="Detailed Content Type Definition", formalDefinition="Detailed Precusory content type." )
680        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-definition-subtype")
681        protected CodeableConcept subType;
682
683        /**
684         * The  individual or organization that published the Contract precursor content.
685         */
686        @Child(name = "publisher", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=false)
687        @Description(shortDefinition="Publisher Entity", formalDefinition="The  individual or organization that published the Contract precursor content." )
688        protected Reference publisher;
689
690        /**
691         * The date (and optionally time) when the contract was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the contract changes.
692         */
693        @Child(name = "publicationDate", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false)
694        @Description(shortDefinition="When published", formalDefinition="The date (and optionally time) when the contract was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the contract changes." )
695        protected DateTimeType publicationDate;
696
697        /**
698         * amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated.
699         */
700        @Child(name = "publicationStatus", type = {CodeType.class}, order=5, min=1, max=1, modifier=false, summary=false)
701        @Description(shortDefinition="amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated", formalDefinition="amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated." )
702        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-publicationstatus")
703        protected Enumeration<ContractResourcePublicationStatusCodes> publicationStatus;
704
705        /**
706         * A copyright statement relating to Contract precursor content. Copyright statements are generally legal restrictions on the use and publishing of the Contract precursor content.
707         */
708        @Child(name = "copyright", type = {MarkdownType.class}, order=6, min=0, max=1, modifier=false, summary=false)
709        @Description(shortDefinition="Publication Ownership", formalDefinition="A copyright statement relating to Contract precursor content. Copyright statements are generally legal restrictions on the use and publishing of the Contract precursor content." )
710        protected MarkdownType copyright;
711
712        private static final long serialVersionUID = 306178803L;
713
714    /**
715     * Constructor
716     */
717      public ContentDefinitionComponent() {
718        super();
719      }
720
721    /**
722     * Constructor
723     */
724      public ContentDefinitionComponent(CodeableConcept type, ContractResourcePublicationStatusCodes publicationStatus) {
725        super();
726        this.setType(type);
727        this.setPublicationStatus(publicationStatus);
728      }
729
730        /**
731         * @return {@link #type} (Precusory content structure and use, i.e., a boilerplate, template, application for a contract such as an insurance policy or benefits under a program, e.g., workers compensation.)
732         */
733        public CodeableConcept getType() { 
734          if (this.type == null)
735            if (Configuration.errorOnAutoCreate())
736              throw new Error("Attempt to auto-create ContentDefinitionComponent.type");
737            else if (Configuration.doAutoCreate())
738              this.type = new CodeableConcept(); // cc
739          return this.type;
740        }
741
742        public boolean hasType() { 
743          return this.type != null && !this.type.isEmpty();
744        }
745
746        /**
747         * @param value {@link #type} (Precusory content structure and use, i.e., a boilerplate, template, application for a contract such as an insurance policy or benefits under a program, e.g., workers compensation.)
748         */
749        public ContentDefinitionComponent setType(CodeableConcept value) { 
750          this.type = value;
751          return this;
752        }
753
754        /**
755         * @return {@link #subType} (Detailed Precusory content type.)
756         */
757        public CodeableConcept getSubType() { 
758          if (this.subType == null)
759            if (Configuration.errorOnAutoCreate())
760              throw new Error("Attempt to auto-create ContentDefinitionComponent.subType");
761            else if (Configuration.doAutoCreate())
762              this.subType = new CodeableConcept(); // cc
763          return this.subType;
764        }
765
766        public boolean hasSubType() { 
767          return this.subType != null && !this.subType.isEmpty();
768        }
769
770        /**
771         * @param value {@link #subType} (Detailed Precusory content type.)
772         */
773        public ContentDefinitionComponent setSubType(CodeableConcept value) { 
774          this.subType = value;
775          return this;
776        }
777
778        /**
779         * @return {@link #publisher} (The  individual or organization that published the Contract precursor content.)
780         */
781        public Reference getPublisher() { 
782          if (this.publisher == null)
783            if (Configuration.errorOnAutoCreate())
784              throw new Error("Attempt to auto-create ContentDefinitionComponent.publisher");
785            else if (Configuration.doAutoCreate())
786              this.publisher = new Reference(); // cc
787          return this.publisher;
788        }
789
790        public boolean hasPublisher() { 
791          return this.publisher != null && !this.publisher.isEmpty();
792        }
793
794        /**
795         * @param value {@link #publisher} (The  individual or organization that published the Contract precursor content.)
796         */
797        public ContentDefinitionComponent setPublisher(Reference value) { 
798          this.publisher = value;
799          return this;
800        }
801
802        /**
803         * @return {@link #publicationDate} (The date (and optionally time) when the contract was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the contract changes.). This is the underlying object with id, value and extensions. The accessor "getPublicationDate" gives direct access to the value
804         */
805        public DateTimeType getPublicationDateElement() { 
806          if (this.publicationDate == null)
807            if (Configuration.errorOnAutoCreate())
808              throw new Error("Attempt to auto-create ContentDefinitionComponent.publicationDate");
809            else if (Configuration.doAutoCreate())
810              this.publicationDate = new DateTimeType(); // bb
811          return this.publicationDate;
812        }
813
814        public boolean hasPublicationDateElement() { 
815          return this.publicationDate != null && !this.publicationDate.isEmpty();
816        }
817
818        public boolean hasPublicationDate() { 
819          return this.publicationDate != null && !this.publicationDate.isEmpty();
820        }
821
822        /**
823         * @param value {@link #publicationDate} (The date (and optionally time) when the contract was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the contract changes.). This is the underlying object with id, value and extensions. The accessor "getPublicationDate" gives direct access to the value
824         */
825        public ContentDefinitionComponent setPublicationDateElement(DateTimeType value) { 
826          this.publicationDate = value;
827          return this;
828        }
829
830        /**
831         * @return The date (and optionally time) when the contract was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the contract changes.
832         */
833        public Date getPublicationDate() { 
834          return this.publicationDate == null ? null : this.publicationDate.getValue();
835        }
836
837        /**
838         * @param value The date (and optionally time) when the contract was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the contract changes.
839         */
840        public ContentDefinitionComponent setPublicationDate(Date value) { 
841          if (value == null)
842            this.publicationDate = null;
843          else {
844            if (this.publicationDate == null)
845              this.publicationDate = new DateTimeType();
846            this.publicationDate.setValue(value);
847          }
848          return this;
849        }
850
851        /**
852         * @return {@link #publicationStatus} (amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated.). This is the underlying object with id, value and extensions. The accessor "getPublicationStatus" gives direct access to the value
853         */
854        public Enumeration<ContractResourcePublicationStatusCodes> getPublicationStatusElement() { 
855          if (this.publicationStatus == null)
856            if (Configuration.errorOnAutoCreate())
857              throw new Error("Attempt to auto-create ContentDefinitionComponent.publicationStatus");
858            else if (Configuration.doAutoCreate())
859              this.publicationStatus = new Enumeration<ContractResourcePublicationStatusCodes>(new ContractResourcePublicationStatusCodesEnumFactory()); // bb
860          return this.publicationStatus;
861        }
862
863        public boolean hasPublicationStatusElement() { 
864          return this.publicationStatus != null && !this.publicationStatus.isEmpty();
865        }
866
867        public boolean hasPublicationStatus() { 
868          return this.publicationStatus != null && !this.publicationStatus.isEmpty();
869        }
870
871        /**
872         * @param value {@link #publicationStatus} (amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated.). This is the underlying object with id, value and extensions. The accessor "getPublicationStatus" gives direct access to the value
873         */
874        public ContentDefinitionComponent setPublicationStatusElement(Enumeration<ContractResourcePublicationStatusCodes> value) { 
875          this.publicationStatus = value;
876          return this;
877        }
878
879        /**
880         * @return amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated.
881         */
882        public ContractResourcePublicationStatusCodes getPublicationStatus() { 
883          return this.publicationStatus == null ? null : this.publicationStatus.getValue();
884        }
885
886        /**
887         * @param value amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated.
888         */
889        public ContentDefinitionComponent setPublicationStatus(ContractResourcePublicationStatusCodes value) { 
890            if (this.publicationStatus == null)
891              this.publicationStatus = new Enumeration<ContractResourcePublicationStatusCodes>(new ContractResourcePublicationStatusCodesEnumFactory());
892            this.publicationStatus.setValue(value);
893          return this;
894        }
895
896        /**
897         * @return {@link #copyright} (A copyright statement relating to Contract precursor content. Copyright statements are generally legal restrictions on the use and publishing of the Contract precursor content.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
898         */
899        public MarkdownType getCopyrightElement() { 
900          if (this.copyright == null)
901            if (Configuration.errorOnAutoCreate())
902              throw new Error("Attempt to auto-create ContentDefinitionComponent.copyright");
903            else if (Configuration.doAutoCreate())
904              this.copyright = new MarkdownType(); // bb
905          return this.copyright;
906        }
907
908        public boolean hasCopyrightElement() { 
909          return this.copyright != null && !this.copyright.isEmpty();
910        }
911
912        public boolean hasCopyright() { 
913          return this.copyright != null && !this.copyright.isEmpty();
914        }
915
916        /**
917         * @param value {@link #copyright} (A copyright statement relating to Contract precursor content. Copyright statements are generally legal restrictions on the use and publishing of the Contract precursor content.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
918         */
919        public ContentDefinitionComponent setCopyrightElement(MarkdownType value) { 
920          this.copyright = value;
921          return this;
922        }
923
924        /**
925         * @return A copyright statement relating to Contract precursor content. Copyright statements are generally legal restrictions on the use and publishing of the Contract precursor content.
926         */
927        public String getCopyright() { 
928          return this.copyright == null ? null : this.copyright.getValue();
929        }
930
931        /**
932         * @param value A copyright statement relating to Contract precursor content. Copyright statements are generally legal restrictions on the use and publishing of the Contract precursor content.
933         */
934        public ContentDefinitionComponent setCopyright(String value) { 
935          if (value == null)
936            this.copyright = null;
937          else {
938            if (this.copyright == null)
939              this.copyright = new MarkdownType();
940            this.copyright.setValue(value);
941          }
942          return this;
943        }
944
945        protected void listChildren(List<Property> children) {
946          super.listChildren(children);
947          children.add(new Property("type", "CodeableConcept", "Precusory content structure and use, i.e., a boilerplate, template, application for a contract such as an insurance policy or benefits under a program, e.g., workers compensation.", 0, 1, type));
948          children.add(new Property("subType", "CodeableConcept", "Detailed Precusory content type.", 0, 1, subType));
949          children.add(new Property("publisher", "Reference(Practitioner|PractitionerRole|Organization)", "The  individual or organization that published the Contract precursor content.", 0, 1, publisher));
950          children.add(new Property("publicationDate", "dateTime", "The date (and optionally time) when the contract was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the contract changes.", 0, 1, publicationDate));
951          children.add(new Property("publicationStatus", "code", "amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated.", 0, 1, publicationStatus));
952          children.add(new Property("copyright", "markdown", "A copyright statement relating to Contract precursor content. Copyright statements are generally legal restrictions on the use and publishing of the Contract precursor content.", 0, 1, copyright));
953        }
954
955        @Override
956        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
957          switch (_hash) {
958          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Precusory content structure and use, i.e., a boilerplate, template, application for a contract such as an insurance policy or benefits under a program, e.g., workers compensation.", 0, 1, type);
959          case -1868521062: /*subType*/  return new Property("subType", "CodeableConcept", "Detailed Precusory content type.", 0, 1, subType);
960          case 1447404028: /*publisher*/  return new Property("publisher", "Reference(Practitioner|PractitionerRole|Organization)", "The  individual or organization that published the Contract precursor content.", 0, 1, publisher);
961          case 1470566394: /*publicationDate*/  return new Property("publicationDate", "dateTime", "The date (and optionally time) when the contract was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the contract changes.", 0, 1, publicationDate);
962          case 616500542: /*publicationStatus*/  return new Property("publicationStatus", "code", "amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated.", 0, 1, publicationStatus);
963          case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to Contract precursor content. Copyright statements are generally legal restrictions on the use and publishing of the Contract precursor content.", 0, 1, copyright);
964          default: return super.getNamedProperty(_hash, _name, _checkValid);
965          }
966
967        }
968
969      @Override
970      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
971        switch (hash) {
972        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
973        case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : new Base[] {this.subType}; // CodeableConcept
974        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // Reference
975        case 1470566394: /*publicationDate*/ return this.publicationDate == null ? new Base[0] : new Base[] {this.publicationDate}; // DateTimeType
976        case 616500542: /*publicationStatus*/ return this.publicationStatus == null ? new Base[0] : new Base[] {this.publicationStatus}; // Enumeration<ContractResourcePublicationStatusCodes>
977        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
978        default: return super.getProperty(hash, name, checkValid);
979        }
980
981      }
982
983      @Override
984      public Base setProperty(int hash, String name, Base value) throws FHIRException {
985        switch (hash) {
986        case 3575610: // type
987          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
988          return value;
989        case -1868521062: // subType
990          this.subType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
991          return value;
992        case 1447404028: // publisher
993          this.publisher = TypeConvertor.castToReference(value); // Reference
994          return value;
995        case 1470566394: // publicationDate
996          this.publicationDate = TypeConvertor.castToDateTime(value); // DateTimeType
997          return value;
998        case 616500542: // publicationStatus
999          value = new ContractResourcePublicationStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
1000          this.publicationStatus = (Enumeration) value; // Enumeration<ContractResourcePublicationStatusCodes>
1001          return value;
1002        case 1522889671: // copyright
1003          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
1004          return value;
1005        default: return super.setProperty(hash, name, value);
1006        }
1007
1008      }
1009
1010      @Override
1011      public Base setProperty(String name, Base value) throws FHIRException {
1012        if (name.equals("type")) {
1013          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1014        } else if (name.equals("subType")) {
1015          this.subType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1016        } else if (name.equals("publisher")) {
1017          this.publisher = TypeConvertor.castToReference(value); // Reference
1018        } else if (name.equals("publicationDate")) {
1019          this.publicationDate = TypeConvertor.castToDateTime(value); // DateTimeType
1020        } else if (name.equals("publicationStatus")) {
1021          value = new ContractResourcePublicationStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
1022          this.publicationStatus = (Enumeration) value; // Enumeration<ContractResourcePublicationStatusCodes>
1023        } else if (name.equals("copyright")) {
1024          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
1025        } else
1026          return super.setProperty(name, value);
1027        return value;
1028      }
1029
1030      @Override
1031      public Base makeProperty(int hash, String name) throws FHIRException {
1032        switch (hash) {
1033        case 3575610:  return getType();
1034        case -1868521062:  return getSubType();
1035        case 1447404028:  return getPublisher();
1036        case 1470566394:  return getPublicationDateElement();
1037        case 616500542:  return getPublicationStatusElement();
1038        case 1522889671:  return getCopyrightElement();
1039        default: return super.makeProperty(hash, name);
1040        }
1041
1042      }
1043
1044      @Override
1045      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1046        switch (hash) {
1047        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1048        case -1868521062: /*subType*/ return new String[] {"CodeableConcept"};
1049        case 1447404028: /*publisher*/ return new String[] {"Reference"};
1050        case 1470566394: /*publicationDate*/ return new String[] {"dateTime"};
1051        case 616500542: /*publicationStatus*/ return new String[] {"code"};
1052        case 1522889671: /*copyright*/ return new String[] {"markdown"};
1053        default: return super.getTypesForProperty(hash, name);
1054        }
1055
1056      }
1057
1058      @Override
1059      public Base addChild(String name) throws FHIRException {
1060        if (name.equals("type")) {
1061          this.type = new CodeableConcept();
1062          return this.type;
1063        }
1064        else if (name.equals("subType")) {
1065          this.subType = new CodeableConcept();
1066          return this.subType;
1067        }
1068        else if (name.equals("publisher")) {
1069          this.publisher = new Reference();
1070          return this.publisher;
1071        }
1072        else if (name.equals("publicationDate")) {
1073          throw new FHIRException("Cannot call addChild on a primitive type Contract.contentDefinition.publicationDate");
1074        }
1075        else if (name.equals("publicationStatus")) {
1076          throw new FHIRException("Cannot call addChild on a primitive type Contract.contentDefinition.publicationStatus");
1077        }
1078        else if (name.equals("copyright")) {
1079          throw new FHIRException("Cannot call addChild on a primitive type Contract.contentDefinition.copyright");
1080        }
1081        else
1082          return super.addChild(name);
1083      }
1084
1085      public ContentDefinitionComponent copy() {
1086        ContentDefinitionComponent dst = new ContentDefinitionComponent();
1087        copyValues(dst);
1088        return dst;
1089      }
1090
1091      public void copyValues(ContentDefinitionComponent dst) {
1092        super.copyValues(dst);
1093        dst.type = type == null ? null : type.copy();
1094        dst.subType = subType == null ? null : subType.copy();
1095        dst.publisher = publisher == null ? null : publisher.copy();
1096        dst.publicationDate = publicationDate == null ? null : publicationDate.copy();
1097        dst.publicationStatus = publicationStatus == null ? null : publicationStatus.copy();
1098        dst.copyright = copyright == null ? null : copyright.copy();
1099      }
1100
1101      @Override
1102      public boolean equalsDeep(Base other_) {
1103        if (!super.equalsDeep(other_))
1104          return false;
1105        if (!(other_ instanceof ContentDefinitionComponent))
1106          return false;
1107        ContentDefinitionComponent o = (ContentDefinitionComponent) other_;
1108        return compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) && compareDeep(publisher, o.publisher, true)
1109           && compareDeep(publicationDate, o.publicationDate, true) && compareDeep(publicationStatus, o.publicationStatus, true)
1110           && compareDeep(copyright, o.copyright, true);
1111      }
1112
1113      @Override
1114      public boolean equalsShallow(Base other_) {
1115        if (!super.equalsShallow(other_))
1116          return false;
1117        if (!(other_ instanceof ContentDefinitionComponent))
1118          return false;
1119        ContentDefinitionComponent o = (ContentDefinitionComponent) other_;
1120        return compareValues(publicationDate, o.publicationDate, true) && compareValues(publicationStatus, o.publicationStatus, true)
1121           && compareValues(copyright, o.copyright, true);
1122      }
1123
1124      public boolean isEmpty() {
1125        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, subType, publisher
1126          , publicationDate, publicationStatus, copyright);
1127      }
1128
1129  public String fhirType() {
1130    return "Contract.contentDefinition";
1131
1132  }
1133
1134  }
1135
1136    @Block()
1137    public static class TermComponent extends BackboneElement implements IBaseBackboneElement {
1138        /**
1139         * Unique identifier for this particular Contract Provision.
1140         */
1141        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true)
1142        @Description(shortDefinition="Contract Term Number", formalDefinition="Unique identifier for this particular Contract Provision." )
1143        protected Identifier identifier;
1144
1145        /**
1146         * When this Contract Provision was issued.
1147         */
1148        @Child(name = "issued", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1149        @Description(shortDefinition="Contract Term Issue Date Time", formalDefinition="When this Contract Provision was issued." )
1150        protected DateTimeType issued;
1151
1152        /**
1153         * Relevant time or time-period when this Contract Provision is applicable.
1154         */
1155        @Child(name = "applies", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true)
1156        @Description(shortDefinition="Contract Term Effective Time", formalDefinition="Relevant time or time-period when this Contract Provision is applicable." )
1157        protected Period applies;
1158
1159        /**
1160         * The entity that the term applies to.
1161         */
1162        @Child(name = "topic", type = {CodeableConcept.class, Reference.class}, order=4, min=0, max=1, modifier=false, summary=false)
1163        @Description(shortDefinition="Term Concern", formalDefinition="The entity that the term applies to." )
1164        protected DataType topic;
1165
1166        /**
1167         * A legal clause or condition contained within a contract that requires one or both parties to perform a particular requirement by some specified time or prevents one or both parties from performing a particular requirement by some specified time.
1168         */
1169        @Child(name = "type", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false)
1170        @Description(shortDefinition="Contract Term Type or Form", formalDefinition="A legal clause or condition contained within a contract that requires one or both parties to perform a particular requirement by some specified time or prevents one or both parties from performing a particular requirement by some specified time." )
1171        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-term-type")
1172        protected CodeableConcept type;
1173
1174        /**
1175         * A specialized legal clause or condition based on overarching contract type.
1176         */
1177        @Child(name = "subType", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false)
1178        @Description(shortDefinition="Contract Term Type specific classification", formalDefinition="A specialized legal clause or condition based on overarching contract type." )
1179        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-term-subtype")
1180        protected CodeableConcept subType;
1181
1182        /**
1183         * Statement of a provision in a policy or a contract.
1184         */
1185        @Child(name = "text", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true)
1186        @Description(shortDefinition="Term Statement", formalDefinition="Statement of a provision in a policy or a contract." )
1187        protected StringType text;
1188
1189        /**
1190         * Security labels that protect the handling of information about the term and its elements, which may be specifically identified..
1191         */
1192        @Child(name = "securityLabel", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1193        @Description(shortDefinition="Protection for the Term", formalDefinition="Security labels that protect the handling of information about the term and its elements, which may be specifically identified.." )
1194        protected List<SecurityLabelComponent> securityLabel;
1195
1196        /**
1197         * The matter of concern in the context of this provision of the agrement.
1198         */
1199        @Child(name = "offer", type = {}, order=9, min=1, max=1, modifier=false, summary=false)
1200        @Description(shortDefinition="Context of the Contract term", formalDefinition="The matter of concern in the context of this provision of the agrement." )
1201        protected ContractOfferComponent offer;
1202
1203        /**
1204         * Contract Term Asset List.
1205         */
1206        @Child(name = "asset", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1207        @Description(shortDefinition="Contract Term Asset List", formalDefinition="Contract Term Asset List." )
1208        protected List<ContractAssetComponent> asset;
1209
1210        /**
1211         * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.
1212         */
1213        @Child(name = "action", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1214        @Description(shortDefinition="Entity being ascribed responsibility", formalDefinition="An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place." )
1215        protected List<ActionComponent> action;
1216
1217        /**
1218         * Nested group of Contract Provisions.
1219         */
1220        @Child(name = "group", type = {TermComponent.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1221        @Description(shortDefinition="Nested Contract Term Group", formalDefinition="Nested group of Contract Provisions." )
1222        protected List<TermComponent> group;
1223
1224        private static final long serialVersionUID = -1647037544L;
1225
1226    /**
1227     * Constructor
1228     */
1229      public TermComponent() {
1230        super();
1231      }
1232
1233    /**
1234     * Constructor
1235     */
1236      public TermComponent(ContractOfferComponent offer) {
1237        super();
1238        this.setOffer(offer);
1239      }
1240
1241        /**
1242         * @return {@link #identifier} (Unique identifier for this particular Contract Provision.)
1243         */
1244        public Identifier getIdentifier() { 
1245          if (this.identifier == null)
1246            if (Configuration.errorOnAutoCreate())
1247              throw new Error("Attempt to auto-create TermComponent.identifier");
1248            else if (Configuration.doAutoCreate())
1249              this.identifier = new Identifier(); // cc
1250          return this.identifier;
1251        }
1252
1253        public boolean hasIdentifier() { 
1254          return this.identifier != null && !this.identifier.isEmpty();
1255        }
1256
1257        /**
1258         * @param value {@link #identifier} (Unique identifier for this particular Contract Provision.)
1259         */
1260        public TermComponent setIdentifier(Identifier value) { 
1261          this.identifier = value;
1262          return this;
1263        }
1264
1265        /**
1266         * @return {@link #issued} (When this Contract Provision was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
1267         */
1268        public DateTimeType getIssuedElement() { 
1269          if (this.issued == null)
1270            if (Configuration.errorOnAutoCreate())
1271              throw new Error("Attempt to auto-create TermComponent.issued");
1272            else if (Configuration.doAutoCreate())
1273              this.issued = new DateTimeType(); // bb
1274          return this.issued;
1275        }
1276
1277        public boolean hasIssuedElement() { 
1278          return this.issued != null && !this.issued.isEmpty();
1279        }
1280
1281        public boolean hasIssued() { 
1282          return this.issued != null && !this.issued.isEmpty();
1283        }
1284
1285        /**
1286         * @param value {@link #issued} (When this Contract Provision was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
1287         */
1288        public TermComponent setIssuedElement(DateTimeType value) { 
1289          this.issued = value;
1290          return this;
1291        }
1292
1293        /**
1294         * @return When this Contract Provision was issued.
1295         */
1296        public Date getIssued() { 
1297          return this.issued == null ? null : this.issued.getValue();
1298        }
1299
1300        /**
1301         * @param value When this Contract Provision was issued.
1302         */
1303        public TermComponent setIssued(Date value) { 
1304          if (value == null)
1305            this.issued = null;
1306          else {
1307            if (this.issued == null)
1308              this.issued = new DateTimeType();
1309            this.issued.setValue(value);
1310          }
1311          return this;
1312        }
1313
1314        /**
1315         * @return {@link #applies} (Relevant time or time-period when this Contract Provision is applicable.)
1316         */
1317        public Period getApplies() { 
1318          if (this.applies == null)
1319            if (Configuration.errorOnAutoCreate())
1320              throw new Error("Attempt to auto-create TermComponent.applies");
1321            else if (Configuration.doAutoCreate())
1322              this.applies = new Period(); // cc
1323          return this.applies;
1324        }
1325
1326        public boolean hasApplies() { 
1327          return this.applies != null && !this.applies.isEmpty();
1328        }
1329
1330        /**
1331         * @param value {@link #applies} (Relevant time or time-period when this Contract Provision is applicable.)
1332         */
1333        public TermComponent setApplies(Period value) { 
1334          this.applies = value;
1335          return this;
1336        }
1337
1338        /**
1339         * @return {@link #topic} (The entity that the term applies to.)
1340         */
1341        public DataType getTopic() { 
1342          return this.topic;
1343        }
1344
1345        /**
1346         * @return {@link #topic} (The entity that the term applies to.)
1347         */
1348        public CodeableConcept getTopicCodeableConcept() throws FHIRException { 
1349          if (this.topic == null)
1350            this.topic = new CodeableConcept();
1351          if (!(this.topic instanceof CodeableConcept))
1352            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.topic.getClass().getName()+" was encountered");
1353          return (CodeableConcept) this.topic;
1354        }
1355
1356        public boolean hasTopicCodeableConcept() { 
1357          return this != null && this.topic instanceof CodeableConcept;
1358        }
1359
1360        /**
1361         * @return {@link #topic} (The entity that the term applies to.)
1362         */
1363        public Reference getTopicReference() throws FHIRException { 
1364          if (this.topic == null)
1365            this.topic = new Reference();
1366          if (!(this.topic instanceof Reference))
1367            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.topic.getClass().getName()+" was encountered");
1368          return (Reference) this.topic;
1369        }
1370
1371        public boolean hasTopicReference() { 
1372          return this != null && this.topic instanceof Reference;
1373        }
1374
1375        public boolean hasTopic() { 
1376          return this.topic != null && !this.topic.isEmpty();
1377        }
1378
1379        /**
1380         * @param value {@link #topic} (The entity that the term applies to.)
1381         */
1382        public TermComponent setTopic(DataType value) { 
1383          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
1384            throw new Error("Not the right type for Contract.term.topic[x]: "+value.fhirType());
1385          this.topic = value;
1386          return this;
1387        }
1388
1389        /**
1390         * @return {@link #type} (A legal clause or condition contained within a contract that requires one or both parties to perform a particular requirement by some specified time or prevents one or both parties from performing a particular requirement by some specified time.)
1391         */
1392        public CodeableConcept getType() { 
1393          if (this.type == null)
1394            if (Configuration.errorOnAutoCreate())
1395              throw new Error("Attempt to auto-create TermComponent.type");
1396            else if (Configuration.doAutoCreate())
1397              this.type = new CodeableConcept(); // cc
1398          return this.type;
1399        }
1400
1401        public boolean hasType() { 
1402          return this.type != null && !this.type.isEmpty();
1403        }
1404
1405        /**
1406         * @param value {@link #type} (A legal clause or condition contained within a contract that requires one or both parties to perform a particular requirement by some specified time or prevents one or both parties from performing a particular requirement by some specified time.)
1407         */
1408        public TermComponent setType(CodeableConcept value) { 
1409          this.type = value;
1410          return this;
1411        }
1412
1413        /**
1414         * @return {@link #subType} (A specialized legal clause or condition based on overarching contract type.)
1415         */
1416        public CodeableConcept getSubType() { 
1417          if (this.subType == null)
1418            if (Configuration.errorOnAutoCreate())
1419              throw new Error("Attempt to auto-create TermComponent.subType");
1420            else if (Configuration.doAutoCreate())
1421              this.subType = new CodeableConcept(); // cc
1422          return this.subType;
1423        }
1424
1425        public boolean hasSubType() { 
1426          return this.subType != null && !this.subType.isEmpty();
1427        }
1428
1429        /**
1430         * @param value {@link #subType} (A specialized legal clause or condition based on overarching contract type.)
1431         */
1432        public TermComponent setSubType(CodeableConcept value) { 
1433          this.subType = value;
1434          return this;
1435        }
1436
1437        /**
1438         * @return {@link #text} (Statement of a provision in a policy or a contract.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
1439         */
1440        public StringType getTextElement() { 
1441          if (this.text == null)
1442            if (Configuration.errorOnAutoCreate())
1443              throw new Error("Attempt to auto-create TermComponent.text");
1444            else if (Configuration.doAutoCreate())
1445              this.text = new StringType(); // bb
1446          return this.text;
1447        }
1448
1449        public boolean hasTextElement() { 
1450          return this.text != null && !this.text.isEmpty();
1451        }
1452
1453        public boolean hasText() { 
1454          return this.text != null && !this.text.isEmpty();
1455        }
1456
1457        /**
1458         * @param value {@link #text} (Statement of a provision in a policy or a contract.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
1459         */
1460        public TermComponent setTextElement(StringType value) { 
1461          this.text = value;
1462          return this;
1463        }
1464
1465        /**
1466         * @return Statement of a provision in a policy or a contract.
1467         */
1468        public String getText() { 
1469          return this.text == null ? null : this.text.getValue();
1470        }
1471
1472        /**
1473         * @param value Statement of a provision in a policy or a contract.
1474         */
1475        public TermComponent setText(String value) { 
1476          if (Utilities.noString(value))
1477            this.text = null;
1478          else {
1479            if (this.text == null)
1480              this.text = new StringType();
1481            this.text.setValue(value);
1482          }
1483          return this;
1484        }
1485
1486        /**
1487         * @return {@link #securityLabel} (Security labels that protect the handling of information about the term and its elements, which may be specifically identified..)
1488         */
1489        public List<SecurityLabelComponent> getSecurityLabel() { 
1490          if (this.securityLabel == null)
1491            this.securityLabel = new ArrayList<SecurityLabelComponent>();
1492          return this.securityLabel;
1493        }
1494
1495        /**
1496         * @return Returns a reference to <code>this</code> for easy method chaining
1497         */
1498        public TermComponent setSecurityLabel(List<SecurityLabelComponent> theSecurityLabel) { 
1499          this.securityLabel = theSecurityLabel;
1500          return this;
1501        }
1502
1503        public boolean hasSecurityLabel() { 
1504          if (this.securityLabel == null)
1505            return false;
1506          for (SecurityLabelComponent item : this.securityLabel)
1507            if (!item.isEmpty())
1508              return true;
1509          return false;
1510        }
1511
1512        public SecurityLabelComponent addSecurityLabel() { //3
1513          SecurityLabelComponent t = new SecurityLabelComponent();
1514          if (this.securityLabel == null)
1515            this.securityLabel = new ArrayList<SecurityLabelComponent>();
1516          this.securityLabel.add(t);
1517          return t;
1518        }
1519
1520        public TermComponent addSecurityLabel(SecurityLabelComponent t) { //3
1521          if (t == null)
1522            return this;
1523          if (this.securityLabel == null)
1524            this.securityLabel = new ArrayList<SecurityLabelComponent>();
1525          this.securityLabel.add(t);
1526          return this;
1527        }
1528
1529        /**
1530         * @return The first repetition of repeating field {@link #securityLabel}, creating it if it does not already exist {3}
1531         */
1532        public SecurityLabelComponent getSecurityLabelFirstRep() { 
1533          if (getSecurityLabel().isEmpty()) {
1534            addSecurityLabel();
1535          }
1536          return getSecurityLabel().get(0);
1537        }
1538
1539        /**
1540         * @return {@link #offer} (The matter of concern in the context of this provision of the agrement.)
1541         */
1542        public ContractOfferComponent getOffer() { 
1543          if (this.offer == null)
1544            if (Configuration.errorOnAutoCreate())
1545              throw new Error("Attempt to auto-create TermComponent.offer");
1546            else if (Configuration.doAutoCreate())
1547              this.offer = new ContractOfferComponent(); // cc
1548          return this.offer;
1549        }
1550
1551        public boolean hasOffer() { 
1552          return this.offer != null && !this.offer.isEmpty();
1553        }
1554
1555        /**
1556         * @param value {@link #offer} (The matter of concern in the context of this provision of the agrement.)
1557         */
1558        public TermComponent setOffer(ContractOfferComponent value) { 
1559          this.offer = value;
1560          return this;
1561        }
1562
1563        /**
1564         * @return {@link #asset} (Contract Term Asset List.)
1565         */
1566        public List<ContractAssetComponent> getAsset() { 
1567          if (this.asset == null)
1568            this.asset = new ArrayList<ContractAssetComponent>();
1569          return this.asset;
1570        }
1571
1572        /**
1573         * @return Returns a reference to <code>this</code> for easy method chaining
1574         */
1575        public TermComponent setAsset(List<ContractAssetComponent> theAsset) { 
1576          this.asset = theAsset;
1577          return this;
1578        }
1579
1580        public boolean hasAsset() { 
1581          if (this.asset == null)
1582            return false;
1583          for (ContractAssetComponent item : this.asset)
1584            if (!item.isEmpty())
1585              return true;
1586          return false;
1587        }
1588
1589        public ContractAssetComponent addAsset() { //3
1590          ContractAssetComponent t = new ContractAssetComponent();
1591          if (this.asset == null)
1592            this.asset = new ArrayList<ContractAssetComponent>();
1593          this.asset.add(t);
1594          return t;
1595        }
1596
1597        public TermComponent addAsset(ContractAssetComponent t) { //3
1598          if (t == null)
1599            return this;
1600          if (this.asset == null)
1601            this.asset = new ArrayList<ContractAssetComponent>();
1602          this.asset.add(t);
1603          return this;
1604        }
1605
1606        /**
1607         * @return The first repetition of repeating field {@link #asset}, creating it if it does not already exist {3}
1608         */
1609        public ContractAssetComponent getAssetFirstRep() { 
1610          if (getAsset().isEmpty()) {
1611            addAsset();
1612          }
1613          return getAsset().get(0);
1614        }
1615
1616        /**
1617         * @return {@link #action} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.)
1618         */
1619        public List<ActionComponent> getAction() { 
1620          if (this.action == null)
1621            this.action = new ArrayList<ActionComponent>();
1622          return this.action;
1623        }
1624
1625        /**
1626         * @return Returns a reference to <code>this</code> for easy method chaining
1627         */
1628        public TermComponent setAction(List<ActionComponent> theAction) { 
1629          this.action = theAction;
1630          return this;
1631        }
1632
1633        public boolean hasAction() { 
1634          if (this.action == null)
1635            return false;
1636          for (ActionComponent item : this.action)
1637            if (!item.isEmpty())
1638              return true;
1639          return false;
1640        }
1641
1642        public ActionComponent addAction() { //3
1643          ActionComponent t = new ActionComponent();
1644          if (this.action == null)
1645            this.action = new ArrayList<ActionComponent>();
1646          this.action.add(t);
1647          return t;
1648        }
1649
1650        public TermComponent addAction(ActionComponent t) { //3
1651          if (t == null)
1652            return this;
1653          if (this.action == null)
1654            this.action = new ArrayList<ActionComponent>();
1655          this.action.add(t);
1656          return this;
1657        }
1658
1659        /**
1660         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist {3}
1661         */
1662        public ActionComponent getActionFirstRep() { 
1663          if (getAction().isEmpty()) {
1664            addAction();
1665          }
1666          return getAction().get(0);
1667        }
1668
1669        /**
1670         * @return {@link #group} (Nested group of Contract Provisions.)
1671         */
1672        public List<TermComponent> getGroup() { 
1673          if (this.group == null)
1674            this.group = new ArrayList<TermComponent>();
1675          return this.group;
1676        }
1677
1678        /**
1679         * @return Returns a reference to <code>this</code> for easy method chaining
1680         */
1681        public TermComponent setGroup(List<TermComponent> theGroup) { 
1682          this.group = theGroup;
1683          return this;
1684        }
1685
1686        public boolean hasGroup() { 
1687          if (this.group == null)
1688            return false;
1689          for (TermComponent item : this.group)
1690            if (!item.isEmpty())
1691              return true;
1692          return false;
1693        }
1694
1695        public TermComponent addGroup() { //3
1696          TermComponent t = new TermComponent();
1697          if (this.group == null)
1698            this.group = new ArrayList<TermComponent>();
1699          this.group.add(t);
1700          return t;
1701        }
1702
1703        public TermComponent addGroup(TermComponent t) { //3
1704          if (t == null)
1705            return this;
1706          if (this.group == null)
1707            this.group = new ArrayList<TermComponent>();
1708          this.group.add(t);
1709          return this;
1710        }
1711
1712        /**
1713         * @return The first repetition of repeating field {@link #group}, creating it if it does not already exist {3}
1714         */
1715        public TermComponent getGroupFirstRep() { 
1716          if (getGroup().isEmpty()) {
1717            addGroup();
1718          }
1719          return getGroup().get(0);
1720        }
1721
1722        protected void listChildren(List<Property> children) {
1723          super.listChildren(children);
1724          children.add(new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, 1, identifier));
1725          children.add(new Property("issued", "dateTime", "When this Contract Provision was issued.", 0, 1, issued));
1726          children.add(new Property("applies", "Period", "Relevant time or time-period when this Contract Provision is applicable.", 0, 1, applies));
1727          children.add(new Property("topic[x]", "CodeableConcept|Reference(Any)", "The entity that the term applies to.", 0, 1, topic));
1728          children.add(new Property("type", "CodeableConcept", "A legal clause or condition contained within a contract that requires one or both parties to perform a particular requirement by some specified time or prevents one or both parties from performing a particular requirement by some specified time.", 0, 1, type));
1729          children.add(new Property("subType", "CodeableConcept", "A specialized legal clause or condition based on overarching contract type.", 0, 1, subType));
1730          children.add(new Property("text", "string", "Statement of a provision in a policy or a contract.", 0, 1, text));
1731          children.add(new Property("securityLabel", "", "Security labels that protect the handling of information about the term and its elements, which may be specifically identified..", 0, java.lang.Integer.MAX_VALUE, securityLabel));
1732          children.add(new Property("offer", "", "The matter of concern in the context of this provision of the agrement.", 0, 1, offer));
1733          children.add(new Property("asset", "", "Contract Term Asset List.", 0, java.lang.Integer.MAX_VALUE, asset));
1734          children.add(new Property("action", "", "An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.", 0, java.lang.Integer.MAX_VALUE, action));
1735          children.add(new Property("group", "@Contract.term", "Nested group of Contract Provisions.", 0, java.lang.Integer.MAX_VALUE, group));
1736        }
1737
1738        @Override
1739        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1740          switch (_hash) {
1741          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, 1, identifier);
1742          case -1179159893: /*issued*/  return new Property("issued", "dateTime", "When this Contract Provision was issued.", 0, 1, issued);
1743          case -793235316: /*applies*/  return new Property("applies", "Period", "Relevant time or time-period when this Contract Provision is applicable.", 0, 1, applies);
1744          case -957295375: /*topic[x]*/  return new Property("topic[x]", "CodeableConcept|Reference(Any)", "The entity that the term applies to.", 0, 1, topic);
1745          case 110546223: /*topic*/  return new Property("topic[x]", "CodeableConcept|Reference(Any)", "The entity that the term applies to.", 0, 1, topic);
1746          case 777778802: /*topicCodeableConcept*/  return new Property("topic[x]", "CodeableConcept", "The entity that the term applies to.", 0, 1, topic);
1747          case -343345444: /*topicReference*/  return new Property("topic[x]", "Reference(Any)", "The entity that the term applies to.", 0, 1, topic);
1748          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A legal clause or condition contained within a contract that requires one or both parties to perform a particular requirement by some specified time or prevents one or both parties from performing a particular requirement by some specified time.", 0, 1, type);
1749          case -1868521062: /*subType*/  return new Property("subType", "CodeableConcept", "A specialized legal clause or condition based on overarching contract type.", 0, 1, subType);
1750          case 3556653: /*text*/  return new Property("text", "string", "Statement of a provision in a policy or a contract.", 0, 1, text);
1751          case -722296940: /*securityLabel*/  return new Property("securityLabel", "", "Security labels that protect the handling of information about the term and its elements, which may be specifically identified..", 0, java.lang.Integer.MAX_VALUE, securityLabel);
1752          case 105650780: /*offer*/  return new Property("offer", "", "The matter of concern in the context of this provision of the agrement.", 0, 1, offer);
1753          case 93121264: /*asset*/  return new Property("asset", "", "Contract Term Asset List.", 0, java.lang.Integer.MAX_VALUE, asset);
1754          case -1422950858: /*action*/  return new Property("action", "", "An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.", 0, java.lang.Integer.MAX_VALUE, action);
1755          case 98629247: /*group*/  return new Property("group", "@Contract.term", "Nested group of Contract Provisions.", 0, java.lang.Integer.MAX_VALUE, group);
1756          default: return super.getNamedProperty(_hash, _name, _checkValid);
1757          }
1758
1759        }
1760
1761      @Override
1762      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1763        switch (hash) {
1764        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
1765        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType
1766        case -793235316: /*applies*/ return this.applies == null ? new Base[0] : new Base[] {this.applies}; // Period
1767        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : new Base[] {this.topic}; // DataType
1768        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1769        case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : new Base[] {this.subType}; // CodeableConcept
1770        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
1771        case -722296940: /*securityLabel*/ return this.securityLabel == null ? new Base[0] : this.securityLabel.toArray(new Base[this.securityLabel.size()]); // SecurityLabelComponent
1772        case 105650780: /*offer*/ return this.offer == null ? new Base[0] : new Base[] {this.offer}; // ContractOfferComponent
1773        case 93121264: /*asset*/ return this.asset == null ? new Base[0] : this.asset.toArray(new Base[this.asset.size()]); // ContractAssetComponent
1774        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // ActionComponent
1775        case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // TermComponent
1776        default: return super.getProperty(hash, name, checkValid);
1777        }
1778
1779      }
1780
1781      @Override
1782      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1783        switch (hash) {
1784        case -1618432855: // identifier
1785          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
1786          return value;
1787        case -1179159893: // issued
1788          this.issued = TypeConvertor.castToDateTime(value); // DateTimeType
1789          return value;
1790        case -793235316: // applies
1791          this.applies = TypeConvertor.castToPeriod(value); // Period
1792          return value;
1793        case 110546223: // topic
1794          this.topic = TypeConvertor.castToType(value); // DataType
1795          return value;
1796        case 3575610: // type
1797          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1798          return value;
1799        case -1868521062: // subType
1800          this.subType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1801          return value;
1802        case 3556653: // text
1803          this.text = TypeConvertor.castToString(value); // StringType
1804          return value;
1805        case -722296940: // securityLabel
1806          this.getSecurityLabel().add((SecurityLabelComponent) value); // SecurityLabelComponent
1807          return value;
1808        case 105650780: // offer
1809          this.offer = (ContractOfferComponent) value; // ContractOfferComponent
1810          return value;
1811        case 93121264: // asset
1812          this.getAsset().add((ContractAssetComponent) value); // ContractAssetComponent
1813          return value;
1814        case -1422950858: // action
1815          this.getAction().add((ActionComponent) value); // ActionComponent
1816          return value;
1817        case 98629247: // group
1818          this.getGroup().add((TermComponent) value); // TermComponent
1819          return value;
1820        default: return super.setProperty(hash, name, value);
1821        }
1822
1823      }
1824
1825      @Override
1826      public Base setProperty(String name, Base value) throws FHIRException {
1827        if (name.equals("identifier")) {
1828          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
1829        } else if (name.equals("issued")) {
1830          this.issued = TypeConvertor.castToDateTime(value); // DateTimeType
1831        } else if (name.equals("applies")) {
1832          this.applies = TypeConvertor.castToPeriod(value); // Period
1833        } else if (name.equals("topic[x]")) {
1834          this.topic = TypeConvertor.castToType(value); // DataType
1835        } else if (name.equals("type")) {
1836          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1837        } else if (name.equals("subType")) {
1838          this.subType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1839        } else if (name.equals("text")) {
1840          this.text = TypeConvertor.castToString(value); // StringType
1841        } else if (name.equals("securityLabel")) {
1842          this.getSecurityLabel().add((SecurityLabelComponent) value);
1843        } else if (name.equals("offer")) {
1844          this.offer = (ContractOfferComponent) value; // ContractOfferComponent
1845        } else if (name.equals("asset")) {
1846          this.getAsset().add((ContractAssetComponent) value);
1847        } else if (name.equals("action")) {
1848          this.getAction().add((ActionComponent) value);
1849        } else if (name.equals("group")) {
1850          this.getGroup().add((TermComponent) value);
1851        } else
1852          return super.setProperty(name, value);
1853        return value;
1854      }
1855
1856      @Override
1857      public Base makeProperty(int hash, String name) throws FHIRException {
1858        switch (hash) {
1859        case -1618432855:  return getIdentifier();
1860        case -1179159893:  return getIssuedElement();
1861        case -793235316:  return getApplies();
1862        case -957295375:  return getTopic();
1863        case 110546223:  return getTopic();
1864        case 3575610:  return getType();
1865        case -1868521062:  return getSubType();
1866        case 3556653:  return getTextElement();
1867        case -722296940:  return addSecurityLabel(); 
1868        case 105650780:  return getOffer();
1869        case 93121264:  return addAsset(); 
1870        case -1422950858:  return addAction(); 
1871        case 98629247:  return addGroup(); 
1872        default: return super.makeProperty(hash, name);
1873        }
1874
1875      }
1876
1877      @Override
1878      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1879        switch (hash) {
1880        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1881        case -1179159893: /*issued*/ return new String[] {"dateTime"};
1882        case -793235316: /*applies*/ return new String[] {"Period"};
1883        case 110546223: /*topic*/ return new String[] {"CodeableConcept", "Reference"};
1884        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1885        case -1868521062: /*subType*/ return new String[] {"CodeableConcept"};
1886        case 3556653: /*text*/ return new String[] {"string"};
1887        case -722296940: /*securityLabel*/ return new String[] {};
1888        case 105650780: /*offer*/ return new String[] {};
1889        case 93121264: /*asset*/ return new String[] {};
1890        case -1422950858: /*action*/ return new String[] {};
1891        case 98629247: /*group*/ return new String[] {"@Contract.term"};
1892        default: return super.getTypesForProperty(hash, name);
1893        }
1894
1895      }
1896
1897      @Override
1898      public Base addChild(String name) throws FHIRException {
1899        if (name.equals("identifier")) {
1900          this.identifier = new Identifier();
1901          return this.identifier;
1902        }
1903        else if (name.equals("issued")) {
1904          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.issued");
1905        }
1906        else if (name.equals("applies")) {
1907          this.applies = new Period();
1908          return this.applies;
1909        }
1910        else if (name.equals("topicCodeableConcept")) {
1911          this.topic = new CodeableConcept();
1912          return this.topic;
1913        }
1914        else if (name.equals("topicReference")) {
1915          this.topic = new Reference();
1916          return this.topic;
1917        }
1918        else if (name.equals("type")) {
1919          this.type = new CodeableConcept();
1920          return this.type;
1921        }
1922        else if (name.equals("subType")) {
1923          this.subType = new CodeableConcept();
1924          return this.subType;
1925        }
1926        else if (name.equals("text")) {
1927          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.text");
1928        }
1929        else if (name.equals("securityLabel")) {
1930          return addSecurityLabel();
1931        }
1932        else if (name.equals("offer")) {
1933          this.offer = new ContractOfferComponent();
1934          return this.offer;
1935        }
1936        else if (name.equals("asset")) {
1937          return addAsset();
1938        }
1939        else if (name.equals("action")) {
1940          return addAction();
1941        }
1942        else if (name.equals("group")) {
1943          return addGroup();
1944        }
1945        else
1946          return super.addChild(name);
1947      }
1948
1949      public TermComponent copy() {
1950        TermComponent dst = new TermComponent();
1951        copyValues(dst);
1952        return dst;
1953      }
1954
1955      public void copyValues(TermComponent dst) {
1956        super.copyValues(dst);
1957        dst.identifier = identifier == null ? null : identifier.copy();
1958        dst.issued = issued == null ? null : issued.copy();
1959        dst.applies = applies == null ? null : applies.copy();
1960        dst.topic = topic == null ? null : topic.copy();
1961        dst.type = type == null ? null : type.copy();
1962        dst.subType = subType == null ? null : subType.copy();
1963        dst.text = text == null ? null : text.copy();
1964        if (securityLabel != null) {
1965          dst.securityLabel = new ArrayList<SecurityLabelComponent>();
1966          for (SecurityLabelComponent i : securityLabel)
1967            dst.securityLabel.add(i.copy());
1968        };
1969        dst.offer = offer == null ? null : offer.copy();
1970        if (asset != null) {
1971          dst.asset = new ArrayList<ContractAssetComponent>();
1972          for (ContractAssetComponent i : asset)
1973            dst.asset.add(i.copy());
1974        };
1975        if (action != null) {
1976          dst.action = new ArrayList<ActionComponent>();
1977          for (ActionComponent i : action)
1978            dst.action.add(i.copy());
1979        };
1980        if (group != null) {
1981          dst.group = new ArrayList<TermComponent>();
1982          for (TermComponent i : group)
1983            dst.group.add(i.copy());
1984        };
1985      }
1986
1987      @Override
1988      public boolean equalsDeep(Base other_) {
1989        if (!super.equalsDeep(other_))
1990          return false;
1991        if (!(other_ instanceof TermComponent))
1992          return false;
1993        TermComponent o = (TermComponent) other_;
1994        return compareDeep(identifier, o.identifier, true) && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true)
1995           && compareDeep(topic, o.topic, true) && compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true)
1996           && compareDeep(text, o.text, true) && compareDeep(securityLabel, o.securityLabel, true) && compareDeep(offer, o.offer, true)
1997           && compareDeep(asset, o.asset, true) && compareDeep(action, o.action, true) && compareDeep(group, o.group, true)
1998          ;
1999      }
2000
2001      @Override
2002      public boolean equalsShallow(Base other_) {
2003        if (!super.equalsShallow(other_))
2004          return false;
2005        if (!(other_ instanceof TermComponent))
2006          return false;
2007        TermComponent o = (TermComponent) other_;
2008        return compareValues(issued, o.issued, true) && compareValues(text, o.text, true);
2009      }
2010
2011      public boolean isEmpty() {
2012        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, issued, applies
2013          , topic, type, subType, text, securityLabel, offer, asset, action, group);
2014      }
2015
2016  public String fhirType() {
2017    return "Contract.term";
2018
2019  }
2020
2021  }
2022
2023    @Block()
2024    public static class SecurityLabelComponent extends BackboneElement implements IBaseBackboneElement {
2025        /**
2026         * Number used to link this term or term element to the applicable Security Label.
2027         */
2028        @Child(name = "number", type = {UnsignedIntType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2029        @Description(shortDefinition="Link to Security Labels", formalDefinition="Number used to link this term or term element to the applicable Security Label." )
2030        protected List<UnsignedIntType> number;
2031
2032        /**
2033         * Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements.
2034         */
2035        @Child(name = "classification", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false)
2036        @Description(shortDefinition="Confidentiality Protection", formalDefinition="Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements." )
2037        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-security-classification")
2038        protected Coding classification;
2039
2040        /**
2041         * Security label privacy tag that species the applicable privacy and security policies governing this term and/or term elements.
2042         */
2043        @Child(name = "category", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2044        @Description(shortDefinition="Applicable Policy", formalDefinition="Security label privacy tag that species the applicable privacy and security policies governing this term and/or term elements." )
2045        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-security-category")
2046        protected List<Coding> category;
2047
2048        /**
2049         * Security label privacy tag that species the manner in which term and/or term elements are to be protected.
2050         */
2051        @Child(name = "control", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2052        @Description(shortDefinition="Handling Instructions", formalDefinition="Security label privacy tag that species the manner in which term and/or term elements are to be protected." )
2053        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-security-control")
2054        protected List<Coding> control;
2055
2056        private static final long serialVersionUID = 788281758L;
2057
2058    /**
2059     * Constructor
2060     */
2061      public SecurityLabelComponent() {
2062        super();
2063      }
2064
2065    /**
2066     * Constructor
2067     */
2068      public SecurityLabelComponent(Coding classification) {
2069        super();
2070        this.setClassification(classification);
2071      }
2072
2073        /**
2074         * @return {@link #number} (Number used to link this term or term element to the applicable Security Label.)
2075         */
2076        public List<UnsignedIntType> getNumber() { 
2077          if (this.number == null)
2078            this.number = new ArrayList<UnsignedIntType>();
2079          return this.number;
2080        }
2081
2082        /**
2083         * @return Returns a reference to <code>this</code> for easy method chaining
2084         */
2085        public SecurityLabelComponent setNumber(List<UnsignedIntType> theNumber) { 
2086          this.number = theNumber;
2087          return this;
2088        }
2089
2090        public boolean hasNumber() { 
2091          if (this.number == null)
2092            return false;
2093          for (UnsignedIntType item : this.number)
2094            if (!item.isEmpty())
2095              return true;
2096          return false;
2097        }
2098
2099        /**
2100         * @return {@link #number} (Number used to link this term or term element to the applicable Security Label.)
2101         */
2102        public UnsignedIntType addNumberElement() {//2 
2103          UnsignedIntType t = new UnsignedIntType();
2104          if (this.number == null)
2105            this.number = new ArrayList<UnsignedIntType>();
2106          this.number.add(t);
2107          return t;
2108        }
2109
2110        /**
2111         * @param value {@link #number} (Number used to link this term or term element to the applicable Security Label.)
2112         */
2113        public SecurityLabelComponent addNumber(int value) { //1
2114          UnsignedIntType t = new UnsignedIntType();
2115          t.setValue(value);
2116          if (this.number == null)
2117            this.number = new ArrayList<UnsignedIntType>();
2118          this.number.add(t);
2119          return this;
2120        }
2121
2122        /**
2123         * @param value {@link #number} (Number used to link this term or term element to the applicable Security Label.)
2124         */
2125        public boolean hasNumber(int value) { 
2126          if (this.number == null)
2127            return false;
2128          for (UnsignedIntType v : this.number)
2129            if (v.getValue().equals(value)) // unsignedInt
2130              return true;
2131          return false;
2132        }
2133
2134        /**
2135         * @return {@link #classification} (Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements.)
2136         */
2137        public Coding getClassification() { 
2138          if (this.classification == null)
2139            if (Configuration.errorOnAutoCreate())
2140              throw new Error("Attempt to auto-create SecurityLabelComponent.classification");
2141            else if (Configuration.doAutoCreate())
2142              this.classification = new Coding(); // cc
2143          return this.classification;
2144        }
2145
2146        public boolean hasClassification() { 
2147          return this.classification != null && !this.classification.isEmpty();
2148        }
2149
2150        /**
2151         * @param value {@link #classification} (Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements.)
2152         */
2153        public SecurityLabelComponent setClassification(Coding value) { 
2154          this.classification = value;
2155          return this;
2156        }
2157
2158        /**
2159         * @return {@link #category} (Security label privacy tag that species the applicable privacy and security policies governing this term and/or term elements.)
2160         */
2161        public List<Coding> getCategory() { 
2162          if (this.category == null)
2163            this.category = new ArrayList<Coding>();
2164          return this.category;
2165        }
2166
2167        /**
2168         * @return Returns a reference to <code>this</code> for easy method chaining
2169         */
2170        public SecurityLabelComponent setCategory(List<Coding> theCategory) { 
2171          this.category = theCategory;
2172          return this;
2173        }
2174
2175        public boolean hasCategory() { 
2176          if (this.category == null)
2177            return false;
2178          for (Coding item : this.category)
2179            if (!item.isEmpty())
2180              return true;
2181          return false;
2182        }
2183
2184        public Coding addCategory() { //3
2185          Coding t = new Coding();
2186          if (this.category == null)
2187            this.category = new ArrayList<Coding>();
2188          this.category.add(t);
2189          return t;
2190        }
2191
2192        public SecurityLabelComponent addCategory(Coding t) { //3
2193          if (t == null)
2194            return this;
2195          if (this.category == null)
2196            this.category = new ArrayList<Coding>();
2197          this.category.add(t);
2198          return this;
2199        }
2200
2201        /**
2202         * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
2203         */
2204        public Coding getCategoryFirstRep() { 
2205          if (getCategory().isEmpty()) {
2206            addCategory();
2207          }
2208          return getCategory().get(0);
2209        }
2210
2211        /**
2212         * @return {@link #control} (Security label privacy tag that species the manner in which term and/or term elements are to be protected.)
2213         */
2214        public List<Coding> getControl() { 
2215          if (this.control == null)
2216            this.control = new ArrayList<Coding>();
2217          return this.control;
2218        }
2219
2220        /**
2221         * @return Returns a reference to <code>this</code> for easy method chaining
2222         */
2223        public SecurityLabelComponent setControl(List<Coding> theControl) { 
2224          this.control = theControl;
2225          return this;
2226        }
2227
2228        public boolean hasControl() { 
2229          if (this.control == null)
2230            return false;
2231          for (Coding item : this.control)
2232            if (!item.isEmpty())
2233              return true;
2234          return false;
2235        }
2236
2237        public Coding addControl() { //3
2238          Coding t = new Coding();
2239          if (this.control == null)
2240            this.control = new ArrayList<Coding>();
2241          this.control.add(t);
2242          return t;
2243        }
2244
2245        public SecurityLabelComponent addControl(Coding t) { //3
2246          if (t == null)
2247            return this;
2248          if (this.control == null)
2249            this.control = new ArrayList<Coding>();
2250          this.control.add(t);
2251          return this;
2252        }
2253
2254        /**
2255         * @return The first repetition of repeating field {@link #control}, creating it if it does not already exist {3}
2256         */
2257        public Coding getControlFirstRep() { 
2258          if (getControl().isEmpty()) {
2259            addControl();
2260          }
2261          return getControl().get(0);
2262        }
2263
2264        protected void listChildren(List<Property> children) {
2265          super.listChildren(children);
2266          children.add(new Property("number", "unsignedInt", "Number used to link this term or term element to the applicable Security Label.", 0, java.lang.Integer.MAX_VALUE, number));
2267          children.add(new Property("classification", "Coding", "Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements.", 0, 1, classification));
2268          children.add(new Property("category", "Coding", "Security label privacy tag that species the applicable privacy and security policies governing this term and/or term elements.", 0, java.lang.Integer.MAX_VALUE, category));
2269          children.add(new Property("control", "Coding", "Security label privacy tag that species the manner in which term and/or term elements are to be protected.", 0, java.lang.Integer.MAX_VALUE, control));
2270        }
2271
2272        @Override
2273        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2274          switch (_hash) {
2275          case -1034364087: /*number*/  return new Property("number", "unsignedInt", "Number used to link this term or term element to the applicable Security Label.", 0, java.lang.Integer.MAX_VALUE, number);
2276          case 382350310: /*classification*/  return new Property("classification", "Coding", "Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements.", 0, 1, classification);
2277          case 50511102: /*category*/  return new Property("category", "Coding", "Security label privacy tag that species the applicable privacy and security policies governing this term and/or term elements.", 0, java.lang.Integer.MAX_VALUE, category);
2278          case 951543133: /*control*/  return new Property("control", "Coding", "Security label privacy tag that species the manner in which term and/or term elements are to be protected.", 0, java.lang.Integer.MAX_VALUE, control);
2279          default: return super.getNamedProperty(_hash, _name, _checkValid);
2280          }
2281
2282        }
2283
2284      @Override
2285      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2286        switch (hash) {
2287        case -1034364087: /*number*/ return this.number == null ? new Base[0] : this.number.toArray(new Base[this.number.size()]); // UnsignedIntType
2288        case 382350310: /*classification*/ return this.classification == null ? new Base[0] : new Base[] {this.classification}; // Coding
2289        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // Coding
2290        case 951543133: /*control*/ return this.control == null ? new Base[0] : this.control.toArray(new Base[this.control.size()]); // Coding
2291        default: return super.getProperty(hash, name, checkValid);
2292        }
2293
2294      }
2295
2296      @Override
2297      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2298        switch (hash) {
2299        case -1034364087: // number
2300          this.getNumber().add(TypeConvertor.castToUnsignedInt(value)); // UnsignedIntType
2301          return value;
2302        case 382350310: // classification
2303          this.classification = TypeConvertor.castToCoding(value); // Coding
2304          return value;
2305        case 50511102: // category
2306          this.getCategory().add(TypeConvertor.castToCoding(value)); // Coding
2307          return value;
2308        case 951543133: // control
2309          this.getControl().add(TypeConvertor.castToCoding(value)); // Coding
2310          return value;
2311        default: return super.setProperty(hash, name, value);
2312        }
2313
2314      }
2315
2316      @Override
2317      public Base setProperty(String name, Base value) throws FHIRException {
2318        if (name.equals("number")) {
2319          this.getNumber().add(TypeConvertor.castToUnsignedInt(value));
2320        } else if (name.equals("classification")) {
2321          this.classification = TypeConvertor.castToCoding(value); // Coding
2322        } else if (name.equals("category")) {
2323          this.getCategory().add(TypeConvertor.castToCoding(value));
2324        } else if (name.equals("control")) {
2325          this.getControl().add(TypeConvertor.castToCoding(value));
2326        } else
2327          return super.setProperty(name, value);
2328        return value;
2329      }
2330
2331      @Override
2332      public Base makeProperty(int hash, String name) throws FHIRException {
2333        switch (hash) {
2334        case -1034364087:  return addNumberElement();
2335        case 382350310:  return getClassification();
2336        case 50511102:  return addCategory(); 
2337        case 951543133:  return addControl(); 
2338        default: return super.makeProperty(hash, name);
2339        }
2340
2341      }
2342
2343      @Override
2344      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2345        switch (hash) {
2346        case -1034364087: /*number*/ return new String[] {"unsignedInt"};
2347        case 382350310: /*classification*/ return new String[] {"Coding"};
2348        case 50511102: /*category*/ return new String[] {"Coding"};
2349        case 951543133: /*control*/ return new String[] {"Coding"};
2350        default: return super.getTypesForProperty(hash, name);
2351        }
2352
2353      }
2354
2355      @Override
2356      public Base addChild(String name) throws FHIRException {
2357        if (name.equals("number")) {
2358          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.securityLabel.number");
2359        }
2360        else if (name.equals("classification")) {
2361          this.classification = new Coding();
2362          return this.classification;
2363        }
2364        else if (name.equals("category")) {
2365          return addCategory();
2366        }
2367        else if (name.equals("control")) {
2368          return addControl();
2369        }
2370        else
2371          return super.addChild(name);
2372      }
2373
2374      public SecurityLabelComponent copy() {
2375        SecurityLabelComponent dst = new SecurityLabelComponent();
2376        copyValues(dst);
2377        return dst;
2378      }
2379
2380      public void copyValues(SecurityLabelComponent dst) {
2381        super.copyValues(dst);
2382        if (number != null) {
2383          dst.number = new ArrayList<UnsignedIntType>();
2384          for (UnsignedIntType i : number)
2385            dst.number.add(i.copy());
2386        };
2387        dst.classification = classification == null ? null : classification.copy();
2388        if (category != null) {
2389          dst.category = new ArrayList<Coding>();
2390          for (Coding i : category)
2391            dst.category.add(i.copy());
2392        };
2393        if (control != null) {
2394          dst.control = new ArrayList<Coding>();
2395          for (Coding i : control)
2396            dst.control.add(i.copy());
2397        };
2398      }
2399
2400      @Override
2401      public boolean equalsDeep(Base other_) {
2402        if (!super.equalsDeep(other_))
2403          return false;
2404        if (!(other_ instanceof SecurityLabelComponent))
2405          return false;
2406        SecurityLabelComponent o = (SecurityLabelComponent) other_;
2407        return compareDeep(number, o.number, true) && compareDeep(classification, o.classification, true)
2408           && compareDeep(category, o.category, true) && compareDeep(control, o.control, true);
2409      }
2410
2411      @Override
2412      public boolean equalsShallow(Base other_) {
2413        if (!super.equalsShallow(other_))
2414          return false;
2415        if (!(other_ instanceof SecurityLabelComponent))
2416          return false;
2417        SecurityLabelComponent o = (SecurityLabelComponent) other_;
2418        return compareValues(number, o.number, true);
2419      }
2420
2421      public boolean isEmpty() {
2422        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(number, classification, category
2423          , control);
2424      }
2425
2426  public String fhirType() {
2427    return "Contract.term.securityLabel";
2428
2429  }
2430
2431  }
2432
2433    @Block()
2434    public static class ContractOfferComponent extends BackboneElement implements IBaseBackboneElement {
2435        /**
2436         * Unique identifier for this particular Contract Provision.
2437         */
2438        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2439        @Description(shortDefinition="Offer business ID", formalDefinition="Unique identifier for this particular Contract Provision." )
2440        protected List<Identifier> identifier;
2441
2442        /**
2443         * Offer Recipient.
2444         */
2445        @Child(name = "party", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2446        @Description(shortDefinition="Offer Recipient", formalDefinition="Offer Recipient." )
2447        protected List<ContractPartyComponent> party;
2448
2449        /**
2450         * The owner of an asset has the residual control rights over the asset: the right to decide all usages of the asset in any way not inconsistent with a prior contract, custom, or law (Hart, 1995, p. 30).
2451         */
2452        @Child(name = "topic", type = {Reference.class}, order=3, min=0, max=1, modifier=false, summary=true)
2453        @Description(shortDefinition="Negotiable offer asset", formalDefinition="The owner of an asset has the residual control rights over the asset: the right to decide all usages of the asset in any way not inconsistent with a prior contract, custom, or law (Hart, 1995, p. 30)." )
2454        protected Reference topic;
2455
2456        /**
2457         * Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.
2458         */
2459        @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
2460        @Description(shortDefinition="Contract Offer Type or Form", formalDefinition="Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit." )
2461        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-term-type")
2462        protected CodeableConcept type;
2463
2464        /**
2465         * Type of choice made by accepting party with respect to an offer made by an offeror/ grantee.
2466         */
2467        @Child(name = "decision", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false)
2468        @Description(shortDefinition="Accepting party choice", formalDefinition="Type of choice made by accepting party with respect to an offer made by an offeror/ grantee." )
2469        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-ActConsentDirective")
2470        protected CodeableConcept decision;
2471
2472        /**
2473         * How the decision about a Contract was conveyed.
2474         */
2475        @Child(name = "decisionMode", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2476        @Description(shortDefinition="How decision is conveyed", formalDefinition="How the decision about a Contract was conveyed." )
2477        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-decision-mode")
2478        protected List<CodeableConcept> decisionMode;
2479
2480        /**
2481         * Response to offer text.
2482         */
2483        @Child(name = "answer", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2484        @Description(shortDefinition="Response to offer text", formalDefinition="Response to offer text." )
2485        protected List<AnswerComponent> answer;
2486
2487        /**
2488         * Human readable form of this Contract Offer.
2489         */
2490        @Child(name = "text", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
2491        @Description(shortDefinition="Human readable offer text", formalDefinition="Human readable form of this Contract Offer." )
2492        protected StringType text;
2493
2494        /**
2495         * The id of the clause or question text of the offer in the referenced questionnaire/response.
2496         */
2497        @Child(name = "linkId", type = {StringType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2498        @Description(shortDefinition="Pointer to text", formalDefinition="The id of the clause or question text of the offer in the referenced questionnaire/response." )
2499        protected List<StringType> linkId;
2500
2501        /**
2502         * Security labels that protects the offer.
2503         */
2504        @Child(name = "securityLabelNumber", type = {UnsignedIntType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2505        @Description(shortDefinition="Offer restriction numbers", formalDefinition="Security labels that protects the offer." )
2506        protected List<UnsignedIntType> securityLabelNumber;
2507
2508        private static final long serialVersionUID = -852140711L;
2509
2510    /**
2511     * Constructor
2512     */
2513      public ContractOfferComponent() {
2514        super();
2515      }
2516
2517        /**
2518         * @return {@link #identifier} (Unique identifier for this particular Contract Provision.)
2519         */
2520        public List<Identifier> getIdentifier() { 
2521          if (this.identifier == null)
2522            this.identifier = new ArrayList<Identifier>();
2523          return this.identifier;
2524        }
2525
2526        /**
2527         * @return Returns a reference to <code>this</code> for easy method chaining
2528         */
2529        public ContractOfferComponent setIdentifier(List<Identifier> theIdentifier) { 
2530          this.identifier = theIdentifier;
2531          return this;
2532        }
2533
2534        public boolean hasIdentifier() { 
2535          if (this.identifier == null)
2536            return false;
2537          for (Identifier item : this.identifier)
2538            if (!item.isEmpty())
2539              return true;
2540          return false;
2541        }
2542
2543        public Identifier addIdentifier() { //3
2544          Identifier t = new Identifier();
2545          if (this.identifier == null)
2546            this.identifier = new ArrayList<Identifier>();
2547          this.identifier.add(t);
2548          return t;
2549        }
2550
2551        public ContractOfferComponent addIdentifier(Identifier t) { //3
2552          if (t == null)
2553            return this;
2554          if (this.identifier == null)
2555            this.identifier = new ArrayList<Identifier>();
2556          this.identifier.add(t);
2557          return this;
2558        }
2559
2560        /**
2561         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2562         */
2563        public Identifier getIdentifierFirstRep() { 
2564          if (getIdentifier().isEmpty()) {
2565            addIdentifier();
2566          }
2567          return getIdentifier().get(0);
2568        }
2569
2570        /**
2571         * @return {@link #party} (Offer Recipient.)
2572         */
2573        public List<ContractPartyComponent> getParty() { 
2574          if (this.party == null)
2575            this.party = new ArrayList<ContractPartyComponent>();
2576          return this.party;
2577        }
2578
2579        /**
2580         * @return Returns a reference to <code>this</code> for easy method chaining
2581         */
2582        public ContractOfferComponent setParty(List<ContractPartyComponent> theParty) { 
2583          this.party = theParty;
2584          return this;
2585        }
2586
2587        public boolean hasParty() { 
2588          if (this.party == null)
2589            return false;
2590          for (ContractPartyComponent item : this.party)
2591            if (!item.isEmpty())
2592              return true;
2593          return false;
2594        }
2595
2596        public ContractPartyComponent addParty() { //3
2597          ContractPartyComponent t = new ContractPartyComponent();
2598          if (this.party == null)
2599            this.party = new ArrayList<ContractPartyComponent>();
2600          this.party.add(t);
2601          return t;
2602        }
2603
2604        public ContractOfferComponent addParty(ContractPartyComponent t) { //3
2605          if (t == null)
2606            return this;
2607          if (this.party == null)
2608            this.party = new ArrayList<ContractPartyComponent>();
2609          this.party.add(t);
2610          return this;
2611        }
2612
2613        /**
2614         * @return The first repetition of repeating field {@link #party}, creating it if it does not already exist {3}
2615         */
2616        public ContractPartyComponent getPartyFirstRep() { 
2617          if (getParty().isEmpty()) {
2618            addParty();
2619          }
2620          return getParty().get(0);
2621        }
2622
2623        /**
2624         * @return {@link #topic} (The owner of an asset has the residual control rights over the asset: the right to decide all usages of the asset in any way not inconsistent with a prior contract, custom, or law (Hart, 1995, p. 30).)
2625         */
2626        public Reference getTopic() { 
2627          if (this.topic == null)
2628            if (Configuration.errorOnAutoCreate())
2629              throw new Error("Attempt to auto-create ContractOfferComponent.topic");
2630            else if (Configuration.doAutoCreate())
2631              this.topic = new Reference(); // cc
2632          return this.topic;
2633        }
2634
2635        public boolean hasTopic() { 
2636          return this.topic != null && !this.topic.isEmpty();
2637        }
2638
2639        /**
2640         * @param value {@link #topic} (The owner of an asset has the residual control rights over the asset: the right to decide all usages of the asset in any way not inconsistent with a prior contract, custom, or law (Hart, 1995, p. 30).)
2641         */
2642        public ContractOfferComponent setTopic(Reference value) { 
2643          this.topic = value;
2644          return this;
2645        }
2646
2647        /**
2648         * @return {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.)
2649         */
2650        public CodeableConcept getType() { 
2651          if (this.type == null)
2652            if (Configuration.errorOnAutoCreate())
2653              throw new Error("Attempt to auto-create ContractOfferComponent.type");
2654            else if (Configuration.doAutoCreate())
2655              this.type = new CodeableConcept(); // cc
2656          return this.type;
2657        }
2658
2659        public boolean hasType() { 
2660          return this.type != null && !this.type.isEmpty();
2661        }
2662
2663        /**
2664         * @param value {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.)
2665         */
2666        public ContractOfferComponent setType(CodeableConcept value) { 
2667          this.type = value;
2668          return this;
2669        }
2670
2671        /**
2672         * @return {@link #decision} (Type of choice made by accepting party with respect to an offer made by an offeror/ grantee.)
2673         */
2674        public CodeableConcept getDecision() { 
2675          if (this.decision == null)
2676            if (Configuration.errorOnAutoCreate())
2677              throw new Error("Attempt to auto-create ContractOfferComponent.decision");
2678            else if (Configuration.doAutoCreate())
2679              this.decision = new CodeableConcept(); // cc
2680          return this.decision;
2681        }
2682
2683        public boolean hasDecision() { 
2684          return this.decision != null && !this.decision.isEmpty();
2685        }
2686
2687        /**
2688         * @param value {@link #decision} (Type of choice made by accepting party with respect to an offer made by an offeror/ grantee.)
2689         */
2690        public ContractOfferComponent setDecision(CodeableConcept value) { 
2691          this.decision = value;
2692          return this;
2693        }
2694
2695        /**
2696         * @return {@link #decisionMode} (How the decision about a Contract was conveyed.)
2697         */
2698        public List<CodeableConcept> getDecisionMode() { 
2699          if (this.decisionMode == null)
2700            this.decisionMode = new ArrayList<CodeableConcept>();
2701          return this.decisionMode;
2702        }
2703
2704        /**
2705         * @return Returns a reference to <code>this</code> for easy method chaining
2706         */
2707        public ContractOfferComponent setDecisionMode(List<CodeableConcept> theDecisionMode) { 
2708          this.decisionMode = theDecisionMode;
2709          return this;
2710        }
2711
2712        public boolean hasDecisionMode() { 
2713          if (this.decisionMode == null)
2714            return false;
2715          for (CodeableConcept item : this.decisionMode)
2716            if (!item.isEmpty())
2717              return true;
2718          return false;
2719        }
2720
2721        public CodeableConcept addDecisionMode() { //3
2722          CodeableConcept t = new CodeableConcept();
2723          if (this.decisionMode == null)
2724            this.decisionMode = new ArrayList<CodeableConcept>();
2725          this.decisionMode.add(t);
2726          return t;
2727        }
2728
2729        public ContractOfferComponent addDecisionMode(CodeableConcept t) { //3
2730          if (t == null)
2731            return this;
2732          if (this.decisionMode == null)
2733            this.decisionMode = new ArrayList<CodeableConcept>();
2734          this.decisionMode.add(t);
2735          return this;
2736        }
2737
2738        /**
2739         * @return The first repetition of repeating field {@link #decisionMode}, creating it if it does not already exist {3}
2740         */
2741        public CodeableConcept getDecisionModeFirstRep() { 
2742          if (getDecisionMode().isEmpty()) {
2743            addDecisionMode();
2744          }
2745          return getDecisionMode().get(0);
2746        }
2747
2748        /**
2749         * @return {@link #answer} (Response to offer text.)
2750         */
2751        public List<AnswerComponent> getAnswer() { 
2752          if (this.answer == null)
2753            this.answer = new ArrayList<AnswerComponent>();
2754          return this.answer;
2755        }
2756
2757        /**
2758         * @return Returns a reference to <code>this</code> for easy method chaining
2759         */
2760        public ContractOfferComponent setAnswer(List<AnswerComponent> theAnswer) { 
2761          this.answer = theAnswer;
2762          return this;
2763        }
2764
2765        public boolean hasAnswer() { 
2766          if (this.answer == null)
2767            return false;
2768          for (AnswerComponent item : this.answer)
2769            if (!item.isEmpty())
2770              return true;
2771          return false;
2772        }
2773
2774        public AnswerComponent addAnswer() { //3
2775          AnswerComponent t = new AnswerComponent();
2776          if (this.answer == null)
2777            this.answer = new ArrayList<AnswerComponent>();
2778          this.answer.add(t);
2779          return t;
2780        }
2781
2782        public ContractOfferComponent addAnswer(AnswerComponent t) { //3
2783          if (t == null)
2784            return this;
2785          if (this.answer == null)
2786            this.answer = new ArrayList<AnswerComponent>();
2787          this.answer.add(t);
2788          return this;
2789        }
2790
2791        /**
2792         * @return The first repetition of repeating field {@link #answer}, creating it if it does not already exist {3}
2793         */
2794        public AnswerComponent getAnswerFirstRep() { 
2795          if (getAnswer().isEmpty()) {
2796            addAnswer();
2797          }
2798          return getAnswer().get(0);
2799        }
2800
2801        /**
2802         * @return {@link #text} (Human readable form of this Contract Offer.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
2803         */
2804        public StringType getTextElement() { 
2805          if (this.text == null)
2806            if (Configuration.errorOnAutoCreate())
2807              throw new Error("Attempt to auto-create ContractOfferComponent.text");
2808            else if (Configuration.doAutoCreate())
2809              this.text = new StringType(); // bb
2810          return this.text;
2811        }
2812
2813        public boolean hasTextElement() { 
2814          return this.text != null && !this.text.isEmpty();
2815        }
2816
2817        public boolean hasText() { 
2818          return this.text != null && !this.text.isEmpty();
2819        }
2820
2821        /**
2822         * @param value {@link #text} (Human readable form of this Contract Offer.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
2823         */
2824        public ContractOfferComponent setTextElement(StringType value) { 
2825          this.text = value;
2826          return this;
2827        }
2828
2829        /**
2830         * @return Human readable form of this Contract Offer.
2831         */
2832        public String getText() { 
2833          return this.text == null ? null : this.text.getValue();
2834        }
2835
2836        /**
2837         * @param value Human readable form of this Contract Offer.
2838         */
2839        public ContractOfferComponent setText(String value) { 
2840          if (Utilities.noString(value))
2841            this.text = null;
2842          else {
2843            if (this.text == null)
2844              this.text = new StringType();
2845            this.text.setValue(value);
2846          }
2847          return this;
2848        }
2849
2850        /**
2851         * @return {@link #linkId} (The id of the clause or question text of the offer in the referenced questionnaire/response.)
2852         */
2853        public List<StringType> getLinkId() { 
2854          if (this.linkId == null)
2855            this.linkId = new ArrayList<StringType>();
2856          return this.linkId;
2857        }
2858
2859        /**
2860         * @return Returns a reference to <code>this</code> for easy method chaining
2861         */
2862        public ContractOfferComponent setLinkId(List<StringType> theLinkId) { 
2863          this.linkId = theLinkId;
2864          return this;
2865        }
2866
2867        public boolean hasLinkId() { 
2868          if (this.linkId == null)
2869            return false;
2870          for (StringType item : this.linkId)
2871            if (!item.isEmpty())
2872              return true;
2873          return false;
2874        }
2875
2876        /**
2877         * @return {@link #linkId} (The id of the clause or question text of the offer in the referenced questionnaire/response.)
2878         */
2879        public StringType addLinkIdElement() {//2 
2880          StringType t = new StringType();
2881          if (this.linkId == null)
2882            this.linkId = new ArrayList<StringType>();
2883          this.linkId.add(t);
2884          return t;
2885        }
2886
2887        /**
2888         * @param value {@link #linkId} (The id of the clause or question text of the offer in the referenced questionnaire/response.)
2889         */
2890        public ContractOfferComponent addLinkId(String value) { //1
2891          StringType t = new StringType();
2892          t.setValue(value);
2893          if (this.linkId == null)
2894            this.linkId = new ArrayList<StringType>();
2895          this.linkId.add(t);
2896          return this;
2897        }
2898
2899        /**
2900         * @param value {@link #linkId} (The id of the clause or question text of the offer in the referenced questionnaire/response.)
2901         */
2902        public boolean hasLinkId(String value) { 
2903          if (this.linkId == null)
2904            return false;
2905          for (StringType v : this.linkId)
2906            if (v.getValue().equals(value)) // string
2907              return true;
2908          return false;
2909        }
2910
2911        /**
2912         * @return {@link #securityLabelNumber} (Security labels that protects the offer.)
2913         */
2914        public List<UnsignedIntType> getSecurityLabelNumber() { 
2915          if (this.securityLabelNumber == null)
2916            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
2917          return this.securityLabelNumber;
2918        }
2919
2920        /**
2921         * @return Returns a reference to <code>this</code> for easy method chaining
2922         */
2923        public ContractOfferComponent setSecurityLabelNumber(List<UnsignedIntType> theSecurityLabelNumber) { 
2924          this.securityLabelNumber = theSecurityLabelNumber;
2925          return this;
2926        }
2927
2928        public boolean hasSecurityLabelNumber() { 
2929          if (this.securityLabelNumber == null)
2930            return false;
2931          for (UnsignedIntType item : this.securityLabelNumber)
2932            if (!item.isEmpty())
2933              return true;
2934          return false;
2935        }
2936
2937        /**
2938         * @return {@link #securityLabelNumber} (Security labels that protects the offer.)
2939         */
2940        public UnsignedIntType addSecurityLabelNumberElement() {//2 
2941          UnsignedIntType t = new UnsignedIntType();
2942          if (this.securityLabelNumber == null)
2943            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
2944          this.securityLabelNumber.add(t);
2945          return t;
2946        }
2947
2948        /**
2949         * @param value {@link #securityLabelNumber} (Security labels that protects the offer.)
2950         */
2951        public ContractOfferComponent addSecurityLabelNumber(int value) { //1
2952          UnsignedIntType t = new UnsignedIntType();
2953          t.setValue(value);
2954          if (this.securityLabelNumber == null)
2955            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
2956          this.securityLabelNumber.add(t);
2957          return this;
2958        }
2959
2960        /**
2961         * @param value {@link #securityLabelNumber} (Security labels that protects the offer.)
2962         */
2963        public boolean hasSecurityLabelNumber(int value) { 
2964          if (this.securityLabelNumber == null)
2965            return false;
2966          for (UnsignedIntType v : this.securityLabelNumber)
2967            if (v.getValue().equals(value)) // unsignedInt
2968              return true;
2969          return false;
2970        }
2971
2972        protected void listChildren(List<Property> children) {
2973          super.listChildren(children);
2974          children.add(new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, java.lang.Integer.MAX_VALUE, identifier));
2975          children.add(new Property("party", "", "Offer Recipient.", 0, java.lang.Integer.MAX_VALUE, party));
2976          children.add(new Property("topic", "Reference(Any)", "The owner of an asset has the residual control rights over the asset: the right to decide all usages of the asset in any way not inconsistent with a prior contract, custom, or law (Hart, 1995, p. 30).", 0, 1, topic));
2977          children.add(new Property("type", "CodeableConcept", "Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.", 0, 1, type));
2978          children.add(new Property("decision", "CodeableConcept", "Type of choice made by accepting party with respect to an offer made by an offeror/ grantee.", 0, 1, decision));
2979          children.add(new Property("decisionMode", "CodeableConcept", "How the decision about a Contract was conveyed.", 0, java.lang.Integer.MAX_VALUE, decisionMode));
2980          children.add(new Property("answer", "", "Response to offer text.", 0, java.lang.Integer.MAX_VALUE, answer));
2981          children.add(new Property("text", "string", "Human readable form of this Contract Offer.", 0, 1, text));
2982          children.add(new Property("linkId", "string", "The id of the clause or question text of the offer in the referenced questionnaire/response.", 0, java.lang.Integer.MAX_VALUE, linkId));
2983          children.add(new Property("securityLabelNumber", "unsignedInt", "Security labels that protects the offer.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber));
2984        }
2985
2986        @Override
2987        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2988          switch (_hash) {
2989          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, java.lang.Integer.MAX_VALUE, identifier);
2990          case 106437350: /*party*/  return new Property("party", "", "Offer Recipient.", 0, java.lang.Integer.MAX_VALUE, party);
2991          case 110546223: /*topic*/  return new Property("topic", "Reference(Any)", "The owner of an asset has the residual control rights over the asset: the right to decide all usages of the asset in any way not inconsistent with a prior contract, custom, or law (Hart, 1995, p. 30).", 0, 1, topic);
2992          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.", 0, 1, type);
2993          case 565719004: /*decision*/  return new Property("decision", "CodeableConcept", "Type of choice made by accepting party with respect to an offer made by an offeror/ grantee.", 0, 1, decision);
2994          case 675909535: /*decisionMode*/  return new Property("decisionMode", "CodeableConcept", "How the decision about a Contract was conveyed.", 0, java.lang.Integer.MAX_VALUE, decisionMode);
2995          case -1412808770: /*answer*/  return new Property("answer", "", "Response to offer text.", 0, java.lang.Integer.MAX_VALUE, answer);
2996          case 3556653: /*text*/  return new Property("text", "string", "Human readable form of this Contract Offer.", 0, 1, text);
2997          case -1102667083: /*linkId*/  return new Property("linkId", "string", "The id of the clause or question text of the offer in the referenced questionnaire/response.", 0, java.lang.Integer.MAX_VALUE, linkId);
2998          case -149460995: /*securityLabelNumber*/  return new Property("securityLabelNumber", "unsignedInt", "Security labels that protects the offer.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber);
2999          default: return super.getNamedProperty(_hash, _name, _checkValid);
3000          }
3001
3002        }
3003
3004      @Override
3005      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3006        switch (hash) {
3007        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3008        case 106437350: /*party*/ return this.party == null ? new Base[0] : this.party.toArray(new Base[this.party.size()]); // ContractPartyComponent
3009        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : new Base[] {this.topic}; // Reference
3010        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3011        case 565719004: /*decision*/ return this.decision == null ? new Base[0] : new Base[] {this.decision}; // CodeableConcept
3012        case 675909535: /*decisionMode*/ return this.decisionMode == null ? new Base[0] : this.decisionMode.toArray(new Base[this.decisionMode.size()]); // CodeableConcept
3013        case -1412808770: /*answer*/ return this.answer == null ? new Base[0] : this.answer.toArray(new Base[this.answer.size()]); // AnswerComponent
3014        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
3015        case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : this.linkId.toArray(new Base[this.linkId.size()]); // StringType
3016        case -149460995: /*securityLabelNumber*/ return this.securityLabelNumber == null ? new Base[0] : this.securityLabelNumber.toArray(new Base[this.securityLabelNumber.size()]); // UnsignedIntType
3017        default: return super.getProperty(hash, name, checkValid);
3018        }
3019
3020      }
3021
3022      @Override
3023      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3024        switch (hash) {
3025        case -1618432855: // identifier
3026          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
3027          return value;
3028        case 106437350: // party
3029          this.getParty().add((ContractPartyComponent) value); // ContractPartyComponent
3030          return value;
3031        case 110546223: // topic
3032          this.topic = TypeConvertor.castToReference(value); // Reference
3033          return value;
3034        case 3575610: // type
3035          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3036          return value;
3037        case 565719004: // decision
3038          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3039          return value;
3040        case 675909535: // decisionMode
3041          this.getDecisionMode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3042          return value;
3043        case -1412808770: // answer
3044          this.getAnswer().add((AnswerComponent) value); // AnswerComponent
3045          return value;
3046        case 3556653: // text
3047          this.text = TypeConvertor.castToString(value); // StringType
3048          return value;
3049        case -1102667083: // linkId
3050          this.getLinkId().add(TypeConvertor.castToString(value)); // StringType
3051          return value;
3052        case -149460995: // securityLabelNumber
3053          this.getSecurityLabelNumber().add(TypeConvertor.castToUnsignedInt(value)); // UnsignedIntType
3054          return value;
3055        default: return super.setProperty(hash, name, value);
3056        }
3057
3058      }
3059
3060      @Override
3061      public Base setProperty(String name, Base value) throws FHIRException {
3062        if (name.equals("identifier")) {
3063          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
3064        } else if (name.equals("party")) {
3065          this.getParty().add((ContractPartyComponent) value);
3066        } else if (name.equals("topic")) {
3067          this.topic = TypeConvertor.castToReference(value); // Reference
3068        } else if (name.equals("type")) {
3069          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3070        } else if (name.equals("decision")) {
3071          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3072        } else if (name.equals("decisionMode")) {
3073          this.getDecisionMode().add(TypeConvertor.castToCodeableConcept(value));
3074        } else if (name.equals("answer")) {
3075          this.getAnswer().add((AnswerComponent) value);
3076        } else if (name.equals("text")) {
3077          this.text = TypeConvertor.castToString(value); // StringType
3078        } else if (name.equals("linkId")) {
3079          this.getLinkId().add(TypeConvertor.castToString(value));
3080        } else if (name.equals("securityLabelNumber")) {
3081          this.getSecurityLabelNumber().add(TypeConvertor.castToUnsignedInt(value));
3082        } else
3083          return super.setProperty(name, value);
3084        return value;
3085      }
3086
3087      @Override
3088      public Base makeProperty(int hash, String name) throws FHIRException {
3089        switch (hash) {
3090        case -1618432855:  return addIdentifier(); 
3091        case 106437350:  return addParty(); 
3092        case 110546223:  return getTopic();
3093        case 3575610:  return getType();
3094        case 565719004:  return getDecision();
3095        case 675909535:  return addDecisionMode(); 
3096        case -1412808770:  return addAnswer(); 
3097        case 3556653:  return getTextElement();
3098        case -1102667083:  return addLinkIdElement();
3099        case -149460995:  return addSecurityLabelNumberElement();
3100        default: return super.makeProperty(hash, name);
3101        }
3102
3103      }
3104
3105      @Override
3106      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3107        switch (hash) {
3108        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3109        case 106437350: /*party*/ return new String[] {};
3110        case 110546223: /*topic*/ return new String[] {"Reference"};
3111        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3112        case 565719004: /*decision*/ return new String[] {"CodeableConcept"};
3113        case 675909535: /*decisionMode*/ return new String[] {"CodeableConcept"};
3114        case -1412808770: /*answer*/ return new String[] {};
3115        case 3556653: /*text*/ return new String[] {"string"};
3116        case -1102667083: /*linkId*/ return new String[] {"string"};
3117        case -149460995: /*securityLabelNumber*/ return new String[] {"unsignedInt"};
3118        default: return super.getTypesForProperty(hash, name);
3119        }
3120
3121      }
3122
3123      @Override
3124      public Base addChild(String name) throws FHIRException {
3125        if (name.equals("identifier")) {
3126          return addIdentifier();
3127        }
3128        else if (name.equals("party")) {
3129          return addParty();
3130        }
3131        else if (name.equals("topic")) {
3132          this.topic = new Reference();
3133          return this.topic;
3134        }
3135        else if (name.equals("type")) {
3136          this.type = new CodeableConcept();
3137          return this.type;
3138        }
3139        else if (name.equals("decision")) {
3140          this.decision = new CodeableConcept();
3141          return this.decision;
3142        }
3143        else if (name.equals("decisionMode")) {
3144          return addDecisionMode();
3145        }
3146        else if (name.equals("answer")) {
3147          return addAnswer();
3148        }
3149        else if (name.equals("text")) {
3150          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.offer.text");
3151        }
3152        else if (name.equals("linkId")) {
3153          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.offer.linkId");
3154        }
3155        else if (name.equals("securityLabelNumber")) {
3156          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.offer.securityLabelNumber");
3157        }
3158        else
3159          return super.addChild(name);
3160      }
3161
3162      public ContractOfferComponent copy() {
3163        ContractOfferComponent dst = new ContractOfferComponent();
3164        copyValues(dst);
3165        return dst;
3166      }
3167
3168      public void copyValues(ContractOfferComponent dst) {
3169        super.copyValues(dst);
3170        if (identifier != null) {
3171          dst.identifier = new ArrayList<Identifier>();
3172          for (Identifier i : identifier)
3173            dst.identifier.add(i.copy());
3174        };
3175        if (party != null) {
3176          dst.party = new ArrayList<ContractPartyComponent>();
3177          for (ContractPartyComponent i : party)
3178            dst.party.add(i.copy());
3179        };
3180        dst.topic = topic == null ? null : topic.copy();
3181        dst.type = type == null ? null : type.copy();
3182        dst.decision = decision == null ? null : decision.copy();
3183        if (decisionMode != null) {
3184          dst.decisionMode = new ArrayList<CodeableConcept>();
3185          for (CodeableConcept i : decisionMode)
3186            dst.decisionMode.add(i.copy());
3187        };
3188        if (answer != null) {
3189          dst.answer = new ArrayList<AnswerComponent>();
3190          for (AnswerComponent i : answer)
3191            dst.answer.add(i.copy());
3192        };
3193        dst.text = text == null ? null : text.copy();
3194        if (linkId != null) {
3195          dst.linkId = new ArrayList<StringType>();
3196          for (StringType i : linkId)
3197            dst.linkId.add(i.copy());
3198        };
3199        if (securityLabelNumber != null) {
3200          dst.securityLabelNumber = new ArrayList<UnsignedIntType>();
3201          for (UnsignedIntType i : securityLabelNumber)
3202            dst.securityLabelNumber.add(i.copy());
3203        };
3204      }
3205
3206      @Override
3207      public boolean equalsDeep(Base other_) {
3208        if (!super.equalsDeep(other_))
3209          return false;
3210        if (!(other_ instanceof ContractOfferComponent))
3211          return false;
3212        ContractOfferComponent o = (ContractOfferComponent) other_;
3213        return compareDeep(identifier, o.identifier, true) && compareDeep(party, o.party, true) && compareDeep(topic, o.topic, true)
3214           && compareDeep(type, o.type, true) && compareDeep(decision, o.decision, true) && compareDeep(decisionMode, o.decisionMode, true)
3215           && compareDeep(answer, o.answer, true) && compareDeep(text, o.text, true) && compareDeep(linkId, o.linkId, true)
3216           && compareDeep(securityLabelNumber, o.securityLabelNumber, true);
3217      }
3218
3219      @Override
3220      public boolean equalsShallow(Base other_) {
3221        if (!super.equalsShallow(other_))
3222          return false;
3223        if (!(other_ instanceof ContractOfferComponent))
3224          return false;
3225        ContractOfferComponent o = (ContractOfferComponent) other_;
3226        return compareValues(text, o.text, true) && compareValues(linkId, o.linkId, true) && compareValues(securityLabelNumber, o.securityLabelNumber, true)
3227          ;
3228      }
3229
3230      public boolean isEmpty() {
3231        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, party, topic
3232          , type, decision, decisionMode, answer, text, linkId, securityLabelNumber);
3233      }
3234
3235  public String fhirType() {
3236    return "Contract.term.offer";
3237
3238  }
3239
3240  }
3241
3242    @Block()
3243    public static class ContractPartyComponent extends BackboneElement implements IBaseBackboneElement {
3244        /**
3245         * Participant in the offer.
3246         */
3247        @Child(name = "reference", type = {Patient.class, RelatedPerson.class, Practitioner.class, PractitionerRole.class, Device.class, Group.class, Organization.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3248        @Description(shortDefinition="Referenced entity", formalDefinition="Participant in the offer." )
3249        protected List<Reference> reference;
3250
3251        /**
3252         * How the party participates in the offer.
3253         */
3254        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false)
3255        @Description(shortDefinition="Participant engagement type", formalDefinition="How the party participates in the offer." )
3256        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-party-role")
3257        protected CodeableConcept role;
3258
3259        private static final long serialVersionUID = -1599592477L;
3260
3261    /**
3262     * Constructor
3263     */
3264      public ContractPartyComponent() {
3265        super();
3266      }
3267
3268    /**
3269     * Constructor
3270     */
3271      public ContractPartyComponent(Reference reference, CodeableConcept role) {
3272        super();
3273        this.addReference(reference);
3274        this.setRole(role);
3275      }
3276
3277        /**
3278         * @return {@link #reference} (Participant in the offer.)
3279         */
3280        public List<Reference> getReference() { 
3281          if (this.reference == null)
3282            this.reference = new ArrayList<Reference>();
3283          return this.reference;
3284        }
3285
3286        /**
3287         * @return Returns a reference to <code>this</code> for easy method chaining
3288         */
3289        public ContractPartyComponent setReference(List<Reference> theReference) { 
3290          this.reference = theReference;
3291          return this;
3292        }
3293
3294        public boolean hasReference() { 
3295          if (this.reference == null)
3296            return false;
3297          for (Reference item : this.reference)
3298            if (!item.isEmpty())
3299              return true;
3300          return false;
3301        }
3302
3303        public Reference addReference() { //3
3304          Reference t = new Reference();
3305          if (this.reference == null)
3306            this.reference = new ArrayList<Reference>();
3307          this.reference.add(t);
3308          return t;
3309        }
3310
3311        public ContractPartyComponent addReference(Reference t) { //3
3312          if (t == null)
3313            return this;
3314          if (this.reference == null)
3315            this.reference = new ArrayList<Reference>();
3316          this.reference.add(t);
3317          return this;
3318        }
3319
3320        /**
3321         * @return The first repetition of repeating field {@link #reference}, creating it if it does not already exist {3}
3322         */
3323        public Reference getReferenceFirstRep() { 
3324          if (getReference().isEmpty()) {
3325            addReference();
3326          }
3327          return getReference().get(0);
3328        }
3329
3330        /**
3331         * @return {@link #role} (How the party participates in the offer.)
3332         */
3333        public CodeableConcept getRole() { 
3334          if (this.role == null)
3335            if (Configuration.errorOnAutoCreate())
3336              throw new Error("Attempt to auto-create ContractPartyComponent.role");
3337            else if (Configuration.doAutoCreate())
3338              this.role = new CodeableConcept(); // cc
3339          return this.role;
3340        }
3341
3342        public boolean hasRole() { 
3343          return this.role != null && !this.role.isEmpty();
3344        }
3345
3346        /**
3347         * @param value {@link #role} (How the party participates in the offer.)
3348         */
3349        public ContractPartyComponent setRole(CodeableConcept value) { 
3350          this.role = value;
3351          return this;
3352        }
3353
3354        protected void listChildren(List<Property> children) {
3355          super.listChildren(children);
3356          children.add(new Property("reference", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Device|Group|Organization)", "Participant in the offer.", 0, java.lang.Integer.MAX_VALUE, reference));
3357          children.add(new Property("role", "CodeableConcept", "How the party participates in the offer.", 0, 1, role));
3358        }
3359
3360        @Override
3361        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3362          switch (_hash) {
3363          case -925155509: /*reference*/  return new Property("reference", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Device|Group|Organization)", "Participant in the offer.", 0, java.lang.Integer.MAX_VALUE, reference);
3364          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "How the party participates in the offer.", 0, 1, role);
3365          default: return super.getNamedProperty(_hash, _name, _checkValid);
3366          }
3367
3368        }
3369
3370      @Override
3371      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3372        switch (hash) {
3373        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : this.reference.toArray(new Base[this.reference.size()]); // Reference
3374        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
3375        default: return super.getProperty(hash, name, checkValid);
3376        }
3377
3378      }
3379
3380      @Override
3381      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3382        switch (hash) {
3383        case -925155509: // reference
3384          this.getReference().add(TypeConvertor.castToReference(value)); // Reference
3385          return value;
3386        case 3506294: // role
3387          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3388          return value;
3389        default: return super.setProperty(hash, name, value);
3390        }
3391
3392      }
3393
3394      @Override
3395      public Base setProperty(String name, Base value) throws FHIRException {
3396        if (name.equals("reference")) {
3397          this.getReference().add(TypeConvertor.castToReference(value));
3398        } else if (name.equals("role")) {
3399          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3400        } else
3401          return super.setProperty(name, value);
3402        return value;
3403      }
3404
3405      @Override
3406      public Base makeProperty(int hash, String name) throws FHIRException {
3407        switch (hash) {
3408        case -925155509:  return addReference(); 
3409        case 3506294:  return getRole();
3410        default: return super.makeProperty(hash, name);
3411        }
3412
3413      }
3414
3415      @Override
3416      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3417        switch (hash) {
3418        case -925155509: /*reference*/ return new String[] {"Reference"};
3419        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
3420        default: return super.getTypesForProperty(hash, name);
3421        }
3422
3423      }
3424
3425      @Override
3426      public Base addChild(String name) throws FHIRException {
3427        if (name.equals("reference")) {
3428          return addReference();
3429        }
3430        else if (name.equals("role")) {
3431          this.role = new CodeableConcept();
3432          return this.role;
3433        }
3434        else
3435          return super.addChild(name);
3436      }
3437
3438      public ContractPartyComponent copy() {
3439        ContractPartyComponent dst = new ContractPartyComponent();
3440        copyValues(dst);
3441        return dst;
3442      }
3443
3444      public void copyValues(ContractPartyComponent dst) {
3445        super.copyValues(dst);
3446        if (reference != null) {
3447          dst.reference = new ArrayList<Reference>();
3448          for (Reference i : reference)
3449            dst.reference.add(i.copy());
3450        };
3451        dst.role = role == null ? null : role.copy();
3452      }
3453
3454      @Override
3455      public boolean equalsDeep(Base other_) {
3456        if (!super.equalsDeep(other_))
3457          return false;
3458        if (!(other_ instanceof ContractPartyComponent))
3459          return false;
3460        ContractPartyComponent o = (ContractPartyComponent) other_;
3461        return compareDeep(reference, o.reference, true) && compareDeep(role, o.role, true);
3462      }
3463
3464      @Override
3465      public boolean equalsShallow(Base other_) {
3466        if (!super.equalsShallow(other_))
3467          return false;
3468        if (!(other_ instanceof ContractPartyComponent))
3469          return false;
3470        ContractPartyComponent o = (ContractPartyComponent) other_;
3471        return true;
3472      }
3473
3474      public boolean isEmpty() {
3475        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(reference, role);
3476      }
3477
3478  public String fhirType() {
3479    return "Contract.term.offer.party";
3480
3481  }
3482
3483  }
3484
3485    @Block()
3486    public static class AnswerComponent extends BackboneElement implements IBaseBackboneElement {
3487        /**
3488         * Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.
3489         */
3490        @Child(name = "value", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class, Reference.class}, order=1, min=1, max=1, modifier=false, summary=false)
3491        @Description(shortDefinition="The actual answer response", formalDefinition="Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research." )
3492        protected DataType value;
3493
3494        private static final long serialVersionUID = -1135414639L;
3495
3496    /**
3497     * Constructor
3498     */
3499      public AnswerComponent() {
3500        super();
3501      }
3502
3503    /**
3504     * Constructor
3505     */
3506      public AnswerComponent(DataType value) {
3507        super();
3508        this.setValue(value);
3509      }
3510
3511        /**
3512         * @return {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3513         */
3514        public DataType getValue() { 
3515          return this.value;
3516        }
3517
3518        /**
3519         * @return {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3520         */
3521        public BooleanType getValueBooleanType() throws FHIRException { 
3522          if (this.value == null)
3523            this.value = new BooleanType();
3524          if (!(this.value instanceof BooleanType))
3525            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
3526          return (BooleanType) this.value;
3527        }
3528
3529        public boolean hasValueBooleanType() { 
3530          return this != null && this.value instanceof BooleanType;
3531        }
3532
3533        /**
3534         * @return {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3535         */
3536        public DecimalType getValueDecimalType() throws FHIRException { 
3537          if (this.value == null)
3538            this.value = new DecimalType();
3539          if (!(this.value instanceof DecimalType))
3540            throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered");
3541          return (DecimalType) this.value;
3542        }
3543
3544        public boolean hasValueDecimalType() { 
3545          return this != null && this.value instanceof DecimalType;
3546        }
3547
3548        /**
3549         * @return {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3550         */
3551        public IntegerType getValueIntegerType() throws FHIRException { 
3552          if (this.value == null)
3553            this.value = new IntegerType();
3554          if (!(this.value instanceof IntegerType))
3555            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
3556          return (IntegerType) this.value;
3557        }
3558
3559        public boolean hasValueIntegerType() { 
3560          return this != null && this.value instanceof IntegerType;
3561        }
3562
3563        /**
3564         * @return {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3565         */
3566        public DateType getValueDateType() throws FHIRException { 
3567          if (this.value == null)
3568            this.value = new DateType();
3569          if (!(this.value instanceof DateType))
3570            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered");
3571          return (DateType) this.value;
3572        }
3573
3574        public boolean hasValueDateType() { 
3575          return this != null && this.value instanceof DateType;
3576        }
3577
3578        /**
3579         * @return {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3580         */
3581        public DateTimeType getValueDateTimeType() throws FHIRException { 
3582          if (this.value == null)
3583            this.value = new DateTimeType();
3584          if (!(this.value instanceof DateTimeType))
3585            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered");
3586          return (DateTimeType) this.value;
3587        }
3588
3589        public boolean hasValueDateTimeType() { 
3590          return this != null && this.value instanceof DateTimeType;
3591        }
3592
3593        /**
3594         * @return {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3595         */
3596        public TimeType getValueTimeType() throws FHIRException { 
3597          if (this.value == null)
3598            this.value = new TimeType();
3599          if (!(this.value instanceof TimeType))
3600            throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered");
3601          return (TimeType) this.value;
3602        }
3603
3604        public boolean hasValueTimeType() { 
3605          return this != null && this.value instanceof TimeType;
3606        }
3607
3608        /**
3609         * @return {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3610         */
3611        public StringType getValueStringType() throws FHIRException { 
3612          if (this.value == null)
3613            this.value = new StringType();
3614          if (!(this.value instanceof StringType))
3615            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
3616          return (StringType) this.value;
3617        }
3618
3619        public boolean hasValueStringType() { 
3620          return this != null && this.value instanceof StringType;
3621        }
3622
3623        /**
3624         * @return {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3625         */
3626        public UriType getValueUriType() throws FHIRException { 
3627          if (this.value == null)
3628            this.value = new UriType();
3629          if (!(this.value instanceof UriType))
3630            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered");
3631          return (UriType) this.value;
3632        }
3633
3634        public boolean hasValueUriType() { 
3635          return this != null && this.value instanceof UriType;
3636        }
3637
3638        /**
3639         * @return {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3640         */
3641        public Attachment getValueAttachment() throws FHIRException { 
3642          if (this.value == null)
3643            this.value = new Attachment();
3644          if (!(this.value instanceof Attachment))
3645            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
3646          return (Attachment) this.value;
3647        }
3648
3649        public boolean hasValueAttachment() { 
3650          return this != null && this.value instanceof Attachment;
3651        }
3652
3653        /**
3654         * @return {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3655         */
3656        public Coding getValueCoding() throws FHIRException { 
3657          if (this.value == null)
3658            this.value = new Coding();
3659          if (!(this.value instanceof Coding))
3660            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered");
3661          return (Coding) this.value;
3662        }
3663
3664        public boolean hasValueCoding() { 
3665          return this != null && this.value instanceof Coding;
3666        }
3667
3668        /**
3669         * @return {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3670         */
3671        public Quantity getValueQuantity() throws FHIRException { 
3672          if (this.value == null)
3673            this.value = new Quantity();
3674          if (!(this.value instanceof Quantity))
3675            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
3676          return (Quantity) this.value;
3677        }
3678
3679        public boolean hasValueQuantity() { 
3680          return this != null && this.value instanceof Quantity;
3681        }
3682
3683        /**
3684         * @return {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3685         */
3686        public Reference getValueReference() throws FHIRException { 
3687          if (this.value == null)
3688            this.value = new Reference();
3689          if (!(this.value instanceof Reference))
3690            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered");
3691          return (Reference) this.value;
3692        }
3693
3694        public boolean hasValueReference() { 
3695          return this != null && this.value instanceof Reference;
3696        }
3697
3698        public boolean hasValue() { 
3699          return this.value != null && !this.value.isEmpty();
3700        }
3701
3702        /**
3703         * @param value {@link #value} (Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.)
3704         */
3705        public AnswerComponent setValue(DataType value) { 
3706          if (value != null && !(value instanceof BooleanType || value instanceof DecimalType || value instanceof IntegerType || value instanceof DateType || value instanceof DateTimeType || value instanceof TimeType || value instanceof StringType || value instanceof UriType || value instanceof Attachment || value instanceof Coding || value instanceof Quantity || value instanceof Reference))
3707            throw new Error("Not the right type for Contract.term.offer.answer.value[x]: "+value.fhirType());
3708          this.value = value;
3709          return this;
3710        }
3711
3712        protected void listChildren(List<Property> children) {
3713          super.listChildren(children);
3714          children.add(new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value));
3715        }
3716
3717        @Override
3718        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3719          switch (_hash) {
3720          case -1410166417: /*value[x]*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3721          case 111972721: /*value*/  return new Property("value[x]", "boolean|decimal|integer|date|dateTime|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3722          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3723          case -2083993440: /*valueDecimal*/  return new Property("value[x]", "decimal", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3724          case -1668204915: /*valueInteger*/  return new Property("value[x]", "integer", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3725          case -766192449: /*valueDate*/  return new Property("value[x]", "date", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3726          case 1047929900: /*valueDateTime*/  return new Property("value[x]", "dateTime", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3727          case -765708322: /*valueTime*/  return new Property("value[x]", "time", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3728          case -1424603934: /*valueString*/  return new Property("value[x]", "string", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3729          case -1410172357: /*valueUri*/  return new Property("value[x]", "uri", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3730          case -475566732: /*valueAttachment*/  return new Property("value[x]", "Attachment", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3731          case -1887705029: /*valueCoding*/  return new Property("value[x]", "Coding", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3732          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3733          case 1755241690: /*valueReference*/  return new Property("value[x]", "Reference(Any)", "Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.", 0, 1, value);
3734          default: return super.getNamedProperty(_hash, _name, _checkValid);
3735          }
3736
3737        }
3738
3739      @Override
3740      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3741        switch (hash) {
3742        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
3743        default: return super.getProperty(hash, name, checkValid);
3744        }
3745
3746      }
3747
3748      @Override
3749      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3750        switch (hash) {
3751        case 111972721: // value
3752          this.value = TypeConvertor.castToType(value); // DataType
3753          return value;
3754        default: return super.setProperty(hash, name, value);
3755        }
3756
3757      }
3758
3759      @Override
3760      public Base setProperty(String name, Base value) throws FHIRException {
3761        if (name.equals("value[x]")) {
3762          this.value = TypeConvertor.castToType(value); // DataType
3763        } else
3764          return super.setProperty(name, value);
3765        return value;
3766      }
3767
3768      @Override
3769      public Base makeProperty(int hash, String name) throws FHIRException {
3770        switch (hash) {
3771        case -1410166417:  return getValue();
3772        case 111972721:  return getValue();
3773        default: return super.makeProperty(hash, name);
3774        }
3775
3776      }
3777
3778      @Override
3779      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3780        switch (hash) {
3781        case 111972721: /*value*/ return new String[] {"boolean", "decimal", "integer", "date", "dateTime", "time", "string", "uri", "Attachment", "Coding", "Quantity", "Reference"};
3782        default: return super.getTypesForProperty(hash, name);
3783        }
3784
3785      }
3786
3787      @Override
3788      public Base addChild(String name) throws FHIRException {
3789        if (name.equals("valueBoolean")) {
3790          this.value = new BooleanType();
3791          return this.value;
3792        }
3793        else if (name.equals("valueDecimal")) {
3794          this.value = new DecimalType();
3795          return this.value;
3796        }
3797        else if (name.equals("valueInteger")) {
3798          this.value = new IntegerType();
3799          return this.value;
3800        }
3801        else if (name.equals("valueDate")) {
3802          this.value = new DateType();
3803          return this.value;
3804        }
3805        else if (name.equals("valueDateTime")) {
3806          this.value = new DateTimeType();
3807          return this.value;
3808        }
3809        else if (name.equals("valueTime")) {
3810          this.value = new TimeType();
3811          return this.value;
3812        }
3813        else if (name.equals("valueString")) {
3814          this.value = new StringType();
3815          return this.value;
3816        }
3817        else if (name.equals("valueUri")) {
3818          this.value = new UriType();
3819          return this.value;
3820        }
3821        else if (name.equals("valueAttachment")) {
3822          this.value = new Attachment();
3823          return this.value;
3824        }
3825        else if (name.equals("valueCoding")) {
3826          this.value = new Coding();
3827          return this.value;
3828        }
3829        else if (name.equals("valueQuantity")) {
3830          this.value = new Quantity();
3831          return this.value;
3832        }
3833        else if (name.equals("valueReference")) {
3834          this.value = new Reference();
3835          return this.value;
3836        }
3837        else
3838          return super.addChild(name);
3839      }
3840
3841      public AnswerComponent copy() {
3842        AnswerComponent dst = new AnswerComponent();
3843        copyValues(dst);
3844        return dst;
3845      }
3846
3847      public void copyValues(AnswerComponent dst) {
3848        super.copyValues(dst);
3849        dst.value = value == null ? null : value.copy();
3850      }
3851
3852      @Override
3853      public boolean equalsDeep(Base other_) {
3854        if (!super.equalsDeep(other_))
3855          return false;
3856        if (!(other_ instanceof AnswerComponent))
3857          return false;
3858        AnswerComponent o = (AnswerComponent) other_;
3859        return compareDeep(value, o.value, true);
3860      }
3861
3862      @Override
3863      public boolean equalsShallow(Base other_) {
3864        if (!super.equalsShallow(other_))
3865          return false;
3866        if (!(other_ instanceof AnswerComponent))
3867          return false;
3868        AnswerComponent o = (AnswerComponent) other_;
3869        return true;
3870      }
3871
3872      public boolean isEmpty() {
3873        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value);
3874      }
3875
3876  public String fhirType() {
3877    return "Contract.term.offer.answer";
3878
3879  }
3880
3881  }
3882
3883    @Block()
3884    public static class ContractAssetComponent extends BackboneElement implements IBaseBackboneElement {
3885        /**
3886         * Differentiates the kind of the asset .
3887         */
3888        @Child(name = "scope", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
3889        @Description(shortDefinition="Range of asset", formalDefinition="Differentiates the kind of the asset ." )
3890        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-assetscope")
3891        protected CodeableConcept scope;
3892
3893        /**
3894         * Target entity type about which the term may be concerned.
3895         */
3896        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3897        @Description(shortDefinition="Asset category", formalDefinition="Target entity type about which the term may be concerned." )
3898        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-assettype")
3899        protected List<CodeableConcept> type;
3900
3901        /**
3902         * Associated entities.
3903         */
3904        @Child(name = "typeReference", type = {Reference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3905        @Description(shortDefinition="Associated entities", formalDefinition="Associated entities." )
3906        protected List<Reference> typeReference;
3907
3908        /**
3909         * May be a subtype or part of an offered asset.
3910         */
3911        @Child(name = "subtype", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3912        @Description(shortDefinition="Asset sub-category", formalDefinition="May be a subtype or part of an offered asset." )
3913        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-assetsubtype")
3914        protected List<CodeableConcept> subtype;
3915
3916        /**
3917         * Specifies the applicability of the term to an asset resource instance, and instances it refers to orinstances that refer to it, and/or are owned by the offeree.
3918         */
3919        @Child(name = "relationship", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false)
3920        @Description(shortDefinition="Kinship of the asset", formalDefinition="Specifies the applicability of the term to an asset resource instance, and instances it refers to orinstances that refer to it, and/or are owned by the offeree." )
3921        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-content-class")
3922        protected Coding relationship;
3923
3924        /**
3925         * Circumstance of the asset.
3926         */
3927        @Child(name = "context", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3928        @Description(shortDefinition="Circumstance of the asset", formalDefinition="Circumstance of the asset." )
3929        protected List<AssetContextComponent> context;
3930
3931        /**
3932         * Description of the quality and completeness of the asset that imay be a factor in its valuation.
3933         */
3934        @Child(name = "condition", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
3935        @Description(shortDefinition="Quality desctiption of asset", formalDefinition="Description of the quality and completeness of the asset that imay be a factor in its valuation." )
3936        protected StringType condition;
3937
3938        /**
3939         * Type of Asset availability for use or ownership.
3940         */
3941        @Child(name = "periodType", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3942        @Description(shortDefinition="Asset availability types", formalDefinition="Type of Asset availability for use or ownership." )
3943        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/asset-availability")
3944        protected List<CodeableConcept> periodType;
3945
3946        /**
3947         * Asset relevant contractual time period.
3948         */
3949        @Child(name = "period", type = {Period.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3950        @Description(shortDefinition="Time period of the asset", formalDefinition="Asset relevant contractual time period." )
3951        protected List<Period> period;
3952
3953        /**
3954         * Time period of asset use.
3955         */
3956        @Child(name = "usePeriod", type = {Period.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3957        @Description(shortDefinition="Time period", formalDefinition="Time period of asset use." )
3958        protected List<Period> usePeriod;
3959
3960        /**
3961         * Clause or question text (Prose Object) concerning the asset in a linked form, such as a QuestionnaireResponse used in the formation of the contract.
3962         */
3963        @Child(name = "text", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false)
3964        @Description(shortDefinition="Asset clause or question text", formalDefinition="Clause or question text (Prose Object) concerning the asset in a linked form, such as a QuestionnaireResponse used in the formation of the contract." )
3965        protected StringType text;
3966
3967        /**
3968         * Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.
3969         */
3970        @Child(name = "linkId", type = {StringType.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3971        @Description(shortDefinition="Pointer to asset text", formalDefinition="Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse." )
3972        protected List<StringType> linkId;
3973
3974        /**
3975         * Response to assets.
3976         */
3977        @Child(name = "answer", type = {AnswerComponent.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3978        @Description(shortDefinition="Response to assets", formalDefinition="Response to assets." )
3979        protected List<AnswerComponent> answer;
3980
3981        /**
3982         * Security labels that protects the asset.
3983         */
3984        @Child(name = "securityLabelNumber", type = {UnsignedIntType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3985        @Description(shortDefinition="Asset restriction numbers", formalDefinition="Security labels that protects the asset." )
3986        protected List<UnsignedIntType> securityLabelNumber;
3987
3988        /**
3989         * Contract Valued Item List.
3990         */
3991        @Child(name = "valuedItem", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3992        @Description(shortDefinition="Contract Valued Item List", formalDefinition="Contract Valued Item List." )
3993        protected List<ValuedItemComponent> valuedItem;
3994
3995        private static final long serialVersionUID = -581986730L;
3996
3997    /**
3998     * Constructor
3999     */
4000      public ContractAssetComponent() {
4001        super();
4002      }
4003
4004        /**
4005         * @return {@link #scope} (Differentiates the kind of the asset .)
4006         */
4007        public CodeableConcept getScope() { 
4008          if (this.scope == null)
4009            if (Configuration.errorOnAutoCreate())
4010              throw new Error("Attempt to auto-create ContractAssetComponent.scope");
4011            else if (Configuration.doAutoCreate())
4012              this.scope = new CodeableConcept(); // cc
4013          return this.scope;
4014        }
4015
4016        public boolean hasScope() { 
4017          return this.scope != null && !this.scope.isEmpty();
4018        }
4019
4020        /**
4021         * @param value {@link #scope} (Differentiates the kind of the asset .)
4022         */
4023        public ContractAssetComponent setScope(CodeableConcept value) { 
4024          this.scope = value;
4025          return this;
4026        }
4027
4028        /**
4029         * @return {@link #type} (Target entity type about which the term may be concerned.)
4030         */
4031        public List<CodeableConcept> getType() { 
4032          if (this.type == null)
4033            this.type = new ArrayList<CodeableConcept>();
4034          return this.type;
4035        }
4036
4037        /**
4038         * @return Returns a reference to <code>this</code> for easy method chaining
4039         */
4040        public ContractAssetComponent setType(List<CodeableConcept> theType) { 
4041          this.type = theType;
4042          return this;
4043        }
4044
4045        public boolean hasType() { 
4046          if (this.type == null)
4047            return false;
4048          for (CodeableConcept item : this.type)
4049            if (!item.isEmpty())
4050              return true;
4051          return false;
4052        }
4053
4054        public CodeableConcept addType() { //3
4055          CodeableConcept t = new CodeableConcept();
4056          if (this.type == null)
4057            this.type = new ArrayList<CodeableConcept>();
4058          this.type.add(t);
4059          return t;
4060        }
4061
4062        public ContractAssetComponent addType(CodeableConcept t) { //3
4063          if (t == null)
4064            return this;
4065          if (this.type == null)
4066            this.type = new ArrayList<CodeableConcept>();
4067          this.type.add(t);
4068          return this;
4069        }
4070
4071        /**
4072         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
4073         */
4074        public CodeableConcept getTypeFirstRep() { 
4075          if (getType().isEmpty()) {
4076            addType();
4077          }
4078          return getType().get(0);
4079        }
4080
4081        /**
4082         * @return {@link #typeReference} (Associated entities.)
4083         */
4084        public List<Reference> getTypeReference() { 
4085          if (this.typeReference == null)
4086            this.typeReference = new ArrayList<Reference>();
4087          return this.typeReference;
4088        }
4089
4090        /**
4091         * @return Returns a reference to <code>this</code> for easy method chaining
4092         */
4093        public ContractAssetComponent setTypeReference(List<Reference> theTypeReference) { 
4094          this.typeReference = theTypeReference;
4095          return this;
4096        }
4097
4098        public boolean hasTypeReference() { 
4099          if (this.typeReference == null)
4100            return false;
4101          for (Reference item : this.typeReference)
4102            if (!item.isEmpty())
4103              return true;
4104          return false;
4105        }
4106
4107        public Reference addTypeReference() { //3
4108          Reference t = new Reference();
4109          if (this.typeReference == null)
4110            this.typeReference = new ArrayList<Reference>();
4111          this.typeReference.add(t);
4112          return t;
4113        }
4114
4115        public ContractAssetComponent addTypeReference(Reference t) { //3
4116          if (t == null)
4117            return this;
4118          if (this.typeReference == null)
4119            this.typeReference = new ArrayList<Reference>();
4120          this.typeReference.add(t);
4121          return this;
4122        }
4123
4124        /**
4125         * @return The first repetition of repeating field {@link #typeReference}, creating it if it does not already exist {3}
4126         */
4127        public Reference getTypeReferenceFirstRep() { 
4128          if (getTypeReference().isEmpty()) {
4129            addTypeReference();
4130          }
4131          return getTypeReference().get(0);
4132        }
4133
4134        /**
4135         * @return {@link #subtype} (May be a subtype or part of an offered asset.)
4136         */
4137        public List<CodeableConcept> getSubtype() { 
4138          if (this.subtype == null)
4139            this.subtype = new ArrayList<CodeableConcept>();
4140          return this.subtype;
4141        }
4142
4143        /**
4144         * @return Returns a reference to <code>this</code> for easy method chaining
4145         */
4146        public ContractAssetComponent setSubtype(List<CodeableConcept> theSubtype) { 
4147          this.subtype = theSubtype;
4148          return this;
4149        }
4150
4151        public boolean hasSubtype() { 
4152          if (this.subtype == null)
4153            return false;
4154          for (CodeableConcept item : this.subtype)
4155            if (!item.isEmpty())
4156              return true;
4157          return false;
4158        }
4159
4160        public CodeableConcept addSubtype() { //3
4161          CodeableConcept t = new CodeableConcept();
4162          if (this.subtype == null)
4163            this.subtype = new ArrayList<CodeableConcept>();
4164          this.subtype.add(t);
4165          return t;
4166        }
4167
4168        public ContractAssetComponent addSubtype(CodeableConcept t) { //3
4169          if (t == null)
4170            return this;
4171          if (this.subtype == null)
4172            this.subtype = new ArrayList<CodeableConcept>();
4173          this.subtype.add(t);
4174          return this;
4175        }
4176
4177        /**
4178         * @return The first repetition of repeating field {@link #subtype}, creating it if it does not already exist {3}
4179         */
4180        public CodeableConcept getSubtypeFirstRep() { 
4181          if (getSubtype().isEmpty()) {
4182            addSubtype();
4183          }
4184          return getSubtype().get(0);
4185        }
4186
4187        /**
4188         * @return {@link #relationship} (Specifies the applicability of the term to an asset resource instance, and instances it refers to orinstances that refer to it, and/or are owned by the offeree.)
4189         */
4190        public Coding getRelationship() { 
4191          if (this.relationship == null)
4192            if (Configuration.errorOnAutoCreate())
4193              throw new Error("Attempt to auto-create ContractAssetComponent.relationship");
4194            else if (Configuration.doAutoCreate())
4195              this.relationship = new Coding(); // cc
4196          return this.relationship;
4197        }
4198
4199        public boolean hasRelationship() { 
4200          return this.relationship != null && !this.relationship.isEmpty();
4201        }
4202
4203        /**
4204         * @param value {@link #relationship} (Specifies the applicability of the term to an asset resource instance, and instances it refers to orinstances that refer to it, and/or are owned by the offeree.)
4205         */
4206        public ContractAssetComponent setRelationship(Coding value) { 
4207          this.relationship = value;
4208          return this;
4209        }
4210
4211        /**
4212         * @return {@link #context} (Circumstance of the asset.)
4213         */
4214        public List<AssetContextComponent> getContext() { 
4215          if (this.context == null)
4216            this.context = new ArrayList<AssetContextComponent>();
4217          return this.context;
4218        }
4219
4220        /**
4221         * @return Returns a reference to <code>this</code> for easy method chaining
4222         */
4223        public ContractAssetComponent setContext(List<AssetContextComponent> theContext) { 
4224          this.context = theContext;
4225          return this;
4226        }
4227
4228        public boolean hasContext() { 
4229          if (this.context == null)
4230            return false;
4231          for (AssetContextComponent item : this.context)
4232            if (!item.isEmpty())
4233              return true;
4234          return false;
4235        }
4236
4237        public AssetContextComponent addContext() { //3
4238          AssetContextComponent t = new AssetContextComponent();
4239          if (this.context == null)
4240            this.context = new ArrayList<AssetContextComponent>();
4241          this.context.add(t);
4242          return t;
4243        }
4244
4245        public ContractAssetComponent addContext(AssetContextComponent t) { //3
4246          if (t == null)
4247            return this;
4248          if (this.context == null)
4249            this.context = new ArrayList<AssetContextComponent>();
4250          this.context.add(t);
4251          return this;
4252        }
4253
4254        /**
4255         * @return The first repetition of repeating field {@link #context}, creating it if it does not already exist {3}
4256         */
4257        public AssetContextComponent getContextFirstRep() { 
4258          if (getContext().isEmpty()) {
4259            addContext();
4260          }
4261          return getContext().get(0);
4262        }
4263
4264        /**
4265         * @return {@link #condition} (Description of the quality and completeness of the asset that imay be a factor in its valuation.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value
4266         */
4267        public StringType getConditionElement() { 
4268          if (this.condition == null)
4269            if (Configuration.errorOnAutoCreate())
4270              throw new Error("Attempt to auto-create ContractAssetComponent.condition");
4271            else if (Configuration.doAutoCreate())
4272              this.condition = new StringType(); // bb
4273          return this.condition;
4274        }
4275
4276        public boolean hasConditionElement() { 
4277          return this.condition != null && !this.condition.isEmpty();
4278        }
4279
4280        public boolean hasCondition() { 
4281          return this.condition != null && !this.condition.isEmpty();
4282        }
4283
4284        /**
4285         * @param value {@link #condition} (Description of the quality and completeness of the asset that imay be a factor in its valuation.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value
4286         */
4287        public ContractAssetComponent setConditionElement(StringType value) { 
4288          this.condition = value;
4289          return this;
4290        }
4291
4292        /**
4293         * @return Description of the quality and completeness of the asset that imay be a factor in its valuation.
4294         */
4295        public String getCondition() { 
4296          return this.condition == null ? null : this.condition.getValue();
4297        }
4298
4299        /**
4300         * @param value Description of the quality and completeness of the asset that imay be a factor in its valuation.
4301         */
4302        public ContractAssetComponent setCondition(String value) { 
4303          if (Utilities.noString(value))
4304            this.condition = null;
4305          else {
4306            if (this.condition == null)
4307              this.condition = new StringType();
4308            this.condition.setValue(value);
4309          }
4310          return this;
4311        }
4312
4313        /**
4314         * @return {@link #periodType} (Type of Asset availability for use or ownership.)
4315         */
4316        public List<CodeableConcept> getPeriodType() { 
4317          if (this.periodType == null)
4318            this.periodType = new ArrayList<CodeableConcept>();
4319          return this.periodType;
4320        }
4321
4322        /**
4323         * @return Returns a reference to <code>this</code> for easy method chaining
4324         */
4325        public ContractAssetComponent setPeriodType(List<CodeableConcept> thePeriodType) { 
4326          this.periodType = thePeriodType;
4327          return this;
4328        }
4329
4330        public boolean hasPeriodType() { 
4331          if (this.periodType == null)
4332            return false;
4333          for (CodeableConcept item : this.periodType)
4334            if (!item.isEmpty())
4335              return true;
4336          return false;
4337        }
4338
4339        public CodeableConcept addPeriodType() { //3
4340          CodeableConcept t = new CodeableConcept();
4341          if (this.periodType == null)
4342            this.periodType = new ArrayList<CodeableConcept>();
4343          this.periodType.add(t);
4344          return t;
4345        }
4346
4347        public ContractAssetComponent addPeriodType(CodeableConcept t) { //3
4348          if (t == null)
4349            return this;
4350          if (this.periodType == null)
4351            this.periodType = new ArrayList<CodeableConcept>();
4352          this.periodType.add(t);
4353          return this;
4354        }
4355
4356        /**
4357         * @return The first repetition of repeating field {@link #periodType}, creating it if it does not already exist {3}
4358         */
4359        public CodeableConcept getPeriodTypeFirstRep() { 
4360          if (getPeriodType().isEmpty()) {
4361            addPeriodType();
4362          }
4363          return getPeriodType().get(0);
4364        }
4365
4366        /**
4367         * @return {@link #period} (Asset relevant contractual time period.)
4368         */
4369        public List<Period> getPeriod() { 
4370          if (this.period == null)
4371            this.period = new ArrayList<Period>();
4372          return this.period;
4373        }
4374
4375        /**
4376         * @return Returns a reference to <code>this</code> for easy method chaining
4377         */
4378        public ContractAssetComponent setPeriod(List<Period> thePeriod) { 
4379          this.period = thePeriod;
4380          return this;
4381        }
4382
4383        public boolean hasPeriod() { 
4384          if (this.period == null)
4385            return false;
4386          for (Period item : this.period)
4387            if (!item.isEmpty())
4388              return true;
4389          return false;
4390        }
4391
4392        public Period addPeriod() { //3
4393          Period t = new Period();
4394          if (this.period == null)
4395            this.period = new ArrayList<Period>();
4396          this.period.add(t);
4397          return t;
4398        }
4399
4400        public ContractAssetComponent addPeriod(Period t) { //3
4401          if (t == null)
4402            return this;
4403          if (this.period == null)
4404            this.period = new ArrayList<Period>();
4405          this.period.add(t);
4406          return this;
4407        }
4408
4409        /**
4410         * @return The first repetition of repeating field {@link #period}, creating it if it does not already exist {3}
4411         */
4412        public Period getPeriodFirstRep() { 
4413          if (getPeriod().isEmpty()) {
4414            addPeriod();
4415          }
4416          return getPeriod().get(0);
4417        }
4418
4419        /**
4420         * @return {@link #usePeriod} (Time period of asset use.)
4421         */
4422        public List<Period> getUsePeriod() { 
4423          if (this.usePeriod == null)
4424            this.usePeriod = new ArrayList<Period>();
4425          return this.usePeriod;
4426        }
4427
4428        /**
4429         * @return Returns a reference to <code>this</code> for easy method chaining
4430         */
4431        public ContractAssetComponent setUsePeriod(List<Period> theUsePeriod) { 
4432          this.usePeriod = theUsePeriod;
4433          return this;
4434        }
4435
4436        public boolean hasUsePeriod() { 
4437          if (this.usePeriod == null)
4438            return false;
4439          for (Period item : this.usePeriod)
4440            if (!item.isEmpty())
4441              return true;
4442          return false;
4443        }
4444
4445        public Period addUsePeriod() { //3
4446          Period t = new Period();
4447          if (this.usePeriod == null)
4448            this.usePeriod = new ArrayList<Period>();
4449          this.usePeriod.add(t);
4450          return t;
4451        }
4452
4453        public ContractAssetComponent addUsePeriod(Period t) { //3
4454          if (t == null)
4455            return this;
4456          if (this.usePeriod == null)
4457            this.usePeriod = new ArrayList<Period>();
4458          this.usePeriod.add(t);
4459          return this;
4460        }
4461
4462        /**
4463         * @return The first repetition of repeating field {@link #usePeriod}, creating it if it does not already exist {3}
4464         */
4465        public Period getUsePeriodFirstRep() { 
4466          if (getUsePeriod().isEmpty()) {
4467            addUsePeriod();
4468          }
4469          return getUsePeriod().get(0);
4470        }
4471
4472        /**
4473         * @return {@link #text} (Clause or question text (Prose Object) concerning the asset in a linked form, such as a QuestionnaireResponse used in the formation of the contract.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
4474         */
4475        public StringType getTextElement() { 
4476          if (this.text == null)
4477            if (Configuration.errorOnAutoCreate())
4478              throw new Error("Attempt to auto-create ContractAssetComponent.text");
4479            else if (Configuration.doAutoCreate())
4480              this.text = new StringType(); // bb
4481          return this.text;
4482        }
4483
4484        public boolean hasTextElement() { 
4485          return this.text != null && !this.text.isEmpty();
4486        }
4487
4488        public boolean hasText() { 
4489          return this.text != null && !this.text.isEmpty();
4490        }
4491
4492        /**
4493         * @param value {@link #text} (Clause or question text (Prose Object) concerning the asset in a linked form, such as a QuestionnaireResponse used in the formation of the contract.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
4494         */
4495        public ContractAssetComponent setTextElement(StringType value) { 
4496          this.text = value;
4497          return this;
4498        }
4499
4500        /**
4501         * @return Clause or question text (Prose Object) concerning the asset in a linked form, such as a QuestionnaireResponse used in the formation of the contract.
4502         */
4503        public String getText() { 
4504          return this.text == null ? null : this.text.getValue();
4505        }
4506
4507        /**
4508         * @param value Clause or question text (Prose Object) concerning the asset in a linked form, such as a QuestionnaireResponse used in the formation of the contract.
4509         */
4510        public ContractAssetComponent setText(String value) { 
4511          if (Utilities.noString(value))
4512            this.text = null;
4513          else {
4514            if (this.text == null)
4515              this.text = new StringType();
4516            this.text.setValue(value);
4517          }
4518          return this;
4519        }
4520
4521        /**
4522         * @return {@link #linkId} (Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.)
4523         */
4524        public List<StringType> getLinkId() { 
4525          if (this.linkId == null)
4526            this.linkId = new ArrayList<StringType>();
4527          return this.linkId;
4528        }
4529
4530        /**
4531         * @return Returns a reference to <code>this</code> for easy method chaining
4532         */
4533        public ContractAssetComponent setLinkId(List<StringType> theLinkId) { 
4534          this.linkId = theLinkId;
4535          return this;
4536        }
4537
4538        public boolean hasLinkId() { 
4539          if (this.linkId == null)
4540            return false;
4541          for (StringType item : this.linkId)
4542            if (!item.isEmpty())
4543              return true;
4544          return false;
4545        }
4546
4547        /**
4548         * @return {@link #linkId} (Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.)
4549         */
4550        public StringType addLinkIdElement() {//2 
4551          StringType t = new StringType();
4552          if (this.linkId == null)
4553            this.linkId = new ArrayList<StringType>();
4554          this.linkId.add(t);
4555          return t;
4556        }
4557
4558        /**
4559         * @param value {@link #linkId} (Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.)
4560         */
4561        public ContractAssetComponent addLinkId(String value) { //1
4562          StringType t = new StringType();
4563          t.setValue(value);
4564          if (this.linkId == null)
4565            this.linkId = new ArrayList<StringType>();
4566          this.linkId.add(t);
4567          return this;
4568        }
4569
4570        /**
4571         * @param value {@link #linkId} (Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.)
4572         */
4573        public boolean hasLinkId(String value) { 
4574          if (this.linkId == null)
4575            return false;
4576          for (StringType v : this.linkId)
4577            if (v.getValue().equals(value)) // string
4578              return true;
4579          return false;
4580        }
4581
4582        /**
4583         * @return {@link #answer} (Response to assets.)
4584         */
4585        public List<AnswerComponent> getAnswer() { 
4586          if (this.answer == null)
4587            this.answer = new ArrayList<AnswerComponent>();
4588          return this.answer;
4589        }
4590
4591        /**
4592         * @return Returns a reference to <code>this</code> for easy method chaining
4593         */
4594        public ContractAssetComponent setAnswer(List<AnswerComponent> theAnswer) { 
4595          this.answer = theAnswer;
4596          return this;
4597        }
4598
4599        public boolean hasAnswer() { 
4600          if (this.answer == null)
4601            return false;
4602          for (AnswerComponent item : this.answer)
4603            if (!item.isEmpty())
4604              return true;
4605          return false;
4606        }
4607
4608        public AnswerComponent addAnswer() { //3
4609          AnswerComponent t = new AnswerComponent();
4610          if (this.answer == null)
4611            this.answer = new ArrayList<AnswerComponent>();
4612          this.answer.add(t);
4613          return t;
4614        }
4615
4616        public ContractAssetComponent addAnswer(AnswerComponent t) { //3
4617          if (t == null)
4618            return this;
4619          if (this.answer == null)
4620            this.answer = new ArrayList<AnswerComponent>();
4621          this.answer.add(t);
4622          return this;
4623        }
4624
4625        /**
4626         * @return The first repetition of repeating field {@link #answer}, creating it if it does not already exist {3}
4627         */
4628        public AnswerComponent getAnswerFirstRep() { 
4629          if (getAnswer().isEmpty()) {
4630            addAnswer();
4631          }
4632          return getAnswer().get(0);
4633        }
4634
4635        /**
4636         * @return {@link #securityLabelNumber} (Security labels that protects the asset.)
4637         */
4638        public List<UnsignedIntType> getSecurityLabelNumber() { 
4639          if (this.securityLabelNumber == null)
4640            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
4641          return this.securityLabelNumber;
4642        }
4643
4644        /**
4645         * @return Returns a reference to <code>this</code> for easy method chaining
4646         */
4647        public ContractAssetComponent setSecurityLabelNumber(List<UnsignedIntType> theSecurityLabelNumber) { 
4648          this.securityLabelNumber = theSecurityLabelNumber;
4649          return this;
4650        }
4651
4652        public boolean hasSecurityLabelNumber() { 
4653          if (this.securityLabelNumber == null)
4654            return false;
4655          for (UnsignedIntType item : this.securityLabelNumber)
4656            if (!item.isEmpty())
4657              return true;
4658          return false;
4659        }
4660
4661        /**
4662         * @return {@link #securityLabelNumber} (Security labels that protects the asset.)
4663         */
4664        public UnsignedIntType addSecurityLabelNumberElement() {//2 
4665          UnsignedIntType t = new UnsignedIntType();
4666          if (this.securityLabelNumber == null)
4667            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
4668          this.securityLabelNumber.add(t);
4669          return t;
4670        }
4671
4672        /**
4673         * @param value {@link #securityLabelNumber} (Security labels that protects the asset.)
4674         */
4675        public ContractAssetComponent addSecurityLabelNumber(int value) { //1
4676          UnsignedIntType t = new UnsignedIntType();
4677          t.setValue(value);
4678          if (this.securityLabelNumber == null)
4679            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
4680          this.securityLabelNumber.add(t);
4681          return this;
4682        }
4683
4684        /**
4685         * @param value {@link #securityLabelNumber} (Security labels that protects the asset.)
4686         */
4687        public boolean hasSecurityLabelNumber(int value) { 
4688          if (this.securityLabelNumber == null)
4689            return false;
4690          for (UnsignedIntType v : this.securityLabelNumber)
4691            if (v.getValue().equals(value)) // unsignedInt
4692              return true;
4693          return false;
4694        }
4695
4696        /**
4697         * @return {@link #valuedItem} (Contract Valued Item List.)
4698         */
4699        public List<ValuedItemComponent> getValuedItem() { 
4700          if (this.valuedItem == null)
4701            this.valuedItem = new ArrayList<ValuedItemComponent>();
4702          return this.valuedItem;
4703        }
4704
4705        /**
4706         * @return Returns a reference to <code>this</code> for easy method chaining
4707         */
4708        public ContractAssetComponent setValuedItem(List<ValuedItemComponent> theValuedItem) { 
4709          this.valuedItem = theValuedItem;
4710          return this;
4711        }
4712
4713        public boolean hasValuedItem() { 
4714          if (this.valuedItem == null)
4715            return false;
4716          for (ValuedItemComponent item : this.valuedItem)
4717            if (!item.isEmpty())
4718              return true;
4719          return false;
4720        }
4721
4722        public ValuedItemComponent addValuedItem() { //3
4723          ValuedItemComponent t = new ValuedItemComponent();
4724          if (this.valuedItem == null)
4725            this.valuedItem = new ArrayList<ValuedItemComponent>();
4726          this.valuedItem.add(t);
4727          return t;
4728        }
4729
4730        public ContractAssetComponent addValuedItem(ValuedItemComponent t) { //3
4731          if (t == null)
4732            return this;
4733          if (this.valuedItem == null)
4734            this.valuedItem = new ArrayList<ValuedItemComponent>();
4735          this.valuedItem.add(t);
4736          return this;
4737        }
4738
4739        /**
4740         * @return The first repetition of repeating field {@link #valuedItem}, creating it if it does not already exist {3}
4741         */
4742        public ValuedItemComponent getValuedItemFirstRep() { 
4743          if (getValuedItem().isEmpty()) {
4744            addValuedItem();
4745          }
4746          return getValuedItem().get(0);
4747        }
4748
4749        protected void listChildren(List<Property> children) {
4750          super.listChildren(children);
4751          children.add(new Property("scope", "CodeableConcept", "Differentiates the kind of the asset .", 0, 1, scope));
4752          children.add(new Property("type", "CodeableConcept", "Target entity type about which the term may be concerned.", 0, java.lang.Integer.MAX_VALUE, type));
4753          children.add(new Property("typeReference", "Reference(Any)", "Associated entities.", 0, java.lang.Integer.MAX_VALUE, typeReference));
4754          children.add(new Property("subtype", "CodeableConcept", "May be a subtype or part of an offered asset.", 0, java.lang.Integer.MAX_VALUE, subtype));
4755          children.add(new Property("relationship", "Coding", "Specifies the applicability of the term to an asset resource instance, and instances it refers to orinstances that refer to it, and/or are owned by the offeree.", 0, 1, relationship));
4756          children.add(new Property("context", "", "Circumstance of the asset.", 0, java.lang.Integer.MAX_VALUE, context));
4757          children.add(new Property("condition", "string", "Description of the quality and completeness of the asset that imay be a factor in its valuation.", 0, 1, condition));
4758          children.add(new Property("periodType", "CodeableConcept", "Type of Asset availability for use or ownership.", 0, java.lang.Integer.MAX_VALUE, periodType));
4759          children.add(new Property("period", "Period", "Asset relevant contractual time period.", 0, java.lang.Integer.MAX_VALUE, period));
4760          children.add(new Property("usePeriod", "Period", "Time period of asset use.", 0, java.lang.Integer.MAX_VALUE, usePeriod));
4761          children.add(new Property("text", "string", "Clause or question text (Prose Object) concerning the asset in a linked form, such as a QuestionnaireResponse used in the formation of the contract.", 0, 1, text));
4762          children.add(new Property("linkId", "string", "Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, linkId));
4763          children.add(new Property("answer", "@Contract.term.offer.answer", "Response to assets.", 0, java.lang.Integer.MAX_VALUE, answer));
4764          children.add(new Property("securityLabelNumber", "unsignedInt", "Security labels that protects the asset.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber));
4765          children.add(new Property("valuedItem", "", "Contract Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem));
4766        }
4767
4768        @Override
4769        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4770          switch (_hash) {
4771          case 109264468: /*scope*/  return new Property("scope", "CodeableConcept", "Differentiates the kind of the asset .", 0, 1, scope);
4772          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Target entity type about which the term may be concerned.", 0, java.lang.Integer.MAX_VALUE, type);
4773          case 2074825009: /*typeReference*/  return new Property("typeReference", "Reference(Any)", "Associated entities.", 0, java.lang.Integer.MAX_VALUE, typeReference);
4774          case -1867567750: /*subtype*/  return new Property("subtype", "CodeableConcept", "May be a subtype or part of an offered asset.", 0, java.lang.Integer.MAX_VALUE, subtype);
4775          case -261851592: /*relationship*/  return new Property("relationship", "Coding", "Specifies the applicability of the term to an asset resource instance, and instances it refers to orinstances that refer to it, and/or are owned by the offeree.", 0, 1, relationship);
4776          case 951530927: /*context*/  return new Property("context", "", "Circumstance of the asset.", 0, java.lang.Integer.MAX_VALUE, context);
4777          case -861311717: /*condition*/  return new Property("condition", "string", "Description of the quality and completeness of the asset that imay be a factor in its valuation.", 0, 1, condition);
4778          case 384348315: /*periodType*/  return new Property("periodType", "CodeableConcept", "Type of Asset availability for use or ownership.", 0, java.lang.Integer.MAX_VALUE, periodType);
4779          case -991726143: /*period*/  return new Property("period", "Period", "Asset relevant contractual time period.", 0, java.lang.Integer.MAX_VALUE, period);
4780          case -628382168: /*usePeriod*/  return new Property("usePeriod", "Period", "Time period of asset use.", 0, java.lang.Integer.MAX_VALUE, usePeriod);
4781          case 3556653: /*text*/  return new Property("text", "string", "Clause or question text (Prose Object) concerning the asset in a linked form, such as a QuestionnaireResponse used in the formation of the contract.", 0, 1, text);
4782          case -1102667083: /*linkId*/  return new Property("linkId", "string", "Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, linkId);
4783          case -1412808770: /*answer*/  return new Property("answer", "@Contract.term.offer.answer", "Response to assets.", 0, java.lang.Integer.MAX_VALUE, answer);
4784          case -149460995: /*securityLabelNumber*/  return new Property("securityLabelNumber", "unsignedInt", "Security labels that protects the asset.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber);
4785          case 2046675654: /*valuedItem*/  return new Property("valuedItem", "", "Contract Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem);
4786          default: return super.getNamedProperty(_hash, _name, _checkValid);
4787          }
4788
4789        }
4790
4791      @Override
4792      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4793        switch (hash) {
4794        case 109264468: /*scope*/ return this.scope == null ? new Base[0] : new Base[] {this.scope}; // CodeableConcept
4795        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
4796        case 2074825009: /*typeReference*/ return this.typeReference == null ? new Base[0] : this.typeReference.toArray(new Base[this.typeReference.size()]); // Reference
4797        case -1867567750: /*subtype*/ return this.subtype == null ? new Base[0] : this.subtype.toArray(new Base[this.subtype.size()]); // CodeableConcept
4798        case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding
4799        case 951530927: /*context*/ return this.context == null ? new Base[0] : this.context.toArray(new Base[this.context.size()]); // AssetContextComponent
4800        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // StringType
4801        case 384348315: /*periodType*/ return this.periodType == null ? new Base[0] : this.periodType.toArray(new Base[this.periodType.size()]); // CodeableConcept
4802        case -991726143: /*period*/ return this.period == null ? new Base[0] : this.period.toArray(new Base[this.period.size()]); // Period
4803        case -628382168: /*usePeriod*/ return this.usePeriod == null ? new Base[0] : this.usePeriod.toArray(new Base[this.usePeriod.size()]); // Period
4804        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
4805        case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : this.linkId.toArray(new Base[this.linkId.size()]); // StringType
4806        case -1412808770: /*answer*/ return this.answer == null ? new Base[0] : this.answer.toArray(new Base[this.answer.size()]); // AnswerComponent
4807        case -149460995: /*securityLabelNumber*/ return this.securityLabelNumber == null ? new Base[0] : this.securityLabelNumber.toArray(new Base[this.securityLabelNumber.size()]); // UnsignedIntType
4808        case 2046675654: /*valuedItem*/ return this.valuedItem == null ? new Base[0] : this.valuedItem.toArray(new Base[this.valuedItem.size()]); // ValuedItemComponent
4809        default: return super.getProperty(hash, name, checkValid);
4810        }
4811
4812      }
4813
4814      @Override
4815      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4816        switch (hash) {
4817        case 109264468: // scope
4818          this.scope = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4819          return value;
4820        case 3575610: // type
4821          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4822          return value;
4823        case 2074825009: // typeReference
4824          this.getTypeReference().add(TypeConvertor.castToReference(value)); // Reference
4825          return value;
4826        case -1867567750: // subtype
4827          this.getSubtype().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4828          return value;
4829        case -261851592: // relationship
4830          this.relationship = TypeConvertor.castToCoding(value); // Coding
4831          return value;
4832        case 951530927: // context
4833          this.getContext().add((AssetContextComponent) value); // AssetContextComponent
4834          return value;
4835        case -861311717: // condition
4836          this.condition = TypeConvertor.castToString(value); // StringType
4837          return value;
4838        case 384348315: // periodType
4839          this.getPeriodType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4840          return value;
4841        case -991726143: // period
4842          this.getPeriod().add(TypeConvertor.castToPeriod(value)); // Period
4843          return value;
4844        case -628382168: // usePeriod
4845          this.getUsePeriod().add(TypeConvertor.castToPeriod(value)); // Period
4846          return value;
4847        case 3556653: // text
4848          this.text = TypeConvertor.castToString(value); // StringType
4849          return value;
4850        case -1102667083: // linkId
4851          this.getLinkId().add(TypeConvertor.castToString(value)); // StringType
4852          return value;
4853        case -1412808770: // answer
4854          this.getAnswer().add((AnswerComponent) value); // AnswerComponent
4855          return value;
4856        case -149460995: // securityLabelNumber
4857          this.getSecurityLabelNumber().add(TypeConvertor.castToUnsignedInt(value)); // UnsignedIntType
4858          return value;
4859        case 2046675654: // valuedItem
4860          this.getValuedItem().add((ValuedItemComponent) value); // ValuedItemComponent
4861          return value;
4862        default: return super.setProperty(hash, name, value);
4863        }
4864
4865      }
4866
4867      @Override
4868      public Base setProperty(String name, Base value) throws FHIRException {
4869        if (name.equals("scope")) {
4870          this.scope = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4871        } else if (name.equals("type")) {
4872          this.getType().add(TypeConvertor.castToCodeableConcept(value));
4873        } else if (name.equals("typeReference")) {
4874          this.getTypeReference().add(TypeConvertor.castToReference(value));
4875        } else if (name.equals("subtype")) {
4876          this.getSubtype().add(TypeConvertor.castToCodeableConcept(value));
4877        } else if (name.equals("relationship")) {
4878          this.relationship = TypeConvertor.castToCoding(value); // Coding
4879        } else if (name.equals("context")) {
4880          this.getContext().add((AssetContextComponent) value);
4881        } else if (name.equals("condition")) {
4882          this.condition = TypeConvertor.castToString(value); // StringType
4883        } else if (name.equals("periodType")) {
4884          this.getPeriodType().add(TypeConvertor.castToCodeableConcept(value));
4885        } else if (name.equals("period")) {
4886          this.getPeriod().add(TypeConvertor.castToPeriod(value));
4887        } else if (name.equals("usePeriod")) {
4888          this.getUsePeriod().add(TypeConvertor.castToPeriod(value));
4889        } else if (name.equals("text")) {
4890          this.text = TypeConvertor.castToString(value); // StringType
4891        } else if (name.equals("linkId")) {
4892          this.getLinkId().add(TypeConvertor.castToString(value));
4893        } else if (name.equals("answer")) {
4894          this.getAnswer().add((AnswerComponent) value);
4895        } else if (name.equals("securityLabelNumber")) {
4896          this.getSecurityLabelNumber().add(TypeConvertor.castToUnsignedInt(value));
4897        } else if (name.equals("valuedItem")) {
4898          this.getValuedItem().add((ValuedItemComponent) value);
4899        } else
4900          return super.setProperty(name, value);
4901        return value;
4902      }
4903
4904      @Override
4905      public Base makeProperty(int hash, String name) throws FHIRException {
4906        switch (hash) {
4907        case 109264468:  return getScope();
4908        case 3575610:  return addType(); 
4909        case 2074825009:  return addTypeReference(); 
4910        case -1867567750:  return addSubtype(); 
4911        case -261851592:  return getRelationship();
4912        case 951530927:  return addContext(); 
4913        case -861311717:  return getConditionElement();
4914        case 384348315:  return addPeriodType(); 
4915        case -991726143:  return addPeriod(); 
4916        case -628382168:  return addUsePeriod(); 
4917        case 3556653:  return getTextElement();
4918        case -1102667083:  return addLinkIdElement();
4919        case -1412808770:  return addAnswer(); 
4920        case -149460995:  return addSecurityLabelNumberElement();
4921        case 2046675654:  return addValuedItem(); 
4922        default: return super.makeProperty(hash, name);
4923        }
4924
4925      }
4926
4927      @Override
4928      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4929        switch (hash) {
4930        case 109264468: /*scope*/ return new String[] {"CodeableConcept"};
4931        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
4932        case 2074825009: /*typeReference*/ return new String[] {"Reference"};
4933        case -1867567750: /*subtype*/ return new String[] {"CodeableConcept"};
4934        case -261851592: /*relationship*/ return new String[] {"Coding"};
4935        case 951530927: /*context*/ return new String[] {};
4936        case -861311717: /*condition*/ return new String[] {"string"};
4937        case 384348315: /*periodType*/ return new String[] {"CodeableConcept"};
4938        case -991726143: /*period*/ return new String[] {"Period"};
4939        case -628382168: /*usePeriod*/ return new String[] {"Period"};
4940        case 3556653: /*text*/ return new String[] {"string"};
4941        case -1102667083: /*linkId*/ return new String[] {"string"};
4942        case -1412808770: /*answer*/ return new String[] {"@Contract.term.offer.answer"};
4943        case -149460995: /*securityLabelNumber*/ return new String[] {"unsignedInt"};
4944        case 2046675654: /*valuedItem*/ return new String[] {};
4945        default: return super.getTypesForProperty(hash, name);
4946        }
4947
4948      }
4949
4950      @Override
4951      public Base addChild(String name) throws FHIRException {
4952        if (name.equals("scope")) {
4953          this.scope = new CodeableConcept();
4954          return this.scope;
4955        }
4956        else if (name.equals("type")) {
4957          return addType();
4958        }
4959        else if (name.equals("typeReference")) {
4960          return addTypeReference();
4961        }
4962        else if (name.equals("subtype")) {
4963          return addSubtype();
4964        }
4965        else if (name.equals("relationship")) {
4966          this.relationship = new Coding();
4967          return this.relationship;
4968        }
4969        else if (name.equals("context")) {
4970          return addContext();
4971        }
4972        else if (name.equals("condition")) {
4973          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.asset.condition");
4974        }
4975        else if (name.equals("periodType")) {
4976          return addPeriodType();
4977        }
4978        else if (name.equals("period")) {
4979          return addPeriod();
4980        }
4981        else if (name.equals("usePeriod")) {
4982          return addUsePeriod();
4983        }
4984        else if (name.equals("text")) {
4985          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.asset.text");
4986        }
4987        else if (name.equals("linkId")) {
4988          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.asset.linkId");
4989        }
4990        else if (name.equals("answer")) {
4991          return addAnswer();
4992        }
4993        else if (name.equals("securityLabelNumber")) {
4994          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.asset.securityLabelNumber");
4995        }
4996        else if (name.equals("valuedItem")) {
4997          return addValuedItem();
4998        }
4999        else
5000          return super.addChild(name);
5001      }
5002
5003      public ContractAssetComponent copy() {
5004        ContractAssetComponent dst = new ContractAssetComponent();
5005        copyValues(dst);
5006        return dst;
5007      }
5008
5009      public void copyValues(ContractAssetComponent dst) {
5010        super.copyValues(dst);
5011        dst.scope = scope == null ? null : scope.copy();
5012        if (type != null) {
5013          dst.type = new ArrayList<CodeableConcept>();
5014          for (CodeableConcept i : type)
5015            dst.type.add(i.copy());
5016        };
5017        if (typeReference != null) {
5018          dst.typeReference = new ArrayList<Reference>();
5019          for (Reference i : typeReference)
5020            dst.typeReference.add(i.copy());
5021        };
5022        if (subtype != null) {
5023          dst.subtype = new ArrayList<CodeableConcept>();
5024          for (CodeableConcept i : subtype)
5025            dst.subtype.add(i.copy());
5026        };
5027        dst.relationship = relationship == null ? null : relationship.copy();
5028        if (context != null) {
5029          dst.context = new ArrayList<AssetContextComponent>();
5030          for (AssetContextComponent i : context)
5031            dst.context.add(i.copy());
5032        };
5033        dst.condition = condition == null ? null : condition.copy();
5034        if (periodType != null) {
5035          dst.periodType = new ArrayList<CodeableConcept>();
5036          for (CodeableConcept i : periodType)
5037            dst.periodType.add(i.copy());
5038        };
5039        if (period != null) {
5040          dst.period = new ArrayList<Period>();
5041          for (Period i : period)
5042            dst.period.add(i.copy());
5043        };
5044        if (usePeriod != null) {
5045          dst.usePeriod = new ArrayList<Period>();
5046          for (Period i : usePeriod)
5047            dst.usePeriod.add(i.copy());
5048        };
5049        dst.text = text == null ? null : text.copy();
5050        if (linkId != null) {
5051          dst.linkId = new ArrayList<StringType>();
5052          for (StringType i : linkId)
5053            dst.linkId.add(i.copy());
5054        };
5055        if (answer != null) {
5056          dst.answer = new ArrayList<AnswerComponent>();
5057          for (AnswerComponent i : answer)
5058            dst.answer.add(i.copy());
5059        };
5060        if (securityLabelNumber != null) {
5061          dst.securityLabelNumber = new ArrayList<UnsignedIntType>();
5062          for (UnsignedIntType i : securityLabelNumber)
5063            dst.securityLabelNumber.add(i.copy());
5064        };
5065        if (valuedItem != null) {
5066          dst.valuedItem = new ArrayList<ValuedItemComponent>();
5067          for (ValuedItemComponent i : valuedItem)
5068            dst.valuedItem.add(i.copy());
5069        };
5070      }
5071
5072      @Override
5073      public boolean equalsDeep(Base other_) {
5074        if (!super.equalsDeep(other_))
5075          return false;
5076        if (!(other_ instanceof ContractAssetComponent))
5077          return false;
5078        ContractAssetComponent o = (ContractAssetComponent) other_;
5079        return compareDeep(scope, o.scope, true) && compareDeep(type, o.type, true) && compareDeep(typeReference, o.typeReference, true)
5080           && compareDeep(subtype, o.subtype, true) && compareDeep(relationship, o.relationship, true) && compareDeep(context, o.context, true)
5081           && compareDeep(condition, o.condition, true) && compareDeep(periodType, o.periodType, true) && compareDeep(period, o.period, true)
5082           && compareDeep(usePeriod, o.usePeriod, true) && compareDeep(text, o.text, true) && compareDeep(linkId, o.linkId, true)
5083           && compareDeep(answer, o.answer, true) && compareDeep(securityLabelNumber, o.securityLabelNumber, true)
5084           && compareDeep(valuedItem, o.valuedItem, true);
5085      }
5086
5087      @Override
5088      public boolean equalsShallow(Base other_) {
5089        if (!super.equalsShallow(other_))
5090          return false;
5091        if (!(other_ instanceof ContractAssetComponent))
5092          return false;
5093        ContractAssetComponent o = (ContractAssetComponent) other_;
5094        return compareValues(condition, o.condition, true) && compareValues(text, o.text, true) && compareValues(linkId, o.linkId, true)
5095           && compareValues(securityLabelNumber, o.securityLabelNumber, true);
5096      }
5097
5098      public boolean isEmpty() {
5099        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(scope, type, typeReference
5100          , subtype, relationship, context, condition, periodType, period, usePeriod, text
5101          , linkId, answer, securityLabelNumber, valuedItem);
5102      }
5103
5104  public String fhirType() {
5105    return "Contract.term.asset";
5106
5107  }
5108
5109  }
5110
5111    @Block()
5112    public static class AssetContextComponent extends BackboneElement implements IBaseBackboneElement {
5113        /**
5114         * Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository),  location held, e.g., building,  jurisdiction.
5115         */
5116        @Child(name = "reference", type = {Reference.class}, order=1, min=0, max=1, modifier=false, summary=false)
5117        @Description(shortDefinition="Creator,custodian or owner", formalDefinition="Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository),  location held, e.g., building,  jurisdiction." )
5118        protected Reference reference;
5119
5120        /**
5121         * Coded representation of the context generally or of the Referenced entity, such as the asset holder type or location.
5122         */
5123        @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5124        @Description(shortDefinition="Codeable asset context", formalDefinition="Coded representation of the context generally or of the Referenced entity, such as the asset holder type or location." )
5125        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-assetcontext")
5126        protected List<CodeableConcept> code;
5127
5128        /**
5129         * Context description.
5130         */
5131        @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
5132        @Description(shortDefinition="Context description", formalDefinition="Context description." )
5133        protected StringType text;
5134
5135        private static final long serialVersionUID = -388598648L;
5136
5137    /**
5138     * Constructor
5139     */
5140      public AssetContextComponent() {
5141        super();
5142      }
5143
5144        /**
5145         * @return {@link #reference} (Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository),  location held, e.g., building,  jurisdiction.)
5146         */
5147        public Reference getReference() { 
5148          if (this.reference == null)
5149            if (Configuration.errorOnAutoCreate())
5150              throw new Error("Attempt to auto-create AssetContextComponent.reference");
5151            else if (Configuration.doAutoCreate())
5152              this.reference = new Reference(); // cc
5153          return this.reference;
5154        }
5155
5156        public boolean hasReference() { 
5157          return this.reference != null && !this.reference.isEmpty();
5158        }
5159
5160        /**
5161         * @param value {@link #reference} (Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository),  location held, e.g., building,  jurisdiction.)
5162         */
5163        public AssetContextComponent setReference(Reference value) { 
5164          this.reference = value;
5165          return this;
5166        }
5167
5168        /**
5169         * @return {@link #code} (Coded representation of the context generally or of the Referenced entity, such as the asset holder type or location.)
5170         */
5171        public List<CodeableConcept> getCode() { 
5172          if (this.code == null)
5173            this.code = new ArrayList<CodeableConcept>();
5174          return this.code;
5175        }
5176
5177        /**
5178         * @return Returns a reference to <code>this</code> for easy method chaining
5179         */
5180        public AssetContextComponent setCode(List<CodeableConcept> theCode) { 
5181          this.code = theCode;
5182          return this;
5183        }
5184
5185        public boolean hasCode() { 
5186          if (this.code == null)
5187            return false;
5188          for (CodeableConcept item : this.code)
5189            if (!item.isEmpty())
5190              return true;
5191          return false;
5192        }
5193
5194        public CodeableConcept addCode() { //3
5195          CodeableConcept t = new CodeableConcept();
5196          if (this.code == null)
5197            this.code = new ArrayList<CodeableConcept>();
5198          this.code.add(t);
5199          return t;
5200        }
5201
5202        public AssetContextComponent addCode(CodeableConcept t) { //3
5203          if (t == null)
5204            return this;
5205          if (this.code == null)
5206            this.code = new ArrayList<CodeableConcept>();
5207          this.code.add(t);
5208          return this;
5209        }
5210
5211        /**
5212         * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist {3}
5213         */
5214        public CodeableConcept getCodeFirstRep() { 
5215          if (getCode().isEmpty()) {
5216            addCode();
5217          }
5218          return getCode().get(0);
5219        }
5220
5221        /**
5222         * @return {@link #text} (Context description.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
5223         */
5224        public StringType getTextElement() { 
5225          if (this.text == null)
5226            if (Configuration.errorOnAutoCreate())
5227              throw new Error("Attempt to auto-create AssetContextComponent.text");
5228            else if (Configuration.doAutoCreate())
5229              this.text = new StringType(); // bb
5230          return this.text;
5231        }
5232
5233        public boolean hasTextElement() { 
5234          return this.text != null && !this.text.isEmpty();
5235        }
5236
5237        public boolean hasText() { 
5238          return this.text != null && !this.text.isEmpty();
5239        }
5240
5241        /**
5242         * @param value {@link #text} (Context description.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
5243         */
5244        public AssetContextComponent setTextElement(StringType value) { 
5245          this.text = value;
5246          return this;
5247        }
5248
5249        /**
5250         * @return Context description.
5251         */
5252        public String getText() { 
5253          return this.text == null ? null : this.text.getValue();
5254        }
5255
5256        /**
5257         * @param value Context description.
5258         */
5259        public AssetContextComponent setText(String value) { 
5260          if (Utilities.noString(value))
5261            this.text = null;
5262          else {
5263            if (this.text == null)
5264              this.text = new StringType();
5265            this.text.setValue(value);
5266          }
5267          return this;
5268        }
5269
5270        protected void listChildren(List<Property> children) {
5271          super.listChildren(children);
5272          children.add(new Property("reference", "Reference(Any)", "Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository),  location held, e.g., building,  jurisdiction.", 0, 1, reference));
5273          children.add(new Property("code", "CodeableConcept", "Coded representation of the context generally or of the Referenced entity, such as the asset holder type or location.", 0, java.lang.Integer.MAX_VALUE, code));
5274          children.add(new Property("text", "string", "Context description.", 0, 1, text));
5275        }
5276
5277        @Override
5278        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5279          switch (_hash) {
5280          case -925155509: /*reference*/  return new Property("reference", "Reference(Any)", "Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository),  location held, e.g., building,  jurisdiction.", 0, 1, reference);
5281          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Coded representation of the context generally or of the Referenced entity, such as the asset holder type or location.", 0, java.lang.Integer.MAX_VALUE, code);
5282          case 3556653: /*text*/  return new Property("text", "string", "Context description.", 0, 1, text);
5283          default: return super.getNamedProperty(_hash, _name, _checkValid);
5284          }
5285
5286        }
5287
5288      @Override
5289      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5290        switch (hash) {
5291        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
5292        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept
5293        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
5294        default: return super.getProperty(hash, name, checkValid);
5295        }
5296
5297      }
5298
5299      @Override
5300      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5301        switch (hash) {
5302        case -925155509: // reference
5303          this.reference = TypeConvertor.castToReference(value); // Reference
5304          return value;
5305        case 3059181: // code
5306          this.getCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
5307          return value;
5308        case 3556653: // text
5309          this.text = TypeConvertor.castToString(value); // StringType
5310          return value;
5311        default: return super.setProperty(hash, name, value);
5312        }
5313
5314      }
5315
5316      @Override
5317      public Base setProperty(String name, Base value) throws FHIRException {
5318        if (name.equals("reference")) {
5319          this.reference = TypeConvertor.castToReference(value); // Reference
5320        } else if (name.equals("code")) {
5321          this.getCode().add(TypeConvertor.castToCodeableConcept(value));
5322        } else if (name.equals("text")) {
5323          this.text = TypeConvertor.castToString(value); // StringType
5324        } else
5325          return super.setProperty(name, value);
5326        return value;
5327      }
5328
5329      @Override
5330      public Base makeProperty(int hash, String name) throws FHIRException {
5331        switch (hash) {
5332        case -925155509:  return getReference();
5333        case 3059181:  return addCode(); 
5334        case 3556653:  return getTextElement();
5335        default: return super.makeProperty(hash, name);
5336        }
5337
5338      }
5339
5340      @Override
5341      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5342        switch (hash) {
5343        case -925155509: /*reference*/ return new String[] {"Reference"};
5344        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
5345        case 3556653: /*text*/ return new String[] {"string"};
5346        default: return super.getTypesForProperty(hash, name);
5347        }
5348
5349      }
5350
5351      @Override
5352      public Base addChild(String name) throws FHIRException {
5353        if (name.equals("reference")) {
5354          this.reference = new Reference();
5355          return this.reference;
5356        }
5357        else if (name.equals("code")) {
5358          return addCode();
5359        }
5360        else if (name.equals("text")) {
5361          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.asset.context.text");
5362        }
5363        else
5364          return super.addChild(name);
5365      }
5366
5367      public AssetContextComponent copy() {
5368        AssetContextComponent dst = new AssetContextComponent();
5369        copyValues(dst);
5370        return dst;
5371      }
5372
5373      public void copyValues(AssetContextComponent dst) {
5374        super.copyValues(dst);
5375        dst.reference = reference == null ? null : reference.copy();
5376        if (code != null) {
5377          dst.code = new ArrayList<CodeableConcept>();
5378          for (CodeableConcept i : code)
5379            dst.code.add(i.copy());
5380        };
5381        dst.text = text == null ? null : text.copy();
5382      }
5383
5384      @Override
5385      public boolean equalsDeep(Base other_) {
5386        if (!super.equalsDeep(other_))
5387          return false;
5388        if (!(other_ instanceof AssetContextComponent))
5389          return false;
5390        AssetContextComponent o = (AssetContextComponent) other_;
5391        return compareDeep(reference, o.reference, true) && compareDeep(code, o.code, true) && compareDeep(text, o.text, true)
5392          ;
5393      }
5394
5395      @Override
5396      public boolean equalsShallow(Base other_) {
5397        if (!super.equalsShallow(other_))
5398          return false;
5399        if (!(other_ instanceof AssetContextComponent))
5400          return false;
5401        AssetContextComponent o = (AssetContextComponent) other_;
5402        return compareValues(text, o.text, true);
5403      }
5404
5405      public boolean isEmpty() {
5406        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(reference, code, text);
5407      }
5408
5409  public String fhirType() {
5410    return "Contract.term.asset.context";
5411
5412  }
5413
5414  }
5415
5416    @Block()
5417    public static class ValuedItemComponent extends BackboneElement implements IBaseBackboneElement {
5418        /**
5419         * Specific type of Contract Valued Item that may be priced.
5420         */
5421        @Child(name = "entity", type = {CodeableConcept.class, Reference.class}, order=1, min=0, max=1, modifier=false, summary=false)
5422        @Description(shortDefinition="Contract Valued Item Type", formalDefinition="Specific type of Contract Valued Item that may be priced." )
5423        protected DataType entity;
5424
5425        /**
5426         * Identifies a Contract Valued Item instance.
5427         */
5428        @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=false)
5429        @Description(shortDefinition="Contract Valued Item Number", formalDefinition="Identifies a Contract Valued Item instance." )
5430        protected Identifier identifier;
5431
5432        /**
5433         * Indicates the time during which this Contract ValuedItem information is effective.
5434         */
5435        @Child(name = "effectiveTime", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
5436        @Description(shortDefinition="Contract Valued Item Effective Tiem", formalDefinition="Indicates the time during which this Contract ValuedItem information is effective." )
5437        protected DateTimeType effectiveTime;
5438
5439        /**
5440         * Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.
5441         */
5442        @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1, modifier=false, summary=false)
5443        @Description(shortDefinition="Count of Contract Valued Items", formalDefinition="Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances." )
5444        protected Quantity quantity;
5445
5446        /**
5447         * A Contract Valued Item unit valuation measure.
5448         */
5449        @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1, modifier=false, summary=false)
5450        @Description(shortDefinition="Contract Valued Item fee, charge, or cost", formalDefinition="A Contract Valued Item unit valuation measure." )
5451        protected Money unitPrice;
5452
5453        /**
5454         * A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
5455         */
5456        @Child(name = "factor", type = {DecimalType.class}, order=6, min=0, max=1, modifier=false, summary=false)
5457        @Description(shortDefinition="Contract Valued Item Price Scaling Factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." )
5458        protected DecimalType factor;
5459
5460        /**
5461         * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.
5462         */
5463        @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=false)
5464        @Description(shortDefinition="Contract Valued Item Difficulty Scaling Factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point." )
5465        protected DecimalType points;
5466
5467        /**
5468         * Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.
5469         */
5470        @Child(name = "net", type = {Money.class}, order=8, min=0, max=1, modifier=false, summary=false)
5471        @Description(shortDefinition="Total Contract Valued Item Value", formalDefinition="Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." )
5472        protected Money net;
5473
5474        /**
5475         * Terms of valuation.
5476         */
5477        @Child(name = "payment", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
5478        @Description(shortDefinition="Terms of valuation", formalDefinition="Terms of valuation." )
5479        protected StringType payment;
5480
5481        /**
5482         * When payment is due.
5483         */
5484        @Child(name = "paymentDate", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=false)
5485        @Description(shortDefinition="When payment is due", formalDefinition="When payment is due." )
5486        protected DateTimeType paymentDate;
5487
5488        /**
5489         * Who will make payment.
5490         */
5491        @Child(name = "responsible", type = {Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class}, order=11, min=0, max=1, modifier=false, summary=false)
5492        @Description(shortDefinition="Who will make payment", formalDefinition="Who will make payment." )
5493        protected Reference responsible;
5494
5495        /**
5496         * Who will receive payment.
5497         */
5498        @Child(name = "recipient", type = {Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class}, order=12, min=0, max=1, modifier=false, summary=false)
5499        @Description(shortDefinition="Who will receive payment", formalDefinition="Who will receive payment." )
5500        protected Reference recipient;
5501
5502        /**
5503         * Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.
5504         */
5505        @Child(name = "linkId", type = {StringType.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5506        @Description(shortDefinition="Pointer to specific item", formalDefinition="Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse." )
5507        protected List<StringType> linkId;
5508
5509        /**
5510         * A set of security labels that define which terms are controlled by this condition.
5511         */
5512        @Child(name = "securityLabelNumber", type = {UnsignedIntType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5513        @Description(shortDefinition="Security Labels that define affected terms", formalDefinition="A set of security labels that define which terms are controlled by this condition." )
5514        protected List<UnsignedIntType> securityLabelNumber;
5515
5516        private static final long serialVersionUID = 915998998L;
5517
5518    /**
5519     * Constructor
5520     */
5521      public ValuedItemComponent() {
5522        super();
5523      }
5524
5525        /**
5526         * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.)
5527         */
5528        public DataType getEntity() { 
5529          return this.entity;
5530        }
5531
5532        /**
5533         * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.)
5534         */
5535        public CodeableConcept getEntityCodeableConcept() throws FHIRException { 
5536          if (this.entity == null)
5537            this.entity = new CodeableConcept();
5538          if (!(this.entity instanceof CodeableConcept))
5539            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.entity.getClass().getName()+" was encountered");
5540          return (CodeableConcept) this.entity;
5541        }
5542
5543        public boolean hasEntityCodeableConcept() { 
5544          return this != null && this.entity instanceof CodeableConcept;
5545        }
5546
5547        /**
5548         * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.)
5549         */
5550        public Reference getEntityReference() throws FHIRException { 
5551          if (this.entity == null)
5552            this.entity = new Reference();
5553          if (!(this.entity instanceof Reference))
5554            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.entity.getClass().getName()+" was encountered");
5555          return (Reference) this.entity;
5556        }
5557
5558        public boolean hasEntityReference() { 
5559          return this != null && this.entity instanceof Reference;
5560        }
5561
5562        public boolean hasEntity() { 
5563          return this.entity != null && !this.entity.isEmpty();
5564        }
5565
5566        /**
5567         * @param value {@link #entity} (Specific type of Contract Valued Item that may be priced.)
5568         */
5569        public ValuedItemComponent setEntity(DataType value) { 
5570          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
5571            throw new Error("Not the right type for Contract.term.asset.valuedItem.entity[x]: "+value.fhirType());
5572          this.entity = value;
5573          return this;
5574        }
5575
5576        /**
5577         * @return {@link #identifier} (Identifies a Contract Valued Item instance.)
5578         */
5579        public Identifier getIdentifier() { 
5580          if (this.identifier == null)
5581            if (Configuration.errorOnAutoCreate())
5582              throw new Error("Attempt to auto-create ValuedItemComponent.identifier");
5583            else if (Configuration.doAutoCreate())
5584              this.identifier = new Identifier(); // cc
5585          return this.identifier;
5586        }
5587
5588        public boolean hasIdentifier() { 
5589          return this.identifier != null && !this.identifier.isEmpty();
5590        }
5591
5592        /**
5593         * @param value {@link #identifier} (Identifies a Contract Valued Item instance.)
5594         */
5595        public ValuedItemComponent setIdentifier(Identifier value) { 
5596          this.identifier = value;
5597          return this;
5598        }
5599
5600        /**
5601         * @return {@link #effectiveTime} (Indicates the time during which this Contract ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value
5602         */
5603        public DateTimeType getEffectiveTimeElement() { 
5604          if (this.effectiveTime == null)
5605            if (Configuration.errorOnAutoCreate())
5606              throw new Error("Attempt to auto-create ValuedItemComponent.effectiveTime");
5607            else if (Configuration.doAutoCreate())
5608              this.effectiveTime = new DateTimeType(); // bb
5609          return this.effectiveTime;
5610        }
5611
5612        public boolean hasEffectiveTimeElement() { 
5613          return this.effectiveTime != null && !this.effectiveTime.isEmpty();
5614        }
5615
5616        public boolean hasEffectiveTime() { 
5617          return this.effectiveTime != null && !this.effectiveTime.isEmpty();
5618        }
5619
5620        /**
5621         * @param value {@link #effectiveTime} (Indicates the time during which this Contract ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value
5622         */
5623        public ValuedItemComponent setEffectiveTimeElement(DateTimeType value) { 
5624          this.effectiveTime = value;
5625          return this;
5626        }
5627
5628        /**
5629         * @return Indicates the time during which this Contract ValuedItem information is effective.
5630         */
5631        public Date getEffectiveTime() { 
5632          return this.effectiveTime == null ? null : this.effectiveTime.getValue();
5633        }
5634
5635        /**
5636         * @param value Indicates the time during which this Contract ValuedItem information is effective.
5637         */
5638        public ValuedItemComponent setEffectiveTime(Date value) { 
5639          if (value == null)
5640            this.effectiveTime = null;
5641          else {
5642            if (this.effectiveTime == null)
5643              this.effectiveTime = new DateTimeType();
5644            this.effectiveTime.setValue(value);
5645          }
5646          return this;
5647        }
5648
5649        /**
5650         * @return {@link #quantity} (Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.)
5651         */
5652        public Quantity getQuantity() { 
5653          if (this.quantity == null)
5654            if (Configuration.errorOnAutoCreate())
5655              throw new Error("Attempt to auto-create ValuedItemComponent.quantity");
5656            else if (Configuration.doAutoCreate())
5657              this.quantity = new Quantity(); // cc
5658          return this.quantity;
5659        }
5660
5661        public boolean hasQuantity() { 
5662          return this.quantity != null && !this.quantity.isEmpty();
5663        }
5664
5665        /**
5666         * @param value {@link #quantity} (Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.)
5667         */
5668        public ValuedItemComponent setQuantity(Quantity value) { 
5669          this.quantity = value;
5670          return this;
5671        }
5672
5673        /**
5674         * @return {@link #unitPrice} (A Contract Valued Item unit valuation measure.)
5675         */
5676        public Money getUnitPrice() { 
5677          if (this.unitPrice == null)
5678            if (Configuration.errorOnAutoCreate())
5679              throw new Error("Attempt to auto-create ValuedItemComponent.unitPrice");
5680            else if (Configuration.doAutoCreate())
5681              this.unitPrice = new Money(); // cc
5682          return this.unitPrice;
5683        }
5684
5685        public boolean hasUnitPrice() { 
5686          return this.unitPrice != null && !this.unitPrice.isEmpty();
5687        }
5688
5689        /**
5690         * @param value {@link #unitPrice} (A Contract Valued Item unit valuation measure.)
5691         */
5692        public ValuedItemComponent setUnitPrice(Money value) { 
5693          this.unitPrice = value;
5694          return this;
5695        }
5696
5697        /**
5698         * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
5699         */
5700        public DecimalType getFactorElement() { 
5701          if (this.factor == null)
5702            if (Configuration.errorOnAutoCreate())
5703              throw new Error("Attempt to auto-create ValuedItemComponent.factor");
5704            else if (Configuration.doAutoCreate())
5705              this.factor = new DecimalType(); // bb
5706          return this.factor;
5707        }
5708
5709        public boolean hasFactorElement() { 
5710          return this.factor != null && !this.factor.isEmpty();
5711        }
5712
5713        public boolean hasFactor() { 
5714          return this.factor != null && !this.factor.isEmpty();
5715        }
5716
5717        /**
5718         * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
5719         */
5720        public ValuedItemComponent setFactorElement(DecimalType value) { 
5721          this.factor = value;
5722          return this;
5723        }
5724
5725        /**
5726         * @return A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
5727         */
5728        public BigDecimal getFactor() { 
5729          return this.factor == null ? null : this.factor.getValue();
5730        }
5731
5732        /**
5733         * @param value A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
5734         */
5735        public ValuedItemComponent setFactor(BigDecimal value) { 
5736          if (value == null)
5737            this.factor = null;
5738          else {
5739            if (this.factor == null)
5740              this.factor = new DecimalType();
5741            this.factor.setValue(value);
5742          }
5743          return this;
5744        }
5745
5746        /**
5747         * @param value A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
5748         */
5749        public ValuedItemComponent setFactor(long value) { 
5750              this.factor = new DecimalType();
5751            this.factor.setValue(value);
5752          return this;
5753        }
5754
5755        /**
5756         * @param value A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
5757         */
5758        public ValuedItemComponent setFactor(double value) { 
5759              this.factor = new DecimalType();
5760            this.factor.setValue(value);
5761          return this;
5762        }
5763
5764        /**
5765         * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value
5766         */
5767        public DecimalType getPointsElement() { 
5768          if (this.points == null)
5769            if (Configuration.errorOnAutoCreate())
5770              throw new Error("Attempt to auto-create ValuedItemComponent.points");
5771            else if (Configuration.doAutoCreate())
5772              this.points = new DecimalType(); // bb
5773          return this.points;
5774        }
5775
5776        public boolean hasPointsElement() { 
5777          return this.points != null && !this.points.isEmpty();
5778        }
5779
5780        public boolean hasPoints() { 
5781          return this.points != null && !this.points.isEmpty();
5782        }
5783
5784        /**
5785         * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value
5786         */
5787        public ValuedItemComponent setPointsElement(DecimalType value) { 
5788          this.points = value;
5789          return this;
5790        }
5791
5792        /**
5793         * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.
5794         */
5795        public BigDecimal getPoints() { 
5796          return this.points == null ? null : this.points.getValue();
5797        }
5798
5799        /**
5800         * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.
5801         */
5802        public ValuedItemComponent setPoints(BigDecimal value) { 
5803          if (value == null)
5804            this.points = null;
5805          else {
5806            if (this.points == null)
5807              this.points = new DecimalType();
5808            this.points.setValue(value);
5809          }
5810          return this;
5811        }
5812
5813        /**
5814         * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.
5815         */
5816        public ValuedItemComponent setPoints(long value) { 
5817              this.points = new DecimalType();
5818            this.points.setValue(value);
5819          return this;
5820        }
5821
5822        /**
5823         * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.
5824         */
5825        public ValuedItemComponent setPoints(double value) { 
5826              this.points = new DecimalType();
5827            this.points.setValue(value);
5828          return this;
5829        }
5830
5831        /**
5832         * @return {@link #net} (Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.)
5833         */
5834        public Money getNet() { 
5835          if (this.net == null)
5836            if (Configuration.errorOnAutoCreate())
5837              throw new Error("Attempt to auto-create ValuedItemComponent.net");
5838            else if (Configuration.doAutoCreate())
5839              this.net = new Money(); // cc
5840          return this.net;
5841        }
5842
5843        public boolean hasNet() { 
5844          return this.net != null && !this.net.isEmpty();
5845        }
5846
5847        /**
5848         * @param value {@link #net} (Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.)
5849         */
5850        public ValuedItemComponent setNet(Money value) { 
5851          this.net = value;
5852          return this;
5853        }
5854
5855        /**
5856         * @return {@link #payment} (Terms of valuation.). This is the underlying object with id, value and extensions. The accessor "getPayment" gives direct access to the value
5857         */
5858        public StringType getPaymentElement() { 
5859          if (this.payment == null)
5860            if (Configuration.errorOnAutoCreate())
5861              throw new Error("Attempt to auto-create ValuedItemComponent.payment");
5862            else if (Configuration.doAutoCreate())
5863              this.payment = new StringType(); // bb
5864          return this.payment;
5865        }
5866
5867        public boolean hasPaymentElement() { 
5868          return this.payment != null && !this.payment.isEmpty();
5869        }
5870
5871        public boolean hasPayment() { 
5872          return this.payment != null && !this.payment.isEmpty();
5873        }
5874
5875        /**
5876         * @param value {@link #payment} (Terms of valuation.). This is the underlying object with id, value and extensions. The accessor "getPayment" gives direct access to the value
5877         */
5878        public ValuedItemComponent setPaymentElement(StringType value) { 
5879          this.payment = value;
5880          return this;
5881        }
5882
5883        /**
5884         * @return Terms of valuation.
5885         */
5886        public String getPayment() { 
5887          return this.payment == null ? null : this.payment.getValue();
5888        }
5889
5890        /**
5891         * @param value Terms of valuation.
5892         */
5893        public ValuedItemComponent setPayment(String value) { 
5894          if (Utilities.noString(value))
5895            this.payment = null;
5896          else {
5897            if (this.payment == null)
5898              this.payment = new StringType();
5899            this.payment.setValue(value);
5900          }
5901          return this;
5902        }
5903
5904        /**
5905         * @return {@link #paymentDate} (When payment is due.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value
5906         */
5907        public DateTimeType getPaymentDateElement() { 
5908          if (this.paymentDate == null)
5909            if (Configuration.errorOnAutoCreate())
5910              throw new Error("Attempt to auto-create ValuedItemComponent.paymentDate");
5911            else if (Configuration.doAutoCreate())
5912              this.paymentDate = new DateTimeType(); // bb
5913          return this.paymentDate;
5914        }
5915
5916        public boolean hasPaymentDateElement() { 
5917          return this.paymentDate != null && !this.paymentDate.isEmpty();
5918        }
5919
5920        public boolean hasPaymentDate() { 
5921          return this.paymentDate != null && !this.paymentDate.isEmpty();
5922        }
5923
5924        /**
5925         * @param value {@link #paymentDate} (When payment is due.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value
5926         */
5927        public ValuedItemComponent setPaymentDateElement(DateTimeType value) { 
5928          this.paymentDate = value;
5929          return this;
5930        }
5931
5932        /**
5933         * @return When payment is due.
5934         */
5935        public Date getPaymentDate() { 
5936          return this.paymentDate == null ? null : this.paymentDate.getValue();
5937        }
5938
5939        /**
5940         * @param value When payment is due.
5941         */
5942        public ValuedItemComponent setPaymentDate(Date value) { 
5943          if (value == null)
5944            this.paymentDate = null;
5945          else {
5946            if (this.paymentDate == null)
5947              this.paymentDate = new DateTimeType();
5948            this.paymentDate.setValue(value);
5949          }
5950          return this;
5951        }
5952
5953        /**
5954         * @return {@link #responsible} (Who will make payment.)
5955         */
5956        public Reference getResponsible() { 
5957          if (this.responsible == null)
5958            if (Configuration.errorOnAutoCreate())
5959              throw new Error("Attempt to auto-create ValuedItemComponent.responsible");
5960            else if (Configuration.doAutoCreate())
5961              this.responsible = new Reference(); // cc
5962          return this.responsible;
5963        }
5964
5965        public boolean hasResponsible() { 
5966          return this.responsible != null && !this.responsible.isEmpty();
5967        }
5968
5969        /**
5970         * @param value {@link #responsible} (Who will make payment.)
5971         */
5972        public ValuedItemComponent setResponsible(Reference value) { 
5973          this.responsible = value;
5974          return this;
5975        }
5976
5977        /**
5978         * @return {@link #recipient} (Who will receive payment.)
5979         */
5980        public Reference getRecipient() { 
5981          if (this.recipient == null)
5982            if (Configuration.errorOnAutoCreate())
5983              throw new Error("Attempt to auto-create ValuedItemComponent.recipient");
5984            else if (Configuration.doAutoCreate())
5985              this.recipient = new Reference(); // cc
5986          return this.recipient;
5987        }
5988
5989        public boolean hasRecipient() { 
5990          return this.recipient != null && !this.recipient.isEmpty();
5991        }
5992
5993        /**
5994         * @param value {@link #recipient} (Who will receive payment.)
5995         */
5996        public ValuedItemComponent setRecipient(Reference value) { 
5997          this.recipient = value;
5998          return this;
5999        }
6000
6001        /**
6002         * @return {@link #linkId} (Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.)
6003         */
6004        public List<StringType> getLinkId() { 
6005          if (this.linkId == null)
6006            this.linkId = new ArrayList<StringType>();
6007          return this.linkId;
6008        }
6009
6010        /**
6011         * @return Returns a reference to <code>this</code> for easy method chaining
6012         */
6013        public ValuedItemComponent setLinkId(List<StringType> theLinkId) { 
6014          this.linkId = theLinkId;
6015          return this;
6016        }
6017
6018        public boolean hasLinkId() { 
6019          if (this.linkId == null)
6020            return false;
6021          for (StringType item : this.linkId)
6022            if (!item.isEmpty())
6023              return true;
6024          return false;
6025        }
6026
6027        /**
6028         * @return {@link #linkId} (Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.)
6029         */
6030        public StringType addLinkIdElement() {//2 
6031          StringType t = new StringType();
6032          if (this.linkId == null)
6033            this.linkId = new ArrayList<StringType>();
6034          this.linkId.add(t);
6035          return t;
6036        }
6037
6038        /**
6039         * @param value {@link #linkId} (Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.)
6040         */
6041        public ValuedItemComponent addLinkId(String value) { //1
6042          StringType t = new StringType();
6043          t.setValue(value);
6044          if (this.linkId == null)
6045            this.linkId = new ArrayList<StringType>();
6046          this.linkId.add(t);
6047          return this;
6048        }
6049
6050        /**
6051         * @param value {@link #linkId} (Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.)
6052         */
6053        public boolean hasLinkId(String value) { 
6054          if (this.linkId == null)
6055            return false;
6056          for (StringType v : this.linkId)
6057            if (v.getValue().equals(value)) // string
6058              return true;
6059          return false;
6060        }
6061
6062        /**
6063         * @return {@link #securityLabelNumber} (A set of security labels that define which terms are controlled by this condition.)
6064         */
6065        public List<UnsignedIntType> getSecurityLabelNumber() { 
6066          if (this.securityLabelNumber == null)
6067            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
6068          return this.securityLabelNumber;
6069        }
6070
6071        /**
6072         * @return Returns a reference to <code>this</code> for easy method chaining
6073         */
6074        public ValuedItemComponent setSecurityLabelNumber(List<UnsignedIntType> theSecurityLabelNumber) { 
6075          this.securityLabelNumber = theSecurityLabelNumber;
6076          return this;
6077        }
6078
6079        public boolean hasSecurityLabelNumber() { 
6080          if (this.securityLabelNumber == null)
6081            return false;
6082          for (UnsignedIntType item : this.securityLabelNumber)
6083            if (!item.isEmpty())
6084              return true;
6085          return false;
6086        }
6087
6088        /**
6089         * @return {@link #securityLabelNumber} (A set of security labels that define which terms are controlled by this condition.)
6090         */
6091        public UnsignedIntType addSecurityLabelNumberElement() {//2 
6092          UnsignedIntType t = new UnsignedIntType();
6093          if (this.securityLabelNumber == null)
6094            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
6095          this.securityLabelNumber.add(t);
6096          return t;
6097        }
6098
6099        /**
6100         * @param value {@link #securityLabelNumber} (A set of security labels that define which terms are controlled by this condition.)
6101         */
6102        public ValuedItemComponent addSecurityLabelNumber(int value) { //1
6103          UnsignedIntType t = new UnsignedIntType();
6104          t.setValue(value);
6105          if (this.securityLabelNumber == null)
6106            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
6107          this.securityLabelNumber.add(t);
6108          return this;
6109        }
6110
6111        /**
6112         * @param value {@link #securityLabelNumber} (A set of security labels that define which terms are controlled by this condition.)
6113         */
6114        public boolean hasSecurityLabelNumber(int value) { 
6115          if (this.securityLabelNumber == null)
6116            return false;
6117          for (UnsignedIntType v : this.securityLabelNumber)
6118            if (v.getValue().equals(value)) // unsignedInt
6119              return true;
6120          return false;
6121        }
6122
6123        protected void listChildren(List<Property> children) {
6124          super.listChildren(children);
6125          children.add(new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, 1, entity));
6126          children.add(new Property("identifier", "Identifier", "Identifies a Contract Valued Item instance.", 0, 1, identifier));
6127          children.add(new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract ValuedItem information is effective.", 0, 1, effectiveTime));
6128          children.add(new Property("quantity", "Quantity", "Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.", 0, 1, quantity));
6129          children.add(new Property("unitPrice", "Money", "A Contract Valued Item unit valuation measure.", 0, 1, unitPrice));
6130          children.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, 1, factor));
6131          children.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.", 0, 1, points));
6132          children.add(new Property("net", "Money", "Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, 1, net));
6133          children.add(new Property("payment", "string", "Terms of valuation.", 0, 1, payment));
6134          children.add(new Property("paymentDate", "dateTime", "When payment is due.", 0, 1, paymentDate));
6135          children.add(new Property("responsible", "Reference(Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "Who will make payment.", 0, 1, responsible));
6136          children.add(new Property("recipient", "Reference(Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "Who will receive payment.", 0, 1, recipient));
6137          children.add(new Property("linkId", "string", "Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, linkId));
6138          children.add(new Property("securityLabelNumber", "unsignedInt", "A set of security labels that define which terms are controlled by this condition.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber));
6139        }
6140
6141        @Override
6142        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6143          switch (_hash) {
6144          case -740568643: /*entity[x]*/  return new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, 1, entity);
6145          case -1298275357: /*entity*/  return new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, 1, entity);
6146          case 924197182: /*entityCodeableConcept*/  return new Property("entity[x]", "CodeableConcept", "Specific type of Contract Valued Item that may be priced.", 0, 1, entity);
6147          case -356635992: /*entityReference*/  return new Property("entity[x]", "Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, 1, entity);
6148          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifies a Contract Valued Item instance.", 0, 1, identifier);
6149          case -929905388: /*effectiveTime*/  return new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract ValuedItem information is effective.", 0, 1, effectiveTime);
6150          case -1285004149: /*quantity*/  return new Property("quantity", "Quantity", "Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.", 0, 1, quantity);
6151          case -486196699: /*unitPrice*/  return new Property("unitPrice", "Money", "A Contract Valued Item unit valuation measure.", 0, 1, unitPrice);
6152          case -1282148017: /*factor*/  return new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, 1, factor);
6153          case -982754077: /*points*/  return new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.", 0, 1, points);
6154          case 108957: /*net*/  return new Property("net", "Money", "Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, 1, net);
6155          case -786681338: /*payment*/  return new Property("payment", "string", "Terms of valuation.", 0, 1, payment);
6156          case -1540873516: /*paymentDate*/  return new Property("paymentDate", "dateTime", "When payment is due.", 0, 1, paymentDate);
6157          case 1847674614: /*responsible*/  return new Property("responsible", "Reference(Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "Who will make payment.", 0, 1, responsible);
6158          case 820081177: /*recipient*/  return new Property("recipient", "Reference(Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "Who will receive payment.", 0, 1, recipient);
6159          case -1102667083: /*linkId*/  return new Property("linkId", "string", "Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, linkId);
6160          case -149460995: /*securityLabelNumber*/  return new Property("securityLabelNumber", "unsignedInt", "A set of security labels that define which terms are controlled by this condition.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber);
6161          default: return super.getNamedProperty(_hash, _name, _checkValid);
6162          }
6163
6164        }
6165
6166      @Override
6167      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6168        switch (hash) {
6169        case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : new Base[] {this.entity}; // DataType
6170        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
6171        case -929905388: /*effectiveTime*/ return this.effectiveTime == null ? new Base[0] : new Base[] {this.effectiveTime}; // DateTimeType
6172        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
6173        case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money
6174        case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType
6175        case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType
6176        case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money
6177        case -786681338: /*payment*/ return this.payment == null ? new Base[0] : new Base[] {this.payment}; // StringType
6178        case -1540873516: /*paymentDate*/ return this.paymentDate == null ? new Base[0] : new Base[] {this.paymentDate}; // DateTimeType
6179        case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // Reference
6180        case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : new Base[] {this.recipient}; // Reference
6181        case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : this.linkId.toArray(new Base[this.linkId.size()]); // StringType
6182        case -149460995: /*securityLabelNumber*/ return this.securityLabelNumber == null ? new Base[0] : this.securityLabelNumber.toArray(new Base[this.securityLabelNumber.size()]); // UnsignedIntType
6183        default: return super.getProperty(hash, name, checkValid);
6184        }
6185
6186      }
6187
6188      @Override
6189      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6190        switch (hash) {
6191        case -1298275357: // entity
6192          this.entity = TypeConvertor.castToType(value); // DataType
6193          return value;
6194        case -1618432855: // identifier
6195          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
6196          return value;
6197        case -929905388: // effectiveTime
6198          this.effectiveTime = TypeConvertor.castToDateTime(value); // DateTimeType
6199          return value;
6200        case -1285004149: // quantity
6201          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
6202          return value;
6203        case -486196699: // unitPrice
6204          this.unitPrice = TypeConvertor.castToMoney(value); // Money
6205          return value;
6206        case -1282148017: // factor
6207          this.factor = TypeConvertor.castToDecimal(value); // DecimalType
6208          return value;
6209        case -982754077: // points
6210          this.points = TypeConvertor.castToDecimal(value); // DecimalType
6211          return value;
6212        case 108957: // net
6213          this.net = TypeConvertor.castToMoney(value); // Money
6214          return value;
6215        case -786681338: // payment
6216          this.payment = TypeConvertor.castToString(value); // StringType
6217          return value;
6218        case -1540873516: // paymentDate
6219          this.paymentDate = TypeConvertor.castToDateTime(value); // DateTimeType
6220          return value;
6221        case 1847674614: // responsible
6222          this.responsible = TypeConvertor.castToReference(value); // Reference
6223          return value;
6224        case 820081177: // recipient
6225          this.recipient = TypeConvertor.castToReference(value); // Reference
6226          return value;
6227        case -1102667083: // linkId
6228          this.getLinkId().add(TypeConvertor.castToString(value)); // StringType
6229          return value;
6230        case -149460995: // securityLabelNumber
6231          this.getSecurityLabelNumber().add(TypeConvertor.castToUnsignedInt(value)); // UnsignedIntType
6232          return value;
6233        default: return super.setProperty(hash, name, value);
6234        }
6235
6236      }
6237
6238      @Override
6239      public Base setProperty(String name, Base value) throws FHIRException {
6240        if (name.equals("entity[x]")) {
6241          this.entity = TypeConvertor.castToType(value); // DataType
6242        } else if (name.equals("identifier")) {
6243          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
6244        } else if (name.equals("effectiveTime")) {
6245          this.effectiveTime = TypeConvertor.castToDateTime(value); // DateTimeType
6246        } else if (name.equals("quantity")) {
6247          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
6248        } else if (name.equals("unitPrice")) {
6249          this.unitPrice = TypeConvertor.castToMoney(value); // Money
6250        } else if (name.equals("factor")) {
6251          this.factor = TypeConvertor.castToDecimal(value); // DecimalType
6252        } else if (name.equals("points")) {
6253          this.points = TypeConvertor.castToDecimal(value); // DecimalType
6254        } else if (name.equals("net")) {
6255          this.net = TypeConvertor.castToMoney(value); // Money
6256        } else if (name.equals("payment")) {
6257          this.payment = TypeConvertor.castToString(value); // StringType
6258        } else if (name.equals("paymentDate")) {
6259          this.paymentDate = TypeConvertor.castToDateTime(value); // DateTimeType
6260        } else if (name.equals("responsible")) {
6261          this.responsible = TypeConvertor.castToReference(value); // Reference
6262        } else if (name.equals("recipient")) {
6263          this.recipient = TypeConvertor.castToReference(value); // Reference
6264        } else if (name.equals("linkId")) {
6265          this.getLinkId().add(TypeConvertor.castToString(value));
6266        } else if (name.equals("securityLabelNumber")) {
6267          this.getSecurityLabelNumber().add(TypeConvertor.castToUnsignedInt(value));
6268        } else
6269          return super.setProperty(name, value);
6270        return value;
6271      }
6272
6273      @Override
6274      public Base makeProperty(int hash, String name) throws FHIRException {
6275        switch (hash) {
6276        case -740568643:  return getEntity();
6277        case -1298275357:  return getEntity();
6278        case -1618432855:  return getIdentifier();
6279        case -929905388:  return getEffectiveTimeElement();
6280        case -1285004149:  return getQuantity();
6281        case -486196699:  return getUnitPrice();
6282        case -1282148017:  return getFactorElement();
6283        case -982754077:  return getPointsElement();
6284        case 108957:  return getNet();
6285        case -786681338:  return getPaymentElement();
6286        case -1540873516:  return getPaymentDateElement();
6287        case 1847674614:  return getResponsible();
6288        case 820081177:  return getRecipient();
6289        case -1102667083:  return addLinkIdElement();
6290        case -149460995:  return addSecurityLabelNumberElement();
6291        default: return super.makeProperty(hash, name);
6292        }
6293
6294      }
6295
6296      @Override
6297      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6298        switch (hash) {
6299        case -1298275357: /*entity*/ return new String[] {"CodeableConcept", "Reference"};
6300        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
6301        case -929905388: /*effectiveTime*/ return new String[] {"dateTime"};
6302        case -1285004149: /*quantity*/ return new String[] {"Quantity"};
6303        case -486196699: /*unitPrice*/ return new String[] {"Money"};
6304        case -1282148017: /*factor*/ return new String[] {"decimal"};
6305        case -982754077: /*points*/ return new String[] {"decimal"};
6306        case 108957: /*net*/ return new String[] {"Money"};
6307        case -786681338: /*payment*/ return new String[] {"string"};
6308        case -1540873516: /*paymentDate*/ return new String[] {"dateTime"};
6309        case 1847674614: /*responsible*/ return new String[] {"Reference"};
6310        case 820081177: /*recipient*/ return new String[] {"Reference"};
6311        case -1102667083: /*linkId*/ return new String[] {"string"};
6312        case -149460995: /*securityLabelNumber*/ return new String[] {"unsignedInt"};
6313        default: return super.getTypesForProperty(hash, name);
6314        }
6315
6316      }
6317
6318      @Override
6319      public Base addChild(String name) throws FHIRException {
6320        if (name.equals("entityCodeableConcept")) {
6321          this.entity = new CodeableConcept();
6322          return this.entity;
6323        }
6324        else if (name.equals("entityReference")) {
6325          this.entity = new Reference();
6326          return this.entity;
6327        }
6328        else if (name.equals("identifier")) {
6329          this.identifier = new Identifier();
6330          return this.identifier;
6331        }
6332        else if (name.equals("effectiveTime")) {
6333          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.asset.valuedItem.effectiveTime");
6334        }
6335        else if (name.equals("quantity")) {
6336          this.quantity = new Quantity();
6337          return this.quantity;
6338        }
6339        else if (name.equals("unitPrice")) {
6340          this.unitPrice = new Money();
6341          return this.unitPrice;
6342        }
6343        else if (name.equals("factor")) {
6344          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.asset.valuedItem.factor");
6345        }
6346        else if (name.equals("points")) {
6347          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.asset.valuedItem.points");
6348        }
6349        else if (name.equals("net")) {
6350          this.net = new Money();
6351          return this.net;
6352        }
6353        else if (name.equals("payment")) {
6354          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.asset.valuedItem.payment");
6355        }
6356        else if (name.equals("paymentDate")) {
6357          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.asset.valuedItem.paymentDate");
6358        }
6359        else if (name.equals("responsible")) {
6360          this.responsible = new Reference();
6361          return this.responsible;
6362        }
6363        else if (name.equals("recipient")) {
6364          this.recipient = new Reference();
6365          return this.recipient;
6366        }
6367        else if (name.equals("linkId")) {
6368          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.asset.valuedItem.linkId");
6369        }
6370        else if (name.equals("securityLabelNumber")) {
6371          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.asset.valuedItem.securityLabelNumber");
6372        }
6373        else
6374          return super.addChild(name);
6375      }
6376
6377      public ValuedItemComponent copy() {
6378        ValuedItemComponent dst = new ValuedItemComponent();
6379        copyValues(dst);
6380        return dst;
6381      }
6382
6383      public void copyValues(ValuedItemComponent dst) {
6384        super.copyValues(dst);
6385        dst.entity = entity == null ? null : entity.copy();
6386        dst.identifier = identifier == null ? null : identifier.copy();
6387        dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy();
6388        dst.quantity = quantity == null ? null : quantity.copy();
6389        dst.unitPrice = unitPrice == null ? null : unitPrice.copy();
6390        dst.factor = factor == null ? null : factor.copy();
6391        dst.points = points == null ? null : points.copy();
6392        dst.net = net == null ? null : net.copy();
6393        dst.payment = payment == null ? null : payment.copy();
6394        dst.paymentDate = paymentDate == null ? null : paymentDate.copy();
6395        dst.responsible = responsible == null ? null : responsible.copy();
6396        dst.recipient = recipient == null ? null : recipient.copy();
6397        if (linkId != null) {
6398          dst.linkId = new ArrayList<StringType>();
6399          for (StringType i : linkId)
6400            dst.linkId.add(i.copy());
6401        };
6402        if (securityLabelNumber != null) {
6403          dst.securityLabelNumber = new ArrayList<UnsignedIntType>();
6404          for (UnsignedIntType i : securityLabelNumber)
6405            dst.securityLabelNumber.add(i.copy());
6406        };
6407      }
6408
6409      @Override
6410      public boolean equalsDeep(Base other_) {
6411        if (!super.equalsDeep(other_))
6412          return false;
6413        if (!(other_ instanceof ValuedItemComponent))
6414          return false;
6415        ValuedItemComponent o = (ValuedItemComponent) other_;
6416        return compareDeep(entity, o.entity, true) && compareDeep(identifier, o.identifier, true) && compareDeep(effectiveTime, o.effectiveTime, true)
6417           && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true)
6418           && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) && compareDeep(payment, o.payment, true)
6419           && compareDeep(paymentDate, o.paymentDate, true) && compareDeep(responsible, o.responsible, true)
6420           && compareDeep(recipient, o.recipient, true) && compareDeep(linkId, o.linkId, true) && compareDeep(securityLabelNumber, o.securityLabelNumber, true)
6421          ;
6422      }
6423
6424      @Override
6425      public boolean equalsShallow(Base other_) {
6426        if (!super.equalsShallow(other_))
6427          return false;
6428        if (!(other_ instanceof ValuedItemComponent))
6429          return false;
6430        ValuedItemComponent o = (ValuedItemComponent) other_;
6431        return compareValues(effectiveTime, o.effectiveTime, true) && compareValues(factor, o.factor, true)
6432           && compareValues(points, o.points, true) && compareValues(payment, o.payment, true) && compareValues(paymentDate, o.paymentDate, true)
6433           && compareValues(linkId, o.linkId, true) && compareValues(securityLabelNumber, o.securityLabelNumber, true)
6434          ;
6435      }
6436
6437      public boolean isEmpty() {
6438        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(entity, identifier, effectiveTime
6439          , quantity, unitPrice, factor, points, net, payment, paymentDate, responsible
6440          , recipient, linkId, securityLabelNumber);
6441      }
6442
6443  public String fhirType() {
6444    return "Contract.term.asset.valuedItem";
6445
6446  }
6447
6448  }
6449
6450    @Block()
6451    public static class ActionComponent extends BackboneElement implements IBaseBackboneElement {
6452        /**
6453         * True if the term prohibits the  action.
6454         */
6455        @Child(name = "doNotPerform", type = {BooleanType.class}, order=1, min=0, max=1, modifier=true, summary=false)
6456        @Description(shortDefinition="True if the term prohibits the  action", formalDefinition="True if the term prohibits the  action." )
6457        protected BooleanType doNotPerform;
6458
6459        /**
6460         * Activity or service obligation to be done or not done, performed or not performed, effectuated or not by this Contract term.
6461         */
6462        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false)
6463        @Description(shortDefinition="Type or form of the action", formalDefinition="Activity or service obligation to be done or not done, performed or not performed, effectuated or not by this Contract term." )
6464        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-action")
6465        protected CodeableConcept type;
6466
6467        /**
6468         * Entity of the action.
6469         */
6470        @Child(name = "subject", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6471        @Description(shortDefinition="Entity of the action", formalDefinition="Entity of the action." )
6472        protected List<ActionSubjectComponent> subject;
6473
6474        /**
6475         * Reason or purpose for the action stipulated by this Contract Provision.
6476         */
6477        @Child(name = "intent", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=false)
6478        @Description(shortDefinition="Purpose for the Contract Term Action", formalDefinition="Reason or purpose for the action stipulated by this Contract Provision." )
6479        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-PurposeOfUse")
6480        protected CodeableConcept intent;
6481
6482        /**
6483         * Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.
6484         */
6485        @Child(name = "linkId", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6486        @Description(shortDefinition="Pointer to specific item", formalDefinition="Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse." )
6487        protected List<StringType> linkId;
6488
6489        /**
6490         * Current state of the term action.
6491         */
6492        @Child(name = "status", type = {CodeableConcept.class}, order=6, min=1, max=1, modifier=false, summary=false)
6493        @Description(shortDefinition="State of the action", formalDefinition="Current state of the term action." )
6494        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-actionstatus")
6495        protected CodeableConcept status;
6496
6497        /**
6498         * Encounter or Episode with primary association to specified term activity.
6499         */
6500        @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=7, min=0, max=1, modifier=false, summary=false)
6501        @Description(shortDefinition="Episode associated with action", formalDefinition="Encounter or Episode with primary association to specified term activity." )
6502        protected Reference context;
6503
6504        /**
6505         * Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.
6506         */
6507        @Child(name = "contextLinkId", type = {StringType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6508        @Description(shortDefinition="Pointer to specific item", formalDefinition="Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse." )
6509        protected List<StringType> contextLinkId;
6510
6511        /**
6512         * When action happens.
6513         */
6514        @Child(name = "occurrence", type = {DateTimeType.class, Period.class, Timing.class}, order=9, min=0, max=1, modifier=false, summary=false)
6515        @Description(shortDefinition="When action happens", formalDefinition="When action happens." )
6516        protected DataType occurrence;
6517
6518        /**
6519         * Who or what initiated the action and has responsibility for its activation.
6520         */
6521        @Child(name = "requester", type = {Patient.class, RelatedPerson.class, Practitioner.class, PractitionerRole.class, Device.class, Group.class, Organization.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6522        @Description(shortDefinition="Who asked for action", formalDefinition="Who or what initiated the action and has responsibility for its activation." )
6523        protected List<Reference> requester;
6524
6525        /**
6526         * Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.
6527         */
6528        @Child(name = "requesterLinkId", type = {StringType.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6529        @Description(shortDefinition="Pointer to specific item", formalDefinition="Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse." )
6530        protected List<StringType> requesterLinkId;
6531
6532        /**
6533         * The type of individual that is desired or required to perform or not perform the action.
6534         */
6535        @Child(name = "performerType", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6536        @Description(shortDefinition="Kind of service performer", formalDefinition="The type of individual that is desired or required to perform or not perform the action." )
6537        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/provenance-participant-type")
6538        protected List<CodeableConcept> performerType;
6539
6540        /**
6541         * The type of role or competency of an individual desired or required to perform or not perform the action.
6542         */
6543        @Child(name = "performerRole", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=false)
6544        @Description(shortDefinition="Competency of the performer", formalDefinition="The type of role or competency of an individual desired or required to perform or not perform the action." )
6545        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/provenance-participant-role")
6546        protected CodeableConcept performerRole;
6547
6548        /**
6549         * Indicates who or what is being asked to perform (or not perform) the ction.
6550         */
6551        @Child(name = "performer", type = {RelatedPerson.class, Patient.class, Practitioner.class, PractitionerRole.class, CareTeam.class, Device.class, Substance.class, Organization.class, Location.class}, order=14, min=0, max=1, modifier=false, summary=false)
6552        @Description(shortDefinition="Actor that wil execute (or not) the action", formalDefinition="Indicates who or what is being asked to perform (or not perform) the ction." )
6553        protected Reference performer;
6554
6555        /**
6556         * Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.
6557         */
6558        @Child(name = "performerLinkId", type = {StringType.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6559        @Description(shortDefinition="Pointer to specific item", formalDefinition="Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse." )
6560        protected List<StringType> performerLinkId;
6561
6562        /**
6563         * Rationale for the action to be performed or not performed. Describes why the action is permitted or prohibited.
6564         */
6565        @Child(name = "reasonCode", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6566        @Description(shortDefinition="Why is action (not) needed?", formalDefinition="Rationale for the action to be performed or not performed. Describes why the action is permitted or prohibited." )
6567        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-PurposeOfUse")
6568        protected List<CodeableConcept> reasonCode;
6569
6570        /**
6571         * Indicates another resource whose existence justifies permitting or not permitting this action.
6572         */
6573        @Child(name = "reasonReference", type = {Condition.class, Observation.class, DiagnosticReport.class, DocumentReference.class, Questionnaire.class, QuestionnaireResponse.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6574        @Description(shortDefinition="Why is action (not) needed?", formalDefinition="Indicates another resource whose existence justifies permitting or not permitting this action." )
6575        protected List<Reference> reasonReference;
6576
6577        /**
6578         * Describes why the action is to be performed or not performed in textual form.
6579         */
6580        @Child(name = "reason", type = {StringType.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6581        @Description(shortDefinition="Why action is to be performed", formalDefinition="Describes why the action is to be performed or not performed in textual form." )
6582        protected List<StringType> reason;
6583
6584        /**
6585         * Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.
6586         */
6587        @Child(name = "reasonLinkId", type = {StringType.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6588        @Description(shortDefinition="Pointer to specific item", formalDefinition="Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse." )
6589        protected List<StringType> reasonLinkId;
6590
6591        /**
6592         * Comments made about the term action made by the requester, performer, subject or other participants.
6593         */
6594        @Child(name = "note", type = {Annotation.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6595        @Description(shortDefinition="Comments about the action", formalDefinition="Comments made about the term action made by the requester, performer, subject or other participants." )
6596        protected List<Annotation> note;
6597
6598        /**
6599         * Security labels that protects the action.
6600         */
6601        @Child(name = "securityLabelNumber", type = {UnsignedIntType.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6602        @Description(shortDefinition="Action restriction numbers", formalDefinition="Security labels that protects the action." )
6603        protected List<UnsignedIntType> securityLabelNumber;
6604
6605        private static final long serialVersionUID = -701731764L;
6606
6607    /**
6608     * Constructor
6609     */
6610      public ActionComponent() {
6611        super();
6612      }
6613
6614    /**
6615     * Constructor
6616     */
6617      public ActionComponent(CodeableConcept type, CodeableConcept intent, CodeableConcept status) {
6618        super();
6619        this.setType(type);
6620        this.setIntent(intent);
6621        this.setStatus(status);
6622      }
6623
6624        /**
6625         * @return {@link #doNotPerform} (True if the term prohibits the  action.). This is the underlying object with id, value and extensions. The accessor "getDoNotPerform" gives direct access to the value
6626         */
6627        public BooleanType getDoNotPerformElement() { 
6628          if (this.doNotPerform == null)
6629            if (Configuration.errorOnAutoCreate())
6630              throw new Error("Attempt to auto-create ActionComponent.doNotPerform");
6631            else if (Configuration.doAutoCreate())
6632              this.doNotPerform = new BooleanType(); // bb
6633          return this.doNotPerform;
6634        }
6635
6636        public boolean hasDoNotPerformElement() { 
6637          return this.doNotPerform != null && !this.doNotPerform.isEmpty();
6638        }
6639
6640        public boolean hasDoNotPerform() { 
6641          return this.doNotPerform != null && !this.doNotPerform.isEmpty();
6642        }
6643
6644        /**
6645         * @param value {@link #doNotPerform} (True if the term prohibits the  action.). This is the underlying object with id, value and extensions. The accessor "getDoNotPerform" gives direct access to the value
6646         */
6647        public ActionComponent setDoNotPerformElement(BooleanType value) { 
6648          this.doNotPerform = value;
6649          return this;
6650        }
6651
6652        /**
6653         * @return True if the term prohibits the  action.
6654         */
6655        public boolean getDoNotPerform() { 
6656          return this.doNotPerform == null || this.doNotPerform.isEmpty() ? false : this.doNotPerform.getValue();
6657        }
6658
6659        /**
6660         * @param value True if the term prohibits the  action.
6661         */
6662        public ActionComponent setDoNotPerform(boolean value) { 
6663            if (this.doNotPerform == null)
6664              this.doNotPerform = new BooleanType();
6665            this.doNotPerform.setValue(value);
6666          return this;
6667        }
6668
6669        /**
6670         * @return {@link #type} (Activity or service obligation to be done or not done, performed or not performed, effectuated or not by this Contract term.)
6671         */
6672        public CodeableConcept getType() { 
6673          if (this.type == null)
6674            if (Configuration.errorOnAutoCreate())
6675              throw new Error("Attempt to auto-create ActionComponent.type");
6676            else if (Configuration.doAutoCreate())
6677              this.type = new CodeableConcept(); // cc
6678          return this.type;
6679        }
6680
6681        public boolean hasType() { 
6682          return this.type != null && !this.type.isEmpty();
6683        }
6684
6685        /**
6686         * @param value {@link #type} (Activity or service obligation to be done or not done, performed or not performed, effectuated or not by this Contract term.)
6687         */
6688        public ActionComponent setType(CodeableConcept value) { 
6689          this.type = value;
6690          return this;
6691        }
6692
6693        /**
6694         * @return {@link #subject} (Entity of the action.)
6695         */
6696        public List<ActionSubjectComponent> getSubject() { 
6697          if (this.subject == null)
6698            this.subject = new ArrayList<ActionSubjectComponent>();
6699          return this.subject;
6700        }
6701
6702        /**
6703         * @return Returns a reference to <code>this</code> for easy method chaining
6704         */
6705        public ActionComponent setSubject(List<ActionSubjectComponent> theSubject) { 
6706          this.subject = theSubject;
6707          return this;
6708        }
6709
6710        public boolean hasSubject() { 
6711          if (this.subject == null)
6712            return false;
6713          for (ActionSubjectComponent item : this.subject)
6714            if (!item.isEmpty())
6715              return true;
6716          return false;
6717        }
6718
6719        public ActionSubjectComponent addSubject() { //3
6720          ActionSubjectComponent t = new ActionSubjectComponent();
6721          if (this.subject == null)
6722            this.subject = new ArrayList<ActionSubjectComponent>();
6723          this.subject.add(t);
6724          return t;
6725        }
6726
6727        public ActionComponent addSubject(ActionSubjectComponent t) { //3
6728          if (t == null)
6729            return this;
6730          if (this.subject == null)
6731            this.subject = new ArrayList<ActionSubjectComponent>();
6732          this.subject.add(t);
6733          return this;
6734        }
6735
6736        /**
6737         * @return The first repetition of repeating field {@link #subject}, creating it if it does not already exist {3}
6738         */
6739        public ActionSubjectComponent getSubjectFirstRep() { 
6740          if (getSubject().isEmpty()) {
6741            addSubject();
6742          }
6743          return getSubject().get(0);
6744        }
6745
6746        /**
6747         * @return {@link #intent} (Reason or purpose for the action stipulated by this Contract Provision.)
6748         */
6749        public CodeableConcept getIntent() { 
6750          if (this.intent == null)
6751            if (Configuration.errorOnAutoCreate())
6752              throw new Error("Attempt to auto-create ActionComponent.intent");
6753            else if (Configuration.doAutoCreate())
6754              this.intent = new CodeableConcept(); // cc
6755          return this.intent;
6756        }
6757
6758        public boolean hasIntent() { 
6759          return this.intent != null && !this.intent.isEmpty();
6760        }
6761
6762        /**
6763         * @param value {@link #intent} (Reason or purpose for the action stipulated by this Contract Provision.)
6764         */
6765        public ActionComponent setIntent(CodeableConcept value) { 
6766          this.intent = value;
6767          return this;
6768        }
6769
6770        /**
6771         * @return {@link #linkId} (Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.)
6772         */
6773        public List<StringType> getLinkId() { 
6774          if (this.linkId == null)
6775            this.linkId = new ArrayList<StringType>();
6776          return this.linkId;
6777        }
6778
6779        /**
6780         * @return Returns a reference to <code>this</code> for easy method chaining
6781         */
6782        public ActionComponent setLinkId(List<StringType> theLinkId) { 
6783          this.linkId = theLinkId;
6784          return this;
6785        }
6786
6787        public boolean hasLinkId() { 
6788          if (this.linkId == null)
6789            return false;
6790          for (StringType item : this.linkId)
6791            if (!item.isEmpty())
6792              return true;
6793          return false;
6794        }
6795
6796        /**
6797         * @return {@link #linkId} (Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.)
6798         */
6799        public StringType addLinkIdElement() {//2 
6800          StringType t = new StringType();
6801          if (this.linkId == null)
6802            this.linkId = new ArrayList<StringType>();
6803          this.linkId.add(t);
6804          return t;
6805        }
6806
6807        /**
6808         * @param value {@link #linkId} (Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.)
6809         */
6810        public ActionComponent addLinkId(String value) { //1
6811          StringType t = new StringType();
6812          t.setValue(value);
6813          if (this.linkId == null)
6814            this.linkId = new ArrayList<StringType>();
6815          this.linkId.add(t);
6816          return this;
6817        }
6818
6819        /**
6820         * @param value {@link #linkId} (Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.)
6821         */
6822        public boolean hasLinkId(String value) { 
6823          if (this.linkId == null)
6824            return false;
6825          for (StringType v : this.linkId)
6826            if (v.getValue().equals(value)) // string
6827              return true;
6828          return false;
6829        }
6830
6831        /**
6832         * @return {@link #status} (Current state of the term action.)
6833         */
6834        public CodeableConcept getStatus() { 
6835          if (this.status == null)
6836            if (Configuration.errorOnAutoCreate())
6837              throw new Error("Attempt to auto-create ActionComponent.status");
6838            else if (Configuration.doAutoCreate())
6839              this.status = new CodeableConcept(); // cc
6840          return this.status;
6841        }
6842
6843        public boolean hasStatus() { 
6844          return this.status != null && !this.status.isEmpty();
6845        }
6846
6847        /**
6848         * @param value {@link #status} (Current state of the term action.)
6849         */
6850        public ActionComponent setStatus(CodeableConcept value) { 
6851          this.status = value;
6852          return this;
6853        }
6854
6855        /**
6856         * @return {@link #context} (Encounter or Episode with primary association to specified term activity.)
6857         */
6858        public Reference getContext() { 
6859          if (this.context == null)
6860            if (Configuration.errorOnAutoCreate())
6861              throw new Error("Attempt to auto-create ActionComponent.context");
6862            else if (Configuration.doAutoCreate())
6863              this.context = new Reference(); // cc
6864          return this.context;
6865        }
6866
6867        public boolean hasContext() { 
6868          return this.context != null && !this.context.isEmpty();
6869        }
6870
6871        /**
6872         * @param value {@link #context} (Encounter or Episode with primary association to specified term activity.)
6873         */
6874        public ActionComponent setContext(Reference value) { 
6875          this.context = value;
6876          return this;
6877        }
6878
6879        /**
6880         * @return {@link #contextLinkId} (Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.)
6881         */
6882        public List<StringType> getContextLinkId() { 
6883          if (this.contextLinkId == null)
6884            this.contextLinkId = new ArrayList<StringType>();
6885          return this.contextLinkId;
6886        }
6887
6888        /**
6889         * @return Returns a reference to <code>this</code> for easy method chaining
6890         */
6891        public ActionComponent setContextLinkId(List<StringType> theContextLinkId) { 
6892          this.contextLinkId = theContextLinkId;
6893          return this;
6894        }
6895
6896        public boolean hasContextLinkId() { 
6897          if (this.contextLinkId == null)
6898            return false;
6899          for (StringType item : this.contextLinkId)
6900            if (!item.isEmpty())
6901              return true;
6902          return false;
6903        }
6904
6905        /**
6906         * @return {@link #contextLinkId} (Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.)
6907         */
6908        public StringType addContextLinkIdElement() {//2 
6909          StringType t = new StringType();
6910          if (this.contextLinkId == null)
6911            this.contextLinkId = new ArrayList<StringType>();
6912          this.contextLinkId.add(t);
6913          return t;
6914        }
6915
6916        /**
6917         * @param value {@link #contextLinkId} (Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.)
6918         */
6919        public ActionComponent addContextLinkId(String value) { //1
6920          StringType t = new StringType();
6921          t.setValue(value);
6922          if (this.contextLinkId == null)
6923            this.contextLinkId = new ArrayList<StringType>();
6924          this.contextLinkId.add(t);
6925          return this;
6926        }
6927
6928        /**
6929         * @param value {@link #contextLinkId} (Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.)
6930         */
6931        public boolean hasContextLinkId(String value) { 
6932          if (this.contextLinkId == null)
6933            return false;
6934          for (StringType v : this.contextLinkId)
6935            if (v.getValue().equals(value)) // string
6936              return true;
6937          return false;
6938        }
6939
6940        /**
6941         * @return {@link #occurrence} (When action happens.)
6942         */
6943        public DataType getOccurrence() { 
6944          return this.occurrence;
6945        }
6946
6947        /**
6948         * @return {@link #occurrence} (When action happens.)
6949         */
6950        public DateTimeType getOccurrenceDateTimeType() throws FHIRException { 
6951          if (this.occurrence == null)
6952            this.occurrence = new DateTimeType();
6953          if (!(this.occurrence instanceof DateTimeType))
6954            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.occurrence.getClass().getName()+" was encountered");
6955          return (DateTimeType) this.occurrence;
6956        }
6957
6958        public boolean hasOccurrenceDateTimeType() { 
6959          return this != null && this.occurrence instanceof DateTimeType;
6960        }
6961
6962        /**
6963         * @return {@link #occurrence} (When action happens.)
6964         */
6965        public Period getOccurrencePeriod() throws FHIRException { 
6966          if (this.occurrence == null)
6967            this.occurrence = new Period();
6968          if (!(this.occurrence instanceof Period))
6969            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.occurrence.getClass().getName()+" was encountered");
6970          return (Period) this.occurrence;
6971        }
6972
6973        public boolean hasOccurrencePeriod() { 
6974          return this != null && this.occurrence instanceof Period;
6975        }
6976
6977        /**
6978         * @return {@link #occurrence} (When action happens.)
6979         */
6980        public Timing getOccurrenceTiming() throws FHIRException { 
6981          if (this.occurrence == null)
6982            this.occurrence = new Timing();
6983          if (!(this.occurrence instanceof Timing))
6984            throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.occurrence.getClass().getName()+" was encountered");
6985          return (Timing) this.occurrence;
6986        }
6987
6988        public boolean hasOccurrenceTiming() { 
6989          return this != null && this.occurrence instanceof Timing;
6990        }
6991
6992        public boolean hasOccurrence() { 
6993          return this.occurrence != null && !this.occurrence.isEmpty();
6994        }
6995
6996        /**
6997         * @param value {@link #occurrence} (When action happens.)
6998         */
6999        public ActionComponent setOccurrence(DataType value) { 
7000          if (value != null && !(value instanceof DateTimeType || value instanceof Period || value instanceof Timing))
7001            throw new Error("Not the right type for Contract.term.action.occurrence[x]: "+value.fhirType());
7002          this.occurrence = value;
7003          return this;
7004        }
7005
7006        /**
7007         * @return {@link #requester} (Who or what initiated the action and has responsibility for its activation.)
7008         */
7009        public List<Reference> getRequester() { 
7010          if (this.requester == null)
7011            this.requester = new ArrayList<Reference>();
7012          return this.requester;
7013        }
7014
7015        /**
7016         * @return Returns a reference to <code>this</code> for easy method chaining
7017         */
7018        public ActionComponent setRequester(List<Reference> theRequester) { 
7019          this.requester = theRequester;
7020          return this;
7021        }
7022
7023        public boolean hasRequester() { 
7024          if (this.requester == null)
7025            return false;
7026          for (Reference item : this.requester)
7027            if (!item.isEmpty())
7028              return true;
7029          return false;
7030        }
7031
7032        public Reference addRequester() { //3
7033          Reference t = new Reference();
7034          if (this.requester == null)
7035            this.requester = new ArrayList<Reference>();
7036          this.requester.add(t);
7037          return t;
7038        }
7039
7040        public ActionComponent addRequester(Reference t) { //3
7041          if (t == null)
7042            return this;
7043          if (this.requester == null)
7044            this.requester = new ArrayList<Reference>();
7045          this.requester.add(t);
7046          return this;
7047        }
7048
7049        /**
7050         * @return The first repetition of repeating field {@link #requester}, creating it if it does not already exist {3}
7051         */
7052        public Reference getRequesterFirstRep() { 
7053          if (getRequester().isEmpty()) {
7054            addRequester();
7055          }
7056          return getRequester().get(0);
7057        }
7058
7059        /**
7060         * @return {@link #requesterLinkId} (Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.)
7061         */
7062        public List<StringType> getRequesterLinkId() { 
7063          if (this.requesterLinkId == null)
7064            this.requesterLinkId = new ArrayList<StringType>();
7065          return this.requesterLinkId;
7066        }
7067
7068        /**
7069         * @return Returns a reference to <code>this</code> for easy method chaining
7070         */
7071        public ActionComponent setRequesterLinkId(List<StringType> theRequesterLinkId) { 
7072          this.requesterLinkId = theRequesterLinkId;
7073          return this;
7074        }
7075
7076        public boolean hasRequesterLinkId() { 
7077          if (this.requesterLinkId == null)
7078            return false;
7079          for (StringType item : this.requesterLinkId)
7080            if (!item.isEmpty())
7081              return true;
7082          return false;
7083        }
7084
7085        /**
7086         * @return {@link #requesterLinkId} (Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.)
7087         */
7088        public StringType addRequesterLinkIdElement() {//2 
7089          StringType t = new StringType();
7090          if (this.requesterLinkId == null)
7091            this.requesterLinkId = new ArrayList<StringType>();
7092          this.requesterLinkId.add(t);
7093          return t;
7094        }
7095
7096        /**
7097         * @param value {@link #requesterLinkId} (Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.)
7098         */
7099        public ActionComponent addRequesterLinkId(String value) { //1
7100          StringType t = new StringType();
7101          t.setValue(value);
7102          if (this.requesterLinkId == null)
7103            this.requesterLinkId = new ArrayList<StringType>();
7104          this.requesterLinkId.add(t);
7105          return this;
7106        }
7107
7108        /**
7109         * @param value {@link #requesterLinkId} (Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.)
7110         */
7111        public boolean hasRequesterLinkId(String value) { 
7112          if (this.requesterLinkId == null)
7113            return false;
7114          for (StringType v : this.requesterLinkId)
7115            if (v.getValue().equals(value)) // string
7116              return true;
7117          return false;
7118        }
7119
7120        /**
7121         * @return {@link #performerType} (The type of individual that is desired or required to perform or not perform the action.)
7122         */
7123        public List<CodeableConcept> getPerformerType() { 
7124          if (this.performerType == null)
7125            this.performerType = new ArrayList<CodeableConcept>();
7126          return this.performerType;
7127        }
7128
7129        /**
7130         * @return Returns a reference to <code>this</code> for easy method chaining
7131         */
7132        public ActionComponent setPerformerType(List<CodeableConcept> thePerformerType) { 
7133          this.performerType = thePerformerType;
7134          return this;
7135        }
7136
7137        public boolean hasPerformerType() { 
7138          if (this.performerType == null)
7139            return false;
7140          for (CodeableConcept item : this.performerType)
7141            if (!item.isEmpty())
7142              return true;
7143          return false;
7144        }
7145
7146        public CodeableConcept addPerformerType() { //3
7147          CodeableConcept t = new CodeableConcept();
7148          if (this.performerType == null)
7149            this.performerType = new ArrayList<CodeableConcept>();
7150          this.performerType.add(t);
7151          return t;
7152        }
7153
7154        public ActionComponent addPerformerType(CodeableConcept t) { //3
7155          if (t == null)
7156            return this;
7157          if (this.performerType == null)
7158            this.performerType = new ArrayList<CodeableConcept>();
7159          this.performerType.add(t);
7160          return this;
7161        }
7162
7163        /**
7164         * @return The first repetition of repeating field {@link #performerType}, creating it if it does not already exist {3}
7165         */
7166        public CodeableConcept getPerformerTypeFirstRep() { 
7167          if (getPerformerType().isEmpty()) {
7168            addPerformerType();
7169          }
7170          return getPerformerType().get(0);
7171        }
7172
7173        /**
7174         * @return {@link #performerRole} (The type of role or competency of an individual desired or required to perform or not perform the action.)
7175         */
7176        public CodeableConcept getPerformerRole() { 
7177          if (this.performerRole == null)
7178            if (Configuration.errorOnAutoCreate())
7179              throw new Error("Attempt to auto-create ActionComponent.performerRole");
7180            else if (Configuration.doAutoCreate())
7181              this.performerRole = new CodeableConcept(); // cc
7182          return this.performerRole;
7183        }
7184
7185        public boolean hasPerformerRole() { 
7186          return this.performerRole != null && !this.performerRole.isEmpty();
7187        }
7188
7189        /**
7190         * @param value {@link #performerRole} (The type of role or competency of an individual desired or required to perform or not perform the action.)
7191         */
7192        public ActionComponent setPerformerRole(CodeableConcept value) { 
7193          this.performerRole = value;
7194          return this;
7195        }
7196
7197        /**
7198         * @return {@link #performer} (Indicates who or what is being asked to perform (or not perform) the ction.)
7199         */
7200        public Reference getPerformer() { 
7201          if (this.performer == null)
7202            if (Configuration.errorOnAutoCreate())
7203              throw new Error("Attempt to auto-create ActionComponent.performer");
7204            else if (Configuration.doAutoCreate())
7205              this.performer = new Reference(); // cc
7206          return this.performer;
7207        }
7208
7209        public boolean hasPerformer() { 
7210          return this.performer != null && !this.performer.isEmpty();
7211        }
7212
7213        /**
7214         * @param value {@link #performer} (Indicates who or what is being asked to perform (or not perform) the ction.)
7215         */
7216        public ActionComponent setPerformer(Reference value) { 
7217          this.performer = value;
7218          return this;
7219        }
7220
7221        /**
7222         * @return {@link #performerLinkId} (Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.)
7223         */
7224        public List<StringType> getPerformerLinkId() { 
7225          if (this.performerLinkId == null)
7226            this.performerLinkId = new ArrayList<StringType>();
7227          return this.performerLinkId;
7228        }
7229
7230        /**
7231         * @return Returns a reference to <code>this</code> for easy method chaining
7232         */
7233        public ActionComponent setPerformerLinkId(List<StringType> thePerformerLinkId) { 
7234          this.performerLinkId = thePerformerLinkId;
7235          return this;
7236        }
7237
7238        public boolean hasPerformerLinkId() { 
7239          if (this.performerLinkId == null)
7240            return false;
7241          for (StringType item : this.performerLinkId)
7242            if (!item.isEmpty())
7243              return true;
7244          return false;
7245        }
7246
7247        /**
7248         * @return {@link #performerLinkId} (Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.)
7249         */
7250        public StringType addPerformerLinkIdElement() {//2 
7251          StringType t = new StringType();
7252          if (this.performerLinkId == null)
7253            this.performerLinkId = new ArrayList<StringType>();
7254          this.performerLinkId.add(t);
7255          return t;
7256        }
7257
7258        /**
7259         * @param value {@link #performerLinkId} (Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.)
7260         */
7261        public ActionComponent addPerformerLinkId(String value) { //1
7262          StringType t = new StringType();
7263          t.setValue(value);
7264          if (this.performerLinkId == null)
7265            this.performerLinkId = new ArrayList<StringType>();
7266          this.performerLinkId.add(t);
7267          return this;
7268        }
7269
7270        /**
7271         * @param value {@link #performerLinkId} (Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.)
7272         */
7273        public boolean hasPerformerLinkId(String value) { 
7274          if (this.performerLinkId == null)
7275            return false;
7276          for (StringType v : this.performerLinkId)
7277            if (v.getValue().equals(value)) // string
7278              return true;
7279          return false;
7280        }
7281
7282        /**
7283         * @return {@link #reasonCode} (Rationale for the action to be performed or not performed. Describes why the action is permitted or prohibited.)
7284         */
7285        public List<CodeableConcept> getReasonCode() { 
7286          if (this.reasonCode == null)
7287            this.reasonCode = new ArrayList<CodeableConcept>();
7288          return this.reasonCode;
7289        }
7290
7291        /**
7292         * @return Returns a reference to <code>this</code> for easy method chaining
7293         */
7294        public ActionComponent setReasonCode(List<CodeableConcept> theReasonCode) { 
7295          this.reasonCode = theReasonCode;
7296          return this;
7297        }
7298
7299        public boolean hasReasonCode() { 
7300          if (this.reasonCode == null)
7301            return false;
7302          for (CodeableConcept item : this.reasonCode)
7303            if (!item.isEmpty())
7304              return true;
7305          return false;
7306        }
7307
7308        public CodeableConcept addReasonCode() { //3
7309          CodeableConcept t = new CodeableConcept();
7310          if (this.reasonCode == null)
7311            this.reasonCode = new ArrayList<CodeableConcept>();
7312          this.reasonCode.add(t);
7313          return t;
7314        }
7315
7316        public ActionComponent addReasonCode(CodeableConcept t) { //3
7317          if (t == null)
7318            return this;
7319          if (this.reasonCode == null)
7320            this.reasonCode = new ArrayList<CodeableConcept>();
7321          this.reasonCode.add(t);
7322          return this;
7323        }
7324
7325        /**
7326         * @return The first repetition of repeating field {@link #reasonCode}, creating it if it does not already exist {3}
7327         */
7328        public CodeableConcept getReasonCodeFirstRep() { 
7329          if (getReasonCode().isEmpty()) {
7330            addReasonCode();
7331          }
7332          return getReasonCode().get(0);
7333        }
7334
7335        /**
7336         * @return {@link #reasonReference} (Indicates another resource whose existence justifies permitting or not permitting this action.)
7337         */
7338        public List<Reference> getReasonReference() { 
7339          if (this.reasonReference == null)
7340            this.reasonReference = new ArrayList<Reference>();
7341          return this.reasonReference;
7342        }
7343
7344        /**
7345         * @return Returns a reference to <code>this</code> for easy method chaining
7346         */
7347        public ActionComponent setReasonReference(List<Reference> theReasonReference) { 
7348          this.reasonReference = theReasonReference;
7349          return this;
7350        }
7351
7352        public boolean hasReasonReference() { 
7353          if (this.reasonReference == null)
7354            return false;
7355          for (Reference item : this.reasonReference)
7356            if (!item.isEmpty())
7357              return true;
7358          return false;
7359        }
7360
7361        public Reference addReasonReference() { //3
7362          Reference t = new Reference();
7363          if (this.reasonReference == null)
7364            this.reasonReference = new ArrayList<Reference>();
7365          this.reasonReference.add(t);
7366          return t;
7367        }
7368
7369        public ActionComponent addReasonReference(Reference t) { //3
7370          if (t == null)
7371            return this;
7372          if (this.reasonReference == null)
7373            this.reasonReference = new ArrayList<Reference>();
7374          this.reasonReference.add(t);
7375          return this;
7376        }
7377
7378        /**
7379         * @return The first repetition of repeating field {@link #reasonReference}, creating it if it does not already exist {3}
7380         */
7381        public Reference getReasonReferenceFirstRep() { 
7382          if (getReasonReference().isEmpty()) {
7383            addReasonReference();
7384          }
7385          return getReasonReference().get(0);
7386        }
7387
7388        /**
7389         * @return {@link #reason} (Describes why the action is to be performed or not performed in textual form.)
7390         */
7391        public List<StringType> getReason() { 
7392          if (this.reason == null)
7393            this.reason = new ArrayList<StringType>();
7394          return this.reason;
7395        }
7396
7397        /**
7398         * @return Returns a reference to <code>this</code> for easy method chaining
7399         */
7400        public ActionComponent setReason(List<StringType> theReason) { 
7401          this.reason = theReason;
7402          return this;
7403        }
7404
7405        public boolean hasReason() { 
7406          if (this.reason == null)
7407            return false;
7408          for (StringType item : this.reason)
7409            if (!item.isEmpty())
7410              return true;
7411          return false;
7412        }
7413
7414        /**
7415         * @return {@link #reason} (Describes why the action is to be performed or not performed in textual form.)
7416         */
7417        public StringType addReasonElement() {//2 
7418          StringType t = new StringType();
7419          if (this.reason == null)
7420            this.reason = new ArrayList<StringType>();
7421          this.reason.add(t);
7422          return t;
7423        }
7424
7425        /**
7426         * @param value {@link #reason} (Describes why the action is to be performed or not performed in textual form.)
7427         */
7428        public ActionComponent addReason(String value) { //1
7429          StringType t = new StringType();
7430          t.setValue(value);
7431          if (this.reason == null)
7432            this.reason = new ArrayList<StringType>();
7433          this.reason.add(t);
7434          return this;
7435        }
7436
7437        /**
7438         * @param value {@link #reason} (Describes why the action is to be performed or not performed in textual form.)
7439         */
7440        public boolean hasReason(String value) { 
7441          if (this.reason == null)
7442            return false;
7443          for (StringType v : this.reason)
7444            if (v.getValue().equals(value)) // string
7445              return true;
7446          return false;
7447        }
7448
7449        /**
7450         * @return {@link #reasonLinkId} (Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.)
7451         */
7452        public List<StringType> getReasonLinkId() { 
7453          if (this.reasonLinkId == null)
7454            this.reasonLinkId = new ArrayList<StringType>();
7455          return this.reasonLinkId;
7456        }
7457
7458        /**
7459         * @return Returns a reference to <code>this</code> for easy method chaining
7460         */
7461        public ActionComponent setReasonLinkId(List<StringType> theReasonLinkId) { 
7462          this.reasonLinkId = theReasonLinkId;
7463          return this;
7464        }
7465
7466        public boolean hasReasonLinkId() { 
7467          if (this.reasonLinkId == null)
7468            return false;
7469          for (StringType item : this.reasonLinkId)
7470            if (!item.isEmpty())
7471              return true;
7472          return false;
7473        }
7474
7475        /**
7476         * @return {@link #reasonLinkId} (Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.)
7477         */
7478        public StringType addReasonLinkIdElement() {//2 
7479          StringType t = new StringType();
7480          if (this.reasonLinkId == null)
7481            this.reasonLinkId = new ArrayList<StringType>();
7482          this.reasonLinkId.add(t);
7483          return t;
7484        }
7485
7486        /**
7487         * @param value {@link #reasonLinkId} (Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.)
7488         */
7489        public ActionComponent addReasonLinkId(String value) { //1
7490          StringType t = new StringType();
7491          t.setValue(value);
7492          if (this.reasonLinkId == null)
7493            this.reasonLinkId = new ArrayList<StringType>();
7494          this.reasonLinkId.add(t);
7495          return this;
7496        }
7497
7498        /**
7499         * @param value {@link #reasonLinkId} (Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.)
7500         */
7501        public boolean hasReasonLinkId(String value) { 
7502          if (this.reasonLinkId == null)
7503            return false;
7504          for (StringType v : this.reasonLinkId)
7505            if (v.getValue().equals(value)) // string
7506              return true;
7507          return false;
7508        }
7509
7510        /**
7511         * @return {@link #note} (Comments made about the term action made by the requester, performer, subject or other participants.)
7512         */
7513        public List<Annotation> getNote() { 
7514          if (this.note == null)
7515            this.note = new ArrayList<Annotation>();
7516          return this.note;
7517        }
7518
7519        /**
7520         * @return Returns a reference to <code>this</code> for easy method chaining
7521         */
7522        public ActionComponent setNote(List<Annotation> theNote) { 
7523          this.note = theNote;
7524          return this;
7525        }
7526
7527        public boolean hasNote() { 
7528          if (this.note == null)
7529            return false;
7530          for (Annotation item : this.note)
7531            if (!item.isEmpty())
7532              return true;
7533          return false;
7534        }
7535
7536        public Annotation addNote() { //3
7537          Annotation t = new Annotation();
7538          if (this.note == null)
7539            this.note = new ArrayList<Annotation>();
7540          this.note.add(t);
7541          return t;
7542        }
7543
7544        public ActionComponent addNote(Annotation t) { //3
7545          if (t == null)
7546            return this;
7547          if (this.note == null)
7548            this.note = new ArrayList<Annotation>();
7549          this.note.add(t);
7550          return this;
7551        }
7552
7553        /**
7554         * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
7555         */
7556        public Annotation getNoteFirstRep() { 
7557          if (getNote().isEmpty()) {
7558            addNote();
7559          }
7560          return getNote().get(0);
7561        }
7562
7563        /**
7564         * @return {@link #securityLabelNumber} (Security labels that protects the action.)
7565         */
7566        public List<UnsignedIntType> getSecurityLabelNumber() { 
7567          if (this.securityLabelNumber == null)
7568            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
7569          return this.securityLabelNumber;
7570        }
7571
7572        /**
7573         * @return Returns a reference to <code>this</code> for easy method chaining
7574         */
7575        public ActionComponent setSecurityLabelNumber(List<UnsignedIntType> theSecurityLabelNumber) { 
7576          this.securityLabelNumber = theSecurityLabelNumber;
7577          return this;
7578        }
7579
7580        public boolean hasSecurityLabelNumber() { 
7581          if (this.securityLabelNumber == null)
7582            return false;
7583          for (UnsignedIntType item : this.securityLabelNumber)
7584            if (!item.isEmpty())
7585              return true;
7586          return false;
7587        }
7588
7589        /**
7590         * @return {@link #securityLabelNumber} (Security labels that protects the action.)
7591         */
7592        public UnsignedIntType addSecurityLabelNumberElement() {//2 
7593          UnsignedIntType t = new UnsignedIntType();
7594          if (this.securityLabelNumber == null)
7595            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
7596          this.securityLabelNumber.add(t);
7597          return t;
7598        }
7599
7600        /**
7601         * @param value {@link #securityLabelNumber} (Security labels that protects the action.)
7602         */
7603        public ActionComponent addSecurityLabelNumber(int value) { //1
7604          UnsignedIntType t = new UnsignedIntType();
7605          t.setValue(value);
7606          if (this.securityLabelNumber == null)
7607            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
7608          this.securityLabelNumber.add(t);
7609          return this;
7610        }
7611
7612        /**
7613         * @param value {@link #securityLabelNumber} (Security labels that protects the action.)
7614         */
7615        public boolean hasSecurityLabelNumber(int value) { 
7616          if (this.securityLabelNumber == null)
7617            return false;
7618          for (UnsignedIntType v : this.securityLabelNumber)
7619            if (v.getValue().equals(value)) // unsignedInt
7620              return true;
7621          return false;
7622        }
7623
7624        protected void listChildren(List<Property> children) {
7625          super.listChildren(children);
7626          children.add(new Property("doNotPerform", "boolean", "True if the term prohibits the  action.", 0, 1, doNotPerform));
7627          children.add(new Property("type", "CodeableConcept", "Activity or service obligation to be done or not done, performed or not performed, effectuated or not by this Contract term.", 0, 1, type));
7628          children.add(new Property("subject", "", "Entity of the action.", 0, java.lang.Integer.MAX_VALUE, subject));
7629          children.add(new Property("intent", "CodeableConcept", "Reason or purpose for the action stipulated by this Contract Provision.", 0, 1, intent));
7630          children.add(new Property("linkId", "string", "Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, linkId));
7631          children.add(new Property("status", "CodeableConcept", "Current state of the term action.", 0, 1, status));
7632          children.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "Encounter or Episode with primary association to specified term activity.", 0, 1, context));
7633          children.add(new Property("contextLinkId", "string", "Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, contextLinkId));
7634          children.add(new Property("occurrence[x]", "dateTime|Period|Timing", "When action happens.", 0, 1, occurrence));
7635          children.add(new Property("requester", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Device|Group|Organization)", "Who or what initiated the action and has responsibility for its activation.", 0, java.lang.Integer.MAX_VALUE, requester));
7636          children.add(new Property("requesterLinkId", "string", "Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, requesterLinkId));
7637          children.add(new Property("performerType", "CodeableConcept", "The type of individual that is desired or required to perform or not perform the action.", 0, java.lang.Integer.MAX_VALUE, performerType));
7638          children.add(new Property("performerRole", "CodeableConcept", "The type of role or competency of an individual desired or required to perform or not perform the action.", 0, 1, performerRole));
7639          children.add(new Property("performer", "Reference(RelatedPerson|Patient|Practitioner|PractitionerRole|CareTeam|Device|Substance|Organization|Location)", "Indicates who or what is being asked to perform (or not perform) the ction.", 0, 1, performer));
7640          children.add(new Property("performerLinkId", "string", "Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, performerLinkId));
7641          children.add(new Property("reasonCode", "CodeableConcept", "Rationale for the action to be performed or not performed. Describes why the action is permitted or prohibited.", 0, java.lang.Integer.MAX_VALUE, reasonCode));
7642          children.add(new Property("reasonReference", "Reference(Condition|Observation|DiagnosticReport|DocumentReference|Questionnaire|QuestionnaireResponse)", "Indicates another resource whose existence justifies permitting or not permitting this action.", 0, java.lang.Integer.MAX_VALUE, reasonReference));
7643          children.add(new Property("reason", "string", "Describes why the action is to be performed or not performed in textual form.", 0, java.lang.Integer.MAX_VALUE, reason));
7644          children.add(new Property("reasonLinkId", "string", "Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, reasonLinkId));
7645          children.add(new Property("note", "Annotation", "Comments made about the term action made by the requester, performer, subject or other participants.", 0, java.lang.Integer.MAX_VALUE, note));
7646          children.add(new Property("securityLabelNumber", "unsignedInt", "Security labels that protects the action.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber));
7647        }
7648
7649        @Override
7650        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7651          switch (_hash) {
7652          case -1788508167: /*doNotPerform*/  return new Property("doNotPerform", "boolean", "True if the term prohibits the  action.", 0, 1, doNotPerform);
7653          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Activity or service obligation to be done or not done, performed or not performed, effectuated or not by this Contract term.", 0, 1, type);
7654          case -1867885268: /*subject*/  return new Property("subject", "", "Entity of the action.", 0, java.lang.Integer.MAX_VALUE, subject);
7655          case -1183762788: /*intent*/  return new Property("intent", "CodeableConcept", "Reason or purpose for the action stipulated by this Contract Provision.", 0, 1, intent);
7656          case -1102667083: /*linkId*/  return new Property("linkId", "string", "Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, linkId);
7657          case -892481550: /*status*/  return new Property("status", "CodeableConcept", "Current state of the term action.", 0, 1, status);
7658          case 951530927: /*context*/  return new Property("context", "Reference(Encounter|EpisodeOfCare)", "Encounter or Episode with primary association to specified term activity.", 0, 1, context);
7659          case -288783036: /*contextLinkId*/  return new Property("contextLinkId", "string", "Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, contextLinkId);
7660          case -2022646513: /*occurrence[x]*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "When action happens.", 0, 1, occurrence);
7661          case 1687874001: /*occurrence*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "When action happens.", 0, 1, occurrence);
7662          case -298443636: /*occurrenceDateTime*/  return new Property("occurrence[x]", "dateTime", "When action happens.", 0, 1, occurrence);
7663          case 1397156594: /*occurrencePeriod*/  return new Property("occurrence[x]", "Period", "When action happens.", 0, 1, occurrence);
7664          case 1515218299: /*occurrenceTiming*/  return new Property("occurrence[x]", "Timing", "When action happens.", 0, 1, occurrence);
7665          case 693933948: /*requester*/  return new Property("requester", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Device|Group|Organization)", "Who or what initiated the action and has responsibility for its activation.", 0, java.lang.Integer.MAX_VALUE, requester);
7666          case -1468032687: /*requesterLinkId*/  return new Property("requesterLinkId", "string", "Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, requesterLinkId);
7667          case -901444568: /*performerType*/  return new Property("performerType", "CodeableConcept", "The type of individual that is desired or required to perform or not perform the action.", 0, java.lang.Integer.MAX_VALUE, performerType);
7668          case -901513884: /*performerRole*/  return new Property("performerRole", "CodeableConcept", "The type of role or competency of an individual desired or required to perform or not perform the action.", 0, 1, performerRole);
7669          case 481140686: /*performer*/  return new Property("performer", "Reference(RelatedPerson|Patient|Practitioner|PractitionerRole|CareTeam|Device|Substance|Organization|Location)", "Indicates who or what is being asked to perform (or not perform) the ction.", 0, 1, performer);
7670          case 1051302947: /*performerLinkId*/  return new Property("performerLinkId", "string", "Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, performerLinkId);
7671          case 722137681: /*reasonCode*/  return new Property("reasonCode", "CodeableConcept", "Rationale for the action to be performed or not performed. Describes why the action is permitted or prohibited.", 0, java.lang.Integer.MAX_VALUE, reasonCode);
7672          case -1146218137: /*reasonReference*/  return new Property("reasonReference", "Reference(Condition|Observation|DiagnosticReport|DocumentReference|Questionnaire|QuestionnaireResponse)", "Indicates another resource whose existence justifies permitting or not permitting this action.", 0, java.lang.Integer.MAX_VALUE, reasonReference);
7673          case -934964668: /*reason*/  return new Property("reason", "string", "Describes why the action is to be performed or not performed in textual form.", 0, java.lang.Integer.MAX_VALUE, reason);
7674          case -1557963239: /*reasonLinkId*/  return new Property("reasonLinkId", "string", "Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, reasonLinkId);
7675          case 3387378: /*note*/  return new Property("note", "Annotation", "Comments made about the term action made by the requester, performer, subject or other participants.", 0, java.lang.Integer.MAX_VALUE, note);
7676          case -149460995: /*securityLabelNumber*/  return new Property("securityLabelNumber", "unsignedInt", "Security labels that protects the action.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber);
7677          default: return super.getNamedProperty(_hash, _name, _checkValid);
7678          }
7679
7680        }
7681
7682      @Override
7683      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7684        switch (hash) {
7685        case -1788508167: /*doNotPerform*/ return this.doNotPerform == null ? new Base[0] : new Base[] {this.doNotPerform}; // BooleanType
7686        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
7687        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // ActionSubjectComponent
7688        case -1183762788: /*intent*/ return this.intent == null ? new Base[0] : new Base[] {this.intent}; // CodeableConcept
7689        case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : this.linkId.toArray(new Base[this.linkId.size()]); // StringType
7690        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept
7691        case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference
7692        case -288783036: /*contextLinkId*/ return this.contextLinkId == null ? new Base[0] : this.contextLinkId.toArray(new Base[this.contextLinkId.size()]); // StringType
7693        case 1687874001: /*occurrence*/ return this.occurrence == null ? new Base[0] : new Base[] {this.occurrence}; // DataType
7694        case 693933948: /*requester*/ return this.requester == null ? new Base[0] : this.requester.toArray(new Base[this.requester.size()]); // Reference
7695        case -1468032687: /*requesterLinkId*/ return this.requesterLinkId == null ? new Base[0] : this.requesterLinkId.toArray(new Base[this.requesterLinkId.size()]); // StringType
7696        case -901444568: /*performerType*/ return this.performerType == null ? new Base[0] : this.performerType.toArray(new Base[this.performerType.size()]); // CodeableConcept
7697        case -901513884: /*performerRole*/ return this.performerRole == null ? new Base[0] : new Base[] {this.performerRole}; // CodeableConcept
7698        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference
7699        case 1051302947: /*performerLinkId*/ return this.performerLinkId == null ? new Base[0] : this.performerLinkId.toArray(new Base[this.performerLinkId.size()]); // StringType
7700        case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
7701        case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
7702        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // StringType
7703        case -1557963239: /*reasonLinkId*/ return this.reasonLinkId == null ? new Base[0] : this.reasonLinkId.toArray(new Base[this.reasonLinkId.size()]); // StringType
7704        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
7705        case -149460995: /*securityLabelNumber*/ return this.securityLabelNumber == null ? new Base[0] : this.securityLabelNumber.toArray(new Base[this.securityLabelNumber.size()]); // UnsignedIntType
7706        default: return super.getProperty(hash, name, checkValid);
7707        }
7708
7709      }
7710
7711      @Override
7712      public Base setProperty(int hash, String name, Base value) throws FHIRException {
7713        switch (hash) {
7714        case -1788508167: // doNotPerform
7715          this.doNotPerform = TypeConvertor.castToBoolean(value); // BooleanType
7716          return value;
7717        case 3575610: // type
7718          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
7719          return value;
7720        case -1867885268: // subject
7721          this.getSubject().add((ActionSubjectComponent) value); // ActionSubjectComponent
7722          return value;
7723        case -1183762788: // intent
7724          this.intent = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
7725          return value;
7726        case -1102667083: // linkId
7727          this.getLinkId().add(TypeConvertor.castToString(value)); // StringType
7728          return value;
7729        case -892481550: // status
7730          this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
7731          return value;
7732        case 951530927: // context
7733          this.context = TypeConvertor.castToReference(value); // Reference
7734          return value;
7735        case -288783036: // contextLinkId
7736          this.getContextLinkId().add(TypeConvertor.castToString(value)); // StringType
7737          return value;
7738        case 1687874001: // occurrence
7739          this.occurrence = TypeConvertor.castToType(value); // DataType
7740          return value;
7741        case 693933948: // requester
7742          this.getRequester().add(TypeConvertor.castToReference(value)); // Reference
7743          return value;
7744        case -1468032687: // requesterLinkId
7745          this.getRequesterLinkId().add(TypeConvertor.castToString(value)); // StringType
7746          return value;
7747        case -901444568: // performerType
7748          this.getPerformerType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
7749          return value;
7750        case -901513884: // performerRole
7751          this.performerRole = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
7752          return value;
7753        case 481140686: // performer
7754          this.performer = TypeConvertor.castToReference(value); // Reference
7755          return value;
7756        case 1051302947: // performerLinkId
7757          this.getPerformerLinkId().add(TypeConvertor.castToString(value)); // StringType
7758          return value;
7759        case 722137681: // reasonCode
7760          this.getReasonCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
7761          return value;
7762        case -1146218137: // reasonReference
7763          this.getReasonReference().add(TypeConvertor.castToReference(value)); // Reference
7764          return value;
7765        case -934964668: // reason
7766          this.getReason().add(TypeConvertor.castToString(value)); // StringType
7767          return value;
7768        case -1557963239: // reasonLinkId
7769          this.getReasonLinkId().add(TypeConvertor.castToString(value)); // StringType
7770          return value;
7771        case 3387378: // note
7772          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
7773          return value;
7774        case -149460995: // securityLabelNumber
7775          this.getSecurityLabelNumber().add(TypeConvertor.castToUnsignedInt(value)); // UnsignedIntType
7776          return value;
7777        default: return super.setProperty(hash, name, value);
7778        }
7779
7780      }
7781
7782      @Override
7783      public Base setProperty(String name, Base value) throws FHIRException {
7784        if (name.equals("doNotPerform")) {
7785          this.doNotPerform = TypeConvertor.castToBoolean(value); // BooleanType
7786        } else if (name.equals("type")) {
7787          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
7788        } else if (name.equals("subject")) {
7789          this.getSubject().add((ActionSubjectComponent) value);
7790        } else if (name.equals("intent")) {
7791          this.intent = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
7792        } else if (name.equals("linkId")) {
7793          this.getLinkId().add(TypeConvertor.castToString(value));
7794        } else if (name.equals("status")) {
7795          this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
7796        } else if (name.equals("context")) {
7797          this.context = TypeConvertor.castToReference(value); // Reference
7798        } else if (name.equals("contextLinkId")) {
7799          this.getContextLinkId().add(TypeConvertor.castToString(value));
7800        } else if (name.equals("occurrence[x]")) {
7801          this.occurrence = TypeConvertor.castToType(value); // DataType
7802        } else if (name.equals("requester")) {
7803          this.getRequester().add(TypeConvertor.castToReference(value));
7804        } else if (name.equals("requesterLinkId")) {
7805          this.getRequesterLinkId().add(TypeConvertor.castToString(value));
7806        } else if (name.equals("performerType")) {
7807          this.getPerformerType().add(TypeConvertor.castToCodeableConcept(value));
7808        } else if (name.equals("performerRole")) {
7809          this.performerRole = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
7810        } else if (name.equals("performer")) {
7811          this.performer = TypeConvertor.castToReference(value); // Reference
7812        } else if (name.equals("performerLinkId")) {
7813          this.getPerformerLinkId().add(TypeConvertor.castToString(value));
7814        } else if (name.equals("reasonCode")) {
7815          this.getReasonCode().add(TypeConvertor.castToCodeableConcept(value));
7816        } else if (name.equals("reasonReference")) {
7817          this.getReasonReference().add(TypeConvertor.castToReference(value));
7818        } else if (name.equals("reason")) {
7819          this.getReason().add(TypeConvertor.castToString(value));
7820        } else if (name.equals("reasonLinkId")) {
7821          this.getReasonLinkId().add(TypeConvertor.castToString(value));
7822        } else if (name.equals("note")) {
7823          this.getNote().add(TypeConvertor.castToAnnotation(value));
7824        } else if (name.equals("securityLabelNumber")) {
7825          this.getSecurityLabelNumber().add(TypeConvertor.castToUnsignedInt(value));
7826        } else
7827          return super.setProperty(name, value);
7828        return value;
7829      }
7830
7831      @Override
7832      public Base makeProperty(int hash, String name) throws FHIRException {
7833        switch (hash) {
7834        case -1788508167:  return getDoNotPerformElement();
7835        case 3575610:  return getType();
7836        case -1867885268:  return addSubject(); 
7837        case -1183762788:  return getIntent();
7838        case -1102667083:  return addLinkIdElement();
7839        case -892481550:  return getStatus();
7840        case 951530927:  return getContext();
7841        case -288783036:  return addContextLinkIdElement();
7842        case -2022646513:  return getOccurrence();
7843        case 1687874001:  return getOccurrence();
7844        case 693933948:  return addRequester(); 
7845        case -1468032687:  return addRequesterLinkIdElement();
7846        case -901444568:  return addPerformerType(); 
7847        case -901513884:  return getPerformerRole();
7848        case 481140686:  return getPerformer();
7849        case 1051302947:  return addPerformerLinkIdElement();
7850        case 722137681:  return addReasonCode(); 
7851        case -1146218137:  return addReasonReference(); 
7852        case -934964668:  return addReasonElement();
7853        case -1557963239:  return addReasonLinkIdElement();
7854        case 3387378:  return addNote(); 
7855        case -149460995:  return addSecurityLabelNumberElement();
7856        default: return super.makeProperty(hash, name);
7857        }
7858
7859      }
7860
7861      @Override
7862      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
7863        switch (hash) {
7864        case -1788508167: /*doNotPerform*/ return new String[] {"boolean"};
7865        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
7866        case -1867885268: /*subject*/ return new String[] {};
7867        case -1183762788: /*intent*/ return new String[] {"CodeableConcept"};
7868        case -1102667083: /*linkId*/ return new String[] {"string"};
7869        case -892481550: /*status*/ return new String[] {"CodeableConcept"};
7870        case 951530927: /*context*/ return new String[] {"Reference"};
7871        case -288783036: /*contextLinkId*/ return new String[] {"string"};
7872        case 1687874001: /*occurrence*/ return new String[] {"dateTime", "Period", "Timing"};
7873        case 693933948: /*requester*/ return new String[] {"Reference"};
7874        case -1468032687: /*requesterLinkId*/ return new String[] {"string"};
7875        case -901444568: /*performerType*/ return new String[] {"CodeableConcept"};
7876        case -901513884: /*performerRole*/ return new String[] {"CodeableConcept"};
7877        case 481140686: /*performer*/ return new String[] {"Reference"};
7878        case 1051302947: /*performerLinkId*/ return new String[] {"string"};
7879        case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
7880        case -1146218137: /*reasonReference*/ return new String[] {"Reference"};
7881        case -934964668: /*reason*/ return new String[] {"string"};
7882        case -1557963239: /*reasonLinkId*/ return new String[] {"string"};
7883        case 3387378: /*note*/ return new String[] {"Annotation"};
7884        case -149460995: /*securityLabelNumber*/ return new String[] {"unsignedInt"};
7885        default: return super.getTypesForProperty(hash, name);
7886        }
7887
7888      }
7889
7890      @Override
7891      public Base addChild(String name) throws FHIRException {
7892        if (name.equals("doNotPerform")) {
7893          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.action.doNotPerform");
7894        }
7895        else if (name.equals("type")) {
7896          this.type = new CodeableConcept();
7897          return this.type;
7898        }
7899        else if (name.equals("subject")) {
7900          return addSubject();
7901        }
7902        else if (name.equals("intent")) {
7903          this.intent = new CodeableConcept();
7904          return this.intent;
7905        }
7906        else if (name.equals("linkId")) {
7907          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.action.linkId");
7908        }
7909        else if (name.equals("status")) {
7910          this.status = new CodeableConcept();
7911          return this.status;
7912        }
7913        else if (name.equals("context")) {
7914          this.context = new Reference();
7915          return this.context;
7916        }
7917        else if (name.equals("contextLinkId")) {
7918          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.action.contextLinkId");
7919        }
7920        else if (name.equals("occurrenceDateTime")) {
7921          this.occurrence = new DateTimeType();
7922          return this.occurrence;
7923        }
7924        else if (name.equals("occurrencePeriod")) {
7925          this.occurrence = new Period();
7926          return this.occurrence;
7927        }
7928        else if (name.equals("occurrenceTiming")) {
7929          this.occurrence = new Timing();
7930          return this.occurrence;
7931        }
7932        else if (name.equals("requester")) {
7933          return addRequester();
7934        }
7935        else if (name.equals("requesterLinkId")) {
7936          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.action.requesterLinkId");
7937        }
7938        else if (name.equals("performerType")) {
7939          return addPerformerType();
7940        }
7941        else if (name.equals("performerRole")) {
7942          this.performerRole = new CodeableConcept();
7943          return this.performerRole;
7944        }
7945        else if (name.equals("performer")) {
7946          this.performer = new Reference();
7947          return this.performer;
7948        }
7949        else if (name.equals("performerLinkId")) {
7950          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.action.performerLinkId");
7951        }
7952        else if (name.equals("reasonCode")) {
7953          return addReasonCode();
7954        }
7955        else if (name.equals("reasonReference")) {
7956          return addReasonReference();
7957        }
7958        else if (name.equals("reason")) {
7959          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.action.reason");
7960        }
7961        else if (name.equals("reasonLinkId")) {
7962          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.action.reasonLinkId");
7963        }
7964        else if (name.equals("note")) {
7965          return addNote();
7966        }
7967        else if (name.equals("securityLabelNumber")) {
7968          throw new FHIRException("Cannot call addChild on a primitive type Contract.term.action.securityLabelNumber");
7969        }
7970        else
7971          return super.addChild(name);
7972      }
7973
7974      public ActionComponent copy() {
7975        ActionComponent dst = new ActionComponent();
7976        copyValues(dst);
7977        return dst;
7978      }
7979
7980      public void copyValues(ActionComponent dst) {
7981        super.copyValues(dst);
7982        dst.doNotPerform = doNotPerform == null ? null : doNotPerform.copy();
7983        dst.type = type == null ? null : type.copy();
7984        if (subject != null) {
7985          dst.subject = new ArrayList<ActionSubjectComponent>();
7986          for (ActionSubjectComponent i : subject)
7987            dst.subject.add(i.copy());
7988        };
7989        dst.intent = intent == null ? null : intent.copy();
7990        if (linkId != null) {
7991          dst.linkId = new ArrayList<StringType>();
7992          for (StringType i : linkId)
7993            dst.linkId.add(i.copy());
7994        };
7995        dst.status = status == null ? null : status.copy();
7996        dst.context = context == null ? null : context.copy();
7997        if (contextLinkId != null) {
7998          dst.contextLinkId = new ArrayList<StringType>();
7999          for (StringType i : contextLinkId)
8000            dst.contextLinkId.add(i.copy());
8001        };
8002        dst.occurrence = occurrence == null ? null : occurrence.copy();
8003        if (requester != null) {
8004          dst.requester = new ArrayList<Reference>();
8005          for (Reference i : requester)
8006            dst.requester.add(i.copy());
8007        };
8008        if (requesterLinkId != null) {
8009          dst.requesterLinkId = new ArrayList<StringType>();
8010          for (StringType i : requesterLinkId)
8011            dst.requesterLinkId.add(i.copy());
8012        };
8013        if (performerType != null) {
8014          dst.performerType = new ArrayList<CodeableConcept>();
8015          for (CodeableConcept i : performerType)
8016            dst.performerType.add(i.copy());
8017        };
8018        dst.performerRole = performerRole == null ? null : performerRole.copy();
8019        dst.performer = performer == null ? null : performer.copy();
8020        if (performerLinkId != null) {
8021          dst.performerLinkId = new ArrayList<StringType>();
8022          for (StringType i : performerLinkId)
8023            dst.performerLinkId.add(i.copy());
8024        };
8025        if (reasonCode != null) {
8026          dst.reasonCode = new ArrayList<CodeableConcept>();
8027          for (CodeableConcept i : reasonCode)
8028            dst.reasonCode.add(i.copy());
8029        };
8030        if (reasonReference != null) {
8031          dst.reasonReference = new ArrayList<Reference>();
8032          for (Reference i : reasonReference)
8033            dst.reasonReference.add(i.copy());
8034        };
8035        if (reason != null) {
8036          dst.reason = new ArrayList<StringType>();
8037          for (StringType i : reason)
8038            dst.reason.add(i.copy());
8039        };
8040        if (reasonLinkId != null) {
8041          dst.reasonLinkId = new ArrayList<StringType>();
8042          for (StringType i : reasonLinkId)
8043            dst.reasonLinkId.add(i.copy());
8044        };
8045        if (note != null) {
8046          dst.note = new ArrayList<Annotation>();
8047          for (Annotation i : note)
8048            dst.note.add(i.copy());
8049        };
8050        if (securityLabelNumber != null) {
8051          dst.securityLabelNumber = new ArrayList<UnsignedIntType>();
8052          for (UnsignedIntType i : securityLabelNumber)
8053            dst.securityLabelNumber.add(i.copy());
8054        };
8055      }
8056
8057      @Override
8058      public boolean equalsDeep(Base other_) {
8059        if (!super.equalsDeep(other_))
8060          return false;
8061        if (!(other_ instanceof ActionComponent))
8062          return false;
8063        ActionComponent o = (ActionComponent) other_;
8064        return compareDeep(doNotPerform, o.doNotPerform, true) && compareDeep(type, o.type, true) && compareDeep(subject, o.subject, true)
8065           && compareDeep(intent, o.intent, true) && compareDeep(linkId, o.linkId, true) && compareDeep(status, o.status, true)
8066           && compareDeep(context, o.context, true) && compareDeep(contextLinkId, o.contextLinkId, true) && compareDeep(occurrence, o.occurrence, true)
8067           && compareDeep(requester, o.requester, true) && compareDeep(requesterLinkId, o.requesterLinkId, true)
8068           && compareDeep(performerType, o.performerType, true) && compareDeep(performerRole, o.performerRole, true)
8069           && compareDeep(performer, o.performer, true) && compareDeep(performerLinkId, o.performerLinkId, true)
8070           && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true)
8071           && compareDeep(reason, o.reason, true) && compareDeep(reasonLinkId, o.reasonLinkId, true) && compareDeep(note, o.note, true)
8072           && compareDeep(securityLabelNumber, o.securityLabelNumber, true);
8073      }
8074
8075      @Override
8076      public boolean equalsShallow(Base other_) {
8077        if (!super.equalsShallow(other_))
8078          return false;
8079        if (!(other_ instanceof ActionComponent))
8080          return false;
8081        ActionComponent o = (ActionComponent) other_;
8082        return compareValues(doNotPerform, o.doNotPerform, true) && compareValues(linkId, o.linkId, true) && compareValues(contextLinkId, o.contextLinkId, true)
8083           && compareValues(requesterLinkId, o.requesterLinkId, true) && compareValues(performerLinkId, o.performerLinkId, true)
8084           && compareValues(reason, o.reason, true) && compareValues(reasonLinkId, o.reasonLinkId, true) && compareValues(securityLabelNumber, o.securityLabelNumber, true)
8085          ;
8086      }
8087
8088      public boolean isEmpty() {
8089        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(doNotPerform, type, subject
8090          , intent, linkId, status, context, contextLinkId, occurrence, requester, requesterLinkId
8091          , performerType, performerRole, performer, performerLinkId, reasonCode, reasonReference
8092          , reason, reasonLinkId, note, securityLabelNumber);
8093      }
8094
8095  public String fhirType() {
8096    return "Contract.term.action";
8097
8098  }
8099
8100  }
8101
8102    @Block()
8103    public static class ActionSubjectComponent extends BackboneElement implements IBaseBackboneElement {
8104        /**
8105         * The entity the action is performed or not performed on or for.
8106         */
8107        @Child(name = "reference", type = {Patient.class, RelatedPerson.class, Practitioner.class, PractitionerRole.class, Device.class, Group.class, Organization.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8108        @Description(shortDefinition="Entity of the action", formalDefinition="The entity the action is performed or not performed on or for." )
8109        protected List<Reference> reference;
8110
8111        /**
8112         * Role type of agent assigned roles in this Contract.
8113         */
8114        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
8115        @Description(shortDefinition="Role type of the agent", formalDefinition="Role type of agent assigned roles in this Contract." )
8116        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-actorrole")
8117        protected CodeableConcept role;
8118
8119        private static final long serialVersionUID = -1599592477L;
8120
8121    /**
8122     * Constructor
8123     */
8124      public ActionSubjectComponent() {
8125        super();
8126      }
8127
8128    /**
8129     * Constructor
8130     */
8131      public ActionSubjectComponent(Reference reference) {
8132        super();
8133        this.addReference(reference);
8134      }
8135
8136        /**
8137         * @return {@link #reference} (The entity the action is performed or not performed on or for.)
8138         */
8139        public List<Reference> getReference() { 
8140          if (this.reference == null)
8141            this.reference = new ArrayList<Reference>();
8142          return this.reference;
8143        }
8144
8145        /**
8146         * @return Returns a reference to <code>this</code> for easy method chaining
8147         */
8148        public ActionSubjectComponent setReference(List<Reference> theReference) { 
8149          this.reference = theReference;
8150          return this;
8151        }
8152
8153        public boolean hasReference() { 
8154          if (this.reference == null)
8155            return false;
8156          for (Reference item : this.reference)
8157            if (!item.isEmpty())
8158              return true;
8159          return false;
8160        }
8161
8162        public Reference addReference() { //3
8163          Reference t = new Reference();
8164          if (this.reference == null)
8165            this.reference = new ArrayList<Reference>();
8166          this.reference.add(t);
8167          return t;
8168        }
8169
8170        public ActionSubjectComponent addReference(Reference t) { //3
8171          if (t == null)
8172            return this;
8173          if (this.reference == null)
8174            this.reference = new ArrayList<Reference>();
8175          this.reference.add(t);
8176          return this;
8177        }
8178
8179        /**
8180         * @return The first repetition of repeating field {@link #reference}, creating it if it does not already exist {3}
8181         */
8182        public Reference getReferenceFirstRep() { 
8183          if (getReference().isEmpty()) {
8184            addReference();
8185          }
8186          return getReference().get(0);
8187        }
8188
8189        /**
8190         * @return {@link #role} (Role type of agent assigned roles in this Contract.)
8191         */
8192        public CodeableConcept getRole() { 
8193          if (this.role == null)
8194            if (Configuration.errorOnAutoCreate())
8195              throw new Error("Attempt to auto-create ActionSubjectComponent.role");
8196            else if (Configuration.doAutoCreate())
8197              this.role = new CodeableConcept(); // cc
8198          return this.role;
8199        }
8200
8201        public boolean hasRole() { 
8202          return this.role != null && !this.role.isEmpty();
8203        }
8204
8205        /**
8206         * @param value {@link #role} (Role type of agent assigned roles in this Contract.)
8207         */
8208        public ActionSubjectComponent setRole(CodeableConcept value) { 
8209          this.role = value;
8210          return this;
8211        }
8212
8213        protected void listChildren(List<Property> children) {
8214          super.listChildren(children);
8215          children.add(new Property("reference", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Device|Group|Organization)", "The entity the action is performed or not performed on or for.", 0, java.lang.Integer.MAX_VALUE, reference));
8216          children.add(new Property("role", "CodeableConcept", "Role type of agent assigned roles in this Contract.", 0, 1, role));
8217        }
8218
8219        @Override
8220        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8221          switch (_hash) {
8222          case -925155509: /*reference*/  return new Property("reference", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Device|Group|Organization)", "The entity the action is performed or not performed on or for.", 0, java.lang.Integer.MAX_VALUE, reference);
8223          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "Role type of agent assigned roles in this Contract.", 0, 1, role);
8224          default: return super.getNamedProperty(_hash, _name, _checkValid);
8225          }
8226
8227        }
8228
8229      @Override
8230      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8231        switch (hash) {
8232        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : this.reference.toArray(new Base[this.reference.size()]); // Reference
8233        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
8234        default: return super.getProperty(hash, name, checkValid);
8235        }
8236
8237      }
8238
8239      @Override
8240      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8241        switch (hash) {
8242        case -925155509: // reference
8243          this.getReference().add(TypeConvertor.castToReference(value)); // Reference
8244          return value;
8245        case 3506294: // role
8246          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8247          return value;
8248        default: return super.setProperty(hash, name, value);
8249        }
8250
8251      }
8252
8253      @Override
8254      public Base setProperty(String name, Base value) throws FHIRException {
8255        if (name.equals("reference")) {
8256          this.getReference().add(TypeConvertor.castToReference(value));
8257        } else if (name.equals("role")) {
8258          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8259        } else
8260          return super.setProperty(name, value);
8261        return value;
8262      }
8263
8264      @Override
8265      public Base makeProperty(int hash, String name) throws FHIRException {
8266        switch (hash) {
8267        case -925155509:  return addReference(); 
8268        case 3506294:  return getRole();
8269        default: return super.makeProperty(hash, name);
8270        }
8271
8272      }
8273
8274      @Override
8275      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8276        switch (hash) {
8277        case -925155509: /*reference*/ return new String[] {"Reference"};
8278        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
8279        default: return super.getTypesForProperty(hash, name);
8280        }
8281
8282      }
8283
8284      @Override
8285      public Base addChild(String name) throws FHIRException {
8286        if (name.equals("reference")) {
8287          return addReference();
8288        }
8289        else if (name.equals("role")) {
8290          this.role = new CodeableConcept();
8291          return this.role;
8292        }
8293        else
8294          return super.addChild(name);
8295      }
8296
8297      public ActionSubjectComponent copy() {
8298        ActionSubjectComponent dst = new ActionSubjectComponent();
8299        copyValues(dst);
8300        return dst;
8301      }
8302
8303      public void copyValues(ActionSubjectComponent dst) {
8304        super.copyValues(dst);
8305        if (reference != null) {
8306          dst.reference = new ArrayList<Reference>();
8307          for (Reference i : reference)
8308            dst.reference.add(i.copy());
8309        };
8310        dst.role = role == null ? null : role.copy();
8311      }
8312
8313      @Override
8314      public boolean equalsDeep(Base other_) {
8315        if (!super.equalsDeep(other_))
8316          return false;
8317        if (!(other_ instanceof ActionSubjectComponent))
8318          return false;
8319        ActionSubjectComponent o = (ActionSubjectComponent) other_;
8320        return compareDeep(reference, o.reference, true) && compareDeep(role, o.role, true);
8321      }
8322
8323      @Override
8324      public boolean equalsShallow(Base other_) {
8325        if (!super.equalsShallow(other_))
8326          return false;
8327        if (!(other_ instanceof ActionSubjectComponent))
8328          return false;
8329        ActionSubjectComponent o = (ActionSubjectComponent) other_;
8330        return true;
8331      }
8332
8333      public boolean isEmpty() {
8334        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(reference, role);
8335      }
8336
8337  public String fhirType() {
8338    return "Contract.term.action.subject";
8339
8340  }
8341
8342  }
8343
8344    @Block()
8345    public static class SignatoryComponent extends BackboneElement implements IBaseBackboneElement {
8346        /**
8347         * Role of this Contract signer, e.g. notary, grantee.
8348         */
8349        @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false)
8350        @Description(shortDefinition="Contract Signatory Role", formalDefinition="Role of this Contract signer, e.g. notary, grantee." )
8351        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-signer-type")
8352        protected Coding type;
8353
8354        /**
8355         * Party which is a signator to this Contract.
8356         */
8357        @Child(name = "party", type = {Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class}, order=2, min=1, max=1, modifier=false, summary=false)
8358        @Description(shortDefinition="Contract Signatory Party", formalDefinition="Party which is a signator to this Contract." )
8359        protected Reference party;
8360
8361        /**
8362         * Legally binding Contract DSIG signature contents in Base64.
8363         */
8364        @Child(name = "signature", type = {Signature.class}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8365        @Description(shortDefinition="Contract Documentation Signature", formalDefinition="Legally binding Contract DSIG signature contents in Base64." )
8366        protected List<Signature> signature;
8367
8368        private static final long serialVersionUID = 1384929729L;
8369
8370    /**
8371     * Constructor
8372     */
8373      public SignatoryComponent() {
8374        super();
8375      }
8376
8377    /**
8378     * Constructor
8379     */
8380      public SignatoryComponent(Coding type, Reference party, Signature signature) {
8381        super();
8382        this.setType(type);
8383        this.setParty(party);
8384        this.addSignature(signature);
8385      }
8386
8387        /**
8388         * @return {@link #type} (Role of this Contract signer, e.g. notary, grantee.)
8389         */
8390        public Coding getType() { 
8391          if (this.type == null)
8392            if (Configuration.errorOnAutoCreate())
8393              throw new Error("Attempt to auto-create SignatoryComponent.type");
8394            else if (Configuration.doAutoCreate())
8395              this.type = new Coding(); // cc
8396          return this.type;
8397        }
8398
8399        public boolean hasType() { 
8400          return this.type != null && !this.type.isEmpty();
8401        }
8402
8403        /**
8404         * @param value {@link #type} (Role of this Contract signer, e.g. notary, grantee.)
8405         */
8406        public SignatoryComponent setType(Coding value) { 
8407          this.type = value;
8408          return this;
8409        }
8410
8411        /**
8412         * @return {@link #party} (Party which is a signator to this Contract.)
8413         */
8414        public Reference getParty() { 
8415          if (this.party == null)
8416            if (Configuration.errorOnAutoCreate())
8417              throw new Error("Attempt to auto-create SignatoryComponent.party");
8418            else if (Configuration.doAutoCreate())
8419              this.party = new Reference(); // cc
8420          return this.party;
8421        }
8422
8423        public boolean hasParty() { 
8424          return this.party != null && !this.party.isEmpty();
8425        }
8426
8427        /**
8428         * @param value {@link #party} (Party which is a signator to this Contract.)
8429         */
8430        public SignatoryComponent setParty(Reference value) { 
8431          this.party = value;
8432          return this;
8433        }
8434
8435        /**
8436         * @return {@link #signature} (Legally binding Contract DSIG signature contents in Base64.)
8437         */
8438        public List<Signature> getSignature() { 
8439          if (this.signature == null)
8440            this.signature = new ArrayList<Signature>();
8441          return this.signature;
8442        }
8443
8444        /**
8445         * @return Returns a reference to <code>this</code> for easy method chaining
8446         */
8447        public SignatoryComponent setSignature(List<Signature> theSignature) { 
8448          this.signature = theSignature;
8449          return this;
8450        }
8451
8452        public boolean hasSignature() { 
8453          if (this.signature == null)
8454            return false;
8455          for (Signature item : this.signature)
8456            if (!item.isEmpty())
8457              return true;
8458          return false;
8459        }
8460
8461        public Signature addSignature() { //3
8462          Signature t = new Signature();
8463          if (this.signature == null)
8464            this.signature = new ArrayList<Signature>();
8465          this.signature.add(t);
8466          return t;
8467        }
8468
8469        public SignatoryComponent addSignature(Signature t) { //3
8470          if (t == null)
8471            return this;
8472          if (this.signature == null)
8473            this.signature = new ArrayList<Signature>();
8474          this.signature.add(t);
8475          return this;
8476        }
8477
8478        /**
8479         * @return The first repetition of repeating field {@link #signature}, creating it if it does not already exist {3}
8480         */
8481        public Signature getSignatureFirstRep() { 
8482          if (getSignature().isEmpty()) {
8483            addSignature();
8484          }
8485          return getSignature().get(0);
8486        }
8487
8488        protected void listChildren(List<Property> children) {
8489          super.listChildren(children);
8490          children.add(new Property("type", "Coding", "Role of this Contract signer, e.g. notary, grantee.", 0, 1, type));
8491          children.add(new Property("party", "Reference(Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "Party which is a signator to this Contract.", 0, 1, party));
8492          children.add(new Property("signature", "Signature", "Legally binding Contract DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, signature));
8493        }
8494
8495        @Override
8496        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8497          switch (_hash) {
8498          case 3575610: /*type*/  return new Property("type", "Coding", "Role of this Contract signer, e.g. notary, grantee.", 0, 1, type);
8499          case 106437350: /*party*/  return new Property("party", "Reference(Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "Party which is a signator to this Contract.", 0, 1, party);
8500          case 1073584312: /*signature*/  return new Property("signature", "Signature", "Legally binding Contract DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, signature);
8501          default: return super.getNamedProperty(_hash, _name, _checkValid);
8502          }
8503
8504        }
8505
8506      @Override
8507      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8508        switch (hash) {
8509        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
8510        case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference
8511        case 1073584312: /*signature*/ return this.signature == null ? new Base[0] : this.signature.toArray(new Base[this.signature.size()]); // Signature
8512        default: return super.getProperty(hash, name, checkValid);
8513        }
8514
8515      }
8516
8517      @Override
8518      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8519        switch (hash) {
8520        case 3575610: // type
8521          this.type = TypeConvertor.castToCoding(value); // Coding
8522          return value;
8523        case 106437350: // party
8524          this.party = TypeConvertor.castToReference(value); // Reference
8525          return value;
8526        case 1073584312: // signature
8527          this.getSignature().add(TypeConvertor.castToSignature(value)); // Signature
8528          return value;
8529        default: return super.setProperty(hash, name, value);
8530        }
8531
8532      }
8533
8534      @Override
8535      public Base setProperty(String name, Base value) throws FHIRException {
8536        if (name.equals("type")) {
8537          this.type = TypeConvertor.castToCoding(value); // Coding
8538        } else if (name.equals("party")) {
8539          this.party = TypeConvertor.castToReference(value); // Reference
8540        } else if (name.equals("signature")) {
8541          this.getSignature().add(TypeConvertor.castToSignature(value));
8542        } else
8543          return super.setProperty(name, value);
8544        return value;
8545      }
8546
8547      @Override
8548      public Base makeProperty(int hash, String name) throws FHIRException {
8549        switch (hash) {
8550        case 3575610:  return getType();
8551        case 106437350:  return getParty();
8552        case 1073584312:  return addSignature(); 
8553        default: return super.makeProperty(hash, name);
8554        }
8555
8556      }
8557
8558      @Override
8559      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8560        switch (hash) {
8561        case 3575610: /*type*/ return new String[] {"Coding"};
8562        case 106437350: /*party*/ return new String[] {"Reference"};
8563        case 1073584312: /*signature*/ return new String[] {"Signature"};
8564        default: return super.getTypesForProperty(hash, name);
8565        }
8566
8567      }
8568
8569      @Override
8570      public Base addChild(String name) throws FHIRException {
8571        if (name.equals("type")) {
8572          this.type = new Coding();
8573          return this.type;
8574        }
8575        else if (name.equals("party")) {
8576          this.party = new Reference();
8577          return this.party;
8578        }
8579        else if (name.equals("signature")) {
8580          return addSignature();
8581        }
8582        else
8583          return super.addChild(name);
8584      }
8585
8586      public SignatoryComponent copy() {
8587        SignatoryComponent dst = new SignatoryComponent();
8588        copyValues(dst);
8589        return dst;
8590      }
8591
8592      public void copyValues(SignatoryComponent dst) {
8593        super.copyValues(dst);
8594        dst.type = type == null ? null : type.copy();
8595        dst.party = party == null ? null : party.copy();
8596        if (signature != null) {
8597          dst.signature = new ArrayList<Signature>();
8598          for (Signature i : signature)
8599            dst.signature.add(i.copy());
8600        };
8601      }
8602
8603      @Override
8604      public boolean equalsDeep(Base other_) {
8605        if (!super.equalsDeep(other_))
8606          return false;
8607        if (!(other_ instanceof SignatoryComponent))
8608          return false;
8609        SignatoryComponent o = (SignatoryComponent) other_;
8610        return compareDeep(type, o.type, true) && compareDeep(party, o.party, true) && compareDeep(signature, o.signature, true)
8611          ;
8612      }
8613
8614      @Override
8615      public boolean equalsShallow(Base other_) {
8616        if (!super.equalsShallow(other_))
8617          return false;
8618        if (!(other_ instanceof SignatoryComponent))
8619          return false;
8620        SignatoryComponent o = (SignatoryComponent) other_;
8621        return true;
8622      }
8623
8624      public boolean isEmpty() {
8625        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, party, signature);
8626      }
8627
8628  public String fhirType() {
8629    return "Contract.signer";
8630
8631  }
8632
8633  }
8634
8635    @Block()
8636    public static class FriendlyLanguageComponent extends BackboneElement implements IBaseBackboneElement {
8637        /**
8638         * Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.
8639         */
8640        @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=1, min=1, max=1, modifier=false, summary=false)
8641        @Description(shortDefinition="Easily comprehended representation of this Contract", formalDefinition="Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability." )
8642        protected DataType content;
8643
8644        private static final long serialVersionUID = -1954179063L;
8645
8646    /**
8647     * Constructor
8648     */
8649      public FriendlyLanguageComponent() {
8650        super();
8651      }
8652
8653    /**
8654     * Constructor
8655     */
8656      public FriendlyLanguageComponent(DataType content) {
8657        super();
8658        this.setContent(content);
8659      }
8660
8661        /**
8662         * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.)
8663         */
8664        public DataType getContent() { 
8665          return this.content;
8666        }
8667
8668        /**
8669         * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.)
8670         */
8671        public Attachment getContentAttachment() throws FHIRException { 
8672          if (this.content == null)
8673            this.content = new Attachment();
8674          if (!(this.content instanceof Attachment))
8675            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
8676          return (Attachment) this.content;
8677        }
8678
8679        public boolean hasContentAttachment() { 
8680          return this != null && this.content instanceof Attachment;
8681        }
8682
8683        /**
8684         * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.)
8685         */
8686        public Reference getContentReference() throws FHIRException { 
8687          if (this.content == null)
8688            this.content = new Reference();
8689          if (!(this.content instanceof Reference))
8690            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered");
8691          return (Reference) this.content;
8692        }
8693
8694        public boolean hasContentReference() { 
8695          return this != null && this.content instanceof Reference;
8696        }
8697
8698        public boolean hasContent() { 
8699          return this.content != null && !this.content.isEmpty();
8700        }
8701
8702        /**
8703         * @param value {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.)
8704         */
8705        public FriendlyLanguageComponent setContent(DataType value) { 
8706          if (value != null && !(value instanceof Attachment || value instanceof Reference))
8707            throw new Error("Not the right type for Contract.friendly.content[x]: "+value.fhirType());
8708          this.content = value;
8709          return this;
8710        }
8711
8712        protected void listChildren(List<Property> children) {
8713          super.listChildren(children);
8714          children.add(new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.", 0, 1, content));
8715        }
8716
8717        @Override
8718        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8719          switch (_hash) {
8720          case 264548711: /*content[x]*/  return new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.", 0, 1, content);
8721          case 951530617: /*content*/  return new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.", 0, 1, content);
8722          case -702028164: /*contentAttachment*/  return new Property("content[x]", "Attachment", "Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.", 0, 1, content);
8723          case 1193747154: /*contentReference*/  return new Property("content[x]", "Reference(Composition|DocumentReference|QuestionnaireResponse)", "Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.", 0, 1, content);
8724          default: return super.getNamedProperty(_hash, _name, _checkValid);
8725          }
8726
8727        }
8728
8729      @Override
8730      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8731        switch (hash) {
8732        case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // DataType
8733        default: return super.getProperty(hash, name, checkValid);
8734        }
8735
8736      }
8737
8738      @Override
8739      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8740        switch (hash) {
8741        case 951530617: // content
8742          this.content = TypeConvertor.castToType(value); // DataType
8743          return value;
8744        default: return super.setProperty(hash, name, value);
8745        }
8746
8747      }
8748
8749      @Override
8750      public Base setProperty(String name, Base value) throws FHIRException {
8751        if (name.equals("content[x]")) {
8752          this.content = TypeConvertor.castToType(value); // DataType
8753        } else
8754          return super.setProperty(name, value);
8755        return value;
8756      }
8757
8758      @Override
8759      public Base makeProperty(int hash, String name) throws FHIRException {
8760        switch (hash) {
8761        case 264548711:  return getContent();
8762        case 951530617:  return getContent();
8763        default: return super.makeProperty(hash, name);
8764        }
8765
8766      }
8767
8768      @Override
8769      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8770        switch (hash) {
8771        case 951530617: /*content*/ return new String[] {"Attachment", "Reference"};
8772        default: return super.getTypesForProperty(hash, name);
8773        }
8774
8775      }
8776
8777      @Override
8778      public Base addChild(String name) throws FHIRException {
8779        if (name.equals("contentAttachment")) {
8780          this.content = new Attachment();
8781          return this.content;
8782        }
8783        else if (name.equals("contentReference")) {
8784          this.content = new Reference();
8785          return this.content;
8786        }
8787        else
8788          return super.addChild(name);
8789      }
8790
8791      public FriendlyLanguageComponent copy() {
8792        FriendlyLanguageComponent dst = new FriendlyLanguageComponent();
8793        copyValues(dst);
8794        return dst;
8795      }
8796
8797      public void copyValues(FriendlyLanguageComponent dst) {
8798        super.copyValues(dst);
8799        dst.content = content == null ? null : content.copy();
8800      }
8801
8802      @Override
8803      public boolean equalsDeep(Base other_) {
8804        if (!super.equalsDeep(other_))
8805          return false;
8806        if (!(other_ instanceof FriendlyLanguageComponent))
8807          return false;
8808        FriendlyLanguageComponent o = (FriendlyLanguageComponent) other_;
8809        return compareDeep(content, o.content, true);
8810      }
8811
8812      @Override
8813      public boolean equalsShallow(Base other_) {
8814        if (!super.equalsShallow(other_))
8815          return false;
8816        if (!(other_ instanceof FriendlyLanguageComponent))
8817          return false;
8818        FriendlyLanguageComponent o = (FriendlyLanguageComponent) other_;
8819        return true;
8820      }
8821
8822      public boolean isEmpty() {
8823        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(content);
8824      }
8825
8826  public String fhirType() {
8827    return "Contract.friendly";
8828
8829  }
8830
8831  }
8832
8833    @Block()
8834    public static class LegalLanguageComponent extends BackboneElement implements IBaseBackboneElement {
8835        /**
8836         * Contract legal text in human renderable form.
8837         */
8838        @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=1, min=1, max=1, modifier=false, summary=false)
8839        @Description(shortDefinition="Contract Legal Text", formalDefinition="Contract legal text in human renderable form." )
8840        protected DataType content;
8841
8842        private static final long serialVersionUID = -1954179063L;
8843
8844    /**
8845     * Constructor
8846     */
8847      public LegalLanguageComponent() {
8848        super();
8849      }
8850
8851    /**
8852     * Constructor
8853     */
8854      public LegalLanguageComponent(DataType content) {
8855        super();
8856        this.setContent(content);
8857      }
8858
8859        /**
8860         * @return {@link #content} (Contract legal text in human renderable form.)
8861         */
8862        public DataType getContent() { 
8863          return this.content;
8864        }
8865
8866        /**
8867         * @return {@link #content} (Contract legal text in human renderable form.)
8868         */
8869        public Attachment getContentAttachment() throws FHIRException { 
8870          if (this.content == null)
8871            this.content = new Attachment();
8872          if (!(this.content instanceof Attachment))
8873            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
8874          return (Attachment) this.content;
8875        }
8876
8877        public boolean hasContentAttachment() { 
8878          return this != null && this.content instanceof Attachment;
8879        }
8880
8881        /**
8882         * @return {@link #content} (Contract legal text in human renderable form.)
8883         */
8884        public Reference getContentReference() throws FHIRException { 
8885          if (this.content == null)
8886            this.content = new Reference();
8887          if (!(this.content instanceof Reference))
8888            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered");
8889          return (Reference) this.content;
8890        }
8891
8892        public boolean hasContentReference() { 
8893          return this != null && this.content instanceof Reference;
8894        }
8895
8896        public boolean hasContent() { 
8897          return this.content != null && !this.content.isEmpty();
8898        }
8899
8900        /**
8901         * @param value {@link #content} (Contract legal text in human renderable form.)
8902         */
8903        public LegalLanguageComponent setContent(DataType value) { 
8904          if (value != null && !(value instanceof Attachment || value instanceof Reference))
8905            throw new Error("Not the right type for Contract.legal.content[x]: "+value.fhirType());
8906          this.content = value;
8907          return this;
8908        }
8909
8910        protected void listChildren(List<Property> children) {
8911          super.listChildren(children);
8912          children.add(new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content));
8913        }
8914
8915        @Override
8916        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8917          switch (_hash) {
8918          case 264548711: /*content[x]*/  return new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content);
8919          case 951530617: /*content*/  return new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content);
8920          case -702028164: /*contentAttachment*/  return new Property("content[x]", "Attachment", "Contract legal text in human renderable form.", 0, 1, content);
8921          case 1193747154: /*contentReference*/  return new Property("content[x]", "Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content);
8922          default: return super.getNamedProperty(_hash, _name, _checkValid);
8923          }
8924
8925        }
8926
8927      @Override
8928      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8929        switch (hash) {
8930        case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // DataType
8931        default: return super.getProperty(hash, name, checkValid);
8932        }
8933
8934      }
8935
8936      @Override
8937      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8938        switch (hash) {
8939        case 951530617: // content
8940          this.content = TypeConvertor.castToType(value); // DataType
8941          return value;
8942        default: return super.setProperty(hash, name, value);
8943        }
8944
8945      }
8946
8947      @Override
8948      public Base setProperty(String name, Base value) throws FHIRException {
8949        if (name.equals("content[x]")) {
8950          this.content = TypeConvertor.castToType(value); // DataType
8951        } else
8952          return super.setProperty(name, value);
8953        return value;
8954      }
8955
8956      @Override
8957      public Base makeProperty(int hash, String name) throws FHIRException {
8958        switch (hash) {
8959        case 264548711:  return getContent();
8960        case 951530617:  return getContent();
8961        default: return super.makeProperty(hash, name);
8962        }
8963
8964      }
8965
8966      @Override
8967      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8968        switch (hash) {
8969        case 951530617: /*content*/ return new String[] {"Attachment", "Reference"};
8970        default: return super.getTypesForProperty(hash, name);
8971        }
8972
8973      }
8974
8975      @Override
8976      public Base addChild(String name) throws FHIRException {
8977        if (name.equals("contentAttachment")) {
8978          this.content = new Attachment();
8979          return this.content;
8980        }
8981        else if (name.equals("contentReference")) {
8982          this.content = new Reference();
8983          return this.content;
8984        }
8985        else
8986          return super.addChild(name);
8987      }
8988
8989      public LegalLanguageComponent copy() {
8990        LegalLanguageComponent dst = new LegalLanguageComponent();
8991        copyValues(dst);
8992        return dst;
8993      }
8994
8995      public void copyValues(LegalLanguageComponent dst) {
8996        super.copyValues(dst);
8997        dst.content = content == null ? null : content.copy();
8998      }
8999
9000      @Override
9001      public boolean equalsDeep(Base other_) {
9002        if (!super.equalsDeep(other_))
9003          return false;
9004        if (!(other_ instanceof LegalLanguageComponent))
9005          return false;
9006        LegalLanguageComponent o = (LegalLanguageComponent) other_;
9007        return compareDeep(content, o.content, true);
9008      }
9009
9010      @Override
9011      public boolean equalsShallow(Base other_) {
9012        if (!super.equalsShallow(other_))
9013          return false;
9014        if (!(other_ instanceof LegalLanguageComponent))
9015          return false;
9016        LegalLanguageComponent o = (LegalLanguageComponent) other_;
9017        return true;
9018      }
9019
9020      public boolean isEmpty() {
9021        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(content);
9022      }
9023
9024  public String fhirType() {
9025    return "Contract.legal";
9026
9027  }
9028
9029  }
9030
9031    @Block()
9032    public static class ComputableLanguageComponent extends BackboneElement implements IBaseBackboneElement {
9033        /**
9034         * Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).
9035         */
9036        @Child(name = "content", type = {Attachment.class, DocumentReference.class}, order=1, min=1, max=1, modifier=false, summary=false)
9037        @Description(shortDefinition="Computable Contract Rules", formalDefinition="Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal)." )
9038        protected DataType content;
9039
9040        private static final long serialVersionUID = -1954179063L;
9041
9042    /**
9043     * Constructor
9044     */
9045      public ComputableLanguageComponent() {
9046        super();
9047      }
9048
9049    /**
9050     * Constructor
9051     */
9052      public ComputableLanguageComponent(DataType content) {
9053        super();
9054        this.setContent(content);
9055      }
9056
9057        /**
9058         * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).)
9059         */
9060        public DataType getContent() { 
9061          return this.content;
9062        }
9063
9064        /**
9065         * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).)
9066         */
9067        public Attachment getContentAttachment() throws FHIRException { 
9068          if (this.content == null)
9069            this.content = new Attachment();
9070          if (!(this.content instanceof Attachment))
9071            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
9072          return (Attachment) this.content;
9073        }
9074
9075        public boolean hasContentAttachment() { 
9076          return this != null && this.content instanceof Attachment;
9077        }
9078
9079        /**
9080         * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).)
9081         */
9082        public Reference getContentReference() throws FHIRException { 
9083          if (this.content == null)
9084            this.content = new Reference();
9085          if (!(this.content instanceof Reference))
9086            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered");
9087          return (Reference) this.content;
9088        }
9089
9090        public boolean hasContentReference() { 
9091          return this != null && this.content instanceof Reference;
9092        }
9093
9094        public boolean hasContent() { 
9095          return this.content != null && !this.content.isEmpty();
9096        }
9097
9098        /**
9099         * @param value {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).)
9100         */
9101        public ComputableLanguageComponent setContent(DataType value) { 
9102          if (value != null && !(value instanceof Attachment || value instanceof Reference))
9103            throw new Error("Not the right type for Contract.rule.content[x]: "+value.fhirType());
9104          this.content = value;
9105          return this;
9106        }
9107
9108        protected void listChildren(List<Property> children) {
9109          super.listChildren(children);
9110          children.add(new Property("content[x]", "Attachment|Reference(DocumentReference)", "Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).", 0, 1, content));
9111        }
9112
9113        @Override
9114        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
9115          switch (_hash) {
9116          case 264548711: /*content[x]*/  return new Property("content[x]", "Attachment|Reference(DocumentReference)", "Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).", 0, 1, content);
9117          case 951530617: /*content*/  return new Property("content[x]", "Attachment|Reference(DocumentReference)", "Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).", 0, 1, content);
9118          case -702028164: /*contentAttachment*/  return new Property("content[x]", "Attachment", "Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).", 0, 1, content);
9119          case 1193747154: /*contentReference*/  return new Property("content[x]", "Reference(DocumentReference)", "Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).", 0, 1, content);
9120          default: return super.getNamedProperty(_hash, _name, _checkValid);
9121          }
9122
9123        }
9124
9125      @Override
9126      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
9127        switch (hash) {
9128        case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // DataType
9129        default: return super.getProperty(hash, name, checkValid);
9130        }
9131
9132      }
9133
9134      @Override
9135      public Base setProperty(int hash, String name, Base value) throws FHIRException {
9136        switch (hash) {
9137        case 951530617: // content
9138          this.content = TypeConvertor.castToType(value); // DataType
9139          return value;
9140        default: return super.setProperty(hash, name, value);
9141        }
9142
9143      }
9144
9145      @Override
9146      public Base setProperty(String name, Base value) throws FHIRException {
9147        if (name.equals("content[x]")) {
9148          this.content = TypeConvertor.castToType(value); // DataType
9149        } else
9150          return super.setProperty(name, value);
9151        return value;
9152      }
9153
9154      @Override
9155      public Base makeProperty(int hash, String name) throws FHIRException {
9156        switch (hash) {
9157        case 264548711:  return getContent();
9158        case 951530617:  return getContent();
9159        default: return super.makeProperty(hash, name);
9160        }
9161
9162      }
9163
9164      @Override
9165      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
9166        switch (hash) {
9167        case 951530617: /*content*/ return new String[] {"Attachment", "Reference"};
9168        default: return super.getTypesForProperty(hash, name);
9169        }
9170
9171      }
9172
9173      @Override
9174      public Base addChild(String name) throws FHIRException {
9175        if (name.equals("contentAttachment")) {
9176          this.content = new Attachment();
9177          return this.content;
9178        }
9179        else if (name.equals("contentReference")) {
9180          this.content = new Reference();
9181          return this.content;
9182        }
9183        else
9184          return super.addChild(name);
9185      }
9186
9187      public ComputableLanguageComponent copy() {
9188        ComputableLanguageComponent dst = new ComputableLanguageComponent();
9189        copyValues(dst);
9190        return dst;
9191      }
9192
9193      public void copyValues(ComputableLanguageComponent dst) {
9194        super.copyValues(dst);
9195        dst.content = content == null ? null : content.copy();
9196      }
9197
9198      @Override
9199      public boolean equalsDeep(Base other_) {
9200        if (!super.equalsDeep(other_))
9201          return false;
9202        if (!(other_ instanceof ComputableLanguageComponent))
9203          return false;
9204        ComputableLanguageComponent o = (ComputableLanguageComponent) other_;
9205        return compareDeep(content, o.content, true);
9206      }
9207
9208      @Override
9209      public boolean equalsShallow(Base other_) {
9210        if (!super.equalsShallow(other_))
9211          return false;
9212        if (!(other_ instanceof ComputableLanguageComponent))
9213          return false;
9214        ComputableLanguageComponent o = (ComputableLanguageComponent) other_;
9215        return true;
9216      }
9217
9218      public boolean isEmpty() {
9219        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(content);
9220      }
9221
9222  public String fhirType() {
9223    return "Contract.rule";
9224
9225  }
9226
9227  }
9228
9229    /**
9230     * Unique identifier for this Contract or a derivative that references a Source Contract.
9231     */
9232    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9233    @Description(shortDefinition="Contract number", formalDefinition="Unique identifier for this Contract or a derivative that references a Source Contract." )
9234    protected List<Identifier> identifier;
9235
9236    /**
9237     * Canonical identifier for this contract, represented as a URI (globally unique).
9238     */
9239    @Child(name = "url", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=false)
9240    @Description(shortDefinition="Basal definition", formalDefinition="Canonical identifier for this contract, represented as a URI (globally unique)." )
9241    protected UriType url;
9242
9243    /**
9244     * An edition identifier used for business purposes to label business significant variants.
9245     */
9246    @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
9247    @Description(shortDefinition="Business edition", formalDefinition="An edition identifier used for business purposes to label business significant variants." )
9248    protected StringType version;
9249
9250    /**
9251     * The status of the resource instance.
9252     */
9253    @Child(name = "status", type = {CodeType.class}, order=3, min=0, max=1, modifier=true, summary=true)
9254    @Description(shortDefinition="amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated", formalDefinition="The status of the resource instance." )
9255    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-status")
9256    protected Enumeration<ContractResourceStatusCodes> status;
9257
9258    /**
9259     * Legal states of the formation of a legal instrument, which is a formally executed written document that can be formally attributed to its author, records and formally expresses a legally enforceable act, process, or contractual duty, obligation, or right, and therefore evidences that act, process, or agreement.
9260     */
9261    @Child(name = "legalState", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
9262    @Description(shortDefinition="Negotiation status", formalDefinition="Legal states of the formation of a legal instrument, which is a formally executed written document that can be formally attributed to its author, records and formally expresses a legally enforceable act, process, or contractual duty, obligation, or right, and therefore evidences that act, process, or agreement." )
9263    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-legalstate")
9264    protected CodeableConcept legalState;
9265
9266    /**
9267     * The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract.
9268     */
9269    @Child(name = "instantiatesCanonical", type = {Contract.class}, order=5, min=0, max=1, modifier=false, summary=false)
9270    @Description(shortDefinition="Source Contract Definition", formalDefinition="The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract." )
9271    protected Reference instantiatesCanonical;
9272
9273    /**
9274     * The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract.
9275     */
9276    @Child(name = "instantiatesUri", type = {UriType.class}, order=6, min=0, max=1, modifier=false, summary=false)
9277    @Description(shortDefinition="External Contract Definition", formalDefinition="The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract." )
9278    protected UriType instantiatesUri;
9279
9280    /**
9281     * The minimal content derived from the basal information source at a specific stage in its lifecycle.
9282     */
9283    @Child(name = "contentDerivative", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false)
9284    @Description(shortDefinition="Content derived from the basal information", formalDefinition="The minimal content derived from the basal information source at a specific stage in its lifecycle." )
9285    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-content-derivative")
9286    protected CodeableConcept contentDerivative;
9287
9288    /**
9289     * When this  Contract was issued.
9290     */
9291    @Child(name = "issued", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true)
9292    @Description(shortDefinition="When this Contract was issued", formalDefinition="When this  Contract was issued." )
9293    protected DateTimeType issued;
9294
9295    /**
9296     * Relevant time or time-period when this Contract is applicable.
9297     */
9298    @Child(name = "applies", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=true)
9299    @Description(shortDefinition="Effective time", formalDefinition="Relevant time or time-period when this Contract is applicable." )
9300    protected Period applies;
9301
9302    /**
9303     * Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract.
9304     */
9305    @Child(name = "expirationType", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=false)
9306    @Description(shortDefinition="Contract cessation cause", formalDefinition="Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract." )
9307    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-expiration-type")
9308    protected CodeableConcept expirationType;
9309
9310    /**
9311     * The target entity impacted by or of interest to parties to the agreement.
9312     */
9313    @Child(name = "subject", type = {Reference.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9314    @Description(shortDefinition="Contract Target Entity", formalDefinition="The target entity impacted by or of interest to parties to the agreement." )
9315    protected List<Reference> subject;
9316
9317    /**
9318     * A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.
9319     */
9320    @Child(name = "authority", type = {Organization.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9321    @Description(shortDefinition="Authority under which this Contract has standing", formalDefinition="A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies." )
9322    protected List<Reference> authority;
9323
9324    /**
9325     * Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.
9326     */
9327    @Child(name = "domain", type = {Location.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9328    @Description(shortDefinition="A sphere of control governed by an authoritative jurisdiction, organization, or person", formalDefinition="Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources." )
9329    protected List<Reference> domain;
9330
9331    /**
9332     * Sites in which the contract is complied with,  exercised, or in force.
9333     */
9334    @Child(name = "site", type = {Location.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9335    @Description(shortDefinition="Specific Location", formalDefinition="Sites in which the contract is complied with,  exercised, or in force." )
9336    protected List<Reference> site;
9337
9338    /**
9339     * A natural language name identifying this Contract definition, derivative, or instance in any legal state. Provides additional information about its content. This name should be usable as an identifier for the module by machine processing applications such as code generation.
9340     */
9341    @Child(name = "name", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=true)
9342    @Description(shortDefinition="Computer friendly designation", formalDefinition="A natural language name identifying this Contract definition, derivative, or instance in any legal state. Provides additional information about its content. This name should be usable as an identifier for the module by machine processing applications such as code generation." )
9343    protected StringType name;
9344
9345    /**
9346     * A short, descriptive, user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.
9347     */
9348    @Child(name = "title", type = {StringType.class}, order=16, min=0, max=1, modifier=false, summary=true)
9349    @Description(shortDefinition="Human Friendly name", formalDefinition="A short, descriptive, user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content." )
9350    protected StringType title;
9351
9352    /**
9353     * An explanatory or alternate user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.
9354     */
9355    @Child(name = "subtitle", type = {StringType.class}, order=17, min=0, max=1, modifier=false, summary=false)
9356    @Description(shortDefinition="Subordinate Friendly name", formalDefinition="An explanatory or alternate user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content." )
9357    protected StringType subtitle;
9358
9359    /**
9360     * Alternative representation of the title for this Contract definition, derivative, or instance in any legal state., e.g., a domain specific contract number related to legislation.
9361     */
9362    @Child(name = "alias", type = {StringType.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9363    @Description(shortDefinition="Acronym or short name", formalDefinition="Alternative representation of the title for this Contract definition, derivative, or instance in any legal state., e.g., a domain specific contract number related to legislation." )
9364    protected List<StringType> alias;
9365
9366    /**
9367     * The individual or organization that authored the Contract definition, derivative, or instance in any legal state.
9368     */
9369    @Child(name = "author", type = {Patient.class, Practitioner.class, PractitionerRole.class, Organization.class}, order=19, min=0, max=1, modifier=false, summary=false)
9370    @Description(shortDefinition="Source of Contract", formalDefinition="The individual or organization that authored the Contract definition, derivative, or instance in any legal state." )
9371    protected Reference author;
9372
9373    /**
9374     * A selector of legal concerns for this Contract definition, derivative, or instance in any legal state.
9375     */
9376    @Child(name = "scope", type = {CodeableConcept.class}, order=20, min=0, max=1, modifier=false, summary=false)
9377    @Description(shortDefinition="Range of Legal Concerns", formalDefinition="A selector of legal concerns for this Contract definition, derivative, or instance in any legal state." )
9378    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-scope")
9379    protected CodeableConcept scope;
9380
9381    /**
9382     * Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.
9383     */
9384    @Child(name = "topic", type = {CodeableConcept.class, Reference.class}, order=21, min=0, max=1, modifier=false, summary=false)
9385    @Description(shortDefinition="Focus of contract interest", formalDefinition="Narrows the range of legal concerns to focus on the achievement of specific contractual objectives." )
9386    protected DataType topic;
9387
9388    /**
9389     * A high-level category for the legal instrument, whether constructed as a Contract definition, derivative, or instance in any legal state.  Provides additional information about its content within the context of the Contract's scope to distinguish the kinds of systems that would be interested in the contract.
9390     */
9391    @Child(name = "type", type = {CodeableConcept.class}, order=22, min=0, max=1, modifier=false, summary=true)
9392    @Description(shortDefinition="Legal instrument category", formalDefinition="A high-level category for the legal instrument, whether constructed as a Contract definition, derivative, or instance in any legal state.  Provides additional information about its content within the context of the Contract's scope to distinguish the kinds of systems that would be interested in the contract." )
9393    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-type")
9394    protected CodeableConcept type;
9395
9396    /**
9397     * Sub-category for the Contract that distinguishes the kinds of systems that would be interested in the Contract within the context of the Contract's scope.
9398     */
9399    @Child(name = "subType", type = {CodeableConcept.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9400    @Description(shortDefinition="Subtype within the context of type", formalDefinition="Sub-category for the Contract that distinguishes the kinds of systems that would be interested in the Contract within the context of the Contract's scope." )
9401    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-subtype")
9402    protected List<CodeableConcept> subType;
9403
9404    /**
9405     * Precusory content developed with a focus and intent of supporting the formation a Contract instance, which may be associated with and transformable into a Contract.
9406     */
9407    @Child(name = "contentDefinition", type = {}, order=24, min=0, max=1, modifier=false, summary=false)
9408    @Description(shortDefinition="Contract precursor content", formalDefinition="Precusory content developed with a focus and intent of supporting the formation a Contract instance, which may be associated with and transformable into a Contract." )
9409    protected ContentDefinitionComponent contentDefinition;
9410
9411    /**
9412     * One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.
9413     */
9414    @Child(name = "term", type = {}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9415    @Description(shortDefinition="Contract Term List", formalDefinition="One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups." )
9416    protected List<TermComponent> term;
9417
9418    /**
9419     * Information that may be needed by/relevant to the performer in their execution of this term action.
9420     */
9421    @Child(name = "supportingInfo", type = {Reference.class}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9422    @Description(shortDefinition="Extra Information", formalDefinition="Information that may be needed by/relevant to the performer in their execution of this term action." )
9423    protected List<Reference> supportingInfo;
9424
9425    /**
9426     * Links to Provenance records for past versions of this Contract definition, derivative, or instance, which identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the Contract.  The Provence.entity indicates the target that was changed in the update. http://build.fhir.org/provenance-definitions.html#Provenance.entity.
9427     */
9428    @Child(name = "relevantHistory", type = {Provenance.class}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9429    @Description(shortDefinition="Key event in Contract History", formalDefinition="Links to Provenance records for past versions of this Contract definition, derivative, or instance, which identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the Contract.  The Provence.entity indicates the target that was changed in the update. http://build.fhir.org/provenance-definitions.html#Provenance.entity." )
9430    protected List<Reference> relevantHistory;
9431
9432    /**
9433     * Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness.
9434     */
9435    @Child(name = "signer", type = {}, order=28, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9436    @Description(shortDefinition="Contract Signatory", formalDefinition="Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness." )
9437    protected List<SignatoryComponent> signer;
9438
9439    /**
9440     * The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.
9441     */
9442    @Child(name = "friendly", type = {}, order=29, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9443    @Description(shortDefinition="Contract Friendly Language", formalDefinition="The \"patient friendly language\" versionof the Contract in whole or in parts. \"Patient friendly language\" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement." )
9444    protected List<FriendlyLanguageComponent> friendly;
9445
9446    /**
9447     * List of Legal expressions or representations of this Contract.
9448     */
9449    @Child(name = "legal", type = {}, order=30, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9450    @Description(shortDefinition="Contract Legal Language", formalDefinition="List of Legal expressions or representations of this Contract." )
9451    protected List<LegalLanguageComponent> legal;
9452
9453    /**
9454     * List of Computable Policy Rule Language Representations of this Contract.
9455     */
9456    @Child(name = "rule", type = {}, order=31, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9457    @Description(shortDefinition="Computable Contract Language", formalDefinition="List of Computable Policy Rule Language Representations of this Contract." )
9458    protected List<ComputableLanguageComponent> rule;
9459
9460    /**
9461     * Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.
9462     */
9463    @Child(name = "legallyBinding", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class, Contract.class}, order=32, min=0, max=1, modifier=false, summary=false)
9464    @Description(shortDefinition="Binding Contract", formalDefinition="Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the \"source of truth\" and which would be the basis for legal action related to enforcement of this Contract." )
9465    protected DataType legallyBinding;
9466
9467    private static final long serialVersionUID = -792431459L;
9468
9469  /**
9470   * Constructor
9471   */
9472    public Contract() {
9473      super();
9474    }
9475
9476    /**
9477     * @return {@link #identifier} (Unique identifier for this Contract or a derivative that references a Source Contract.)
9478     */
9479    public List<Identifier> getIdentifier() { 
9480      if (this.identifier == null)
9481        this.identifier = new ArrayList<Identifier>();
9482      return this.identifier;
9483    }
9484
9485    /**
9486     * @return Returns a reference to <code>this</code> for easy method chaining
9487     */
9488    public Contract setIdentifier(List<Identifier> theIdentifier) { 
9489      this.identifier = theIdentifier;
9490      return this;
9491    }
9492
9493    public boolean hasIdentifier() { 
9494      if (this.identifier == null)
9495        return false;
9496      for (Identifier item : this.identifier)
9497        if (!item.isEmpty())
9498          return true;
9499      return false;
9500    }
9501
9502    public Identifier addIdentifier() { //3
9503      Identifier t = new Identifier();
9504      if (this.identifier == null)
9505        this.identifier = new ArrayList<Identifier>();
9506      this.identifier.add(t);
9507      return t;
9508    }
9509
9510    public Contract addIdentifier(Identifier t) { //3
9511      if (t == null)
9512        return this;
9513      if (this.identifier == null)
9514        this.identifier = new ArrayList<Identifier>();
9515      this.identifier.add(t);
9516      return this;
9517    }
9518
9519    /**
9520     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
9521     */
9522    public Identifier getIdentifierFirstRep() { 
9523      if (getIdentifier().isEmpty()) {
9524        addIdentifier();
9525      }
9526      return getIdentifier().get(0);
9527    }
9528
9529    /**
9530     * @return {@link #url} (Canonical identifier for this contract, represented as a URI (globally unique).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
9531     */
9532    public UriType getUrlElement() { 
9533      if (this.url == null)
9534        if (Configuration.errorOnAutoCreate())
9535          throw new Error("Attempt to auto-create Contract.url");
9536        else if (Configuration.doAutoCreate())
9537          this.url = new UriType(); // bb
9538      return this.url;
9539    }
9540
9541    public boolean hasUrlElement() { 
9542      return this.url != null && !this.url.isEmpty();
9543    }
9544
9545    public boolean hasUrl() { 
9546      return this.url != null && !this.url.isEmpty();
9547    }
9548
9549    /**
9550     * @param value {@link #url} (Canonical identifier for this contract, represented as a URI (globally unique).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
9551     */
9552    public Contract setUrlElement(UriType value) { 
9553      this.url = value;
9554      return this;
9555    }
9556
9557    /**
9558     * @return Canonical identifier for this contract, represented as a URI (globally unique).
9559     */
9560    public String getUrl() { 
9561      return this.url == null ? null : this.url.getValue();
9562    }
9563
9564    /**
9565     * @param value Canonical identifier for this contract, represented as a URI (globally unique).
9566     */
9567    public Contract setUrl(String value) { 
9568      if (Utilities.noString(value))
9569        this.url = null;
9570      else {
9571        if (this.url == null)
9572          this.url = new UriType();
9573        this.url.setValue(value);
9574      }
9575      return this;
9576    }
9577
9578    /**
9579     * @return {@link #version} (An edition identifier used for business purposes to label business significant variants.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
9580     */
9581    public StringType getVersionElement() { 
9582      if (this.version == null)
9583        if (Configuration.errorOnAutoCreate())
9584          throw new Error("Attempt to auto-create Contract.version");
9585        else if (Configuration.doAutoCreate())
9586          this.version = new StringType(); // bb
9587      return this.version;
9588    }
9589
9590    public boolean hasVersionElement() { 
9591      return this.version != null && !this.version.isEmpty();
9592    }
9593
9594    public boolean hasVersion() { 
9595      return this.version != null && !this.version.isEmpty();
9596    }
9597
9598    /**
9599     * @param value {@link #version} (An edition identifier used for business purposes to label business significant variants.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
9600     */
9601    public Contract setVersionElement(StringType value) { 
9602      this.version = value;
9603      return this;
9604    }
9605
9606    /**
9607     * @return An edition identifier used for business purposes to label business significant variants.
9608     */
9609    public String getVersion() { 
9610      return this.version == null ? null : this.version.getValue();
9611    }
9612
9613    /**
9614     * @param value An edition identifier used for business purposes to label business significant variants.
9615     */
9616    public Contract setVersion(String value) { 
9617      if (Utilities.noString(value))
9618        this.version = null;
9619      else {
9620        if (this.version == null)
9621          this.version = new StringType();
9622        this.version.setValue(value);
9623      }
9624      return this;
9625    }
9626
9627    /**
9628     * @return {@link #status} (The status of the resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
9629     */
9630    public Enumeration<ContractResourceStatusCodes> getStatusElement() { 
9631      if (this.status == null)
9632        if (Configuration.errorOnAutoCreate())
9633          throw new Error("Attempt to auto-create Contract.status");
9634        else if (Configuration.doAutoCreate())
9635          this.status = new Enumeration<ContractResourceStatusCodes>(new ContractResourceStatusCodesEnumFactory()); // bb
9636      return this.status;
9637    }
9638
9639    public boolean hasStatusElement() { 
9640      return this.status != null && !this.status.isEmpty();
9641    }
9642
9643    public boolean hasStatus() { 
9644      return this.status != null && !this.status.isEmpty();
9645    }
9646
9647    /**
9648     * @param value {@link #status} (The status of the resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
9649     */
9650    public Contract setStatusElement(Enumeration<ContractResourceStatusCodes> value) { 
9651      this.status = value;
9652      return this;
9653    }
9654
9655    /**
9656     * @return The status of the resource instance.
9657     */
9658    public ContractResourceStatusCodes getStatus() { 
9659      return this.status == null ? null : this.status.getValue();
9660    }
9661
9662    /**
9663     * @param value The status of the resource instance.
9664     */
9665    public Contract setStatus(ContractResourceStatusCodes value) { 
9666      if (value == null)
9667        this.status = null;
9668      else {
9669        if (this.status == null)
9670          this.status = new Enumeration<ContractResourceStatusCodes>(new ContractResourceStatusCodesEnumFactory());
9671        this.status.setValue(value);
9672      }
9673      return this;
9674    }
9675
9676    /**
9677     * @return {@link #legalState} (Legal states of the formation of a legal instrument, which is a formally executed written document that can be formally attributed to its author, records and formally expresses a legally enforceable act, process, or contractual duty, obligation, or right, and therefore evidences that act, process, or agreement.)
9678     */
9679    public CodeableConcept getLegalState() { 
9680      if (this.legalState == null)
9681        if (Configuration.errorOnAutoCreate())
9682          throw new Error("Attempt to auto-create Contract.legalState");
9683        else if (Configuration.doAutoCreate())
9684          this.legalState = new CodeableConcept(); // cc
9685      return this.legalState;
9686    }
9687
9688    public boolean hasLegalState() { 
9689      return this.legalState != null && !this.legalState.isEmpty();
9690    }
9691
9692    /**
9693     * @param value {@link #legalState} (Legal states of the formation of a legal instrument, which is a formally executed written document that can be formally attributed to its author, records and formally expresses a legally enforceable act, process, or contractual duty, obligation, or right, and therefore evidences that act, process, or agreement.)
9694     */
9695    public Contract setLegalState(CodeableConcept value) { 
9696      this.legalState = value;
9697      return this;
9698    }
9699
9700    /**
9701     * @return {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract.)
9702     */
9703    public Reference getInstantiatesCanonical() { 
9704      if (this.instantiatesCanonical == null)
9705        if (Configuration.errorOnAutoCreate())
9706          throw new Error("Attempt to auto-create Contract.instantiatesCanonical");
9707        else if (Configuration.doAutoCreate())
9708          this.instantiatesCanonical = new Reference(); // cc
9709      return this.instantiatesCanonical;
9710    }
9711
9712    public boolean hasInstantiatesCanonical() { 
9713      return this.instantiatesCanonical != null && !this.instantiatesCanonical.isEmpty();
9714    }
9715
9716    /**
9717     * @param value {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract.)
9718     */
9719    public Contract setInstantiatesCanonical(Reference value) { 
9720      this.instantiatesCanonical = value;
9721      return this;
9722    }
9723
9724    /**
9725     * @return {@link #instantiatesUri} (The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesUri" gives direct access to the value
9726     */
9727    public UriType getInstantiatesUriElement() { 
9728      if (this.instantiatesUri == null)
9729        if (Configuration.errorOnAutoCreate())
9730          throw new Error("Attempt to auto-create Contract.instantiatesUri");
9731        else if (Configuration.doAutoCreate())
9732          this.instantiatesUri = new UriType(); // bb
9733      return this.instantiatesUri;
9734    }
9735
9736    public boolean hasInstantiatesUriElement() { 
9737      return this.instantiatesUri != null && !this.instantiatesUri.isEmpty();
9738    }
9739
9740    public boolean hasInstantiatesUri() { 
9741      return this.instantiatesUri != null && !this.instantiatesUri.isEmpty();
9742    }
9743
9744    /**
9745     * @param value {@link #instantiatesUri} (The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesUri" gives direct access to the value
9746     */
9747    public Contract setInstantiatesUriElement(UriType value) { 
9748      this.instantiatesUri = value;
9749      return this;
9750    }
9751
9752    /**
9753     * @return The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract.
9754     */
9755    public String getInstantiatesUri() { 
9756      return this.instantiatesUri == null ? null : this.instantiatesUri.getValue();
9757    }
9758
9759    /**
9760     * @param value The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract.
9761     */
9762    public Contract setInstantiatesUri(String value) { 
9763      if (Utilities.noString(value))
9764        this.instantiatesUri = null;
9765      else {
9766        if (this.instantiatesUri == null)
9767          this.instantiatesUri = new UriType();
9768        this.instantiatesUri.setValue(value);
9769      }
9770      return this;
9771    }
9772
9773    /**
9774     * @return {@link #contentDerivative} (The minimal content derived from the basal information source at a specific stage in its lifecycle.)
9775     */
9776    public CodeableConcept getContentDerivative() { 
9777      if (this.contentDerivative == null)
9778        if (Configuration.errorOnAutoCreate())
9779          throw new Error("Attempt to auto-create Contract.contentDerivative");
9780        else if (Configuration.doAutoCreate())
9781          this.contentDerivative = new CodeableConcept(); // cc
9782      return this.contentDerivative;
9783    }
9784
9785    public boolean hasContentDerivative() { 
9786      return this.contentDerivative != null && !this.contentDerivative.isEmpty();
9787    }
9788
9789    /**
9790     * @param value {@link #contentDerivative} (The minimal content derived from the basal information source at a specific stage in its lifecycle.)
9791     */
9792    public Contract setContentDerivative(CodeableConcept value) { 
9793      this.contentDerivative = value;
9794      return this;
9795    }
9796
9797    /**
9798     * @return {@link #issued} (When this  Contract was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
9799     */
9800    public DateTimeType getIssuedElement() { 
9801      if (this.issued == null)
9802        if (Configuration.errorOnAutoCreate())
9803          throw new Error("Attempt to auto-create Contract.issued");
9804        else if (Configuration.doAutoCreate())
9805          this.issued = new DateTimeType(); // bb
9806      return this.issued;
9807    }
9808
9809    public boolean hasIssuedElement() { 
9810      return this.issued != null && !this.issued.isEmpty();
9811    }
9812
9813    public boolean hasIssued() { 
9814      return this.issued != null && !this.issued.isEmpty();
9815    }
9816
9817    /**
9818     * @param value {@link #issued} (When this  Contract was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
9819     */
9820    public Contract setIssuedElement(DateTimeType value) { 
9821      this.issued = value;
9822      return this;
9823    }
9824
9825    /**
9826     * @return When this  Contract was issued.
9827     */
9828    public Date getIssued() { 
9829      return this.issued == null ? null : this.issued.getValue();
9830    }
9831
9832    /**
9833     * @param value When this  Contract was issued.
9834     */
9835    public Contract setIssued(Date value) { 
9836      if (value == null)
9837        this.issued = null;
9838      else {
9839        if (this.issued == null)
9840          this.issued = new DateTimeType();
9841        this.issued.setValue(value);
9842      }
9843      return this;
9844    }
9845
9846    /**
9847     * @return {@link #applies} (Relevant time or time-period when this Contract is applicable.)
9848     */
9849    public Period getApplies() { 
9850      if (this.applies == null)
9851        if (Configuration.errorOnAutoCreate())
9852          throw new Error("Attempt to auto-create Contract.applies");
9853        else if (Configuration.doAutoCreate())
9854          this.applies = new Period(); // cc
9855      return this.applies;
9856    }
9857
9858    public boolean hasApplies() { 
9859      return this.applies != null && !this.applies.isEmpty();
9860    }
9861
9862    /**
9863     * @param value {@link #applies} (Relevant time or time-period when this Contract is applicable.)
9864     */
9865    public Contract setApplies(Period value) { 
9866      this.applies = value;
9867      return this;
9868    }
9869
9870    /**
9871     * @return {@link #expirationType} (Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract.)
9872     */
9873    public CodeableConcept getExpirationType() { 
9874      if (this.expirationType == null)
9875        if (Configuration.errorOnAutoCreate())
9876          throw new Error("Attempt to auto-create Contract.expirationType");
9877        else if (Configuration.doAutoCreate())
9878          this.expirationType = new CodeableConcept(); // cc
9879      return this.expirationType;
9880    }
9881
9882    public boolean hasExpirationType() { 
9883      return this.expirationType != null && !this.expirationType.isEmpty();
9884    }
9885
9886    /**
9887     * @param value {@link #expirationType} (Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract.)
9888     */
9889    public Contract setExpirationType(CodeableConcept value) { 
9890      this.expirationType = value;
9891      return this;
9892    }
9893
9894    /**
9895     * @return {@link #subject} (The target entity impacted by or of interest to parties to the agreement.)
9896     */
9897    public List<Reference> getSubject() { 
9898      if (this.subject == null)
9899        this.subject = new ArrayList<Reference>();
9900      return this.subject;
9901    }
9902
9903    /**
9904     * @return Returns a reference to <code>this</code> for easy method chaining
9905     */
9906    public Contract setSubject(List<Reference> theSubject) { 
9907      this.subject = theSubject;
9908      return this;
9909    }
9910
9911    public boolean hasSubject() { 
9912      if (this.subject == null)
9913        return false;
9914      for (Reference item : this.subject)
9915        if (!item.isEmpty())
9916          return true;
9917      return false;
9918    }
9919
9920    public Reference addSubject() { //3
9921      Reference t = new Reference();
9922      if (this.subject == null)
9923        this.subject = new ArrayList<Reference>();
9924      this.subject.add(t);
9925      return t;
9926    }
9927
9928    public Contract addSubject(Reference t) { //3
9929      if (t == null)
9930        return this;
9931      if (this.subject == null)
9932        this.subject = new ArrayList<Reference>();
9933      this.subject.add(t);
9934      return this;
9935    }
9936
9937    /**
9938     * @return The first repetition of repeating field {@link #subject}, creating it if it does not already exist {3}
9939     */
9940    public Reference getSubjectFirstRep() { 
9941      if (getSubject().isEmpty()) {
9942        addSubject();
9943      }
9944      return getSubject().get(0);
9945    }
9946
9947    /**
9948     * @return {@link #authority} (A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.)
9949     */
9950    public List<Reference> getAuthority() { 
9951      if (this.authority == null)
9952        this.authority = new ArrayList<Reference>();
9953      return this.authority;
9954    }
9955
9956    /**
9957     * @return Returns a reference to <code>this</code> for easy method chaining
9958     */
9959    public Contract setAuthority(List<Reference> theAuthority) { 
9960      this.authority = theAuthority;
9961      return this;
9962    }
9963
9964    public boolean hasAuthority() { 
9965      if (this.authority == null)
9966        return false;
9967      for (Reference item : this.authority)
9968        if (!item.isEmpty())
9969          return true;
9970      return false;
9971    }
9972
9973    public Reference addAuthority() { //3
9974      Reference t = new Reference();
9975      if (this.authority == null)
9976        this.authority = new ArrayList<Reference>();
9977      this.authority.add(t);
9978      return t;
9979    }
9980
9981    public Contract addAuthority(Reference t) { //3
9982      if (t == null)
9983        return this;
9984      if (this.authority == null)
9985        this.authority = new ArrayList<Reference>();
9986      this.authority.add(t);
9987      return this;
9988    }
9989
9990    /**
9991     * @return The first repetition of repeating field {@link #authority}, creating it if it does not already exist {3}
9992     */
9993    public Reference getAuthorityFirstRep() { 
9994      if (getAuthority().isEmpty()) {
9995        addAuthority();
9996      }
9997      return getAuthority().get(0);
9998    }
9999
10000    /**
10001     * @return {@link #domain} (Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.)
10002     */
10003    public List<Reference> getDomain() { 
10004      if (this.domain == null)
10005        this.domain = new ArrayList<Reference>();
10006      return this.domain;
10007    }
10008
10009    /**
10010     * @return Returns a reference to <code>this</code> for easy method chaining
10011     */
10012    public Contract setDomain(List<Reference> theDomain) { 
10013      this.domain = theDomain;
10014      return this;
10015    }
10016
10017    public boolean hasDomain() { 
10018      if (this.domain == null)
10019        return false;
10020      for (Reference item : this.domain)
10021        if (!item.isEmpty())
10022          return true;
10023      return false;
10024    }
10025
10026    public Reference addDomain() { //3
10027      Reference t = new Reference();
10028      if (this.domain == null)
10029        this.domain = new ArrayList<Reference>();
10030      this.domain.add(t);
10031      return t;
10032    }
10033
10034    public Contract addDomain(Reference t) { //3
10035      if (t == null)
10036        return this;
10037      if (this.domain == null)
10038        this.domain = new ArrayList<Reference>();
10039      this.domain.add(t);
10040      return this;
10041    }
10042
10043    /**
10044     * @return The first repetition of repeating field {@link #domain}, creating it if it does not already exist {3}
10045     */
10046    public Reference getDomainFirstRep() { 
10047      if (getDomain().isEmpty()) {
10048        addDomain();
10049      }
10050      return getDomain().get(0);
10051    }
10052
10053    /**
10054     * @return {@link #site} (Sites in which the contract is complied with,  exercised, or in force.)
10055     */
10056    public List<Reference> getSite() { 
10057      if (this.site == null)
10058        this.site = new ArrayList<Reference>();
10059      return this.site;
10060    }
10061
10062    /**
10063     * @return Returns a reference to <code>this</code> for easy method chaining
10064     */
10065    public Contract setSite(List<Reference> theSite) { 
10066      this.site = theSite;
10067      return this;
10068    }
10069
10070    public boolean hasSite() { 
10071      if (this.site == null)
10072        return false;
10073      for (Reference item : this.site)
10074        if (!item.isEmpty())
10075          return true;
10076      return false;
10077    }
10078
10079    public Reference addSite() { //3
10080      Reference t = new Reference();
10081      if (this.site == null)
10082        this.site = new ArrayList<Reference>();
10083      this.site.add(t);
10084      return t;
10085    }
10086
10087    public Contract addSite(Reference t) { //3
10088      if (t == null)
10089        return this;
10090      if (this.site == null)
10091        this.site = new ArrayList<Reference>();
10092      this.site.add(t);
10093      return this;
10094    }
10095
10096    /**
10097     * @return The first repetition of repeating field {@link #site}, creating it if it does not already exist {3}
10098     */
10099    public Reference getSiteFirstRep() { 
10100      if (getSite().isEmpty()) {
10101        addSite();
10102      }
10103      return getSite().get(0);
10104    }
10105
10106    /**
10107     * @return {@link #name} (A natural language name identifying this Contract definition, derivative, or instance in any legal state. Provides additional information about its content. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
10108     */
10109    public StringType getNameElement() { 
10110      if (this.name == null)
10111        if (Configuration.errorOnAutoCreate())
10112          throw new Error("Attempt to auto-create Contract.name");
10113        else if (Configuration.doAutoCreate())
10114          this.name = new StringType(); // bb
10115      return this.name;
10116    }
10117
10118    public boolean hasNameElement() { 
10119      return this.name != null && !this.name.isEmpty();
10120    }
10121
10122    public boolean hasName() { 
10123      return this.name != null && !this.name.isEmpty();
10124    }
10125
10126    /**
10127     * @param value {@link #name} (A natural language name identifying this Contract definition, derivative, or instance in any legal state. Provides additional information about its content. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
10128     */
10129    public Contract setNameElement(StringType value) { 
10130      this.name = value;
10131      return this;
10132    }
10133
10134    /**
10135     * @return A natural language name identifying this Contract definition, derivative, or instance in any legal state. Provides additional information about its content. This name should be usable as an identifier for the module by machine processing applications such as code generation.
10136     */
10137    public String getName() { 
10138      return this.name == null ? null : this.name.getValue();
10139    }
10140
10141    /**
10142     * @param value A natural language name identifying this Contract definition, derivative, or instance in any legal state. Provides additional information about its content. This name should be usable as an identifier for the module by machine processing applications such as code generation.
10143     */
10144    public Contract setName(String value) { 
10145      if (Utilities.noString(value))
10146        this.name = null;
10147      else {
10148        if (this.name == null)
10149          this.name = new StringType();
10150        this.name.setValue(value);
10151      }
10152      return this;
10153    }
10154
10155    /**
10156     * @return {@link #title} (A short, descriptive, user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
10157     */
10158    public StringType getTitleElement() { 
10159      if (this.title == null)
10160        if (Configuration.errorOnAutoCreate())
10161          throw new Error("Attempt to auto-create Contract.title");
10162        else if (Configuration.doAutoCreate())
10163          this.title = new StringType(); // bb
10164      return this.title;
10165    }
10166
10167    public boolean hasTitleElement() { 
10168      return this.title != null && !this.title.isEmpty();
10169    }
10170
10171    public boolean hasTitle() { 
10172      return this.title != null && !this.title.isEmpty();
10173    }
10174
10175    /**
10176     * @param value {@link #title} (A short, descriptive, user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
10177     */
10178    public Contract setTitleElement(StringType value) { 
10179      this.title = value;
10180      return this;
10181    }
10182
10183    /**
10184     * @return A short, descriptive, user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.
10185     */
10186    public String getTitle() { 
10187      return this.title == null ? null : this.title.getValue();
10188    }
10189
10190    /**
10191     * @param value A short, descriptive, user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.
10192     */
10193    public Contract setTitle(String value) { 
10194      if (Utilities.noString(value))
10195        this.title = null;
10196      else {
10197        if (this.title == null)
10198          this.title = new StringType();
10199        this.title.setValue(value);
10200      }
10201      return this;
10202    }
10203
10204    /**
10205     * @return {@link #subtitle} (An explanatory or alternate user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.). This is the underlying object with id, value and extensions. The accessor "getSubtitle" gives direct access to the value
10206     */
10207    public StringType getSubtitleElement() { 
10208      if (this.subtitle == null)
10209        if (Configuration.errorOnAutoCreate())
10210          throw new Error("Attempt to auto-create Contract.subtitle");
10211        else if (Configuration.doAutoCreate())
10212          this.subtitle = new StringType(); // bb
10213      return this.subtitle;
10214    }
10215
10216    public boolean hasSubtitleElement() { 
10217      return this.subtitle != null && !this.subtitle.isEmpty();
10218    }
10219
10220    public boolean hasSubtitle() { 
10221      return this.subtitle != null && !this.subtitle.isEmpty();
10222    }
10223
10224    /**
10225     * @param value {@link #subtitle} (An explanatory or alternate user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.). This is the underlying object with id, value and extensions. The accessor "getSubtitle" gives direct access to the value
10226     */
10227    public Contract setSubtitleElement(StringType value) { 
10228      this.subtitle = value;
10229      return this;
10230    }
10231
10232    /**
10233     * @return An explanatory or alternate user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.
10234     */
10235    public String getSubtitle() { 
10236      return this.subtitle == null ? null : this.subtitle.getValue();
10237    }
10238
10239    /**
10240     * @param value An explanatory or alternate user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.
10241     */
10242    public Contract setSubtitle(String value) { 
10243      if (Utilities.noString(value))
10244        this.subtitle = null;
10245      else {
10246        if (this.subtitle == null)
10247          this.subtitle = new StringType();
10248        this.subtitle.setValue(value);
10249      }
10250      return this;
10251    }
10252
10253    /**
10254     * @return {@link #alias} (Alternative representation of the title for this Contract definition, derivative, or instance in any legal state., e.g., a domain specific contract number related to legislation.)
10255     */
10256    public List<StringType> getAlias() { 
10257      if (this.alias == null)
10258        this.alias = new ArrayList<StringType>();
10259      return this.alias;
10260    }
10261
10262    /**
10263     * @return Returns a reference to <code>this</code> for easy method chaining
10264     */
10265    public Contract setAlias(List<StringType> theAlias) { 
10266      this.alias = theAlias;
10267      return this;
10268    }
10269
10270    public boolean hasAlias() { 
10271      if (this.alias == null)
10272        return false;
10273      for (StringType item : this.alias)
10274        if (!item.isEmpty())
10275          return true;
10276      return false;
10277    }
10278
10279    /**
10280     * @return {@link #alias} (Alternative representation of the title for this Contract definition, derivative, or instance in any legal state., e.g., a domain specific contract number related to legislation.)
10281     */
10282    public StringType addAliasElement() {//2 
10283      StringType t = new StringType();
10284      if (this.alias == null)
10285        this.alias = new ArrayList<StringType>();
10286      this.alias.add(t);
10287      return t;
10288    }
10289
10290    /**
10291     * @param value {@link #alias} (Alternative representation of the title for this Contract definition, derivative, or instance in any legal state., e.g., a domain specific contract number related to legislation.)
10292     */
10293    public Contract addAlias(String value) { //1
10294      StringType t = new StringType();
10295      t.setValue(value);
10296      if (this.alias == null)
10297        this.alias = new ArrayList<StringType>();
10298      this.alias.add(t);
10299      return this;
10300    }
10301
10302    /**
10303     * @param value {@link #alias} (Alternative representation of the title for this Contract definition, derivative, or instance in any legal state., e.g., a domain specific contract number related to legislation.)
10304     */
10305    public boolean hasAlias(String value) { 
10306      if (this.alias == null)
10307        return false;
10308      for (StringType v : this.alias)
10309        if (v.getValue().equals(value)) // string
10310          return true;
10311      return false;
10312    }
10313
10314    /**
10315     * @return {@link #author} (The individual or organization that authored the Contract definition, derivative, or instance in any legal state.)
10316     */
10317    public Reference getAuthor() { 
10318      if (this.author == null)
10319        if (Configuration.errorOnAutoCreate())
10320          throw new Error("Attempt to auto-create Contract.author");
10321        else if (Configuration.doAutoCreate())
10322          this.author = new Reference(); // cc
10323      return this.author;
10324    }
10325
10326    public boolean hasAuthor() { 
10327      return this.author != null && !this.author.isEmpty();
10328    }
10329
10330    /**
10331     * @param value {@link #author} (The individual or organization that authored the Contract definition, derivative, or instance in any legal state.)
10332     */
10333    public Contract setAuthor(Reference value) { 
10334      this.author = value;
10335      return this;
10336    }
10337
10338    /**
10339     * @return {@link #scope} (A selector of legal concerns for this Contract definition, derivative, or instance in any legal state.)
10340     */
10341    public CodeableConcept getScope() { 
10342      if (this.scope == null)
10343        if (Configuration.errorOnAutoCreate())
10344          throw new Error("Attempt to auto-create Contract.scope");
10345        else if (Configuration.doAutoCreate())
10346          this.scope = new CodeableConcept(); // cc
10347      return this.scope;
10348    }
10349
10350    public boolean hasScope() { 
10351      return this.scope != null && !this.scope.isEmpty();
10352    }
10353
10354    /**
10355     * @param value {@link #scope} (A selector of legal concerns for this Contract definition, derivative, or instance in any legal state.)
10356     */
10357    public Contract setScope(CodeableConcept value) { 
10358      this.scope = value;
10359      return this;
10360    }
10361
10362    /**
10363     * @return {@link #topic} (Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.)
10364     */
10365    public DataType getTopic() { 
10366      return this.topic;
10367    }
10368
10369    /**
10370     * @return {@link #topic} (Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.)
10371     */
10372    public CodeableConcept getTopicCodeableConcept() throws FHIRException { 
10373      if (this.topic == null)
10374        this.topic = new CodeableConcept();
10375      if (!(this.topic instanceof CodeableConcept))
10376        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.topic.getClass().getName()+" was encountered");
10377      return (CodeableConcept) this.topic;
10378    }
10379
10380    public boolean hasTopicCodeableConcept() { 
10381      return this != null && this.topic instanceof CodeableConcept;
10382    }
10383
10384    /**
10385     * @return {@link #topic} (Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.)
10386     */
10387    public Reference getTopicReference() throws FHIRException { 
10388      if (this.topic == null)
10389        this.topic = new Reference();
10390      if (!(this.topic instanceof Reference))
10391        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.topic.getClass().getName()+" was encountered");
10392      return (Reference) this.topic;
10393    }
10394
10395    public boolean hasTopicReference() { 
10396      return this != null && this.topic instanceof Reference;
10397    }
10398
10399    public boolean hasTopic() { 
10400      return this.topic != null && !this.topic.isEmpty();
10401    }
10402
10403    /**
10404     * @param value {@link #topic} (Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.)
10405     */
10406    public Contract setTopic(DataType value) { 
10407      if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
10408        throw new Error("Not the right type for Contract.topic[x]: "+value.fhirType());
10409      this.topic = value;
10410      return this;
10411    }
10412
10413    /**
10414     * @return {@link #type} (A high-level category for the legal instrument, whether constructed as a Contract definition, derivative, or instance in any legal state.  Provides additional information about its content within the context of the Contract's scope to distinguish the kinds of systems that would be interested in the contract.)
10415     */
10416    public CodeableConcept getType() { 
10417      if (this.type == null)
10418        if (Configuration.errorOnAutoCreate())
10419          throw new Error("Attempt to auto-create Contract.type");
10420        else if (Configuration.doAutoCreate())
10421          this.type = new CodeableConcept(); // cc
10422      return this.type;
10423    }
10424
10425    public boolean hasType() { 
10426      return this.type != null && !this.type.isEmpty();
10427    }
10428
10429    /**
10430     * @param value {@link #type} (A high-level category for the legal instrument, whether constructed as a Contract definition, derivative, or instance in any legal state.  Provides additional information about its content within the context of the Contract's scope to distinguish the kinds of systems that would be interested in the contract.)
10431     */
10432    public Contract setType(CodeableConcept value) { 
10433      this.type = value;
10434      return this;
10435    }
10436
10437    /**
10438     * @return {@link #subType} (Sub-category for the Contract that distinguishes the kinds of systems that would be interested in the Contract within the context of the Contract's scope.)
10439     */
10440    public List<CodeableConcept> getSubType() { 
10441      if (this.subType == null)
10442        this.subType = new ArrayList<CodeableConcept>();
10443      return this.subType;
10444    }
10445
10446    /**
10447     * @return Returns a reference to <code>this</code> for easy method chaining
10448     */
10449    public Contract setSubType(List<CodeableConcept> theSubType) { 
10450      this.subType = theSubType;
10451      return this;
10452    }
10453
10454    public boolean hasSubType() { 
10455      if (this.subType == null)
10456        return false;
10457      for (CodeableConcept item : this.subType)
10458        if (!item.isEmpty())
10459          return true;
10460      return false;
10461    }
10462
10463    public CodeableConcept addSubType() { //3
10464      CodeableConcept t = new CodeableConcept();
10465      if (this.subType == null)
10466        this.subType = new ArrayList<CodeableConcept>();
10467      this.subType.add(t);
10468      return t;
10469    }
10470
10471    public Contract addSubType(CodeableConcept t) { //3
10472      if (t == null)
10473        return this;
10474      if (this.subType == null)
10475        this.subType = new ArrayList<CodeableConcept>();
10476      this.subType.add(t);
10477      return this;
10478    }
10479
10480    /**
10481     * @return The first repetition of repeating field {@link #subType}, creating it if it does not already exist {3}
10482     */
10483    public CodeableConcept getSubTypeFirstRep() { 
10484      if (getSubType().isEmpty()) {
10485        addSubType();
10486      }
10487      return getSubType().get(0);
10488    }
10489
10490    /**
10491     * @return {@link #contentDefinition} (Precusory content developed with a focus and intent of supporting the formation a Contract instance, which may be associated with and transformable into a Contract.)
10492     */
10493    public ContentDefinitionComponent getContentDefinition() { 
10494      if (this.contentDefinition == null)
10495        if (Configuration.errorOnAutoCreate())
10496          throw new Error("Attempt to auto-create Contract.contentDefinition");
10497        else if (Configuration.doAutoCreate())
10498          this.contentDefinition = new ContentDefinitionComponent(); // cc
10499      return this.contentDefinition;
10500    }
10501
10502    public boolean hasContentDefinition() { 
10503      return this.contentDefinition != null && !this.contentDefinition.isEmpty();
10504    }
10505
10506    /**
10507     * @param value {@link #contentDefinition} (Precusory content developed with a focus and intent of supporting the formation a Contract instance, which may be associated with and transformable into a Contract.)
10508     */
10509    public Contract setContentDefinition(ContentDefinitionComponent value) { 
10510      this.contentDefinition = value;
10511      return this;
10512    }
10513
10514    /**
10515     * @return {@link #term} (One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.)
10516     */
10517    public List<TermComponent> getTerm() { 
10518      if (this.term == null)
10519        this.term = new ArrayList<TermComponent>();
10520      return this.term;
10521    }
10522
10523    /**
10524     * @return Returns a reference to <code>this</code> for easy method chaining
10525     */
10526    public Contract setTerm(List<TermComponent> theTerm) { 
10527      this.term = theTerm;
10528      return this;
10529    }
10530
10531    public boolean hasTerm() { 
10532      if (this.term == null)
10533        return false;
10534      for (TermComponent item : this.term)
10535        if (!item.isEmpty())
10536          return true;
10537      return false;
10538    }
10539
10540    public TermComponent addTerm() { //3
10541      TermComponent t = new TermComponent();
10542      if (this.term == null)
10543        this.term = new ArrayList<TermComponent>();
10544      this.term.add(t);
10545      return t;
10546    }
10547
10548    public Contract addTerm(TermComponent t) { //3
10549      if (t == null)
10550        return this;
10551      if (this.term == null)
10552        this.term = new ArrayList<TermComponent>();
10553      this.term.add(t);
10554      return this;
10555    }
10556
10557    /**
10558     * @return The first repetition of repeating field {@link #term}, creating it if it does not already exist {3}
10559     */
10560    public TermComponent getTermFirstRep() { 
10561      if (getTerm().isEmpty()) {
10562        addTerm();
10563      }
10564      return getTerm().get(0);
10565    }
10566
10567    /**
10568     * @return {@link #supportingInfo} (Information that may be needed by/relevant to the performer in their execution of this term action.)
10569     */
10570    public List<Reference> getSupportingInfo() { 
10571      if (this.supportingInfo == null)
10572        this.supportingInfo = new ArrayList<Reference>();
10573      return this.supportingInfo;
10574    }
10575
10576    /**
10577     * @return Returns a reference to <code>this</code> for easy method chaining
10578     */
10579    public Contract setSupportingInfo(List<Reference> theSupportingInfo) { 
10580      this.supportingInfo = theSupportingInfo;
10581      return this;
10582    }
10583
10584    public boolean hasSupportingInfo() { 
10585      if (this.supportingInfo == null)
10586        return false;
10587      for (Reference item : this.supportingInfo)
10588        if (!item.isEmpty())
10589          return true;
10590      return false;
10591    }
10592
10593    public Reference addSupportingInfo() { //3
10594      Reference t = new Reference();
10595      if (this.supportingInfo == null)
10596        this.supportingInfo = new ArrayList<Reference>();
10597      this.supportingInfo.add(t);
10598      return t;
10599    }
10600
10601    public Contract addSupportingInfo(Reference t) { //3
10602      if (t == null)
10603        return this;
10604      if (this.supportingInfo == null)
10605        this.supportingInfo = new ArrayList<Reference>();
10606      this.supportingInfo.add(t);
10607      return this;
10608    }
10609
10610    /**
10611     * @return The first repetition of repeating field {@link #supportingInfo}, creating it if it does not already exist {3}
10612     */
10613    public Reference getSupportingInfoFirstRep() { 
10614      if (getSupportingInfo().isEmpty()) {
10615        addSupportingInfo();
10616      }
10617      return getSupportingInfo().get(0);
10618    }
10619
10620    /**
10621     * @return {@link #relevantHistory} (Links to Provenance records for past versions of this Contract definition, derivative, or instance, which identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the Contract.  The Provence.entity indicates the target that was changed in the update. http://build.fhir.org/provenance-definitions.html#Provenance.entity.)
10622     */
10623    public List<Reference> getRelevantHistory() { 
10624      if (this.relevantHistory == null)
10625        this.relevantHistory = new ArrayList<Reference>();
10626      return this.relevantHistory;
10627    }
10628
10629    /**
10630     * @return Returns a reference to <code>this</code> for easy method chaining
10631     */
10632    public Contract setRelevantHistory(List<Reference> theRelevantHistory) { 
10633      this.relevantHistory = theRelevantHistory;
10634      return this;
10635    }
10636
10637    public boolean hasRelevantHistory() { 
10638      if (this.relevantHistory == null)
10639        return false;
10640      for (Reference item : this.relevantHistory)
10641        if (!item.isEmpty())
10642          return true;
10643      return false;
10644    }
10645
10646    public Reference addRelevantHistory() { //3
10647      Reference t = new Reference();
10648      if (this.relevantHistory == null)
10649        this.relevantHistory = new ArrayList<Reference>();
10650      this.relevantHistory.add(t);
10651      return t;
10652    }
10653
10654    public Contract addRelevantHistory(Reference t) { //3
10655      if (t == null)
10656        return this;
10657      if (this.relevantHistory == null)
10658        this.relevantHistory = new ArrayList<Reference>();
10659      this.relevantHistory.add(t);
10660      return this;
10661    }
10662
10663    /**
10664     * @return The first repetition of repeating field {@link #relevantHistory}, creating it if it does not already exist {3}
10665     */
10666    public Reference getRelevantHistoryFirstRep() { 
10667      if (getRelevantHistory().isEmpty()) {
10668        addRelevantHistory();
10669      }
10670      return getRelevantHistory().get(0);
10671    }
10672
10673    /**
10674     * @return {@link #signer} (Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness.)
10675     */
10676    public List<SignatoryComponent> getSigner() { 
10677      if (this.signer == null)
10678        this.signer = new ArrayList<SignatoryComponent>();
10679      return this.signer;
10680    }
10681
10682    /**
10683     * @return Returns a reference to <code>this</code> for easy method chaining
10684     */
10685    public Contract setSigner(List<SignatoryComponent> theSigner) { 
10686      this.signer = theSigner;
10687      return this;
10688    }
10689
10690    public boolean hasSigner() { 
10691      if (this.signer == null)
10692        return false;
10693      for (SignatoryComponent item : this.signer)
10694        if (!item.isEmpty())
10695          return true;
10696      return false;
10697    }
10698
10699    public SignatoryComponent addSigner() { //3
10700      SignatoryComponent t = new SignatoryComponent();
10701      if (this.signer == null)
10702        this.signer = new ArrayList<SignatoryComponent>();
10703      this.signer.add(t);
10704      return t;
10705    }
10706
10707    public Contract addSigner(SignatoryComponent t) { //3
10708      if (t == null)
10709        return this;
10710      if (this.signer == null)
10711        this.signer = new ArrayList<SignatoryComponent>();
10712      this.signer.add(t);
10713      return this;
10714    }
10715
10716    /**
10717     * @return The first repetition of repeating field {@link #signer}, creating it if it does not already exist {3}
10718     */
10719    public SignatoryComponent getSignerFirstRep() { 
10720      if (getSigner().isEmpty()) {
10721        addSigner();
10722      }
10723      return getSigner().get(0);
10724    }
10725
10726    /**
10727     * @return {@link #friendly} (The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.)
10728     */
10729    public List<FriendlyLanguageComponent> getFriendly() { 
10730      if (this.friendly == null)
10731        this.friendly = new ArrayList<FriendlyLanguageComponent>();
10732      return this.friendly;
10733    }
10734
10735    /**
10736     * @return Returns a reference to <code>this</code> for easy method chaining
10737     */
10738    public Contract setFriendly(List<FriendlyLanguageComponent> theFriendly) { 
10739      this.friendly = theFriendly;
10740      return this;
10741    }
10742
10743    public boolean hasFriendly() { 
10744      if (this.friendly == null)
10745        return false;
10746      for (FriendlyLanguageComponent item : this.friendly)
10747        if (!item.isEmpty())
10748          return true;
10749      return false;
10750    }
10751
10752    public FriendlyLanguageComponent addFriendly() { //3
10753      FriendlyLanguageComponent t = new FriendlyLanguageComponent();
10754      if (this.friendly == null)
10755        this.friendly = new ArrayList<FriendlyLanguageComponent>();
10756      this.friendly.add(t);
10757      return t;
10758    }
10759
10760    public Contract addFriendly(FriendlyLanguageComponent t) { //3
10761      if (t == null)
10762        return this;
10763      if (this.friendly == null)
10764        this.friendly = new ArrayList<FriendlyLanguageComponent>();
10765      this.friendly.add(t);
10766      return this;
10767    }
10768
10769    /**
10770     * @return The first repetition of repeating field {@link #friendly}, creating it if it does not already exist {3}
10771     */
10772    public FriendlyLanguageComponent getFriendlyFirstRep() { 
10773      if (getFriendly().isEmpty()) {
10774        addFriendly();
10775      }
10776      return getFriendly().get(0);
10777    }
10778
10779    /**
10780     * @return {@link #legal} (List of Legal expressions or representations of this Contract.)
10781     */
10782    public List<LegalLanguageComponent> getLegal() { 
10783      if (this.legal == null)
10784        this.legal = new ArrayList<LegalLanguageComponent>();
10785      return this.legal;
10786    }
10787
10788    /**
10789     * @return Returns a reference to <code>this</code> for easy method chaining
10790     */
10791    public Contract setLegal(List<LegalLanguageComponent> theLegal) { 
10792      this.legal = theLegal;
10793      return this;
10794    }
10795
10796    public boolean hasLegal() { 
10797      if (this.legal == null)
10798        return false;
10799      for (LegalLanguageComponent item : this.legal)
10800        if (!item.isEmpty())
10801          return true;
10802      return false;
10803    }
10804
10805    public LegalLanguageComponent addLegal() { //3
10806      LegalLanguageComponent t = new LegalLanguageComponent();
10807      if (this.legal == null)
10808        this.legal = new ArrayList<LegalLanguageComponent>();
10809      this.legal.add(t);
10810      return t;
10811    }
10812
10813    public Contract addLegal(LegalLanguageComponent t) { //3
10814      if (t == null)
10815        return this;
10816      if (this.legal == null)
10817        this.legal = new ArrayList<LegalLanguageComponent>();
10818      this.legal.add(t);
10819      return this;
10820    }
10821
10822    /**
10823     * @return The first repetition of repeating field {@link #legal}, creating it if it does not already exist {3}
10824     */
10825    public LegalLanguageComponent getLegalFirstRep() { 
10826      if (getLegal().isEmpty()) {
10827        addLegal();
10828      }
10829      return getLegal().get(0);
10830    }
10831
10832    /**
10833     * @return {@link #rule} (List of Computable Policy Rule Language Representations of this Contract.)
10834     */
10835    public List<ComputableLanguageComponent> getRule() { 
10836      if (this.rule == null)
10837        this.rule = new ArrayList<ComputableLanguageComponent>();
10838      return this.rule;
10839    }
10840
10841    /**
10842     * @return Returns a reference to <code>this</code> for easy method chaining
10843     */
10844    public Contract setRule(List<ComputableLanguageComponent> theRule) { 
10845      this.rule = theRule;
10846      return this;
10847    }
10848
10849    public boolean hasRule() { 
10850      if (this.rule == null)
10851        return false;
10852      for (ComputableLanguageComponent item : this.rule)
10853        if (!item.isEmpty())
10854          return true;
10855      return false;
10856    }
10857
10858    public ComputableLanguageComponent addRule() { //3
10859      ComputableLanguageComponent t = new ComputableLanguageComponent();
10860      if (this.rule == null)
10861        this.rule = new ArrayList<ComputableLanguageComponent>();
10862      this.rule.add(t);
10863      return t;
10864    }
10865
10866    public Contract addRule(ComputableLanguageComponent t) { //3
10867      if (t == null)
10868        return this;
10869      if (this.rule == null)
10870        this.rule = new ArrayList<ComputableLanguageComponent>();
10871      this.rule.add(t);
10872      return this;
10873    }
10874
10875    /**
10876     * @return The first repetition of repeating field {@link #rule}, creating it if it does not already exist {3}
10877     */
10878    public ComputableLanguageComponent getRuleFirstRep() { 
10879      if (getRule().isEmpty()) {
10880        addRule();
10881      }
10882      return getRule().get(0);
10883    }
10884
10885    /**
10886     * @return {@link #legallyBinding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.)
10887     */
10888    public DataType getLegallyBinding() { 
10889      return this.legallyBinding;
10890    }
10891
10892    /**
10893     * @return {@link #legallyBinding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.)
10894     */
10895    public Attachment getLegallyBindingAttachment() throws FHIRException { 
10896      if (this.legallyBinding == null)
10897        this.legallyBinding = new Attachment();
10898      if (!(this.legallyBinding instanceof Attachment))
10899        throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.legallyBinding.getClass().getName()+" was encountered");
10900      return (Attachment) this.legallyBinding;
10901    }
10902
10903    public boolean hasLegallyBindingAttachment() { 
10904      return this != null && this.legallyBinding instanceof Attachment;
10905    }
10906
10907    /**
10908     * @return {@link #legallyBinding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.)
10909     */
10910    public Reference getLegallyBindingReference() throws FHIRException { 
10911      if (this.legallyBinding == null)
10912        this.legallyBinding = new Reference();
10913      if (!(this.legallyBinding instanceof Reference))
10914        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.legallyBinding.getClass().getName()+" was encountered");
10915      return (Reference) this.legallyBinding;
10916    }
10917
10918    public boolean hasLegallyBindingReference() { 
10919      return this != null && this.legallyBinding instanceof Reference;
10920    }
10921
10922    public boolean hasLegallyBinding() { 
10923      return this.legallyBinding != null && !this.legallyBinding.isEmpty();
10924    }
10925
10926    /**
10927     * @param value {@link #legallyBinding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.)
10928     */
10929    public Contract setLegallyBinding(DataType value) { 
10930      if (value != null && !(value instanceof Attachment || value instanceof Reference))
10931        throw new Error("Not the right type for Contract.legallyBinding[x]: "+value.fhirType());
10932      this.legallyBinding = value;
10933      return this;
10934    }
10935
10936      protected void listChildren(List<Property> children) {
10937        super.listChildren(children);
10938        children.add(new Property("identifier", "Identifier", "Unique identifier for this Contract or a derivative that references a Source Contract.", 0, java.lang.Integer.MAX_VALUE, identifier));
10939        children.add(new Property("url", "uri", "Canonical identifier for this contract, represented as a URI (globally unique).", 0, 1, url));
10940        children.add(new Property("version", "string", "An edition identifier used for business purposes to label business significant variants.", 0, 1, version));
10941        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
10942        children.add(new Property("legalState", "CodeableConcept", "Legal states of the formation of a legal instrument, which is a formally executed written document that can be formally attributed to its author, records and formally expresses a legally enforceable act, process, or contractual duty, obligation, or right, and therefore evidences that act, process, or agreement.", 0, 1, legalState));
10943        children.add(new Property("instantiatesCanonical", "Reference(Contract)", "The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract.", 0, 1, instantiatesCanonical));
10944        children.add(new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract.", 0, 1, instantiatesUri));
10945        children.add(new Property("contentDerivative", "CodeableConcept", "The minimal content derived from the basal information source at a specific stage in its lifecycle.", 0, 1, contentDerivative));
10946        children.add(new Property("issued", "dateTime", "When this  Contract was issued.", 0, 1, issued));
10947        children.add(new Property("applies", "Period", "Relevant time or time-period when this Contract is applicable.", 0, 1, applies));
10948        children.add(new Property("expirationType", "CodeableConcept", "Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract.", 0, 1, expirationType));
10949        children.add(new Property("subject", "Reference(Any)", "The target entity impacted by or of interest to parties to the agreement.", 0, java.lang.Integer.MAX_VALUE, subject));
10950        children.add(new Property("authority", "Reference(Organization)", "A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.", 0, java.lang.Integer.MAX_VALUE, authority));
10951        children.add(new Property("domain", "Reference(Location)", "Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.", 0, java.lang.Integer.MAX_VALUE, domain));
10952        children.add(new Property("site", "Reference(Location)", "Sites in which the contract is complied with,  exercised, or in force.", 0, java.lang.Integer.MAX_VALUE, site));
10953        children.add(new Property("name", "string", "A natural language name identifying this Contract definition, derivative, or instance in any legal state. Provides additional information about its content. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
10954        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.", 0, 1, title));
10955        children.add(new Property("subtitle", "string", "An explanatory or alternate user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.", 0, 1, subtitle));
10956        children.add(new Property("alias", "string", "Alternative representation of the title for this Contract definition, derivative, or instance in any legal state., e.g., a domain specific contract number related to legislation.", 0, java.lang.Integer.MAX_VALUE, alias));
10957        children.add(new Property("author", "Reference(Patient|Practitioner|PractitionerRole|Organization)", "The individual or organization that authored the Contract definition, derivative, or instance in any legal state.", 0, 1, author));
10958        children.add(new Property("scope", "CodeableConcept", "A selector of legal concerns for this Contract definition, derivative, or instance in any legal state.", 0, 1, scope));
10959        children.add(new Property("topic[x]", "CodeableConcept|Reference(Any)", "Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.", 0, 1, topic));
10960        children.add(new Property("type", "CodeableConcept", "A high-level category for the legal instrument, whether constructed as a Contract definition, derivative, or instance in any legal state.  Provides additional information about its content within the context of the Contract's scope to distinguish the kinds of systems that would be interested in the contract.", 0, 1, type));
10961        children.add(new Property("subType", "CodeableConcept", "Sub-category for the Contract that distinguishes the kinds of systems that would be interested in the Contract within the context of the Contract's scope.", 0, java.lang.Integer.MAX_VALUE, subType));
10962        children.add(new Property("contentDefinition", "", "Precusory content developed with a focus and intent of supporting the formation a Contract instance, which may be associated with and transformable into a Contract.", 0, 1, contentDefinition));
10963        children.add(new Property("term", "", "One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.", 0, java.lang.Integer.MAX_VALUE, term));
10964        children.add(new Property("supportingInfo", "Reference(Any)", "Information that may be needed by/relevant to the performer in their execution of this term action.", 0, java.lang.Integer.MAX_VALUE, supportingInfo));
10965        children.add(new Property("relevantHistory", "Reference(Provenance)", "Links to Provenance records for past versions of this Contract definition, derivative, or instance, which identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the Contract.  The Provence.entity indicates the target that was changed in the update. http://build.fhir.org/provenance-definitions.html#Provenance.entity.", 0, java.lang.Integer.MAX_VALUE, relevantHistory));
10966        children.add(new Property("signer", "", "Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness.", 0, java.lang.Integer.MAX_VALUE, signer));
10967        children.add(new Property("friendly", "", "The \"patient friendly language\" versionof the Contract in whole or in parts. \"Patient friendly language\" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.", 0, java.lang.Integer.MAX_VALUE, friendly));
10968        children.add(new Property("legal", "", "List of Legal expressions or representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, legal));
10969        children.add(new Property("rule", "", "List of Computable Policy Rule Language Representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, rule));
10970        children.add(new Property("legallyBinding[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse|Contract)", "Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the \"source of truth\" and which would be the basis for legal action related to enforcement of this Contract.", 0, 1, legallyBinding));
10971      }
10972
10973      @Override
10974      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
10975        switch (_hash) {
10976        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique identifier for this Contract or a derivative that references a Source Contract.", 0, java.lang.Integer.MAX_VALUE, identifier);
10977        case 116079: /*url*/  return new Property("url", "uri", "Canonical identifier for this contract, represented as a URI (globally unique).", 0, 1, url);
10978        case 351608024: /*version*/  return new Property("version", "string", "An edition identifier used for business purposes to label business significant variants.", 0, 1, version);
10979        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
10980        case 568606040: /*legalState*/  return new Property("legalState", "CodeableConcept", "Legal states of the formation of a legal instrument, which is a formally executed written document that can be formally attributed to its author, records and formally expresses a legally enforceable act, process, or contractual duty, obligation, or right, and therefore evidences that act, process, or agreement.", 0, 1, legalState);
10981        case 8911915: /*instantiatesCanonical*/  return new Property("instantiatesCanonical", "Reference(Contract)", "The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract.", 0, 1, instantiatesCanonical);
10982        case -1926393373: /*instantiatesUri*/  return new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract.", 0, 1, instantiatesUri);
10983        case -92412192: /*contentDerivative*/  return new Property("contentDerivative", "CodeableConcept", "The minimal content derived from the basal information source at a specific stage in its lifecycle.", 0, 1, contentDerivative);
10984        case -1179159893: /*issued*/  return new Property("issued", "dateTime", "When this  Contract was issued.", 0, 1, issued);
10985        case -793235316: /*applies*/  return new Property("applies", "Period", "Relevant time or time-period when this Contract is applicable.", 0, 1, applies);
10986        case -668311927: /*expirationType*/  return new Property("expirationType", "CodeableConcept", "Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract.", 0, 1, expirationType);
10987        case -1867885268: /*subject*/  return new Property("subject", "Reference(Any)", "The target entity impacted by or of interest to parties to the agreement.", 0, java.lang.Integer.MAX_VALUE, subject);
10988        case 1475610435: /*authority*/  return new Property("authority", "Reference(Organization)", "A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.", 0, java.lang.Integer.MAX_VALUE, authority);
10989        case -1326197564: /*domain*/  return new Property("domain", "Reference(Location)", "Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.", 0, java.lang.Integer.MAX_VALUE, domain);
10990        case 3530567: /*site*/  return new Property("site", "Reference(Location)", "Sites in which the contract is complied with,  exercised, or in force.", 0, java.lang.Integer.MAX_VALUE, site);
10991        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying this Contract definition, derivative, or instance in any legal state. Provides additional information about its content. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
10992        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.", 0, 1, title);
10993        case -2060497896: /*subtitle*/  return new Property("subtitle", "string", "An explanatory or alternate user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.", 0, 1, subtitle);
10994        case 92902992: /*alias*/  return new Property("alias", "string", "Alternative representation of the title for this Contract definition, derivative, or instance in any legal state., e.g., a domain specific contract number related to legislation.", 0, java.lang.Integer.MAX_VALUE, alias);
10995        case -1406328437: /*author*/  return new Property("author", "Reference(Patient|Practitioner|PractitionerRole|Organization)", "The individual or organization that authored the Contract definition, derivative, or instance in any legal state.", 0, 1, author);
10996        case 109264468: /*scope*/  return new Property("scope", "CodeableConcept", "A selector of legal concerns for this Contract definition, derivative, or instance in any legal state.", 0, 1, scope);
10997        case -957295375: /*topic[x]*/  return new Property("topic[x]", "CodeableConcept|Reference(Any)", "Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.", 0, 1, topic);
10998        case 110546223: /*topic*/  return new Property("topic[x]", "CodeableConcept|Reference(Any)", "Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.", 0, 1, topic);
10999        case 777778802: /*topicCodeableConcept*/  return new Property("topic[x]", "CodeableConcept", "Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.", 0, 1, topic);
11000        case -343345444: /*topicReference*/  return new Property("topic[x]", "Reference(Any)", "Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.", 0, 1, topic);
11001        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A high-level category for the legal instrument, whether constructed as a Contract definition, derivative, or instance in any legal state.  Provides additional information about its content within the context of the Contract's scope to distinguish the kinds of systems that would be interested in the contract.", 0, 1, type);
11002        case -1868521062: /*subType*/  return new Property("subType", "CodeableConcept", "Sub-category for the Contract that distinguishes the kinds of systems that would be interested in the Contract within the context of the Contract's scope.", 0, java.lang.Integer.MAX_VALUE, subType);
11003        case 247055020: /*contentDefinition*/  return new Property("contentDefinition", "", "Precusory content developed with a focus and intent of supporting the formation a Contract instance, which may be associated with and transformable into a Contract.", 0, 1, contentDefinition);
11004        case 3556460: /*term*/  return new Property("term", "", "One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.", 0, java.lang.Integer.MAX_VALUE, term);
11005        case 1922406657: /*supportingInfo*/  return new Property("supportingInfo", "Reference(Any)", "Information that may be needed by/relevant to the performer in their execution of this term action.", 0, java.lang.Integer.MAX_VALUE, supportingInfo);
11006        case 1538891575: /*relevantHistory*/  return new Property("relevantHistory", "Reference(Provenance)", "Links to Provenance records for past versions of this Contract definition, derivative, or instance, which identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the Contract.  The Provence.entity indicates the target that was changed in the update. http://build.fhir.org/provenance-definitions.html#Provenance.entity.", 0, java.lang.Integer.MAX_VALUE, relevantHistory);
11007        case -902467798: /*signer*/  return new Property("signer", "", "Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness.", 0, java.lang.Integer.MAX_VALUE, signer);
11008        case -1423054677: /*friendly*/  return new Property("friendly", "", "The \"patient friendly language\" versionof the Contract in whole or in parts. \"Patient friendly language\" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.", 0, java.lang.Integer.MAX_VALUE, friendly);
11009        case 102851257: /*legal*/  return new Property("legal", "", "List of Legal expressions or representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, legal);
11010        case 3512060: /*rule*/  return new Property("rule", "", "List of Computable Policy Rule Language Representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, rule);
11011        case -772497791: /*legallyBinding[x]*/  return new Property("legallyBinding[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse|Contract)", "Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the \"source of truth\" and which would be the basis for legal action related to enforcement of this Contract.", 0, 1, legallyBinding);
11012        case -126751329: /*legallyBinding*/  return new Property("legallyBinding[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse|Contract)", "Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the \"source of truth\" and which would be the basis for legal action related to enforcement of this Contract.", 0, 1, legallyBinding);
11013        case 344057890: /*legallyBindingAttachment*/  return new Property("legallyBinding[x]", "Attachment", "Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the \"source of truth\" and which would be the basis for legal action related to enforcement of this Contract.", 0, 1, legallyBinding);
11014        case -296528788: /*legallyBindingReference*/  return new Property("legallyBinding[x]", "Reference(Composition|DocumentReference|QuestionnaireResponse|Contract)", "Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the \"source of truth\" and which would be the basis for legal action related to enforcement of this Contract.", 0, 1, legallyBinding);
11015        default: return super.getNamedProperty(_hash, _name, _checkValid);
11016        }
11017
11018      }
11019
11020      @Override
11021      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
11022        switch (hash) {
11023        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
11024        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
11025        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
11026        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ContractResourceStatusCodes>
11027        case 568606040: /*legalState*/ return this.legalState == null ? new Base[0] : new Base[] {this.legalState}; // CodeableConcept
11028        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : new Base[] {this.instantiatesCanonical}; // Reference
11029        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : new Base[] {this.instantiatesUri}; // UriType
11030        case -92412192: /*contentDerivative*/ return this.contentDerivative == null ? new Base[0] : new Base[] {this.contentDerivative}; // CodeableConcept
11031        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType
11032        case -793235316: /*applies*/ return this.applies == null ? new Base[0] : new Base[] {this.applies}; // Period
11033        case -668311927: /*expirationType*/ return this.expirationType == null ? new Base[0] : new Base[] {this.expirationType}; // CodeableConcept
11034        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // Reference
11035        case 1475610435: /*authority*/ return this.authority == null ? new Base[0] : this.authority.toArray(new Base[this.authority.size()]); // Reference
11036        case -1326197564: /*domain*/ return this.domain == null ? new Base[0] : this.domain.toArray(new Base[this.domain.size()]); // Reference
11037        case 3530567: /*site*/ return this.site == null ? new Base[0] : this.site.toArray(new Base[this.site.size()]); // Reference
11038        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
11039        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
11040        case -2060497896: /*subtitle*/ return this.subtitle == null ? new Base[0] : new Base[] {this.subtitle}; // StringType
11041        case 92902992: /*alias*/ return this.alias == null ? new Base[0] : this.alias.toArray(new Base[this.alias.size()]); // StringType
11042        case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference
11043        case 109264468: /*scope*/ return this.scope == null ? new Base[0] : new Base[] {this.scope}; // CodeableConcept
11044        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : new Base[] {this.topic}; // DataType
11045        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
11046        case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // CodeableConcept
11047        case 247055020: /*contentDefinition*/ return this.contentDefinition == null ? new Base[0] : new Base[] {this.contentDefinition}; // ContentDefinitionComponent
11048        case 3556460: /*term*/ return this.term == null ? new Base[0] : this.term.toArray(new Base[this.term.size()]); // TermComponent
11049        case 1922406657: /*supportingInfo*/ return this.supportingInfo == null ? new Base[0] : this.supportingInfo.toArray(new Base[this.supportingInfo.size()]); // Reference
11050        case 1538891575: /*relevantHistory*/ return this.relevantHistory == null ? new Base[0] : this.relevantHistory.toArray(new Base[this.relevantHistory.size()]); // Reference
11051        case -902467798: /*signer*/ return this.signer == null ? new Base[0] : this.signer.toArray(new Base[this.signer.size()]); // SignatoryComponent
11052        case -1423054677: /*friendly*/ return this.friendly == null ? new Base[0] : this.friendly.toArray(new Base[this.friendly.size()]); // FriendlyLanguageComponent
11053        case 102851257: /*legal*/ return this.legal == null ? new Base[0] : this.legal.toArray(new Base[this.legal.size()]); // LegalLanguageComponent
11054        case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // ComputableLanguageComponent
11055        case -126751329: /*legallyBinding*/ return this.legallyBinding == null ? new Base[0] : new Base[] {this.legallyBinding}; // DataType
11056        default: return super.getProperty(hash, name, checkValid);
11057        }
11058
11059      }
11060
11061      @Override
11062      public Base setProperty(int hash, String name, Base value) throws FHIRException {
11063        switch (hash) {
11064        case -1618432855: // identifier
11065          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
11066          return value;
11067        case 116079: // url
11068          this.url = TypeConvertor.castToUri(value); // UriType
11069          return value;
11070        case 351608024: // version
11071          this.version = TypeConvertor.castToString(value); // StringType
11072          return value;
11073        case -892481550: // status
11074          value = new ContractResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
11075          this.status = (Enumeration) value; // Enumeration<ContractResourceStatusCodes>
11076          return value;
11077        case 568606040: // legalState
11078          this.legalState = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
11079          return value;
11080        case 8911915: // instantiatesCanonical
11081          this.instantiatesCanonical = TypeConvertor.castToReference(value); // Reference
11082          return value;
11083        case -1926393373: // instantiatesUri
11084          this.instantiatesUri = TypeConvertor.castToUri(value); // UriType
11085          return value;
11086        case -92412192: // contentDerivative
11087          this.contentDerivative = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
11088          return value;
11089        case -1179159893: // issued
11090          this.issued = TypeConvertor.castToDateTime(value); // DateTimeType
11091          return value;
11092        case -793235316: // applies
11093          this.applies = TypeConvertor.castToPeriod(value); // Period
11094          return value;
11095        case -668311927: // expirationType
11096          this.expirationType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
11097          return value;
11098        case -1867885268: // subject
11099          this.getSubject().add(TypeConvertor.castToReference(value)); // Reference
11100          return value;
11101        case 1475610435: // authority
11102          this.getAuthority().add(TypeConvertor.castToReference(value)); // Reference
11103          return value;
11104        case -1326197564: // domain
11105          this.getDomain().add(TypeConvertor.castToReference(value)); // Reference
11106          return value;
11107        case 3530567: // site
11108          this.getSite().add(TypeConvertor.castToReference(value)); // Reference
11109          return value;
11110        case 3373707: // name
11111          this.name = TypeConvertor.castToString(value); // StringType
11112          return value;
11113        case 110371416: // title
11114          this.title = TypeConvertor.castToString(value); // StringType
11115          return value;
11116        case -2060497896: // subtitle
11117          this.subtitle = TypeConvertor.castToString(value); // StringType
11118          return value;
11119        case 92902992: // alias
11120          this.getAlias().add(TypeConvertor.castToString(value)); // StringType
11121          return value;
11122        case -1406328437: // author
11123          this.author = TypeConvertor.castToReference(value); // Reference
11124          return value;
11125        case 109264468: // scope
11126          this.scope = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
11127          return value;
11128        case 110546223: // topic
11129          this.topic = TypeConvertor.castToType(value); // DataType
11130          return value;
11131        case 3575610: // type
11132          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
11133          return value;
11134        case -1868521062: // subType
11135          this.getSubType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
11136          return value;
11137        case 247055020: // contentDefinition
11138          this.contentDefinition = (ContentDefinitionComponent) value; // ContentDefinitionComponent
11139          return value;
11140        case 3556460: // term
11141          this.getTerm().add((TermComponent) value); // TermComponent
11142          return value;
11143        case 1922406657: // supportingInfo
11144          this.getSupportingInfo().add(TypeConvertor.castToReference(value)); // Reference
11145          return value;
11146        case 1538891575: // relevantHistory
11147          this.getRelevantHistory().add(TypeConvertor.castToReference(value)); // Reference
11148          return value;
11149        case -902467798: // signer
11150          this.getSigner().add((SignatoryComponent) value); // SignatoryComponent
11151          return value;
11152        case -1423054677: // friendly
11153          this.getFriendly().add((FriendlyLanguageComponent) value); // FriendlyLanguageComponent
11154          return value;
11155        case 102851257: // legal
11156          this.getLegal().add((LegalLanguageComponent) value); // LegalLanguageComponent
11157          return value;
11158        case 3512060: // rule
11159          this.getRule().add((ComputableLanguageComponent) value); // ComputableLanguageComponent
11160          return value;
11161        case -126751329: // legallyBinding
11162          this.legallyBinding = TypeConvertor.castToType(value); // DataType
11163          return value;
11164        default: return super.setProperty(hash, name, value);
11165        }
11166
11167      }
11168
11169      @Override
11170      public Base setProperty(String name, Base value) throws FHIRException {
11171        if (name.equals("identifier")) {
11172          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
11173        } else if (name.equals("url")) {
11174          this.url = TypeConvertor.castToUri(value); // UriType
11175        } else if (name.equals("version")) {
11176          this.version = TypeConvertor.castToString(value); // StringType
11177        } else if (name.equals("status")) {
11178          value = new ContractResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
11179          this.status = (Enumeration) value; // Enumeration<ContractResourceStatusCodes>
11180        } else if (name.equals("legalState")) {
11181          this.legalState = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
11182        } else if (name.equals("instantiatesCanonical")) {
11183          this.instantiatesCanonical = TypeConvertor.castToReference(value); // Reference
11184        } else if (name.equals("instantiatesUri")) {
11185          this.instantiatesUri = TypeConvertor.castToUri(value); // UriType
11186        } else if (name.equals("contentDerivative")) {
11187          this.contentDerivative = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
11188        } else if (name.equals("issued")) {
11189          this.issued = TypeConvertor.castToDateTime(value); // DateTimeType
11190        } else if (name.equals("applies")) {
11191          this.applies = TypeConvertor.castToPeriod(value); // Period
11192        } else if (name.equals("expirationType")) {
11193          this.expirationType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
11194        } else if (name.equals("subject")) {
11195          this.getSubject().add(TypeConvertor.castToReference(value));
11196        } else if (name.equals("authority")) {
11197          this.getAuthority().add(TypeConvertor.castToReference(value));
11198        } else if (name.equals("domain")) {
11199          this.getDomain().add(TypeConvertor.castToReference(value));
11200        } else if (name.equals("site")) {
11201          this.getSite().add(TypeConvertor.castToReference(value));
11202        } else if (name.equals("name")) {
11203          this.name = TypeConvertor.castToString(value); // StringType
11204        } else if (name.equals("title")) {
11205          this.title = TypeConvertor.castToString(value); // StringType
11206        } else if (name.equals("subtitle")) {
11207          this.subtitle = TypeConvertor.castToString(value); // StringType
11208        } else if (name.equals("alias")) {
11209          this.getAlias().add(TypeConvertor.castToString(value));
11210        } else if (name.equals("author")) {
11211          this.author = TypeConvertor.castToReference(value); // Reference
11212        } else if (name.equals("scope")) {
11213          this.scope = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
11214        } else if (name.equals("topic[x]")) {
11215          this.topic = TypeConvertor.castToType(value); // DataType
11216        } else if (name.equals("type")) {
11217          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
11218        } else if (name.equals("subType")) {
11219          this.getSubType().add(TypeConvertor.castToCodeableConcept(value));
11220        } else if (name.equals("contentDefinition")) {
11221          this.contentDefinition = (ContentDefinitionComponent) value; // ContentDefinitionComponent
11222        } else if (name.equals("term")) {
11223          this.getTerm().add((TermComponent) value);
11224        } else if (name.equals("supportingInfo")) {
11225          this.getSupportingInfo().add(TypeConvertor.castToReference(value));
11226        } else if (name.equals("relevantHistory")) {
11227          this.getRelevantHistory().add(TypeConvertor.castToReference(value));
11228        } else if (name.equals("signer")) {
11229          this.getSigner().add((SignatoryComponent) value);
11230        } else if (name.equals("friendly")) {
11231          this.getFriendly().add((FriendlyLanguageComponent) value);
11232        } else if (name.equals("legal")) {
11233          this.getLegal().add((LegalLanguageComponent) value);
11234        } else if (name.equals("rule")) {
11235          this.getRule().add((ComputableLanguageComponent) value);
11236        } else if (name.equals("legallyBinding[x]")) {
11237          this.legallyBinding = TypeConvertor.castToType(value); // DataType
11238        } else
11239          return super.setProperty(name, value);
11240        return value;
11241      }
11242
11243      @Override
11244      public Base makeProperty(int hash, String name) throws FHIRException {
11245        switch (hash) {
11246        case -1618432855:  return addIdentifier(); 
11247        case 116079:  return getUrlElement();
11248        case 351608024:  return getVersionElement();
11249        case -892481550:  return getStatusElement();
11250        case 568606040:  return getLegalState();
11251        case 8911915:  return getInstantiatesCanonical();
11252        case -1926393373:  return getInstantiatesUriElement();
11253        case -92412192:  return getContentDerivative();
11254        case -1179159893:  return getIssuedElement();
11255        case -793235316:  return getApplies();
11256        case -668311927:  return getExpirationType();
11257        case -1867885268:  return addSubject(); 
11258        case 1475610435:  return addAuthority(); 
11259        case -1326197564:  return addDomain(); 
11260        case 3530567:  return addSite(); 
11261        case 3373707:  return getNameElement();
11262        case 110371416:  return getTitleElement();
11263        case -2060497896:  return getSubtitleElement();
11264        case 92902992:  return addAliasElement();
11265        case -1406328437:  return getAuthor();
11266        case 109264468:  return getScope();
11267        case -957295375:  return getTopic();
11268        case 110546223:  return getTopic();
11269        case 3575610:  return getType();
11270        case -1868521062:  return addSubType(); 
11271        case 247055020:  return getContentDefinition();
11272        case 3556460:  return addTerm(); 
11273        case 1922406657:  return addSupportingInfo(); 
11274        case 1538891575:  return addRelevantHistory(); 
11275        case -902467798:  return addSigner(); 
11276        case -1423054677:  return addFriendly(); 
11277        case 102851257:  return addLegal(); 
11278        case 3512060:  return addRule(); 
11279        case -772497791:  return getLegallyBinding();
11280        case -126751329:  return getLegallyBinding();
11281        default: return super.makeProperty(hash, name);
11282        }
11283
11284      }
11285
11286      @Override
11287      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
11288        switch (hash) {
11289        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
11290        case 116079: /*url*/ return new String[] {"uri"};
11291        case 351608024: /*version*/ return new String[] {"string"};
11292        case -892481550: /*status*/ return new String[] {"code"};
11293        case 568606040: /*legalState*/ return new String[] {"CodeableConcept"};
11294        case 8911915: /*instantiatesCanonical*/ return new String[] {"Reference"};
11295        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
11296        case -92412192: /*contentDerivative*/ return new String[] {"CodeableConcept"};
11297        case -1179159893: /*issued*/ return new String[] {"dateTime"};
11298        case -793235316: /*applies*/ return new String[] {"Period"};
11299        case -668311927: /*expirationType*/ return new String[] {"CodeableConcept"};
11300        case -1867885268: /*subject*/ return new String[] {"Reference"};
11301        case 1475610435: /*authority*/ return new String[] {"Reference"};
11302        case -1326197564: /*domain*/ return new String[] {"Reference"};
11303        case 3530567: /*site*/ return new String[] {"Reference"};
11304        case 3373707: /*name*/ return new String[] {"string"};
11305        case 110371416: /*title*/ return new String[] {"string"};
11306        case -2060497896: /*subtitle*/ return new String[] {"string"};
11307        case 92902992: /*alias*/ return new String[] {"string"};
11308        case -1406328437: /*author*/ return new String[] {"Reference"};
11309        case 109264468: /*scope*/ return new String[] {"CodeableConcept"};
11310        case 110546223: /*topic*/ return new String[] {"CodeableConcept", "Reference"};
11311        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
11312        case -1868521062: /*subType*/ return new String[] {"CodeableConcept"};
11313        case 247055020: /*contentDefinition*/ return new String[] {};
11314        case 3556460: /*term*/ return new String[] {};
11315        case 1922406657: /*supportingInfo*/ return new String[] {"Reference"};
11316        case 1538891575: /*relevantHistory*/ return new String[] {"Reference"};
11317        case -902467798: /*signer*/ return new String[] {};
11318        case -1423054677: /*friendly*/ return new String[] {};
11319        case 102851257: /*legal*/ return new String[] {};
11320        case 3512060: /*rule*/ return new String[] {};
11321        case -126751329: /*legallyBinding*/ return new String[] {"Attachment", "Reference"};
11322        default: return super.getTypesForProperty(hash, name);
11323        }
11324
11325      }
11326
11327      @Override
11328      public Base addChild(String name) throws FHIRException {
11329        if (name.equals("identifier")) {
11330          return addIdentifier();
11331        }
11332        else if (name.equals("url")) {
11333          throw new FHIRException("Cannot call addChild on a primitive type Contract.url");
11334        }
11335        else if (name.equals("version")) {
11336          throw new FHIRException("Cannot call addChild on a primitive type Contract.version");
11337        }
11338        else if (name.equals("status")) {
11339          throw new FHIRException("Cannot call addChild on a primitive type Contract.status");
11340        }
11341        else if (name.equals("legalState")) {
11342          this.legalState = new CodeableConcept();
11343          return this.legalState;
11344        }
11345        else if (name.equals("instantiatesCanonical")) {
11346          this.instantiatesCanonical = new Reference();
11347          return this.instantiatesCanonical;
11348        }
11349        else if (name.equals("instantiatesUri")) {
11350          throw new FHIRException("Cannot call addChild on a primitive type Contract.instantiatesUri");
11351        }
11352        else if (name.equals("contentDerivative")) {
11353          this.contentDerivative = new CodeableConcept();
11354          return this.contentDerivative;
11355        }
11356        else if (name.equals("issued")) {
11357          throw new FHIRException("Cannot call addChild on a primitive type Contract.issued");
11358        }
11359        else if (name.equals("applies")) {
11360          this.applies = new Period();
11361          return this.applies;
11362        }
11363        else if (name.equals("expirationType")) {
11364          this.expirationType = new CodeableConcept();
11365          return this.expirationType;
11366        }
11367        else if (name.equals("subject")) {
11368          return addSubject();
11369        }
11370        else if (name.equals("authority")) {
11371          return addAuthority();
11372        }
11373        else if (name.equals("domain")) {
11374          return addDomain();
11375        }
11376        else if (name.equals("site")) {
11377          return addSite();
11378        }
11379        else if (name.equals("name")) {
11380          throw new FHIRException("Cannot call addChild on a primitive type Contract.name");
11381        }
11382        else if (name.equals("title")) {
11383          throw new FHIRException("Cannot call addChild on a primitive type Contract.title");
11384        }
11385        else if (name.equals("subtitle")) {
11386          throw new FHIRException("Cannot call addChild on a primitive type Contract.subtitle");
11387        }
11388        else if (name.equals("alias")) {
11389          throw new FHIRException("Cannot call addChild on a primitive type Contract.alias");
11390        }
11391        else if (name.equals("author")) {
11392          this.author = new Reference();
11393          return this.author;
11394        }
11395        else if (name.equals("scope")) {
11396          this.scope = new CodeableConcept();
11397          return this.scope;
11398        }
11399        else if (name.equals("topicCodeableConcept")) {
11400          this.topic = new CodeableConcept();
11401          return this.topic;
11402        }
11403        else if (name.equals("topicReference")) {
11404          this.topic = new Reference();
11405          return this.topic;
11406        }
11407        else if (name.equals("type")) {
11408          this.type = new CodeableConcept();
11409          return this.type;
11410        }
11411        else if (name.equals("subType")) {
11412          return addSubType();
11413        }
11414        else if (name.equals("contentDefinition")) {
11415          this.contentDefinition = new ContentDefinitionComponent();
11416          return this.contentDefinition;
11417        }
11418        else if (name.equals("term")) {
11419          return addTerm();
11420        }
11421        else if (name.equals("supportingInfo")) {
11422          return addSupportingInfo();
11423        }
11424        else if (name.equals("relevantHistory")) {
11425          return addRelevantHistory();
11426        }
11427        else if (name.equals("signer")) {
11428          return addSigner();
11429        }
11430        else if (name.equals("friendly")) {
11431          return addFriendly();
11432        }
11433        else if (name.equals("legal")) {
11434          return addLegal();
11435        }
11436        else if (name.equals("rule")) {
11437          return addRule();
11438        }
11439        else if (name.equals("legallyBindingAttachment")) {
11440          this.legallyBinding = new Attachment();
11441          return this.legallyBinding;
11442        }
11443        else if (name.equals("legallyBindingReference")) {
11444          this.legallyBinding = new Reference();
11445          return this.legallyBinding;
11446        }
11447        else
11448          return super.addChild(name);
11449      }
11450
11451  public String fhirType() {
11452    return "Contract";
11453
11454  }
11455
11456      public Contract copy() {
11457        Contract dst = new Contract();
11458        copyValues(dst);
11459        return dst;
11460      }
11461
11462      public void copyValues(Contract dst) {
11463        super.copyValues(dst);
11464        if (identifier != null) {
11465          dst.identifier = new ArrayList<Identifier>();
11466          for (Identifier i : identifier)
11467            dst.identifier.add(i.copy());
11468        };
11469        dst.url = url == null ? null : url.copy();
11470        dst.version = version == null ? null : version.copy();
11471        dst.status = status == null ? null : status.copy();
11472        dst.legalState = legalState == null ? null : legalState.copy();
11473        dst.instantiatesCanonical = instantiatesCanonical == null ? null : instantiatesCanonical.copy();
11474        dst.instantiatesUri = instantiatesUri == null ? null : instantiatesUri.copy();
11475        dst.contentDerivative = contentDerivative == null ? null : contentDerivative.copy();
11476        dst.issued = issued == null ? null : issued.copy();
11477        dst.applies = applies == null ? null : applies.copy();
11478        dst.expirationType = expirationType == null ? null : expirationType.copy();
11479        if (subject != null) {
11480          dst.subject = new ArrayList<Reference>();
11481          for (Reference i : subject)
11482            dst.subject.add(i.copy());
11483        };
11484        if (authority != null) {
11485          dst.authority = new ArrayList<Reference>();
11486          for (Reference i : authority)
11487            dst.authority.add(i.copy());
11488        };
11489        if (domain != null) {
11490          dst.domain = new ArrayList<Reference>();
11491          for (Reference i : domain)
11492            dst.domain.add(i.copy());
11493        };
11494        if (site != null) {
11495          dst.site = new ArrayList<Reference>();
11496          for (Reference i : site)
11497            dst.site.add(i.copy());
11498        };
11499        dst.name = name == null ? null : name.copy();
11500        dst.title = title == null ? null : title.copy();
11501        dst.subtitle = subtitle == null ? null : subtitle.copy();
11502        if (alias != null) {
11503          dst.alias = new ArrayList<StringType>();
11504          for (StringType i : alias)
11505            dst.alias.add(i.copy());
11506        };
11507        dst.author = author == null ? null : author.copy();
11508        dst.scope = scope == null ? null : scope.copy();
11509        dst.topic = topic == null ? null : topic.copy();
11510        dst.type = type == null ? null : type.copy();
11511        if (subType != null) {
11512          dst.subType = new ArrayList<CodeableConcept>();
11513          for (CodeableConcept i : subType)
11514            dst.subType.add(i.copy());
11515        };
11516        dst.contentDefinition = contentDefinition == null ? null : contentDefinition.copy();
11517        if (term != null) {
11518          dst.term = new ArrayList<TermComponent>();
11519          for (TermComponent i : term)
11520            dst.term.add(i.copy());
11521        };
11522        if (supportingInfo != null) {
11523          dst.supportingInfo = new ArrayList<Reference>();
11524          for (Reference i : supportingInfo)
11525            dst.supportingInfo.add(i.copy());
11526        };
11527        if (relevantHistory != null) {
11528          dst.relevantHistory = new ArrayList<Reference>();
11529          for (Reference i : relevantHistory)
11530            dst.relevantHistory.add(i.copy());
11531        };
11532        if (signer != null) {
11533          dst.signer = new ArrayList<SignatoryComponent>();
11534          for (SignatoryComponent i : signer)
11535            dst.signer.add(i.copy());
11536        };
11537        if (friendly != null) {
11538          dst.friendly = new ArrayList<FriendlyLanguageComponent>();
11539          for (FriendlyLanguageComponent i : friendly)
11540            dst.friendly.add(i.copy());
11541        };
11542        if (legal != null) {
11543          dst.legal = new ArrayList<LegalLanguageComponent>();
11544          for (LegalLanguageComponent i : legal)
11545            dst.legal.add(i.copy());
11546        };
11547        if (rule != null) {
11548          dst.rule = new ArrayList<ComputableLanguageComponent>();
11549          for (ComputableLanguageComponent i : rule)
11550            dst.rule.add(i.copy());
11551        };
11552        dst.legallyBinding = legallyBinding == null ? null : legallyBinding.copy();
11553      }
11554
11555      protected Contract typedCopy() {
11556        return copy();
11557      }
11558
11559      @Override
11560      public boolean equalsDeep(Base other_) {
11561        if (!super.equalsDeep(other_))
11562          return false;
11563        if (!(other_ instanceof Contract))
11564          return false;
11565        Contract o = (Contract) other_;
11566        return compareDeep(identifier, o.identifier, true) && compareDeep(url, o.url, true) && compareDeep(version, o.version, true)
11567           && compareDeep(status, o.status, true) && compareDeep(legalState, o.legalState, true) && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
11568           && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(contentDerivative, o.contentDerivative, true)
11569           && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true) && compareDeep(expirationType, o.expirationType, true)
11570           && compareDeep(subject, o.subject, true) && compareDeep(authority, o.authority, true) && compareDeep(domain, o.domain, true)
11571           && compareDeep(site, o.site, true) && compareDeep(name, o.name, true) && compareDeep(title, o.title, true)
11572           && compareDeep(subtitle, o.subtitle, true) && compareDeep(alias, o.alias, true) && compareDeep(author, o.author, true)
11573           && compareDeep(scope, o.scope, true) && compareDeep(topic, o.topic, true) && compareDeep(type, o.type, true)
11574           && compareDeep(subType, o.subType, true) && compareDeep(contentDefinition, o.contentDefinition, true)
11575           && compareDeep(term, o.term, true) && compareDeep(supportingInfo, o.supportingInfo, true) && compareDeep(relevantHistory, o.relevantHistory, true)
11576           && compareDeep(signer, o.signer, true) && compareDeep(friendly, o.friendly, true) && compareDeep(legal, o.legal, true)
11577           && compareDeep(rule, o.rule, true) && compareDeep(legallyBinding, o.legallyBinding, true);
11578      }
11579
11580      @Override
11581      public boolean equalsShallow(Base other_) {
11582        if (!super.equalsShallow(other_))
11583          return false;
11584        if (!(other_ instanceof Contract))
11585          return false;
11586        Contract o = (Contract) other_;
11587        return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(status, o.status, true)
11588           && compareValues(instantiatesUri, o.instantiatesUri, true) && compareValues(issued, o.issued, true)
11589           && compareValues(name, o.name, true) && compareValues(title, o.title, true) && compareValues(subtitle, o.subtitle, true)
11590           && compareValues(alias, o.alias, true);
11591      }
11592
11593      public boolean isEmpty() {
11594        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, url, version
11595          , status, legalState, instantiatesCanonical, instantiatesUri, contentDerivative, issued
11596          , applies, expirationType, subject, authority, domain, site, name, title, subtitle
11597          , alias, author, scope, topic, type, subType, contentDefinition, term, supportingInfo
11598          , relevantHistory, signer, friendly, legal, rule, legallyBinding);
11599      }
11600
11601  @Override
11602  public ResourceType getResourceType() {
11603    return ResourceType.Contract;
11604   }
11605
11606 /**
11607   * Search parameter: <b>authority</b>
11608   * <p>
11609   * Description: <b>The authority of the contract</b><br>
11610   * Type: <b>reference</b><br>
11611   * Path: <b>Contract.authority</b><br>
11612   * </p>
11613   */
11614  @SearchParamDefinition(name="authority", path="Contract.authority", description="The authority of the contract", type="reference", target={Organization.class } )
11615  public static final String SP_AUTHORITY = "authority";
11616 /**
11617   * <b>Fluent Client</b> search parameter constant for <b>authority</b>
11618   * <p>
11619   * Description: <b>The authority of the contract</b><br>
11620   * Type: <b>reference</b><br>
11621   * Path: <b>Contract.authority</b><br>
11622   * </p>
11623   */
11624  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHORITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHORITY);
11625
11626/**
11627   * Constant for fluent queries to be used to add include statements. Specifies
11628   * the path value of "<b>Contract:authority</b>".
11629   */
11630  public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHORITY = new ca.uhn.fhir.model.api.Include("Contract:authority").toLocked();
11631
11632 /**
11633   * Search parameter: <b>domain</b>
11634   * <p>
11635   * Description: <b>The domain of the contract</b><br>
11636   * Type: <b>reference</b><br>
11637   * Path: <b>Contract.domain</b><br>
11638   * </p>
11639   */
11640  @SearchParamDefinition(name="domain", path="Contract.domain", description="The domain of the contract", type="reference", target={Location.class } )
11641  public static final String SP_DOMAIN = "domain";
11642 /**
11643   * <b>Fluent Client</b> search parameter constant for <b>domain</b>
11644   * <p>
11645   * Description: <b>The domain of the contract</b><br>
11646   * Type: <b>reference</b><br>
11647   * Path: <b>Contract.domain</b><br>
11648   * </p>
11649   */
11650  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DOMAIN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DOMAIN);
11651
11652/**
11653   * Constant for fluent queries to be used to add include statements. Specifies
11654   * the path value of "<b>Contract:domain</b>".
11655   */
11656  public static final ca.uhn.fhir.model.api.Include INCLUDE_DOMAIN = new ca.uhn.fhir.model.api.Include("Contract:domain").toLocked();
11657
11658 /**
11659   * Search parameter: <b>identifier</b>
11660   * <p>
11661   * Description: <b>The identity of the contract</b><br>
11662   * Type: <b>token</b><br>
11663   * Path: <b>Contract.identifier</b><br>
11664   * </p>
11665   */
11666  @SearchParamDefinition(name="identifier", path="Contract.identifier", description="The identity of the contract", type="token" )
11667  public static final String SP_IDENTIFIER = "identifier";
11668 /**
11669   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
11670   * <p>
11671   * Description: <b>The identity of the contract</b><br>
11672   * Type: <b>token</b><br>
11673   * Path: <b>Contract.identifier</b><br>
11674   * </p>
11675   */
11676  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
11677
11678 /**
11679   * Search parameter: <b>instantiates</b>
11680   * <p>
11681   * Description: <b>A source definition of the contract</b><br>
11682   * Type: <b>uri</b><br>
11683   * Path: <b>Contract.instantiatesUri</b><br>
11684   * </p>
11685   */
11686  @SearchParamDefinition(name="instantiates", path="Contract.instantiatesUri", description="A source definition of the contract", type="uri" )
11687  public static final String SP_INSTANTIATES = "instantiates";
11688 /**
11689   * <b>Fluent Client</b> search parameter constant for <b>instantiates</b>
11690   * <p>
11691   * Description: <b>A source definition of the contract</b><br>
11692   * Type: <b>uri</b><br>
11693   * Path: <b>Contract.instantiatesUri</b><br>
11694   * </p>
11695   */
11696  public static final ca.uhn.fhir.rest.gclient.UriClientParam INSTANTIATES = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_INSTANTIATES);
11697
11698 /**
11699   * Search parameter: <b>issued</b>
11700   * <p>
11701   * Description: <b>The date/time the contract was issued</b><br>
11702   * Type: <b>date</b><br>
11703   * Path: <b>Contract.issued</b><br>
11704   * </p>
11705   */
11706  @SearchParamDefinition(name="issued", path="Contract.issued", description="The date/time the contract was issued", type="date" )
11707  public static final String SP_ISSUED = "issued";
11708 /**
11709   * <b>Fluent Client</b> search parameter constant for <b>issued</b>
11710   * <p>
11711   * Description: <b>The date/time the contract was issued</b><br>
11712   * Type: <b>date</b><br>
11713   * Path: <b>Contract.issued</b><br>
11714   * </p>
11715   */
11716  public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED);
11717
11718 /**
11719   * Search parameter: <b>patient</b>
11720   * <p>
11721   * Description: <b>The identity of the subject of the contract (if a patient)</b><br>
11722   * Type: <b>reference</b><br>
11723   * Path: <b>Contract.subject.where(resolve() is Patient)</b><br>
11724   * </p>
11725   */
11726  @SearchParamDefinition(name="patient", path="Contract.subject.where(resolve() is Patient)", description="The identity of the subject of the contract (if a patient)", 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, CarePlan.class, CareTeam.class, CatalogEntry.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, Condition.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, EvidenceReport.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, Media.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationStatement.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchDefinition.class, ResearchElementDefinition.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
11727  public static final String SP_PATIENT = "patient";
11728 /**
11729   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
11730   * <p>
11731   * Description: <b>The identity of the subject of the contract (if a patient)</b><br>
11732   * Type: <b>reference</b><br>
11733   * Path: <b>Contract.subject.where(resolve() is Patient)</b><br>
11734   * </p>
11735   */
11736  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
11737
11738/**
11739   * Constant for fluent queries to be used to add include statements. Specifies
11740   * the path value of "<b>Contract:patient</b>".
11741   */
11742  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Contract:patient").toLocked();
11743
11744 /**
11745   * Search parameter: <b>signer</b>
11746   * <p>
11747   * Description: <b>Contract Signatory Party</b><br>
11748   * Type: <b>reference</b><br>
11749   * Path: <b>Contract.signer.party</b><br>
11750   * </p>
11751   */
11752  @SearchParamDefinition(name="signer", path="Contract.signer.party", description="Contract Signatory Party", type="reference", target={Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
11753  public static final String SP_SIGNER = "signer";
11754 /**
11755   * <b>Fluent Client</b> search parameter constant for <b>signer</b>
11756   * <p>
11757   * Description: <b>Contract Signatory Party</b><br>
11758   * Type: <b>reference</b><br>
11759   * Path: <b>Contract.signer.party</b><br>
11760   * </p>
11761   */
11762  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SIGNER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SIGNER);
11763
11764/**
11765   * Constant for fluent queries to be used to add include statements. Specifies
11766   * the path value of "<b>Contract:signer</b>".
11767   */
11768  public static final ca.uhn.fhir.model.api.Include INCLUDE_SIGNER = new ca.uhn.fhir.model.api.Include("Contract:signer").toLocked();
11769
11770 /**
11771   * Search parameter: <b>status</b>
11772   * <p>
11773   * Description: <b>The status of the contract</b><br>
11774   * Type: <b>token</b><br>
11775   * Path: <b>Contract.status</b><br>
11776   * </p>
11777   */
11778  @SearchParamDefinition(name="status", path="Contract.status", description="The status of the contract", type="token" )
11779  public static final String SP_STATUS = "status";
11780 /**
11781   * <b>Fluent Client</b> search parameter constant for <b>status</b>
11782   * <p>
11783   * Description: <b>The status of the contract</b><br>
11784   * Type: <b>token</b><br>
11785   * Path: <b>Contract.status</b><br>
11786   * </p>
11787   */
11788  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
11789
11790 /**
11791   * Search parameter: <b>subject</b>
11792   * <p>
11793   * Description: <b>The identity of the subject of the contract</b><br>
11794   * Type: <b>reference</b><br>
11795   * Path: <b>Contract.subject</b><br>
11796   * </p>
11797   */
11798  @SearchParamDefinition(name="subject", path="Contract.subject", description="The identity of the subject of the contract", 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, CarePlan.class, CareTeam.class, CatalogEntry.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, Condition.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, EvidenceReport.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, Media.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationStatement.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchDefinition.class, ResearchElementDefinition.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
11799  public static final String SP_SUBJECT = "subject";
11800 /**
11801   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
11802   * <p>
11803   * Description: <b>The identity of the subject of the contract</b><br>
11804   * Type: <b>reference</b><br>
11805   * Path: <b>Contract.subject</b><br>
11806   * </p>
11807   */
11808  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
11809
11810/**
11811   * Constant for fluent queries to be used to add include statements. Specifies
11812   * the path value of "<b>Contract:subject</b>".
11813   */
11814  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Contract:subject").toLocked();
11815
11816 /**
11817   * Search parameter: <b>url</b>
11818   * <p>
11819   * Description: <b>The basal contract definition</b><br>
11820   * Type: <b>uri</b><br>
11821   * Path: <b>Contract.url</b><br>
11822   * </p>
11823   */
11824  @SearchParamDefinition(name="url", path="Contract.url", description="The basal contract definition", type="uri" )
11825  public static final String SP_URL = "url";
11826 /**
11827   * <b>Fluent Client</b> search parameter constant for <b>url</b>
11828   * <p>
11829   * Description: <b>The basal contract definition</b><br>
11830   * Type: <b>uri</b><br>
11831   * Path: <b>Contract.url</b><br>
11832   * </p>
11833   */
11834  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
11835
11836
11837}
11838