001package org.hl7.fhir.r4.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import java.math.*;
040import org.hl7.fhir.utilities.Utilities;
041import ca.uhn.fhir.model.api.annotation.ResourceDef;
042import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
043import ca.uhn.fhir.model.api.annotation.Child;
044import ca.uhn.fhir.model.api.annotation.ChildOrder;
045import ca.uhn.fhir.model.api.annotation.Description;
046import ca.uhn.fhir.model.api.annotation.Block;
047import org.hl7.fhir.instance.model.api.*;
048import org.hl7.fhir.exceptions.FHIRException;
049/**
050 * Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.
051 */
052@ResourceDef(name="Contract", profile="http://hl7.org/fhir/StructureDefinition/Contract")
053public class Contract extends DomainResource {
054
055    public enum ContractStatus {
056        /**
057         * 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.
058         */
059        AMENDED, 
060        /**
061         * 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.
062         */
063        APPENDED, 
064        /**
065         * 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.
066         */
067        CANCELLED, 
068        /**
069         * 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.
070         */
071        DISPUTED, 
072        /**
073         * Contract was created in error. No Precedence Order.  Status may be applied to a Contract with any status.
074         */
075        ENTEREDINERROR, 
076        /**
077         * 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.
078         */
079        EXECUTABLE, 
080        /**
081         * 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.
082         */
083        EXECUTED, 
084        /**
085         * 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.
086         */
087        NEGOTIABLE, 
088        /**
089         * 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.
090         */
091        OFFERED, 
092        /**
093         * 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.
094         */
095        POLICY, 
096        /**
097         *  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.
098         */
099        REJECTED, 
100        /**
101         * 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.
102         */
103        RENEWED, 
104        /**
105         * A Contract that is rescinded.  May be required prior to replacing with an updated Contract. Comparable FHIR and v.3 status codes: nullified.
106         */
107        REVOKED, 
108        /**
109         * 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.
110         */
111        RESOLVED, 
112        /**
113         * 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.
114         */
115        TERMINATED, 
116        /**
117         * added to help the parsers with the generic types
118         */
119        NULL;
120        public static ContractStatus fromCode(String codeString) throws FHIRException {
121            if (codeString == null || "".equals(codeString))
122                return null;
123        if ("amended".equals(codeString))
124          return AMENDED;
125        if ("appended".equals(codeString))
126          return APPENDED;
127        if ("cancelled".equals(codeString))
128          return CANCELLED;
129        if ("disputed".equals(codeString))
130          return DISPUTED;
131        if ("entered-in-error".equals(codeString))
132          return ENTEREDINERROR;
133        if ("executable".equals(codeString))
134          return EXECUTABLE;
135        if ("executed".equals(codeString))
136          return EXECUTED;
137        if ("negotiable".equals(codeString))
138          return NEGOTIABLE;
139        if ("offered".equals(codeString))
140          return OFFERED;
141        if ("policy".equals(codeString))
142          return POLICY;
143        if ("rejected".equals(codeString))
144          return REJECTED;
145        if ("renewed".equals(codeString))
146          return RENEWED;
147        if ("revoked".equals(codeString))
148          return REVOKED;
149        if ("resolved".equals(codeString))
150          return RESOLVED;
151        if ("terminated".equals(codeString))
152          return TERMINATED;
153        if (Configuration.isAcceptInvalidEnums())
154          return null;
155        else
156          throw new FHIRException("Unknown ContractStatus code '"+codeString+"'");
157        }
158        public String toCode() {
159          switch (this) {
160            case AMENDED: return "amended";
161            case APPENDED: return "appended";
162            case CANCELLED: return "cancelled";
163            case DISPUTED: return "disputed";
164            case ENTEREDINERROR: return "entered-in-error";
165            case EXECUTABLE: return "executable";
166            case EXECUTED: return "executed";
167            case NEGOTIABLE: return "negotiable";
168            case OFFERED: return "offered";
169            case POLICY: return "policy";
170            case REJECTED: return "rejected";
171            case RENEWED: return "renewed";
172            case REVOKED: return "revoked";
173            case RESOLVED: return "resolved";
174            case TERMINATED: return "terminated";
175            default: return "?";
176          }
177        }
178        public String getSystem() {
179          switch (this) {
180            case AMENDED: return "http://hl7.org/fhir/contract-status";
181            case APPENDED: return "http://hl7.org/fhir/contract-status";
182            case CANCELLED: return "http://hl7.org/fhir/contract-status";
183            case DISPUTED: return "http://hl7.org/fhir/contract-status";
184            case ENTEREDINERROR: return "http://hl7.org/fhir/contract-status";
185            case EXECUTABLE: return "http://hl7.org/fhir/contract-status";
186            case EXECUTED: return "http://hl7.org/fhir/contract-status";
187            case NEGOTIABLE: return "http://hl7.org/fhir/contract-status";
188            case OFFERED: return "http://hl7.org/fhir/contract-status";
189            case POLICY: return "http://hl7.org/fhir/contract-status";
190            case REJECTED: return "http://hl7.org/fhir/contract-status";
191            case RENEWED: return "http://hl7.org/fhir/contract-status";
192            case REVOKED: return "http://hl7.org/fhir/contract-status";
193            case RESOLVED: return "http://hl7.org/fhir/contract-status";
194            case TERMINATED: return "http://hl7.org/fhir/contract-status";
195            default: return "?";
196          }
197        }
198        public String getDefinition() {
199          switch (this) {
200            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.";
201            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.";
202            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.";
203            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.";
204            case ENTEREDINERROR: return "Contract was created in error. No Precedence Order.  Status may be applied to a Contract with any status.";
205            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.";
206            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.";
207            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.";
208            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.";
209            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.";
210            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.";
211            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.";
212            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.";
213            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.";
214            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.";
215            default: return "?";
216          }
217        }
218        public String getDisplay() {
219          switch (this) {
220            case AMENDED: return "Amended";
221            case APPENDED: return "Appended";
222            case CANCELLED: return "Cancelled";
223            case DISPUTED: return "Disputed";
224            case ENTEREDINERROR: return "Entered in Error";
225            case EXECUTABLE: return "Executable";
226            case EXECUTED: return "Executed";
227            case NEGOTIABLE: return "Negotiable";
228            case OFFERED: return "Offered";
229            case POLICY: return "Policy";
230            case REJECTED: return "Rejected";
231            case RENEWED: return "Renewed";
232            case REVOKED: return "Revoked";
233            case RESOLVED: return "Resolved";
234            case TERMINATED: return "Terminated";
235            default: return "?";
236          }
237        }
238    }
239
240  public static class ContractStatusEnumFactory implements EnumFactory<ContractStatus> {
241    public ContractStatus fromCode(String codeString) throws IllegalArgumentException {
242      if (codeString == null || "".equals(codeString))
243            if (codeString == null || "".equals(codeString))
244                return null;
245        if ("amended".equals(codeString))
246          return ContractStatus.AMENDED;
247        if ("appended".equals(codeString))
248          return ContractStatus.APPENDED;
249        if ("cancelled".equals(codeString))
250          return ContractStatus.CANCELLED;
251        if ("disputed".equals(codeString))
252          return ContractStatus.DISPUTED;
253        if ("entered-in-error".equals(codeString))
254          return ContractStatus.ENTEREDINERROR;
255        if ("executable".equals(codeString))
256          return ContractStatus.EXECUTABLE;
257        if ("executed".equals(codeString))
258          return ContractStatus.EXECUTED;
259        if ("negotiable".equals(codeString))
260          return ContractStatus.NEGOTIABLE;
261        if ("offered".equals(codeString))
262          return ContractStatus.OFFERED;
263        if ("policy".equals(codeString))
264          return ContractStatus.POLICY;
265        if ("rejected".equals(codeString))
266          return ContractStatus.REJECTED;
267        if ("renewed".equals(codeString))
268          return ContractStatus.RENEWED;
269        if ("revoked".equals(codeString))
270          return ContractStatus.REVOKED;
271        if ("resolved".equals(codeString))
272          return ContractStatus.RESOLVED;
273        if ("terminated".equals(codeString))
274          return ContractStatus.TERMINATED;
275        throw new IllegalArgumentException("Unknown ContractStatus code '"+codeString+"'");
276        }
277        public Enumeration<ContractStatus> fromType(Base code) throws FHIRException {
278          if (code == null)
279            return null;
280          if (code.isEmpty())
281            return new Enumeration<ContractStatus>(this);
282          String codeString = ((PrimitiveType) code).asStringValue();
283          if (codeString == null || "".equals(codeString))
284            return null;
285        if ("amended".equals(codeString))
286          return new Enumeration<ContractStatus>(this, ContractStatus.AMENDED);
287        if ("appended".equals(codeString))
288          return new Enumeration<ContractStatus>(this, ContractStatus.APPENDED);
289        if ("cancelled".equals(codeString))
290          return new Enumeration<ContractStatus>(this, ContractStatus.CANCELLED);
291        if ("disputed".equals(codeString))
292          return new Enumeration<ContractStatus>(this, ContractStatus.DISPUTED);
293        if ("entered-in-error".equals(codeString))
294          return new Enumeration<ContractStatus>(this, ContractStatus.ENTEREDINERROR);
295        if ("executable".equals(codeString))
296          return new Enumeration<ContractStatus>(this, ContractStatus.EXECUTABLE);
297        if ("executed".equals(codeString))
298          return new Enumeration<ContractStatus>(this, ContractStatus.EXECUTED);
299        if ("negotiable".equals(codeString))
300          return new Enumeration<ContractStatus>(this, ContractStatus.NEGOTIABLE);
301        if ("offered".equals(codeString))
302          return new Enumeration<ContractStatus>(this, ContractStatus.OFFERED);
303        if ("policy".equals(codeString))
304          return new Enumeration<ContractStatus>(this, ContractStatus.POLICY);
305        if ("rejected".equals(codeString))
306          return new Enumeration<ContractStatus>(this, ContractStatus.REJECTED);
307        if ("renewed".equals(codeString))
308          return new Enumeration<ContractStatus>(this, ContractStatus.RENEWED);
309        if ("revoked".equals(codeString))
310          return new Enumeration<ContractStatus>(this, ContractStatus.REVOKED);
311        if ("resolved".equals(codeString))
312          return new Enumeration<ContractStatus>(this, ContractStatus.RESOLVED);
313        if ("terminated".equals(codeString))
314          return new Enumeration<ContractStatus>(this, ContractStatus.TERMINATED);
315        throw new FHIRException("Unknown ContractStatus code '"+codeString+"'");
316        }
317    public String toCode(ContractStatus code) {
318      if (code == ContractStatus.AMENDED)
319        return "amended";
320      if (code == ContractStatus.APPENDED)
321        return "appended";
322      if (code == ContractStatus.CANCELLED)
323        return "cancelled";
324      if (code == ContractStatus.DISPUTED)
325        return "disputed";
326      if (code == ContractStatus.ENTEREDINERROR)
327        return "entered-in-error";
328      if (code == ContractStatus.EXECUTABLE)
329        return "executable";
330      if (code == ContractStatus.EXECUTED)
331        return "executed";
332      if (code == ContractStatus.NEGOTIABLE)
333        return "negotiable";
334      if (code == ContractStatus.OFFERED)
335        return "offered";
336      if (code == ContractStatus.POLICY)
337        return "policy";
338      if (code == ContractStatus.REJECTED)
339        return "rejected";
340      if (code == ContractStatus.RENEWED)
341        return "renewed";
342      if (code == ContractStatus.REVOKED)
343        return "revoked";
344      if (code == ContractStatus.RESOLVED)
345        return "resolved";
346      if (code == ContractStatus.TERMINATED)
347        return "terminated";
348      return "?";
349      }
350    public String toSystem(ContractStatus code) {
351      return code.getSystem();
352      }
353    }
354
355    public enum ContractPublicationStatus {
356        /**
357         * 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.
358         */
359        AMENDED, 
360        /**
361         * 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.
362         */
363        APPENDED, 
364        /**
365         * 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.
366         */
367        CANCELLED, 
368        /**
369         * 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.
370         */
371        DISPUTED, 
372        /**
373         * Contract was created in error. No Precedence Order.  Status may be applied to a Contract with any status.
374         */
375        ENTEREDINERROR, 
376        /**
377         * 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.
378         */
379        EXECUTABLE, 
380        /**
381         * 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.
382         */
383        EXECUTED, 
384        /**
385         * 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.
386         */
387        NEGOTIABLE, 
388        /**
389         * 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.
390         */
391        OFFERED, 
392        /**
393         * 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.
394         */
395        POLICY, 
396        /**
397         *  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.
398         */
399        REJECTED, 
400        /**
401         * 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.
402         */
403        RENEWED, 
404        /**
405         * A Contract that is rescinded.  May be required prior to replacing with an updated Contract. Comparable FHIR and v.3 status codes: nullified.
406         */
407        REVOKED, 
408        /**
409         * 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.
410         */
411        RESOLVED, 
412        /**
413         * 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.
414         */
415        TERMINATED, 
416        /**
417         * added to help the parsers with the generic types
418         */
419        NULL;
420        public static ContractPublicationStatus fromCode(String codeString) throws FHIRException {
421            if (codeString == null || "".equals(codeString))
422                return null;
423        if ("amended".equals(codeString))
424          return AMENDED;
425        if ("appended".equals(codeString))
426          return APPENDED;
427        if ("cancelled".equals(codeString))
428          return CANCELLED;
429        if ("disputed".equals(codeString))
430          return DISPUTED;
431        if ("entered-in-error".equals(codeString))
432          return ENTEREDINERROR;
433        if ("executable".equals(codeString))
434          return EXECUTABLE;
435        if ("executed".equals(codeString))
436          return EXECUTED;
437        if ("negotiable".equals(codeString))
438          return NEGOTIABLE;
439        if ("offered".equals(codeString))
440          return OFFERED;
441        if ("policy".equals(codeString))
442          return POLICY;
443        if ("rejected".equals(codeString))
444          return REJECTED;
445        if ("renewed".equals(codeString))
446          return RENEWED;
447        if ("revoked".equals(codeString))
448          return REVOKED;
449        if ("resolved".equals(codeString))
450          return RESOLVED;
451        if ("terminated".equals(codeString))
452          return TERMINATED;
453        if (Configuration.isAcceptInvalidEnums())
454          return null;
455        else
456          throw new FHIRException("Unknown ContractPublicationStatus code '"+codeString+"'");
457        }
458        public String toCode() {
459          switch (this) {
460            case AMENDED: return "amended";
461            case APPENDED: return "appended";
462            case CANCELLED: return "cancelled";
463            case DISPUTED: return "disputed";
464            case ENTEREDINERROR: return "entered-in-error";
465            case EXECUTABLE: return "executable";
466            case EXECUTED: return "executed";
467            case NEGOTIABLE: return "negotiable";
468            case OFFERED: return "offered";
469            case POLICY: return "policy";
470            case REJECTED: return "rejected";
471            case RENEWED: return "renewed";
472            case REVOKED: return "revoked";
473            case RESOLVED: return "resolved";
474            case TERMINATED: return "terminated";
475            default: return "?";
476          }
477        }
478        public String getSystem() {
479          switch (this) {
480            case AMENDED: return "http://hl7.org/fhir/contract-publicationstatus";
481            case APPENDED: return "http://hl7.org/fhir/contract-publicationstatus";
482            case CANCELLED: return "http://hl7.org/fhir/contract-publicationstatus";
483            case DISPUTED: return "http://hl7.org/fhir/contract-publicationstatus";
484            case ENTEREDINERROR: return "http://hl7.org/fhir/contract-publicationstatus";
485            case EXECUTABLE: return "http://hl7.org/fhir/contract-publicationstatus";
486            case EXECUTED: return "http://hl7.org/fhir/contract-publicationstatus";
487            case NEGOTIABLE: return "http://hl7.org/fhir/contract-publicationstatus";
488            case OFFERED: return "http://hl7.org/fhir/contract-publicationstatus";
489            case POLICY: return "http://hl7.org/fhir/contract-publicationstatus";
490            case REJECTED: return "http://hl7.org/fhir/contract-publicationstatus";
491            case RENEWED: return "http://hl7.org/fhir/contract-publicationstatus";
492            case REVOKED: return "http://hl7.org/fhir/contract-publicationstatus";
493            case RESOLVED: return "http://hl7.org/fhir/contract-publicationstatus";
494            case TERMINATED: return "http://hl7.org/fhir/contract-publicationstatus";
495            default: return "?";
496          }
497        }
498        public String getDefinition() {
499          switch (this) {
500            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.";
501            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.";
502            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.";
503            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.";
504            case ENTEREDINERROR: return "Contract was created in error. No Precedence Order.  Status may be applied to a Contract with any status.";
505            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.";
506            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.";
507            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.";
508            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.";
509            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.";
510            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.";
511            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.";
512            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.";
513            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.";
514            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.";
515            default: return "?";
516          }
517        }
518        public String getDisplay() {
519          switch (this) {
520            case AMENDED: return "Amended";
521            case APPENDED: return "Appended";
522            case CANCELLED: return "Cancelled";
523            case DISPUTED: return "Disputed";
524            case ENTEREDINERROR: return "Entered in Error";
525            case EXECUTABLE: return "Executable";
526            case EXECUTED: return "Executed";
527            case NEGOTIABLE: return "Negotiable";
528            case OFFERED: return "Offered";
529            case POLICY: return "Policy";
530            case REJECTED: return "Rejected";
531            case RENEWED: return "Renewed";
532            case REVOKED: return "Revoked";
533            case RESOLVED: return "Resolved";
534            case TERMINATED: return "Terminated";
535            default: return "?";
536          }
537        }
538    }
539
540  public static class ContractPublicationStatusEnumFactory implements EnumFactory<ContractPublicationStatus> {
541    public ContractPublicationStatus fromCode(String codeString) throws IllegalArgumentException {
542      if (codeString == null || "".equals(codeString))
543            if (codeString == null || "".equals(codeString))
544                return null;
545        if ("amended".equals(codeString))
546          return ContractPublicationStatus.AMENDED;
547        if ("appended".equals(codeString))
548          return ContractPublicationStatus.APPENDED;
549        if ("cancelled".equals(codeString))
550          return ContractPublicationStatus.CANCELLED;
551        if ("disputed".equals(codeString))
552          return ContractPublicationStatus.DISPUTED;
553        if ("entered-in-error".equals(codeString))
554          return ContractPublicationStatus.ENTEREDINERROR;
555        if ("executable".equals(codeString))
556          return ContractPublicationStatus.EXECUTABLE;
557        if ("executed".equals(codeString))
558          return ContractPublicationStatus.EXECUTED;
559        if ("negotiable".equals(codeString))
560          return ContractPublicationStatus.NEGOTIABLE;
561        if ("offered".equals(codeString))
562          return ContractPublicationStatus.OFFERED;
563        if ("policy".equals(codeString))
564          return ContractPublicationStatus.POLICY;
565        if ("rejected".equals(codeString))
566          return ContractPublicationStatus.REJECTED;
567        if ("renewed".equals(codeString))
568          return ContractPublicationStatus.RENEWED;
569        if ("revoked".equals(codeString))
570          return ContractPublicationStatus.REVOKED;
571        if ("resolved".equals(codeString))
572          return ContractPublicationStatus.RESOLVED;
573        if ("terminated".equals(codeString))
574          return ContractPublicationStatus.TERMINATED;
575        throw new IllegalArgumentException("Unknown ContractPublicationStatus code '"+codeString+"'");
576        }
577        public Enumeration<ContractPublicationStatus> fromType(Base code) throws FHIRException {
578          if (code == null)
579            return null;
580          if (code.isEmpty())
581            return new Enumeration<ContractPublicationStatus>(this);
582          String codeString = ((PrimitiveType) code).asStringValue();
583          if (codeString == null || "".equals(codeString))
584            return null;
585        if ("amended".equals(codeString))
586          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.AMENDED);
587        if ("appended".equals(codeString))
588          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.APPENDED);
589        if ("cancelled".equals(codeString))
590          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.CANCELLED);
591        if ("disputed".equals(codeString))
592          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.DISPUTED);
593        if ("entered-in-error".equals(codeString))
594          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.ENTEREDINERROR);
595        if ("executable".equals(codeString))
596          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.EXECUTABLE);
597        if ("executed".equals(codeString))
598          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.EXECUTED);
599        if ("negotiable".equals(codeString))
600          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.NEGOTIABLE);
601        if ("offered".equals(codeString))
602          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.OFFERED);
603        if ("policy".equals(codeString))
604          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.POLICY);
605        if ("rejected".equals(codeString))
606          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.REJECTED);
607        if ("renewed".equals(codeString))
608          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.RENEWED);
609        if ("revoked".equals(codeString))
610          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.REVOKED);
611        if ("resolved".equals(codeString))
612          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.RESOLVED);
613        if ("terminated".equals(codeString))
614          return new Enumeration<ContractPublicationStatus>(this, ContractPublicationStatus.TERMINATED);
615        throw new FHIRException("Unknown ContractPublicationStatus code '"+codeString+"'");
616        }
617    public String toCode(ContractPublicationStatus code) {
618      if (code == ContractPublicationStatus.AMENDED)
619        return "amended";
620      if (code == ContractPublicationStatus.APPENDED)
621        return "appended";
622      if (code == ContractPublicationStatus.CANCELLED)
623        return "cancelled";
624      if (code == ContractPublicationStatus.DISPUTED)
625        return "disputed";
626      if (code == ContractPublicationStatus.ENTEREDINERROR)
627        return "entered-in-error";
628      if (code == ContractPublicationStatus.EXECUTABLE)
629        return "executable";
630      if (code == ContractPublicationStatus.EXECUTED)
631        return "executed";
632      if (code == ContractPublicationStatus.NEGOTIABLE)
633        return "negotiable";
634      if (code == ContractPublicationStatus.OFFERED)
635        return "offered";
636      if (code == ContractPublicationStatus.POLICY)
637        return "policy";
638      if (code == ContractPublicationStatus.REJECTED)
639        return "rejected";
640      if (code == ContractPublicationStatus.RENEWED)
641        return "renewed";
642      if (code == ContractPublicationStatus.REVOKED)
643        return "revoked";
644      if (code == ContractPublicationStatus.RESOLVED)
645        return "resolved";
646      if (code == ContractPublicationStatus.TERMINATED)
647        return "terminated";
648      return "?";
649      }
650    public String toSystem(ContractPublicationStatus code) {
651      return code.getSystem();
652      }
653    }
654
655    @Block()
656    public static class ContentDefinitionComponent extends BackboneElement implements IBaseBackboneElement {
657        /**
658         * 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.
659         */
660        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
661        @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." )
662        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-definition-type")
663        protected CodeableConcept type;
664
665        /**
666         * Detailed Precusory content type.
667         */
668        @Child(name = "subType", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
669        @Description(shortDefinition="Detailed Content Type Definition", formalDefinition="Detailed Precusory content type." )
670        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-definition-subtype")
671        protected CodeableConcept subType;
672
673        /**
674         * The  individual or organization that published the Contract precursor content.
675         */
676        @Child(name = "publisher", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=false)
677        @Description(shortDefinition="Publisher Entity", formalDefinition="The  individual or organization that published the Contract precursor content." )
678        protected Reference publisher;
679
680        /**
681         * The actual object that is the target of the reference (The  individual or organization that published the Contract precursor content.)
682         */
683        protected Resource publisherTarget;
684
685        /**
686         * 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.
687         */
688        @Child(name = "publicationDate", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false)
689        @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." )
690        protected DateTimeType publicationDate;
691
692        /**
693         * amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated.
694         */
695        @Child(name = "publicationStatus", type = {CodeType.class}, order=5, min=1, max=1, modifier=false, summary=false)
696        @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." )
697        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-publicationstatus")
698        protected Enumeration<ContractPublicationStatus> publicationStatus;
699
700        /**
701         * A copyright statement relating to Contract precursor content. Copyright statements are generally legal restrictions on the use and publishing of the Contract precursor content.
702         */
703        @Child(name = "copyright", type = {MarkdownType.class}, order=6, min=0, max=1, modifier=false, summary=false)
704        @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." )
705        protected MarkdownType copyright;
706
707        private static final long serialVersionUID = -699592864L;
708
709    /**
710     * Constructor
711     */
712      public ContentDefinitionComponent() {
713        super();
714      }
715
716    /**
717     * Constructor
718     */
719      public ContentDefinitionComponent(CodeableConcept type, Enumeration<ContractPublicationStatus> publicationStatus) {
720        super();
721        this.type = type;
722        this.publicationStatus = publicationStatus;
723      }
724
725        /**
726         * @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.)
727         */
728        public CodeableConcept getType() { 
729          if (this.type == null)
730            if (Configuration.errorOnAutoCreate())
731              throw new Error("Attempt to auto-create ContentDefinitionComponent.type");
732            else if (Configuration.doAutoCreate())
733              this.type = new CodeableConcept(); // cc
734          return this.type;
735        }
736
737        public boolean hasType() { 
738          return this.type != null && !this.type.isEmpty();
739        }
740
741        /**
742         * @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.)
743         */
744        public ContentDefinitionComponent setType(CodeableConcept value) { 
745          this.type = value;
746          return this;
747        }
748
749        /**
750         * @return {@link #subType} (Detailed Precusory content type.)
751         */
752        public CodeableConcept getSubType() { 
753          if (this.subType == null)
754            if (Configuration.errorOnAutoCreate())
755              throw new Error("Attempt to auto-create ContentDefinitionComponent.subType");
756            else if (Configuration.doAutoCreate())
757              this.subType = new CodeableConcept(); // cc
758          return this.subType;
759        }
760
761        public boolean hasSubType() { 
762          return this.subType != null && !this.subType.isEmpty();
763        }
764
765        /**
766         * @param value {@link #subType} (Detailed Precusory content type.)
767         */
768        public ContentDefinitionComponent setSubType(CodeableConcept value) { 
769          this.subType = value;
770          return this;
771        }
772
773        /**
774         * @return {@link #publisher} (The  individual or organization that published the Contract precursor content.)
775         */
776        public Reference getPublisher() { 
777          if (this.publisher == null)
778            if (Configuration.errorOnAutoCreate())
779              throw new Error("Attempt to auto-create ContentDefinitionComponent.publisher");
780            else if (Configuration.doAutoCreate())
781              this.publisher = new Reference(); // cc
782          return this.publisher;
783        }
784
785        public boolean hasPublisher() { 
786          return this.publisher != null && !this.publisher.isEmpty();
787        }
788
789        /**
790         * @param value {@link #publisher} (The  individual or organization that published the Contract precursor content.)
791         */
792        public ContentDefinitionComponent setPublisher(Reference value) { 
793          this.publisher = value;
794          return this;
795        }
796
797        /**
798         * @return {@link #publisher} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The  individual or organization that published the Contract precursor content.)
799         */
800        public Resource getPublisherTarget() { 
801          return this.publisherTarget;
802        }
803
804        /**
805         * @param value {@link #publisher} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The  individual or organization that published the Contract precursor content.)
806         */
807        public ContentDefinitionComponent setPublisherTarget(Resource value) { 
808          this.publisherTarget = value;
809          return this;
810        }
811
812        /**
813         * @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
814         */
815        public DateTimeType getPublicationDateElement() { 
816          if (this.publicationDate == null)
817            if (Configuration.errorOnAutoCreate())
818              throw new Error("Attempt to auto-create ContentDefinitionComponent.publicationDate");
819            else if (Configuration.doAutoCreate())
820              this.publicationDate = new DateTimeType(); // bb
821          return this.publicationDate;
822        }
823
824        public boolean hasPublicationDateElement() { 
825          return this.publicationDate != null && !this.publicationDate.isEmpty();
826        }
827
828        public boolean hasPublicationDate() { 
829          return this.publicationDate != null && !this.publicationDate.isEmpty();
830        }
831
832        /**
833         * @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
834         */
835        public ContentDefinitionComponent setPublicationDateElement(DateTimeType value) { 
836          this.publicationDate = value;
837          return this;
838        }
839
840        /**
841         * @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.
842         */
843        public Date getPublicationDate() { 
844          return this.publicationDate == null ? null : this.publicationDate.getValue();
845        }
846
847        /**
848         * @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.
849         */
850        public ContentDefinitionComponent setPublicationDate(Date value) { 
851          if (value == null)
852            this.publicationDate = null;
853          else {
854            if (this.publicationDate == null)
855              this.publicationDate = new DateTimeType();
856            this.publicationDate.setValue(value);
857          }
858          return this;
859        }
860
861        /**
862         * @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
863         */
864        public Enumeration<ContractPublicationStatus> getPublicationStatusElement() { 
865          if (this.publicationStatus == null)
866            if (Configuration.errorOnAutoCreate())
867              throw new Error("Attempt to auto-create ContentDefinitionComponent.publicationStatus");
868            else if (Configuration.doAutoCreate())
869              this.publicationStatus = new Enumeration<ContractPublicationStatus>(new ContractPublicationStatusEnumFactory()); // bb
870          return this.publicationStatus;
871        }
872
873        public boolean hasPublicationStatusElement() { 
874          return this.publicationStatus != null && !this.publicationStatus.isEmpty();
875        }
876
877        public boolean hasPublicationStatus() { 
878          return this.publicationStatus != null && !this.publicationStatus.isEmpty();
879        }
880
881        /**
882         * @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
883         */
884        public ContentDefinitionComponent setPublicationStatusElement(Enumeration<ContractPublicationStatus> value) { 
885          this.publicationStatus = value;
886          return this;
887        }
888
889        /**
890         * @return amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated.
891         */
892        public ContractPublicationStatus getPublicationStatus() { 
893          return this.publicationStatus == null ? null : this.publicationStatus.getValue();
894        }
895
896        /**
897         * @param value amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated.
898         */
899        public ContentDefinitionComponent setPublicationStatus(ContractPublicationStatus value) { 
900            if (this.publicationStatus == null)
901              this.publicationStatus = new Enumeration<ContractPublicationStatus>(new ContractPublicationStatusEnumFactory());
902            this.publicationStatus.setValue(value);
903          return this;
904        }
905
906        /**
907         * @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
908         */
909        public MarkdownType getCopyrightElement() { 
910          if (this.copyright == null)
911            if (Configuration.errorOnAutoCreate())
912              throw new Error("Attempt to auto-create ContentDefinitionComponent.copyright");
913            else if (Configuration.doAutoCreate())
914              this.copyright = new MarkdownType(); // bb
915          return this.copyright;
916        }
917
918        public boolean hasCopyrightElement() { 
919          return this.copyright != null && !this.copyright.isEmpty();
920        }
921
922        public boolean hasCopyright() { 
923          return this.copyright != null && !this.copyright.isEmpty();
924        }
925
926        /**
927         * @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
928         */
929        public ContentDefinitionComponent setCopyrightElement(MarkdownType value) { 
930          this.copyright = value;
931          return this;
932        }
933
934        /**
935         * @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.
936         */
937        public String getCopyright() { 
938          return this.copyright == null ? null : this.copyright.getValue();
939        }
940
941        /**
942         * @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.
943         */
944        public ContentDefinitionComponent setCopyright(String value) { 
945          if (value == null)
946            this.copyright = null;
947          else {
948            if (this.copyright == null)
949              this.copyright = new MarkdownType();
950            this.copyright.setValue(value);
951          }
952          return this;
953        }
954
955        protected void listChildren(List<Property> children) {
956          super.listChildren(children);
957          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));
958          children.add(new Property("subType", "CodeableConcept", "Detailed Precusory content type.", 0, 1, subType));
959          children.add(new Property("publisher", "Reference(Practitioner|PractitionerRole|Organization)", "The  individual or organization that published the Contract precursor content.", 0, 1, publisher));
960          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));
961          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));
962          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));
963        }
964
965        @Override
966        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
967          switch (_hash) {
968          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);
969          case -1868521062: /*subType*/  return new Property("subType", "CodeableConcept", "Detailed Precusory content type.", 0, 1, subType);
970          case 1447404028: /*publisher*/  return new Property("publisher", "Reference(Practitioner|PractitionerRole|Organization)", "The  individual or organization that published the Contract precursor content.", 0, 1, publisher);
971          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);
972          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);
973          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);
974          default: return super.getNamedProperty(_hash, _name, _checkValid);
975          }
976
977        }
978
979      @Override
980      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
981        switch (hash) {
982        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
983        case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : new Base[] {this.subType}; // CodeableConcept
984        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // Reference
985        case 1470566394: /*publicationDate*/ return this.publicationDate == null ? new Base[0] : new Base[] {this.publicationDate}; // DateTimeType
986        case 616500542: /*publicationStatus*/ return this.publicationStatus == null ? new Base[0] : new Base[] {this.publicationStatus}; // Enumeration<ContractPublicationStatus>
987        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
988        default: return super.getProperty(hash, name, checkValid);
989        }
990
991      }
992
993      @Override
994      public Base setProperty(int hash, String name, Base value) throws FHIRException {
995        switch (hash) {
996        case 3575610: // type
997          this.type = castToCodeableConcept(value); // CodeableConcept
998          return value;
999        case -1868521062: // subType
1000          this.subType = castToCodeableConcept(value); // CodeableConcept
1001          return value;
1002        case 1447404028: // publisher
1003          this.publisher = castToReference(value); // Reference
1004          return value;
1005        case 1470566394: // publicationDate
1006          this.publicationDate = castToDateTime(value); // DateTimeType
1007          return value;
1008        case 616500542: // publicationStatus
1009          value = new ContractPublicationStatusEnumFactory().fromType(castToCode(value));
1010          this.publicationStatus = (Enumeration) value; // Enumeration<ContractPublicationStatus>
1011          return value;
1012        case 1522889671: // copyright
1013          this.copyright = castToMarkdown(value); // MarkdownType
1014          return value;
1015        default: return super.setProperty(hash, name, value);
1016        }
1017
1018      }
1019
1020      @Override
1021      public Base setProperty(String name, Base value) throws FHIRException {
1022        if (name.equals("type")) {
1023          this.type = castToCodeableConcept(value); // CodeableConcept
1024        } else if (name.equals("subType")) {
1025          this.subType = castToCodeableConcept(value); // CodeableConcept
1026        } else if (name.equals("publisher")) {
1027          this.publisher = castToReference(value); // Reference
1028        } else if (name.equals("publicationDate")) {
1029          this.publicationDate = castToDateTime(value); // DateTimeType
1030        } else if (name.equals("publicationStatus")) {
1031          value = new ContractPublicationStatusEnumFactory().fromType(castToCode(value));
1032          this.publicationStatus = (Enumeration) value; // Enumeration<ContractPublicationStatus>
1033        } else if (name.equals("copyright")) {
1034          this.copyright = castToMarkdown(value); // MarkdownType
1035        } else
1036          return super.setProperty(name, value);
1037        return value;
1038      }
1039
1040      @Override
1041      public Base makeProperty(int hash, String name) throws FHIRException {
1042        switch (hash) {
1043        case 3575610:  return getType(); 
1044        case -1868521062:  return getSubType(); 
1045        case 1447404028:  return getPublisher(); 
1046        case 1470566394:  return getPublicationDateElement();
1047        case 616500542:  return getPublicationStatusElement();
1048        case 1522889671:  return getCopyrightElement();
1049        default: return super.makeProperty(hash, name);
1050        }
1051
1052      }
1053
1054      @Override
1055      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1056        switch (hash) {
1057        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1058        case -1868521062: /*subType*/ return new String[] {"CodeableConcept"};
1059        case 1447404028: /*publisher*/ return new String[] {"Reference"};
1060        case 1470566394: /*publicationDate*/ return new String[] {"dateTime"};
1061        case 616500542: /*publicationStatus*/ return new String[] {"code"};
1062        case 1522889671: /*copyright*/ return new String[] {"markdown"};
1063        default: return super.getTypesForProperty(hash, name);
1064        }
1065
1066      }
1067
1068      @Override
1069      public Base addChild(String name) throws FHIRException {
1070        if (name.equals("type")) {
1071          this.type = new CodeableConcept();
1072          return this.type;
1073        }
1074        else if (name.equals("subType")) {
1075          this.subType = new CodeableConcept();
1076          return this.subType;
1077        }
1078        else if (name.equals("publisher")) {
1079          this.publisher = new Reference();
1080          return this.publisher;
1081        }
1082        else if (name.equals("publicationDate")) {
1083          throw new FHIRException("Cannot call addChild on a primitive type Contract.publicationDate");
1084        }
1085        else if (name.equals("publicationStatus")) {
1086          throw new FHIRException("Cannot call addChild on a primitive type Contract.publicationStatus");
1087        }
1088        else if (name.equals("copyright")) {
1089          throw new FHIRException("Cannot call addChild on a primitive type Contract.copyright");
1090        }
1091        else
1092          return super.addChild(name);
1093      }
1094
1095      public ContentDefinitionComponent copy() {
1096        ContentDefinitionComponent dst = new ContentDefinitionComponent();
1097        copyValues(dst);
1098        return dst;
1099      }
1100
1101      public void copyValues(ContentDefinitionComponent dst) {
1102        super.copyValues(dst);
1103        dst.type = type == null ? null : type.copy();
1104        dst.subType = subType == null ? null : subType.copy();
1105        dst.publisher = publisher == null ? null : publisher.copy();
1106        dst.publicationDate = publicationDate == null ? null : publicationDate.copy();
1107        dst.publicationStatus = publicationStatus == null ? null : publicationStatus.copy();
1108        dst.copyright = copyright == null ? null : copyright.copy();
1109      }
1110
1111      @Override
1112      public boolean equalsDeep(Base other_) {
1113        if (!super.equalsDeep(other_))
1114          return false;
1115        if (!(other_ instanceof ContentDefinitionComponent))
1116          return false;
1117        ContentDefinitionComponent o = (ContentDefinitionComponent) other_;
1118        return compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) && compareDeep(publisher, o.publisher, true)
1119           && compareDeep(publicationDate, o.publicationDate, true) && compareDeep(publicationStatus, o.publicationStatus, true)
1120           && compareDeep(copyright, o.copyright, true);
1121      }
1122
1123      @Override
1124      public boolean equalsShallow(Base other_) {
1125        if (!super.equalsShallow(other_))
1126          return false;
1127        if (!(other_ instanceof ContentDefinitionComponent))
1128          return false;
1129        ContentDefinitionComponent o = (ContentDefinitionComponent) other_;
1130        return compareValues(publicationDate, o.publicationDate, true) && compareValues(publicationStatus, o.publicationStatus, true)
1131           && compareValues(copyright, o.copyright, true);
1132      }
1133
1134      public boolean isEmpty() {
1135        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, subType, publisher
1136          , publicationDate, publicationStatus, copyright);
1137      }
1138
1139  public String fhirType() {
1140    return "Contract.contentDefinition";
1141
1142  }
1143
1144  }
1145
1146    @Block()
1147    public static class TermComponent extends BackboneElement implements IBaseBackboneElement {
1148        /**
1149         * Unique identifier for this particular Contract Provision.
1150         */
1151        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true)
1152        @Description(shortDefinition="Contract Term Number", formalDefinition="Unique identifier for this particular Contract Provision." )
1153        protected Identifier identifier;
1154
1155        /**
1156         * When this Contract Provision was issued.
1157         */
1158        @Child(name = "issued", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1159        @Description(shortDefinition="Contract Term Issue Date Time", formalDefinition="When this Contract Provision was issued." )
1160        protected DateTimeType issued;
1161
1162        /**
1163         * Relevant time or time-period when this Contract Provision is applicable.
1164         */
1165        @Child(name = "applies", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true)
1166        @Description(shortDefinition="Contract Term Effective Time", formalDefinition="Relevant time or time-period when this Contract Provision is applicable." )
1167        protected Period applies;
1168
1169        /**
1170         * The entity that the term applies to.
1171         */
1172        @Child(name = "topic", type = {CodeableConcept.class, Reference.class}, order=4, min=0, max=1, modifier=false, summary=false)
1173        @Description(shortDefinition="Term Concern", formalDefinition="The entity that the term applies to." )
1174        protected Type topic;
1175
1176        /**
1177         * 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.
1178         */
1179        @Child(name = "type", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false)
1180        @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." )
1181        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-term-type")
1182        protected CodeableConcept type;
1183
1184        /**
1185         * A specialized legal clause or condition based on overarching contract type.
1186         */
1187        @Child(name = "subType", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false)
1188        @Description(shortDefinition="Contract Term Type specific classification", formalDefinition="A specialized legal clause or condition based on overarching contract type." )
1189        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-term-subtype")
1190        protected CodeableConcept subType;
1191
1192        /**
1193         * Statement of a provision in a policy or a contract.
1194         */
1195        @Child(name = "text", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true)
1196        @Description(shortDefinition="Term Statement", formalDefinition="Statement of a provision in a policy or a contract." )
1197        protected StringType text;
1198
1199        /**
1200         * Security labels that protect the handling of information about the term and its elements, which may be specifically identified..
1201         */
1202        @Child(name = "securityLabel", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1203        @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.." )
1204        protected List<SecurityLabelComponent> securityLabel;
1205
1206        /**
1207         * The matter of concern in the context of this provision of the agrement.
1208         */
1209        @Child(name = "offer", type = {}, order=9, min=1, max=1, modifier=false, summary=false)
1210        @Description(shortDefinition="Context of the Contract term", formalDefinition="The matter of concern in the context of this provision of the agrement." )
1211        protected ContractOfferComponent offer;
1212
1213        /**
1214         * Contract Term Asset List.
1215         */
1216        @Child(name = "asset", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1217        @Description(shortDefinition="Contract Term Asset List", formalDefinition="Contract Term Asset List." )
1218        protected List<ContractAssetComponent> asset;
1219
1220        /**
1221         * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.
1222         */
1223        @Child(name = "action", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1224        @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." )
1225        protected List<ActionComponent> action;
1226
1227        /**
1228         * Nested group of Contract Provisions.
1229         */
1230        @Child(name = "group", type = {TermComponent.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1231        @Description(shortDefinition="Nested Contract Term Group", formalDefinition="Nested group of Contract Provisions." )
1232        protected List<TermComponent> group;
1233
1234        private static final long serialVersionUID = -460907186L;
1235
1236    /**
1237     * Constructor
1238     */
1239      public TermComponent() {
1240        super();
1241      }
1242
1243    /**
1244     * Constructor
1245     */
1246      public TermComponent(ContractOfferComponent offer) {
1247        super();
1248        this.offer = offer;
1249      }
1250
1251        /**
1252         * @return {@link #identifier} (Unique identifier for this particular Contract Provision.)
1253         */
1254        public Identifier getIdentifier() { 
1255          if (this.identifier == null)
1256            if (Configuration.errorOnAutoCreate())
1257              throw new Error("Attempt to auto-create TermComponent.identifier");
1258            else if (Configuration.doAutoCreate())
1259              this.identifier = new Identifier(); // cc
1260          return this.identifier;
1261        }
1262
1263        public boolean hasIdentifier() { 
1264          return this.identifier != null && !this.identifier.isEmpty();
1265        }
1266
1267        /**
1268         * @param value {@link #identifier} (Unique identifier for this particular Contract Provision.)
1269         */
1270        public TermComponent setIdentifier(Identifier value) { 
1271          this.identifier = value;
1272          return this;
1273        }
1274
1275        /**
1276         * @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
1277         */
1278        public DateTimeType getIssuedElement() { 
1279          if (this.issued == null)
1280            if (Configuration.errorOnAutoCreate())
1281              throw new Error("Attempt to auto-create TermComponent.issued");
1282            else if (Configuration.doAutoCreate())
1283              this.issued = new DateTimeType(); // bb
1284          return this.issued;
1285        }
1286
1287        public boolean hasIssuedElement() { 
1288          return this.issued != null && !this.issued.isEmpty();
1289        }
1290
1291        public boolean hasIssued() { 
1292          return this.issued != null && !this.issued.isEmpty();
1293        }
1294
1295        /**
1296         * @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
1297         */
1298        public TermComponent setIssuedElement(DateTimeType value) { 
1299          this.issued = value;
1300          return this;
1301        }
1302
1303        /**
1304         * @return When this Contract Provision was issued.
1305         */
1306        public Date getIssued() { 
1307          return this.issued == null ? null : this.issued.getValue();
1308        }
1309
1310        /**
1311         * @param value When this Contract Provision was issued.
1312         */
1313        public TermComponent setIssued(Date value) { 
1314          if (value == null)
1315            this.issued = null;
1316          else {
1317            if (this.issued == null)
1318              this.issued = new DateTimeType();
1319            this.issued.setValue(value);
1320          }
1321          return this;
1322        }
1323
1324        /**
1325         * @return {@link #applies} (Relevant time or time-period when this Contract Provision is applicable.)
1326         */
1327        public Period getApplies() { 
1328          if (this.applies == null)
1329            if (Configuration.errorOnAutoCreate())
1330              throw new Error("Attempt to auto-create TermComponent.applies");
1331            else if (Configuration.doAutoCreate())
1332              this.applies = new Period(); // cc
1333          return this.applies;
1334        }
1335
1336        public boolean hasApplies() { 
1337          return this.applies != null && !this.applies.isEmpty();
1338        }
1339
1340        /**
1341         * @param value {@link #applies} (Relevant time or time-period when this Contract Provision is applicable.)
1342         */
1343        public TermComponent setApplies(Period value) { 
1344          this.applies = value;
1345          return this;
1346        }
1347
1348        /**
1349         * @return {@link #topic} (The entity that the term applies to.)
1350         */
1351        public Type getTopic() { 
1352          return this.topic;
1353        }
1354
1355        /**
1356         * @return {@link #topic} (The entity that the term applies to.)
1357         */
1358        public CodeableConcept getTopicCodeableConcept() throws FHIRException { 
1359          if (this.topic == null)
1360            this.topic = new CodeableConcept();
1361          if (!(this.topic instanceof CodeableConcept))
1362            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.topic.getClass().getName()+" was encountered");
1363          return (CodeableConcept) this.topic;
1364        }
1365
1366        public boolean hasTopicCodeableConcept() { 
1367          return this != null && this.topic instanceof CodeableConcept;
1368        }
1369
1370        /**
1371         * @return {@link #topic} (The entity that the term applies to.)
1372         */
1373        public Reference getTopicReference() throws FHIRException { 
1374          if (this.topic == null)
1375            this.topic = new Reference();
1376          if (!(this.topic instanceof Reference))
1377            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.topic.getClass().getName()+" was encountered");
1378          return (Reference) this.topic;
1379        }
1380
1381        public boolean hasTopicReference() { 
1382          return this != null && this.topic instanceof Reference;
1383        }
1384
1385        public boolean hasTopic() { 
1386          return this.topic != null && !this.topic.isEmpty();
1387        }
1388
1389        /**
1390         * @param value {@link #topic} (The entity that the term applies to.)
1391         */
1392        public TermComponent setTopic(Type value) { 
1393          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
1394            throw new Error("Not the right type for Contract.term.topic[x]: "+value.fhirType());
1395          this.topic = value;
1396          return this;
1397        }
1398
1399        /**
1400         * @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.)
1401         */
1402        public CodeableConcept getType() { 
1403          if (this.type == null)
1404            if (Configuration.errorOnAutoCreate())
1405              throw new Error("Attempt to auto-create TermComponent.type");
1406            else if (Configuration.doAutoCreate())
1407              this.type = new CodeableConcept(); // cc
1408          return this.type;
1409        }
1410
1411        public boolean hasType() { 
1412          return this.type != null && !this.type.isEmpty();
1413        }
1414
1415        /**
1416         * @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.)
1417         */
1418        public TermComponent setType(CodeableConcept value) { 
1419          this.type = value;
1420          return this;
1421        }
1422
1423        /**
1424         * @return {@link #subType} (A specialized legal clause or condition based on overarching contract type.)
1425         */
1426        public CodeableConcept getSubType() { 
1427          if (this.subType == null)
1428            if (Configuration.errorOnAutoCreate())
1429              throw new Error("Attempt to auto-create TermComponent.subType");
1430            else if (Configuration.doAutoCreate())
1431              this.subType = new CodeableConcept(); // cc
1432          return this.subType;
1433        }
1434
1435        public boolean hasSubType() { 
1436          return this.subType != null && !this.subType.isEmpty();
1437        }
1438
1439        /**
1440         * @param value {@link #subType} (A specialized legal clause or condition based on overarching contract type.)
1441         */
1442        public TermComponent setSubType(CodeableConcept value) { 
1443          this.subType = value;
1444          return this;
1445        }
1446
1447        /**
1448         * @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
1449         */
1450        public StringType getTextElement() { 
1451          if (this.text == null)
1452            if (Configuration.errorOnAutoCreate())
1453              throw new Error("Attempt to auto-create TermComponent.text");
1454            else if (Configuration.doAutoCreate())
1455              this.text = new StringType(); // bb
1456          return this.text;
1457        }
1458
1459        public boolean hasTextElement() { 
1460          return this.text != null && !this.text.isEmpty();
1461        }
1462
1463        public boolean hasText() { 
1464          return this.text != null && !this.text.isEmpty();
1465        }
1466
1467        /**
1468         * @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
1469         */
1470        public TermComponent setTextElement(StringType value) { 
1471          this.text = value;
1472          return this;
1473        }
1474
1475        /**
1476         * @return Statement of a provision in a policy or a contract.
1477         */
1478        public String getText() { 
1479          return this.text == null ? null : this.text.getValue();
1480        }
1481
1482        /**
1483         * @param value Statement of a provision in a policy or a contract.
1484         */
1485        public TermComponent setText(String value) { 
1486          if (Utilities.noString(value))
1487            this.text = null;
1488          else {
1489            if (this.text == null)
1490              this.text = new StringType();
1491            this.text.setValue(value);
1492          }
1493          return this;
1494        }
1495
1496        /**
1497         * @return {@link #securityLabel} (Security labels that protect the handling of information about the term and its elements, which may be specifically identified..)
1498         */
1499        public List<SecurityLabelComponent> getSecurityLabel() { 
1500          if (this.securityLabel == null)
1501            this.securityLabel = new ArrayList<SecurityLabelComponent>();
1502          return this.securityLabel;
1503        }
1504
1505        /**
1506         * @return Returns a reference to <code>this</code> for easy method chaining
1507         */
1508        public TermComponent setSecurityLabel(List<SecurityLabelComponent> theSecurityLabel) { 
1509          this.securityLabel = theSecurityLabel;
1510          return this;
1511        }
1512
1513        public boolean hasSecurityLabel() { 
1514          if (this.securityLabel == null)
1515            return false;
1516          for (SecurityLabelComponent item : this.securityLabel)
1517            if (!item.isEmpty())
1518              return true;
1519          return false;
1520        }
1521
1522        public SecurityLabelComponent addSecurityLabel() { //3
1523          SecurityLabelComponent t = new SecurityLabelComponent();
1524          if (this.securityLabel == null)
1525            this.securityLabel = new ArrayList<SecurityLabelComponent>();
1526          this.securityLabel.add(t);
1527          return t;
1528        }
1529
1530        public TermComponent addSecurityLabel(SecurityLabelComponent t) { //3
1531          if (t == null)
1532            return this;
1533          if (this.securityLabel == null)
1534            this.securityLabel = new ArrayList<SecurityLabelComponent>();
1535          this.securityLabel.add(t);
1536          return this;
1537        }
1538
1539        /**
1540         * @return The first repetition of repeating field {@link #securityLabel}, creating it if it does not already exist
1541         */
1542        public SecurityLabelComponent getSecurityLabelFirstRep() { 
1543          if (getSecurityLabel().isEmpty()) {
1544            addSecurityLabel();
1545          }
1546          return getSecurityLabel().get(0);
1547        }
1548
1549        /**
1550         * @return {@link #offer} (The matter of concern in the context of this provision of the agrement.)
1551         */
1552        public ContractOfferComponent getOffer() { 
1553          if (this.offer == null)
1554            if (Configuration.errorOnAutoCreate())
1555              throw new Error("Attempt to auto-create TermComponent.offer");
1556            else if (Configuration.doAutoCreate())
1557              this.offer = new ContractOfferComponent(); // cc
1558          return this.offer;
1559        }
1560
1561        public boolean hasOffer() { 
1562          return this.offer != null && !this.offer.isEmpty();
1563        }
1564
1565        /**
1566         * @param value {@link #offer} (The matter of concern in the context of this provision of the agrement.)
1567         */
1568        public TermComponent setOffer(ContractOfferComponent value) { 
1569          this.offer = value;
1570          return this;
1571        }
1572
1573        /**
1574         * @return {@link #asset} (Contract Term Asset List.)
1575         */
1576        public List<ContractAssetComponent> getAsset() { 
1577          if (this.asset == null)
1578            this.asset = new ArrayList<ContractAssetComponent>();
1579          return this.asset;
1580        }
1581
1582        /**
1583         * @return Returns a reference to <code>this</code> for easy method chaining
1584         */
1585        public TermComponent setAsset(List<ContractAssetComponent> theAsset) { 
1586          this.asset = theAsset;
1587          return this;
1588        }
1589
1590        public boolean hasAsset() { 
1591          if (this.asset == null)
1592            return false;
1593          for (ContractAssetComponent item : this.asset)
1594            if (!item.isEmpty())
1595              return true;
1596          return false;
1597        }
1598
1599        public ContractAssetComponent addAsset() { //3
1600          ContractAssetComponent t = new ContractAssetComponent();
1601          if (this.asset == null)
1602            this.asset = new ArrayList<ContractAssetComponent>();
1603          this.asset.add(t);
1604          return t;
1605        }
1606
1607        public TermComponent addAsset(ContractAssetComponent t) { //3
1608          if (t == null)
1609            return this;
1610          if (this.asset == null)
1611            this.asset = new ArrayList<ContractAssetComponent>();
1612          this.asset.add(t);
1613          return this;
1614        }
1615
1616        /**
1617         * @return The first repetition of repeating field {@link #asset}, creating it if it does not already exist
1618         */
1619        public ContractAssetComponent getAssetFirstRep() { 
1620          if (getAsset().isEmpty()) {
1621            addAsset();
1622          }
1623          return getAsset().get(0);
1624        }
1625
1626        /**
1627         * @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.)
1628         */
1629        public List<ActionComponent> getAction() { 
1630          if (this.action == null)
1631            this.action = new ArrayList<ActionComponent>();
1632          return this.action;
1633        }
1634
1635        /**
1636         * @return Returns a reference to <code>this</code> for easy method chaining
1637         */
1638        public TermComponent setAction(List<ActionComponent> theAction) { 
1639          this.action = theAction;
1640          return this;
1641        }
1642
1643        public boolean hasAction() { 
1644          if (this.action == null)
1645            return false;
1646          for (ActionComponent item : this.action)
1647            if (!item.isEmpty())
1648              return true;
1649          return false;
1650        }
1651
1652        public ActionComponent addAction() { //3
1653          ActionComponent t = new ActionComponent();
1654          if (this.action == null)
1655            this.action = new ArrayList<ActionComponent>();
1656          this.action.add(t);
1657          return t;
1658        }
1659
1660        public TermComponent addAction(ActionComponent t) { //3
1661          if (t == null)
1662            return this;
1663          if (this.action == null)
1664            this.action = new ArrayList<ActionComponent>();
1665          this.action.add(t);
1666          return this;
1667        }
1668
1669        /**
1670         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist
1671         */
1672        public ActionComponent getActionFirstRep() { 
1673          if (getAction().isEmpty()) {
1674            addAction();
1675          }
1676          return getAction().get(0);
1677        }
1678
1679        /**
1680         * @return {@link #group} (Nested group of Contract Provisions.)
1681         */
1682        public List<TermComponent> getGroup() { 
1683          if (this.group == null)
1684            this.group = new ArrayList<TermComponent>();
1685          return this.group;
1686        }
1687
1688        /**
1689         * @return Returns a reference to <code>this</code> for easy method chaining
1690         */
1691        public TermComponent setGroup(List<TermComponent> theGroup) { 
1692          this.group = theGroup;
1693          return this;
1694        }
1695
1696        public boolean hasGroup() { 
1697          if (this.group == null)
1698            return false;
1699          for (TermComponent item : this.group)
1700            if (!item.isEmpty())
1701              return true;
1702          return false;
1703        }
1704
1705        public TermComponent addGroup() { //3
1706          TermComponent t = new TermComponent();
1707          if (this.group == null)
1708            this.group = new ArrayList<TermComponent>();
1709          this.group.add(t);
1710          return t;
1711        }
1712
1713        public TermComponent addGroup(TermComponent t) { //3
1714          if (t == null)
1715            return this;
1716          if (this.group == null)
1717            this.group = new ArrayList<TermComponent>();
1718          this.group.add(t);
1719          return this;
1720        }
1721
1722        /**
1723         * @return The first repetition of repeating field {@link #group}, creating it if it does not already exist
1724         */
1725        public TermComponent getGroupFirstRep() { 
1726          if (getGroup().isEmpty()) {
1727            addGroup();
1728          }
1729          return getGroup().get(0);
1730        }
1731
1732        protected void listChildren(List<Property> children) {
1733          super.listChildren(children);
1734          children.add(new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, 1, identifier));
1735          children.add(new Property("issued", "dateTime", "When this Contract Provision was issued.", 0, 1, issued));
1736          children.add(new Property("applies", "Period", "Relevant time or time-period when this Contract Provision is applicable.", 0, 1, applies));
1737          children.add(new Property("topic[x]", "CodeableConcept|Reference(Any)", "The entity that the term applies to.", 0, 1, topic));
1738          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));
1739          children.add(new Property("subType", "CodeableConcept", "A specialized legal clause or condition based on overarching contract type.", 0, 1, subType));
1740          children.add(new Property("text", "string", "Statement of a provision in a policy or a contract.", 0, 1, text));
1741          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));
1742          children.add(new Property("offer", "", "The matter of concern in the context of this provision of the agrement.", 0, 1, offer));
1743          children.add(new Property("asset", "", "Contract Term Asset List.", 0, java.lang.Integer.MAX_VALUE, asset));
1744          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));
1745          children.add(new Property("group", "@Contract.term", "Nested group of Contract Provisions.", 0, java.lang.Integer.MAX_VALUE, group));
1746        }
1747
1748        @Override
1749        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1750          switch (_hash) {
1751          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, 1, identifier);
1752          case -1179159893: /*issued*/  return new Property("issued", "dateTime", "When this Contract Provision was issued.", 0, 1, issued);
1753          case -793235316: /*applies*/  return new Property("applies", "Period", "Relevant time or time-period when this Contract Provision is applicable.", 0, 1, applies);
1754          case -957295375: /*topic[x]*/  return new Property("topic[x]", "CodeableConcept|Reference(Any)", "The entity that the term applies to.", 0, 1, topic);
1755          case 110546223: /*topic*/  return new Property("topic[x]", "CodeableConcept|Reference(Any)", "The entity that the term applies to.", 0, 1, topic);
1756          case 777778802: /*topicCodeableConcept*/  return new Property("topic[x]", "CodeableConcept|Reference(Any)", "The entity that the term applies to.", 0, 1, topic);
1757          case -343345444: /*topicReference*/  return new Property("topic[x]", "CodeableConcept|Reference(Any)", "The entity that the term applies to.", 0, 1, topic);
1758          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);
1759          case -1868521062: /*subType*/  return new Property("subType", "CodeableConcept", "A specialized legal clause or condition based on overarching contract type.", 0, 1, subType);
1760          case 3556653: /*text*/  return new Property("text", "string", "Statement of a provision in a policy or a contract.", 0, 1, text);
1761          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);
1762          case 105650780: /*offer*/  return new Property("offer", "", "The matter of concern in the context of this provision of the agrement.", 0, 1, offer);
1763          case 93121264: /*asset*/  return new Property("asset", "", "Contract Term Asset List.", 0, java.lang.Integer.MAX_VALUE, asset);
1764          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);
1765          case 98629247: /*group*/  return new Property("group", "@Contract.term", "Nested group of Contract Provisions.", 0, java.lang.Integer.MAX_VALUE, group);
1766          default: return super.getNamedProperty(_hash, _name, _checkValid);
1767          }
1768
1769        }
1770
1771      @Override
1772      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1773        switch (hash) {
1774        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
1775        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType
1776        case -793235316: /*applies*/ return this.applies == null ? new Base[0] : new Base[] {this.applies}; // Period
1777        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : new Base[] {this.topic}; // Type
1778        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1779        case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : new Base[] {this.subType}; // CodeableConcept
1780        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
1781        case -722296940: /*securityLabel*/ return this.securityLabel == null ? new Base[0] : this.securityLabel.toArray(new Base[this.securityLabel.size()]); // SecurityLabelComponent
1782        case 105650780: /*offer*/ return this.offer == null ? new Base[0] : new Base[] {this.offer}; // ContractOfferComponent
1783        case 93121264: /*asset*/ return this.asset == null ? new Base[0] : this.asset.toArray(new Base[this.asset.size()]); // ContractAssetComponent
1784        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // ActionComponent
1785        case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // TermComponent
1786        default: return super.getProperty(hash, name, checkValid);
1787        }
1788
1789      }
1790
1791      @Override
1792      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1793        switch (hash) {
1794        case -1618432855: // identifier
1795          this.identifier = castToIdentifier(value); // Identifier
1796          return value;
1797        case -1179159893: // issued
1798          this.issued = castToDateTime(value); // DateTimeType
1799          return value;
1800        case -793235316: // applies
1801          this.applies = castToPeriod(value); // Period
1802          return value;
1803        case 110546223: // topic
1804          this.topic = castToType(value); // Type
1805          return value;
1806        case 3575610: // type
1807          this.type = castToCodeableConcept(value); // CodeableConcept
1808          return value;
1809        case -1868521062: // subType
1810          this.subType = castToCodeableConcept(value); // CodeableConcept
1811          return value;
1812        case 3556653: // text
1813          this.text = castToString(value); // StringType
1814          return value;
1815        case -722296940: // securityLabel
1816          this.getSecurityLabel().add((SecurityLabelComponent) value); // SecurityLabelComponent
1817          return value;
1818        case 105650780: // offer
1819          this.offer = (ContractOfferComponent) value; // ContractOfferComponent
1820          return value;
1821        case 93121264: // asset
1822          this.getAsset().add((ContractAssetComponent) value); // ContractAssetComponent
1823          return value;
1824        case -1422950858: // action
1825          this.getAction().add((ActionComponent) value); // ActionComponent
1826          return value;
1827        case 98629247: // group
1828          this.getGroup().add((TermComponent) value); // TermComponent
1829          return value;
1830        default: return super.setProperty(hash, name, value);
1831        }
1832
1833      }
1834
1835      @Override
1836      public Base setProperty(String name, Base value) throws FHIRException {
1837        if (name.equals("identifier")) {
1838          this.identifier = castToIdentifier(value); // Identifier
1839        } else if (name.equals("issued")) {
1840          this.issued = castToDateTime(value); // DateTimeType
1841        } else if (name.equals("applies")) {
1842          this.applies = castToPeriod(value); // Period
1843        } else if (name.equals("topic[x]")) {
1844          this.topic = castToType(value); // Type
1845        } else if (name.equals("type")) {
1846          this.type = castToCodeableConcept(value); // CodeableConcept
1847        } else if (name.equals("subType")) {
1848          this.subType = castToCodeableConcept(value); // CodeableConcept
1849        } else if (name.equals("text")) {
1850          this.text = castToString(value); // StringType
1851        } else if (name.equals("securityLabel")) {
1852          this.getSecurityLabel().add((SecurityLabelComponent) value);
1853        } else if (name.equals("offer")) {
1854          this.offer = (ContractOfferComponent) value; // ContractOfferComponent
1855        } else if (name.equals("asset")) {
1856          this.getAsset().add((ContractAssetComponent) value);
1857        } else if (name.equals("action")) {
1858          this.getAction().add((ActionComponent) value);
1859        } else if (name.equals("group")) {
1860          this.getGroup().add((TermComponent) value);
1861        } else
1862          return super.setProperty(name, value);
1863        return value;
1864      }
1865
1866      @Override
1867      public Base makeProperty(int hash, String name) throws FHIRException {
1868        switch (hash) {
1869        case -1618432855:  return getIdentifier(); 
1870        case -1179159893:  return getIssuedElement();
1871        case -793235316:  return getApplies(); 
1872        case -957295375:  return getTopic(); 
1873        case 110546223:  return getTopic(); 
1874        case 3575610:  return getType(); 
1875        case -1868521062:  return getSubType(); 
1876        case 3556653:  return getTextElement();
1877        case -722296940:  return addSecurityLabel(); 
1878        case 105650780:  return getOffer(); 
1879        case 93121264:  return addAsset(); 
1880        case -1422950858:  return addAction(); 
1881        case 98629247:  return addGroup(); 
1882        default: return super.makeProperty(hash, name);
1883        }
1884
1885      }
1886
1887      @Override
1888      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1889        switch (hash) {
1890        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1891        case -1179159893: /*issued*/ return new String[] {"dateTime"};
1892        case -793235316: /*applies*/ return new String[] {"Period"};
1893        case 110546223: /*topic*/ return new String[] {"CodeableConcept", "Reference"};
1894        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1895        case -1868521062: /*subType*/ return new String[] {"CodeableConcept"};
1896        case 3556653: /*text*/ return new String[] {"string"};
1897        case -722296940: /*securityLabel*/ return new String[] {};
1898        case 105650780: /*offer*/ return new String[] {};
1899        case 93121264: /*asset*/ return new String[] {};
1900        case -1422950858: /*action*/ return new String[] {};
1901        case 98629247: /*group*/ return new String[] {"@Contract.term"};
1902        default: return super.getTypesForProperty(hash, name);
1903        }
1904
1905      }
1906
1907      @Override
1908      public Base addChild(String name) throws FHIRException {
1909        if (name.equals("identifier")) {
1910          this.identifier = new Identifier();
1911          return this.identifier;
1912        }
1913        else if (name.equals("issued")) {
1914          throw new FHIRException("Cannot call addChild on a primitive type Contract.issued");
1915        }
1916        else if (name.equals("applies")) {
1917          this.applies = new Period();
1918          return this.applies;
1919        }
1920        else if (name.equals("topicCodeableConcept")) {
1921          this.topic = new CodeableConcept();
1922          return this.topic;
1923        }
1924        else if (name.equals("topicReference")) {
1925          this.topic = new Reference();
1926          return this.topic;
1927        }
1928        else if (name.equals("type")) {
1929          this.type = new CodeableConcept();
1930          return this.type;
1931        }
1932        else if (name.equals("subType")) {
1933          this.subType = new CodeableConcept();
1934          return this.subType;
1935        }
1936        else if (name.equals("text")) {
1937          throw new FHIRException("Cannot call addChild on a primitive type Contract.text");
1938        }
1939        else if (name.equals("securityLabel")) {
1940          return addSecurityLabel();
1941        }
1942        else if (name.equals("offer")) {
1943          this.offer = new ContractOfferComponent();
1944          return this.offer;
1945        }
1946        else if (name.equals("asset")) {
1947          return addAsset();
1948        }
1949        else if (name.equals("action")) {
1950          return addAction();
1951        }
1952        else if (name.equals("group")) {
1953          return addGroup();
1954        }
1955        else
1956          return super.addChild(name);
1957      }
1958
1959      public TermComponent copy() {
1960        TermComponent dst = new TermComponent();
1961        copyValues(dst);
1962        return dst;
1963      }
1964
1965      public void copyValues(TermComponent dst) {
1966        super.copyValues(dst);
1967        dst.identifier = identifier == null ? null : identifier.copy();
1968        dst.issued = issued == null ? null : issued.copy();
1969        dst.applies = applies == null ? null : applies.copy();
1970        dst.topic = topic == null ? null : topic.copy();
1971        dst.type = type == null ? null : type.copy();
1972        dst.subType = subType == null ? null : subType.copy();
1973        dst.text = text == null ? null : text.copy();
1974        if (securityLabel != null) {
1975          dst.securityLabel = new ArrayList<SecurityLabelComponent>();
1976          for (SecurityLabelComponent i : securityLabel)
1977            dst.securityLabel.add(i.copy());
1978        };
1979        dst.offer = offer == null ? null : offer.copy();
1980        if (asset != null) {
1981          dst.asset = new ArrayList<ContractAssetComponent>();
1982          for (ContractAssetComponent i : asset)
1983            dst.asset.add(i.copy());
1984        };
1985        if (action != null) {
1986          dst.action = new ArrayList<ActionComponent>();
1987          for (ActionComponent i : action)
1988            dst.action.add(i.copy());
1989        };
1990        if (group != null) {
1991          dst.group = new ArrayList<TermComponent>();
1992          for (TermComponent i : group)
1993            dst.group.add(i.copy());
1994        };
1995      }
1996
1997      @Override
1998      public boolean equalsDeep(Base other_) {
1999        if (!super.equalsDeep(other_))
2000          return false;
2001        if (!(other_ instanceof TermComponent))
2002          return false;
2003        TermComponent o = (TermComponent) other_;
2004        return compareDeep(identifier, o.identifier, true) && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true)
2005           && compareDeep(topic, o.topic, true) && compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true)
2006           && compareDeep(text, o.text, true) && compareDeep(securityLabel, o.securityLabel, true) && compareDeep(offer, o.offer, true)
2007           && compareDeep(asset, o.asset, true) && compareDeep(action, o.action, true) && compareDeep(group, o.group, true)
2008          ;
2009      }
2010
2011      @Override
2012      public boolean equalsShallow(Base other_) {
2013        if (!super.equalsShallow(other_))
2014          return false;
2015        if (!(other_ instanceof TermComponent))
2016          return false;
2017        TermComponent o = (TermComponent) other_;
2018        return compareValues(issued, o.issued, true) && compareValues(text, o.text, true);
2019      }
2020
2021      public boolean isEmpty() {
2022        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, issued, applies
2023          , topic, type, subType, text, securityLabel, offer, asset, action, group);
2024      }
2025
2026  public String fhirType() {
2027    return "Contract.term";
2028
2029  }
2030
2031  }
2032
2033    @Block()
2034    public static class SecurityLabelComponent extends BackboneElement implements IBaseBackboneElement {
2035        /**
2036         * Number used to link this term or term element to the applicable Security Label.
2037         */
2038        @Child(name = "number", type = {UnsignedIntType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2039        @Description(shortDefinition="Link to Security Labels", formalDefinition="Number used to link this term or term element to the applicable Security Label." )
2040        protected List<UnsignedIntType> number;
2041
2042        /**
2043         * Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements.
2044         */
2045        @Child(name = "classification", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false)
2046        @Description(shortDefinition="Confidentiality Protection", formalDefinition="Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements." )
2047        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-security-classification")
2048        protected Coding classification;
2049
2050        /**
2051         * Security label privacy tag that species the applicable privacy and security policies governing this term and/or term elements.
2052         */
2053        @Child(name = "category", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2054        @Description(shortDefinition="Applicable Policy", formalDefinition="Security label privacy tag that species the applicable privacy and security policies governing this term and/or term elements." )
2055        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-security-category")
2056        protected List<Coding> category;
2057
2058        /**
2059         * Security label privacy tag that species the manner in which term and/or term elements are to be protected.
2060         */
2061        @Child(name = "control", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2062        @Description(shortDefinition="Handling Instructions", formalDefinition="Security label privacy tag that species the manner in which term and/or term elements are to be protected." )
2063        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-security-control")
2064        protected List<Coding> control;
2065
2066        private static final long serialVersionUID = 788281758L;
2067
2068    /**
2069     * Constructor
2070     */
2071      public SecurityLabelComponent() {
2072        super();
2073      }
2074
2075    /**
2076     * Constructor
2077     */
2078      public SecurityLabelComponent(Coding classification) {
2079        super();
2080        this.classification = classification;
2081      }
2082
2083        /**
2084         * @return {@link #number} (Number used to link this term or term element to the applicable Security Label.)
2085         */
2086        public List<UnsignedIntType> getNumber() { 
2087          if (this.number == null)
2088            this.number = new ArrayList<UnsignedIntType>();
2089          return this.number;
2090        }
2091
2092        /**
2093         * @return Returns a reference to <code>this</code> for easy method chaining
2094         */
2095        public SecurityLabelComponent setNumber(List<UnsignedIntType> theNumber) { 
2096          this.number = theNumber;
2097          return this;
2098        }
2099
2100        public boolean hasNumber() { 
2101          if (this.number == null)
2102            return false;
2103          for (UnsignedIntType item : this.number)
2104            if (!item.isEmpty())
2105              return true;
2106          return false;
2107        }
2108
2109        /**
2110         * @return {@link #number} (Number used to link this term or term element to the applicable Security Label.)
2111         */
2112        public UnsignedIntType addNumberElement() {//2 
2113          UnsignedIntType t = new UnsignedIntType();
2114          if (this.number == null)
2115            this.number = new ArrayList<UnsignedIntType>();
2116          this.number.add(t);
2117          return t;
2118        }
2119
2120        /**
2121         * @param value {@link #number} (Number used to link this term or term element to the applicable Security Label.)
2122         */
2123        public SecurityLabelComponent addNumber(int value) { //1
2124          UnsignedIntType t = new UnsignedIntType();
2125          t.setValue(value);
2126          if (this.number == null)
2127            this.number = new ArrayList<UnsignedIntType>();
2128          this.number.add(t);
2129          return this;
2130        }
2131
2132        /**
2133         * @param value {@link #number} (Number used to link this term or term element to the applicable Security Label.)
2134         */
2135        public boolean hasNumber(int value) { 
2136          if (this.number == null)
2137            return false;
2138          for (UnsignedIntType v : this.number)
2139            if (v.getValue().equals(value)) // unsignedInt
2140              return true;
2141          return false;
2142        }
2143
2144        /**
2145         * @return {@link #classification} (Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements.)
2146         */
2147        public Coding getClassification() { 
2148          if (this.classification == null)
2149            if (Configuration.errorOnAutoCreate())
2150              throw new Error("Attempt to auto-create SecurityLabelComponent.classification");
2151            else if (Configuration.doAutoCreate())
2152              this.classification = new Coding(); // cc
2153          return this.classification;
2154        }
2155
2156        public boolean hasClassification() { 
2157          return this.classification != null && !this.classification.isEmpty();
2158        }
2159
2160        /**
2161         * @param value {@link #classification} (Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements.)
2162         */
2163        public SecurityLabelComponent setClassification(Coding value) { 
2164          this.classification = value;
2165          return this;
2166        }
2167
2168        /**
2169         * @return {@link #category} (Security label privacy tag that species the applicable privacy and security policies governing this term and/or term elements.)
2170         */
2171        public List<Coding> getCategory() { 
2172          if (this.category == null)
2173            this.category = new ArrayList<Coding>();
2174          return this.category;
2175        }
2176
2177        /**
2178         * @return Returns a reference to <code>this</code> for easy method chaining
2179         */
2180        public SecurityLabelComponent setCategory(List<Coding> theCategory) { 
2181          this.category = theCategory;
2182          return this;
2183        }
2184
2185        public boolean hasCategory() { 
2186          if (this.category == null)
2187            return false;
2188          for (Coding item : this.category)
2189            if (!item.isEmpty())
2190              return true;
2191          return false;
2192        }
2193
2194        public Coding addCategory() { //3
2195          Coding t = new Coding();
2196          if (this.category == null)
2197            this.category = new ArrayList<Coding>();
2198          this.category.add(t);
2199          return t;
2200        }
2201
2202        public SecurityLabelComponent addCategory(Coding t) { //3
2203          if (t == null)
2204            return this;
2205          if (this.category == null)
2206            this.category = new ArrayList<Coding>();
2207          this.category.add(t);
2208          return this;
2209        }
2210
2211        /**
2212         * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist
2213         */
2214        public Coding getCategoryFirstRep() { 
2215          if (getCategory().isEmpty()) {
2216            addCategory();
2217          }
2218          return getCategory().get(0);
2219        }
2220
2221        /**
2222         * @return {@link #control} (Security label privacy tag that species the manner in which term and/or term elements are to be protected.)
2223         */
2224        public List<Coding> getControl() { 
2225          if (this.control == null)
2226            this.control = new ArrayList<Coding>();
2227          return this.control;
2228        }
2229
2230        /**
2231         * @return Returns a reference to <code>this</code> for easy method chaining
2232         */
2233        public SecurityLabelComponent setControl(List<Coding> theControl) { 
2234          this.control = theControl;
2235          return this;
2236        }
2237
2238        public boolean hasControl() { 
2239          if (this.control == null)
2240            return false;
2241          for (Coding item : this.control)
2242            if (!item.isEmpty())
2243              return true;
2244          return false;
2245        }
2246
2247        public Coding addControl() { //3
2248          Coding t = new Coding();
2249          if (this.control == null)
2250            this.control = new ArrayList<Coding>();
2251          this.control.add(t);
2252          return t;
2253        }
2254
2255        public SecurityLabelComponent addControl(Coding t) { //3
2256          if (t == null)
2257            return this;
2258          if (this.control == null)
2259            this.control = new ArrayList<Coding>();
2260          this.control.add(t);
2261          return this;
2262        }
2263
2264        /**
2265         * @return The first repetition of repeating field {@link #control}, creating it if it does not already exist
2266         */
2267        public Coding getControlFirstRep() { 
2268          if (getControl().isEmpty()) {
2269            addControl();
2270          }
2271          return getControl().get(0);
2272        }
2273
2274        protected void listChildren(List<Property> children) {
2275          super.listChildren(children);
2276          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));
2277          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));
2278          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));
2279          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));
2280        }
2281
2282        @Override
2283        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2284          switch (_hash) {
2285          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);
2286          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);
2287          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);
2288          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);
2289          default: return super.getNamedProperty(_hash, _name, _checkValid);
2290          }
2291
2292        }
2293
2294      @Override
2295      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2296        switch (hash) {
2297        case -1034364087: /*number*/ return this.number == null ? new Base[0] : this.number.toArray(new Base[this.number.size()]); // UnsignedIntType
2298        case 382350310: /*classification*/ return this.classification == null ? new Base[0] : new Base[] {this.classification}; // Coding
2299        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // Coding
2300        case 951543133: /*control*/ return this.control == null ? new Base[0] : this.control.toArray(new Base[this.control.size()]); // Coding
2301        default: return super.getProperty(hash, name, checkValid);
2302        }
2303
2304      }
2305
2306      @Override
2307      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2308        switch (hash) {
2309        case -1034364087: // number
2310          this.getNumber().add(castToUnsignedInt(value)); // UnsignedIntType
2311          return value;
2312        case 382350310: // classification
2313          this.classification = castToCoding(value); // Coding
2314          return value;
2315        case 50511102: // category
2316          this.getCategory().add(castToCoding(value)); // Coding
2317          return value;
2318        case 951543133: // control
2319          this.getControl().add(castToCoding(value)); // Coding
2320          return value;
2321        default: return super.setProperty(hash, name, value);
2322        }
2323
2324      }
2325
2326      @Override
2327      public Base setProperty(String name, Base value) throws FHIRException {
2328        if (name.equals("number")) {
2329          this.getNumber().add(castToUnsignedInt(value));
2330        } else if (name.equals("classification")) {
2331          this.classification = castToCoding(value); // Coding
2332        } else if (name.equals("category")) {
2333          this.getCategory().add(castToCoding(value));
2334        } else if (name.equals("control")) {
2335          this.getControl().add(castToCoding(value));
2336        } else
2337          return super.setProperty(name, value);
2338        return value;
2339      }
2340
2341      @Override
2342      public Base makeProperty(int hash, String name) throws FHIRException {
2343        switch (hash) {
2344        case -1034364087:  return addNumberElement();
2345        case 382350310:  return getClassification(); 
2346        case 50511102:  return addCategory(); 
2347        case 951543133:  return addControl(); 
2348        default: return super.makeProperty(hash, name);
2349        }
2350
2351      }
2352
2353      @Override
2354      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2355        switch (hash) {
2356        case -1034364087: /*number*/ return new String[] {"unsignedInt"};
2357        case 382350310: /*classification*/ return new String[] {"Coding"};
2358        case 50511102: /*category*/ return new String[] {"Coding"};
2359        case 951543133: /*control*/ return new String[] {"Coding"};
2360        default: return super.getTypesForProperty(hash, name);
2361        }
2362
2363      }
2364
2365      @Override
2366      public Base addChild(String name) throws FHIRException {
2367        if (name.equals("number")) {
2368          throw new FHIRException("Cannot call addChild on a primitive type Contract.number");
2369        }
2370        else if (name.equals("classification")) {
2371          this.classification = new Coding();
2372          return this.classification;
2373        }
2374        else if (name.equals("category")) {
2375          return addCategory();
2376        }
2377        else if (name.equals("control")) {
2378          return addControl();
2379        }
2380        else
2381          return super.addChild(name);
2382      }
2383
2384      public SecurityLabelComponent copy() {
2385        SecurityLabelComponent dst = new SecurityLabelComponent();
2386        copyValues(dst);
2387        return dst;
2388      }
2389
2390      public void copyValues(SecurityLabelComponent dst) {
2391        super.copyValues(dst);
2392        if (number != null) {
2393          dst.number = new ArrayList<UnsignedIntType>();
2394          for (UnsignedIntType i : number)
2395            dst.number.add(i.copy());
2396        };
2397        dst.classification = classification == null ? null : classification.copy();
2398        if (category != null) {
2399          dst.category = new ArrayList<Coding>();
2400          for (Coding i : category)
2401            dst.category.add(i.copy());
2402        };
2403        if (control != null) {
2404          dst.control = new ArrayList<Coding>();
2405          for (Coding i : control)
2406            dst.control.add(i.copy());
2407        };
2408      }
2409
2410      @Override
2411      public boolean equalsDeep(Base other_) {
2412        if (!super.equalsDeep(other_))
2413          return false;
2414        if (!(other_ instanceof SecurityLabelComponent))
2415          return false;
2416        SecurityLabelComponent o = (SecurityLabelComponent) other_;
2417        return compareDeep(number, o.number, true) && compareDeep(classification, o.classification, true)
2418           && compareDeep(category, o.category, true) && compareDeep(control, o.control, true);
2419      }
2420
2421      @Override
2422      public boolean equalsShallow(Base other_) {
2423        if (!super.equalsShallow(other_))
2424          return false;
2425        if (!(other_ instanceof SecurityLabelComponent))
2426          return false;
2427        SecurityLabelComponent o = (SecurityLabelComponent) other_;
2428        return compareValues(number, o.number, true);
2429      }
2430
2431      public boolean isEmpty() {
2432        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(number, classification, category
2433          , control);
2434      }
2435
2436  public String fhirType() {
2437    return "Contract.term.securityLabel";
2438
2439  }
2440
2441  }
2442
2443    @Block()
2444    public static class ContractOfferComponent extends BackboneElement implements IBaseBackboneElement {
2445        /**
2446         * Unique identifier for this particular Contract Provision.
2447         */
2448        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2449        @Description(shortDefinition="Offer business ID", formalDefinition="Unique identifier for this particular Contract Provision." )
2450        protected List<Identifier> identifier;
2451
2452        /**
2453         * Offer Recipient.
2454         */
2455        @Child(name = "party", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2456        @Description(shortDefinition="Offer Recipient", formalDefinition="Offer Recipient." )
2457        protected List<ContractPartyComponent> party;
2458
2459        /**
2460         * 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).
2461         */
2462        @Child(name = "topic", type = {Reference.class}, order=3, min=0, max=1, modifier=false, summary=true)
2463        @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)." )
2464        protected Reference topic;
2465
2466        /**
2467         * The actual object that is the target of the reference (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).)
2468         */
2469        protected Resource topicTarget;
2470
2471        /**
2472         * Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.
2473         */
2474        @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
2475        @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." )
2476        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-term-type")
2477        protected CodeableConcept type;
2478
2479        /**
2480         * Type of choice made by accepting party with respect to an offer made by an offeror/ grantee.
2481         */
2482        @Child(name = "decision", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false)
2483        @Description(shortDefinition="Accepting party choice", formalDefinition="Type of choice made by accepting party with respect to an offer made by an offeror/ grantee." )
2484        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-ActConsentDirective")
2485        protected CodeableConcept decision;
2486
2487        /**
2488         * How the decision about a Contract was conveyed.
2489         */
2490        @Child(name = "decisionMode", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2491        @Description(shortDefinition="How decision is conveyed", formalDefinition="How the decision about a Contract was conveyed." )
2492        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-decision-mode")
2493        protected List<CodeableConcept> decisionMode;
2494
2495        /**
2496         * Response to offer text.
2497         */
2498        @Child(name = "answer", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2499        @Description(shortDefinition="Response to offer text", formalDefinition="Response to offer text." )
2500        protected List<AnswerComponent> answer;
2501
2502        /**
2503         * Human readable form of this Contract Offer.
2504         */
2505        @Child(name = "text", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
2506        @Description(shortDefinition="Human readable offer text", formalDefinition="Human readable form of this Contract Offer." )
2507        protected StringType text;
2508
2509        /**
2510         * The id of the clause or question text of the offer in the referenced questionnaire/response.
2511         */
2512        @Child(name = "linkId", type = {StringType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2513        @Description(shortDefinition="Pointer to text", formalDefinition="The id of the clause or question text of the offer in the referenced questionnaire/response." )
2514        protected List<StringType> linkId;
2515
2516        /**
2517         * Security labels that protects the offer.
2518         */
2519        @Child(name = "securityLabelNumber", type = {UnsignedIntType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2520        @Description(shortDefinition="Offer restriction numbers", formalDefinition="Security labels that protects the offer." )
2521        protected List<UnsignedIntType> securityLabelNumber;
2522
2523        private static final long serialVersionUID = -395674449L;
2524
2525    /**
2526     * Constructor
2527     */
2528      public ContractOfferComponent() {
2529        super();
2530      }
2531
2532        /**
2533         * @return {@link #identifier} (Unique identifier for this particular Contract Provision.)
2534         */
2535        public List<Identifier> getIdentifier() { 
2536          if (this.identifier == null)
2537            this.identifier = new ArrayList<Identifier>();
2538          return this.identifier;
2539        }
2540
2541        /**
2542         * @return Returns a reference to <code>this</code> for easy method chaining
2543         */
2544        public ContractOfferComponent setIdentifier(List<Identifier> theIdentifier) { 
2545          this.identifier = theIdentifier;
2546          return this;
2547        }
2548
2549        public boolean hasIdentifier() { 
2550          if (this.identifier == null)
2551            return false;
2552          for (Identifier item : this.identifier)
2553            if (!item.isEmpty())
2554              return true;
2555          return false;
2556        }
2557
2558        public Identifier addIdentifier() { //3
2559          Identifier t = new Identifier();
2560          if (this.identifier == null)
2561            this.identifier = new ArrayList<Identifier>();
2562          this.identifier.add(t);
2563          return t;
2564        }
2565
2566        public ContractOfferComponent addIdentifier(Identifier t) { //3
2567          if (t == null)
2568            return this;
2569          if (this.identifier == null)
2570            this.identifier = new ArrayList<Identifier>();
2571          this.identifier.add(t);
2572          return this;
2573        }
2574
2575        /**
2576         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
2577         */
2578        public Identifier getIdentifierFirstRep() { 
2579          if (getIdentifier().isEmpty()) {
2580            addIdentifier();
2581          }
2582          return getIdentifier().get(0);
2583        }
2584
2585        /**
2586         * @return {@link #party} (Offer Recipient.)
2587         */
2588        public List<ContractPartyComponent> getParty() { 
2589          if (this.party == null)
2590            this.party = new ArrayList<ContractPartyComponent>();
2591          return this.party;
2592        }
2593
2594        /**
2595         * @return Returns a reference to <code>this</code> for easy method chaining
2596         */
2597        public ContractOfferComponent setParty(List<ContractPartyComponent> theParty) { 
2598          this.party = theParty;
2599          return this;
2600        }
2601
2602        public boolean hasParty() { 
2603          if (this.party == null)
2604            return false;
2605          for (ContractPartyComponent item : this.party)
2606            if (!item.isEmpty())
2607              return true;
2608          return false;
2609        }
2610
2611        public ContractPartyComponent addParty() { //3
2612          ContractPartyComponent t = new ContractPartyComponent();
2613          if (this.party == null)
2614            this.party = new ArrayList<ContractPartyComponent>();
2615          this.party.add(t);
2616          return t;
2617        }
2618
2619        public ContractOfferComponent addParty(ContractPartyComponent t) { //3
2620          if (t == null)
2621            return this;
2622          if (this.party == null)
2623            this.party = new ArrayList<ContractPartyComponent>();
2624          this.party.add(t);
2625          return this;
2626        }
2627
2628        /**
2629         * @return The first repetition of repeating field {@link #party}, creating it if it does not already exist
2630         */
2631        public ContractPartyComponent getPartyFirstRep() { 
2632          if (getParty().isEmpty()) {
2633            addParty();
2634          }
2635          return getParty().get(0);
2636        }
2637
2638        /**
2639         * @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).)
2640         */
2641        public Reference getTopic() { 
2642          if (this.topic == null)
2643            if (Configuration.errorOnAutoCreate())
2644              throw new Error("Attempt to auto-create ContractOfferComponent.topic");
2645            else if (Configuration.doAutoCreate())
2646              this.topic = new Reference(); // cc
2647          return this.topic;
2648        }
2649
2650        public boolean hasTopic() { 
2651          return this.topic != null && !this.topic.isEmpty();
2652        }
2653
2654        /**
2655         * @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).)
2656         */
2657        public ContractOfferComponent setTopic(Reference value) { 
2658          this.topic = value;
2659          return this;
2660        }
2661
2662        /**
2663         * @return {@link #topic} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The 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).)
2664         */
2665        public Resource getTopicTarget() { 
2666          return this.topicTarget;
2667        }
2668
2669        /**
2670         * @param value {@link #topic} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The 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).)
2671         */
2672        public ContractOfferComponent setTopicTarget(Resource value) { 
2673          this.topicTarget = value;
2674          return this;
2675        }
2676
2677        /**
2678         * @return {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.)
2679         */
2680        public CodeableConcept getType() { 
2681          if (this.type == null)
2682            if (Configuration.errorOnAutoCreate())
2683              throw new Error("Attempt to auto-create ContractOfferComponent.type");
2684            else if (Configuration.doAutoCreate())
2685              this.type = new CodeableConcept(); // cc
2686          return this.type;
2687        }
2688
2689        public boolean hasType() { 
2690          return this.type != null && !this.type.isEmpty();
2691        }
2692
2693        /**
2694         * @param value {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.)
2695         */
2696        public ContractOfferComponent setType(CodeableConcept value) { 
2697          this.type = value;
2698          return this;
2699        }
2700
2701        /**
2702         * @return {@link #decision} (Type of choice made by accepting party with respect to an offer made by an offeror/ grantee.)
2703         */
2704        public CodeableConcept getDecision() { 
2705          if (this.decision == null)
2706            if (Configuration.errorOnAutoCreate())
2707              throw new Error("Attempt to auto-create ContractOfferComponent.decision");
2708            else if (Configuration.doAutoCreate())
2709              this.decision = new CodeableConcept(); // cc
2710          return this.decision;
2711        }
2712
2713        public boolean hasDecision() { 
2714          return this.decision != null && !this.decision.isEmpty();
2715        }
2716
2717        /**
2718         * @param value {@link #decision} (Type of choice made by accepting party with respect to an offer made by an offeror/ grantee.)
2719         */
2720        public ContractOfferComponent setDecision(CodeableConcept value) { 
2721          this.decision = value;
2722          return this;
2723        }
2724
2725        /**
2726         * @return {@link #decisionMode} (How the decision about a Contract was conveyed.)
2727         */
2728        public List<CodeableConcept> getDecisionMode() { 
2729          if (this.decisionMode == null)
2730            this.decisionMode = new ArrayList<CodeableConcept>();
2731          return this.decisionMode;
2732        }
2733
2734        /**
2735         * @return Returns a reference to <code>this</code> for easy method chaining
2736         */
2737        public ContractOfferComponent setDecisionMode(List<CodeableConcept> theDecisionMode) { 
2738          this.decisionMode = theDecisionMode;
2739          return this;
2740        }
2741
2742        public boolean hasDecisionMode() { 
2743          if (this.decisionMode == null)
2744            return false;
2745          for (CodeableConcept item : this.decisionMode)
2746            if (!item.isEmpty())
2747              return true;
2748          return false;
2749        }
2750
2751        public CodeableConcept addDecisionMode() { //3
2752          CodeableConcept t = new CodeableConcept();
2753          if (this.decisionMode == null)
2754            this.decisionMode = new ArrayList<CodeableConcept>();
2755          this.decisionMode.add(t);
2756          return t;
2757        }
2758
2759        public ContractOfferComponent addDecisionMode(CodeableConcept t) { //3
2760          if (t == null)
2761            return this;
2762          if (this.decisionMode == null)
2763            this.decisionMode = new ArrayList<CodeableConcept>();
2764          this.decisionMode.add(t);
2765          return this;
2766        }
2767
2768        /**
2769         * @return The first repetition of repeating field {@link #decisionMode}, creating it if it does not already exist
2770         */
2771        public CodeableConcept getDecisionModeFirstRep() { 
2772          if (getDecisionMode().isEmpty()) {
2773            addDecisionMode();
2774          }
2775          return getDecisionMode().get(0);
2776        }
2777
2778        /**
2779         * @return {@link #answer} (Response to offer text.)
2780         */
2781        public List<AnswerComponent> getAnswer() { 
2782          if (this.answer == null)
2783            this.answer = new ArrayList<AnswerComponent>();
2784          return this.answer;
2785        }
2786
2787        /**
2788         * @return Returns a reference to <code>this</code> for easy method chaining
2789         */
2790        public ContractOfferComponent setAnswer(List<AnswerComponent> theAnswer) { 
2791          this.answer = theAnswer;
2792          return this;
2793        }
2794
2795        public boolean hasAnswer() { 
2796          if (this.answer == null)
2797            return false;
2798          for (AnswerComponent item : this.answer)
2799            if (!item.isEmpty())
2800              return true;
2801          return false;
2802        }
2803
2804        public AnswerComponent addAnswer() { //3
2805          AnswerComponent t = new AnswerComponent();
2806          if (this.answer == null)
2807            this.answer = new ArrayList<AnswerComponent>();
2808          this.answer.add(t);
2809          return t;
2810        }
2811
2812        public ContractOfferComponent addAnswer(AnswerComponent t) { //3
2813          if (t == null)
2814            return this;
2815          if (this.answer == null)
2816            this.answer = new ArrayList<AnswerComponent>();
2817          this.answer.add(t);
2818          return this;
2819        }
2820
2821        /**
2822         * @return The first repetition of repeating field {@link #answer}, creating it if it does not already exist
2823         */
2824        public AnswerComponent getAnswerFirstRep() { 
2825          if (getAnswer().isEmpty()) {
2826            addAnswer();
2827          }
2828          return getAnswer().get(0);
2829        }
2830
2831        /**
2832         * @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
2833         */
2834        public StringType getTextElement() { 
2835          if (this.text == null)
2836            if (Configuration.errorOnAutoCreate())
2837              throw new Error("Attempt to auto-create ContractOfferComponent.text");
2838            else if (Configuration.doAutoCreate())
2839              this.text = new StringType(); // bb
2840          return this.text;
2841        }
2842
2843        public boolean hasTextElement() { 
2844          return this.text != null && !this.text.isEmpty();
2845        }
2846
2847        public boolean hasText() { 
2848          return this.text != null && !this.text.isEmpty();
2849        }
2850
2851        /**
2852         * @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
2853         */
2854        public ContractOfferComponent setTextElement(StringType value) { 
2855          this.text = value;
2856          return this;
2857        }
2858
2859        /**
2860         * @return Human readable form of this Contract Offer.
2861         */
2862        public String getText() { 
2863          return this.text == null ? null : this.text.getValue();
2864        }
2865
2866        /**
2867         * @param value Human readable form of this Contract Offer.
2868         */
2869        public ContractOfferComponent setText(String value) { 
2870          if (Utilities.noString(value))
2871            this.text = null;
2872          else {
2873            if (this.text == null)
2874              this.text = new StringType();
2875            this.text.setValue(value);
2876          }
2877          return this;
2878        }
2879
2880        /**
2881         * @return {@link #linkId} (The id of the clause or question text of the offer in the referenced questionnaire/response.)
2882         */
2883        public List<StringType> getLinkId() { 
2884          if (this.linkId == null)
2885            this.linkId = new ArrayList<StringType>();
2886          return this.linkId;
2887        }
2888
2889        /**
2890         * @return Returns a reference to <code>this</code> for easy method chaining
2891         */
2892        public ContractOfferComponent setLinkId(List<StringType> theLinkId) { 
2893          this.linkId = theLinkId;
2894          return this;
2895        }
2896
2897        public boolean hasLinkId() { 
2898          if (this.linkId == null)
2899            return false;
2900          for (StringType item : this.linkId)
2901            if (!item.isEmpty())
2902              return true;
2903          return false;
2904        }
2905
2906        /**
2907         * @return {@link #linkId} (The id of the clause or question text of the offer in the referenced questionnaire/response.)
2908         */
2909        public StringType addLinkIdElement() {//2 
2910          StringType t = new StringType();
2911          if (this.linkId == null)
2912            this.linkId = new ArrayList<StringType>();
2913          this.linkId.add(t);
2914          return t;
2915        }
2916
2917        /**
2918         * @param value {@link #linkId} (The id of the clause or question text of the offer in the referenced questionnaire/response.)
2919         */
2920        public ContractOfferComponent addLinkId(String value) { //1
2921          StringType t = new StringType();
2922          t.setValue(value);
2923          if (this.linkId == null)
2924            this.linkId = new ArrayList<StringType>();
2925          this.linkId.add(t);
2926          return this;
2927        }
2928
2929        /**
2930         * @param value {@link #linkId} (The id of the clause or question text of the offer in the referenced questionnaire/response.)
2931         */
2932        public boolean hasLinkId(String value) { 
2933          if (this.linkId == null)
2934            return false;
2935          for (StringType v : this.linkId)
2936            if (v.getValue().equals(value)) // string
2937              return true;
2938          return false;
2939        }
2940
2941        /**
2942         * @return {@link #securityLabelNumber} (Security labels that protects the offer.)
2943         */
2944        public List<UnsignedIntType> getSecurityLabelNumber() { 
2945          if (this.securityLabelNumber == null)
2946            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
2947          return this.securityLabelNumber;
2948        }
2949
2950        /**
2951         * @return Returns a reference to <code>this</code> for easy method chaining
2952         */
2953        public ContractOfferComponent setSecurityLabelNumber(List<UnsignedIntType> theSecurityLabelNumber) { 
2954          this.securityLabelNumber = theSecurityLabelNumber;
2955          return this;
2956        }
2957
2958        public boolean hasSecurityLabelNumber() { 
2959          if (this.securityLabelNumber == null)
2960            return false;
2961          for (UnsignedIntType item : this.securityLabelNumber)
2962            if (!item.isEmpty())
2963              return true;
2964          return false;
2965        }
2966
2967        /**
2968         * @return {@link #securityLabelNumber} (Security labels that protects the offer.)
2969         */
2970        public UnsignedIntType addSecurityLabelNumberElement() {//2 
2971          UnsignedIntType t = new UnsignedIntType();
2972          if (this.securityLabelNumber == null)
2973            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
2974          this.securityLabelNumber.add(t);
2975          return t;
2976        }
2977
2978        /**
2979         * @param value {@link #securityLabelNumber} (Security labels that protects the offer.)
2980         */
2981        public ContractOfferComponent addSecurityLabelNumber(int value) { //1
2982          UnsignedIntType t = new UnsignedIntType();
2983          t.setValue(value);
2984          if (this.securityLabelNumber == null)
2985            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
2986          this.securityLabelNumber.add(t);
2987          return this;
2988        }
2989
2990        /**
2991         * @param value {@link #securityLabelNumber} (Security labels that protects the offer.)
2992         */
2993        public boolean hasSecurityLabelNumber(int value) { 
2994          if (this.securityLabelNumber == null)
2995            return false;
2996          for (UnsignedIntType v : this.securityLabelNumber)
2997            if (v.getValue().equals(value)) // unsignedInt
2998              return true;
2999          return false;
3000        }
3001
3002        protected void listChildren(List<Property> children) {
3003          super.listChildren(children);
3004          children.add(new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, java.lang.Integer.MAX_VALUE, identifier));
3005          children.add(new Property("party", "", "Offer Recipient.", 0, java.lang.Integer.MAX_VALUE, party));
3006          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));
3007          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));
3008          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));
3009          children.add(new Property("decisionMode", "CodeableConcept", "How the decision about a Contract was conveyed.", 0, java.lang.Integer.MAX_VALUE, decisionMode));
3010          children.add(new Property("answer", "", "Response to offer text.", 0, java.lang.Integer.MAX_VALUE, answer));
3011          children.add(new Property("text", "string", "Human readable form of this Contract Offer.", 0, 1, text));
3012          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));
3013          children.add(new Property("securityLabelNumber", "unsignedInt", "Security labels that protects the offer.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber));
3014        }
3015
3016        @Override
3017        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3018          switch (_hash) {
3019          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, java.lang.Integer.MAX_VALUE, identifier);
3020          case 106437350: /*party*/  return new Property("party", "", "Offer Recipient.", 0, java.lang.Integer.MAX_VALUE, party);
3021          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);
3022          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);
3023          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);
3024          case 675909535: /*decisionMode*/  return new Property("decisionMode", "CodeableConcept", "How the decision about a Contract was conveyed.", 0, java.lang.Integer.MAX_VALUE, decisionMode);
3025          case -1412808770: /*answer*/  return new Property("answer", "", "Response to offer text.", 0, java.lang.Integer.MAX_VALUE, answer);
3026          case 3556653: /*text*/  return new Property("text", "string", "Human readable form of this Contract Offer.", 0, 1, text);
3027          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);
3028          case -149460995: /*securityLabelNumber*/  return new Property("securityLabelNumber", "unsignedInt", "Security labels that protects the offer.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber);
3029          default: return super.getNamedProperty(_hash, _name, _checkValid);
3030          }
3031
3032        }
3033
3034      @Override
3035      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3036        switch (hash) {
3037        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3038        case 106437350: /*party*/ return this.party == null ? new Base[0] : this.party.toArray(new Base[this.party.size()]); // ContractPartyComponent
3039        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : new Base[] {this.topic}; // Reference
3040        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3041        case 565719004: /*decision*/ return this.decision == null ? new Base[0] : new Base[] {this.decision}; // CodeableConcept
3042        case 675909535: /*decisionMode*/ return this.decisionMode == null ? new Base[0] : this.decisionMode.toArray(new Base[this.decisionMode.size()]); // CodeableConcept
3043        case -1412808770: /*answer*/ return this.answer == null ? new Base[0] : this.answer.toArray(new Base[this.answer.size()]); // AnswerComponent
3044        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
3045        case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : this.linkId.toArray(new Base[this.linkId.size()]); // StringType
3046        case -149460995: /*securityLabelNumber*/ return this.securityLabelNumber == null ? new Base[0] : this.securityLabelNumber.toArray(new Base[this.securityLabelNumber.size()]); // UnsignedIntType
3047        default: return super.getProperty(hash, name, checkValid);
3048        }
3049
3050      }
3051
3052      @Override
3053      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3054        switch (hash) {
3055        case -1618432855: // identifier
3056          this.getIdentifier().add(castToIdentifier(value)); // Identifier
3057          return value;
3058        case 106437350: // party
3059          this.getParty().add((ContractPartyComponent) value); // ContractPartyComponent
3060          return value;
3061        case 110546223: // topic
3062          this.topic = castToReference(value); // Reference
3063          return value;
3064        case 3575610: // type
3065          this.type = castToCodeableConcept(value); // CodeableConcept
3066          return value;
3067        case 565719004: // decision
3068          this.decision = castToCodeableConcept(value); // CodeableConcept
3069          return value;
3070        case 675909535: // decisionMode
3071          this.getDecisionMode().add(castToCodeableConcept(value)); // CodeableConcept
3072          return value;
3073        case -1412808770: // answer
3074          this.getAnswer().add((AnswerComponent) value); // AnswerComponent
3075          return value;
3076        case 3556653: // text
3077          this.text = castToString(value); // StringType
3078          return value;
3079        case -1102667083: // linkId
3080          this.getLinkId().add(castToString(value)); // StringType
3081          return value;
3082        case -149460995: // securityLabelNumber
3083          this.getSecurityLabelNumber().add(castToUnsignedInt(value)); // UnsignedIntType
3084          return value;
3085        default: return super.setProperty(hash, name, value);
3086        }
3087
3088      }
3089
3090      @Override
3091      public Base setProperty(String name, Base value) throws FHIRException {
3092        if (name.equals("identifier")) {
3093          this.getIdentifier().add(castToIdentifier(value));
3094        } else if (name.equals("party")) {
3095          this.getParty().add((ContractPartyComponent) value);
3096        } else if (name.equals("topic")) {
3097          this.topic = castToReference(value); // Reference
3098        } else if (name.equals("type")) {
3099          this.type = castToCodeableConcept(value); // CodeableConcept
3100        } else if (name.equals("decision")) {
3101          this.decision = castToCodeableConcept(value); // CodeableConcept
3102        } else if (name.equals("decisionMode")) {
3103          this.getDecisionMode().add(castToCodeableConcept(value));
3104        } else if (name.equals("answer")) {
3105          this.getAnswer().add((AnswerComponent) value);
3106        } else if (name.equals("text")) {
3107          this.text = castToString(value); // StringType
3108        } else if (name.equals("linkId")) {
3109          this.getLinkId().add(castToString(value));
3110        } else if (name.equals("securityLabelNumber")) {
3111          this.getSecurityLabelNumber().add(castToUnsignedInt(value));
3112        } else
3113          return super.setProperty(name, value);
3114        return value;
3115      }
3116
3117      @Override
3118      public Base makeProperty(int hash, String name) throws FHIRException {
3119        switch (hash) {
3120        case -1618432855:  return addIdentifier(); 
3121        case 106437350:  return addParty(); 
3122        case 110546223:  return getTopic(); 
3123        case 3575610:  return getType(); 
3124        case 565719004:  return getDecision(); 
3125        case 675909535:  return addDecisionMode(); 
3126        case -1412808770:  return addAnswer(); 
3127        case 3556653:  return getTextElement();
3128        case -1102667083:  return addLinkIdElement();
3129        case -149460995:  return addSecurityLabelNumberElement();
3130        default: return super.makeProperty(hash, name);
3131        }
3132
3133      }
3134
3135      @Override
3136      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3137        switch (hash) {
3138        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3139        case 106437350: /*party*/ return new String[] {};
3140        case 110546223: /*topic*/ return new String[] {"Reference"};
3141        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3142        case 565719004: /*decision*/ return new String[] {"CodeableConcept"};
3143        case 675909535: /*decisionMode*/ return new String[] {"CodeableConcept"};
3144        case -1412808770: /*answer*/ return new String[] {};
3145        case 3556653: /*text*/ return new String[] {"string"};
3146        case -1102667083: /*linkId*/ return new String[] {"string"};
3147        case -149460995: /*securityLabelNumber*/ return new String[] {"unsignedInt"};
3148        default: return super.getTypesForProperty(hash, name);
3149        }
3150
3151      }
3152
3153      @Override
3154      public Base addChild(String name) throws FHIRException {
3155        if (name.equals("identifier")) {
3156          return addIdentifier();
3157        }
3158        else if (name.equals("party")) {
3159          return addParty();
3160        }
3161        else if (name.equals("topic")) {
3162          this.topic = new Reference();
3163          return this.topic;
3164        }
3165        else if (name.equals("type")) {
3166          this.type = new CodeableConcept();
3167          return this.type;
3168        }
3169        else if (name.equals("decision")) {
3170          this.decision = new CodeableConcept();
3171          return this.decision;
3172        }
3173        else if (name.equals("decisionMode")) {
3174          return addDecisionMode();
3175        }
3176        else if (name.equals("answer")) {
3177          return addAnswer();
3178        }
3179        else if (name.equals("text")) {
3180          throw new FHIRException("Cannot call addChild on a primitive type Contract.text");
3181        }
3182        else if (name.equals("linkId")) {
3183          throw new FHIRException("Cannot call addChild on a primitive type Contract.linkId");
3184        }
3185        else if (name.equals("securityLabelNumber")) {
3186          throw new FHIRException("Cannot call addChild on a primitive type Contract.securityLabelNumber");
3187        }
3188        else
3189          return super.addChild(name);
3190      }
3191
3192      public ContractOfferComponent copy() {
3193        ContractOfferComponent dst = new ContractOfferComponent();
3194        copyValues(dst);
3195        return dst;
3196      }
3197
3198      public void copyValues(ContractOfferComponent dst) {
3199        super.copyValues(dst);
3200        if (identifier != null) {
3201          dst.identifier = new ArrayList<Identifier>();
3202          for (Identifier i : identifier)
3203            dst.identifier.add(i.copy());
3204        };
3205        if (party != null) {
3206          dst.party = new ArrayList<ContractPartyComponent>();
3207          for (ContractPartyComponent i : party)
3208            dst.party.add(i.copy());
3209        };
3210        dst.topic = topic == null ? null : topic.copy();
3211        dst.type = type == null ? null : type.copy();
3212        dst.decision = decision == null ? null : decision.copy();
3213        if (decisionMode != null) {
3214          dst.decisionMode = new ArrayList<CodeableConcept>();
3215          for (CodeableConcept i : decisionMode)
3216            dst.decisionMode.add(i.copy());
3217        };
3218        if (answer != null) {
3219          dst.answer = new ArrayList<AnswerComponent>();
3220          for (AnswerComponent i : answer)
3221            dst.answer.add(i.copy());
3222        };
3223        dst.text = text == null ? null : text.copy();
3224        if (linkId != null) {
3225          dst.linkId = new ArrayList<StringType>();
3226          for (StringType i : linkId)
3227            dst.linkId.add(i.copy());
3228        };
3229        if (securityLabelNumber != null) {
3230          dst.securityLabelNumber = new ArrayList<UnsignedIntType>();
3231          for (UnsignedIntType i : securityLabelNumber)
3232            dst.securityLabelNumber.add(i.copy());
3233        };
3234      }
3235
3236      @Override
3237      public boolean equalsDeep(Base other_) {
3238        if (!super.equalsDeep(other_))
3239          return false;
3240        if (!(other_ instanceof ContractOfferComponent))
3241          return false;
3242        ContractOfferComponent o = (ContractOfferComponent) other_;
3243        return compareDeep(identifier, o.identifier, true) && compareDeep(party, o.party, true) && compareDeep(topic, o.topic, true)
3244           && compareDeep(type, o.type, true) && compareDeep(decision, o.decision, true) && compareDeep(decisionMode, o.decisionMode, true)
3245           && compareDeep(answer, o.answer, true) && compareDeep(text, o.text, true) && compareDeep(linkId, o.linkId, true)
3246           && compareDeep(securityLabelNumber, o.securityLabelNumber, true);
3247      }
3248
3249      @Override
3250      public boolean equalsShallow(Base other_) {
3251        if (!super.equalsShallow(other_))
3252          return false;
3253        if (!(other_ instanceof ContractOfferComponent))
3254          return false;
3255        ContractOfferComponent o = (ContractOfferComponent) other_;
3256        return compareValues(text, o.text, true) && compareValues(linkId, o.linkId, true) && compareValues(securityLabelNumber, o.securityLabelNumber, true)
3257          ;
3258      }
3259
3260      public boolean isEmpty() {
3261        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, party, topic
3262          , type, decision, decisionMode, answer, text, linkId, securityLabelNumber);
3263      }
3264
3265  public String fhirType() {
3266    return "Contract.term.offer";
3267
3268  }
3269
3270  }
3271
3272    @Block()
3273    public static class ContractPartyComponent extends BackboneElement implements IBaseBackboneElement {
3274        /**
3275         * Participant in the offer.
3276         */
3277        @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)
3278        @Description(shortDefinition="Referenced entity", formalDefinition="Participant in the offer." )
3279        protected List<Reference> reference;
3280        /**
3281         * The actual objects that are the target of the reference (Participant in the offer.)
3282         */
3283        protected List<Resource> referenceTarget;
3284
3285
3286        /**
3287         * How the party participates in the offer.
3288         */
3289        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false)
3290        @Description(shortDefinition="Participant engagement type", formalDefinition="How the party participates in the offer." )
3291        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-party-role")
3292        protected CodeableConcept role;
3293
3294        private static final long serialVersionUID = 128949255L;
3295
3296    /**
3297     * Constructor
3298     */
3299      public ContractPartyComponent() {
3300        super();
3301      }
3302
3303    /**
3304     * Constructor
3305     */
3306      public ContractPartyComponent(CodeableConcept role) {
3307        super();
3308        this.role = role;
3309      }
3310
3311        /**
3312         * @return {@link #reference} (Participant in the offer.)
3313         */
3314        public List<Reference> getReference() { 
3315          if (this.reference == null)
3316            this.reference = new ArrayList<Reference>();
3317          return this.reference;
3318        }
3319
3320        /**
3321         * @return Returns a reference to <code>this</code> for easy method chaining
3322         */
3323        public ContractPartyComponent setReference(List<Reference> theReference) { 
3324          this.reference = theReference;
3325          return this;
3326        }
3327
3328        public boolean hasReference() { 
3329          if (this.reference == null)
3330            return false;
3331          for (Reference item : this.reference)
3332            if (!item.isEmpty())
3333              return true;
3334          return false;
3335        }
3336
3337        public Reference addReference() { //3
3338          Reference t = new Reference();
3339          if (this.reference == null)
3340            this.reference = new ArrayList<Reference>();
3341          this.reference.add(t);
3342          return t;
3343        }
3344
3345        public ContractPartyComponent addReference(Reference t) { //3
3346          if (t == null)
3347            return this;
3348          if (this.reference == null)
3349            this.reference = new ArrayList<Reference>();
3350          this.reference.add(t);
3351          return this;
3352        }
3353
3354        /**
3355         * @return The first repetition of repeating field {@link #reference}, creating it if it does not already exist
3356         */
3357        public Reference getReferenceFirstRep() { 
3358          if (getReference().isEmpty()) {
3359            addReference();
3360          }
3361          return getReference().get(0);
3362        }
3363
3364        /**
3365         * @deprecated Use Reference#setResource(IBaseResource) instead
3366         */
3367        @Deprecated
3368        public List<Resource> getReferenceTarget() { 
3369          if (this.referenceTarget == null)
3370            this.referenceTarget = new ArrayList<Resource>();
3371          return this.referenceTarget;
3372        }
3373
3374        /**
3375         * @return {@link #role} (How the party participates in the offer.)
3376         */
3377        public CodeableConcept getRole() { 
3378          if (this.role == null)
3379            if (Configuration.errorOnAutoCreate())
3380              throw new Error("Attempt to auto-create ContractPartyComponent.role");
3381            else if (Configuration.doAutoCreate())
3382              this.role = new CodeableConcept(); // cc
3383          return this.role;
3384        }
3385
3386        public boolean hasRole() { 
3387          return this.role != null && !this.role.isEmpty();
3388        }
3389
3390        /**
3391         * @param value {@link #role} (How the party participates in the offer.)
3392         */
3393        public ContractPartyComponent setRole(CodeableConcept value) { 
3394          this.role = value;
3395          return this;
3396        }
3397
3398        protected void listChildren(List<Property> children) {
3399          super.listChildren(children);
3400          children.add(new Property("reference", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Device|Group|Organization)", "Participant in the offer.", 0, java.lang.Integer.MAX_VALUE, reference));
3401          children.add(new Property("role", "CodeableConcept", "How the party participates in the offer.", 0, 1, role));
3402        }
3403
3404        @Override
3405        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3406          switch (_hash) {
3407          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);
3408          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "How the party participates in the offer.", 0, 1, role);
3409          default: return super.getNamedProperty(_hash, _name, _checkValid);
3410          }
3411
3412        }
3413
3414      @Override
3415      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3416        switch (hash) {
3417        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : this.reference.toArray(new Base[this.reference.size()]); // Reference
3418        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
3419        default: return super.getProperty(hash, name, checkValid);
3420        }
3421
3422      }
3423
3424      @Override
3425      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3426        switch (hash) {
3427        case -925155509: // reference
3428          this.getReference().add(castToReference(value)); // Reference
3429          return value;
3430        case 3506294: // role
3431          this.role = castToCodeableConcept(value); // CodeableConcept
3432          return value;
3433        default: return super.setProperty(hash, name, value);
3434        }
3435
3436      }
3437
3438      @Override
3439      public Base setProperty(String name, Base value) throws FHIRException {
3440        if (name.equals("reference")) {
3441          this.getReference().add(castToReference(value));
3442        } else if (name.equals("role")) {
3443          this.role = castToCodeableConcept(value); // CodeableConcept
3444        } else
3445          return super.setProperty(name, value);
3446        return value;
3447      }
3448
3449      @Override
3450      public Base makeProperty(int hash, String name) throws FHIRException {
3451        switch (hash) {
3452        case -925155509:  return addReference(); 
3453        case 3506294:  return getRole(); 
3454        default: return super.makeProperty(hash, name);
3455        }
3456
3457      }
3458
3459      @Override
3460      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3461        switch (hash) {
3462        case -925155509: /*reference*/ return new String[] {"Reference"};
3463        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
3464        default: return super.getTypesForProperty(hash, name);
3465        }
3466
3467      }
3468
3469      @Override
3470      public Base addChild(String name) throws FHIRException {
3471        if (name.equals("reference")) {
3472          return addReference();
3473        }
3474        else if (name.equals("role")) {
3475          this.role = new CodeableConcept();
3476          return this.role;
3477        }
3478        else
3479          return super.addChild(name);
3480      }
3481
3482      public ContractPartyComponent copy() {
3483        ContractPartyComponent dst = new ContractPartyComponent();
3484        copyValues(dst);
3485        return dst;
3486      }
3487
3488      public void copyValues(ContractPartyComponent dst) {
3489        super.copyValues(dst);
3490        if (reference != null) {
3491          dst.reference = new ArrayList<Reference>();
3492          for (Reference i : reference)
3493            dst.reference.add(i.copy());
3494        };
3495        dst.role = role == null ? null : role.copy();
3496      }
3497
3498      @Override
3499      public boolean equalsDeep(Base other_) {
3500        if (!super.equalsDeep(other_))
3501          return false;
3502        if (!(other_ instanceof ContractPartyComponent))
3503          return false;
3504        ContractPartyComponent o = (ContractPartyComponent) other_;
3505        return compareDeep(reference, o.reference, true) && compareDeep(role, o.role, true);
3506      }
3507
3508      @Override
3509      public boolean equalsShallow(Base other_) {
3510        if (!super.equalsShallow(other_))
3511          return false;
3512        if (!(other_ instanceof ContractPartyComponent))
3513          return false;
3514        ContractPartyComponent o = (ContractPartyComponent) other_;
3515        return true;
3516      }
3517
3518      public boolean isEmpty() {
3519        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(reference, role);
3520      }
3521
3522  public String fhirType() {
3523    return "Contract.term.offer.party";
3524
3525  }
3526
3527  }
3528
3529    @Block()
3530    public static class AnswerComponent extends BackboneElement implements IBaseBackboneElement {
3531        /**
3532         * 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.
3533         */
3534        @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)
3535        @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." )
3536        protected Type value;
3537
3538        private static final long serialVersionUID = -732981989L;
3539
3540    /**
3541     * Constructor
3542     */
3543      public AnswerComponent() {
3544        super();
3545      }
3546
3547    /**
3548     * Constructor
3549     */
3550      public AnswerComponent(Type value) {
3551        super();
3552        this.value = value;
3553      }
3554
3555        /**
3556         * @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.)
3557         */
3558        public Type getValue() { 
3559          return this.value;
3560        }
3561
3562        /**
3563         * @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.)
3564         */
3565        public BooleanType getValueBooleanType() throws FHIRException { 
3566          if (this.value == null)
3567            this.value = new BooleanType();
3568          if (!(this.value instanceof BooleanType))
3569            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
3570          return (BooleanType) this.value;
3571        }
3572
3573        public boolean hasValueBooleanType() { 
3574          return this != null && this.value instanceof BooleanType;
3575        }
3576
3577        /**
3578         * @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.)
3579         */
3580        public DecimalType getValueDecimalType() throws FHIRException { 
3581          if (this.value == null)
3582            this.value = new DecimalType();
3583          if (!(this.value instanceof DecimalType))
3584            throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered");
3585          return (DecimalType) this.value;
3586        }
3587
3588        public boolean hasValueDecimalType() { 
3589          return this != null && this.value instanceof DecimalType;
3590        }
3591
3592        /**
3593         * @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.)
3594         */
3595        public IntegerType getValueIntegerType() throws FHIRException { 
3596          if (this.value == null)
3597            this.value = new IntegerType();
3598          if (!(this.value instanceof IntegerType))
3599            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
3600          return (IntegerType) this.value;
3601        }
3602
3603        public boolean hasValueIntegerType() { 
3604          return this != null && this.value instanceof IntegerType;
3605        }
3606
3607        /**
3608         * @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.)
3609         */
3610        public DateType getValueDateType() throws FHIRException { 
3611          if (this.value == null)
3612            this.value = new DateType();
3613          if (!(this.value instanceof DateType))
3614            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered");
3615          return (DateType) this.value;
3616        }
3617
3618        public boolean hasValueDateType() { 
3619          return this != null && this.value instanceof DateType;
3620        }
3621
3622        /**
3623         * @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.)
3624         */
3625        public DateTimeType getValueDateTimeType() throws FHIRException { 
3626          if (this.value == null)
3627            this.value = new DateTimeType();
3628          if (!(this.value instanceof DateTimeType))
3629            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered");
3630          return (DateTimeType) this.value;
3631        }
3632
3633        public boolean hasValueDateTimeType() { 
3634          return this != null && this.value instanceof DateTimeType;
3635        }
3636
3637        /**
3638         * @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.)
3639         */
3640        public TimeType getValueTimeType() throws FHIRException { 
3641          if (this.value == null)
3642            this.value = new TimeType();
3643          if (!(this.value instanceof TimeType))
3644            throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered");
3645          return (TimeType) this.value;
3646        }
3647
3648        public boolean hasValueTimeType() { 
3649          return this != null && this.value instanceof TimeType;
3650        }
3651
3652        /**
3653         * @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.)
3654         */
3655        public StringType getValueStringType() throws FHIRException { 
3656          if (this.value == null)
3657            this.value = new StringType();
3658          if (!(this.value instanceof StringType))
3659            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
3660          return (StringType) this.value;
3661        }
3662
3663        public boolean hasValueStringType() { 
3664          return this != null && this.value instanceof StringType;
3665        }
3666
3667        /**
3668         * @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.)
3669         */
3670        public UriType getValueUriType() throws FHIRException { 
3671          if (this.value == null)
3672            this.value = new UriType();
3673          if (!(this.value instanceof UriType))
3674            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered");
3675          return (UriType) this.value;
3676        }
3677
3678        public boolean hasValueUriType() { 
3679          return this != null && this.value instanceof UriType;
3680        }
3681
3682        /**
3683         * @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.)
3684         */
3685        public Attachment getValueAttachment() throws FHIRException { 
3686          if (this.value == null)
3687            this.value = new Attachment();
3688          if (!(this.value instanceof Attachment))
3689            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
3690          return (Attachment) this.value;
3691        }
3692
3693        public boolean hasValueAttachment() { 
3694          return this != null && this.value instanceof Attachment;
3695        }
3696
3697        /**
3698         * @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.)
3699         */
3700        public Coding getValueCoding() throws FHIRException { 
3701          if (this.value == null)
3702            this.value = new Coding();
3703          if (!(this.value instanceof Coding))
3704            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered");
3705          return (Coding) this.value;
3706        }
3707
3708        public boolean hasValueCoding() { 
3709          return this != null && this.value instanceof Coding;
3710        }
3711
3712        /**
3713         * @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.)
3714         */
3715        public Quantity getValueQuantity() throws FHIRException { 
3716          if (this.value == null)
3717            this.value = new Quantity();
3718          if (!(this.value instanceof Quantity))
3719            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
3720          return (Quantity) this.value;
3721        }
3722
3723        public boolean hasValueQuantity() { 
3724          return this != null && this.value instanceof Quantity;
3725        }
3726
3727        /**
3728         * @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.)
3729         */
3730        public Reference getValueReference() throws FHIRException { 
3731          if (this.value == null)
3732            this.value = new Reference();
3733          if (!(this.value instanceof Reference))
3734            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered");
3735          return (Reference) this.value;
3736        }
3737
3738        public boolean hasValueReference() { 
3739          return this != null && this.value instanceof Reference;
3740        }
3741
3742        public boolean hasValue() { 
3743          return this.value != null && !this.value.isEmpty();
3744        }
3745
3746        /**
3747         * @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.)
3748         */
3749        public AnswerComponent setValue(Type value) { 
3750          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))
3751            throw new Error("Not the right type for Contract.term.offer.answer.value[x]: "+value.fhirType());
3752          this.value = value;
3753          return this;
3754        }
3755
3756        protected void listChildren(List<Property> children) {
3757          super.listChildren(children);
3758          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));
3759        }
3760
3761        @Override
3762        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3763          switch (_hash) {
3764          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);
3765          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);
3766          case 733421943: /*valueBoolean*/  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);
3767          case -2083993440: /*valueDecimal*/  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);
3768          case -1668204915: /*valueInteger*/  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);
3769          case -766192449: /*valueDate*/  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);
3770          case 1047929900: /*valueDateTime*/  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);
3771          case -765708322: /*valueTime*/  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);
3772          case -1424603934: /*valueString*/  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);
3773          case -1410172357: /*valueUri*/  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);
3774          case -475566732: /*valueAttachment*/  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);
3775          case -1887705029: /*valueCoding*/  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);
3776          case -2029823716: /*valueQuantity*/  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);
3777          case 1755241690: /*valueReference*/  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);
3778          default: return super.getNamedProperty(_hash, _name, _checkValid);
3779          }
3780
3781        }
3782
3783      @Override
3784      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3785        switch (hash) {
3786        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type
3787        default: return super.getProperty(hash, name, checkValid);
3788        }
3789
3790      }
3791
3792      @Override
3793      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3794        switch (hash) {
3795        case 111972721: // value
3796          this.value = castToType(value); // Type
3797          return value;
3798        default: return super.setProperty(hash, name, value);
3799        }
3800
3801      }
3802
3803      @Override
3804      public Base setProperty(String name, Base value) throws FHIRException {
3805        if (name.equals("value[x]")) {
3806          this.value = castToType(value); // Type
3807        } else
3808          return super.setProperty(name, value);
3809        return value;
3810      }
3811
3812      @Override
3813      public Base makeProperty(int hash, String name) throws FHIRException {
3814        switch (hash) {
3815        case -1410166417:  return getValue(); 
3816        case 111972721:  return getValue(); 
3817        default: return super.makeProperty(hash, name);
3818        }
3819
3820      }
3821
3822      @Override
3823      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3824        switch (hash) {
3825        case 111972721: /*value*/ return new String[] {"boolean", "decimal", "integer", "date", "dateTime", "time", "string", "uri", "Attachment", "Coding", "Quantity", "Reference"};
3826        default: return super.getTypesForProperty(hash, name);
3827        }
3828
3829      }
3830
3831      @Override
3832      public Base addChild(String name) throws FHIRException {
3833        if (name.equals("valueBoolean")) {
3834          this.value = new BooleanType();
3835          return this.value;
3836        }
3837        else if (name.equals("valueDecimal")) {
3838          this.value = new DecimalType();
3839          return this.value;
3840        }
3841        else if (name.equals("valueInteger")) {
3842          this.value = new IntegerType();
3843          return this.value;
3844        }
3845        else if (name.equals("valueDate")) {
3846          this.value = new DateType();
3847          return this.value;
3848        }
3849        else if (name.equals("valueDateTime")) {
3850          this.value = new DateTimeType();
3851          return this.value;
3852        }
3853        else if (name.equals("valueTime")) {
3854          this.value = new TimeType();
3855          return this.value;
3856        }
3857        else if (name.equals("valueString")) {
3858          this.value = new StringType();
3859          return this.value;
3860        }
3861        else if (name.equals("valueUri")) {
3862          this.value = new UriType();
3863          return this.value;
3864        }
3865        else if (name.equals("valueAttachment")) {
3866          this.value = new Attachment();
3867          return this.value;
3868        }
3869        else if (name.equals("valueCoding")) {
3870          this.value = new Coding();
3871          return this.value;
3872        }
3873        else if (name.equals("valueQuantity")) {
3874          this.value = new Quantity();
3875          return this.value;
3876        }
3877        else if (name.equals("valueReference")) {
3878          this.value = new Reference();
3879          return this.value;
3880        }
3881        else
3882          return super.addChild(name);
3883      }
3884
3885      public AnswerComponent copy() {
3886        AnswerComponent dst = new AnswerComponent();
3887        copyValues(dst);
3888        return dst;
3889      }
3890
3891      public void copyValues(AnswerComponent dst) {
3892        super.copyValues(dst);
3893        dst.value = value == null ? null : value.copy();
3894      }
3895
3896      @Override
3897      public boolean equalsDeep(Base other_) {
3898        if (!super.equalsDeep(other_))
3899          return false;
3900        if (!(other_ instanceof AnswerComponent))
3901          return false;
3902        AnswerComponent o = (AnswerComponent) other_;
3903        return compareDeep(value, o.value, true);
3904      }
3905
3906      @Override
3907      public boolean equalsShallow(Base other_) {
3908        if (!super.equalsShallow(other_))
3909          return false;
3910        if (!(other_ instanceof AnswerComponent))
3911          return false;
3912        AnswerComponent o = (AnswerComponent) other_;
3913        return true;
3914      }
3915
3916      public boolean isEmpty() {
3917        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value);
3918      }
3919
3920  public String fhirType() {
3921    return "Contract.term.offer.answer";
3922
3923  }
3924
3925  }
3926
3927    @Block()
3928    public static class ContractAssetComponent extends BackboneElement implements IBaseBackboneElement {
3929        /**
3930         * Differentiates the kind of the asset .
3931         */
3932        @Child(name = "scope", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
3933        @Description(shortDefinition="Range of asset", formalDefinition="Differentiates the kind of the asset ." )
3934        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-assetscope")
3935        protected CodeableConcept scope;
3936
3937        /**
3938         * Target entity type about which the term may be concerned.
3939         */
3940        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3941        @Description(shortDefinition="Asset category", formalDefinition="Target entity type about which the term may be concerned." )
3942        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-assettype")
3943        protected List<CodeableConcept> type;
3944
3945        /**
3946         * Associated entities.
3947         */
3948        @Child(name = "typeReference", type = {Reference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3949        @Description(shortDefinition="Associated entities", formalDefinition="Associated entities." )
3950        protected List<Reference> typeReference;
3951        /**
3952         * The actual objects that are the target of the reference (Associated entities.)
3953         */
3954        protected List<Resource> typeReferenceTarget;
3955
3956
3957        /**
3958         * May be a subtype or part of an offered asset.
3959         */
3960        @Child(name = "subtype", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3961        @Description(shortDefinition="Asset sub-category", formalDefinition="May be a subtype or part of an offered asset." )
3962        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-assetsubtype")
3963        protected List<CodeableConcept> subtype;
3964
3965        /**
3966         * 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.
3967         */
3968        @Child(name = "relationship", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false)
3969        @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." )
3970        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-content-class")
3971        protected Coding relationship;
3972
3973        /**
3974         * Circumstance of the asset.
3975         */
3976        @Child(name = "context", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3977        @Description(shortDefinition="Circumstance of the asset", formalDefinition="Circumstance of the asset." )
3978        protected List<AssetContextComponent> context;
3979
3980        /**
3981         * Description of the quality and completeness of the asset that imay be a factor in its valuation.
3982         */
3983        @Child(name = "condition", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
3984        @Description(shortDefinition="Quality desctiption of asset", formalDefinition="Description of the quality and completeness of the asset that imay be a factor in its valuation." )
3985        protected StringType condition;
3986
3987        /**
3988         * Type of Asset availability for use or ownership.
3989         */
3990        @Child(name = "periodType", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3991        @Description(shortDefinition="Asset availability types", formalDefinition="Type of Asset availability for use or ownership." )
3992        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/asset-availability")
3993        protected List<CodeableConcept> periodType;
3994
3995        /**
3996         * Asset relevant contractual time period.
3997         */
3998        @Child(name = "period", type = {Period.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3999        @Description(shortDefinition="Time period of the asset", formalDefinition="Asset relevant contractual time period." )
4000        protected List<Period> period;
4001
4002        /**
4003         * Time period of asset use.
4004         */
4005        @Child(name = "usePeriod", type = {Period.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4006        @Description(shortDefinition="Time period", formalDefinition="Time period of asset use." )
4007        protected List<Period> usePeriod;
4008
4009        /**
4010         * Clause or question text (Prose Object) concerning the asset in a linked form, such as a QuestionnaireResponse used in the formation of the contract.
4011         */
4012        @Child(name = "text", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false)
4013        @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." )
4014        protected StringType text;
4015
4016        /**
4017         * Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.
4018         */
4019        @Child(name = "linkId", type = {StringType.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4020        @Description(shortDefinition="Pointer to asset text", formalDefinition="Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse." )
4021        protected List<StringType> linkId;
4022
4023        /**
4024         * Response to assets.
4025         */
4026        @Child(name = "answer", type = {AnswerComponent.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4027        @Description(shortDefinition="Response to assets", formalDefinition="Response to assets." )
4028        protected List<AnswerComponent> answer;
4029
4030        /**
4031         * Security labels that protects the asset.
4032         */
4033        @Child(name = "securityLabelNumber", type = {UnsignedIntType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4034        @Description(shortDefinition="Asset restriction numbers", formalDefinition="Security labels that protects the asset." )
4035        protected List<UnsignedIntType> securityLabelNumber;
4036
4037        /**
4038         * Contract Valued Item List.
4039         */
4040        @Child(name = "valuedItem", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4041        @Description(shortDefinition="Contract Valued Item List", formalDefinition="Contract Valued Item List." )
4042        protected List<ValuedItemComponent> valuedItem;
4043
4044        private static final long serialVersionUID = -1080398792L;
4045
4046    /**
4047     * Constructor
4048     */
4049      public ContractAssetComponent() {
4050        super();
4051      }
4052
4053        /**
4054         * @return {@link #scope} (Differentiates the kind of the asset .)
4055         */
4056        public CodeableConcept getScope() { 
4057          if (this.scope == null)
4058            if (Configuration.errorOnAutoCreate())
4059              throw new Error("Attempt to auto-create ContractAssetComponent.scope");
4060            else if (Configuration.doAutoCreate())
4061              this.scope = new CodeableConcept(); // cc
4062          return this.scope;
4063        }
4064
4065        public boolean hasScope() { 
4066          return this.scope != null && !this.scope.isEmpty();
4067        }
4068
4069        /**
4070         * @param value {@link #scope} (Differentiates the kind of the asset .)
4071         */
4072        public ContractAssetComponent setScope(CodeableConcept value) { 
4073          this.scope = value;
4074          return this;
4075        }
4076
4077        /**
4078         * @return {@link #type} (Target entity type about which the term may be concerned.)
4079         */
4080        public List<CodeableConcept> getType() { 
4081          if (this.type == null)
4082            this.type = new ArrayList<CodeableConcept>();
4083          return this.type;
4084        }
4085
4086        /**
4087         * @return Returns a reference to <code>this</code> for easy method chaining
4088         */
4089        public ContractAssetComponent setType(List<CodeableConcept> theType) { 
4090          this.type = theType;
4091          return this;
4092        }
4093
4094        public boolean hasType() { 
4095          if (this.type == null)
4096            return false;
4097          for (CodeableConcept item : this.type)
4098            if (!item.isEmpty())
4099              return true;
4100          return false;
4101        }
4102
4103        public CodeableConcept addType() { //3
4104          CodeableConcept t = new CodeableConcept();
4105          if (this.type == null)
4106            this.type = new ArrayList<CodeableConcept>();
4107          this.type.add(t);
4108          return t;
4109        }
4110
4111        public ContractAssetComponent addType(CodeableConcept t) { //3
4112          if (t == null)
4113            return this;
4114          if (this.type == null)
4115            this.type = new ArrayList<CodeableConcept>();
4116          this.type.add(t);
4117          return this;
4118        }
4119
4120        /**
4121         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist
4122         */
4123        public CodeableConcept getTypeFirstRep() { 
4124          if (getType().isEmpty()) {
4125            addType();
4126          }
4127          return getType().get(0);
4128        }
4129
4130        /**
4131         * @return {@link #typeReference} (Associated entities.)
4132         */
4133        public List<Reference> getTypeReference() { 
4134          if (this.typeReference == null)
4135            this.typeReference = new ArrayList<Reference>();
4136          return this.typeReference;
4137        }
4138
4139        /**
4140         * @return Returns a reference to <code>this</code> for easy method chaining
4141         */
4142        public ContractAssetComponent setTypeReference(List<Reference> theTypeReference) { 
4143          this.typeReference = theTypeReference;
4144          return this;
4145        }
4146
4147        public boolean hasTypeReference() { 
4148          if (this.typeReference == null)
4149            return false;
4150          for (Reference item : this.typeReference)
4151            if (!item.isEmpty())
4152              return true;
4153          return false;
4154        }
4155
4156        public Reference addTypeReference() { //3
4157          Reference t = new Reference();
4158          if (this.typeReference == null)
4159            this.typeReference = new ArrayList<Reference>();
4160          this.typeReference.add(t);
4161          return t;
4162        }
4163
4164        public ContractAssetComponent addTypeReference(Reference t) { //3
4165          if (t == null)
4166            return this;
4167          if (this.typeReference == null)
4168            this.typeReference = new ArrayList<Reference>();
4169          this.typeReference.add(t);
4170          return this;
4171        }
4172
4173        /**
4174         * @return The first repetition of repeating field {@link #typeReference}, creating it if it does not already exist
4175         */
4176        public Reference getTypeReferenceFirstRep() { 
4177          if (getTypeReference().isEmpty()) {
4178            addTypeReference();
4179          }
4180          return getTypeReference().get(0);
4181        }
4182
4183        /**
4184         * @deprecated Use Reference#setResource(IBaseResource) instead
4185         */
4186        @Deprecated
4187        public List<Resource> getTypeReferenceTarget() { 
4188          if (this.typeReferenceTarget == null)
4189            this.typeReferenceTarget = new ArrayList<Resource>();
4190          return this.typeReferenceTarget;
4191        }
4192
4193        /**
4194         * @return {@link #subtype} (May be a subtype or part of an offered asset.)
4195         */
4196        public List<CodeableConcept> getSubtype() { 
4197          if (this.subtype == null)
4198            this.subtype = new ArrayList<CodeableConcept>();
4199          return this.subtype;
4200        }
4201
4202        /**
4203         * @return Returns a reference to <code>this</code> for easy method chaining
4204         */
4205        public ContractAssetComponent setSubtype(List<CodeableConcept> theSubtype) { 
4206          this.subtype = theSubtype;
4207          return this;
4208        }
4209
4210        public boolean hasSubtype() { 
4211          if (this.subtype == null)
4212            return false;
4213          for (CodeableConcept item : this.subtype)
4214            if (!item.isEmpty())
4215              return true;
4216          return false;
4217        }
4218
4219        public CodeableConcept addSubtype() { //3
4220          CodeableConcept t = new CodeableConcept();
4221          if (this.subtype == null)
4222            this.subtype = new ArrayList<CodeableConcept>();
4223          this.subtype.add(t);
4224          return t;
4225        }
4226
4227        public ContractAssetComponent addSubtype(CodeableConcept t) { //3
4228          if (t == null)
4229            return this;
4230          if (this.subtype == null)
4231            this.subtype = new ArrayList<CodeableConcept>();
4232          this.subtype.add(t);
4233          return this;
4234        }
4235
4236        /**
4237         * @return The first repetition of repeating field {@link #subtype}, creating it if it does not already exist
4238         */
4239        public CodeableConcept getSubtypeFirstRep() { 
4240          if (getSubtype().isEmpty()) {
4241            addSubtype();
4242          }
4243          return getSubtype().get(0);
4244        }
4245
4246        /**
4247         * @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.)
4248         */
4249        public Coding getRelationship() { 
4250          if (this.relationship == null)
4251            if (Configuration.errorOnAutoCreate())
4252              throw new Error("Attempt to auto-create ContractAssetComponent.relationship");
4253            else if (Configuration.doAutoCreate())
4254              this.relationship = new Coding(); // cc
4255          return this.relationship;
4256        }
4257
4258        public boolean hasRelationship() { 
4259          return this.relationship != null && !this.relationship.isEmpty();
4260        }
4261
4262        /**
4263         * @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.)
4264         */
4265        public ContractAssetComponent setRelationship(Coding value) { 
4266          this.relationship = value;
4267          return this;
4268        }
4269
4270        /**
4271         * @return {@link #context} (Circumstance of the asset.)
4272         */
4273        public List<AssetContextComponent> getContext() { 
4274          if (this.context == null)
4275            this.context = new ArrayList<AssetContextComponent>();
4276          return this.context;
4277        }
4278
4279        /**
4280         * @return Returns a reference to <code>this</code> for easy method chaining
4281         */
4282        public ContractAssetComponent setContext(List<AssetContextComponent> theContext) { 
4283          this.context = theContext;
4284          return this;
4285        }
4286
4287        public boolean hasContext() { 
4288          if (this.context == null)
4289            return false;
4290          for (AssetContextComponent item : this.context)
4291            if (!item.isEmpty())
4292              return true;
4293          return false;
4294        }
4295
4296        public AssetContextComponent addContext() { //3
4297          AssetContextComponent t = new AssetContextComponent();
4298          if (this.context == null)
4299            this.context = new ArrayList<AssetContextComponent>();
4300          this.context.add(t);
4301          return t;
4302        }
4303
4304        public ContractAssetComponent addContext(AssetContextComponent t) { //3
4305          if (t == null)
4306            return this;
4307          if (this.context == null)
4308            this.context = new ArrayList<AssetContextComponent>();
4309          this.context.add(t);
4310          return this;
4311        }
4312
4313        /**
4314         * @return The first repetition of repeating field {@link #context}, creating it if it does not already exist
4315         */
4316        public AssetContextComponent getContextFirstRep() { 
4317          if (getContext().isEmpty()) {
4318            addContext();
4319          }
4320          return getContext().get(0);
4321        }
4322
4323        /**
4324         * @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
4325         */
4326        public StringType getConditionElement() { 
4327          if (this.condition == null)
4328            if (Configuration.errorOnAutoCreate())
4329              throw new Error("Attempt to auto-create ContractAssetComponent.condition");
4330            else if (Configuration.doAutoCreate())
4331              this.condition = new StringType(); // bb
4332          return this.condition;
4333        }
4334
4335        public boolean hasConditionElement() { 
4336          return this.condition != null && !this.condition.isEmpty();
4337        }
4338
4339        public boolean hasCondition() { 
4340          return this.condition != null && !this.condition.isEmpty();
4341        }
4342
4343        /**
4344         * @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
4345         */
4346        public ContractAssetComponent setConditionElement(StringType value) { 
4347          this.condition = value;
4348          return this;
4349        }
4350
4351        /**
4352         * @return Description of the quality and completeness of the asset that imay be a factor in its valuation.
4353         */
4354        public String getCondition() { 
4355          return this.condition == null ? null : this.condition.getValue();
4356        }
4357
4358        /**
4359         * @param value Description of the quality and completeness of the asset that imay be a factor in its valuation.
4360         */
4361        public ContractAssetComponent setCondition(String value) { 
4362          if (Utilities.noString(value))
4363            this.condition = null;
4364          else {
4365            if (this.condition == null)
4366              this.condition = new StringType();
4367            this.condition.setValue(value);
4368          }
4369          return this;
4370        }
4371
4372        /**
4373         * @return {@link #periodType} (Type of Asset availability for use or ownership.)
4374         */
4375        public List<CodeableConcept> getPeriodType() { 
4376          if (this.periodType == null)
4377            this.periodType = new ArrayList<CodeableConcept>();
4378          return this.periodType;
4379        }
4380
4381        /**
4382         * @return Returns a reference to <code>this</code> for easy method chaining
4383         */
4384        public ContractAssetComponent setPeriodType(List<CodeableConcept> thePeriodType) { 
4385          this.periodType = thePeriodType;
4386          return this;
4387        }
4388
4389        public boolean hasPeriodType() { 
4390          if (this.periodType == null)
4391            return false;
4392          for (CodeableConcept item : this.periodType)
4393            if (!item.isEmpty())
4394              return true;
4395          return false;
4396        }
4397
4398        public CodeableConcept addPeriodType() { //3
4399          CodeableConcept t = new CodeableConcept();
4400          if (this.periodType == null)
4401            this.periodType = new ArrayList<CodeableConcept>();
4402          this.periodType.add(t);
4403          return t;
4404        }
4405
4406        public ContractAssetComponent addPeriodType(CodeableConcept t) { //3
4407          if (t == null)
4408            return this;
4409          if (this.periodType == null)
4410            this.periodType = new ArrayList<CodeableConcept>();
4411          this.periodType.add(t);
4412          return this;
4413        }
4414
4415        /**
4416         * @return The first repetition of repeating field {@link #periodType}, creating it if it does not already exist
4417         */
4418        public CodeableConcept getPeriodTypeFirstRep() { 
4419          if (getPeriodType().isEmpty()) {
4420            addPeriodType();
4421          }
4422          return getPeriodType().get(0);
4423        }
4424
4425        /**
4426         * @return {@link #period} (Asset relevant contractual time period.)
4427         */
4428        public List<Period> getPeriod() { 
4429          if (this.period == null)
4430            this.period = new ArrayList<Period>();
4431          return this.period;
4432        }
4433
4434        /**
4435         * @return Returns a reference to <code>this</code> for easy method chaining
4436         */
4437        public ContractAssetComponent setPeriod(List<Period> thePeriod) { 
4438          this.period = thePeriod;
4439          return this;
4440        }
4441
4442        public boolean hasPeriod() { 
4443          if (this.period == null)
4444            return false;
4445          for (Period item : this.period)
4446            if (!item.isEmpty())
4447              return true;
4448          return false;
4449        }
4450
4451        public Period addPeriod() { //3
4452          Period t = new Period();
4453          if (this.period == null)
4454            this.period = new ArrayList<Period>();
4455          this.period.add(t);
4456          return t;
4457        }
4458
4459        public ContractAssetComponent addPeriod(Period t) { //3
4460          if (t == null)
4461            return this;
4462          if (this.period == null)
4463            this.period = new ArrayList<Period>();
4464          this.period.add(t);
4465          return this;
4466        }
4467
4468        /**
4469         * @return The first repetition of repeating field {@link #period}, creating it if it does not already exist
4470         */
4471        public Period getPeriodFirstRep() { 
4472          if (getPeriod().isEmpty()) {
4473            addPeriod();
4474          }
4475          return getPeriod().get(0);
4476        }
4477
4478        /**
4479         * @return {@link #usePeriod} (Time period of asset use.)
4480         */
4481        public List<Period> getUsePeriod() { 
4482          if (this.usePeriod == null)
4483            this.usePeriod = new ArrayList<Period>();
4484          return this.usePeriod;
4485        }
4486
4487        /**
4488         * @return Returns a reference to <code>this</code> for easy method chaining
4489         */
4490        public ContractAssetComponent setUsePeriod(List<Period> theUsePeriod) { 
4491          this.usePeriod = theUsePeriod;
4492          return this;
4493        }
4494
4495        public boolean hasUsePeriod() { 
4496          if (this.usePeriod == null)
4497            return false;
4498          for (Period item : this.usePeriod)
4499            if (!item.isEmpty())
4500              return true;
4501          return false;
4502        }
4503
4504        public Period addUsePeriod() { //3
4505          Period t = new Period();
4506          if (this.usePeriod == null)
4507            this.usePeriod = new ArrayList<Period>();
4508          this.usePeriod.add(t);
4509          return t;
4510        }
4511
4512        public ContractAssetComponent addUsePeriod(Period t) { //3
4513          if (t == null)
4514            return this;
4515          if (this.usePeriod == null)
4516            this.usePeriod = new ArrayList<Period>();
4517          this.usePeriod.add(t);
4518          return this;
4519        }
4520
4521        /**
4522         * @return The first repetition of repeating field {@link #usePeriod}, creating it if it does not already exist
4523         */
4524        public Period getUsePeriodFirstRep() { 
4525          if (getUsePeriod().isEmpty()) {
4526            addUsePeriod();
4527          }
4528          return getUsePeriod().get(0);
4529        }
4530
4531        /**
4532         * @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
4533         */
4534        public StringType getTextElement() { 
4535          if (this.text == null)
4536            if (Configuration.errorOnAutoCreate())
4537              throw new Error("Attempt to auto-create ContractAssetComponent.text");
4538            else if (Configuration.doAutoCreate())
4539              this.text = new StringType(); // bb
4540          return this.text;
4541        }
4542
4543        public boolean hasTextElement() { 
4544          return this.text != null && !this.text.isEmpty();
4545        }
4546
4547        public boolean hasText() { 
4548          return this.text != null && !this.text.isEmpty();
4549        }
4550
4551        /**
4552         * @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
4553         */
4554        public ContractAssetComponent setTextElement(StringType value) { 
4555          this.text = value;
4556          return this;
4557        }
4558
4559        /**
4560         * @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.
4561         */
4562        public String getText() { 
4563          return this.text == null ? null : this.text.getValue();
4564        }
4565
4566        /**
4567         * @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.
4568         */
4569        public ContractAssetComponent setText(String value) { 
4570          if (Utilities.noString(value))
4571            this.text = null;
4572          else {
4573            if (this.text == null)
4574              this.text = new StringType();
4575            this.text.setValue(value);
4576          }
4577          return this;
4578        }
4579
4580        /**
4581         * @return {@link #linkId} (Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.)
4582         */
4583        public List<StringType> getLinkId() { 
4584          if (this.linkId == null)
4585            this.linkId = new ArrayList<StringType>();
4586          return this.linkId;
4587        }
4588
4589        /**
4590         * @return Returns a reference to <code>this</code> for easy method chaining
4591         */
4592        public ContractAssetComponent setLinkId(List<StringType> theLinkId) { 
4593          this.linkId = theLinkId;
4594          return this;
4595        }
4596
4597        public boolean hasLinkId() { 
4598          if (this.linkId == null)
4599            return false;
4600          for (StringType item : this.linkId)
4601            if (!item.isEmpty())
4602              return true;
4603          return false;
4604        }
4605
4606        /**
4607         * @return {@link #linkId} (Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.)
4608         */
4609        public StringType addLinkIdElement() {//2 
4610          StringType t = new StringType();
4611          if (this.linkId == null)
4612            this.linkId = new ArrayList<StringType>();
4613          this.linkId.add(t);
4614          return t;
4615        }
4616
4617        /**
4618         * @param value {@link #linkId} (Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.)
4619         */
4620        public ContractAssetComponent addLinkId(String value) { //1
4621          StringType t = new StringType();
4622          t.setValue(value);
4623          if (this.linkId == null)
4624            this.linkId = new ArrayList<StringType>();
4625          this.linkId.add(t);
4626          return this;
4627        }
4628
4629        /**
4630         * @param value {@link #linkId} (Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.)
4631         */
4632        public boolean hasLinkId(String value) { 
4633          if (this.linkId == null)
4634            return false;
4635          for (StringType v : this.linkId)
4636            if (v.getValue().equals(value)) // string
4637              return true;
4638          return false;
4639        }
4640
4641        /**
4642         * @return {@link #answer} (Response to assets.)
4643         */
4644        public List<AnswerComponent> getAnswer() { 
4645          if (this.answer == null)
4646            this.answer = new ArrayList<AnswerComponent>();
4647          return this.answer;
4648        }
4649
4650        /**
4651         * @return Returns a reference to <code>this</code> for easy method chaining
4652         */
4653        public ContractAssetComponent setAnswer(List<AnswerComponent> theAnswer) { 
4654          this.answer = theAnswer;
4655          return this;
4656        }
4657
4658        public boolean hasAnswer() { 
4659          if (this.answer == null)
4660            return false;
4661          for (AnswerComponent item : this.answer)
4662            if (!item.isEmpty())
4663              return true;
4664          return false;
4665        }
4666
4667        public AnswerComponent addAnswer() { //3
4668          AnswerComponent t = new AnswerComponent();
4669          if (this.answer == null)
4670            this.answer = new ArrayList<AnswerComponent>();
4671          this.answer.add(t);
4672          return t;
4673        }
4674
4675        public ContractAssetComponent addAnswer(AnswerComponent t) { //3
4676          if (t == null)
4677            return this;
4678          if (this.answer == null)
4679            this.answer = new ArrayList<AnswerComponent>();
4680          this.answer.add(t);
4681          return this;
4682        }
4683
4684        /**
4685         * @return The first repetition of repeating field {@link #answer}, creating it if it does not already exist
4686         */
4687        public AnswerComponent getAnswerFirstRep() { 
4688          if (getAnswer().isEmpty()) {
4689            addAnswer();
4690          }
4691          return getAnswer().get(0);
4692        }
4693
4694        /**
4695         * @return {@link #securityLabelNumber} (Security labels that protects the asset.)
4696         */
4697        public List<UnsignedIntType> getSecurityLabelNumber() { 
4698          if (this.securityLabelNumber == null)
4699            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
4700          return this.securityLabelNumber;
4701        }
4702
4703        /**
4704         * @return Returns a reference to <code>this</code> for easy method chaining
4705         */
4706        public ContractAssetComponent setSecurityLabelNumber(List<UnsignedIntType> theSecurityLabelNumber) { 
4707          this.securityLabelNumber = theSecurityLabelNumber;
4708          return this;
4709        }
4710
4711        public boolean hasSecurityLabelNumber() { 
4712          if (this.securityLabelNumber == null)
4713            return false;
4714          for (UnsignedIntType item : this.securityLabelNumber)
4715            if (!item.isEmpty())
4716              return true;
4717          return false;
4718        }
4719
4720        /**
4721         * @return {@link #securityLabelNumber} (Security labels that protects the asset.)
4722         */
4723        public UnsignedIntType addSecurityLabelNumberElement() {//2 
4724          UnsignedIntType t = new UnsignedIntType();
4725          if (this.securityLabelNumber == null)
4726            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
4727          this.securityLabelNumber.add(t);
4728          return t;
4729        }
4730
4731        /**
4732         * @param value {@link #securityLabelNumber} (Security labels that protects the asset.)
4733         */
4734        public ContractAssetComponent addSecurityLabelNumber(int value) { //1
4735          UnsignedIntType t = new UnsignedIntType();
4736          t.setValue(value);
4737          if (this.securityLabelNumber == null)
4738            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
4739          this.securityLabelNumber.add(t);
4740          return this;
4741        }
4742
4743        /**
4744         * @param value {@link #securityLabelNumber} (Security labels that protects the asset.)
4745         */
4746        public boolean hasSecurityLabelNumber(int value) { 
4747          if (this.securityLabelNumber == null)
4748            return false;
4749          for (UnsignedIntType v : this.securityLabelNumber)
4750            if (v.getValue().equals(value)) // unsignedInt
4751              return true;
4752          return false;
4753        }
4754
4755        /**
4756         * @return {@link #valuedItem} (Contract Valued Item List.)
4757         */
4758        public List<ValuedItemComponent> getValuedItem() { 
4759          if (this.valuedItem == null)
4760            this.valuedItem = new ArrayList<ValuedItemComponent>();
4761          return this.valuedItem;
4762        }
4763
4764        /**
4765         * @return Returns a reference to <code>this</code> for easy method chaining
4766         */
4767        public ContractAssetComponent setValuedItem(List<ValuedItemComponent> theValuedItem) { 
4768          this.valuedItem = theValuedItem;
4769          return this;
4770        }
4771
4772        public boolean hasValuedItem() { 
4773          if (this.valuedItem == null)
4774            return false;
4775          for (ValuedItemComponent item : this.valuedItem)
4776            if (!item.isEmpty())
4777              return true;
4778          return false;
4779        }
4780
4781        public ValuedItemComponent addValuedItem() { //3
4782          ValuedItemComponent t = new ValuedItemComponent();
4783          if (this.valuedItem == null)
4784            this.valuedItem = new ArrayList<ValuedItemComponent>();
4785          this.valuedItem.add(t);
4786          return t;
4787        }
4788
4789        public ContractAssetComponent addValuedItem(ValuedItemComponent t) { //3
4790          if (t == null)
4791            return this;
4792          if (this.valuedItem == null)
4793            this.valuedItem = new ArrayList<ValuedItemComponent>();
4794          this.valuedItem.add(t);
4795          return this;
4796        }
4797
4798        /**
4799         * @return The first repetition of repeating field {@link #valuedItem}, creating it if it does not already exist
4800         */
4801        public ValuedItemComponent getValuedItemFirstRep() { 
4802          if (getValuedItem().isEmpty()) {
4803            addValuedItem();
4804          }
4805          return getValuedItem().get(0);
4806        }
4807
4808        protected void listChildren(List<Property> children) {
4809          super.listChildren(children);
4810          children.add(new Property("scope", "CodeableConcept", "Differentiates the kind of the asset .", 0, 1, scope));
4811          children.add(new Property("type", "CodeableConcept", "Target entity type about which the term may be concerned.", 0, java.lang.Integer.MAX_VALUE, type));
4812          children.add(new Property("typeReference", "Reference(Any)", "Associated entities.", 0, java.lang.Integer.MAX_VALUE, typeReference));
4813          children.add(new Property("subtype", "CodeableConcept", "May be a subtype or part of an offered asset.", 0, java.lang.Integer.MAX_VALUE, subtype));
4814          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));
4815          children.add(new Property("context", "", "Circumstance of the asset.", 0, java.lang.Integer.MAX_VALUE, context));
4816          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));
4817          children.add(new Property("periodType", "CodeableConcept", "Type of Asset availability for use or ownership.", 0, java.lang.Integer.MAX_VALUE, periodType));
4818          children.add(new Property("period", "Period", "Asset relevant contractual time period.", 0, java.lang.Integer.MAX_VALUE, period));
4819          children.add(new Property("usePeriod", "Period", "Time period of asset use.", 0, java.lang.Integer.MAX_VALUE, usePeriod));
4820          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));
4821          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));
4822          children.add(new Property("answer", "@Contract.term.offer.answer", "Response to assets.", 0, java.lang.Integer.MAX_VALUE, answer));
4823          children.add(new Property("securityLabelNumber", "unsignedInt", "Security labels that protects the asset.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber));
4824          children.add(new Property("valuedItem", "", "Contract Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem));
4825        }
4826
4827        @Override
4828        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4829          switch (_hash) {
4830          case 109264468: /*scope*/  return new Property("scope", "CodeableConcept", "Differentiates the kind of the asset .", 0, 1, scope);
4831          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);
4832          case 2074825009: /*typeReference*/  return new Property("typeReference", "Reference(Any)", "Associated entities.", 0, java.lang.Integer.MAX_VALUE, typeReference);
4833          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);
4834          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);
4835          case 951530927: /*context*/  return new Property("context", "", "Circumstance of the asset.", 0, java.lang.Integer.MAX_VALUE, context);
4836          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);
4837          case 384348315: /*periodType*/  return new Property("periodType", "CodeableConcept", "Type of Asset availability for use or ownership.", 0, java.lang.Integer.MAX_VALUE, periodType);
4838          case -991726143: /*period*/  return new Property("period", "Period", "Asset relevant contractual time period.", 0, java.lang.Integer.MAX_VALUE, period);
4839          case -628382168: /*usePeriod*/  return new Property("usePeriod", "Period", "Time period of asset use.", 0, java.lang.Integer.MAX_VALUE, usePeriod);
4840          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);
4841          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);
4842          case -1412808770: /*answer*/  return new Property("answer", "@Contract.term.offer.answer", "Response to assets.", 0, java.lang.Integer.MAX_VALUE, answer);
4843          case -149460995: /*securityLabelNumber*/  return new Property("securityLabelNumber", "unsignedInt", "Security labels that protects the asset.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber);
4844          case 2046675654: /*valuedItem*/  return new Property("valuedItem", "", "Contract Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem);
4845          default: return super.getNamedProperty(_hash, _name, _checkValid);
4846          }
4847
4848        }
4849
4850      @Override
4851      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4852        switch (hash) {
4853        case 109264468: /*scope*/ return this.scope == null ? new Base[0] : new Base[] {this.scope}; // CodeableConcept
4854        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
4855        case 2074825009: /*typeReference*/ return this.typeReference == null ? new Base[0] : this.typeReference.toArray(new Base[this.typeReference.size()]); // Reference
4856        case -1867567750: /*subtype*/ return this.subtype == null ? new Base[0] : this.subtype.toArray(new Base[this.subtype.size()]); // CodeableConcept
4857        case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding
4858        case 951530927: /*context*/ return this.context == null ? new Base[0] : this.context.toArray(new Base[this.context.size()]); // AssetContextComponent
4859        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // StringType
4860        case 384348315: /*periodType*/ return this.periodType == null ? new Base[0] : this.periodType.toArray(new Base[this.periodType.size()]); // CodeableConcept
4861        case -991726143: /*period*/ return this.period == null ? new Base[0] : this.period.toArray(new Base[this.period.size()]); // Period
4862        case -628382168: /*usePeriod*/ return this.usePeriod == null ? new Base[0] : this.usePeriod.toArray(new Base[this.usePeriod.size()]); // Period
4863        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
4864        case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : this.linkId.toArray(new Base[this.linkId.size()]); // StringType
4865        case -1412808770: /*answer*/ return this.answer == null ? new Base[0] : this.answer.toArray(new Base[this.answer.size()]); // AnswerComponent
4866        case -149460995: /*securityLabelNumber*/ return this.securityLabelNumber == null ? new Base[0] : this.securityLabelNumber.toArray(new Base[this.securityLabelNumber.size()]); // UnsignedIntType
4867        case 2046675654: /*valuedItem*/ return this.valuedItem == null ? new Base[0] : this.valuedItem.toArray(new Base[this.valuedItem.size()]); // ValuedItemComponent
4868        default: return super.getProperty(hash, name, checkValid);
4869        }
4870
4871      }
4872
4873      @Override
4874      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4875        switch (hash) {
4876        case 109264468: // scope
4877          this.scope = castToCodeableConcept(value); // CodeableConcept
4878          return value;
4879        case 3575610: // type
4880          this.getType().add(castToCodeableConcept(value)); // CodeableConcept
4881          return value;
4882        case 2074825009: // typeReference
4883          this.getTypeReference().add(castToReference(value)); // Reference
4884          return value;
4885        case -1867567750: // subtype
4886          this.getSubtype().add(castToCodeableConcept(value)); // CodeableConcept
4887          return value;
4888        case -261851592: // relationship
4889          this.relationship = castToCoding(value); // Coding
4890          return value;
4891        case 951530927: // context
4892          this.getContext().add((AssetContextComponent) value); // AssetContextComponent
4893          return value;
4894        case -861311717: // condition
4895          this.condition = castToString(value); // StringType
4896          return value;
4897        case 384348315: // periodType
4898          this.getPeriodType().add(castToCodeableConcept(value)); // CodeableConcept
4899          return value;
4900        case -991726143: // period
4901          this.getPeriod().add(castToPeriod(value)); // Period
4902          return value;
4903        case -628382168: // usePeriod
4904          this.getUsePeriod().add(castToPeriod(value)); // Period
4905          return value;
4906        case 3556653: // text
4907          this.text = castToString(value); // StringType
4908          return value;
4909        case -1102667083: // linkId
4910          this.getLinkId().add(castToString(value)); // StringType
4911          return value;
4912        case -1412808770: // answer
4913          this.getAnswer().add((AnswerComponent) value); // AnswerComponent
4914          return value;
4915        case -149460995: // securityLabelNumber
4916          this.getSecurityLabelNumber().add(castToUnsignedInt(value)); // UnsignedIntType
4917          return value;
4918        case 2046675654: // valuedItem
4919          this.getValuedItem().add((ValuedItemComponent) value); // ValuedItemComponent
4920          return value;
4921        default: return super.setProperty(hash, name, value);
4922        }
4923
4924      }
4925
4926      @Override
4927      public Base setProperty(String name, Base value) throws FHIRException {
4928        if (name.equals("scope")) {
4929          this.scope = castToCodeableConcept(value); // CodeableConcept
4930        } else if (name.equals("type")) {
4931          this.getType().add(castToCodeableConcept(value));
4932        } else if (name.equals("typeReference")) {
4933          this.getTypeReference().add(castToReference(value));
4934        } else if (name.equals("subtype")) {
4935          this.getSubtype().add(castToCodeableConcept(value));
4936        } else if (name.equals("relationship")) {
4937          this.relationship = castToCoding(value); // Coding
4938        } else if (name.equals("context")) {
4939          this.getContext().add((AssetContextComponent) value);
4940        } else if (name.equals("condition")) {
4941          this.condition = castToString(value); // StringType
4942        } else if (name.equals("periodType")) {
4943          this.getPeriodType().add(castToCodeableConcept(value));
4944        } else if (name.equals("period")) {
4945          this.getPeriod().add(castToPeriod(value));
4946        } else if (name.equals("usePeriod")) {
4947          this.getUsePeriod().add(castToPeriod(value));
4948        } else if (name.equals("text")) {
4949          this.text = castToString(value); // StringType
4950        } else if (name.equals("linkId")) {
4951          this.getLinkId().add(castToString(value));
4952        } else if (name.equals("answer")) {
4953          this.getAnswer().add((AnswerComponent) value);
4954        } else if (name.equals("securityLabelNumber")) {
4955          this.getSecurityLabelNumber().add(castToUnsignedInt(value));
4956        } else if (name.equals("valuedItem")) {
4957          this.getValuedItem().add((ValuedItemComponent) value);
4958        } else
4959          return super.setProperty(name, value);
4960        return value;
4961      }
4962
4963      @Override
4964      public Base makeProperty(int hash, String name) throws FHIRException {
4965        switch (hash) {
4966        case 109264468:  return getScope(); 
4967        case 3575610:  return addType(); 
4968        case 2074825009:  return addTypeReference(); 
4969        case -1867567750:  return addSubtype(); 
4970        case -261851592:  return getRelationship(); 
4971        case 951530927:  return addContext(); 
4972        case -861311717:  return getConditionElement();
4973        case 384348315:  return addPeriodType(); 
4974        case -991726143:  return addPeriod(); 
4975        case -628382168:  return addUsePeriod(); 
4976        case 3556653:  return getTextElement();
4977        case -1102667083:  return addLinkIdElement();
4978        case -1412808770:  return addAnswer(); 
4979        case -149460995:  return addSecurityLabelNumberElement();
4980        case 2046675654:  return addValuedItem(); 
4981        default: return super.makeProperty(hash, name);
4982        }
4983
4984      }
4985
4986      @Override
4987      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4988        switch (hash) {
4989        case 109264468: /*scope*/ return new String[] {"CodeableConcept"};
4990        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
4991        case 2074825009: /*typeReference*/ return new String[] {"Reference"};
4992        case -1867567750: /*subtype*/ return new String[] {"CodeableConcept"};
4993        case -261851592: /*relationship*/ return new String[] {"Coding"};
4994        case 951530927: /*context*/ return new String[] {};
4995        case -861311717: /*condition*/ return new String[] {"string"};
4996        case 384348315: /*periodType*/ return new String[] {"CodeableConcept"};
4997        case -991726143: /*period*/ return new String[] {"Period"};
4998        case -628382168: /*usePeriod*/ return new String[] {"Period"};
4999        case 3556653: /*text*/ return new String[] {"string"};
5000        case -1102667083: /*linkId*/ return new String[] {"string"};
5001        case -1412808770: /*answer*/ return new String[] {"@Contract.term.offer.answer"};
5002        case -149460995: /*securityLabelNumber*/ return new String[] {"unsignedInt"};
5003        case 2046675654: /*valuedItem*/ return new String[] {};
5004        default: return super.getTypesForProperty(hash, name);
5005        }
5006
5007      }
5008
5009      @Override
5010      public Base addChild(String name) throws FHIRException {
5011        if (name.equals("scope")) {
5012          this.scope = new CodeableConcept();
5013          return this.scope;
5014        }
5015        else if (name.equals("type")) {
5016          return addType();
5017        }
5018        else if (name.equals("typeReference")) {
5019          return addTypeReference();
5020        }
5021        else if (name.equals("subtype")) {
5022          return addSubtype();
5023        }
5024        else if (name.equals("relationship")) {
5025          this.relationship = new Coding();
5026          return this.relationship;
5027        }
5028        else if (name.equals("context")) {
5029          return addContext();
5030        }
5031        else if (name.equals("condition")) {
5032          throw new FHIRException("Cannot call addChild on a primitive type Contract.condition");
5033        }
5034        else if (name.equals("periodType")) {
5035          return addPeriodType();
5036        }
5037        else if (name.equals("period")) {
5038          return addPeriod();
5039        }
5040        else if (name.equals("usePeriod")) {
5041          return addUsePeriod();
5042        }
5043        else if (name.equals("text")) {
5044          throw new FHIRException("Cannot call addChild on a primitive type Contract.text");
5045        }
5046        else if (name.equals("linkId")) {
5047          throw new FHIRException("Cannot call addChild on a primitive type Contract.linkId");
5048        }
5049        else if (name.equals("answer")) {
5050          return addAnswer();
5051        }
5052        else if (name.equals("securityLabelNumber")) {
5053          throw new FHIRException("Cannot call addChild on a primitive type Contract.securityLabelNumber");
5054        }
5055        else if (name.equals("valuedItem")) {
5056          return addValuedItem();
5057        }
5058        else
5059          return super.addChild(name);
5060      }
5061
5062      public ContractAssetComponent copy() {
5063        ContractAssetComponent dst = new ContractAssetComponent();
5064        copyValues(dst);
5065        return dst;
5066      }
5067
5068      public void copyValues(ContractAssetComponent dst) {
5069        super.copyValues(dst);
5070        dst.scope = scope == null ? null : scope.copy();
5071        if (type != null) {
5072          dst.type = new ArrayList<CodeableConcept>();
5073          for (CodeableConcept i : type)
5074            dst.type.add(i.copy());
5075        };
5076        if (typeReference != null) {
5077          dst.typeReference = new ArrayList<Reference>();
5078          for (Reference i : typeReference)
5079            dst.typeReference.add(i.copy());
5080        };
5081        if (subtype != null) {
5082          dst.subtype = new ArrayList<CodeableConcept>();
5083          for (CodeableConcept i : subtype)
5084            dst.subtype.add(i.copy());
5085        };
5086        dst.relationship = relationship == null ? null : relationship.copy();
5087        if (context != null) {
5088          dst.context = new ArrayList<AssetContextComponent>();
5089          for (AssetContextComponent i : context)
5090            dst.context.add(i.copy());
5091        };
5092        dst.condition = condition == null ? null : condition.copy();
5093        if (periodType != null) {
5094          dst.periodType = new ArrayList<CodeableConcept>();
5095          for (CodeableConcept i : periodType)
5096            dst.periodType.add(i.copy());
5097        };
5098        if (period != null) {
5099          dst.period = new ArrayList<Period>();
5100          for (Period i : period)
5101            dst.period.add(i.copy());
5102        };
5103        if (usePeriod != null) {
5104          dst.usePeriod = new ArrayList<Period>();
5105          for (Period i : usePeriod)
5106            dst.usePeriod.add(i.copy());
5107        };
5108        dst.text = text == null ? null : text.copy();
5109        if (linkId != null) {
5110          dst.linkId = new ArrayList<StringType>();
5111          for (StringType i : linkId)
5112            dst.linkId.add(i.copy());
5113        };
5114        if (answer != null) {
5115          dst.answer = new ArrayList<AnswerComponent>();
5116          for (AnswerComponent i : answer)
5117            dst.answer.add(i.copy());
5118        };
5119        if (securityLabelNumber != null) {
5120          dst.securityLabelNumber = new ArrayList<UnsignedIntType>();
5121          for (UnsignedIntType i : securityLabelNumber)
5122            dst.securityLabelNumber.add(i.copy());
5123        };
5124        if (valuedItem != null) {
5125          dst.valuedItem = new ArrayList<ValuedItemComponent>();
5126          for (ValuedItemComponent i : valuedItem)
5127            dst.valuedItem.add(i.copy());
5128        };
5129      }
5130
5131      @Override
5132      public boolean equalsDeep(Base other_) {
5133        if (!super.equalsDeep(other_))
5134          return false;
5135        if (!(other_ instanceof ContractAssetComponent))
5136          return false;
5137        ContractAssetComponent o = (ContractAssetComponent) other_;
5138        return compareDeep(scope, o.scope, true) && compareDeep(type, o.type, true) && compareDeep(typeReference, o.typeReference, true)
5139           && compareDeep(subtype, o.subtype, true) && compareDeep(relationship, o.relationship, true) && compareDeep(context, o.context, true)
5140           && compareDeep(condition, o.condition, true) && compareDeep(periodType, o.periodType, true) && compareDeep(period, o.period, true)
5141           && compareDeep(usePeriod, o.usePeriod, true) && compareDeep(text, o.text, true) && compareDeep(linkId, o.linkId, true)
5142           && compareDeep(answer, o.answer, true) && compareDeep(securityLabelNumber, o.securityLabelNumber, true)
5143           && compareDeep(valuedItem, o.valuedItem, true);
5144      }
5145
5146      @Override
5147      public boolean equalsShallow(Base other_) {
5148        if (!super.equalsShallow(other_))
5149          return false;
5150        if (!(other_ instanceof ContractAssetComponent))
5151          return false;
5152        ContractAssetComponent o = (ContractAssetComponent) other_;
5153        return compareValues(condition, o.condition, true) && compareValues(text, o.text, true) && compareValues(linkId, o.linkId, true)
5154           && compareValues(securityLabelNumber, o.securityLabelNumber, true);
5155      }
5156
5157      public boolean isEmpty() {
5158        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(scope, type, typeReference
5159          , subtype, relationship, context, condition, periodType, period, usePeriod, text
5160          , linkId, answer, securityLabelNumber, valuedItem);
5161      }
5162
5163  public String fhirType() {
5164    return "Contract.term.asset";
5165
5166  }
5167
5168  }
5169
5170    @Block()
5171    public static class AssetContextComponent extends BackboneElement implements IBaseBackboneElement {
5172        /**
5173         * Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository),  location held, e.g., building,  jurisdiction.
5174         */
5175        @Child(name = "reference", type = {Reference.class}, order=1, min=0, max=1, modifier=false, summary=false)
5176        @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." )
5177        protected Reference reference;
5178
5179        /**
5180         * The actual object that is the target of the reference (Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository),  location held, e.g., building,  jurisdiction.)
5181         */
5182        protected Resource referenceTarget;
5183
5184        /**
5185         * Coded representation of the context generally or of the Referenced entity, such as the asset holder type or location.
5186         */
5187        @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5188        @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." )
5189        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-assetcontext")
5190        protected List<CodeableConcept> code;
5191
5192        /**
5193         * Context description.
5194         */
5195        @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
5196        @Description(shortDefinition="Context description", formalDefinition="Context description." )
5197        protected StringType text;
5198
5199        private static final long serialVersionUID = -634115628L;
5200
5201    /**
5202     * Constructor
5203     */
5204      public AssetContextComponent() {
5205        super();
5206      }
5207
5208        /**
5209         * @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.)
5210         */
5211        public Reference getReference() { 
5212          if (this.reference == null)
5213            if (Configuration.errorOnAutoCreate())
5214              throw new Error("Attempt to auto-create AssetContextComponent.reference");
5215            else if (Configuration.doAutoCreate())
5216              this.reference = new Reference(); // cc
5217          return this.reference;
5218        }
5219
5220        public boolean hasReference() { 
5221          return this.reference != null && !this.reference.isEmpty();
5222        }
5223
5224        /**
5225         * @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.)
5226         */
5227        public AssetContextComponent setReference(Reference value) { 
5228          this.reference = value;
5229          return this;
5230        }
5231
5232        /**
5233         * @return {@link #reference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository),  location held, e.g., building,  jurisdiction.)
5234         */
5235        public Resource getReferenceTarget() { 
5236          return this.referenceTarget;
5237        }
5238
5239        /**
5240         * @param value {@link #reference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository),  location held, e.g., building,  jurisdiction.)
5241         */
5242        public AssetContextComponent setReferenceTarget(Resource value) { 
5243          this.referenceTarget = value;
5244          return this;
5245        }
5246
5247        /**
5248         * @return {@link #code} (Coded representation of the context generally or of the Referenced entity, such as the asset holder type or location.)
5249         */
5250        public List<CodeableConcept> getCode() { 
5251          if (this.code == null)
5252            this.code = new ArrayList<CodeableConcept>();
5253          return this.code;
5254        }
5255
5256        /**
5257         * @return Returns a reference to <code>this</code> for easy method chaining
5258         */
5259        public AssetContextComponent setCode(List<CodeableConcept> theCode) { 
5260          this.code = theCode;
5261          return this;
5262        }
5263
5264        public boolean hasCode() { 
5265          if (this.code == null)
5266            return false;
5267          for (CodeableConcept item : this.code)
5268            if (!item.isEmpty())
5269              return true;
5270          return false;
5271        }
5272
5273        public CodeableConcept addCode() { //3
5274          CodeableConcept t = new CodeableConcept();
5275          if (this.code == null)
5276            this.code = new ArrayList<CodeableConcept>();
5277          this.code.add(t);
5278          return t;
5279        }
5280
5281        public AssetContextComponent addCode(CodeableConcept t) { //3
5282          if (t == null)
5283            return this;
5284          if (this.code == null)
5285            this.code = new ArrayList<CodeableConcept>();
5286          this.code.add(t);
5287          return this;
5288        }
5289
5290        /**
5291         * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist
5292         */
5293        public CodeableConcept getCodeFirstRep() { 
5294          if (getCode().isEmpty()) {
5295            addCode();
5296          }
5297          return getCode().get(0);
5298        }
5299
5300        /**
5301         * @return {@link #text} (Context description.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
5302         */
5303        public StringType getTextElement() { 
5304          if (this.text == null)
5305            if (Configuration.errorOnAutoCreate())
5306              throw new Error("Attempt to auto-create AssetContextComponent.text");
5307            else if (Configuration.doAutoCreate())
5308              this.text = new StringType(); // bb
5309          return this.text;
5310        }
5311
5312        public boolean hasTextElement() { 
5313          return this.text != null && !this.text.isEmpty();
5314        }
5315
5316        public boolean hasText() { 
5317          return this.text != null && !this.text.isEmpty();
5318        }
5319
5320        /**
5321         * @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
5322         */
5323        public AssetContextComponent setTextElement(StringType value) { 
5324          this.text = value;
5325          return this;
5326        }
5327
5328        /**
5329         * @return Context description.
5330         */
5331        public String getText() { 
5332          return this.text == null ? null : this.text.getValue();
5333        }
5334
5335        /**
5336         * @param value Context description.
5337         */
5338        public AssetContextComponent setText(String value) { 
5339          if (Utilities.noString(value))
5340            this.text = null;
5341          else {
5342            if (this.text == null)
5343              this.text = new StringType();
5344            this.text.setValue(value);
5345          }
5346          return this;
5347        }
5348
5349        protected void listChildren(List<Property> children) {
5350          super.listChildren(children);
5351          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));
5352          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));
5353          children.add(new Property("text", "string", "Context description.", 0, 1, text));
5354        }
5355
5356        @Override
5357        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5358          switch (_hash) {
5359          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);
5360          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);
5361          case 3556653: /*text*/  return new Property("text", "string", "Context description.", 0, 1, text);
5362          default: return super.getNamedProperty(_hash, _name, _checkValid);
5363          }
5364
5365        }
5366
5367      @Override
5368      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5369        switch (hash) {
5370        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
5371        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept
5372        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
5373        default: return super.getProperty(hash, name, checkValid);
5374        }
5375
5376      }
5377
5378      @Override
5379      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5380        switch (hash) {
5381        case -925155509: // reference
5382          this.reference = castToReference(value); // Reference
5383          return value;
5384        case 3059181: // code
5385          this.getCode().add(castToCodeableConcept(value)); // CodeableConcept
5386          return value;
5387        case 3556653: // text
5388          this.text = castToString(value); // StringType
5389          return value;
5390        default: return super.setProperty(hash, name, value);
5391        }
5392
5393      }
5394
5395      @Override
5396      public Base setProperty(String name, Base value) throws FHIRException {
5397        if (name.equals("reference")) {
5398          this.reference = castToReference(value); // Reference
5399        } else if (name.equals("code")) {
5400          this.getCode().add(castToCodeableConcept(value));
5401        } else if (name.equals("text")) {
5402          this.text = castToString(value); // StringType
5403        } else
5404          return super.setProperty(name, value);
5405        return value;
5406      }
5407
5408      @Override
5409      public Base makeProperty(int hash, String name) throws FHIRException {
5410        switch (hash) {
5411        case -925155509:  return getReference(); 
5412        case 3059181:  return addCode(); 
5413        case 3556653:  return getTextElement();
5414        default: return super.makeProperty(hash, name);
5415        }
5416
5417      }
5418
5419      @Override
5420      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5421        switch (hash) {
5422        case -925155509: /*reference*/ return new String[] {"Reference"};
5423        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
5424        case 3556653: /*text*/ return new String[] {"string"};
5425        default: return super.getTypesForProperty(hash, name);
5426        }
5427
5428      }
5429
5430      @Override
5431      public Base addChild(String name) throws FHIRException {
5432        if (name.equals("reference")) {
5433          this.reference = new Reference();
5434          return this.reference;
5435        }
5436        else if (name.equals("code")) {
5437          return addCode();
5438        }
5439        else if (name.equals("text")) {
5440          throw new FHIRException("Cannot call addChild on a primitive type Contract.text");
5441        }
5442        else
5443          return super.addChild(name);
5444      }
5445
5446      public AssetContextComponent copy() {
5447        AssetContextComponent dst = new AssetContextComponent();
5448        copyValues(dst);
5449        return dst;
5450      }
5451
5452      public void copyValues(AssetContextComponent dst) {
5453        super.copyValues(dst);
5454        dst.reference = reference == null ? null : reference.copy();
5455        if (code != null) {
5456          dst.code = new ArrayList<CodeableConcept>();
5457          for (CodeableConcept i : code)
5458            dst.code.add(i.copy());
5459        };
5460        dst.text = text == null ? null : text.copy();
5461      }
5462
5463      @Override
5464      public boolean equalsDeep(Base other_) {
5465        if (!super.equalsDeep(other_))
5466          return false;
5467        if (!(other_ instanceof AssetContextComponent))
5468          return false;
5469        AssetContextComponent o = (AssetContextComponent) other_;
5470        return compareDeep(reference, o.reference, true) && compareDeep(code, o.code, true) && compareDeep(text, o.text, true)
5471          ;
5472      }
5473
5474      @Override
5475      public boolean equalsShallow(Base other_) {
5476        if (!super.equalsShallow(other_))
5477          return false;
5478        if (!(other_ instanceof AssetContextComponent))
5479          return false;
5480        AssetContextComponent o = (AssetContextComponent) other_;
5481        return compareValues(text, o.text, true);
5482      }
5483
5484      public boolean isEmpty() {
5485        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(reference, code, text);
5486      }
5487
5488  public String fhirType() {
5489    return "Contract.term.asset.context";
5490
5491  }
5492
5493  }
5494
5495    @Block()
5496    public static class ValuedItemComponent extends BackboneElement implements IBaseBackboneElement {
5497        /**
5498         * Specific type of Contract Valued Item that may be priced.
5499         */
5500        @Child(name = "entity", type = {CodeableConcept.class, Reference.class}, order=1, min=0, max=1, modifier=false, summary=false)
5501        @Description(shortDefinition="Contract Valued Item Type", formalDefinition="Specific type of Contract Valued Item that may be priced." )
5502        protected Type entity;
5503
5504        /**
5505         * Identifies a Contract Valued Item instance.
5506         */
5507        @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=false)
5508        @Description(shortDefinition="Contract Valued Item Number", formalDefinition="Identifies a Contract Valued Item instance." )
5509        protected Identifier identifier;
5510
5511        /**
5512         * Indicates the time during which this Contract ValuedItem information is effective.
5513         */
5514        @Child(name = "effectiveTime", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
5515        @Description(shortDefinition="Contract Valued Item Effective Tiem", formalDefinition="Indicates the time during which this Contract ValuedItem information is effective." )
5516        protected DateTimeType effectiveTime;
5517
5518        /**
5519         * Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.
5520         */
5521        @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1, modifier=false, summary=false)
5522        @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." )
5523        protected Quantity quantity;
5524
5525        /**
5526         * A Contract Valued Item unit valuation measure.
5527         */
5528        @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1, modifier=false, summary=false)
5529        @Description(shortDefinition="Contract Valued Item fee, charge, or cost", formalDefinition="A Contract Valued Item unit valuation measure." )
5530        protected Money unitPrice;
5531
5532        /**
5533         * 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.
5534         */
5535        @Child(name = "factor", type = {DecimalType.class}, order=6, min=0, max=1, modifier=false, summary=false)
5536        @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." )
5537        protected DecimalType factor;
5538
5539        /**
5540         * 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.
5541         */
5542        @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=false)
5543        @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." )
5544        protected DecimalType points;
5545
5546        /**
5547         * 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.
5548         */
5549        @Child(name = "net", type = {Money.class}, order=8, min=0, max=1, modifier=false, summary=false)
5550        @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." )
5551        protected Money net;
5552
5553        /**
5554         * Terms of valuation.
5555         */
5556        @Child(name = "payment", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
5557        @Description(shortDefinition="Terms of valuation", formalDefinition="Terms of valuation." )
5558        protected StringType payment;
5559
5560        /**
5561         * When payment is due.
5562         */
5563        @Child(name = "paymentDate", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=false)
5564        @Description(shortDefinition="When payment is due", formalDefinition="When payment is due." )
5565        protected DateTimeType paymentDate;
5566
5567        /**
5568         * Who will make payment.
5569         */
5570        @Child(name = "responsible", type = {Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class}, order=11, min=0, max=1, modifier=false, summary=false)
5571        @Description(shortDefinition="Who will make payment", formalDefinition="Who will make payment." )
5572        protected Reference responsible;
5573
5574        /**
5575         * The actual object that is the target of the reference (Who will make payment.)
5576         */
5577        protected Resource responsibleTarget;
5578
5579        /**
5580         * Who will receive payment.
5581         */
5582        @Child(name = "recipient", type = {Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class}, order=12, min=0, max=1, modifier=false, summary=false)
5583        @Description(shortDefinition="Who will receive payment", formalDefinition="Who will receive payment." )
5584        protected Reference recipient;
5585
5586        /**
5587         * The actual object that is the target of the reference (Who will receive payment.)
5588         */
5589        protected Resource recipientTarget;
5590
5591        /**
5592         * Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.
5593         */
5594        @Child(name = "linkId", type = {StringType.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5595        @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." )
5596        protected List<StringType> linkId;
5597
5598        /**
5599         * A set of security labels that define which terms are controlled by this condition.
5600         */
5601        @Child(name = "securityLabelNumber", type = {UnsignedIntType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5602        @Description(shortDefinition="Security Labels that define affected terms", formalDefinition="A set of security labels that define which terms are controlled by this condition." )
5603        protected List<UnsignedIntType> securityLabelNumber;
5604
5605        private static final long serialVersionUID = 1894951601L;
5606
5607    /**
5608     * Constructor
5609     */
5610      public ValuedItemComponent() {
5611        super();
5612      }
5613
5614        /**
5615         * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.)
5616         */
5617        public Type getEntity() { 
5618          return this.entity;
5619        }
5620
5621        /**
5622         * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.)
5623         */
5624        public CodeableConcept getEntityCodeableConcept() throws FHIRException { 
5625          if (this.entity == null)
5626            this.entity = new CodeableConcept();
5627          if (!(this.entity instanceof CodeableConcept))
5628            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.entity.getClass().getName()+" was encountered");
5629          return (CodeableConcept) this.entity;
5630        }
5631
5632        public boolean hasEntityCodeableConcept() { 
5633          return this != null && this.entity instanceof CodeableConcept;
5634        }
5635
5636        /**
5637         * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.)
5638         */
5639        public Reference getEntityReference() throws FHIRException { 
5640          if (this.entity == null)
5641            this.entity = new Reference();
5642          if (!(this.entity instanceof Reference))
5643            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.entity.getClass().getName()+" was encountered");
5644          return (Reference) this.entity;
5645        }
5646
5647        public boolean hasEntityReference() { 
5648          return this != null && this.entity instanceof Reference;
5649        }
5650
5651        public boolean hasEntity() { 
5652          return this.entity != null && !this.entity.isEmpty();
5653        }
5654
5655        /**
5656         * @param value {@link #entity} (Specific type of Contract Valued Item that may be priced.)
5657         */
5658        public ValuedItemComponent setEntity(Type value) { 
5659          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
5660            throw new Error("Not the right type for Contract.term.asset.valuedItem.entity[x]: "+value.fhirType());
5661          this.entity = value;
5662          return this;
5663        }
5664
5665        /**
5666         * @return {@link #identifier} (Identifies a Contract Valued Item instance.)
5667         */
5668        public Identifier getIdentifier() { 
5669          if (this.identifier == null)
5670            if (Configuration.errorOnAutoCreate())
5671              throw new Error("Attempt to auto-create ValuedItemComponent.identifier");
5672            else if (Configuration.doAutoCreate())
5673              this.identifier = new Identifier(); // cc
5674          return this.identifier;
5675        }
5676
5677        public boolean hasIdentifier() { 
5678          return this.identifier != null && !this.identifier.isEmpty();
5679        }
5680
5681        /**
5682         * @param value {@link #identifier} (Identifies a Contract Valued Item instance.)
5683         */
5684        public ValuedItemComponent setIdentifier(Identifier value) { 
5685          this.identifier = value;
5686          return this;
5687        }
5688
5689        /**
5690         * @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
5691         */
5692        public DateTimeType getEffectiveTimeElement() { 
5693          if (this.effectiveTime == null)
5694            if (Configuration.errorOnAutoCreate())
5695              throw new Error("Attempt to auto-create ValuedItemComponent.effectiveTime");
5696            else if (Configuration.doAutoCreate())
5697              this.effectiveTime = new DateTimeType(); // bb
5698          return this.effectiveTime;
5699        }
5700
5701        public boolean hasEffectiveTimeElement() { 
5702          return this.effectiveTime != null && !this.effectiveTime.isEmpty();
5703        }
5704
5705        public boolean hasEffectiveTime() { 
5706          return this.effectiveTime != null && !this.effectiveTime.isEmpty();
5707        }
5708
5709        /**
5710         * @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
5711         */
5712        public ValuedItemComponent setEffectiveTimeElement(DateTimeType value) { 
5713          this.effectiveTime = value;
5714          return this;
5715        }
5716
5717        /**
5718         * @return Indicates the time during which this Contract ValuedItem information is effective.
5719         */
5720        public Date getEffectiveTime() { 
5721          return this.effectiveTime == null ? null : this.effectiveTime.getValue();
5722        }
5723
5724        /**
5725         * @param value Indicates the time during which this Contract ValuedItem information is effective.
5726         */
5727        public ValuedItemComponent setEffectiveTime(Date value) { 
5728          if (value == null)
5729            this.effectiveTime = null;
5730          else {
5731            if (this.effectiveTime == null)
5732              this.effectiveTime = new DateTimeType();
5733            this.effectiveTime.setValue(value);
5734          }
5735          return this;
5736        }
5737
5738        /**
5739         * @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.)
5740         */
5741        public Quantity getQuantity() { 
5742          if (this.quantity == null)
5743            if (Configuration.errorOnAutoCreate())
5744              throw new Error("Attempt to auto-create ValuedItemComponent.quantity");
5745            else if (Configuration.doAutoCreate())
5746              this.quantity = new Quantity(); // cc
5747          return this.quantity;
5748        }
5749
5750        public boolean hasQuantity() { 
5751          return this.quantity != null && !this.quantity.isEmpty();
5752        }
5753
5754        /**
5755         * @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.)
5756         */
5757        public ValuedItemComponent setQuantity(Quantity value) { 
5758          this.quantity = value;
5759          return this;
5760        }
5761
5762        /**
5763         * @return {@link #unitPrice} (A Contract Valued Item unit valuation measure.)
5764         */
5765        public Money getUnitPrice() { 
5766          if (this.unitPrice == null)
5767            if (Configuration.errorOnAutoCreate())
5768              throw new Error("Attempt to auto-create ValuedItemComponent.unitPrice");
5769            else if (Configuration.doAutoCreate())
5770              this.unitPrice = new Money(); // cc
5771          return this.unitPrice;
5772        }
5773
5774        public boolean hasUnitPrice() { 
5775          return this.unitPrice != null && !this.unitPrice.isEmpty();
5776        }
5777
5778        /**
5779         * @param value {@link #unitPrice} (A Contract Valued Item unit valuation measure.)
5780         */
5781        public ValuedItemComponent setUnitPrice(Money value) { 
5782          this.unitPrice = value;
5783          return this;
5784        }
5785
5786        /**
5787         * @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
5788         */
5789        public DecimalType getFactorElement() { 
5790          if (this.factor == null)
5791            if (Configuration.errorOnAutoCreate())
5792              throw new Error("Attempt to auto-create ValuedItemComponent.factor");
5793            else if (Configuration.doAutoCreate())
5794              this.factor = new DecimalType(); // bb
5795          return this.factor;
5796        }
5797
5798        public boolean hasFactorElement() { 
5799          return this.factor != null && !this.factor.isEmpty();
5800        }
5801
5802        public boolean hasFactor() { 
5803          return this.factor != null && !this.factor.isEmpty();
5804        }
5805
5806        /**
5807         * @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
5808         */
5809        public ValuedItemComponent setFactorElement(DecimalType value) { 
5810          this.factor = value;
5811          return this;
5812        }
5813
5814        /**
5815         * @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.
5816         */
5817        public BigDecimal getFactor() { 
5818          return this.factor == null ? null : this.factor.getValue();
5819        }
5820
5821        /**
5822         * @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.
5823         */
5824        public ValuedItemComponent setFactor(BigDecimal value) { 
5825          if (value == null)
5826            this.factor = null;
5827          else {
5828            if (this.factor == null)
5829              this.factor = new DecimalType();
5830            this.factor.setValue(value);
5831          }
5832          return this;
5833        }
5834
5835        /**
5836         * @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.
5837         */
5838        public ValuedItemComponent setFactor(long value) { 
5839              this.factor = new DecimalType();
5840            this.factor.setValue(value);
5841          return this;
5842        }
5843
5844        /**
5845         * @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.
5846         */
5847        public ValuedItemComponent setFactor(double value) { 
5848              this.factor = new DecimalType();
5849            this.factor.setValue(value);
5850          return this;
5851        }
5852
5853        /**
5854         * @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
5855         */
5856        public DecimalType getPointsElement() { 
5857          if (this.points == null)
5858            if (Configuration.errorOnAutoCreate())
5859              throw new Error("Attempt to auto-create ValuedItemComponent.points");
5860            else if (Configuration.doAutoCreate())
5861              this.points = new DecimalType(); // bb
5862          return this.points;
5863        }
5864
5865        public boolean hasPointsElement() { 
5866          return this.points != null && !this.points.isEmpty();
5867        }
5868
5869        public boolean hasPoints() { 
5870          return this.points != null && !this.points.isEmpty();
5871        }
5872
5873        /**
5874         * @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
5875         */
5876        public ValuedItemComponent setPointsElement(DecimalType value) { 
5877          this.points = value;
5878          return this;
5879        }
5880
5881        /**
5882         * @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.
5883         */
5884        public BigDecimal getPoints() { 
5885          return this.points == null ? null : this.points.getValue();
5886        }
5887
5888        /**
5889         * @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.
5890         */
5891        public ValuedItemComponent setPoints(BigDecimal value) { 
5892          if (value == null)
5893            this.points = null;
5894          else {
5895            if (this.points == null)
5896              this.points = new DecimalType();
5897            this.points.setValue(value);
5898          }
5899          return this;
5900        }
5901
5902        /**
5903         * @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.
5904         */
5905        public ValuedItemComponent setPoints(long value) { 
5906              this.points = new DecimalType();
5907            this.points.setValue(value);
5908          return this;
5909        }
5910
5911        /**
5912         * @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.
5913         */
5914        public ValuedItemComponent setPoints(double value) { 
5915              this.points = new DecimalType();
5916            this.points.setValue(value);
5917          return this;
5918        }
5919
5920        /**
5921         * @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.)
5922         */
5923        public Money getNet() { 
5924          if (this.net == null)
5925            if (Configuration.errorOnAutoCreate())
5926              throw new Error("Attempt to auto-create ValuedItemComponent.net");
5927            else if (Configuration.doAutoCreate())
5928              this.net = new Money(); // cc
5929          return this.net;
5930        }
5931
5932        public boolean hasNet() { 
5933          return this.net != null && !this.net.isEmpty();
5934        }
5935
5936        /**
5937         * @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.)
5938         */
5939        public ValuedItemComponent setNet(Money value) { 
5940          this.net = value;
5941          return this;
5942        }
5943
5944        /**
5945         * @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
5946         */
5947        public StringType getPaymentElement() { 
5948          if (this.payment == null)
5949            if (Configuration.errorOnAutoCreate())
5950              throw new Error("Attempt to auto-create ValuedItemComponent.payment");
5951            else if (Configuration.doAutoCreate())
5952              this.payment = new StringType(); // bb
5953          return this.payment;
5954        }
5955
5956        public boolean hasPaymentElement() { 
5957          return this.payment != null && !this.payment.isEmpty();
5958        }
5959
5960        public boolean hasPayment() { 
5961          return this.payment != null && !this.payment.isEmpty();
5962        }
5963
5964        /**
5965         * @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
5966         */
5967        public ValuedItemComponent setPaymentElement(StringType value) { 
5968          this.payment = value;
5969          return this;
5970        }
5971
5972        /**
5973         * @return Terms of valuation.
5974         */
5975        public String getPayment() { 
5976          return this.payment == null ? null : this.payment.getValue();
5977        }
5978
5979        /**
5980         * @param value Terms of valuation.
5981         */
5982        public ValuedItemComponent setPayment(String value) { 
5983          if (Utilities.noString(value))
5984            this.payment = null;
5985          else {
5986            if (this.payment == null)
5987              this.payment = new StringType();
5988            this.payment.setValue(value);
5989          }
5990          return this;
5991        }
5992
5993        /**
5994         * @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
5995         */
5996        public DateTimeType getPaymentDateElement() { 
5997          if (this.paymentDate == null)
5998            if (Configuration.errorOnAutoCreate())
5999              throw new Error("Attempt to auto-create ValuedItemComponent.paymentDate");
6000            else if (Configuration.doAutoCreate())
6001              this.paymentDate = new DateTimeType(); // bb
6002          return this.paymentDate;
6003        }
6004
6005        public boolean hasPaymentDateElement() { 
6006          return this.paymentDate != null && !this.paymentDate.isEmpty();
6007        }
6008
6009        public boolean hasPaymentDate() { 
6010          return this.paymentDate != null && !this.paymentDate.isEmpty();
6011        }
6012
6013        /**
6014         * @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
6015         */
6016        public ValuedItemComponent setPaymentDateElement(DateTimeType value) { 
6017          this.paymentDate = value;
6018          return this;
6019        }
6020
6021        /**
6022         * @return When payment is due.
6023         */
6024        public Date getPaymentDate() { 
6025          return this.paymentDate == null ? null : this.paymentDate.getValue();
6026        }
6027
6028        /**
6029         * @param value When payment is due.
6030         */
6031        public ValuedItemComponent setPaymentDate(Date value) { 
6032          if (value == null)
6033            this.paymentDate = null;
6034          else {
6035            if (this.paymentDate == null)
6036              this.paymentDate = new DateTimeType();
6037            this.paymentDate.setValue(value);
6038          }
6039          return this;
6040        }
6041
6042        /**
6043         * @return {@link #responsible} (Who will make payment.)
6044         */
6045        public Reference getResponsible() { 
6046          if (this.responsible == null)
6047            if (Configuration.errorOnAutoCreate())
6048              throw new Error("Attempt to auto-create ValuedItemComponent.responsible");
6049            else if (Configuration.doAutoCreate())
6050              this.responsible = new Reference(); // cc
6051          return this.responsible;
6052        }
6053
6054        public boolean hasResponsible() { 
6055          return this.responsible != null && !this.responsible.isEmpty();
6056        }
6057
6058        /**
6059         * @param value {@link #responsible} (Who will make payment.)
6060         */
6061        public ValuedItemComponent setResponsible(Reference value) { 
6062          this.responsible = value;
6063          return this;
6064        }
6065
6066        /**
6067         * @return {@link #responsible} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who will make payment.)
6068         */
6069        public Resource getResponsibleTarget() { 
6070          return this.responsibleTarget;
6071        }
6072
6073        /**
6074         * @param value {@link #responsible} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who will make payment.)
6075         */
6076        public ValuedItemComponent setResponsibleTarget(Resource value) { 
6077          this.responsibleTarget = value;
6078          return this;
6079        }
6080
6081        /**
6082         * @return {@link #recipient} (Who will receive payment.)
6083         */
6084        public Reference getRecipient() { 
6085          if (this.recipient == null)
6086            if (Configuration.errorOnAutoCreate())
6087              throw new Error("Attempt to auto-create ValuedItemComponent.recipient");
6088            else if (Configuration.doAutoCreate())
6089              this.recipient = new Reference(); // cc
6090          return this.recipient;
6091        }
6092
6093        public boolean hasRecipient() { 
6094          return this.recipient != null && !this.recipient.isEmpty();
6095        }
6096
6097        /**
6098         * @param value {@link #recipient} (Who will receive payment.)
6099         */
6100        public ValuedItemComponent setRecipient(Reference value) { 
6101          this.recipient = value;
6102          return this;
6103        }
6104
6105        /**
6106         * @return {@link #recipient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who will receive payment.)
6107         */
6108        public Resource getRecipientTarget() { 
6109          return this.recipientTarget;
6110        }
6111
6112        /**
6113         * @param value {@link #recipient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who will receive payment.)
6114         */
6115        public ValuedItemComponent setRecipientTarget(Resource value) { 
6116          this.recipientTarget = value;
6117          return this;
6118        }
6119
6120        /**
6121         * @return {@link #linkId} (Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.)
6122         */
6123        public List<StringType> getLinkId() { 
6124          if (this.linkId == null)
6125            this.linkId = new ArrayList<StringType>();
6126          return this.linkId;
6127        }
6128
6129        /**
6130         * @return Returns a reference to <code>this</code> for easy method chaining
6131         */
6132        public ValuedItemComponent setLinkId(List<StringType> theLinkId) { 
6133          this.linkId = theLinkId;
6134          return this;
6135        }
6136
6137        public boolean hasLinkId() { 
6138          if (this.linkId == null)
6139            return false;
6140          for (StringType item : this.linkId)
6141            if (!item.isEmpty())
6142              return true;
6143          return false;
6144        }
6145
6146        /**
6147         * @return {@link #linkId} (Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.)
6148         */
6149        public StringType addLinkIdElement() {//2 
6150          StringType t = new StringType();
6151          if (this.linkId == null)
6152            this.linkId = new ArrayList<StringType>();
6153          this.linkId.add(t);
6154          return t;
6155        }
6156
6157        /**
6158         * @param value {@link #linkId} (Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.)
6159         */
6160        public ValuedItemComponent addLinkId(String value) { //1
6161          StringType t = new StringType();
6162          t.setValue(value);
6163          if (this.linkId == null)
6164            this.linkId = new ArrayList<StringType>();
6165          this.linkId.add(t);
6166          return this;
6167        }
6168
6169        /**
6170         * @param value {@link #linkId} (Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.)
6171         */
6172        public boolean hasLinkId(String value) { 
6173          if (this.linkId == null)
6174            return false;
6175          for (StringType v : this.linkId)
6176            if (v.getValue().equals(value)) // string
6177              return true;
6178          return false;
6179        }
6180
6181        /**
6182         * @return {@link #securityLabelNumber} (A set of security labels that define which terms are controlled by this condition.)
6183         */
6184        public List<UnsignedIntType> getSecurityLabelNumber() { 
6185          if (this.securityLabelNumber == null)
6186            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
6187          return this.securityLabelNumber;
6188        }
6189
6190        /**
6191         * @return Returns a reference to <code>this</code> for easy method chaining
6192         */
6193        public ValuedItemComponent setSecurityLabelNumber(List<UnsignedIntType> theSecurityLabelNumber) { 
6194          this.securityLabelNumber = theSecurityLabelNumber;
6195          return this;
6196        }
6197
6198        public boolean hasSecurityLabelNumber() { 
6199          if (this.securityLabelNumber == null)
6200            return false;
6201          for (UnsignedIntType item : this.securityLabelNumber)
6202            if (!item.isEmpty())
6203              return true;
6204          return false;
6205        }
6206
6207        /**
6208         * @return {@link #securityLabelNumber} (A set of security labels that define which terms are controlled by this condition.)
6209         */
6210        public UnsignedIntType addSecurityLabelNumberElement() {//2 
6211          UnsignedIntType t = new UnsignedIntType();
6212          if (this.securityLabelNumber == null)
6213            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
6214          this.securityLabelNumber.add(t);
6215          return t;
6216        }
6217
6218        /**
6219         * @param value {@link #securityLabelNumber} (A set of security labels that define which terms are controlled by this condition.)
6220         */
6221        public ValuedItemComponent addSecurityLabelNumber(int value) { //1
6222          UnsignedIntType t = new UnsignedIntType();
6223          t.setValue(value);
6224          if (this.securityLabelNumber == null)
6225            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
6226          this.securityLabelNumber.add(t);
6227          return this;
6228        }
6229
6230        /**
6231         * @param value {@link #securityLabelNumber} (A set of security labels that define which terms are controlled by this condition.)
6232         */
6233        public boolean hasSecurityLabelNumber(int value) { 
6234          if (this.securityLabelNumber == null)
6235            return false;
6236          for (UnsignedIntType v : this.securityLabelNumber)
6237            if (v.getValue().equals(value)) // unsignedInt
6238              return true;
6239          return false;
6240        }
6241
6242        protected void listChildren(List<Property> children) {
6243          super.listChildren(children);
6244          children.add(new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, 1, entity));
6245          children.add(new Property("identifier", "Identifier", "Identifies a Contract Valued Item instance.", 0, 1, identifier));
6246          children.add(new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract ValuedItem information is effective.", 0, 1, effectiveTime));
6247          children.add(new Property("quantity", "SimpleQuantity", "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));
6248          children.add(new Property("unitPrice", "Money", "A Contract Valued Item unit valuation measure.", 0, 1, unitPrice));
6249          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));
6250          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));
6251          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));
6252          children.add(new Property("payment", "string", "Terms of valuation.", 0, 1, payment));
6253          children.add(new Property("paymentDate", "dateTime", "When payment is due.", 0, 1, paymentDate));
6254          children.add(new Property("responsible", "Reference(Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "Who will make payment.", 0, 1, responsible));
6255          children.add(new Property("recipient", "Reference(Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "Who will receive payment.", 0, 1, recipient));
6256          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));
6257          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));
6258        }
6259
6260        @Override
6261        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6262          switch (_hash) {
6263          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);
6264          case -1298275357: /*entity*/  return new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, 1, entity);
6265          case 924197182: /*entityCodeableConcept*/  return new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, 1, entity);
6266          case -356635992: /*entityReference*/  return new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, 1, entity);
6267          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifies a Contract Valued Item instance.", 0, 1, identifier);
6268          case -929905388: /*effectiveTime*/  return new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract ValuedItem information is effective.", 0, 1, effectiveTime);
6269          case -1285004149: /*quantity*/  return new Property("quantity", "SimpleQuantity", "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);
6270          case -486196699: /*unitPrice*/  return new Property("unitPrice", "Money", "A Contract Valued Item unit valuation measure.", 0, 1, unitPrice);
6271          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);
6272          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);
6273          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);
6274          case -786681338: /*payment*/  return new Property("payment", "string", "Terms of valuation.", 0, 1, payment);
6275          case -1540873516: /*paymentDate*/  return new Property("paymentDate", "dateTime", "When payment is due.", 0, 1, paymentDate);
6276          case 1847674614: /*responsible*/  return new Property("responsible", "Reference(Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "Who will make payment.", 0, 1, responsible);
6277          case 820081177: /*recipient*/  return new Property("recipient", "Reference(Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "Who will receive payment.", 0, 1, recipient);
6278          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);
6279          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);
6280          default: return super.getNamedProperty(_hash, _name, _checkValid);
6281          }
6282
6283        }
6284
6285      @Override
6286      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6287        switch (hash) {
6288        case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : new Base[] {this.entity}; // Type
6289        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
6290        case -929905388: /*effectiveTime*/ return this.effectiveTime == null ? new Base[0] : new Base[] {this.effectiveTime}; // DateTimeType
6291        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
6292        case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money
6293        case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType
6294        case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType
6295        case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money
6296        case -786681338: /*payment*/ return this.payment == null ? new Base[0] : new Base[] {this.payment}; // StringType
6297        case -1540873516: /*paymentDate*/ return this.paymentDate == null ? new Base[0] : new Base[] {this.paymentDate}; // DateTimeType
6298        case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // Reference
6299        case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : new Base[] {this.recipient}; // Reference
6300        case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : this.linkId.toArray(new Base[this.linkId.size()]); // StringType
6301        case -149460995: /*securityLabelNumber*/ return this.securityLabelNumber == null ? new Base[0] : this.securityLabelNumber.toArray(new Base[this.securityLabelNumber.size()]); // UnsignedIntType
6302        default: return super.getProperty(hash, name, checkValid);
6303        }
6304
6305      }
6306
6307      @Override
6308      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6309        switch (hash) {
6310        case -1298275357: // entity
6311          this.entity = castToType(value); // Type
6312          return value;
6313        case -1618432855: // identifier
6314          this.identifier = castToIdentifier(value); // Identifier
6315          return value;
6316        case -929905388: // effectiveTime
6317          this.effectiveTime = castToDateTime(value); // DateTimeType
6318          return value;
6319        case -1285004149: // quantity
6320          this.quantity = castToQuantity(value); // Quantity
6321          return value;
6322        case -486196699: // unitPrice
6323          this.unitPrice = castToMoney(value); // Money
6324          return value;
6325        case -1282148017: // factor
6326          this.factor = castToDecimal(value); // DecimalType
6327          return value;
6328        case -982754077: // points
6329          this.points = castToDecimal(value); // DecimalType
6330          return value;
6331        case 108957: // net
6332          this.net = castToMoney(value); // Money
6333          return value;
6334        case -786681338: // payment
6335          this.payment = castToString(value); // StringType
6336          return value;
6337        case -1540873516: // paymentDate
6338          this.paymentDate = castToDateTime(value); // DateTimeType
6339          return value;
6340        case 1847674614: // responsible
6341          this.responsible = castToReference(value); // Reference
6342          return value;
6343        case 820081177: // recipient
6344          this.recipient = castToReference(value); // Reference
6345          return value;
6346        case -1102667083: // linkId
6347          this.getLinkId().add(castToString(value)); // StringType
6348          return value;
6349        case -149460995: // securityLabelNumber
6350          this.getSecurityLabelNumber().add(castToUnsignedInt(value)); // UnsignedIntType
6351          return value;
6352        default: return super.setProperty(hash, name, value);
6353        }
6354
6355      }
6356
6357      @Override
6358      public Base setProperty(String name, Base value) throws FHIRException {
6359        if (name.equals("entity[x]")) {
6360          this.entity = castToType(value); // Type
6361        } else if (name.equals("identifier")) {
6362          this.identifier = castToIdentifier(value); // Identifier
6363        } else if (name.equals("effectiveTime")) {
6364          this.effectiveTime = castToDateTime(value); // DateTimeType
6365        } else if (name.equals("quantity")) {
6366          this.quantity = castToQuantity(value); // Quantity
6367        } else if (name.equals("unitPrice")) {
6368          this.unitPrice = castToMoney(value); // Money
6369        } else if (name.equals("factor")) {
6370          this.factor = castToDecimal(value); // DecimalType
6371        } else if (name.equals("points")) {
6372          this.points = castToDecimal(value); // DecimalType
6373        } else if (name.equals("net")) {
6374          this.net = castToMoney(value); // Money
6375        } else if (name.equals("payment")) {
6376          this.payment = castToString(value); // StringType
6377        } else if (name.equals("paymentDate")) {
6378          this.paymentDate = castToDateTime(value); // DateTimeType
6379        } else if (name.equals("responsible")) {
6380          this.responsible = castToReference(value); // Reference
6381        } else if (name.equals("recipient")) {
6382          this.recipient = castToReference(value); // Reference
6383        } else if (name.equals("linkId")) {
6384          this.getLinkId().add(castToString(value));
6385        } else if (name.equals("securityLabelNumber")) {
6386          this.getSecurityLabelNumber().add(castToUnsignedInt(value));
6387        } else
6388          return super.setProperty(name, value);
6389        return value;
6390      }
6391
6392      @Override
6393      public Base makeProperty(int hash, String name) throws FHIRException {
6394        switch (hash) {
6395        case -740568643:  return getEntity(); 
6396        case -1298275357:  return getEntity(); 
6397        case -1618432855:  return getIdentifier(); 
6398        case -929905388:  return getEffectiveTimeElement();
6399        case -1285004149:  return getQuantity(); 
6400        case -486196699:  return getUnitPrice(); 
6401        case -1282148017:  return getFactorElement();
6402        case -982754077:  return getPointsElement();
6403        case 108957:  return getNet(); 
6404        case -786681338:  return getPaymentElement();
6405        case -1540873516:  return getPaymentDateElement();
6406        case 1847674614:  return getResponsible(); 
6407        case 820081177:  return getRecipient(); 
6408        case -1102667083:  return addLinkIdElement();
6409        case -149460995:  return addSecurityLabelNumberElement();
6410        default: return super.makeProperty(hash, name);
6411        }
6412
6413      }
6414
6415      @Override
6416      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6417        switch (hash) {
6418        case -1298275357: /*entity*/ return new String[] {"CodeableConcept", "Reference"};
6419        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
6420        case -929905388: /*effectiveTime*/ return new String[] {"dateTime"};
6421        case -1285004149: /*quantity*/ return new String[] {"SimpleQuantity"};
6422        case -486196699: /*unitPrice*/ return new String[] {"Money"};
6423        case -1282148017: /*factor*/ return new String[] {"decimal"};
6424        case -982754077: /*points*/ return new String[] {"decimal"};
6425        case 108957: /*net*/ return new String[] {"Money"};
6426        case -786681338: /*payment*/ return new String[] {"string"};
6427        case -1540873516: /*paymentDate*/ return new String[] {"dateTime"};
6428        case 1847674614: /*responsible*/ return new String[] {"Reference"};
6429        case 820081177: /*recipient*/ return new String[] {"Reference"};
6430        case -1102667083: /*linkId*/ return new String[] {"string"};
6431        case -149460995: /*securityLabelNumber*/ return new String[] {"unsignedInt"};
6432        default: return super.getTypesForProperty(hash, name);
6433        }
6434
6435      }
6436
6437      @Override
6438      public Base addChild(String name) throws FHIRException {
6439        if (name.equals("entityCodeableConcept")) {
6440          this.entity = new CodeableConcept();
6441          return this.entity;
6442        }
6443        else if (name.equals("entityReference")) {
6444          this.entity = new Reference();
6445          return this.entity;
6446        }
6447        else if (name.equals("identifier")) {
6448          this.identifier = new Identifier();
6449          return this.identifier;
6450        }
6451        else if (name.equals("effectiveTime")) {
6452          throw new FHIRException("Cannot call addChild on a primitive type Contract.effectiveTime");
6453        }
6454        else if (name.equals("quantity")) {
6455          this.quantity = new Quantity();
6456          return this.quantity;
6457        }
6458        else if (name.equals("unitPrice")) {
6459          this.unitPrice = new Money();
6460          return this.unitPrice;
6461        }
6462        else if (name.equals("factor")) {
6463          throw new FHIRException("Cannot call addChild on a primitive type Contract.factor");
6464        }
6465        else if (name.equals("points")) {
6466          throw new FHIRException("Cannot call addChild on a primitive type Contract.points");
6467        }
6468        else if (name.equals("net")) {
6469          this.net = new Money();
6470          return this.net;
6471        }
6472        else if (name.equals("payment")) {
6473          throw new FHIRException("Cannot call addChild on a primitive type Contract.payment");
6474        }
6475        else if (name.equals("paymentDate")) {
6476          throw new FHIRException("Cannot call addChild on a primitive type Contract.paymentDate");
6477        }
6478        else if (name.equals("responsible")) {
6479          this.responsible = new Reference();
6480          return this.responsible;
6481        }
6482        else if (name.equals("recipient")) {
6483          this.recipient = new Reference();
6484          return this.recipient;
6485        }
6486        else if (name.equals("linkId")) {
6487          throw new FHIRException("Cannot call addChild on a primitive type Contract.linkId");
6488        }
6489        else if (name.equals("securityLabelNumber")) {
6490          throw new FHIRException("Cannot call addChild on a primitive type Contract.securityLabelNumber");
6491        }
6492        else
6493          return super.addChild(name);
6494      }
6495
6496      public ValuedItemComponent copy() {
6497        ValuedItemComponent dst = new ValuedItemComponent();
6498        copyValues(dst);
6499        return dst;
6500      }
6501
6502      public void copyValues(ValuedItemComponent dst) {
6503        super.copyValues(dst);
6504        dst.entity = entity == null ? null : entity.copy();
6505        dst.identifier = identifier == null ? null : identifier.copy();
6506        dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy();
6507        dst.quantity = quantity == null ? null : quantity.copy();
6508        dst.unitPrice = unitPrice == null ? null : unitPrice.copy();
6509        dst.factor = factor == null ? null : factor.copy();
6510        dst.points = points == null ? null : points.copy();
6511        dst.net = net == null ? null : net.copy();
6512        dst.payment = payment == null ? null : payment.copy();
6513        dst.paymentDate = paymentDate == null ? null : paymentDate.copy();
6514        dst.responsible = responsible == null ? null : responsible.copy();
6515        dst.recipient = recipient == null ? null : recipient.copy();
6516        if (linkId != null) {
6517          dst.linkId = new ArrayList<StringType>();
6518          for (StringType i : linkId)
6519            dst.linkId.add(i.copy());
6520        };
6521        if (securityLabelNumber != null) {
6522          dst.securityLabelNumber = new ArrayList<UnsignedIntType>();
6523          for (UnsignedIntType i : securityLabelNumber)
6524            dst.securityLabelNumber.add(i.copy());
6525        };
6526      }
6527
6528      @Override
6529      public boolean equalsDeep(Base other_) {
6530        if (!super.equalsDeep(other_))
6531          return false;
6532        if (!(other_ instanceof ValuedItemComponent))
6533          return false;
6534        ValuedItemComponent o = (ValuedItemComponent) other_;
6535        return compareDeep(entity, o.entity, true) && compareDeep(identifier, o.identifier, true) && compareDeep(effectiveTime, o.effectiveTime, true)
6536           && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true)
6537           && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) && compareDeep(payment, o.payment, true)
6538           && compareDeep(paymentDate, o.paymentDate, true) && compareDeep(responsible, o.responsible, true)
6539           && compareDeep(recipient, o.recipient, true) && compareDeep(linkId, o.linkId, true) && compareDeep(securityLabelNumber, o.securityLabelNumber, true)
6540          ;
6541      }
6542
6543      @Override
6544      public boolean equalsShallow(Base other_) {
6545        if (!super.equalsShallow(other_))
6546          return false;
6547        if (!(other_ instanceof ValuedItemComponent))
6548          return false;
6549        ValuedItemComponent o = (ValuedItemComponent) other_;
6550        return compareValues(effectiveTime, o.effectiveTime, true) && compareValues(factor, o.factor, true)
6551           && compareValues(points, o.points, true) && compareValues(payment, o.payment, true) && compareValues(paymentDate, o.paymentDate, true)
6552           && compareValues(linkId, o.linkId, true) && compareValues(securityLabelNumber, o.securityLabelNumber, true)
6553          ;
6554      }
6555
6556      public boolean isEmpty() {
6557        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(entity, identifier, effectiveTime
6558          , quantity, unitPrice, factor, points, net, payment, paymentDate, responsible
6559          , recipient, linkId, securityLabelNumber);
6560      }
6561
6562  public String fhirType() {
6563    return "Contract.term.asset.valuedItem";
6564
6565  }
6566
6567  }
6568
6569    @Block()
6570    public static class ActionComponent extends BackboneElement implements IBaseBackboneElement {
6571        /**
6572         * True if the term prohibits the  action.
6573         */
6574        @Child(name = "doNotPerform", type = {BooleanType.class}, order=1, min=0, max=1, modifier=true, summary=false)
6575        @Description(shortDefinition="True if the term prohibits the  action", formalDefinition="True if the term prohibits the  action." )
6576        protected BooleanType doNotPerform;
6577
6578        /**
6579         * Activity or service obligation to be done or not done, performed or not performed, effectuated or not by this Contract term.
6580         */
6581        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false)
6582        @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." )
6583        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-action")
6584        protected CodeableConcept type;
6585
6586        /**
6587         * Entity of the action.
6588         */
6589        @Child(name = "subject", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6590        @Description(shortDefinition="Entity of the action", formalDefinition="Entity of the action." )
6591        protected List<ActionSubjectComponent> subject;
6592
6593        /**
6594         * Reason or purpose for the action stipulated by this Contract Provision.
6595         */
6596        @Child(name = "intent", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=false)
6597        @Description(shortDefinition="Purpose for the Contract Term Action", formalDefinition="Reason or purpose for the action stipulated by this Contract Provision." )
6598        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-PurposeOfUse")
6599        protected CodeableConcept intent;
6600
6601        /**
6602         * Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.
6603         */
6604        @Child(name = "linkId", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6605        @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." )
6606        protected List<StringType> linkId;
6607
6608        /**
6609         * Current state of the term action.
6610         */
6611        @Child(name = "status", type = {CodeableConcept.class}, order=6, min=1, max=1, modifier=false, summary=false)
6612        @Description(shortDefinition="State of the action", formalDefinition="Current state of the term action." )
6613        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-actionstatus")
6614        protected CodeableConcept status;
6615
6616        /**
6617         * Encounter or Episode with primary association to specified term activity.
6618         */
6619        @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=7, min=0, max=1, modifier=false, summary=false)
6620        @Description(shortDefinition="Episode associated with action", formalDefinition="Encounter or Episode with primary association to specified term activity." )
6621        protected Reference context;
6622
6623        /**
6624         * The actual object that is the target of the reference (Encounter or Episode with primary association to specified term activity.)
6625         */
6626        protected Resource contextTarget;
6627
6628        /**
6629         * Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.
6630         */
6631        @Child(name = "contextLinkId", type = {StringType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6632        @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." )
6633        protected List<StringType> contextLinkId;
6634
6635        /**
6636         * When action happens.
6637         */
6638        @Child(name = "occurrence", type = {DateTimeType.class, Period.class, Timing.class}, order=9, min=0, max=1, modifier=false, summary=false)
6639        @Description(shortDefinition="When action happens", formalDefinition="When action happens." )
6640        protected Type occurrence;
6641
6642        /**
6643         * Who or what initiated the action and has responsibility for its activation.
6644         */
6645        @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)
6646        @Description(shortDefinition="Who asked for action", formalDefinition="Who or what initiated the action and has responsibility for its activation." )
6647        protected List<Reference> requester;
6648        /**
6649         * The actual objects that are the target of the reference (Who or what initiated the action and has responsibility for its activation.)
6650         */
6651        protected List<Resource> requesterTarget;
6652
6653
6654        /**
6655         * Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.
6656         */
6657        @Child(name = "requesterLinkId", type = {StringType.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6658        @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." )
6659        protected List<StringType> requesterLinkId;
6660
6661        /**
6662         * The type of individual that is desired or required to perform or not perform the action.
6663         */
6664        @Child(name = "performerType", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6665        @Description(shortDefinition="Kind of service performer", formalDefinition="The type of individual that is desired or required to perform or not perform the action." )
6666        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/provenance-agent-type")
6667        protected List<CodeableConcept> performerType;
6668
6669        /**
6670         * The type of role or competency of an individual desired or required to perform or not perform the action.
6671         */
6672        @Child(name = "performerRole", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=false)
6673        @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." )
6674        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/provenance-agent-role")
6675        protected CodeableConcept performerRole;
6676
6677        /**
6678         * Indicates who or what is being asked to perform (or not perform) the ction.
6679         */
6680        @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)
6681        @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." )
6682        protected Reference performer;
6683
6684        /**
6685         * The actual object that is the target of the reference (Indicates who or what is being asked to perform (or not perform) the ction.)
6686         */
6687        protected Resource performerTarget;
6688
6689        /**
6690         * Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.
6691         */
6692        @Child(name = "performerLinkId", type = {StringType.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6693        @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." )
6694        protected List<StringType> performerLinkId;
6695
6696        /**
6697         * Rationale for the action to be performed or not performed. Describes why the action is permitted or prohibited.
6698         */
6699        @Child(name = "reasonCode", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6700        @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." )
6701        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-PurposeOfUse")
6702        protected List<CodeableConcept> reasonCode;
6703
6704        /**
6705         * Indicates another resource whose existence justifies permitting or not permitting this action.
6706         */
6707        @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)
6708        @Description(shortDefinition="Why is action (not) needed?", formalDefinition="Indicates another resource whose existence justifies permitting or not permitting this action." )
6709        protected List<Reference> reasonReference;
6710        /**
6711         * The actual objects that are the target of the reference (Indicates another resource whose existence justifies permitting or not permitting this action.)
6712         */
6713        protected List<Resource> reasonReferenceTarget;
6714
6715
6716        /**
6717         * Describes why the action is to be performed or not performed in textual form.
6718         */
6719        @Child(name = "reason", type = {StringType.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6720        @Description(shortDefinition="Why action is to be performed", formalDefinition="Describes why the action is to be performed or not performed in textual form." )
6721        protected List<StringType> reason;
6722
6723        /**
6724         * Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.
6725         */
6726        @Child(name = "reasonLinkId", type = {StringType.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6727        @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." )
6728        protected List<StringType> reasonLinkId;
6729
6730        /**
6731         * Comments made about the term action made by the requester, performer, subject or other participants.
6732         */
6733        @Child(name = "note", type = {Annotation.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6734        @Description(shortDefinition="Comments about the action", formalDefinition="Comments made about the term action made by the requester, performer, subject or other participants." )
6735        protected List<Annotation> note;
6736
6737        /**
6738         * Security labels that protects the action.
6739         */
6740        @Child(name = "securityLabelNumber", type = {UnsignedIntType.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6741        @Description(shortDefinition="Action restriction numbers", formalDefinition="Security labels that protects the action." )
6742        protected List<UnsignedIntType> securityLabelNumber;
6743
6744        private static final long serialVersionUID = -178728180L;
6745
6746    /**
6747     * Constructor
6748     */
6749      public ActionComponent() {
6750        super();
6751      }
6752
6753    /**
6754     * Constructor
6755     */
6756      public ActionComponent(CodeableConcept type, CodeableConcept intent, CodeableConcept status) {
6757        super();
6758        this.type = type;
6759        this.intent = intent;
6760        this.status = status;
6761      }
6762
6763        /**
6764         * @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
6765         */
6766        public BooleanType getDoNotPerformElement() { 
6767          if (this.doNotPerform == null)
6768            if (Configuration.errorOnAutoCreate())
6769              throw new Error("Attempt to auto-create ActionComponent.doNotPerform");
6770            else if (Configuration.doAutoCreate())
6771              this.doNotPerform = new BooleanType(); // bb
6772          return this.doNotPerform;
6773        }
6774
6775        public boolean hasDoNotPerformElement() { 
6776          return this.doNotPerform != null && !this.doNotPerform.isEmpty();
6777        }
6778
6779        public boolean hasDoNotPerform() { 
6780          return this.doNotPerform != null && !this.doNotPerform.isEmpty();
6781        }
6782
6783        /**
6784         * @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
6785         */
6786        public ActionComponent setDoNotPerformElement(BooleanType value) { 
6787          this.doNotPerform = value;
6788          return this;
6789        }
6790
6791        /**
6792         * @return True if the term prohibits the  action.
6793         */
6794        public boolean getDoNotPerform() { 
6795          return this.doNotPerform == null || this.doNotPerform.isEmpty() ? false : this.doNotPerform.getValue();
6796        }
6797
6798        /**
6799         * @param value True if the term prohibits the  action.
6800         */
6801        public ActionComponent setDoNotPerform(boolean value) { 
6802            if (this.doNotPerform == null)
6803              this.doNotPerform = new BooleanType();
6804            this.doNotPerform.setValue(value);
6805          return this;
6806        }
6807
6808        /**
6809         * @return {@link #type} (Activity or service obligation to be done or not done, performed or not performed, effectuated or not by this Contract term.)
6810         */
6811        public CodeableConcept getType() { 
6812          if (this.type == null)
6813            if (Configuration.errorOnAutoCreate())
6814              throw new Error("Attempt to auto-create ActionComponent.type");
6815            else if (Configuration.doAutoCreate())
6816              this.type = new CodeableConcept(); // cc
6817          return this.type;
6818        }
6819
6820        public boolean hasType() { 
6821          return this.type != null && !this.type.isEmpty();
6822        }
6823
6824        /**
6825         * @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.)
6826         */
6827        public ActionComponent setType(CodeableConcept value) { 
6828          this.type = value;
6829          return this;
6830        }
6831
6832        /**
6833         * @return {@link #subject} (Entity of the action.)
6834         */
6835        public List<ActionSubjectComponent> getSubject() { 
6836          if (this.subject == null)
6837            this.subject = new ArrayList<ActionSubjectComponent>();
6838          return this.subject;
6839        }
6840
6841        /**
6842         * @return Returns a reference to <code>this</code> for easy method chaining
6843         */
6844        public ActionComponent setSubject(List<ActionSubjectComponent> theSubject) { 
6845          this.subject = theSubject;
6846          return this;
6847        }
6848
6849        public boolean hasSubject() { 
6850          if (this.subject == null)
6851            return false;
6852          for (ActionSubjectComponent item : this.subject)
6853            if (!item.isEmpty())
6854              return true;
6855          return false;
6856        }
6857
6858        public ActionSubjectComponent addSubject() { //3
6859          ActionSubjectComponent t = new ActionSubjectComponent();
6860          if (this.subject == null)
6861            this.subject = new ArrayList<ActionSubjectComponent>();
6862          this.subject.add(t);
6863          return t;
6864        }
6865
6866        public ActionComponent addSubject(ActionSubjectComponent t) { //3
6867          if (t == null)
6868            return this;
6869          if (this.subject == null)
6870            this.subject = new ArrayList<ActionSubjectComponent>();
6871          this.subject.add(t);
6872          return this;
6873        }
6874
6875        /**
6876         * @return The first repetition of repeating field {@link #subject}, creating it if it does not already exist
6877         */
6878        public ActionSubjectComponent getSubjectFirstRep() { 
6879          if (getSubject().isEmpty()) {
6880            addSubject();
6881          }
6882          return getSubject().get(0);
6883        }
6884
6885        /**
6886         * @return {@link #intent} (Reason or purpose for the action stipulated by this Contract Provision.)
6887         */
6888        public CodeableConcept getIntent() { 
6889          if (this.intent == null)
6890            if (Configuration.errorOnAutoCreate())
6891              throw new Error("Attempt to auto-create ActionComponent.intent");
6892            else if (Configuration.doAutoCreate())
6893              this.intent = new CodeableConcept(); // cc
6894          return this.intent;
6895        }
6896
6897        public boolean hasIntent() { 
6898          return this.intent != null && !this.intent.isEmpty();
6899        }
6900
6901        /**
6902         * @param value {@link #intent} (Reason or purpose for the action stipulated by this Contract Provision.)
6903         */
6904        public ActionComponent setIntent(CodeableConcept value) { 
6905          this.intent = value;
6906          return this;
6907        }
6908
6909        /**
6910         * @return {@link #linkId} (Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.)
6911         */
6912        public List<StringType> getLinkId() { 
6913          if (this.linkId == null)
6914            this.linkId = new ArrayList<StringType>();
6915          return this.linkId;
6916        }
6917
6918        /**
6919         * @return Returns a reference to <code>this</code> for easy method chaining
6920         */
6921        public ActionComponent setLinkId(List<StringType> theLinkId) { 
6922          this.linkId = theLinkId;
6923          return this;
6924        }
6925
6926        public boolean hasLinkId() { 
6927          if (this.linkId == null)
6928            return false;
6929          for (StringType item : this.linkId)
6930            if (!item.isEmpty())
6931              return true;
6932          return false;
6933        }
6934
6935        /**
6936         * @return {@link #linkId} (Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.)
6937         */
6938        public StringType addLinkIdElement() {//2 
6939          StringType t = new StringType();
6940          if (this.linkId == null)
6941            this.linkId = new ArrayList<StringType>();
6942          this.linkId.add(t);
6943          return t;
6944        }
6945
6946        /**
6947         * @param value {@link #linkId} (Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.)
6948         */
6949        public ActionComponent addLinkId(String value) { //1
6950          StringType t = new StringType();
6951          t.setValue(value);
6952          if (this.linkId == null)
6953            this.linkId = new ArrayList<StringType>();
6954          this.linkId.add(t);
6955          return this;
6956        }
6957
6958        /**
6959         * @param value {@link #linkId} (Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.)
6960         */
6961        public boolean hasLinkId(String value) { 
6962          if (this.linkId == null)
6963            return false;
6964          for (StringType v : this.linkId)
6965            if (v.getValue().equals(value)) // string
6966              return true;
6967          return false;
6968        }
6969
6970        /**
6971         * @return {@link #status} (Current state of the term action.)
6972         */
6973        public CodeableConcept getStatus() { 
6974          if (this.status == null)
6975            if (Configuration.errorOnAutoCreate())
6976              throw new Error("Attempt to auto-create ActionComponent.status");
6977            else if (Configuration.doAutoCreate())
6978              this.status = new CodeableConcept(); // cc
6979          return this.status;
6980        }
6981
6982        public boolean hasStatus() { 
6983          return this.status != null && !this.status.isEmpty();
6984        }
6985
6986        /**
6987         * @param value {@link #status} (Current state of the term action.)
6988         */
6989        public ActionComponent setStatus(CodeableConcept value) { 
6990          this.status = value;
6991          return this;
6992        }
6993
6994        /**
6995         * @return {@link #context} (Encounter or Episode with primary association to specified term activity.)
6996         */
6997        public Reference getContext() { 
6998          if (this.context == null)
6999            if (Configuration.errorOnAutoCreate())
7000              throw new Error("Attempt to auto-create ActionComponent.context");
7001            else if (Configuration.doAutoCreate())
7002              this.context = new Reference(); // cc
7003          return this.context;
7004        }
7005
7006        public boolean hasContext() { 
7007          return this.context != null && !this.context.isEmpty();
7008        }
7009
7010        /**
7011         * @param value {@link #context} (Encounter or Episode with primary association to specified term activity.)
7012         */
7013        public ActionComponent setContext(Reference value) { 
7014          this.context = value;
7015          return this;
7016        }
7017
7018        /**
7019         * @return {@link #context} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Encounter or Episode with primary association to specified term activity.)
7020         */
7021        public Resource getContextTarget() { 
7022          return this.contextTarget;
7023        }
7024
7025        /**
7026         * @param value {@link #context} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Encounter or Episode with primary association to specified term activity.)
7027         */
7028        public ActionComponent setContextTarget(Resource value) { 
7029          this.contextTarget = value;
7030          return this;
7031        }
7032
7033        /**
7034         * @return {@link #contextLinkId} (Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.)
7035         */
7036        public List<StringType> getContextLinkId() { 
7037          if (this.contextLinkId == null)
7038            this.contextLinkId = new ArrayList<StringType>();
7039          return this.contextLinkId;
7040        }
7041
7042        /**
7043         * @return Returns a reference to <code>this</code> for easy method chaining
7044         */
7045        public ActionComponent setContextLinkId(List<StringType> theContextLinkId) { 
7046          this.contextLinkId = theContextLinkId;
7047          return this;
7048        }
7049
7050        public boolean hasContextLinkId() { 
7051          if (this.contextLinkId == null)
7052            return false;
7053          for (StringType item : this.contextLinkId)
7054            if (!item.isEmpty())
7055              return true;
7056          return false;
7057        }
7058
7059        /**
7060         * @return {@link #contextLinkId} (Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.)
7061         */
7062        public StringType addContextLinkIdElement() {//2 
7063          StringType t = new StringType();
7064          if (this.contextLinkId == null)
7065            this.contextLinkId = new ArrayList<StringType>();
7066          this.contextLinkId.add(t);
7067          return t;
7068        }
7069
7070        /**
7071         * @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.)
7072         */
7073        public ActionComponent addContextLinkId(String value) { //1
7074          StringType t = new StringType();
7075          t.setValue(value);
7076          if (this.contextLinkId == null)
7077            this.contextLinkId = new ArrayList<StringType>();
7078          this.contextLinkId.add(t);
7079          return this;
7080        }
7081
7082        /**
7083         * @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.)
7084         */
7085        public boolean hasContextLinkId(String value) { 
7086          if (this.contextLinkId == null)
7087            return false;
7088          for (StringType v : this.contextLinkId)
7089            if (v.getValue().equals(value)) // string
7090              return true;
7091          return false;
7092        }
7093
7094        /**
7095         * @return {@link #occurrence} (When action happens.)
7096         */
7097        public Type getOccurrence() { 
7098          return this.occurrence;
7099        }
7100
7101        /**
7102         * @return {@link #occurrence} (When action happens.)
7103         */
7104        public DateTimeType getOccurrenceDateTimeType() throws FHIRException { 
7105          if (this.occurrence == null)
7106            this.occurrence = new DateTimeType();
7107          if (!(this.occurrence instanceof DateTimeType))
7108            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.occurrence.getClass().getName()+" was encountered");
7109          return (DateTimeType) this.occurrence;
7110        }
7111
7112        public boolean hasOccurrenceDateTimeType() { 
7113          return this != null && this.occurrence instanceof DateTimeType;
7114        }
7115
7116        /**
7117         * @return {@link #occurrence} (When action happens.)
7118         */
7119        public Period getOccurrencePeriod() throws FHIRException { 
7120          if (this.occurrence == null)
7121            this.occurrence = new Period();
7122          if (!(this.occurrence instanceof Period))
7123            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.occurrence.getClass().getName()+" was encountered");
7124          return (Period) this.occurrence;
7125        }
7126
7127        public boolean hasOccurrencePeriod() { 
7128          return this != null && this.occurrence instanceof Period;
7129        }
7130
7131        /**
7132         * @return {@link #occurrence} (When action happens.)
7133         */
7134        public Timing getOccurrenceTiming() throws FHIRException { 
7135          if (this.occurrence == null)
7136            this.occurrence = new Timing();
7137          if (!(this.occurrence instanceof Timing))
7138            throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.occurrence.getClass().getName()+" was encountered");
7139          return (Timing) this.occurrence;
7140        }
7141
7142        public boolean hasOccurrenceTiming() { 
7143          return this != null && this.occurrence instanceof Timing;
7144        }
7145
7146        public boolean hasOccurrence() { 
7147          return this.occurrence != null && !this.occurrence.isEmpty();
7148        }
7149
7150        /**
7151         * @param value {@link #occurrence} (When action happens.)
7152         */
7153        public ActionComponent setOccurrence(Type value) { 
7154          if (value != null && !(value instanceof DateTimeType || value instanceof Period || value instanceof Timing))
7155            throw new Error("Not the right type for Contract.term.action.occurrence[x]: "+value.fhirType());
7156          this.occurrence = value;
7157          return this;
7158        }
7159
7160        /**
7161         * @return {@link #requester} (Who or what initiated the action and has responsibility for its activation.)
7162         */
7163        public List<Reference> getRequester() { 
7164          if (this.requester == null)
7165            this.requester = new ArrayList<Reference>();
7166          return this.requester;
7167        }
7168
7169        /**
7170         * @return Returns a reference to <code>this</code> for easy method chaining
7171         */
7172        public ActionComponent setRequester(List<Reference> theRequester) { 
7173          this.requester = theRequester;
7174          return this;
7175        }
7176
7177        public boolean hasRequester() { 
7178          if (this.requester == null)
7179            return false;
7180          for (Reference item : this.requester)
7181            if (!item.isEmpty())
7182              return true;
7183          return false;
7184        }
7185
7186        public Reference addRequester() { //3
7187          Reference t = new Reference();
7188          if (this.requester == null)
7189            this.requester = new ArrayList<Reference>();
7190          this.requester.add(t);
7191          return t;
7192        }
7193
7194        public ActionComponent addRequester(Reference t) { //3
7195          if (t == null)
7196            return this;
7197          if (this.requester == null)
7198            this.requester = new ArrayList<Reference>();
7199          this.requester.add(t);
7200          return this;
7201        }
7202
7203        /**
7204         * @return The first repetition of repeating field {@link #requester}, creating it if it does not already exist
7205         */
7206        public Reference getRequesterFirstRep() { 
7207          if (getRequester().isEmpty()) {
7208            addRequester();
7209          }
7210          return getRequester().get(0);
7211        }
7212
7213        /**
7214         * @deprecated Use Reference#setResource(IBaseResource) instead
7215         */
7216        @Deprecated
7217        public List<Resource> getRequesterTarget() { 
7218          if (this.requesterTarget == null)
7219            this.requesterTarget = new ArrayList<Resource>();
7220          return this.requesterTarget;
7221        }
7222
7223        /**
7224         * @return {@link #requesterLinkId} (Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.)
7225         */
7226        public List<StringType> getRequesterLinkId() { 
7227          if (this.requesterLinkId == null)
7228            this.requesterLinkId = new ArrayList<StringType>();
7229          return this.requesterLinkId;
7230        }
7231
7232        /**
7233         * @return Returns a reference to <code>this</code> for easy method chaining
7234         */
7235        public ActionComponent setRequesterLinkId(List<StringType> theRequesterLinkId) { 
7236          this.requesterLinkId = theRequesterLinkId;
7237          return this;
7238        }
7239
7240        public boolean hasRequesterLinkId() { 
7241          if (this.requesterLinkId == null)
7242            return false;
7243          for (StringType item : this.requesterLinkId)
7244            if (!item.isEmpty())
7245              return true;
7246          return false;
7247        }
7248
7249        /**
7250         * @return {@link #requesterLinkId} (Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.)
7251         */
7252        public StringType addRequesterLinkIdElement() {//2 
7253          StringType t = new StringType();
7254          if (this.requesterLinkId == null)
7255            this.requesterLinkId = new ArrayList<StringType>();
7256          this.requesterLinkId.add(t);
7257          return t;
7258        }
7259
7260        /**
7261         * @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.)
7262         */
7263        public ActionComponent addRequesterLinkId(String value) { //1
7264          StringType t = new StringType();
7265          t.setValue(value);
7266          if (this.requesterLinkId == null)
7267            this.requesterLinkId = new ArrayList<StringType>();
7268          this.requesterLinkId.add(t);
7269          return this;
7270        }
7271
7272        /**
7273         * @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.)
7274         */
7275        public boolean hasRequesterLinkId(String value) { 
7276          if (this.requesterLinkId == null)
7277            return false;
7278          for (StringType v : this.requesterLinkId)
7279            if (v.getValue().equals(value)) // string
7280              return true;
7281          return false;
7282        }
7283
7284        /**
7285         * @return {@link #performerType} (The type of individual that is desired or required to perform or not perform the action.)
7286         */
7287        public List<CodeableConcept> getPerformerType() { 
7288          if (this.performerType == null)
7289            this.performerType = new ArrayList<CodeableConcept>();
7290          return this.performerType;
7291        }
7292
7293        /**
7294         * @return Returns a reference to <code>this</code> for easy method chaining
7295         */
7296        public ActionComponent setPerformerType(List<CodeableConcept> thePerformerType) { 
7297          this.performerType = thePerformerType;
7298          return this;
7299        }
7300
7301        public boolean hasPerformerType() { 
7302          if (this.performerType == null)
7303            return false;
7304          for (CodeableConcept item : this.performerType)
7305            if (!item.isEmpty())
7306              return true;
7307          return false;
7308        }
7309
7310        public CodeableConcept addPerformerType() { //3
7311          CodeableConcept t = new CodeableConcept();
7312          if (this.performerType == null)
7313            this.performerType = new ArrayList<CodeableConcept>();
7314          this.performerType.add(t);
7315          return t;
7316        }
7317
7318        public ActionComponent addPerformerType(CodeableConcept t) { //3
7319          if (t == null)
7320            return this;
7321          if (this.performerType == null)
7322            this.performerType = new ArrayList<CodeableConcept>();
7323          this.performerType.add(t);
7324          return this;
7325        }
7326
7327        /**
7328         * @return The first repetition of repeating field {@link #performerType}, creating it if it does not already exist
7329         */
7330        public CodeableConcept getPerformerTypeFirstRep() { 
7331          if (getPerformerType().isEmpty()) {
7332            addPerformerType();
7333          }
7334          return getPerformerType().get(0);
7335        }
7336
7337        /**
7338         * @return {@link #performerRole} (The type of role or competency of an individual desired or required to perform or not perform the action.)
7339         */
7340        public CodeableConcept getPerformerRole() { 
7341          if (this.performerRole == null)
7342            if (Configuration.errorOnAutoCreate())
7343              throw new Error("Attempt to auto-create ActionComponent.performerRole");
7344            else if (Configuration.doAutoCreate())
7345              this.performerRole = new CodeableConcept(); // cc
7346          return this.performerRole;
7347        }
7348
7349        public boolean hasPerformerRole() { 
7350          return this.performerRole != null && !this.performerRole.isEmpty();
7351        }
7352
7353        /**
7354         * @param value {@link #performerRole} (The type of role or competency of an individual desired or required to perform or not perform the action.)
7355         */
7356        public ActionComponent setPerformerRole(CodeableConcept value) { 
7357          this.performerRole = value;
7358          return this;
7359        }
7360
7361        /**
7362         * @return {@link #performer} (Indicates who or what is being asked to perform (or not perform) the ction.)
7363         */
7364        public Reference getPerformer() { 
7365          if (this.performer == null)
7366            if (Configuration.errorOnAutoCreate())
7367              throw new Error("Attempt to auto-create ActionComponent.performer");
7368            else if (Configuration.doAutoCreate())
7369              this.performer = new Reference(); // cc
7370          return this.performer;
7371        }
7372
7373        public boolean hasPerformer() { 
7374          return this.performer != null && !this.performer.isEmpty();
7375        }
7376
7377        /**
7378         * @param value {@link #performer} (Indicates who or what is being asked to perform (or not perform) the ction.)
7379         */
7380        public ActionComponent setPerformer(Reference value) { 
7381          this.performer = value;
7382          return this;
7383        }
7384
7385        /**
7386         * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates who or what is being asked to perform (or not perform) the ction.)
7387         */
7388        public Resource getPerformerTarget() { 
7389          return this.performerTarget;
7390        }
7391
7392        /**
7393         * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates who or what is being asked to perform (or not perform) the ction.)
7394         */
7395        public ActionComponent setPerformerTarget(Resource value) { 
7396          this.performerTarget = value;
7397          return this;
7398        }
7399
7400        /**
7401         * @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.)
7402         */
7403        public List<StringType> getPerformerLinkId() { 
7404          if (this.performerLinkId == null)
7405            this.performerLinkId = new ArrayList<StringType>();
7406          return this.performerLinkId;
7407        }
7408
7409        /**
7410         * @return Returns a reference to <code>this</code> for easy method chaining
7411         */
7412        public ActionComponent setPerformerLinkId(List<StringType> thePerformerLinkId) { 
7413          this.performerLinkId = thePerformerLinkId;
7414          return this;
7415        }
7416
7417        public boolean hasPerformerLinkId() { 
7418          if (this.performerLinkId == null)
7419            return false;
7420          for (StringType item : this.performerLinkId)
7421            if (!item.isEmpty())
7422              return true;
7423          return false;
7424        }
7425
7426        /**
7427         * @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.)
7428         */
7429        public StringType addPerformerLinkIdElement() {//2 
7430          StringType t = new StringType();
7431          if (this.performerLinkId == null)
7432            this.performerLinkId = new ArrayList<StringType>();
7433          this.performerLinkId.add(t);
7434          return t;
7435        }
7436
7437        /**
7438         * @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.)
7439         */
7440        public ActionComponent addPerformerLinkId(String value) { //1
7441          StringType t = new StringType();
7442          t.setValue(value);
7443          if (this.performerLinkId == null)
7444            this.performerLinkId = new ArrayList<StringType>();
7445          this.performerLinkId.add(t);
7446          return this;
7447        }
7448
7449        /**
7450         * @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.)
7451         */
7452        public boolean hasPerformerLinkId(String value) { 
7453          if (this.performerLinkId == null)
7454            return false;
7455          for (StringType v : this.performerLinkId)
7456            if (v.getValue().equals(value)) // string
7457              return true;
7458          return false;
7459        }
7460
7461        /**
7462         * @return {@link #reasonCode} (Rationale for the action to be performed or not performed. Describes why the action is permitted or prohibited.)
7463         */
7464        public List<CodeableConcept> getReasonCode() { 
7465          if (this.reasonCode == null)
7466            this.reasonCode = new ArrayList<CodeableConcept>();
7467          return this.reasonCode;
7468        }
7469
7470        /**
7471         * @return Returns a reference to <code>this</code> for easy method chaining
7472         */
7473        public ActionComponent setReasonCode(List<CodeableConcept> theReasonCode) { 
7474          this.reasonCode = theReasonCode;
7475          return this;
7476        }
7477
7478        public boolean hasReasonCode() { 
7479          if (this.reasonCode == null)
7480            return false;
7481          for (CodeableConcept item : this.reasonCode)
7482            if (!item.isEmpty())
7483              return true;
7484          return false;
7485        }
7486
7487        public CodeableConcept addReasonCode() { //3
7488          CodeableConcept t = new CodeableConcept();
7489          if (this.reasonCode == null)
7490            this.reasonCode = new ArrayList<CodeableConcept>();
7491          this.reasonCode.add(t);
7492          return t;
7493        }
7494
7495        public ActionComponent addReasonCode(CodeableConcept t) { //3
7496          if (t == null)
7497            return this;
7498          if (this.reasonCode == null)
7499            this.reasonCode = new ArrayList<CodeableConcept>();
7500          this.reasonCode.add(t);
7501          return this;
7502        }
7503
7504        /**
7505         * @return The first repetition of repeating field {@link #reasonCode}, creating it if it does not already exist
7506         */
7507        public CodeableConcept getReasonCodeFirstRep() { 
7508          if (getReasonCode().isEmpty()) {
7509            addReasonCode();
7510          }
7511          return getReasonCode().get(0);
7512        }
7513
7514        /**
7515         * @return {@link #reasonReference} (Indicates another resource whose existence justifies permitting or not permitting this action.)
7516         */
7517        public List<Reference> getReasonReference() { 
7518          if (this.reasonReference == null)
7519            this.reasonReference = new ArrayList<Reference>();
7520          return this.reasonReference;
7521        }
7522
7523        /**
7524         * @return Returns a reference to <code>this</code> for easy method chaining
7525         */
7526        public ActionComponent setReasonReference(List<Reference> theReasonReference) { 
7527          this.reasonReference = theReasonReference;
7528          return this;
7529        }
7530
7531        public boolean hasReasonReference() { 
7532          if (this.reasonReference == null)
7533            return false;
7534          for (Reference item : this.reasonReference)
7535            if (!item.isEmpty())
7536              return true;
7537          return false;
7538        }
7539
7540        public Reference addReasonReference() { //3
7541          Reference t = new Reference();
7542          if (this.reasonReference == null)
7543            this.reasonReference = new ArrayList<Reference>();
7544          this.reasonReference.add(t);
7545          return t;
7546        }
7547
7548        public ActionComponent addReasonReference(Reference t) { //3
7549          if (t == null)
7550            return this;
7551          if (this.reasonReference == null)
7552            this.reasonReference = new ArrayList<Reference>();
7553          this.reasonReference.add(t);
7554          return this;
7555        }
7556
7557        /**
7558         * @return The first repetition of repeating field {@link #reasonReference}, creating it if it does not already exist
7559         */
7560        public Reference getReasonReferenceFirstRep() { 
7561          if (getReasonReference().isEmpty()) {
7562            addReasonReference();
7563          }
7564          return getReasonReference().get(0);
7565        }
7566
7567        /**
7568         * @deprecated Use Reference#setResource(IBaseResource) instead
7569         */
7570        @Deprecated
7571        public List<Resource> getReasonReferenceTarget() { 
7572          if (this.reasonReferenceTarget == null)
7573            this.reasonReferenceTarget = new ArrayList<Resource>();
7574          return this.reasonReferenceTarget;
7575        }
7576
7577        /**
7578         * @return {@link #reason} (Describes why the action is to be performed or not performed in textual form.)
7579         */
7580        public List<StringType> getReason() { 
7581          if (this.reason == null)
7582            this.reason = new ArrayList<StringType>();
7583          return this.reason;
7584        }
7585
7586        /**
7587         * @return Returns a reference to <code>this</code> for easy method chaining
7588         */
7589        public ActionComponent setReason(List<StringType> theReason) { 
7590          this.reason = theReason;
7591          return this;
7592        }
7593
7594        public boolean hasReason() { 
7595          if (this.reason == null)
7596            return false;
7597          for (StringType item : this.reason)
7598            if (!item.isEmpty())
7599              return true;
7600          return false;
7601        }
7602
7603        /**
7604         * @return {@link #reason} (Describes why the action is to be performed or not performed in textual form.)
7605         */
7606        public StringType addReasonElement() {//2 
7607          StringType t = new StringType();
7608          if (this.reason == null)
7609            this.reason = new ArrayList<StringType>();
7610          this.reason.add(t);
7611          return t;
7612        }
7613
7614        /**
7615         * @param value {@link #reason} (Describes why the action is to be performed or not performed in textual form.)
7616         */
7617        public ActionComponent addReason(String value) { //1
7618          StringType t = new StringType();
7619          t.setValue(value);
7620          if (this.reason == null)
7621            this.reason = new ArrayList<StringType>();
7622          this.reason.add(t);
7623          return this;
7624        }
7625
7626        /**
7627         * @param value {@link #reason} (Describes why the action is to be performed or not performed in textual form.)
7628         */
7629        public boolean hasReason(String value) { 
7630          if (this.reason == null)
7631            return false;
7632          for (StringType v : this.reason)
7633            if (v.getValue().equals(value)) // string
7634              return true;
7635          return false;
7636        }
7637
7638        /**
7639         * @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.)
7640         */
7641        public List<StringType> getReasonLinkId() { 
7642          if (this.reasonLinkId == null)
7643            this.reasonLinkId = new ArrayList<StringType>();
7644          return this.reasonLinkId;
7645        }
7646
7647        /**
7648         * @return Returns a reference to <code>this</code> for easy method chaining
7649         */
7650        public ActionComponent setReasonLinkId(List<StringType> theReasonLinkId) { 
7651          this.reasonLinkId = theReasonLinkId;
7652          return this;
7653        }
7654
7655        public boolean hasReasonLinkId() { 
7656          if (this.reasonLinkId == null)
7657            return false;
7658          for (StringType item : this.reasonLinkId)
7659            if (!item.isEmpty())
7660              return true;
7661          return false;
7662        }
7663
7664        /**
7665         * @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.)
7666         */
7667        public StringType addReasonLinkIdElement() {//2 
7668          StringType t = new StringType();
7669          if (this.reasonLinkId == null)
7670            this.reasonLinkId = new ArrayList<StringType>();
7671          this.reasonLinkId.add(t);
7672          return t;
7673        }
7674
7675        /**
7676         * @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.)
7677         */
7678        public ActionComponent addReasonLinkId(String value) { //1
7679          StringType t = new StringType();
7680          t.setValue(value);
7681          if (this.reasonLinkId == null)
7682            this.reasonLinkId = new ArrayList<StringType>();
7683          this.reasonLinkId.add(t);
7684          return this;
7685        }
7686
7687        /**
7688         * @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.)
7689         */
7690        public boolean hasReasonLinkId(String value) { 
7691          if (this.reasonLinkId == null)
7692            return false;
7693          for (StringType v : this.reasonLinkId)
7694            if (v.getValue().equals(value)) // string
7695              return true;
7696          return false;
7697        }
7698
7699        /**
7700         * @return {@link #note} (Comments made about the term action made by the requester, performer, subject or other participants.)
7701         */
7702        public List<Annotation> getNote() { 
7703          if (this.note == null)
7704            this.note = new ArrayList<Annotation>();
7705          return this.note;
7706        }
7707
7708        /**
7709         * @return Returns a reference to <code>this</code> for easy method chaining
7710         */
7711        public ActionComponent setNote(List<Annotation> theNote) { 
7712          this.note = theNote;
7713          return this;
7714        }
7715
7716        public boolean hasNote() { 
7717          if (this.note == null)
7718            return false;
7719          for (Annotation item : this.note)
7720            if (!item.isEmpty())
7721              return true;
7722          return false;
7723        }
7724
7725        public Annotation addNote() { //3
7726          Annotation t = new Annotation();
7727          if (this.note == null)
7728            this.note = new ArrayList<Annotation>();
7729          this.note.add(t);
7730          return t;
7731        }
7732
7733        public ActionComponent addNote(Annotation t) { //3
7734          if (t == null)
7735            return this;
7736          if (this.note == null)
7737            this.note = new ArrayList<Annotation>();
7738          this.note.add(t);
7739          return this;
7740        }
7741
7742        /**
7743         * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
7744         */
7745        public Annotation getNoteFirstRep() { 
7746          if (getNote().isEmpty()) {
7747            addNote();
7748          }
7749          return getNote().get(0);
7750        }
7751
7752        /**
7753         * @return {@link #securityLabelNumber} (Security labels that protects the action.)
7754         */
7755        public List<UnsignedIntType> getSecurityLabelNumber() { 
7756          if (this.securityLabelNumber == null)
7757            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
7758          return this.securityLabelNumber;
7759        }
7760
7761        /**
7762         * @return Returns a reference to <code>this</code> for easy method chaining
7763         */
7764        public ActionComponent setSecurityLabelNumber(List<UnsignedIntType> theSecurityLabelNumber) { 
7765          this.securityLabelNumber = theSecurityLabelNumber;
7766          return this;
7767        }
7768
7769        public boolean hasSecurityLabelNumber() { 
7770          if (this.securityLabelNumber == null)
7771            return false;
7772          for (UnsignedIntType item : this.securityLabelNumber)
7773            if (!item.isEmpty())
7774              return true;
7775          return false;
7776        }
7777
7778        /**
7779         * @return {@link #securityLabelNumber} (Security labels that protects the action.)
7780         */
7781        public UnsignedIntType addSecurityLabelNumberElement() {//2 
7782          UnsignedIntType t = new UnsignedIntType();
7783          if (this.securityLabelNumber == null)
7784            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
7785          this.securityLabelNumber.add(t);
7786          return t;
7787        }
7788
7789        /**
7790         * @param value {@link #securityLabelNumber} (Security labels that protects the action.)
7791         */
7792        public ActionComponent addSecurityLabelNumber(int value) { //1
7793          UnsignedIntType t = new UnsignedIntType();
7794          t.setValue(value);
7795          if (this.securityLabelNumber == null)
7796            this.securityLabelNumber = new ArrayList<UnsignedIntType>();
7797          this.securityLabelNumber.add(t);
7798          return this;
7799        }
7800
7801        /**
7802         * @param value {@link #securityLabelNumber} (Security labels that protects the action.)
7803         */
7804        public boolean hasSecurityLabelNumber(int value) { 
7805          if (this.securityLabelNumber == null)
7806            return false;
7807          for (UnsignedIntType v : this.securityLabelNumber)
7808            if (v.getValue().equals(value)) // unsignedInt
7809              return true;
7810          return false;
7811        }
7812
7813        protected void listChildren(List<Property> children) {
7814          super.listChildren(children);
7815          children.add(new Property("doNotPerform", "boolean", "True if the term prohibits the  action.", 0, 1, doNotPerform));
7816          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));
7817          children.add(new Property("subject", "", "Entity of the action.", 0, java.lang.Integer.MAX_VALUE, subject));
7818          children.add(new Property("intent", "CodeableConcept", "Reason or purpose for the action stipulated by this Contract Provision.", 0, 1, intent));
7819          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));
7820          children.add(new Property("status", "CodeableConcept", "Current state of the term action.", 0, 1, status));
7821          children.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "Encounter or Episode with primary association to specified term activity.", 0, 1, context));
7822          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));
7823          children.add(new Property("occurrence[x]", "dateTime|Period|Timing", "When action happens.", 0, 1, occurrence));
7824          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));
7825          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));
7826          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));
7827          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));
7828          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));
7829          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));
7830          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));
7831          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));
7832          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));
7833          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));
7834          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));
7835          children.add(new Property("securityLabelNumber", "unsignedInt", "Security labels that protects the action.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber));
7836        }
7837
7838        @Override
7839        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7840          switch (_hash) {
7841          case -1788508167: /*doNotPerform*/  return new Property("doNotPerform", "boolean", "True if the term prohibits the  action.", 0, 1, doNotPerform);
7842          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);
7843          case -1867885268: /*subject*/  return new Property("subject", "", "Entity of the action.", 0, java.lang.Integer.MAX_VALUE, subject);
7844          case -1183762788: /*intent*/  return new Property("intent", "CodeableConcept", "Reason or purpose for the action stipulated by this Contract Provision.", 0, 1, intent);
7845          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);
7846          case -892481550: /*status*/  return new Property("status", "CodeableConcept", "Current state of the term action.", 0, 1, status);
7847          case 951530927: /*context*/  return new Property("context", "Reference(Encounter|EpisodeOfCare)", "Encounter or Episode with primary association to specified term activity.", 0, 1, context);
7848          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);
7849          case -2022646513: /*occurrence[x]*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "When action happens.", 0, 1, occurrence);
7850          case 1687874001: /*occurrence*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "When action happens.", 0, 1, occurrence);
7851          case -298443636: /*occurrenceDateTime*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "When action happens.", 0, 1, occurrence);
7852          case 1397156594: /*occurrencePeriod*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "When action happens.", 0, 1, occurrence);
7853          case 1515218299: /*occurrenceTiming*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "When action happens.", 0, 1, occurrence);
7854          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);
7855          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);
7856          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);
7857          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);
7858          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);
7859          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);
7860          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);
7861          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);
7862          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);
7863          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);
7864          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);
7865          case -149460995: /*securityLabelNumber*/  return new Property("securityLabelNumber", "unsignedInt", "Security labels that protects the action.", 0, java.lang.Integer.MAX_VALUE, securityLabelNumber);
7866          default: return super.getNamedProperty(_hash, _name, _checkValid);
7867          }
7868
7869        }
7870
7871      @Override
7872      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7873        switch (hash) {
7874        case -1788508167: /*doNotPerform*/ return this.doNotPerform == null ? new Base[0] : new Base[] {this.doNotPerform}; // BooleanType
7875        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
7876        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // ActionSubjectComponent
7877        case -1183762788: /*intent*/ return this.intent == null ? new Base[0] : new Base[] {this.intent}; // CodeableConcept
7878        case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : this.linkId.toArray(new Base[this.linkId.size()]); // StringType
7879        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept
7880        case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference
7881        case -288783036: /*contextLinkId*/ return this.contextLinkId == null ? new Base[0] : this.contextLinkId.toArray(new Base[this.contextLinkId.size()]); // StringType
7882        case 1687874001: /*occurrence*/ return this.occurrence == null ? new Base[0] : new Base[] {this.occurrence}; // Type
7883        case 693933948: /*requester*/ return this.requester == null ? new Base[0] : this.requester.toArray(new Base[this.requester.size()]); // Reference
7884        case -1468032687: /*requesterLinkId*/ return this.requesterLinkId == null ? new Base[0] : this.requesterLinkId.toArray(new Base[this.requesterLinkId.size()]); // StringType
7885        case -901444568: /*performerType*/ return this.performerType == null ? new Base[0] : this.performerType.toArray(new Base[this.performerType.size()]); // CodeableConcept
7886        case -901513884: /*performerRole*/ return this.performerRole == null ? new Base[0] : new Base[] {this.performerRole}; // CodeableConcept
7887        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference
7888        case 1051302947: /*performerLinkId*/ return this.performerLinkId == null ? new Base[0] : this.performerLinkId.toArray(new Base[this.performerLinkId.size()]); // StringType
7889        case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
7890        case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
7891        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // StringType
7892        case -1557963239: /*reasonLinkId*/ return this.reasonLinkId == null ? new Base[0] : this.reasonLinkId.toArray(new Base[this.reasonLinkId.size()]); // StringType
7893        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
7894        case -149460995: /*securityLabelNumber*/ return this.securityLabelNumber == null ? new Base[0] : this.securityLabelNumber.toArray(new Base[this.securityLabelNumber.size()]); // UnsignedIntType
7895        default: return super.getProperty(hash, name, checkValid);
7896        }
7897
7898      }
7899
7900      @Override
7901      public Base setProperty(int hash, String name, Base value) throws FHIRException {
7902        switch (hash) {
7903        case -1788508167: // doNotPerform
7904          this.doNotPerform = castToBoolean(value); // BooleanType
7905          return value;
7906        case 3575610: // type
7907          this.type = castToCodeableConcept(value); // CodeableConcept
7908          return value;
7909        case -1867885268: // subject
7910          this.getSubject().add((ActionSubjectComponent) value); // ActionSubjectComponent
7911          return value;
7912        case -1183762788: // intent
7913          this.intent = castToCodeableConcept(value); // CodeableConcept
7914          return value;
7915        case -1102667083: // linkId
7916          this.getLinkId().add(castToString(value)); // StringType
7917          return value;
7918        case -892481550: // status
7919          this.status = castToCodeableConcept(value); // CodeableConcept
7920          return value;
7921        case 951530927: // context
7922          this.context = castToReference(value); // Reference
7923          return value;
7924        case -288783036: // contextLinkId
7925          this.getContextLinkId().add(castToString(value)); // StringType
7926          return value;
7927        case 1687874001: // occurrence
7928          this.occurrence = castToType(value); // Type
7929          return value;
7930        case 693933948: // requester
7931          this.getRequester().add(castToReference(value)); // Reference
7932          return value;
7933        case -1468032687: // requesterLinkId
7934          this.getRequesterLinkId().add(castToString(value)); // StringType
7935          return value;
7936        case -901444568: // performerType
7937          this.getPerformerType().add(castToCodeableConcept(value)); // CodeableConcept
7938          return value;
7939        case -901513884: // performerRole
7940          this.performerRole = castToCodeableConcept(value); // CodeableConcept
7941          return value;
7942        case 481140686: // performer
7943          this.performer = castToReference(value); // Reference
7944          return value;
7945        case 1051302947: // performerLinkId
7946          this.getPerformerLinkId().add(castToString(value)); // StringType
7947          return value;
7948        case 722137681: // reasonCode
7949          this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
7950          return value;
7951        case -1146218137: // reasonReference
7952          this.getReasonReference().add(castToReference(value)); // Reference
7953          return value;
7954        case -934964668: // reason
7955          this.getReason().add(castToString(value)); // StringType
7956          return value;
7957        case -1557963239: // reasonLinkId
7958          this.getReasonLinkId().add(castToString(value)); // StringType
7959          return value;
7960        case 3387378: // note
7961          this.getNote().add(castToAnnotation(value)); // Annotation
7962          return value;
7963        case -149460995: // securityLabelNumber
7964          this.getSecurityLabelNumber().add(castToUnsignedInt(value)); // UnsignedIntType
7965          return value;
7966        default: return super.setProperty(hash, name, value);
7967        }
7968
7969      }
7970
7971      @Override
7972      public Base setProperty(String name, Base value) throws FHIRException {
7973        if (name.equals("doNotPerform")) {
7974          this.doNotPerform = castToBoolean(value); // BooleanType
7975        } else if (name.equals("type")) {
7976          this.type = castToCodeableConcept(value); // CodeableConcept
7977        } else if (name.equals("subject")) {
7978          this.getSubject().add((ActionSubjectComponent) value);
7979        } else if (name.equals("intent")) {
7980          this.intent = castToCodeableConcept(value); // CodeableConcept
7981        } else if (name.equals("linkId")) {
7982          this.getLinkId().add(castToString(value));
7983        } else if (name.equals("status")) {
7984          this.status = castToCodeableConcept(value); // CodeableConcept
7985        } else if (name.equals("context")) {
7986          this.context = castToReference(value); // Reference
7987        } else if (name.equals("contextLinkId")) {
7988          this.getContextLinkId().add(castToString(value));
7989        } else if (name.equals("occurrence[x]")) {
7990          this.occurrence = castToType(value); // Type
7991        } else if (name.equals("requester")) {
7992          this.getRequester().add(castToReference(value));
7993        } else if (name.equals("requesterLinkId")) {
7994          this.getRequesterLinkId().add(castToString(value));
7995        } else if (name.equals("performerType")) {
7996          this.getPerformerType().add(castToCodeableConcept(value));
7997        } else if (name.equals("performerRole")) {
7998          this.performerRole = castToCodeableConcept(value); // CodeableConcept
7999        } else if (name.equals("performer")) {
8000          this.performer = castToReference(value); // Reference
8001        } else if (name.equals("performerLinkId")) {
8002          this.getPerformerLinkId().add(castToString(value));
8003        } else if (name.equals("reasonCode")) {
8004          this.getReasonCode().add(castToCodeableConcept(value));
8005        } else if (name.equals("reasonReference")) {
8006          this.getReasonReference().add(castToReference(value));
8007        } else if (name.equals("reason")) {
8008          this.getReason().add(castToString(value));
8009        } else if (name.equals("reasonLinkId")) {
8010          this.getReasonLinkId().add(castToString(value));
8011        } else if (name.equals("note")) {
8012          this.getNote().add(castToAnnotation(value));
8013        } else if (name.equals("securityLabelNumber")) {
8014          this.getSecurityLabelNumber().add(castToUnsignedInt(value));
8015        } else
8016          return super.setProperty(name, value);
8017        return value;
8018      }
8019
8020      @Override
8021      public Base makeProperty(int hash, String name) throws FHIRException {
8022        switch (hash) {
8023        case -1788508167:  return getDoNotPerformElement();
8024        case 3575610:  return getType(); 
8025        case -1867885268:  return addSubject(); 
8026        case -1183762788:  return getIntent(); 
8027        case -1102667083:  return addLinkIdElement();
8028        case -892481550:  return getStatus(); 
8029        case 951530927:  return getContext(); 
8030        case -288783036:  return addContextLinkIdElement();
8031        case -2022646513:  return getOccurrence(); 
8032        case 1687874001:  return getOccurrence(); 
8033        case 693933948:  return addRequester(); 
8034        case -1468032687:  return addRequesterLinkIdElement();
8035        case -901444568:  return addPerformerType(); 
8036        case -901513884:  return getPerformerRole(); 
8037        case 481140686:  return getPerformer(); 
8038        case 1051302947:  return addPerformerLinkIdElement();
8039        case 722137681:  return addReasonCode(); 
8040        case -1146218137:  return addReasonReference(); 
8041        case -934964668:  return addReasonElement();
8042        case -1557963239:  return addReasonLinkIdElement();
8043        case 3387378:  return addNote(); 
8044        case -149460995:  return addSecurityLabelNumberElement();
8045        default: return super.makeProperty(hash, name);
8046        }
8047
8048      }
8049
8050      @Override
8051      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8052        switch (hash) {
8053        case -1788508167: /*doNotPerform*/ return new String[] {"boolean"};
8054        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
8055        case -1867885268: /*subject*/ return new String[] {};
8056        case -1183762788: /*intent*/ return new String[] {"CodeableConcept"};
8057        case -1102667083: /*linkId*/ return new String[] {"string"};
8058        case -892481550: /*status*/ return new String[] {"CodeableConcept"};
8059        case 951530927: /*context*/ return new String[] {"Reference"};
8060        case -288783036: /*contextLinkId*/ return new String[] {"string"};
8061        case 1687874001: /*occurrence*/ return new String[] {"dateTime", "Period", "Timing"};
8062        case 693933948: /*requester*/ return new String[] {"Reference"};
8063        case -1468032687: /*requesterLinkId*/ return new String[] {"string"};
8064        case -901444568: /*performerType*/ return new String[] {"CodeableConcept"};
8065        case -901513884: /*performerRole*/ return new String[] {"CodeableConcept"};
8066        case 481140686: /*performer*/ return new String[] {"Reference"};
8067        case 1051302947: /*performerLinkId*/ return new String[] {"string"};
8068        case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
8069        case -1146218137: /*reasonReference*/ return new String[] {"Reference"};
8070        case -934964668: /*reason*/ return new String[] {"string"};
8071        case -1557963239: /*reasonLinkId*/ return new String[] {"string"};
8072        case 3387378: /*note*/ return new String[] {"Annotation"};
8073        case -149460995: /*securityLabelNumber*/ return new String[] {"unsignedInt"};
8074        default: return super.getTypesForProperty(hash, name);
8075        }
8076
8077      }
8078
8079      @Override
8080      public Base addChild(String name) throws FHIRException {
8081        if (name.equals("doNotPerform")) {
8082          throw new FHIRException("Cannot call addChild on a primitive type Contract.doNotPerform");
8083        }
8084        else if (name.equals("type")) {
8085          this.type = new CodeableConcept();
8086          return this.type;
8087        }
8088        else if (name.equals("subject")) {
8089          return addSubject();
8090        }
8091        else if (name.equals("intent")) {
8092          this.intent = new CodeableConcept();
8093          return this.intent;
8094        }
8095        else if (name.equals("linkId")) {
8096          throw new FHIRException("Cannot call addChild on a primitive type Contract.linkId");
8097        }
8098        else if (name.equals("status")) {
8099          this.status = new CodeableConcept();
8100          return this.status;
8101        }
8102        else if (name.equals("context")) {
8103          this.context = new Reference();
8104          return this.context;
8105        }
8106        else if (name.equals("contextLinkId")) {
8107          throw new FHIRException("Cannot call addChild on a primitive type Contract.contextLinkId");
8108        }
8109        else if (name.equals("occurrenceDateTime")) {
8110          this.occurrence = new DateTimeType();
8111          return this.occurrence;
8112        }
8113        else if (name.equals("occurrencePeriod")) {
8114          this.occurrence = new Period();
8115          return this.occurrence;
8116        }
8117        else if (name.equals("occurrenceTiming")) {
8118          this.occurrence = new Timing();
8119          return this.occurrence;
8120        }
8121        else if (name.equals("requester")) {
8122          return addRequester();
8123        }
8124        else if (name.equals("requesterLinkId")) {
8125          throw new FHIRException("Cannot call addChild on a primitive type Contract.requesterLinkId");
8126        }
8127        else if (name.equals("performerType")) {
8128          return addPerformerType();
8129        }
8130        else if (name.equals("performerRole")) {
8131          this.performerRole = new CodeableConcept();
8132          return this.performerRole;
8133        }
8134        else if (name.equals("performer")) {
8135          this.performer = new Reference();
8136          return this.performer;
8137        }
8138        else if (name.equals("performerLinkId")) {
8139          throw new FHIRException("Cannot call addChild on a primitive type Contract.performerLinkId");
8140        }
8141        else if (name.equals("reasonCode")) {
8142          return addReasonCode();
8143        }
8144        else if (name.equals("reasonReference")) {
8145          return addReasonReference();
8146        }
8147        else if (name.equals("reason")) {
8148          throw new FHIRException("Cannot call addChild on a primitive type Contract.reason");
8149        }
8150        else if (name.equals("reasonLinkId")) {
8151          throw new FHIRException("Cannot call addChild on a primitive type Contract.reasonLinkId");
8152        }
8153        else if (name.equals("note")) {
8154          return addNote();
8155        }
8156        else if (name.equals("securityLabelNumber")) {
8157          throw new FHIRException("Cannot call addChild on a primitive type Contract.securityLabelNumber");
8158        }
8159        else
8160          return super.addChild(name);
8161      }
8162
8163      public ActionComponent copy() {
8164        ActionComponent dst = new ActionComponent();
8165        copyValues(dst);
8166        return dst;
8167      }
8168
8169      public void copyValues(ActionComponent dst) {
8170        super.copyValues(dst);
8171        dst.doNotPerform = doNotPerform == null ? null : doNotPerform.copy();
8172        dst.type = type == null ? null : type.copy();
8173        if (subject != null) {
8174          dst.subject = new ArrayList<ActionSubjectComponent>();
8175          for (ActionSubjectComponent i : subject)
8176            dst.subject.add(i.copy());
8177        };
8178        dst.intent = intent == null ? null : intent.copy();
8179        if (linkId != null) {
8180          dst.linkId = new ArrayList<StringType>();
8181          for (StringType i : linkId)
8182            dst.linkId.add(i.copy());
8183        };
8184        dst.status = status == null ? null : status.copy();
8185        dst.context = context == null ? null : context.copy();
8186        if (contextLinkId != null) {
8187          dst.contextLinkId = new ArrayList<StringType>();
8188          for (StringType i : contextLinkId)
8189            dst.contextLinkId.add(i.copy());
8190        };
8191        dst.occurrence = occurrence == null ? null : occurrence.copy();
8192        if (requester != null) {
8193          dst.requester = new ArrayList<Reference>();
8194          for (Reference i : requester)
8195            dst.requester.add(i.copy());
8196        };
8197        if (requesterLinkId != null) {
8198          dst.requesterLinkId = new ArrayList<StringType>();
8199          for (StringType i : requesterLinkId)
8200            dst.requesterLinkId.add(i.copy());
8201        };
8202        if (performerType != null) {
8203          dst.performerType = new ArrayList<CodeableConcept>();
8204          for (CodeableConcept i : performerType)
8205            dst.performerType.add(i.copy());
8206        };
8207        dst.performerRole = performerRole == null ? null : performerRole.copy();
8208        dst.performer = performer == null ? null : performer.copy();
8209        if (performerLinkId != null) {
8210          dst.performerLinkId = new ArrayList<StringType>();
8211          for (StringType i : performerLinkId)
8212            dst.performerLinkId.add(i.copy());
8213        };
8214        if (reasonCode != null) {
8215          dst.reasonCode = new ArrayList<CodeableConcept>();
8216          for (CodeableConcept i : reasonCode)
8217            dst.reasonCode.add(i.copy());
8218        };
8219        if (reasonReference != null) {
8220          dst.reasonReference = new ArrayList<Reference>();
8221          for (Reference i : reasonReference)
8222            dst.reasonReference.add(i.copy());
8223        };
8224        if (reason != null) {
8225          dst.reason = new ArrayList<StringType>();
8226          for (StringType i : reason)
8227            dst.reason.add(i.copy());
8228        };
8229        if (reasonLinkId != null) {
8230          dst.reasonLinkId = new ArrayList<StringType>();
8231          for (StringType i : reasonLinkId)
8232            dst.reasonLinkId.add(i.copy());
8233        };
8234        if (note != null) {
8235          dst.note = new ArrayList<Annotation>();
8236          for (Annotation i : note)
8237            dst.note.add(i.copy());
8238        };
8239        if (securityLabelNumber != null) {
8240          dst.securityLabelNumber = new ArrayList<UnsignedIntType>();
8241          for (UnsignedIntType i : securityLabelNumber)
8242            dst.securityLabelNumber.add(i.copy());
8243        };
8244      }
8245
8246      @Override
8247      public boolean equalsDeep(Base other_) {
8248        if (!super.equalsDeep(other_))
8249          return false;
8250        if (!(other_ instanceof ActionComponent))
8251          return false;
8252        ActionComponent o = (ActionComponent) other_;
8253        return compareDeep(doNotPerform, o.doNotPerform, true) && compareDeep(type, o.type, true) && compareDeep(subject, o.subject, true)
8254           && compareDeep(intent, o.intent, true) && compareDeep(linkId, o.linkId, true) && compareDeep(status, o.status, true)
8255           && compareDeep(context, o.context, true) && compareDeep(contextLinkId, o.contextLinkId, true) && compareDeep(occurrence, o.occurrence, true)
8256           && compareDeep(requester, o.requester, true) && compareDeep(requesterLinkId, o.requesterLinkId, true)
8257           && compareDeep(performerType, o.performerType, true) && compareDeep(performerRole, o.performerRole, true)
8258           && compareDeep(performer, o.performer, true) && compareDeep(performerLinkId, o.performerLinkId, true)
8259           && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true)
8260           && compareDeep(reason, o.reason, true) && compareDeep(reasonLinkId, o.reasonLinkId, true) && compareDeep(note, o.note, true)
8261           && compareDeep(securityLabelNumber, o.securityLabelNumber, true);
8262      }
8263
8264      @Override
8265      public boolean equalsShallow(Base other_) {
8266        if (!super.equalsShallow(other_))
8267          return false;
8268        if (!(other_ instanceof ActionComponent))
8269          return false;
8270        ActionComponent o = (ActionComponent) other_;
8271        return compareValues(doNotPerform, o.doNotPerform, true) && compareValues(linkId, o.linkId, true) && compareValues(contextLinkId, o.contextLinkId, true)
8272           && compareValues(requesterLinkId, o.requesterLinkId, true) && compareValues(performerLinkId, o.performerLinkId, true)
8273           && compareValues(reason, o.reason, true) && compareValues(reasonLinkId, o.reasonLinkId, true) && compareValues(securityLabelNumber, o.securityLabelNumber, true)
8274          ;
8275      }
8276
8277      public boolean isEmpty() {
8278        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(doNotPerform, type, subject
8279          , intent, linkId, status, context, contextLinkId, occurrence, requester, requesterLinkId
8280          , performerType, performerRole, performer, performerLinkId, reasonCode, reasonReference
8281          , reason, reasonLinkId, note, securityLabelNumber);
8282      }
8283
8284  public String fhirType() {
8285    return "Contract.term.action";
8286
8287  }
8288
8289  }
8290
8291    @Block()
8292    public static class ActionSubjectComponent extends BackboneElement implements IBaseBackboneElement {
8293        /**
8294         * The entity the action is performed or not performed on or for.
8295         */
8296        @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)
8297        @Description(shortDefinition="Entity of the action", formalDefinition="The entity the action is performed or not performed on or for." )
8298        protected List<Reference> reference;
8299        /**
8300         * The actual objects that are the target of the reference (The entity the action is performed or not performed on or for.)
8301         */
8302        protected List<Resource> referenceTarget;
8303
8304
8305        /**
8306         * Role type of agent assigned roles in this Contract.
8307         */
8308        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
8309        @Description(shortDefinition="Role type of the agent", formalDefinition="Role type of agent assigned roles in this Contract." )
8310        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-actorrole")
8311        protected CodeableConcept role;
8312
8313        private static final long serialVersionUID = 128949255L;
8314
8315    /**
8316     * Constructor
8317     */
8318      public ActionSubjectComponent() {
8319        super();
8320      }
8321
8322        /**
8323         * @return {@link #reference} (The entity the action is performed or not performed on or for.)
8324         */
8325        public List<Reference> getReference() { 
8326          if (this.reference == null)
8327            this.reference = new ArrayList<Reference>();
8328          return this.reference;
8329        }
8330
8331        /**
8332         * @return Returns a reference to <code>this</code> for easy method chaining
8333         */
8334        public ActionSubjectComponent setReference(List<Reference> theReference) { 
8335          this.reference = theReference;
8336          return this;
8337        }
8338
8339        public boolean hasReference() { 
8340          if (this.reference == null)
8341            return false;
8342          for (Reference item : this.reference)
8343            if (!item.isEmpty())
8344              return true;
8345          return false;
8346        }
8347
8348        public Reference addReference() { //3
8349          Reference t = new Reference();
8350          if (this.reference == null)
8351            this.reference = new ArrayList<Reference>();
8352          this.reference.add(t);
8353          return t;
8354        }
8355
8356        public ActionSubjectComponent addReference(Reference t) { //3
8357          if (t == null)
8358            return this;
8359          if (this.reference == null)
8360            this.reference = new ArrayList<Reference>();
8361          this.reference.add(t);
8362          return this;
8363        }
8364
8365        /**
8366         * @return The first repetition of repeating field {@link #reference}, creating it if it does not already exist
8367         */
8368        public Reference getReferenceFirstRep() { 
8369          if (getReference().isEmpty()) {
8370            addReference();
8371          }
8372          return getReference().get(0);
8373        }
8374
8375        /**
8376         * @deprecated Use Reference#setResource(IBaseResource) instead
8377         */
8378        @Deprecated
8379        public List<Resource> getReferenceTarget() { 
8380          if (this.referenceTarget == null)
8381            this.referenceTarget = new ArrayList<Resource>();
8382          return this.referenceTarget;
8383        }
8384
8385        /**
8386         * @return {@link #role} (Role type of agent assigned roles in this Contract.)
8387         */
8388        public CodeableConcept getRole() { 
8389          if (this.role == null)
8390            if (Configuration.errorOnAutoCreate())
8391              throw new Error("Attempt to auto-create ActionSubjectComponent.role");
8392            else if (Configuration.doAutoCreate())
8393              this.role = new CodeableConcept(); // cc
8394          return this.role;
8395        }
8396
8397        public boolean hasRole() { 
8398          return this.role != null && !this.role.isEmpty();
8399        }
8400
8401        /**
8402         * @param value {@link #role} (Role type of agent assigned roles in this Contract.)
8403         */
8404        public ActionSubjectComponent setRole(CodeableConcept value) { 
8405          this.role = value;
8406          return this;
8407        }
8408
8409        protected void listChildren(List<Property> children) {
8410          super.listChildren(children);
8411          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));
8412          children.add(new Property("role", "CodeableConcept", "Role type of agent assigned roles in this Contract.", 0, 1, role));
8413        }
8414
8415        @Override
8416        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8417          switch (_hash) {
8418          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);
8419          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "Role type of agent assigned roles in this Contract.", 0, 1, role);
8420          default: return super.getNamedProperty(_hash, _name, _checkValid);
8421          }
8422
8423        }
8424
8425      @Override
8426      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8427        switch (hash) {
8428        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : this.reference.toArray(new Base[this.reference.size()]); // Reference
8429        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
8430        default: return super.getProperty(hash, name, checkValid);
8431        }
8432
8433      }
8434
8435      @Override
8436      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8437        switch (hash) {
8438        case -925155509: // reference
8439          this.getReference().add(castToReference(value)); // Reference
8440          return value;
8441        case 3506294: // role
8442          this.role = castToCodeableConcept(value); // CodeableConcept
8443          return value;
8444        default: return super.setProperty(hash, name, value);
8445        }
8446
8447      }
8448
8449      @Override
8450      public Base setProperty(String name, Base value) throws FHIRException {
8451        if (name.equals("reference")) {
8452          this.getReference().add(castToReference(value));
8453        } else if (name.equals("role")) {
8454          this.role = castToCodeableConcept(value); // CodeableConcept
8455        } else
8456          return super.setProperty(name, value);
8457        return value;
8458      }
8459
8460      @Override
8461      public Base makeProperty(int hash, String name) throws FHIRException {
8462        switch (hash) {
8463        case -925155509:  return addReference(); 
8464        case 3506294:  return getRole(); 
8465        default: return super.makeProperty(hash, name);
8466        }
8467
8468      }
8469
8470      @Override
8471      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8472        switch (hash) {
8473        case -925155509: /*reference*/ return new String[] {"Reference"};
8474        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
8475        default: return super.getTypesForProperty(hash, name);
8476        }
8477
8478      }
8479
8480      @Override
8481      public Base addChild(String name) throws FHIRException {
8482        if (name.equals("reference")) {
8483          return addReference();
8484        }
8485        else if (name.equals("role")) {
8486          this.role = new CodeableConcept();
8487          return this.role;
8488        }
8489        else
8490          return super.addChild(name);
8491      }
8492
8493      public ActionSubjectComponent copy() {
8494        ActionSubjectComponent dst = new ActionSubjectComponent();
8495        copyValues(dst);
8496        return dst;
8497      }
8498
8499      public void copyValues(ActionSubjectComponent dst) {
8500        super.copyValues(dst);
8501        if (reference != null) {
8502          dst.reference = new ArrayList<Reference>();
8503          for (Reference i : reference)
8504            dst.reference.add(i.copy());
8505        };
8506        dst.role = role == null ? null : role.copy();
8507      }
8508
8509      @Override
8510      public boolean equalsDeep(Base other_) {
8511        if (!super.equalsDeep(other_))
8512          return false;
8513        if (!(other_ instanceof ActionSubjectComponent))
8514          return false;
8515        ActionSubjectComponent o = (ActionSubjectComponent) other_;
8516        return compareDeep(reference, o.reference, true) && compareDeep(role, o.role, true);
8517      }
8518
8519      @Override
8520      public boolean equalsShallow(Base other_) {
8521        if (!super.equalsShallow(other_))
8522          return false;
8523        if (!(other_ instanceof ActionSubjectComponent))
8524          return false;
8525        ActionSubjectComponent o = (ActionSubjectComponent) other_;
8526        return true;
8527      }
8528
8529      public boolean isEmpty() {
8530        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(reference, role);
8531      }
8532
8533  public String fhirType() {
8534    return "Contract.term.action.subject";
8535
8536  }
8537
8538  }
8539
8540    @Block()
8541    public static class SignatoryComponent extends BackboneElement implements IBaseBackboneElement {
8542        /**
8543         * Role of this Contract signer, e.g. notary, grantee.
8544         */
8545        @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false)
8546        @Description(shortDefinition="Contract Signatory Role", formalDefinition="Role of this Contract signer, e.g. notary, grantee." )
8547        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-signer-type")
8548        protected Coding type;
8549
8550        /**
8551         * Party which is a signator to this Contract.
8552         */
8553        @Child(name = "party", type = {Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class}, order=2, min=1, max=1, modifier=false, summary=false)
8554        @Description(shortDefinition="Contract Signatory Party", formalDefinition="Party which is a signator to this Contract." )
8555        protected Reference party;
8556
8557        /**
8558         * The actual object that is the target of the reference (Party which is a signator to this Contract.)
8559         */
8560        protected Resource partyTarget;
8561
8562        /**
8563         * Legally binding Contract DSIG signature contents in Base64.
8564         */
8565        @Child(name = "signature", type = {Signature.class}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8566        @Description(shortDefinition="Contract Documentation Signature", formalDefinition="Legally binding Contract DSIG signature contents in Base64." )
8567        protected List<Signature> signature;
8568
8569        private static final long serialVersionUID = 1948139228L;
8570
8571    /**
8572     * Constructor
8573     */
8574      public SignatoryComponent() {
8575        super();
8576      }
8577
8578    /**
8579     * Constructor
8580     */
8581      public SignatoryComponent(Coding type, Reference party) {
8582        super();
8583        this.type = type;
8584        this.party = party;
8585      }
8586
8587        /**
8588         * @return {@link #type} (Role of this Contract signer, e.g. notary, grantee.)
8589         */
8590        public Coding getType() { 
8591          if (this.type == null)
8592            if (Configuration.errorOnAutoCreate())
8593              throw new Error("Attempt to auto-create SignatoryComponent.type");
8594            else if (Configuration.doAutoCreate())
8595              this.type = new Coding(); // cc
8596          return this.type;
8597        }
8598
8599        public boolean hasType() { 
8600          return this.type != null && !this.type.isEmpty();
8601        }
8602
8603        /**
8604         * @param value {@link #type} (Role of this Contract signer, e.g. notary, grantee.)
8605         */
8606        public SignatoryComponent setType(Coding value) { 
8607          this.type = value;
8608          return this;
8609        }
8610
8611        /**
8612         * @return {@link #party} (Party which is a signator to this Contract.)
8613         */
8614        public Reference getParty() { 
8615          if (this.party == null)
8616            if (Configuration.errorOnAutoCreate())
8617              throw new Error("Attempt to auto-create SignatoryComponent.party");
8618            else if (Configuration.doAutoCreate())
8619              this.party = new Reference(); // cc
8620          return this.party;
8621        }
8622
8623        public boolean hasParty() { 
8624          return this.party != null && !this.party.isEmpty();
8625        }
8626
8627        /**
8628         * @param value {@link #party} (Party which is a signator to this Contract.)
8629         */
8630        public SignatoryComponent setParty(Reference value) { 
8631          this.party = value;
8632          return this;
8633        }
8634
8635        /**
8636         * @return {@link #party} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Party which is a signator to this Contract.)
8637         */
8638        public Resource getPartyTarget() { 
8639          return this.partyTarget;
8640        }
8641
8642        /**
8643         * @param value {@link #party} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Party which is a signator to this Contract.)
8644         */
8645        public SignatoryComponent setPartyTarget(Resource value) { 
8646          this.partyTarget = value;
8647          return this;
8648        }
8649
8650        /**
8651         * @return {@link #signature} (Legally binding Contract DSIG signature contents in Base64.)
8652         */
8653        public List<Signature> getSignature() { 
8654          if (this.signature == null)
8655            this.signature = new ArrayList<Signature>();
8656          return this.signature;
8657        }
8658
8659        /**
8660         * @return Returns a reference to <code>this</code> for easy method chaining
8661         */
8662        public SignatoryComponent setSignature(List<Signature> theSignature) { 
8663          this.signature = theSignature;
8664          return this;
8665        }
8666
8667        public boolean hasSignature() { 
8668          if (this.signature == null)
8669            return false;
8670          for (Signature item : this.signature)
8671            if (!item.isEmpty())
8672              return true;
8673          return false;
8674        }
8675
8676        public Signature addSignature() { //3
8677          Signature t = new Signature();
8678          if (this.signature == null)
8679            this.signature = new ArrayList<Signature>();
8680          this.signature.add(t);
8681          return t;
8682        }
8683
8684        public SignatoryComponent addSignature(Signature t) { //3
8685          if (t == null)
8686            return this;
8687          if (this.signature == null)
8688            this.signature = new ArrayList<Signature>();
8689          this.signature.add(t);
8690          return this;
8691        }
8692
8693        /**
8694         * @return The first repetition of repeating field {@link #signature}, creating it if it does not already exist
8695         */
8696        public Signature getSignatureFirstRep() { 
8697          if (getSignature().isEmpty()) {
8698            addSignature();
8699          }
8700          return getSignature().get(0);
8701        }
8702
8703        protected void listChildren(List<Property> children) {
8704          super.listChildren(children);
8705          children.add(new Property("type", "Coding", "Role of this Contract signer, e.g. notary, grantee.", 0, 1, type));
8706          children.add(new Property("party", "Reference(Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "Party which is a signator to this Contract.", 0, 1, party));
8707          children.add(new Property("signature", "Signature", "Legally binding Contract DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, signature));
8708        }
8709
8710        @Override
8711        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8712          switch (_hash) {
8713          case 3575610: /*type*/  return new Property("type", "Coding", "Role of this Contract signer, e.g. notary, grantee.", 0, 1, type);
8714          case 106437350: /*party*/  return new Property("party", "Reference(Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "Party which is a signator to this Contract.", 0, 1, party);
8715          case 1073584312: /*signature*/  return new Property("signature", "Signature", "Legally binding Contract DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, signature);
8716          default: return super.getNamedProperty(_hash, _name, _checkValid);
8717          }
8718
8719        }
8720
8721      @Override
8722      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8723        switch (hash) {
8724        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
8725        case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference
8726        case 1073584312: /*signature*/ return this.signature == null ? new Base[0] : this.signature.toArray(new Base[this.signature.size()]); // Signature
8727        default: return super.getProperty(hash, name, checkValid);
8728        }
8729
8730      }
8731
8732      @Override
8733      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8734        switch (hash) {
8735        case 3575610: // type
8736          this.type = castToCoding(value); // Coding
8737          return value;
8738        case 106437350: // party
8739          this.party = castToReference(value); // Reference
8740          return value;
8741        case 1073584312: // signature
8742          this.getSignature().add(castToSignature(value)); // Signature
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("type")) {
8752          this.type = castToCoding(value); // Coding
8753        } else if (name.equals("party")) {
8754          this.party = castToReference(value); // Reference
8755        } else if (name.equals("signature")) {
8756          this.getSignature().add(castToSignature(value));
8757        } else
8758          return super.setProperty(name, value);
8759        return value;
8760      }
8761
8762      @Override
8763      public Base makeProperty(int hash, String name) throws FHIRException {
8764        switch (hash) {
8765        case 3575610:  return getType(); 
8766        case 106437350:  return getParty(); 
8767        case 1073584312:  return addSignature(); 
8768        default: return super.makeProperty(hash, name);
8769        }
8770
8771      }
8772
8773      @Override
8774      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8775        switch (hash) {
8776        case 3575610: /*type*/ return new String[] {"Coding"};
8777        case 106437350: /*party*/ return new String[] {"Reference"};
8778        case 1073584312: /*signature*/ return new String[] {"Signature"};
8779        default: return super.getTypesForProperty(hash, name);
8780        }
8781
8782      }
8783
8784      @Override
8785      public Base addChild(String name) throws FHIRException {
8786        if (name.equals("type")) {
8787          this.type = new Coding();
8788          return this.type;
8789        }
8790        else if (name.equals("party")) {
8791          this.party = new Reference();
8792          return this.party;
8793        }
8794        else if (name.equals("signature")) {
8795          return addSignature();
8796        }
8797        else
8798          return super.addChild(name);
8799      }
8800
8801      public SignatoryComponent copy() {
8802        SignatoryComponent dst = new SignatoryComponent();
8803        copyValues(dst);
8804        return dst;
8805      }
8806
8807      public void copyValues(SignatoryComponent dst) {
8808        super.copyValues(dst);
8809        dst.type = type == null ? null : type.copy();
8810        dst.party = party == null ? null : party.copy();
8811        if (signature != null) {
8812          dst.signature = new ArrayList<Signature>();
8813          for (Signature i : signature)
8814            dst.signature.add(i.copy());
8815        };
8816      }
8817
8818      @Override
8819      public boolean equalsDeep(Base other_) {
8820        if (!super.equalsDeep(other_))
8821          return false;
8822        if (!(other_ instanceof SignatoryComponent))
8823          return false;
8824        SignatoryComponent o = (SignatoryComponent) other_;
8825        return compareDeep(type, o.type, true) && compareDeep(party, o.party, true) && compareDeep(signature, o.signature, true)
8826          ;
8827      }
8828
8829      @Override
8830      public boolean equalsShallow(Base other_) {
8831        if (!super.equalsShallow(other_))
8832          return false;
8833        if (!(other_ instanceof SignatoryComponent))
8834          return false;
8835        SignatoryComponent o = (SignatoryComponent) other_;
8836        return true;
8837      }
8838
8839      public boolean isEmpty() {
8840        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, party, signature);
8841      }
8842
8843  public String fhirType() {
8844    return "Contract.signer";
8845
8846  }
8847
8848  }
8849
8850    @Block()
8851    public static class FriendlyLanguageComponent extends BackboneElement implements IBaseBackboneElement {
8852        /**
8853         * Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.
8854         */
8855        @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=1, min=1, max=1, modifier=false, summary=false)
8856        @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." )
8857        protected Type content;
8858
8859        private static final long serialVersionUID = -1763459053L;
8860
8861    /**
8862     * Constructor
8863     */
8864      public FriendlyLanguageComponent() {
8865        super();
8866      }
8867
8868    /**
8869     * Constructor
8870     */
8871      public FriendlyLanguageComponent(Type content) {
8872        super();
8873        this.content = content;
8874      }
8875
8876        /**
8877         * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.)
8878         */
8879        public Type getContent() { 
8880          return this.content;
8881        }
8882
8883        /**
8884         * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.)
8885         */
8886        public Attachment getContentAttachment() throws FHIRException { 
8887          if (this.content == null)
8888            this.content = new Attachment();
8889          if (!(this.content instanceof Attachment))
8890            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
8891          return (Attachment) this.content;
8892        }
8893
8894        public boolean hasContentAttachment() { 
8895          return this != null && this.content instanceof Attachment;
8896        }
8897
8898        /**
8899         * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.)
8900         */
8901        public Reference getContentReference() throws FHIRException { 
8902          if (this.content == null)
8903            this.content = new Reference();
8904          if (!(this.content instanceof Reference))
8905            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered");
8906          return (Reference) this.content;
8907        }
8908
8909        public boolean hasContentReference() { 
8910          return this != null && this.content instanceof Reference;
8911        }
8912
8913        public boolean hasContent() { 
8914          return this.content != null && !this.content.isEmpty();
8915        }
8916
8917        /**
8918         * @param value {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.)
8919         */
8920        public FriendlyLanguageComponent setContent(Type value) { 
8921          if (value != null && !(value instanceof Attachment || value instanceof Reference))
8922            throw new Error("Not the right type for Contract.friendly.content[x]: "+value.fhirType());
8923          this.content = value;
8924          return this;
8925        }
8926
8927        protected void listChildren(List<Property> children) {
8928          super.listChildren(children);
8929          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));
8930        }
8931
8932        @Override
8933        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8934          switch (_hash) {
8935          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);
8936          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);
8937          case -702028164: /*contentAttachment*/  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);
8938          case 1193747154: /*contentReference*/  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);
8939          default: return super.getNamedProperty(_hash, _name, _checkValid);
8940          }
8941
8942        }
8943
8944      @Override
8945      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8946        switch (hash) {
8947        case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type
8948        default: return super.getProperty(hash, name, checkValid);
8949        }
8950
8951      }
8952
8953      @Override
8954      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8955        switch (hash) {
8956        case 951530617: // content
8957          this.content = castToType(value); // Type
8958          return value;
8959        default: return super.setProperty(hash, name, value);
8960        }
8961
8962      }
8963
8964      @Override
8965      public Base setProperty(String name, Base value) throws FHIRException {
8966        if (name.equals("content[x]")) {
8967          this.content = castToType(value); // Type
8968        } else
8969          return super.setProperty(name, value);
8970        return value;
8971      }
8972
8973      @Override
8974      public Base makeProperty(int hash, String name) throws FHIRException {
8975        switch (hash) {
8976        case 264548711:  return getContent(); 
8977        case 951530617:  return getContent(); 
8978        default: return super.makeProperty(hash, name);
8979        }
8980
8981      }
8982
8983      @Override
8984      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8985        switch (hash) {
8986        case 951530617: /*content*/ return new String[] {"Attachment", "Reference"};
8987        default: return super.getTypesForProperty(hash, name);
8988        }
8989
8990      }
8991
8992      @Override
8993      public Base addChild(String name) throws FHIRException {
8994        if (name.equals("contentAttachment")) {
8995          this.content = new Attachment();
8996          return this.content;
8997        }
8998        else if (name.equals("contentReference")) {
8999          this.content = new Reference();
9000          return this.content;
9001        }
9002        else
9003          return super.addChild(name);
9004      }
9005
9006      public FriendlyLanguageComponent copy() {
9007        FriendlyLanguageComponent dst = new FriendlyLanguageComponent();
9008        copyValues(dst);
9009        return dst;
9010      }
9011
9012      public void copyValues(FriendlyLanguageComponent dst) {
9013        super.copyValues(dst);
9014        dst.content = content == null ? null : content.copy();
9015      }
9016
9017      @Override
9018      public boolean equalsDeep(Base other_) {
9019        if (!super.equalsDeep(other_))
9020          return false;
9021        if (!(other_ instanceof FriendlyLanguageComponent))
9022          return false;
9023        FriendlyLanguageComponent o = (FriendlyLanguageComponent) other_;
9024        return compareDeep(content, o.content, true);
9025      }
9026
9027      @Override
9028      public boolean equalsShallow(Base other_) {
9029        if (!super.equalsShallow(other_))
9030          return false;
9031        if (!(other_ instanceof FriendlyLanguageComponent))
9032          return false;
9033        FriendlyLanguageComponent o = (FriendlyLanguageComponent) other_;
9034        return true;
9035      }
9036
9037      public boolean isEmpty() {
9038        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(content);
9039      }
9040
9041  public String fhirType() {
9042    return "Contract.friendly";
9043
9044  }
9045
9046  }
9047
9048    @Block()
9049    public static class LegalLanguageComponent extends BackboneElement implements IBaseBackboneElement {
9050        /**
9051         * Contract legal text in human renderable form.
9052         */
9053        @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=1, min=1, max=1, modifier=false, summary=false)
9054        @Description(shortDefinition="Contract Legal Text", formalDefinition="Contract legal text in human renderable form." )
9055        protected Type content;
9056
9057        private static final long serialVersionUID = -1763459053L;
9058
9059    /**
9060     * Constructor
9061     */
9062      public LegalLanguageComponent() {
9063        super();
9064      }
9065
9066    /**
9067     * Constructor
9068     */
9069      public LegalLanguageComponent(Type content) {
9070        super();
9071        this.content = content;
9072      }
9073
9074        /**
9075         * @return {@link #content} (Contract legal text in human renderable form.)
9076         */
9077        public Type getContent() { 
9078          return this.content;
9079        }
9080
9081        /**
9082         * @return {@link #content} (Contract legal text in human renderable form.)
9083         */
9084        public Attachment getContentAttachment() throws FHIRException { 
9085          if (this.content == null)
9086            this.content = new Attachment();
9087          if (!(this.content instanceof Attachment))
9088            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
9089          return (Attachment) this.content;
9090        }
9091
9092        public boolean hasContentAttachment() { 
9093          return this != null && this.content instanceof Attachment;
9094        }
9095
9096        /**
9097         * @return {@link #content} (Contract legal text in human renderable form.)
9098         */
9099        public Reference getContentReference() throws FHIRException { 
9100          if (this.content == null)
9101            this.content = new Reference();
9102          if (!(this.content instanceof Reference))
9103            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered");
9104          return (Reference) this.content;
9105        }
9106
9107        public boolean hasContentReference() { 
9108          return this != null && this.content instanceof Reference;
9109        }
9110
9111        public boolean hasContent() { 
9112          return this.content != null && !this.content.isEmpty();
9113        }
9114
9115        /**
9116         * @param value {@link #content} (Contract legal text in human renderable form.)
9117         */
9118        public LegalLanguageComponent setContent(Type value) { 
9119          if (value != null && !(value instanceof Attachment || value instanceof Reference))
9120            throw new Error("Not the right type for Contract.legal.content[x]: "+value.fhirType());
9121          this.content = value;
9122          return this;
9123        }
9124
9125        protected void listChildren(List<Property> children) {
9126          super.listChildren(children);
9127          children.add(new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content));
9128        }
9129
9130        @Override
9131        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
9132          switch (_hash) {
9133          case 264548711: /*content[x]*/  return new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content);
9134          case 951530617: /*content*/  return new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content);
9135          case -702028164: /*contentAttachment*/  return new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content);
9136          case 1193747154: /*contentReference*/  return new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content);
9137          default: return super.getNamedProperty(_hash, _name, _checkValid);
9138          }
9139
9140        }
9141
9142      @Override
9143      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
9144        switch (hash) {
9145        case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type
9146        default: return super.getProperty(hash, name, checkValid);
9147        }
9148
9149      }
9150
9151      @Override
9152      public Base setProperty(int hash, String name, Base value) throws FHIRException {
9153        switch (hash) {
9154        case 951530617: // content
9155          this.content = castToType(value); // Type
9156          return value;
9157        default: return super.setProperty(hash, name, value);
9158        }
9159
9160      }
9161
9162      @Override
9163      public Base setProperty(String name, Base value) throws FHIRException {
9164        if (name.equals("content[x]")) {
9165          this.content = castToType(value); // Type
9166        } else
9167          return super.setProperty(name, value);
9168        return value;
9169      }
9170
9171      @Override
9172      public Base makeProperty(int hash, String name) throws FHIRException {
9173        switch (hash) {
9174        case 264548711:  return getContent(); 
9175        case 951530617:  return getContent(); 
9176        default: return super.makeProperty(hash, name);
9177        }
9178
9179      }
9180
9181      @Override
9182      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
9183        switch (hash) {
9184        case 951530617: /*content*/ return new String[] {"Attachment", "Reference"};
9185        default: return super.getTypesForProperty(hash, name);
9186        }
9187
9188      }
9189
9190      @Override
9191      public Base addChild(String name) throws FHIRException {
9192        if (name.equals("contentAttachment")) {
9193          this.content = new Attachment();
9194          return this.content;
9195        }
9196        else if (name.equals("contentReference")) {
9197          this.content = new Reference();
9198          return this.content;
9199        }
9200        else
9201          return super.addChild(name);
9202      }
9203
9204      public LegalLanguageComponent copy() {
9205        LegalLanguageComponent dst = new LegalLanguageComponent();
9206        copyValues(dst);
9207        return dst;
9208      }
9209
9210      public void copyValues(LegalLanguageComponent dst) {
9211        super.copyValues(dst);
9212        dst.content = content == null ? null : content.copy();
9213      }
9214
9215      @Override
9216      public boolean equalsDeep(Base other_) {
9217        if (!super.equalsDeep(other_))
9218          return false;
9219        if (!(other_ instanceof LegalLanguageComponent))
9220          return false;
9221        LegalLanguageComponent o = (LegalLanguageComponent) other_;
9222        return compareDeep(content, o.content, true);
9223      }
9224
9225      @Override
9226      public boolean equalsShallow(Base other_) {
9227        if (!super.equalsShallow(other_))
9228          return false;
9229        if (!(other_ instanceof LegalLanguageComponent))
9230          return false;
9231        LegalLanguageComponent o = (LegalLanguageComponent) other_;
9232        return true;
9233      }
9234
9235      public boolean isEmpty() {
9236        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(content);
9237      }
9238
9239  public String fhirType() {
9240    return "Contract.legal";
9241
9242  }
9243
9244  }
9245
9246    @Block()
9247    public static class ComputableLanguageComponent extends BackboneElement implements IBaseBackboneElement {
9248        /**
9249         * Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).
9250         */
9251        @Child(name = "content", type = {Attachment.class, DocumentReference.class}, order=1, min=1, max=1, modifier=false, summary=false)
9252        @Description(shortDefinition="Computable Contract Rules", formalDefinition="Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal)." )
9253        protected Type content;
9254
9255        private static final long serialVersionUID = -1763459053L;
9256
9257    /**
9258     * Constructor
9259     */
9260      public ComputableLanguageComponent() {
9261        super();
9262      }
9263
9264    /**
9265     * Constructor
9266     */
9267      public ComputableLanguageComponent(Type content) {
9268        super();
9269        this.content = content;
9270      }
9271
9272        /**
9273         * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).)
9274         */
9275        public Type getContent() { 
9276          return this.content;
9277        }
9278
9279        /**
9280         * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).)
9281         */
9282        public Attachment getContentAttachment() throws FHIRException { 
9283          if (this.content == null)
9284            this.content = new Attachment();
9285          if (!(this.content instanceof Attachment))
9286            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
9287          return (Attachment) this.content;
9288        }
9289
9290        public boolean hasContentAttachment() { 
9291          return this != null && this.content instanceof Attachment;
9292        }
9293
9294        /**
9295         * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).)
9296         */
9297        public Reference getContentReference() throws FHIRException { 
9298          if (this.content == null)
9299            this.content = new Reference();
9300          if (!(this.content instanceof Reference))
9301            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered");
9302          return (Reference) this.content;
9303        }
9304
9305        public boolean hasContentReference() { 
9306          return this != null && this.content instanceof Reference;
9307        }
9308
9309        public boolean hasContent() { 
9310          return this.content != null && !this.content.isEmpty();
9311        }
9312
9313        /**
9314         * @param value {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).)
9315         */
9316        public ComputableLanguageComponent setContent(Type value) { 
9317          if (value != null && !(value instanceof Attachment || value instanceof Reference))
9318            throw new Error("Not the right type for Contract.rule.content[x]: "+value.fhirType());
9319          this.content = value;
9320          return this;
9321        }
9322
9323        protected void listChildren(List<Property> children) {
9324          super.listChildren(children);
9325          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));
9326        }
9327
9328        @Override
9329        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
9330          switch (_hash) {
9331          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);
9332          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);
9333          case -702028164: /*contentAttachment*/  return new Property("content[x]", "Attachment|Reference(DocumentReference)", "Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).", 0, 1, content);
9334          case 1193747154: /*contentReference*/  return new Property("content[x]", "Attachment|Reference(DocumentReference)", "Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).", 0, 1, content);
9335          default: return super.getNamedProperty(_hash, _name, _checkValid);
9336          }
9337
9338        }
9339
9340      @Override
9341      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
9342        switch (hash) {
9343        case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type
9344        default: return super.getProperty(hash, name, checkValid);
9345        }
9346
9347      }
9348
9349      @Override
9350      public Base setProperty(int hash, String name, Base value) throws FHIRException {
9351        switch (hash) {
9352        case 951530617: // content
9353          this.content = castToType(value); // Type
9354          return value;
9355        default: return super.setProperty(hash, name, value);
9356        }
9357
9358      }
9359
9360      @Override
9361      public Base setProperty(String name, Base value) throws FHIRException {
9362        if (name.equals("content[x]")) {
9363          this.content = castToType(value); // Type
9364        } else
9365          return super.setProperty(name, value);
9366        return value;
9367      }
9368
9369      @Override
9370      public Base makeProperty(int hash, String name) throws FHIRException {
9371        switch (hash) {
9372        case 264548711:  return getContent(); 
9373        case 951530617:  return getContent(); 
9374        default: return super.makeProperty(hash, name);
9375        }
9376
9377      }
9378
9379      @Override
9380      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
9381        switch (hash) {
9382        case 951530617: /*content*/ return new String[] {"Attachment", "Reference"};
9383        default: return super.getTypesForProperty(hash, name);
9384        }
9385
9386      }
9387
9388      @Override
9389      public Base addChild(String name) throws FHIRException {
9390        if (name.equals("contentAttachment")) {
9391          this.content = new Attachment();
9392          return this.content;
9393        }
9394        else if (name.equals("contentReference")) {
9395          this.content = new Reference();
9396          return this.content;
9397        }
9398        else
9399          return super.addChild(name);
9400      }
9401
9402      public ComputableLanguageComponent copy() {
9403        ComputableLanguageComponent dst = new ComputableLanguageComponent();
9404        copyValues(dst);
9405        return dst;
9406      }
9407
9408      public void copyValues(ComputableLanguageComponent dst) {
9409        super.copyValues(dst);
9410        dst.content = content == null ? null : content.copy();
9411      }
9412
9413      @Override
9414      public boolean equalsDeep(Base other_) {
9415        if (!super.equalsDeep(other_))
9416          return false;
9417        if (!(other_ instanceof ComputableLanguageComponent))
9418          return false;
9419        ComputableLanguageComponent o = (ComputableLanguageComponent) other_;
9420        return compareDeep(content, o.content, true);
9421      }
9422
9423      @Override
9424      public boolean equalsShallow(Base other_) {
9425        if (!super.equalsShallow(other_))
9426          return false;
9427        if (!(other_ instanceof ComputableLanguageComponent))
9428          return false;
9429        ComputableLanguageComponent o = (ComputableLanguageComponent) other_;
9430        return true;
9431      }
9432
9433      public boolean isEmpty() {
9434        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(content);
9435      }
9436
9437  public String fhirType() {
9438    return "Contract.rule";
9439
9440  }
9441
9442  }
9443
9444    /**
9445     * Unique identifier for this Contract or a derivative that references a Source Contract.
9446     */
9447    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9448    @Description(shortDefinition="Contract number", formalDefinition="Unique identifier for this Contract or a derivative that references a Source Contract." )
9449    protected List<Identifier> identifier;
9450
9451    /**
9452     * Canonical identifier for this contract, represented as a URI (globally unique).
9453     */
9454    @Child(name = "url", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=false)
9455    @Description(shortDefinition="Basal definition", formalDefinition="Canonical identifier for this contract, represented as a URI (globally unique)." )
9456    protected UriType url;
9457
9458    /**
9459     * An edition identifier used for business purposes to label business significant variants.
9460     */
9461    @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
9462    @Description(shortDefinition="Business edition", formalDefinition="An edition identifier used for business purposes to label business significant variants." )
9463    protected StringType version;
9464
9465    /**
9466     * The status of the resource instance.
9467     */
9468    @Child(name = "status", type = {CodeType.class}, order=3, min=0, max=1, modifier=true, summary=true)
9469    @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." )
9470    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-status")
9471    protected Enumeration<ContractStatus> status;
9472
9473    /**
9474     * 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.
9475     */
9476    @Child(name = "legalState", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
9477    @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." )
9478    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-legalstate")
9479    protected CodeableConcept legalState;
9480
9481    /**
9482     * The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract.
9483     */
9484    @Child(name = "instantiatesCanonical", type = {Contract.class}, order=5, min=0, max=1, modifier=false, summary=false)
9485    @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." )
9486    protected Reference instantiatesCanonical;
9487
9488    /**
9489     * The actual object that is the target of the reference (The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract.)
9490     */
9491    protected Contract instantiatesCanonicalTarget;
9492
9493    /**
9494     * The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract.
9495     */
9496    @Child(name = "instantiatesUri", type = {UriType.class}, order=6, min=0, max=1, modifier=false, summary=false)
9497    @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." )
9498    protected UriType instantiatesUri;
9499
9500    /**
9501     * The minimal content derived from the basal information source at a specific stage in its lifecycle.
9502     */
9503    @Child(name = "contentDerivative", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false)
9504    @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." )
9505    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-content-derivative")
9506    protected CodeableConcept contentDerivative;
9507
9508    /**
9509     * When this  Contract was issued.
9510     */
9511    @Child(name = "issued", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true)
9512    @Description(shortDefinition="When this Contract was issued", formalDefinition="When this  Contract was issued." )
9513    protected DateTimeType issued;
9514
9515    /**
9516     * Relevant time or time-period when this Contract is applicable.
9517     */
9518    @Child(name = "applies", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=true)
9519    @Description(shortDefinition="Effective time", formalDefinition="Relevant time or time-period when this Contract is applicable." )
9520    protected Period applies;
9521
9522    /**
9523     * Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract.
9524     */
9525    @Child(name = "expirationType", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=false)
9526    @Description(shortDefinition="Contract cessation cause", formalDefinition="Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract." )
9527    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-expiration-type")
9528    protected CodeableConcept expirationType;
9529
9530    /**
9531     * The target entity impacted by or of interest to parties to the agreement.
9532     */
9533    @Child(name = "subject", type = {Reference.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9534    @Description(shortDefinition="Contract Target Entity", formalDefinition="The target entity impacted by or of interest to parties to the agreement." )
9535    protected List<Reference> subject;
9536    /**
9537     * The actual objects that are the target of the reference (The target entity impacted by or of interest to parties to the agreement.)
9538     */
9539    protected List<Resource> subjectTarget;
9540
9541
9542    /**
9543     * 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.
9544     */
9545    @Child(name = "authority", type = {Organization.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9546    @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." )
9547    protected List<Reference> authority;
9548    /**
9549     * The actual objects that are the target of the reference (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.)
9550     */
9551    protected List<Organization> authorityTarget;
9552
9553
9554    /**
9555     * 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.
9556     */
9557    @Child(name = "domain", type = {Location.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9558    @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." )
9559    protected List<Reference> domain;
9560    /**
9561     * The actual objects that are the target of the reference (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.)
9562     */
9563    protected List<Location> domainTarget;
9564
9565
9566    /**
9567     * Sites in which the contract is complied with,  exercised, or in force.
9568     */
9569    @Child(name = "site", type = {Location.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9570    @Description(shortDefinition="Specific Location", formalDefinition="Sites in which the contract is complied with,  exercised, or in force." )
9571    protected List<Reference> site;
9572    /**
9573     * The actual objects that are the target of the reference (Sites in which the contract is complied with,  exercised, or in force.)
9574     */
9575    protected List<Location> siteTarget;
9576
9577
9578    /**
9579     * 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.
9580     */
9581    @Child(name = "name", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=true)
9582    @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." )
9583    protected StringType name;
9584
9585    /**
9586     * A short, descriptive, user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.
9587     */
9588    @Child(name = "title", type = {StringType.class}, order=16, min=0, max=1, modifier=false, summary=true)
9589    @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." )
9590    protected StringType title;
9591
9592    /**
9593     * 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.
9594     */
9595    @Child(name = "subtitle", type = {StringType.class}, order=17, min=0, max=1, modifier=false, summary=false)
9596    @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." )
9597    protected StringType subtitle;
9598
9599    /**
9600     * 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.
9601     */
9602    @Child(name = "alias", type = {StringType.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9603    @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." )
9604    protected List<StringType> alias;
9605
9606    /**
9607     * The individual or organization that authored the Contract definition, derivative, or instance in any legal state.
9608     */
9609    @Child(name = "author", type = {Patient.class, Practitioner.class, PractitionerRole.class, Organization.class}, order=19, min=0, max=1, modifier=false, summary=false)
9610    @Description(shortDefinition="Source of Contract", formalDefinition="The individual or organization that authored the Contract definition, derivative, or instance in any legal state." )
9611    protected Reference author;
9612
9613    /**
9614     * The actual object that is the target of the reference (The individual or organization that authored the Contract definition, derivative, or instance in any legal state.)
9615     */
9616    protected Resource authorTarget;
9617
9618    /**
9619     * A selector of legal concerns for this Contract definition, derivative, or instance in any legal state.
9620     */
9621    @Child(name = "scope", type = {CodeableConcept.class}, order=20, min=0, max=1, modifier=false, summary=false)
9622    @Description(shortDefinition="Range of Legal Concerns", formalDefinition="A selector of legal concerns for this Contract definition, derivative, or instance in any legal state." )
9623    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-scope")
9624    protected CodeableConcept scope;
9625
9626    /**
9627     * Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.
9628     */
9629    @Child(name = "topic", type = {CodeableConcept.class, Reference.class}, order=21, min=0, max=1, modifier=false, summary=false)
9630    @Description(shortDefinition="Focus of contract interest", formalDefinition="Narrows the range of legal concerns to focus on the achievement of specific contractual objectives." )
9631    protected Type topic;
9632
9633    /**
9634     * 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.
9635     */
9636    @Child(name = "type", type = {CodeableConcept.class}, order=22, min=0, max=1, modifier=false, summary=true)
9637    @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." )
9638    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-type")
9639    protected CodeableConcept type;
9640
9641    /**
9642     * 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.
9643     */
9644    @Child(name = "subType", type = {CodeableConcept.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9645    @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." )
9646    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-subtype")
9647    protected List<CodeableConcept> subType;
9648
9649    /**
9650     * 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.
9651     */
9652    @Child(name = "contentDefinition", type = {}, order=24, min=0, max=1, modifier=false, summary=false)
9653    @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." )
9654    protected ContentDefinitionComponent contentDefinition;
9655
9656    /**
9657     * One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.
9658     */
9659    @Child(name = "term", type = {}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9660    @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." )
9661    protected List<TermComponent> term;
9662
9663    /**
9664     * Information that may be needed by/relevant to the performer in their execution of this term action.
9665     */
9666    @Child(name = "supportingInfo", type = {Reference.class}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9667    @Description(shortDefinition="Extra Information", formalDefinition="Information that may be needed by/relevant to the performer in their execution of this term action." )
9668    protected List<Reference> supportingInfo;
9669    /**
9670     * The actual objects that are the target of the reference (Information that may be needed by/relevant to the performer in their execution of this term action.)
9671     */
9672    protected List<Resource> supportingInfoTarget;
9673
9674
9675    /**
9676     * 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.
9677     */
9678    @Child(name = "relevantHistory", type = {Provenance.class}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9679    @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." )
9680    protected List<Reference> relevantHistory;
9681    /**
9682     * The actual objects that are the target of the reference (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.)
9683     */
9684    protected List<Provenance> relevantHistoryTarget;
9685
9686
9687    /**
9688     * 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.
9689     */
9690    @Child(name = "signer", type = {}, order=28, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9691    @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." )
9692    protected List<SignatoryComponent> signer;
9693
9694    /**
9695     * 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.
9696     */
9697    @Child(name = "friendly", type = {}, order=29, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9698    @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." )
9699    protected List<FriendlyLanguageComponent> friendly;
9700
9701    /**
9702     * List of Legal expressions or representations of this Contract.
9703     */
9704    @Child(name = "legal", type = {}, order=30, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9705    @Description(shortDefinition="Contract Legal Language", formalDefinition="List of Legal expressions or representations of this Contract." )
9706    protected List<LegalLanguageComponent> legal;
9707
9708    /**
9709     * List of Computable Policy Rule Language Representations of this Contract.
9710     */
9711    @Child(name = "rule", type = {}, order=31, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9712    @Description(shortDefinition="Computable Contract Language", formalDefinition="List of Computable Policy Rule Language Representations of this Contract." )
9713    protected List<ComputableLanguageComponent> rule;
9714
9715    /**
9716     * 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.
9717     */
9718    @Child(name = "legallyBinding", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class, Contract.class}, order=32, min=0, max=1, modifier=false, summary=false)
9719    @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." )
9720    protected Type legallyBinding;
9721
9722    private static final long serialVersionUID = -1388892487L;
9723
9724  /**
9725   * Constructor
9726   */
9727    public Contract() {
9728      super();
9729    }
9730
9731    /**
9732     * @return {@link #identifier} (Unique identifier for this Contract or a derivative that references a Source Contract.)
9733     */
9734    public List<Identifier> getIdentifier() { 
9735      if (this.identifier == null)
9736        this.identifier = new ArrayList<Identifier>();
9737      return this.identifier;
9738    }
9739
9740    /**
9741     * @return Returns a reference to <code>this</code> for easy method chaining
9742     */
9743    public Contract setIdentifier(List<Identifier> theIdentifier) { 
9744      this.identifier = theIdentifier;
9745      return this;
9746    }
9747
9748    public boolean hasIdentifier() { 
9749      if (this.identifier == null)
9750        return false;
9751      for (Identifier item : this.identifier)
9752        if (!item.isEmpty())
9753          return true;
9754      return false;
9755    }
9756
9757    public Identifier addIdentifier() { //3
9758      Identifier t = new Identifier();
9759      if (this.identifier == null)
9760        this.identifier = new ArrayList<Identifier>();
9761      this.identifier.add(t);
9762      return t;
9763    }
9764
9765    public Contract addIdentifier(Identifier t) { //3
9766      if (t == null)
9767        return this;
9768      if (this.identifier == null)
9769        this.identifier = new ArrayList<Identifier>();
9770      this.identifier.add(t);
9771      return this;
9772    }
9773
9774    /**
9775     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
9776     */
9777    public Identifier getIdentifierFirstRep() { 
9778      if (getIdentifier().isEmpty()) {
9779        addIdentifier();
9780      }
9781      return getIdentifier().get(0);
9782    }
9783
9784    /**
9785     * @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
9786     */
9787    public UriType getUrlElement() { 
9788      if (this.url == null)
9789        if (Configuration.errorOnAutoCreate())
9790          throw new Error("Attempt to auto-create Contract.url");
9791        else if (Configuration.doAutoCreate())
9792          this.url = new UriType(); // bb
9793      return this.url;
9794    }
9795
9796    public boolean hasUrlElement() { 
9797      return this.url != null && !this.url.isEmpty();
9798    }
9799
9800    public boolean hasUrl() { 
9801      return this.url != null && !this.url.isEmpty();
9802    }
9803
9804    /**
9805     * @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
9806     */
9807    public Contract setUrlElement(UriType value) { 
9808      this.url = value;
9809      return this;
9810    }
9811
9812    /**
9813     * @return Canonical identifier for this contract, represented as a URI (globally unique).
9814     */
9815    public String getUrl() { 
9816      return this.url == null ? null : this.url.getValue();
9817    }
9818
9819    /**
9820     * @param value Canonical identifier for this contract, represented as a URI (globally unique).
9821     */
9822    public Contract setUrl(String value) { 
9823      if (Utilities.noString(value))
9824        this.url = null;
9825      else {
9826        if (this.url == null)
9827          this.url = new UriType();
9828        this.url.setValue(value);
9829      }
9830      return this;
9831    }
9832
9833    /**
9834     * @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
9835     */
9836    public StringType getVersionElement() { 
9837      if (this.version == null)
9838        if (Configuration.errorOnAutoCreate())
9839          throw new Error("Attempt to auto-create Contract.version");
9840        else if (Configuration.doAutoCreate())
9841          this.version = new StringType(); // bb
9842      return this.version;
9843    }
9844
9845    public boolean hasVersionElement() { 
9846      return this.version != null && !this.version.isEmpty();
9847    }
9848
9849    public boolean hasVersion() { 
9850      return this.version != null && !this.version.isEmpty();
9851    }
9852
9853    /**
9854     * @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
9855     */
9856    public Contract setVersionElement(StringType value) { 
9857      this.version = value;
9858      return this;
9859    }
9860
9861    /**
9862     * @return An edition identifier used for business purposes to label business significant variants.
9863     */
9864    public String getVersion() { 
9865      return this.version == null ? null : this.version.getValue();
9866    }
9867
9868    /**
9869     * @param value An edition identifier used for business purposes to label business significant variants.
9870     */
9871    public Contract setVersion(String value) { 
9872      if (Utilities.noString(value))
9873        this.version = null;
9874      else {
9875        if (this.version == null)
9876          this.version = new StringType();
9877        this.version.setValue(value);
9878      }
9879      return this;
9880    }
9881
9882    /**
9883     * @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
9884     */
9885    public Enumeration<ContractStatus> getStatusElement() { 
9886      if (this.status == null)
9887        if (Configuration.errorOnAutoCreate())
9888          throw new Error("Attempt to auto-create Contract.status");
9889        else if (Configuration.doAutoCreate())
9890          this.status = new Enumeration<ContractStatus>(new ContractStatusEnumFactory()); // bb
9891      return this.status;
9892    }
9893
9894    public boolean hasStatusElement() { 
9895      return this.status != null && !this.status.isEmpty();
9896    }
9897
9898    public boolean hasStatus() { 
9899      return this.status != null && !this.status.isEmpty();
9900    }
9901
9902    /**
9903     * @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
9904     */
9905    public Contract setStatusElement(Enumeration<ContractStatus> value) { 
9906      this.status = value;
9907      return this;
9908    }
9909
9910    /**
9911     * @return The status of the resource instance.
9912     */
9913    public ContractStatus getStatus() { 
9914      return this.status == null ? null : this.status.getValue();
9915    }
9916
9917    /**
9918     * @param value The status of the resource instance.
9919     */
9920    public Contract setStatus(ContractStatus value) { 
9921      if (value == null)
9922        this.status = null;
9923      else {
9924        if (this.status == null)
9925          this.status = new Enumeration<ContractStatus>(new ContractStatusEnumFactory());
9926        this.status.setValue(value);
9927      }
9928      return this;
9929    }
9930
9931    /**
9932     * @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.)
9933     */
9934    public CodeableConcept getLegalState() { 
9935      if (this.legalState == null)
9936        if (Configuration.errorOnAutoCreate())
9937          throw new Error("Attempt to auto-create Contract.legalState");
9938        else if (Configuration.doAutoCreate())
9939          this.legalState = new CodeableConcept(); // cc
9940      return this.legalState;
9941    }
9942
9943    public boolean hasLegalState() { 
9944      return this.legalState != null && !this.legalState.isEmpty();
9945    }
9946
9947    /**
9948     * @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.)
9949     */
9950    public Contract setLegalState(CodeableConcept value) { 
9951      this.legalState = value;
9952      return this;
9953    }
9954
9955    /**
9956     * @return {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract.)
9957     */
9958    public Reference getInstantiatesCanonical() { 
9959      if (this.instantiatesCanonical == null)
9960        if (Configuration.errorOnAutoCreate())
9961          throw new Error("Attempt to auto-create Contract.instantiatesCanonical");
9962        else if (Configuration.doAutoCreate())
9963          this.instantiatesCanonical = new Reference(); // cc
9964      return this.instantiatesCanonical;
9965    }
9966
9967    public boolean hasInstantiatesCanonical() { 
9968      return this.instantiatesCanonical != null && !this.instantiatesCanonical.isEmpty();
9969    }
9970
9971    /**
9972     * @param value {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract.)
9973     */
9974    public Contract setInstantiatesCanonical(Reference value) { 
9975      this.instantiatesCanonical = value;
9976      return this;
9977    }
9978
9979    /**
9980     * @return {@link #instantiatesCanonical} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract.)
9981     */
9982    public Contract getInstantiatesCanonicalTarget() { 
9983      if (this.instantiatesCanonicalTarget == null)
9984        if (Configuration.errorOnAutoCreate())
9985          throw new Error("Attempt to auto-create Contract.instantiatesCanonical");
9986        else if (Configuration.doAutoCreate())
9987          this.instantiatesCanonicalTarget = new Contract(); // aa
9988      return this.instantiatesCanonicalTarget;
9989    }
9990
9991    /**
9992     * @param value {@link #instantiatesCanonical} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract.)
9993     */
9994    public Contract setInstantiatesCanonicalTarget(Contract value) { 
9995      this.instantiatesCanonicalTarget = value;
9996      return this;
9997    }
9998
9999    /**
10000     * @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
10001     */
10002    public UriType getInstantiatesUriElement() { 
10003      if (this.instantiatesUri == null)
10004        if (Configuration.errorOnAutoCreate())
10005          throw new Error("Attempt to auto-create Contract.instantiatesUri");
10006        else if (Configuration.doAutoCreate())
10007          this.instantiatesUri = new UriType(); // bb
10008      return this.instantiatesUri;
10009    }
10010
10011    public boolean hasInstantiatesUriElement() { 
10012      return this.instantiatesUri != null && !this.instantiatesUri.isEmpty();
10013    }
10014
10015    public boolean hasInstantiatesUri() { 
10016      return this.instantiatesUri != null && !this.instantiatesUri.isEmpty();
10017    }
10018
10019    /**
10020     * @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
10021     */
10022    public Contract setInstantiatesUriElement(UriType value) { 
10023      this.instantiatesUri = value;
10024      return this;
10025    }
10026
10027    /**
10028     * @return The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract.
10029     */
10030    public String getInstantiatesUri() { 
10031      return this.instantiatesUri == null ? null : this.instantiatesUri.getValue();
10032    }
10033
10034    /**
10035     * @param value The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract.
10036     */
10037    public Contract setInstantiatesUri(String value) { 
10038      if (Utilities.noString(value))
10039        this.instantiatesUri = null;
10040      else {
10041        if (this.instantiatesUri == null)
10042          this.instantiatesUri = new UriType();
10043        this.instantiatesUri.setValue(value);
10044      }
10045      return this;
10046    }
10047
10048    /**
10049     * @return {@link #contentDerivative} (The minimal content derived from the basal information source at a specific stage in its lifecycle.)
10050     */
10051    public CodeableConcept getContentDerivative() { 
10052      if (this.contentDerivative == null)
10053        if (Configuration.errorOnAutoCreate())
10054          throw new Error("Attempt to auto-create Contract.contentDerivative");
10055        else if (Configuration.doAutoCreate())
10056          this.contentDerivative = new CodeableConcept(); // cc
10057      return this.contentDerivative;
10058    }
10059
10060    public boolean hasContentDerivative() { 
10061      return this.contentDerivative != null && !this.contentDerivative.isEmpty();
10062    }
10063
10064    /**
10065     * @param value {@link #contentDerivative} (The minimal content derived from the basal information source at a specific stage in its lifecycle.)
10066     */
10067    public Contract setContentDerivative(CodeableConcept value) { 
10068      this.contentDerivative = value;
10069      return this;
10070    }
10071
10072    /**
10073     * @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
10074     */
10075    public DateTimeType getIssuedElement() { 
10076      if (this.issued == null)
10077        if (Configuration.errorOnAutoCreate())
10078          throw new Error("Attempt to auto-create Contract.issued");
10079        else if (Configuration.doAutoCreate())
10080          this.issued = new DateTimeType(); // bb
10081      return this.issued;
10082    }
10083
10084    public boolean hasIssuedElement() { 
10085      return this.issued != null && !this.issued.isEmpty();
10086    }
10087
10088    public boolean hasIssued() { 
10089      return this.issued != null && !this.issued.isEmpty();
10090    }
10091
10092    /**
10093     * @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
10094     */
10095    public Contract setIssuedElement(DateTimeType value) { 
10096      this.issued = value;
10097      return this;
10098    }
10099
10100    /**
10101     * @return When this  Contract was issued.
10102     */
10103    public Date getIssued() { 
10104      return this.issued == null ? null : this.issued.getValue();
10105    }
10106
10107    /**
10108     * @param value When this  Contract was issued.
10109     */
10110    public Contract setIssued(Date value) { 
10111      if (value == null)
10112        this.issued = null;
10113      else {
10114        if (this.issued == null)
10115          this.issued = new DateTimeType();
10116        this.issued.setValue(value);
10117      }
10118      return this;
10119    }
10120
10121    /**
10122     * @return {@link #applies} (Relevant time or time-period when this Contract is applicable.)
10123     */
10124    public Period getApplies() { 
10125      if (this.applies == null)
10126        if (Configuration.errorOnAutoCreate())
10127          throw new Error("Attempt to auto-create Contract.applies");
10128        else if (Configuration.doAutoCreate())
10129          this.applies = new Period(); // cc
10130      return this.applies;
10131    }
10132
10133    public boolean hasApplies() { 
10134      return this.applies != null && !this.applies.isEmpty();
10135    }
10136
10137    /**
10138     * @param value {@link #applies} (Relevant time or time-period when this Contract is applicable.)
10139     */
10140    public Contract setApplies(Period value) { 
10141      this.applies = value;
10142      return this;
10143    }
10144
10145    /**
10146     * @return {@link #expirationType} (Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract.)
10147     */
10148    public CodeableConcept getExpirationType() { 
10149      if (this.expirationType == null)
10150        if (Configuration.errorOnAutoCreate())
10151          throw new Error("Attempt to auto-create Contract.expirationType");
10152        else if (Configuration.doAutoCreate())
10153          this.expirationType = new CodeableConcept(); // cc
10154      return this.expirationType;
10155    }
10156
10157    public boolean hasExpirationType() { 
10158      return this.expirationType != null && !this.expirationType.isEmpty();
10159    }
10160
10161    /**
10162     * @param value {@link #expirationType} (Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract.)
10163     */
10164    public Contract setExpirationType(CodeableConcept value) { 
10165      this.expirationType = value;
10166      return this;
10167    }
10168
10169    /**
10170     * @return {@link #subject} (The target entity impacted by or of interest to parties to the agreement.)
10171     */
10172    public List<Reference> getSubject() { 
10173      if (this.subject == null)
10174        this.subject = new ArrayList<Reference>();
10175      return this.subject;
10176    }
10177
10178    /**
10179     * @return Returns a reference to <code>this</code> for easy method chaining
10180     */
10181    public Contract setSubject(List<Reference> theSubject) { 
10182      this.subject = theSubject;
10183      return this;
10184    }
10185
10186    public boolean hasSubject() { 
10187      if (this.subject == null)
10188        return false;
10189      for (Reference item : this.subject)
10190        if (!item.isEmpty())
10191          return true;
10192      return false;
10193    }
10194
10195    public Reference addSubject() { //3
10196      Reference t = new Reference();
10197      if (this.subject == null)
10198        this.subject = new ArrayList<Reference>();
10199      this.subject.add(t);
10200      return t;
10201    }
10202
10203    public Contract addSubject(Reference t) { //3
10204      if (t == null)
10205        return this;
10206      if (this.subject == null)
10207        this.subject = new ArrayList<Reference>();
10208      this.subject.add(t);
10209      return this;
10210    }
10211
10212    /**
10213     * @return The first repetition of repeating field {@link #subject}, creating it if it does not already exist
10214     */
10215    public Reference getSubjectFirstRep() { 
10216      if (getSubject().isEmpty()) {
10217        addSubject();
10218      }
10219      return getSubject().get(0);
10220    }
10221
10222    /**
10223     * @deprecated Use Reference#setResource(IBaseResource) instead
10224     */
10225    @Deprecated
10226    public List<Resource> getSubjectTarget() { 
10227      if (this.subjectTarget == null)
10228        this.subjectTarget = new ArrayList<Resource>();
10229      return this.subjectTarget;
10230    }
10231
10232    /**
10233     * @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.)
10234     */
10235    public List<Reference> getAuthority() { 
10236      if (this.authority == null)
10237        this.authority = new ArrayList<Reference>();
10238      return this.authority;
10239    }
10240
10241    /**
10242     * @return Returns a reference to <code>this</code> for easy method chaining
10243     */
10244    public Contract setAuthority(List<Reference> theAuthority) { 
10245      this.authority = theAuthority;
10246      return this;
10247    }
10248
10249    public boolean hasAuthority() { 
10250      if (this.authority == null)
10251        return false;
10252      for (Reference item : this.authority)
10253        if (!item.isEmpty())
10254          return true;
10255      return false;
10256    }
10257
10258    public Reference addAuthority() { //3
10259      Reference t = new Reference();
10260      if (this.authority == null)
10261        this.authority = new ArrayList<Reference>();
10262      this.authority.add(t);
10263      return t;
10264    }
10265
10266    public Contract addAuthority(Reference t) { //3
10267      if (t == null)
10268        return this;
10269      if (this.authority == null)
10270        this.authority = new ArrayList<Reference>();
10271      this.authority.add(t);
10272      return this;
10273    }
10274
10275    /**
10276     * @return The first repetition of repeating field {@link #authority}, creating it if it does not already exist
10277     */
10278    public Reference getAuthorityFirstRep() { 
10279      if (getAuthority().isEmpty()) {
10280        addAuthority();
10281      }
10282      return getAuthority().get(0);
10283    }
10284
10285    /**
10286     * @deprecated Use Reference#setResource(IBaseResource) instead
10287     */
10288    @Deprecated
10289    public List<Organization> getAuthorityTarget() { 
10290      if (this.authorityTarget == null)
10291        this.authorityTarget = new ArrayList<Organization>();
10292      return this.authorityTarget;
10293    }
10294
10295    /**
10296     * @deprecated Use Reference#setResource(IBaseResource) instead
10297     */
10298    @Deprecated
10299    public Organization addAuthorityTarget() { 
10300      Organization r = new Organization();
10301      if (this.authorityTarget == null)
10302        this.authorityTarget = new ArrayList<Organization>();
10303      this.authorityTarget.add(r);
10304      return r;
10305    }
10306
10307    /**
10308     * @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.)
10309     */
10310    public List<Reference> getDomain() { 
10311      if (this.domain == null)
10312        this.domain = new ArrayList<Reference>();
10313      return this.domain;
10314    }
10315
10316    /**
10317     * @return Returns a reference to <code>this</code> for easy method chaining
10318     */
10319    public Contract setDomain(List<Reference> theDomain) { 
10320      this.domain = theDomain;
10321      return this;
10322    }
10323
10324    public boolean hasDomain() { 
10325      if (this.domain == null)
10326        return false;
10327      for (Reference item : this.domain)
10328        if (!item.isEmpty())
10329          return true;
10330      return false;
10331    }
10332
10333    public Reference addDomain() { //3
10334      Reference t = new Reference();
10335      if (this.domain == null)
10336        this.domain = new ArrayList<Reference>();
10337      this.domain.add(t);
10338      return t;
10339    }
10340
10341    public Contract addDomain(Reference t) { //3
10342      if (t == null)
10343        return this;
10344      if (this.domain == null)
10345        this.domain = new ArrayList<Reference>();
10346      this.domain.add(t);
10347      return this;
10348    }
10349
10350    /**
10351     * @return The first repetition of repeating field {@link #domain}, creating it if it does not already exist
10352     */
10353    public Reference getDomainFirstRep() { 
10354      if (getDomain().isEmpty()) {
10355        addDomain();
10356      }
10357      return getDomain().get(0);
10358    }
10359
10360    /**
10361     * @deprecated Use Reference#setResource(IBaseResource) instead
10362     */
10363    @Deprecated
10364    public List<Location> getDomainTarget() { 
10365      if (this.domainTarget == null)
10366        this.domainTarget = new ArrayList<Location>();
10367      return this.domainTarget;
10368    }
10369
10370    /**
10371     * @deprecated Use Reference#setResource(IBaseResource) instead
10372     */
10373    @Deprecated
10374    public Location addDomainTarget() { 
10375      Location r = new Location();
10376      if (this.domainTarget == null)
10377        this.domainTarget = new ArrayList<Location>();
10378      this.domainTarget.add(r);
10379      return r;
10380    }
10381
10382    /**
10383     * @return {@link #site} (Sites in which the contract is complied with,  exercised, or in force.)
10384     */
10385    public List<Reference> getSite() { 
10386      if (this.site == null)
10387        this.site = new ArrayList<Reference>();
10388      return this.site;
10389    }
10390
10391    /**
10392     * @return Returns a reference to <code>this</code> for easy method chaining
10393     */
10394    public Contract setSite(List<Reference> theSite) { 
10395      this.site = theSite;
10396      return this;
10397    }
10398
10399    public boolean hasSite() { 
10400      if (this.site == null)
10401        return false;
10402      for (Reference item : this.site)
10403        if (!item.isEmpty())
10404          return true;
10405      return false;
10406    }
10407
10408    public Reference addSite() { //3
10409      Reference t = new Reference();
10410      if (this.site == null)
10411        this.site = new ArrayList<Reference>();
10412      this.site.add(t);
10413      return t;
10414    }
10415
10416    public Contract addSite(Reference t) { //3
10417      if (t == null)
10418        return this;
10419      if (this.site == null)
10420        this.site = new ArrayList<Reference>();
10421      this.site.add(t);
10422      return this;
10423    }
10424
10425    /**
10426     * @return The first repetition of repeating field {@link #site}, creating it if it does not already exist
10427     */
10428    public Reference getSiteFirstRep() { 
10429      if (getSite().isEmpty()) {
10430        addSite();
10431      }
10432      return getSite().get(0);
10433    }
10434
10435    /**
10436     * @deprecated Use Reference#setResource(IBaseResource) instead
10437     */
10438    @Deprecated
10439    public List<Location> getSiteTarget() { 
10440      if (this.siteTarget == null)
10441        this.siteTarget = new ArrayList<Location>();
10442      return this.siteTarget;
10443    }
10444
10445    /**
10446     * @deprecated Use Reference#setResource(IBaseResource) instead
10447     */
10448    @Deprecated
10449    public Location addSiteTarget() { 
10450      Location r = new Location();
10451      if (this.siteTarget == null)
10452        this.siteTarget = new ArrayList<Location>();
10453      this.siteTarget.add(r);
10454      return r;
10455    }
10456
10457    /**
10458     * @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
10459     */
10460    public StringType getNameElement() { 
10461      if (this.name == null)
10462        if (Configuration.errorOnAutoCreate())
10463          throw new Error("Attempt to auto-create Contract.name");
10464        else if (Configuration.doAutoCreate())
10465          this.name = new StringType(); // bb
10466      return this.name;
10467    }
10468
10469    public boolean hasNameElement() { 
10470      return this.name != null && !this.name.isEmpty();
10471    }
10472
10473    public boolean hasName() { 
10474      return this.name != null && !this.name.isEmpty();
10475    }
10476
10477    /**
10478     * @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
10479     */
10480    public Contract setNameElement(StringType value) { 
10481      this.name = value;
10482      return this;
10483    }
10484
10485    /**
10486     * @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.
10487     */
10488    public String getName() { 
10489      return this.name == null ? null : this.name.getValue();
10490    }
10491
10492    /**
10493     * @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.
10494     */
10495    public Contract setName(String value) { 
10496      if (Utilities.noString(value))
10497        this.name = null;
10498      else {
10499        if (this.name == null)
10500          this.name = new StringType();
10501        this.name.setValue(value);
10502      }
10503      return this;
10504    }
10505
10506    /**
10507     * @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
10508     */
10509    public StringType getTitleElement() { 
10510      if (this.title == null)
10511        if (Configuration.errorOnAutoCreate())
10512          throw new Error("Attempt to auto-create Contract.title");
10513        else if (Configuration.doAutoCreate())
10514          this.title = new StringType(); // bb
10515      return this.title;
10516    }
10517
10518    public boolean hasTitleElement() { 
10519      return this.title != null && !this.title.isEmpty();
10520    }
10521
10522    public boolean hasTitle() { 
10523      return this.title != null && !this.title.isEmpty();
10524    }
10525
10526    /**
10527     * @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
10528     */
10529    public Contract setTitleElement(StringType value) { 
10530      this.title = value;
10531      return this;
10532    }
10533
10534    /**
10535     * @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.
10536     */
10537    public String getTitle() { 
10538      return this.title == null ? null : this.title.getValue();
10539    }
10540
10541    /**
10542     * @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.
10543     */
10544    public Contract setTitle(String value) { 
10545      if (Utilities.noString(value))
10546        this.title = null;
10547      else {
10548        if (this.title == null)
10549          this.title = new StringType();
10550        this.title.setValue(value);
10551      }
10552      return this;
10553    }
10554
10555    /**
10556     * @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
10557     */
10558    public StringType getSubtitleElement() { 
10559      if (this.subtitle == null)
10560        if (Configuration.errorOnAutoCreate())
10561          throw new Error("Attempt to auto-create Contract.subtitle");
10562        else if (Configuration.doAutoCreate())
10563          this.subtitle = new StringType(); // bb
10564      return this.subtitle;
10565    }
10566
10567    public boolean hasSubtitleElement() { 
10568      return this.subtitle != null && !this.subtitle.isEmpty();
10569    }
10570
10571    public boolean hasSubtitle() { 
10572      return this.subtitle != null && !this.subtitle.isEmpty();
10573    }
10574
10575    /**
10576     * @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
10577     */
10578    public Contract setSubtitleElement(StringType value) { 
10579      this.subtitle = value;
10580      return this;
10581    }
10582
10583    /**
10584     * @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.
10585     */
10586    public String getSubtitle() { 
10587      return this.subtitle == null ? null : this.subtitle.getValue();
10588    }
10589
10590    /**
10591     * @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.
10592     */
10593    public Contract setSubtitle(String value) { 
10594      if (Utilities.noString(value))
10595        this.subtitle = null;
10596      else {
10597        if (this.subtitle == null)
10598          this.subtitle = new StringType();
10599        this.subtitle.setValue(value);
10600      }
10601      return this;
10602    }
10603
10604    /**
10605     * @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.)
10606     */
10607    public List<StringType> getAlias() { 
10608      if (this.alias == null)
10609        this.alias = new ArrayList<StringType>();
10610      return this.alias;
10611    }
10612
10613    /**
10614     * @return Returns a reference to <code>this</code> for easy method chaining
10615     */
10616    public Contract setAlias(List<StringType> theAlias) { 
10617      this.alias = theAlias;
10618      return this;
10619    }
10620
10621    public boolean hasAlias() { 
10622      if (this.alias == null)
10623        return false;
10624      for (StringType item : this.alias)
10625        if (!item.isEmpty())
10626          return true;
10627      return false;
10628    }
10629
10630    /**
10631     * @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.)
10632     */
10633    public StringType addAliasElement() {//2 
10634      StringType t = new StringType();
10635      if (this.alias == null)
10636        this.alias = new ArrayList<StringType>();
10637      this.alias.add(t);
10638      return t;
10639    }
10640
10641    /**
10642     * @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.)
10643     */
10644    public Contract addAlias(String value) { //1
10645      StringType t = new StringType();
10646      t.setValue(value);
10647      if (this.alias == null)
10648        this.alias = new ArrayList<StringType>();
10649      this.alias.add(t);
10650      return this;
10651    }
10652
10653    /**
10654     * @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.)
10655     */
10656    public boolean hasAlias(String value) { 
10657      if (this.alias == null)
10658        return false;
10659      for (StringType v : this.alias)
10660        if (v.getValue().equals(value)) // string
10661          return true;
10662      return false;
10663    }
10664
10665    /**
10666     * @return {@link #author} (The individual or organization that authored the Contract definition, derivative, or instance in any legal state.)
10667     */
10668    public Reference getAuthor() { 
10669      if (this.author == null)
10670        if (Configuration.errorOnAutoCreate())
10671          throw new Error("Attempt to auto-create Contract.author");
10672        else if (Configuration.doAutoCreate())
10673          this.author = new Reference(); // cc
10674      return this.author;
10675    }
10676
10677    public boolean hasAuthor() { 
10678      return this.author != null && !this.author.isEmpty();
10679    }
10680
10681    /**
10682     * @param value {@link #author} (The individual or organization that authored the Contract definition, derivative, or instance in any legal state.)
10683     */
10684    public Contract setAuthor(Reference value) { 
10685      this.author = value;
10686      return this;
10687    }
10688
10689    /**
10690     * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual or organization that authored the Contract definition, derivative, or instance in any legal state.)
10691     */
10692    public Resource getAuthorTarget() { 
10693      return this.authorTarget;
10694    }
10695
10696    /**
10697     * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual or organization that authored the Contract definition, derivative, or instance in any legal state.)
10698     */
10699    public Contract setAuthorTarget(Resource value) { 
10700      this.authorTarget = value;
10701      return this;
10702    }
10703
10704    /**
10705     * @return {@link #scope} (A selector of legal concerns for this Contract definition, derivative, or instance in any legal state.)
10706     */
10707    public CodeableConcept getScope() { 
10708      if (this.scope == null)
10709        if (Configuration.errorOnAutoCreate())
10710          throw new Error("Attempt to auto-create Contract.scope");
10711        else if (Configuration.doAutoCreate())
10712          this.scope = new CodeableConcept(); // cc
10713      return this.scope;
10714    }
10715
10716    public boolean hasScope() { 
10717      return this.scope != null && !this.scope.isEmpty();
10718    }
10719
10720    /**
10721     * @param value {@link #scope} (A selector of legal concerns for this Contract definition, derivative, or instance in any legal state.)
10722     */
10723    public Contract setScope(CodeableConcept value) { 
10724      this.scope = value;
10725      return this;
10726    }
10727
10728    /**
10729     * @return {@link #topic} (Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.)
10730     */
10731    public Type getTopic() { 
10732      return this.topic;
10733    }
10734
10735    /**
10736     * @return {@link #topic} (Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.)
10737     */
10738    public CodeableConcept getTopicCodeableConcept() throws FHIRException { 
10739      if (this.topic == null)
10740        this.topic = new CodeableConcept();
10741      if (!(this.topic instanceof CodeableConcept))
10742        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.topic.getClass().getName()+" was encountered");
10743      return (CodeableConcept) this.topic;
10744    }
10745
10746    public boolean hasTopicCodeableConcept() { 
10747      return this != null && this.topic instanceof CodeableConcept;
10748    }
10749
10750    /**
10751     * @return {@link #topic} (Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.)
10752     */
10753    public Reference getTopicReference() throws FHIRException { 
10754      if (this.topic == null)
10755        this.topic = new Reference();
10756      if (!(this.topic instanceof Reference))
10757        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.topic.getClass().getName()+" was encountered");
10758      return (Reference) this.topic;
10759    }
10760
10761    public boolean hasTopicReference() { 
10762      return this != null && this.topic instanceof Reference;
10763    }
10764
10765    public boolean hasTopic() { 
10766      return this.topic != null && !this.topic.isEmpty();
10767    }
10768
10769    /**
10770     * @param value {@link #topic} (Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.)
10771     */
10772    public Contract setTopic(Type value) { 
10773      if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
10774        throw new Error("Not the right type for Contract.topic[x]: "+value.fhirType());
10775      this.topic = value;
10776      return this;
10777    }
10778
10779    /**
10780     * @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.)
10781     */
10782    public CodeableConcept getType() { 
10783      if (this.type == null)
10784        if (Configuration.errorOnAutoCreate())
10785          throw new Error("Attempt to auto-create Contract.type");
10786        else if (Configuration.doAutoCreate())
10787          this.type = new CodeableConcept(); // cc
10788      return this.type;
10789    }
10790
10791    public boolean hasType() { 
10792      return this.type != null && !this.type.isEmpty();
10793    }
10794
10795    /**
10796     * @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.)
10797     */
10798    public Contract setType(CodeableConcept value) { 
10799      this.type = value;
10800      return this;
10801    }
10802
10803    /**
10804     * @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.)
10805     */
10806    public List<CodeableConcept> getSubType() { 
10807      if (this.subType == null)
10808        this.subType = new ArrayList<CodeableConcept>();
10809      return this.subType;
10810    }
10811
10812    /**
10813     * @return Returns a reference to <code>this</code> for easy method chaining
10814     */
10815    public Contract setSubType(List<CodeableConcept> theSubType) { 
10816      this.subType = theSubType;
10817      return this;
10818    }
10819
10820    public boolean hasSubType() { 
10821      if (this.subType == null)
10822        return false;
10823      for (CodeableConcept item : this.subType)
10824        if (!item.isEmpty())
10825          return true;
10826      return false;
10827    }
10828
10829    public CodeableConcept addSubType() { //3
10830      CodeableConcept t = new CodeableConcept();
10831      if (this.subType == null)
10832        this.subType = new ArrayList<CodeableConcept>();
10833      this.subType.add(t);
10834      return t;
10835    }
10836
10837    public Contract addSubType(CodeableConcept t) { //3
10838      if (t == null)
10839        return this;
10840      if (this.subType == null)
10841        this.subType = new ArrayList<CodeableConcept>();
10842      this.subType.add(t);
10843      return this;
10844    }
10845
10846    /**
10847     * @return The first repetition of repeating field {@link #subType}, creating it if it does not already exist
10848     */
10849    public CodeableConcept getSubTypeFirstRep() { 
10850      if (getSubType().isEmpty()) {
10851        addSubType();
10852      }
10853      return getSubType().get(0);
10854    }
10855
10856    /**
10857     * @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.)
10858     */
10859    public ContentDefinitionComponent getContentDefinition() { 
10860      if (this.contentDefinition == null)
10861        if (Configuration.errorOnAutoCreate())
10862          throw new Error("Attempt to auto-create Contract.contentDefinition");
10863        else if (Configuration.doAutoCreate())
10864          this.contentDefinition = new ContentDefinitionComponent(); // cc
10865      return this.contentDefinition;
10866    }
10867
10868    public boolean hasContentDefinition() { 
10869      return this.contentDefinition != null && !this.contentDefinition.isEmpty();
10870    }
10871
10872    /**
10873     * @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.)
10874     */
10875    public Contract setContentDefinition(ContentDefinitionComponent value) { 
10876      this.contentDefinition = value;
10877      return this;
10878    }
10879
10880    /**
10881     * @return {@link #term} (One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.)
10882     */
10883    public List<TermComponent> getTerm() { 
10884      if (this.term == null)
10885        this.term = new ArrayList<TermComponent>();
10886      return this.term;
10887    }
10888
10889    /**
10890     * @return Returns a reference to <code>this</code> for easy method chaining
10891     */
10892    public Contract setTerm(List<TermComponent> theTerm) { 
10893      this.term = theTerm;
10894      return this;
10895    }
10896
10897    public boolean hasTerm() { 
10898      if (this.term == null)
10899        return false;
10900      for (TermComponent item : this.term)
10901        if (!item.isEmpty())
10902          return true;
10903      return false;
10904    }
10905
10906    public TermComponent addTerm() { //3
10907      TermComponent t = new TermComponent();
10908      if (this.term == null)
10909        this.term = new ArrayList<TermComponent>();
10910      this.term.add(t);
10911      return t;
10912    }
10913
10914    public Contract addTerm(TermComponent t) { //3
10915      if (t == null)
10916        return this;
10917      if (this.term == null)
10918        this.term = new ArrayList<TermComponent>();
10919      this.term.add(t);
10920      return this;
10921    }
10922
10923    /**
10924     * @return The first repetition of repeating field {@link #term}, creating it if it does not already exist
10925     */
10926    public TermComponent getTermFirstRep() { 
10927      if (getTerm().isEmpty()) {
10928        addTerm();
10929      }
10930      return getTerm().get(0);
10931    }
10932
10933    /**
10934     * @return {@link #supportingInfo} (Information that may be needed by/relevant to the performer in their execution of this term action.)
10935     */
10936    public List<Reference> getSupportingInfo() { 
10937      if (this.supportingInfo == null)
10938        this.supportingInfo = new ArrayList<Reference>();
10939      return this.supportingInfo;
10940    }
10941
10942    /**
10943     * @return Returns a reference to <code>this</code> for easy method chaining
10944     */
10945    public Contract setSupportingInfo(List<Reference> theSupportingInfo) { 
10946      this.supportingInfo = theSupportingInfo;
10947      return this;
10948    }
10949
10950    public boolean hasSupportingInfo() { 
10951      if (this.supportingInfo == null)
10952        return false;
10953      for (Reference item : this.supportingInfo)
10954        if (!item.isEmpty())
10955          return true;
10956      return false;
10957    }
10958
10959    public Reference addSupportingInfo() { //3
10960      Reference t = new Reference();
10961      if (this.supportingInfo == null)
10962        this.supportingInfo = new ArrayList<Reference>();
10963      this.supportingInfo.add(t);
10964      return t;
10965    }
10966
10967    public Contract addSupportingInfo(Reference t) { //3
10968      if (t == null)
10969        return this;
10970      if (this.supportingInfo == null)
10971        this.supportingInfo = new ArrayList<Reference>();
10972      this.supportingInfo.add(t);
10973      return this;
10974    }
10975
10976    /**
10977     * @return The first repetition of repeating field {@link #supportingInfo}, creating it if it does not already exist
10978     */
10979    public Reference getSupportingInfoFirstRep() { 
10980      if (getSupportingInfo().isEmpty()) {
10981        addSupportingInfo();
10982      }
10983      return getSupportingInfo().get(0);
10984    }
10985
10986    /**
10987     * @deprecated Use Reference#setResource(IBaseResource) instead
10988     */
10989    @Deprecated
10990    public List<Resource> getSupportingInfoTarget() { 
10991      if (this.supportingInfoTarget == null)
10992        this.supportingInfoTarget = new ArrayList<Resource>();
10993      return this.supportingInfoTarget;
10994    }
10995
10996    /**
10997     * @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.)
10998     */
10999    public List<Reference> getRelevantHistory() { 
11000      if (this.relevantHistory == null)
11001        this.relevantHistory = new ArrayList<Reference>();
11002      return this.relevantHistory;
11003    }
11004
11005    /**
11006     * @return Returns a reference to <code>this</code> for easy method chaining
11007     */
11008    public Contract setRelevantHistory(List<Reference> theRelevantHistory) { 
11009      this.relevantHistory = theRelevantHistory;
11010      return this;
11011    }
11012
11013    public boolean hasRelevantHistory() { 
11014      if (this.relevantHistory == null)
11015        return false;
11016      for (Reference item : this.relevantHistory)
11017        if (!item.isEmpty())
11018          return true;
11019      return false;
11020    }
11021
11022    public Reference addRelevantHistory() { //3
11023      Reference t = new Reference();
11024      if (this.relevantHistory == null)
11025        this.relevantHistory = new ArrayList<Reference>();
11026      this.relevantHistory.add(t);
11027      return t;
11028    }
11029
11030    public Contract addRelevantHistory(Reference t) { //3
11031      if (t == null)
11032        return this;
11033      if (this.relevantHistory == null)
11034        this.relevantHistory = new ArrayList<Reference>();
11035      this.relevantHistory.add(t);
11036      return this;
11037    }
11038
11039    /**
11040     * @return The first repetition of repeating field {@link #relevantHistory}, creating it if it does not already exist
11041     */
11042    public Reference getRelevantHistoryFirstRep() { 
11043      if (getRelevantHistory().isEmpty()) {
11044        addRelevantHistory();
11045      }
11046      return getRelevantHistory().get(0);
11047    }
11048
11049    /**
11050     * @deprecated Use Reference#setResource(IBaseResource) instead
11051     */
11052    @Deprecated
11053    public List<Provenance> getRelevantHistoryTarget() { 
11054      if (this.relevantHistoryTarget == null)
11055        this.relevantHistoryTarget = new ArrayList<Provenance>();
11056      return this.relevantHistoryTarget;
11057    }
11058
11059    /**
11060     * @deprecated Use Reference#setResource(IBaseResource) instead
11061     */
11062    @Deprecated
11063    public Provenance addRelevantHistoryTarget() { 
11064      Provenance r = new Provenance();
11065      if (this.relevantHistoryTarget == null)
11066        this.relevantHistoryTarget = new ArrayList<Provenance>();
11067      this.relevantHistoryTarget.add(r);
11068      return r;
11069    }
11070
11071    /**
11072     * @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.)
11073     */
11074    public List<SignatoryComponent> getSigner() { 
11075      if (this.signer == null)
11076        this.signer = new ArrayList<SignatoryComponent>();
11077      return this.signer;
11078    }
11079
11080    /**
11081     * @return Returns a reference to <code>this</code> for easy method chaining
11082     */
11083    public Contract setSigner(List<SignatoryComponent> theSigner) { 
11084      this.signer = theSigner;
11085      return this;
11086    }
11087
11088    public boolean hasSigner() { 
11089      if (this.signer == null)
11090        return false;
11091      for (SignatoryComponent item : this.signer)
11092        if (!item.isEmpty())
11093          return true;
11094      return false;
11095    }
11096
11097    public SignatoryComponent addSigner() { //3
11098      SignatoryComponent t = new SignatoryComponent();
11099      if (this.signer == null)
11100        this.signer = new ArrayList<SignatoryComponent>();
11101      this.signer.add(t);
11102      return t;
11103    }
11104
11105    public Contract addSigner(SignatoryComponent t) { //3
11106      if (t == null)
11107        return this;
11108      if (this.signer == null)
11109        this.signer = new ArrayList<SignatoryComponent>();
11110      this.signer.add(t);
11111      return this;
11112    }
11113
11114    /**
11115     * @return The first repetition of repeating field {@link #signer}, creating it if it does not already exist
11116     */
11117    public SignatoryComponent getSignerFirstRep() { 
11118      if (getSigner().isEmpty()) {
11119        addSigner();
11120      }
11121      return getSigner().get(0);
11122    }
11123
11124    /**
11125     * @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.)
11126     */
11127    public List<FriendlyLanguageComponent> getFriendly() { 
11128      if (this.friendly == null)
11129        this.friendly = new ArrayList<FriendlyLanguageComponent>();
11130      return this.friendly;
11131    }
11132
11133    /**
11134     * @return Returns a reference to <code>this</code> for easy method chaining
11135     */
11136    public Contract setFriendly(List<FriendlyLanguageComponent> theFriendly) { 
11137      this.friendly = theFriendly;
11138      return this;
11139    }
11140
11141    public boolean hasFriendly() { 
11142      if (this.friendly == null)
11143        return false;
11144      for (FriendlyLanguageComponent item : this.friendly)
11145        if (!item.isEmpty())
11146          return true;
11147      return false;
11148    }
11149
11150    public FriendlyLanguageComponent addFriendly() { //3
11151      FriendlyLanguageComponent t = new FriendlyLanguageComponent();
11152      if (this.friendly == null)
11153        this.friendly = new ArrayList<FriendlyLanguageComponent>();
11154      this.friendly.add(t);
11155      return t;
11156    }
11157
11158    public Contract addFriendly(FriendlyLanguageComponent t) { //3
11159      if (t == null)
11160        return this;
11161      if (this.friendly == null)
11162        this.friendly = new ArrayList<FriendlyLanguageComponent>();
11163      this.friendly.add(t);
11164      return this;
11165    }
11166
11167    /**
11168     * @return The first repetition of repeating field {@link #friendly}, creating it if it does not already exist
11169     */
11170    public FriendlyLanguageComponent getFriendlyFirstRep() { 
11171      if (getFriendly().isEmpty()) {
11172        addFriendly();
11173      }
11174      return getFriendly().get(0);
11175    }
11176
11177    /**
11178     * @return {@link #legal} (List of Legal expressions or representations of this Contract.)
11179     */
11180    public List<LegalLanguageComponent> getLegal() { 
11181      if (this.legal == null)
11182        this.legal = new ArrayList<LegalLanguageComponent>();
11183      return this.legal;
11184    }
11185
11186    /**
11187     * @return Returns a reference to <code>this</code> for easy method chaining
11188     */
11189    public Contract setLegal(List<LegalLanguageComponent> theLegal) { 
11190      this.legal = theLegal;
11191      return this;
11192    }
11193
11194    public boolean hasLegal() { 
11195      if (this.legal == null)
11196        return false;
11197      for (LegalLanguageComponent item : this.legal)
11198        if (!item.isEmpty())
11199          return true;
11200      return false;
11201    }
11202
11203    public LegalLanguageComponent addLegal() { //3
11204      LegalLanguageComponent t = new LegalLanguageComponent();
11205      if (this.legal == null)
11206        this.legal = new ArrayList<LegalLanguageComponent>();
11207      this.legal.add(t);
11208      return t;
11209    }
11210
11211    public Contract addLegal(LegalLanguageComponent t) { //3
11212      if (t == null)
11213        return this;
11214      if (this.legal == null)
11215        this.legal = new ArrayList<LegalLanguageComponent>();
11216      this.legal.add(t);
11217      return this;
11218    }
11219
11220    /**
11221     * @return The first repetition of repeating field {@link #legal}, creating it if it does not already exist
11222     */
11223    public LegalLanguageComponent getLegalFirstRep() { 
11224      if (getLegal().isEmpty()) {
11225        addLegal();
11226      }
11227      return getLegal().get(0);
11228    }
11229
11230    /**
11231     * @return {@link #rule} (List of Computable Policy Rule Language Representations of this Contract.)
11232     */
11233    public List<ComputableLanguageComponent> getRule() { 
11234      if (this.rule == null)
11235        this.rule = new ArrayList<ComputableLanguageComponent>();
11236      return this.rule;
11237    }
11238
11239    /**
11240     * @return Returns a reference to <code>this</code> for easy method chaining
11241     */
11242    public Contract setRule(List<ComputableLanguageComponent> theRule) { 
11243      this.rule = theRule;
11244      return this;
11245    }
11246
11247    public boolean hasRule() { 
11248      if (this.rule == null)
11249        return false;
11250      for (ComputableLanguageComponent item : this.rule)
11251        if (!item.isEmpty())
11252          return true;
11253      return false;
11254    }
11255
11256    public ComputableLanguageComponent addRule() { //3
11257      ComputableLanguageComponent t = new ComputableLanguageComponent();
11258      if (this.rule == null)
11259        this.rule = new ArrayList<ComputableLanguageComponent>();
11260      this.rule.add(t);
11261      return t;
11262    }
11263
11264    public Contract addRule(ComputableLanguageComponent t) { //3
11265      if (t == null)
11266        return this;
11267      if (this.rule == null)
11268        this.rule = new ArrayList<ComputableLanguageComponent>();
11269      this.rule.add(t);
11270      return this;
11271    }
11272
11273    /**
11274     * @return The first repetition of repeating field {@link #rule}, creating it if it does not already exist
11275     */
11276    public ComputableLanguageComponent getRuleFirstRep() { 
11277      if (getRule().isEmpty()) {
11278        addRule();
11279      }
11280      return getRule().get(0);
11281    }
11282
11283    /**
11284     * @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.)
11285     */
11286    public Type getLegallyBinding() { 
11287      return this.legallyBinding;
11288    }
11289
11290    /**
11291     * @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.)
11292     */
11293    public Attachment getLegallyBindingAttachment() throws FHIRException { 
11294      if (this.legallyBinding == null)
11295        this.legallyBinding = new Attachment();
11296      if (!(this.legallyBinding instanceof Attachment))
11297        throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.legallyBinding.getClass().getName()+" was encountered");
11298      return (Attachment) this.legallyBinding;
11299    }
11300
11301    public boolean hasLegallyBindingAttachment() { 
11302      return this != null && this.legallyBinding instanceof Attachment;
11303    }
11304
11305    /**
11306     * @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.)
11307     */
11308    public Reference getLegallyBindingReference() throws FHIRException { 
11309      if (this.legallyBinding == null)
11310        this.legallyBinding = new Reference();
11311      if (!(this.legallyBinding instanceof Reference))
11312        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.legallyBinding.getClass().getName()+" was encountered");
11313      return (Reference) this.legallyBinding;
11314    }
11315
11316    public boolean hasLegallyBindingReference() { 
11317      return this != null && this.legallyBinding instanceof Reference;
11318    }
11319
11320    public boolean hasLegallyBinding() { 
11321      return this.legallyBinding != null && !this.legallyBinding.isEmpty();
11322    }
11323
11324    /**
11325     * @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.)
11326     */
11327    public Contract setLegallyBinding(Type value) { 
11328      if (value != null && !(value instanceof Attachment || value instanceof Reference))
11329        throw new Error("Not the right type for Contract.legallyBinding[x]: "+value.fhirType());
11330      this.legallyBinding = value;
11331      return this;
11332    }
11333
11334      protected void listChildren(List<Property> children) {
11335        super.listChildren(children);
11336        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));
11337        children.add(new Property("url", "uri", "Canonical identifier for this contract, represented as a URI (globally unique).", 0, 1, url));
11338        children.add(new Property("version", "string", "An edition identifier used for business purposes to label business significant variants.", 0, 1, version));
11339        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
11340        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));
11341        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));
11342        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));
11343        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));
11344        children.add(new Property("issued", "dateTime", "When this  Contract was issued.", 0, 1, issued));
11345        children.add(new Property("applies", "Period", "Relevant time or time-period when this Contract is applicable.", 0, 1, applies));
11346        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));
11347        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));
11348        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));
11349        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));
11350        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));
11351        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));
11352        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));
11353        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));
11354        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));
11355        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));
11356        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));
11357        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));
11358        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));
11359        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));
11360        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));
11361        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));
11362        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));
11363        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));
11364        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));
11365        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));
11366        children.add(new Property("legal", "", "List of Legal expressions or representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, legal));
11367        children.add(new Property("rule", "", "List of Computable Policy Rule Language Representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, rule));
11368        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));
11369      }
11370
11371      @Override
11372      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
11373        switch (_hash) {
11374        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);
11375        case 116079: /*url*/  return new Property("url", "uri", "Canonical identifier for this contract, represented as a URI (globally unique).", 0, 1, url);
11376        case 351608024: /*version*/  return new Property("version", "string", "An edition identifier used for business purposes to label business significant variants.", 0, 1, version);
11377        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
11378        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);
11379        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);
11380        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);
11381        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);
11382        case -1179159893: /*issued*/  return new Property("issued", "dateTime", "When this  Contract was issued.", 0, 1, issued);
11383        case -793235316: /*applies*/  return new Property("applies", "Period", "Relevant time or time-period when this Contract is applicable.", 0, 1, applies);
11384        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);
11385        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);
11386        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);
11387        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);
11388        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);
11389        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);
11390        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);
11391        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);
11392        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);
11393        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);
11394        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);
11395        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);
11396        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);
11397        case 777778802: /*topicCodeableConcept*/  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);
11398        case -343345444: /*topicReference*/  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);
11399        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);
11400        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);
11401        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);
11402        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);
11403        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);
11404        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);
11405        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);
11406        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);
11407        case 102851257: /*legal*/  return new Property("legal", "", "List of Legal expressions or representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, legal);
11408        case 3512060: /*rule*/  return new Property("rule", "", "List of Computable Policy Rule Language Representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, rule);
11409        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);
11410        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);
11411        case 344057890: /*legallyBindingAttachment*/  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);
11412        case -296528788: /*legallyBindingReference*/  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);
11413        default: return super.getNamedProperty(_hash, _name, _checkValid);
11414        }
11415
11416      }
11417
11418      @Override
11419      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
11420        switch (hash) {
11421        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
11422        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
11423        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
11424        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ContractStatus>
11425        case 568606040: /*legalState*/ return this.legalState == null ? new Base[0] : new Base[] {this.legalState}; // CodeableConcept
11426        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : new Base[] {this.instantiatesCanonical}; // Reference
11427        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : new Base[] {this.instantiatesUri}; // UriType
11428        case -92412192: /*contentDerivative*/ return this.contentDerivative == null ? new Base[0] : new Base[] {this.contentDerivative}; // CodeableConcept
11429        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType
11430        case -793235316: /*applies*/ return this.applies == null ? new Base[0] : new Base[] {this.applies}; // Period
11431        case -668311927: /*expirationType*/ return this.expirationType == null ? new Base[0] : new Base[] {this.expirationType}; // CodeableConcept
11432        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // Reference
11433        case 1475610435: /*authority*/ return this.authority == null ? new Base[0] : this.authority.toArray(new Base[this.authority.size()]); // Reference
11434        case -1326197564: /*domain*/ return this.domain == null ? new Base[0] : this.domain.toArray(new Base[this.domain.size()]); // Reference
11435        case 3530567: /*site*/ return this.site == null ? new Base[0] : this.site.toArray(new Base[this.site.size()]); // Reference
11436        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
11437        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
11438        case -2060497896: /*subtitle*/ return this.subtitle == null ? new Base[0] : new Base[] {this.subtitle}; // StringType
11439        case 92902992: /*alias*/ return this.alias == null ? new Base[0] : this.alias.toArray(new Base[this.alias.size()]); // StringType
11440        case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference
11441        case 109264468: /*scope*/ return this.scope == null ? new Base[0] : new Base[] {this.scope}; // CodeableConcept
11442        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : new Base[] {this.topic}; // Type
11443        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
11444        case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // CodeableConcept
11445        case 247055020: /*contentDefinition*/ return this.contentDefinition == null ? new Base[0] : new Base[] {this.contentDefinition}; // ContentDefinitionComponent
11446        case 3556460: /*term*/ return this.term == null ? new Base[0] : this.term.toArray(new Base[this.term.size()]); // TermComponent
11447        case 1922406657: /*supportingInfo*/ return this.supportingInfo == null ? new Base[0] : this.supportingInfo.toArray(new Base[this.supportingInfo.size()]); // Reference
11448        case 1538891575: /*relevantHistory*/ return this.relevantHistory == null ? new Base[0] : this.relevantHistory.toArray(new Base[this.relevantHistory.size()]); // Reference
11449        case -902467798: /*signer*/ return this.signer == null ? new Base[0] : this.signer.toArray(new Base[this.signer.size()]); // SignatoryComponent
11450        case -1423054677: /*friendly*/ return this.friendly == null ? new Base[0] : this.friendly.toArray(new Base[this.friendly.size()]); // FriendlyLanguageComponent
11451        case 102851257: /*legal*/ return this.legal == null ? new Base[0] : this.legal.toArray(new Base[this.legal.size()]); // LegalLanguageComponent
11452        case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // ComputableLanguageComponent
11453        case -126751329: /*legallyBinding*/ return this.legallyBinding == null ? new Base[0] : new Base[] {this.legallyBinding}; // Type
11454        default: return super.getProperty(hash, name, checkValid);
11455        }
11456
11457      }
11458
11459      @Override
11460      public Base setProperty(int hash, String name, Base value) throws FHIRException {
11461        switch (hash) {
11462        case -1618432855: // identifier
11463          this.getIdentifier().add(castToIdentifier(value)); // Identifier
11464          return value;
11465        case 116079: // url
11466          this.url = castToUri(value); // UriType
11467          return value;
11468        case 351608024: // version
11469          this.version = castToString(value); // StringType
11470          return value;
11471        case -892481550: // status
11472          value = new ContractStatusEnumFactory().fromType(castToCode(value));
11473          this.status = (Enumeration) value; // Enumeration<ContractStatus>
11474          return value;
11475        case 568606040: // legalState
11476          this.legalState = castToCodeableConcept(value); // CodeableConcept
11477          return value;
11478        case 8911915: // instantiatesCanonical
11479          this.instantiatesCanonical = castToReference(value); // Reference
11480          return value;
11481        case -1926393373: // instantiatesUri
11482          this.instantiatesUri = castToUri(value); // UriType
11483          return value;
11484        case -92412192: // contentDerivative
11485          this.contentDerivative = castToCodeableConcept(value); // CodeableConcept
11486          return value;
11487        case -1179159893: // issued
11488          this.issued = castToDateTime(value); // DateTimeType
11489          return value;
11490        case -793235316: // applies
11491          this.applies = castToPeriod(value); // Period
11492          return value;
11493        case -668311927: // expirationType
11494          this.expirationType = castToCodeableConcept(value); // CodeableConcept
11495          return value;
11496        case -1867885268: // subject
11497          this.getSubject().add(castToReference(value)); // Reference
11498          return value;
11499        case 1475610435: // authority
11500          this.getAuthority().add(castToReference(value)); // Reference
11501          return value;
11502        case -1326197564: // domain
11503          this.getDomain().add(castToReference(value)); // Reference
11504          return value;
11505        case 3530567: // site
11506          this.getSite().add(castToReference(value)); // Reference
11507          return value;
11508        case 3373707: // name
11509          this.name = castToString(value); // StringType
11510          return value;
11511        case 110371416: // title
11512          this.title = castToString(value); // StringType
11513          return value;
11514        case -2060497896: // subtitle
11515          this.subtitle = castToString(value); // StringType
11516          return value;
11517        case 92902992: // alias
11518          this.getAlias().add(castToString(value)); // StringType
11519          return value;
11520        case -1406328437: // author
11521          this.author = castToReference(value); // Reference
11522          return value;
11523        case 109264468: // scope
11524          this.scope = castToCodeableConcept(value); // CodeableConcept
11525          return value;
11526        case 110546223: // topic
11527          this.topic = castToType(value); // Type
11528          return value;
11529        case 3575610: // type
11530          this.type = castToCodeableConcept(value); // CodeableConcept
11531          return value;
11532        case -1868521062: // subType
11533          this.getSubType().add(castToCodeableConcept(value)); // CodeableConcept
11534          return value;
11535        case 247055020: // contentDefinition
11536          this.contentDefinition = (ContentDefinitionComponent) value; // ContentDefinitionComponent
11537          return value;
11538        case 3556460: // term
11539          this.getTerm().add((TermComponent) value); // TermComponent
11540          return value;
11541        case 1922406657: // supportingInfo
11542          this.getSupportingInfo().add(castToReference(value)); // Reference
11543          return value;
11544        case 1538891575: // relevantHistory
11545          this.getRelevantHistory().add(castToReference(value)); // Reference
11546          return value;
11547        case -902467798: // signer
11548          this.getSigner().add((SignatoryComponent) value); // SignatoryComponent
11549          return value;
11550        case -1423054677: // friendly
11551          this.getFriendly().add((FriendlyLanguageComponent) value); // FriendlyLanguageComponent
11552          return value;
11553        case 102851257: // legal
11554          this.getLegal().add((LegalLanguageComponent) value); // LegalLanguageComponent
11555          return value;
11556        case 3512060: // rule
11557          this.getRule().add((ComputableLanguageComponent) value); // ComputableLanguageComponent
11558          return value;
11559        case -126751329: // legallyBinding
11560          this.legallyBinding = castToType(value); // Type
11561          return value;
11562        default: return super.setProperty(hash, name, value);
11563        }
11564
11565      }
11566
11567      @Override
11568      public Base setProperty(String name, Base value) throws FHIRException {
11569        if (name.equals("identifier")) {
11570          this.getIdentifier().add(castToIdentifier(value));
11571        } else if (name.equals("url")) {
11572          this.url = castToUri(value); // UriType
11573        } else if (name.equals("version")) {
11574          this.version = castToString(value); // StringType
11575        } else if (name.equals("status")) {
11576          value = new ContractStatusEnumFactory().fromType(castToCode(value));
11577          this.status = (Enumeration) value; // Enumeration<ContractStatus>
11578        } else if (name.equals("legalState")) {
11579          this.legalState = castToCodeableConcept(value); // CodeableConcept
11580        } else if (name.equals("instantiatesCanonical")) {
11581          this.instantiatesCanonical = castToReference(value); // Reference
11582        } else if (name.equals("instantiatesUri")) {
11583          this.instantiatesUri = castToUri(value); // UriType
11584        } else if (name.equals("contentDerivative")) {
11585          this.contentDerivative = castToCodeableConcept(value); // CodeableConcept
11586        } else if (name.equals("issued")) {
11587          this.issued = castToDateTime(value); // DateTimeType
11588        } else if (name.equals("applies")) {
11589          this.applies = castToPeriod(value); // Period
11590        } else if (name.equals("expirationType")) {
11591          this.expirationType = castToCodeableConcept(value); // CodeableConcept
11592        } else if (name.equals("subject")) {
11593          this.getSubject().add(castToReference(value));
11594        } else if (name.equals("authority")) {
11595          this.getAuthority().add(castToReference(value));
11596        } else if (name.equals("domain")) {
11597          this.getDomain().add(castToReference(value));
11598        } else if (name.equals("site")) {
11599          this.getSite().add(castToReference(value));
11600        } else if (name.equals("name")) {
11601          this.name = castToString(value); // StringType
11602        } else if (name.equals("title")) {
11603          this.title = castToString(value); // StringType
11604        } else if (name.equals("subtitle")) {
11605          this.subtitle = castToString(value); // StringType
11606        } else if (name.equals("alias")) {
11607          this.getAlias().add(castToString(value));
11608        } else if (name.equals("author")) {
11609          this.author = castToReference(value); // Reference
11610        } else if (name.equals("scope")) {
11611          this.scope = castToCodeableConcept(value); // CodeableConcept
11612        } else if (name.equals("topic[x]")) {
11613          this.topic = castToType(value); // Type
11614        } else if (name.equals("type")) {
11615          this.type = castToCodeableConcept(value); // CodeableConcept
11616        } else if (name.equals("subType")) {
11617          this.getSubType().add(castToCodeableConcept(value));
11618        } else if (name.equals("contentDefinition")) {
11619          this.contentDefinition = (ContentDefinitionComponent) value; // ContentDefinitionComponent
11620        } else if (name.equals("term")) {
11621          this.getTerm().add((TermComponent) value);
11622        } else if (name.equals("supportingInfo")) {
11623          this.getSupportingInfo().add(castToReference(value));
11624        } else if (name.equals("relevantHistory")) {
11625          this.getRelevantHistory().add(castToReference(value));
11626        } else if (name.equals("signer")) {
11627          this.getSigner().add((SignatoryComponent) value);
11628        } else if (name.equals("friendly")) {
11629          this.getFriendly().add((FriendlyLanguageComponent) value);
11630        } else if (name.equals("legal")) {
11631          this.getLegal().add((LegalLanguageComponent) value);
11632        } else if (name.equals("rule")) {
11633          this.getRule().add((ComputableLanguageComponent) value);
11634        } else if (name.equals("legallyBinding[x]")) {
11635          this.legallyBinding = castToType(value); // Type
11636        } else
11637          return super.setProperty(name, value);
11638        return value;
11639      }
11640
11641      @Override
11642      public Base makeProperty(int hash, String name) throws FHIRException {
11643        switch (hash) {
11644        case -1618432855:  return addIdentifier(); 
11645        case 116079:  return getUrlElement();
11646        case 351608024:  return getVersionElement();
11647        case -892481550:  return getStatusElement();
11648        case 568606040:  return getLegalState(); 
11649        case 8911915:  return getInstantiatesCanonical(); 
11650        case -1926393373:  return getInstantiatesUriElement();
11651        case -92412192:  return getContentDerivative(); 
11652        case -1179159893:  return getIssuedElement();
11653        case -793235316:  return getApplies(); 
11654        case -668311927:  return getExpirationType(); 
11655        case -1867885268:  return addSubject(); 
11656        case 1475610435:  return addAuthority(); 
11657        case -1326197564:  return addDomain(); 
11658        case 3530567:  return addSite(); 
11659        case 3373707:  return getNameElement();
11660        case 110371416:  return getTitleElement();
11661        case -2060497896:  return getSubtitleElement();
11662        case 92902992:  return addAliasElement();
11663        case -1406328437:  return getAuthor(); 
11664        case 109264468:  return getScope(); 
11665        case -957295375:  return getTopic(); 
11666        case 110546223:  return getTopic(); 
11667        case 3575610:  return getType(); 
11668        case -1868521062:  return addSubType(); 
11669        case 247055020:  return getContentDefinition(); 
11670        case 3556460:  return addTerm(); 
11671        case 1922406657:  return addSupportingInfo(); 
11672        case 1538891575:  return addRelevantHistory(); 
11673        case -902467798:  return addSigner(); 
11674        case -1423054677:  return addFriendly(); 
11675        case 102851257:  return addLegal(); 
11676        case 3512060:  return addRule(); 
11677        case -772497791:  return getLegallyBinding(); 
11678        case -126751329:  return getLegallyBinding(); 
11679        default: return super.makeProperty(hash, name);
11680        }
11681
11682      }
11683
11684      @Override
11685      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
11686        switch (hash) {
11687        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
11688        case 116079: /*url*/ return new String[] {"uri"};
11689        case 351608024: /*version*/ return new String[] {"string"};
11690        case -892481550: /*status*/ return new String[] {"code"};
11691        case 568606040: /*legalState*/ return new String[] {"CodeableConcept"};
11692        case 8911915: /*instantiatesCanonical*/ return new String[] {"Reference"};
11693        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
11694        case -92412192: /*contentDerivative*/ return new String[] {"CodeableConcept"};
11695        case -1179159893: /*issued*/ return new String[] {"dateTime"};
11696        case -793235316: /*applies*/ return new String[] {"Period"};
11697        case -668311927: /*expirationType*/ return new String[] {"CodeableConcept"};
11698        case -1867885268: /*subject*/ return new String[] {"Reference"};
11699        case 1475610435: /*authority*/ return new String[] {"Reference"};
11700        case -1326197564: /*domain*/ return new String[] {"Reference"};
11701        case 3530567: /*site*/ return new String[] {"Reference"};
11702        case 3373707: /*name*/ return new String[] {"string"};
11703        case 110371416: /*title*/ return new String[] {"string"};
11704        case -2060497896: /*subtitle*/ return new String[] {"string"};
11705        case 92902992: /*alias*/ return new String[] {"string"};
11706        case -1406328437: /*author*/ return new String[] {"Reference"};
11707        case 109264468: /*scope*/ return new String[] {"CodeableConcept"};
11708        case 110546223: /*topic*/ return new String[] {"CodeableConcept", "Reference"};
11709        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
11710        case -1868521062: /*subType*/ return new String[] {"CodeableConcept"};
11711        case 247055020: /*contentDefinition*/ return new String[] {};
11712        case 3556460: /*term*/ return new String[] {};
11713        case 1922406657: /*supportingInfo*/ return new String[] {"Reference"};
11714        case 1538891575: /*relevantHistory*/ return new String[] {"Reference"};
11715        case -902467798: /*signer*/ return new String[] {};
11716        case -1423054677: /*friendly*/ return new String[] {};
11717        case 102851257: /*legal*/ return new String[] {};
11718        case 3512060: /*rule*/ return new String[] {};
11719        case -126751329: /*legallyBinding*/ return new String[] {"Attachment", "Reference"};
11720        default: return super.getTypesForProperty(hash, name);
11721        }
11722
11723      }
11724
11725      @Override
11726      public Base addChild(String name) throws FHIRException {
11727        if (name.equals("identifier")) {
11728          return addIdentifier();
11729        }
11730        else if (name.equals("url")) {
11731          throw new FHIRException("Cannot call addChild on a primitive type Contract.url");
11732        }
11733        else if (name.equals("version")) {
11734          throw new FHIRException("Cannot call addChild on a primitive type Contract.version");
11735        }
11736        else if (name.equals("status")) {
11737          throw new FHIRException("Cannot call addChild on a primitive type Contract.status");
11738        }
11739        else if (name.equals("legalState")) {
11740          this.legalState = new CodeableConcept();
11741          return this.legalState;
11742        }
11743        else if (name.equals("instantiatesCanonical")) {
11744          this.instantiatesCanonical = new Reference();
11745          return this.instantiatesCanonical;
11746        }
11747        else if (name.equals("instantiatesUri")) {
11748          throw new FHIRException("Cannot call addChild on a primitive type Contract.instantiatesUri");
11749        }
11750        else if (name.equals("contentDerivative")) {
11751          this.contentDerivative = new CodeableConcept();
11752          return this.contentDerivative;
11753        }
11754        else if (name.equals("issued")) {
11755          throw new FHIRException("Cannot call addChild on a primitive type Contract.issued");
11756        }
11757        else if (name.equals("applies")) {
11758          this.applies = new Period();
11759          return this.applies;
11760        }
11761        else if (name.equals("expirationType")) {
11762          this.expirationType = new CodeableConcept();
11763          return this.expirationType;
11764        }
11765        else if (name.equals("subject")) {
11766          return addSubject();
11767        }
11768        else if (name.equals("authority")) {
11769          return addAuthority();
11770        }
11771        else if (name.equals("domain")) {
11772          return addDomain();
11773        }
11774        else if (name.equals("site")) {
11775          return addSite();
11776        }
11777        else if (name.equals("name")) {
11778          throw new FHIRException("Cannot call addChild on a primitive type Contract.name");
11779        }
11780        else if (name.equals("title")) {
11781          throw new FHIRException("Cannot call addChild on a primitive type Contract.title");
11782        }
11783        else if (name.equals("subtitle")) {
11784          throw new FHIRException("Cannot call addChild on a primitive type Contract.subtitle");
11785        }
11786        else if (name.equals("alias")) {
11787          throw new FHIRException("Cannot call addChild on a primitive type Contract.alias");
11788        }
11789        else if (name.equals("author")) {
11790          this.author = new Reference();
11791          return this.author;
11792        }
11793        else if (name.equals("scope")) {
11794          this.scope = new CodeableConcept();
11795          return this.scope;
11796        }
11797        else if (name.equals("topicCodeableConcept")) {
11798          this.topic = new CodeableConcept();
11799          return this.topic;
11800        }
11801        else if (name.equals("topicReference")) {
11802          this.topic = new Reference();
11803          return this.topic;
11804        }
11805        else if (name.equals("type")) {
11806          this.type = new CodeableConcept();
11807          return this.type;
11808        }
11809        else if (name.equals("subType")) {
11810          return addSubType();
11811        }
11812        else if (name.equals("contentDefinition")) {
11813          this.contentDefinition = new ContentDefinitionComponent();
11814          return this.contentDefinition;
11815        }
11816        else if (name.equals("term")) {
11817          return addTerm();
11818        }
11819        else if (name.equals("supportingInfo")) {
11820          return addSupportingInfo();
11821        }
11822        else if (name.equals("relevantHistory")) {
11823          return addRelevantHistory();
11824        }
11825        else if (name.equals("signer")) {
11826          return addSigner();
11827        }
11828        else if (name.equals("friendly")) {
11829          return addFriendly();
11830        }
11831        else if (name.equals("legal")) {
11832          return addLegal();
11833        }
11834        else if (name.equals("rule")) {
11835          return addRule();
11836        }
11837        else if (name.equals("legallyBindingAttachment")) {
11838          this.legallyBinding = new Attachment();
11839          return this.legallyBinding;
11840        }
11841        else if (name.equals("legallyBindingReference")) {
11842          this.legallyBinding = new Reference();
11843          return this.legallyBinding;
11844        }
11845        else
11846          return super.addChild(name);
11847      }
11848
11849  public String fhirType() {
11850    return "Contract";
11851
11852  }
11853
11854      public Contract copy() {
11855        Contract dst = new Contract();
11856        copyValues(dst);
11857        return dst;
11858      }
11859
11860      public void copyValues(Contract dst) {
11861        super.copyValues(dst);
11862        if (identifier != null) {
11863          dst.identifier = new ArrayList<Identifier>();
11864          for (Identifier i : identifier)
11865            dst.identifier.add(i.copy());
11866        };
11867        dst.url = url == null ? null : url.copy();
11868        dst.version = version == null ? null : version.copy();
11869        dst.status = status == null ? null : status.copy();
11870        dst.legalState = legalState == null ? null : legalState.copy();
11871        dst.instantiatesCanonical = instantiatesCanonical == null ? null : instantiatesCanonical.copy();
11872        dst.instantiatesUri = instantiatesUri == null ? null : instantiatesUri.copy();
11873        dst.contentDerivative = contentDerivative == null ? null : contentDerivative.copy();
11874        dst.issued = issued == null ? null : issued.copy();
11875        dst.applies = applies == null ? null : applies.copy();
11876        dst.expirationType = expirationType == null ? null : expirationType.copy();
11877        if (subject != null) {
11878          dst.subject = new ArrayList<Reference>();
11879          for (Reference i : subject)
11880            dst.subject.add(i.copy());
11881        };
11882        if (authority != null) {
11883          dst.authority = new ArrayList<Reference>();
11884          for (Reference i : authority)
11885            dst.authority.add(i.copy());
11886        };
11887        if (domain != null) {
11888          dst.domain = new ArrayList<Reference>();
11889          for (Reference i : domain)
11890            dst.domain.add(i.copy());
11891        };
11892        if (site != null) {
11893          dst.site = new ArrayList<Reference>();
11894          for (Reference i : site)
11895            dst.site.add(i.copy());
11896        };
11897        dst.name = name == null ? null : name.copy();
11898        dst.title = title == null ? null : title.copy();
11899        dst.subtitle = subtitle == null ? null : subtitle.copy();
11900        if (alias != null) {
11901          dst.alias = new ArrayList<StringType>();
11902          for (StringType i : alias)
11903            dst.alias.add(i.copy());
11904        };
11905        dst.author = author == null ? null : author.copy();
11906        dst.scope = scope == null ? null : scope.copy();
11907        dst.topic = topic == null ? null : topic.copy();
11908        dst.type = type == null ? null : type.copy();
11909        if (subType != null) {
11910          dst.subType = new ArrayList<CodeableConcept>();
11911          for (CodeableConcept i : subType)
11912            dst.subType.add(i.copy());
11913        };
11914        dst.contentDefinition = contentDefinition == null ? null : contentDefinition.copy();
11915        if (term != null) {
11916          dst.term = new ArrayList<TermComponent>();
11917          for (TermComponent i : term)
11918            dst.term.add(i.copy());
11919        };
11920        if (supportingInfo != null) {
11921          dst.supportingInfo = new ArrayList<Reference>();
11922          for (Reference i : supportingInfo)
11923            dst.supportingInfo.add(i.copy());
11924        };
11925        if (relevantHistory != null) {
11926          dst.relevantHistory = new ArrayList<Reference>();
11927          for (Reference i : relevantHistory)
11928            dst.relevantHistory.add(i.copy());
11929        };
11930        if (signer != null) {
11931          dst.signer = new ArrayList<SignatoryComponent>();
11932          for (SignatoryComponent i : signer)
11933            dst.signer.add(i.copy());
11934        };
11935        if (friendly != null) {
11936          dst.friendly = new ArrayList<FriendlyLanguageComponent>();
11937          for (FriendlyLanguageComponent i : friendly)
11938            dst.friendly.add(i.copy());
11939        };
11940        if (legal != null) {
11941          dst.legal = new ArrayList<LegalLanguageComponent>();
11942          for (LegalLanguageComponent i : legal)
11943            dst.legal.add(i.copy());
11944        };
11945        if (rule != null) {
11946          dst.rule = new ArrayList<ComputableLanguageComponent>();
11947          for (ComputableLanguageComponent i : rule)
11948            dst.rule.add(i.copy());
11949        };
11950        dst.legallyBinding = legallyBinding == null ? null : legallyBinding.copy();
11951      }
11952
11953      protected Contract typedCopy() {
11954        return copy();
11955      }
11956
11957      @Override
11958      public boolean equalsDeep(Base other_) {
11959        if (!super.equalsDeep(other_))
11960          return false;
11961        if (!(other_ instanceof Contract))
11962          return false;
11963        Contract o = (Contract) other_;
11964        return compareDeep(identifier, o.identifier, true) && compareDeep(url, o.url, true) && compareDeep(version, o.version, true)
11965           && compareDeep(status, o.status, true) && compareDeep(legalState, o.legalState, true) && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
11966           && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(contentDerivative, o.contentDerivative, true)
11967           && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true) && compareDeep(expirationType, o.expirationType, true)
11968           && compareDeep(subject, o.subject, true) && compareDeep(authority, o.authority, true) && compareDeep(domain, o.domain, true)
11969           && compareDeep(site, o.site, true) && compareDeep(name, o.name, true) && compareDeep(title, o.title, true)
11970           && compareDeep(subtitle, o.subtitle, true) && compareDeep(alias, o.alias, true) && compareDeep(author, o.author, true)
11971           && compareDeep(scope, o.scope, true) && compareDeep(topic, o.topic, true) && compareDeep(type, o.type, true)
11972           && compareDeep(subType, o.subType, true) && compareDeep(contentDefinition, o.contentDefinition, true)
11973           && compareDeep(term, o.term, true) && compareDeep(supportingInfo, o.supportingInfo, true) && compareDeep(relevantHistory, o.relevantHistory, true)
11974           && compareDeep(signer, o.signer, true) && compareDeep(friendly, o.friendly, true) && compareDeep(legal, o.legal, true)
11975           && compareDeep(rule, o.rule, true) && compareDeep(legallyBinding, o.legallyBinding, true);
11976      }
11977
11978      @Override
11979      public boolean equalsShallow(Base other_) {
11980        if (!super.equalsShallow(other_))
11981          return false;
11982        if (!(other_ instanceof Contract))
11983          return false;
11984        Contract o = (Contract) other_;
11985        return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(status, o.status, true)
11986           && compareValues(instantiatesUri, o.instantiatesUri, true) && compareValues(issued, o.issued, true)
11987           && compareValues(name, o.name, true) && compareValues(title, o.title, true) && compareValues(subtitle, o.subtitle, true)
11988           && compareValues(alias, o.alias, true);
11989      }
11990
11991      public boolean isEmpty() {
11992        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, url, version
11993          , status, legalState, instantiatesCanonical, instantiatesUri, contentDerivative, issued
11994          , applies, expirationType, subject, authority, domain, site, name, title, subtitle
11995          , alias, author, scope, topic, type, subType, contentDefinition, term, supportingInfo
11996          , relevantHistory, signer, friendly, legal, rule, legallyBinding);
11997      }
11998
11999  @Override
12000  public ResourceType getResourceType() {
12001    return ResourceType.Contract;
12002   }
12003
12004 /**
12005   * Search parameter: <b>identifier</b>
12006   * <p>
12007   * Description: <b>The identity of the contract</b><br>
12008   * Type: <b>token</b><br>
12009   * Path: <b>Contract.identifier</b><br>
12010   * </p>
12011   */
12012  @SearchParamDefinition(name="identifier", path="Contract.identifier", description="The identity of the contract", type="token" )
12013  public static final String SP_IDENTIFIER = "identifier";
12014 /**
12015   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
12016   * <p>
12017   * Description: <b>The identity of the contract</b><br>
12018   * Type: <b>token</b><br>
12019   * Path: <b>Contract.identifier</b><br>
12020   * </p>
12021   */
12022  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
12023
12024 /**
12025   * Search parameter: <b>instantiates</b>
12026   * <p>
12027   * Description: <b>A source definition of the contract</b><br>
12028   * Type: <b>uri</b><br>
12029   * Path: <b>Contract.instantiatesUri</b><br>
12030   * </p>
12031   */
12032  @SearchParamDefinition(name="instantiates", path="Contract.instantiatesUri", description="A source definition of the contract", type="uri" )
12033  public static final String SP_INSTANTIATES = "instantiates";
12034 /**
12035   * <b>Fluent Client</b> search parameter constant for <b>instantiates</b>
12036   * <p>
12037   * Description: <b>A source definition of the contract</b><br>
12038   * Type: <b>uri</b><br>
12039   * Path: <b>Contract.instantiatesUri</b><br>
12040   * </p>
12041   */
12042  public static final ca.uhn.fhir.rest.gclient.UriClientParam INSTANTIATES = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_INSTANTIATES);
12043
12044 /**
12045   * Search parameter: <b>patient</b>
12046   * <p>
12047   * Description: <b>The identity of the subject of the contract (if a patient)</b><br>
12048   * Type: <b>reference</b><br>
12049   * Path: <b>Contract.subject</b><br>
12050   * </p>
12051   */
12052  @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={Patient.class } )
12053  public static final String SP_PATIENT = "patient";
12054 /**
12055   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
12056   * <p>
12057   * Description: <b>The identity of the subject of the contract (if a patient)</b><br>
12058   * Type: <b>reference</b><br>
12059   * Path: <b>Contract.subject</b><br>
12060   * </p>
12061   */
12062  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
12063
12064/**
12065   * Constant for fluent queries to be used to add include statements. Specifies
12066   * the path value of "<b>Contract:patient</b>".
12067   */
12068  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Contract:patient").toLocked();
12069
12070 /**
12071   * Search parameter: <b>subject</b>
12072   * <p>
12073   * Description: <b>The identity of the subject of the contract</b><br>
12074   * Type: <b>reference</b><br>
12075   * Path: <b>Contract.subject</b><br>
12076   * </p>
12077   */
12078  @SearchParamDefinition(name="subject", path="Contract.subject", description="The identity of the subject of the contract", type="reference" )
12079  public static final String SP_SUBJECT = "subject";
12080 /**
12081   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
12082   * <p>
12083   * Description: <b>The identity of the subject of the contract</b><br>
12084   * Type: <b>reference</b><br>
12085   * Path: <b>Contract.subject</b><br>
12086   * </p>
12087   */
12088  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
12089
12090/**
12091   * Constant for fluent queries to be used to add include statements. Specifies
12092   * the path value of "<b>Contract:subject</b>".
12093   */
12094  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Contract:subject").toLocked();
12095
12096 /**
12097   * Search parameter: <b>authority</b>
12098   * <p>
12099   * Description: <b>The authority of the contract</b><br>
12100   * Type: <b>reference</b><br>
12101   * Path: <b>Contract.authority</b><br>
12102   * </p>
12103   */
12104  @SearchParamDefinition(name="authority", path="Contract.authority", description="The authority of the contract", type="reference", target={Organization.class } )
12105  public static final String SP_AUTHORITY = "authority";
12106 /**
12107   * <b>Fluent Client</b> search parameter constant for <b>authority</b>
12108   * <p>
12109   * Description: <b>The authority of the contract</b><br>
12110   * Type: <b>reference</b><br>
12111   * Path: <b>Contract.authority</b><br>
12112   * </p>
12113   */
12114  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHORITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHORITY);
12115
12116/**
12117   * Constant for fluent queries to be used to add include statements. Specifies
12118   * the path value of "<b>Contract:authority</b>".
12119   */
12120  public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHORITY = new ca.uhn.fhir.model.api.Include("Contract:authority").toLocked();
12121
12122 /**
12123   * Search parameter: <b>domain</b>
12124   * <p>
12125   * Description: <b>The domain of the contract</b><br>
12126   * Type: <b>reference</b><br>
12127   * Path: <b>Contract.domain</b><br>
12128   * </p>
12129   */
12130  @SearchParamDefinition(name="domain", path="Contract.domain", description="The domain of the contract", type="reference", target={Location.class } )
12131  public static final String SP_DOMAIN = "domain";
12132 /**
12133   * <b>Fluent Client</b> search parameter constant for <b>domain</b>
12134   * <p>
12135   * Description: <b>The domain of the contract</b><br>
12136   * Type: <b>reference</b><br>
12137   * Path: <b>Contract.domain</b><br>
12138   * </p>
12139   */
12140  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DOMAIN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DOMAIN);
12141
12142/**
12143   * Constant for fluent queries to be used to add include statements. Specifies
12144   * the path value of "<b>Contract:domain</b>".
12145   */
12146  public static final ca.uhn.fhir.model.api.Include INCLUDE_DOMAIN = new ca.uhn.fhir.model.api.Include("Contract:domain").toLocked();
12147
12148 /**
12149   * Search parameter: <b>issued</b>
12150   * <p>
12151   * Description: <b>The date/time the contract was issued</b><br>
12152   * Type: <b>date</b><br>
12153   * Path: <b>Contract.issued</b><br>
12154   * </p>
12155   */
12156  @SearchParamDefinition(name="issued", path="Contract.issued", description="The date/time the contract was issued", type="date" )
12157  public static final String SP_ISSUED = "issued";
12158 /**
12159   * <b>Fluent Client</b> search parameter constant for <b>issued</b>
12160   * <p>
12161   * Description: <b>The date/time the contract was issued</b><br>
12162   * Type: <b>date</b><br>
12163   * Path: <b>Contract.issued</b><br>
12164   * </p>
12165   */
12166  public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED);
12167
12168 /**
12169   * Search parameter: <b>url</b>
12170   * <p>
12171   * Description: <b>The basal contract definition</b><br>
12172   * Type: <b>uri</b><br>
12173   * Path: <b>Contract.url</b><br>
12174   * </p>
12175   */
12176  @SearchParamDefinition(name="url", path="Contract.url", description="The basal contract definition", type="uri" )
12177  public static final String SP_URL = "url";
12178 /**
12179   * <b>Fluent Client</b> search parameter constant for <b>url</b>
12180   * <p>
12181   * Description: <b>The basal contract definition</b><br>
12182   * Type: <b>uri</b><br>
12183   * Path: <b>Contract.url</b><br>
12184   * </p>
12185   */
12186  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
12187
12188 /**
12189   * Search parameter: <b>signer</b>
12190   * <p>
12191   * Description: <b>Contract Signatory Party</b><br>
12192   * Type: <b>reference</b><br>
12193   * Path: <b>Contract.signer.party</b><br>
12194   * </p>
12195   */
12196  @SearchParamDefinition(name="signer", path="Contract.signer.party", description="Contract Signatory Party", type="reference", target={Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
12197  public static final String SP_SIGNER = "signer";
12198 /**
12199   * <b>Fluent Client</b> search parameter constant for <b>signer</b>
12200   * <p>
12201   * Description: <b>Contract Signatory Party</b><br>
12202   * Type: <b>reference</b><br>
12203   * Path: <b>Contract.signer.party</b><br>
12204   * </p>
12205   */
12206  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SIGNER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SIGNER);
12207
12208/**
12209   * Constant for fluent queries to be used to add include statements. Specifies
12210   * the path value of "<b>Contract:signer</b>".
12211   */
12212  public static final ca.uhn.fhir.model.api.Include INCLUDE_SIGNER = new ca.uhn.fhir.model.api.Include("Contract:signer").toLocked();
12213
12214 /**
12215   * Search parameter: <b>status</b>
12216   * <p>
12217   * Description: <b>The status of the contract</b><br>
12218   * Type: <b>token</b><br>
12219   * Path: <b>Contract.status</b><br>
12220   * </p>
12221   */
12222  @SearchParamDefinition(name="status", path="Contract.status", description="The status of the contract", type="token" )
12223  public static final String SP_STATUS = "status";
12224 /**
12225   * <b>Fluent Client</b> search parameter constant for <b>status</b>
12226   * <p>
12227   * Description: <b>The status of the contract</b><br>
12228   * Type: <b>token</b><br>
12229   * Path: <b>Contract.status</b><br>
12230   * </p>
12231   */
12232  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
12233
12234
12235}