001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034import java.util.*;
035
036import java.math.*;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r4.model.Enumerations.*;
039import ca.uhn.fhir.model.api.annotation.ResourceDef;
040import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
041import ca.uhn.fhir.model.api.annotation.Child;
042import ca.uhn.fhir.model.api.annotation.ChildOrder;
043import ca.uhn.fhir.model.api.annotation.Description;
044import ca.uhn.fhir.model.api.annotation.Block;
045import org.hl7.fhir.instance.model.api.*;
046import org.hl7.fhir.exceptions.FHIRException;
047/**
048 * A formal agreement between parties regarding the conduct of business, exchange of information or other matters.
049 */
050@ResourceDef(name="Contract", profile="http://hl7.org/fhir/Profile/Contract")
051public class Contract extends DomainResource {
052
053    public enum ContractStatus {
054        /**
055         * 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.
056         */
057        AMENDED, 
058        /**
059         * 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.
060         */
061        APPENDED, 
062        /**
063         * 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.
064         */
065        CANCELLED, 
066        /**
067         * 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.
068         */
069        DISPUTED, 
070        /**
071         * Contract was created in error. No Precedence Order.  Status may be applied to a Contract with any status.
072         */
073        ENTEREDINERROR, 
074        /**
075         * 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.
076         */
077        EXECUTABLE, 
078        /**
079         * 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.
080         */
081        EXECUTED, 
082        /**
083         * 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.
084         */
085        NEGOTIABLE, 
086        /**
087         * 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.
088         */
089        OFFERED, 
090        /**
091         * 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.
092         */
093        POLICY, 
094        /**
095         *  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.
096         */
097        REJECTED, 
098        /**
099         * 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.
100         */
101        RENEWED, 
102        /**
103         * A Contract that is rescinded.  May be required prior to replacing with an updated Contract. Comparable FHIR and v.3 status codes: nullified.
104         */
105        REVOKED, 
106        /**
107         * 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.
108         */
109        RESOLVED, 
110        /**
111         * 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.
112         */
113        TERMINATED, 
114        /**
115         * added to help the parsers with the generic types
116         */
117        NULL;
118        public static ContractStatus fromCode(String codeString) throws FHIRException {
119            if (codeString == null || "".equals(codeString))
120                return null;
121        if ("amended".equals(codeString))
122          return AMENDED;
123        if ("appended".equals(codeString))
124          return APPENDED;
125        if ("cancelled".equals(codeString))
126          return CANCELLED;
127        if ("disputed".equals(codeString))
128          return DISPUTED;
129        if ("entered-in-error".equals(codeString))
130          return ENTEREDINERROR;
131        if ("executable".equals(codeString))
132          return EXECUTABLE;
133        if ("executed".equals(codeString))
134          return EXECUTED;
135        if ("negotiable".equals(codeString))
136          return NEGOTIABLE;
137        if ("offered".equals(codeString))
138          return OFFERED;
139        if ("policy".equals(codeString))
140          return POLICY;
141        if ("rejected".equals(codeString))
142          return REJECTED;
143        if ("renewed".equals(codeString))
144          return RENEWED;
145        if ("revoked".equals(codeString))
146          return REVOKED;
147        if ("resolved".equals(codeString))
148          return RESOLVED;
149        if ("terminated".equals(codeString))
150          return TERMINATED;
151        if (Configuration.isAcceptInvalidEnums())
152          return null;
153        else
154          throw new FHIRException("Unknown ContractStatus code '"+codeString+"'");
155        }
156        public String toCode() {
157          switch (this) {
158            case AMENDED: return "amended";
159            case APPENDED: return "appended";
160            case CANCELLED: return "cancelled";
161            case DISPUTED: return "disputed";
162            case ENTEREDINERROR: return "entered-in-error";
163            case EXECUTABLE: return "executable";
164            case EXECUTED: return "executed";
165            case NEGOTIABLE: return "negotiable";
166            case OFFERED: return "offered";
167            case POLICY: return "policy";
168            case REJECTED: return "rejected";
169            case RENEWED: return "renewed";
170            case REVOKED: return "revoked";
171            case RESOLVED: return "resolved";
172            case TERMINATED: return "terminated";
173            default: return "?";
174          }
175        }
176        public String getSystem() {
177          switch (this) {
178            case AMENDED: return "http://hl7.org/fhir/contract-status";
179            case APPENDED: return "http://hl7.org/fhir/contract-status";
180            case CANCELLED: return "http://hl7.org/fhir/contract-status";
181            case DISPUTED: return "http://hl7.org/fhir/contract-status";
182            case ENTEREDINERROR: return "http://hl7.org/fhir/contract-status";
183            case EXECUTABLE: return "http://hl7.org/fhir/contract-status";
184            case EXECUTED: return "http://hl7.org/fhir/contract-status";
185            case NEGOTIABLE: return "http://hl7.org/fhir/contract-status";
186            case OFFERED: return "http://hl7.org/fhir/contract-status";
187            case POLICY: return "http://hl7.org/fhir/contract-status";
188            case REJECTED: return "http://hl7.org/fhir/contract-status";
189            case RENEWED: return "http://hl7.org/fhir/contract-status";
190            case REVOKED: return "http://hl7.org/fhir/contract-status";
191            case RESOLVED: return "http://hl7.org/fhir/contract-status";
192            case TERMINATED: return "http://hl7.org/fhir/contract-status";
193            default: return "?";
194          }
195        }
196        public String getDefinition() {
197          switch (this) {
198            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.";
199            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.";
200            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.";
201            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.";
202            case ENTEREDINERROR: return "Contract was created in error. No Precedence Order.  Status may be applied to a Contract with any status.";
203            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.";
204            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.";
205            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.";
206            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.";
207            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.";
208            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.";
209            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.";
210            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.";
211            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.";
212            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.";
213            default: return "?";
214          }
215        }
216        public String getDisplay() {
217          switch (this) {
218            case AMENDED: return "Amended";
219            case APPENDED: return "Appended";
220            case CANCELLED: return "Cancelled";
221            case DISPUTED: return "Disputed";
222            case ENTEREDINERROR: return "Entered in Error";
223            case EXECUTABLE: return "Executable";
224            case EXECUTED: return "Executed";
225            case NEGOTIABLE: return "Negotiable";
226            case OFFERED: return "Offered";
227            case POLICY: return "Policy";
228            case REJECTED: return "Rejected";
229            case RENEWED: return "Renewed";
230            case REVOKED: return "Revoked";
231            case RESOLVED: return "Resolved";
232            case TERMINATED: return "Terminated";
233            default: return "?";
234          }
235        }
236    }
237
238  public static class ContractStatusEnumFactory implements EnumFactory<ContractStatus> {
239    public ContractStatus fromCode(String codeString) throws IllegalArgumentException {
240      if (codeString == null || "".equals(codeString))
241            if (codeString == null || "".equals(codeString))
242                return null;
243        if ("amended".equals(codeString))
244          return ContractStatus.AMENDED;
245        if ("appended".equals(codeString))
246          return ContractStatus.APPENDED;
247        if ("cancelled".equals(codeString))
248          return ContractStatus.CANCELLED;
249        if ("disputed".equals(codeString))
250          return ContractStatus.DISPUTED;
251        if ("entered-in-error".equals(codeString))
252          return ContractStatus.ENTEREDINERROR;
253        if ("executable".equals(codeString))
254          return ContractStatus.EXECUTABLE;
255        if ("executed".equals(codeString))
256          return ContractStatus.EXECUTED;
257        if ("negotiable".equals(codeString))
258          return ContractStatus.NEGOTIABLE;
259        if ("offered".equals(codeString))
260          return ContractStatus.OFFERED;
261        if ("policy".equals(codeString))
262          return ContractStatus.POLICY;
263        if ("rejected".equals(codeString))
264          return ContractStatus.REJECTED;
265        if ("renewed".equals(codeString))
266          return ContractStatus.RENEWED;
267        if ("revoked".equals(codeString))
268          return ContractStatus.REVOKED;
269        if ("resolved".equals(codeString))
270          return ContractStatus.RESOLVED;
271        if ("terminated".equals(codeString))
272          return ContractStatus.TERMINATED;
273        throw new IllegalArgumentException("Unknown ContractStatus code '"+codeString+"'");
274        }
275        public Enumeration<ContractStatus> fromType(Base code) throws FHIRException {
276          if (code == null)
277            return null;
278          if (code.isEmpty())
279            return new Enumeration<ContractStatus>(this);
280          String codeString = ((PrimitiveType) code).asStringValue();
281          if (codeString == null || "".equals(codeString))
282            return null;
283        if ("amended".equals(codeString))
284          return new Enumeration<ContractStatus>(this, ContractStatus.AMENDED);
285        if ("appended".equals(codeString))
286          return new Enumeration<ContractStatus>(this, ContractStatus.APPENDED);
287        if ("cancelled".equals(codeString))
288          return new Enumeration<ContractStatus>(this, ContractStatus.CANCELLED);
289        if ("disputed".equals(codeString))
290          return new Enumeration<ContractStatus>(this, ContractStatus.DISPUTED);
291        if ("entered-in-error".equals(codeString))
292          return new Enumeration<ContractStatus>(this, ContractStatus.ENTEREDINERROR);
293        if ("executable".equals(codeString))
294          return new Enumeration<ContractStatus>(this, ContractStatus.EXECUTABLE);
295        if ("executed".equals(codeString))
296          return new Enumeration<ContractStatus>(this, ContractStatus.EXECUTED);
297        if ("negotiable".equals(codeString))
298          return new Enumeration<ContractStatus>(this, ContractStatus.NEGOTIABLE);
299        if ("offered".equals(codeString))
300          return new Enumeration<ContractStatus>(this, ContractStatus.OFFERED);
301        if ("policy".equals(codeString))
302          return new Enumeration<ContractStatus>(this, ContractStatus.POLICY);
303        if ("rejected".equals(codeString))
304          return new Enumeration<ContractStatus>(this, ContractStatus.REJECTED);
305        if ("renewed".equals(codeString))
306          return new Enumeration<ContractStatus>(this, ContractStatus.RENEWED);
307        if ("revoked".equals(codeString))
308          return new Enumeration<ContractStatus>(this, ContractStatus.REVOKED);
309        if ("resolved".equals(codeString))
310          return new Enumeration<ContractStatus>(this, ContractStatus.RESOLVED);
311        if ("terminated".equals(codeString))
312          return new Enumeration<ContractStatus>(this, ContractStatus.TERMINATED);
313        throw new FHIRException("Unknown ContractStatus code '"+codeString+"'");
314        }
315    public String toCode(ContractStatus code) {
316      if (code == ContractStatus.AMENDED)
317        return "amended";
318      if (code == ContractStatus.APPENDED)
319        return "appended";
320      if (code == ContractStatus.CANCELLED)
321        return "cancelled";
322      if (code == ContractStatus.DISPUTED)
323        return "disputed";
324      if (code == ContractStatus.ENTEREDINERROR)
325        return "entered-in-error";
326      if (code == ContractStatus.EXECUTABLE)
327        return "executable";
328      if (code == ContractStatus.EXECUTED)
329        return "executed";
330      if (code == ContractStatus.NEGOTIABLE)
331        return "negotiable";
332      if (code == ContractStatus.OFFERED)
333        return "offered";
334      if (code == ContractStatus.POLICY)
335        return "policy";
336      if (code == ContractStatus.REJECTED)
337        return "rejected";
338      if (code == ContractStatus.RENEWED)
339        return "renewed";
340      if (code == ContractStatus.REVOKED)
341        return "revoked";
342      if (code == ContractStatus.RESOLVED)
343        return "resolved";
344      if (code == ContractStatus.TERMINATED)
345        return "terminated";
346      return "?";
347      }
348    public String toSystem(ContractStatus code) {
349      return code.getSystem();
350      }
351    }
352
353    public enum ContractDataMeaning {
354        /**
355         * The consent applies directly to the instance of the resource
356         */
357        INSTANCE, 
358        /**
359         * The consent applies directly to the instance of the resource and instances it refers to
360         */
361        RELATED, 
362        /**
363         * The consent applies directly to the instance of the resource and instances that refer to it
364         */
365        DEPENDENTS, 
366        /**
367         * The consent applies to instances of resources that are authored by
368         */
369        AUTHOREDBY, 
370        /**
371         * added to help the parsers with the generic types
372         */
373        NULL;
374        public static ContractDataMeaning fromCode(String codeString) throws FHIRException {
375            if (codeString == null || "".equals(codeString))
376                return null;
377        if ("instance".equals(codeString))
378          return INSTANCE;
379        if ("related".equals(codeString))
380          return RELATED;
381        if ("dependents".equals(codeString))
382          return DEPENDENTS;
383        if ("authoredby".equals(codeString))
384          return AUTHOREDBY;
385        if (Configuration.isAcceptInvalidEnums())
386          return null;
387        else
388          throw new FHIRException("Unknown ContractDataMeaning code '"+codeString+"'");
389        }
390        public String toCode() {
391          switch (this) {
392            case INSTANCE: return "instance";
393            case RELATED: return "related";
394            case DEPENDENTS: return "dependents";
395            case AUTHOREDBY: return "authoredby";
396            default: return "?";
397          }
398        }
399        public String getSystem() {
400          switch (this) {
401            case INSTANCE: return "http://hl7.org/fhir/contract-data-meaning";
402            case RELATED: return "http://hl7.org/fhir/contract-data-meaning";
403            case DEPENDENTS: return "http://hl7.org/fhir/contract-data-meaning";
404            case AUTHOREDBY: return "http://hl7.org/fhir/contract-data-meaning";
405            default: return "?";
406          }
407        }
408        public String getDefinition() {
409          switch (this) {
410            case INSTANCE: return "The consent applies directly to the instance of the resource";
411            case RELATED: return "The consent applies directly to the instance of the resource and instances it refers to";
412            case DEPENDENTS: return "The consent applies directly to the instance of the resource and instances that refer to it";
413            case AUTHOREDBY: return "The consent applies to instances of resources that are authored by";
414            default: return "?";
415          }
416        }
417        public String getDisplay() {
418          switch (this) {
419            case INSTANCE: return "Instance";
420            case RELATED: return "Related";
421            case DEPENDENTS: return "Dependents";
422            case AUTHOREDBY: return "AuthoredBy";
423            default: return "?";
424          }
425        }
426    }
427
428  public static class ContractDataMeaningEnumFactory implements EnumFactory<ContractDataMeaning> {
429    public ContractDataMeaning fromCode(String codeString) throws IllegalArgumentException {
430      if (codeString == null || "".equals(codeString))
431            if (codeString == null || "".equals(codeString))
432                return null;
433        if ("instance".equals(codeString))
434          return ContractDataMeaning.INSTANCE;
435        if ("related".equals(codeString))
436          return ContractDataMeaning.RELATED;
437        if ("dependents".equals(codeString))
438          return ContractDataMeaning.DEPENDENTS;
439        if ("authoredby".equals(codeString))
440          return ContractDataMeaning.AUTHOREDBY;
441        throw new IllegalArgumentException("Unknown ContractDataMeaning code '"+codeString+"'");
442        }
443        public Enumeration<ContractDataMeaning> fromType(Base code) throws FHIRException {
444          if (code == null)
445            return null;
446          if (code.isEmpty())
447            return new Enumeration<ContractDataMeaning>(this);
448          String codeString = ((PrimitiveType) code).asStringValue();
449          if (codeString == null || "".equals(codeString))
450            return null;
451        if ("instance".equals(codeString))
452          return new Enumeration<ContractDataMeaning>(this, ContractDataMeaning.INSTANCE);
453        if ("related".equals(codeString))
454          return new Enumeration<ContractDataMeaning>(this, ContractDataMeaning.RELATED);
455        if ("dependents".equals(codeString))
456          return new Enumeration<ContractDataMeaning>(this, ContractDataMeaning.DEPENDENTS);
457        if ("authoredby".equals(codeString))
458          return new Enumeration<ContractDataMeaning>(this, ContractDataMeaning.AUTHOREDBY);
459        throw new FHIRException("Unknown ContractDataMeaning code '"+codeString+"'");
460        }
461    public String toCode(ContractDataMeaning code) {
462      if (code == ContractDataMeaning.INSTANCE)
463        return "instance";
464      if (code == ContractDataMeaning.RELATED)
465        return "related";
466      if (code == ContractDataMeaning.DEPENDENTS)
467        return "dependents";
468      if (code == ContractDataMeaning.AUTHOREDBY)
469        return "authoredby";
470      return "?";
471      }
472    public String toSystem(ContractDataMeaning code) {
473      return code.getSystem();
474      }
475    }
476
477    @Block()
478    public static class TermComponent extends BackboneElement implements IBaseBackboneElement {
479        /**
480         * Unique identifier for this particular Contract Provision.
481         */
482        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true)
483        @Description(shortDefinition="Contract Term Number", formalDefinition="Unique identifier for this particular Contract Provision." )
484        protected Identifier identifier;
485
486        /**
487         * When this Contract Provision was issued.
488         */
489        @Child(name = "issued", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
490        @Description(shortDefinition="Contract Term Issue Date Time", formalDefinition="When this Contract Provision was issued." )
491        protected DateTimeType issued;
492
493        /**
494         * Relevant time or time-period when this Contract Provision is applicable.
495         */
496        @Child(name = "applies", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true)
497        @Description(shortDefinition="Contract Term Effective Time", formalDefinition="Relevant time or time-period when this Contract Provision is applicable." )
498        protected Period applies;
499
500        /**
501         * Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.
502         */
503        @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
504        @Description(shortDefinition="Contract Term Type or Form", formalDefinition="Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit." )
505        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-term-type")
506        protected CodeableConcept type;
507
508        /**
509         * Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment.
510         */
511        @Child(name = "subType", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false)
512        @Description(shortDefinition="Contract Term Type specific classification", formalDefinition="Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment." )
513        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-term-subtype")
514        protected CodeableConcept subType;
515
516        /**
517         * The matter of concern in the context of this provision of the agrement.
518         */
519        @Child(name = "offer", type = {}, order=6, min=1, max=1, modifier=false, summary=false)
520        @Description(shortDefinition="Context of the Contract term", formalDefinition="The matter of concern in the context of this provision of the agrement." )
521        protected ContractOfferComponent offer;
522
523        /**
524         * Contract Term Asset List.
525         */
526        @Child(name = "asset", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
527        @Description(shortDefinition="Contract Term Asset List", formalDefinition="Contract Term Asset List." )
528        protected List<ContractAssetComponent> asset;
529
530        /**
531         * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.
532         */
533        @Child(name = "agent", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
534        @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." )
535        protected List<AgentComponent> agent;
536
537        /**
538         * Action stipulated by this Contract Provision.
539         */
540        @Child(name = "action", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
541        @Description(shortDefinition="Contract Term Activity", formalDefinition="Action stipulated by this Contract Provision." )
542        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-action")
543        protected List<CodeableConcept> action;
544
545        /**
546         * Reason or purpose for the action stipulated by this Contract Provision.
547         */
548        @Child(name = "actionReason", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
549        @Description(shortDefinition="Purpose for the Contract Term Action", formalDefinition="Reason or purpose for the action stipulated by this Contract Provision." )
550        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-PurposeOfUse")
551        protected List<CodeableConcept> actionReason;
552
553        /**
554         * Nested group of Contract Provisions.
555         */
556        @Child(name = "group", type = {TermComponent.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
557        @Description(shortDefinition="Nested Contract Term Group", formalDefinition="Nested group of Contract Provisions." )
558        protected List<TermComponent> group;
559
560        private static final long serialVersionUID = 1344727862L;
561
562    /**
563     * Constructor
564     */
565      public TermComponent() {
566        super();
567      }
568
569    /**
570     * Constructor
571     */
572      public TermComponent(ContractOfferComponent offer) {
573        super();
574        this.offer = offer;
575      }
576
577        /**
578         * @return {@link #identifier} (Unique identifier for this particular Contract Provision.)
579         */
580        public Identifier getIdentifier() { 
581          if (this.identifier == null)
582            if (Configuration.errorOnAutoCreate())
583              throw new Error("Attempt to auto-create TermComponent.identifier");
584            else if (Configuration.doAutoCreate())
585              this.identifier = new Identifier(); // cc
586          return this.identifier;
587        }
588
589        public boolean hasIdentifier() { 
590          return this.identifier != null && !this.identifier.isEmpty();
591        }
592
593        /**
594         * @param value {@link #identifier} (Unique identifier for this particular Contract Provision.)
595         */
596        public TermComponent setIdentifier(Identifier value) { 
597          this.identifier = value;
598          return this;
599        }
600
601        /**
602         * @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
603         */
604        public DateTimeType getIssuedElement() { 
605          if (this.issued == null)
606            if (Configuration.errorOnAutoCreate())
607              throw new Error("Attempt to auto-create TermComponent.issued");
608            else if (Configuration.doAutoCreate())
609              this.issued = new DateTimeType(); // bb
610          return this.issued;
611        }
612
613        public boolean hasIssuedElement() { 
614          return this.issued != null && !this.issued.isEmpty();
615        }
616
617        public boolean hasIssued() { 
618          return this.issued != null && !this.issued.isEmpty();
619        }
620
621        /**
622         * @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
623         */
624        public TermComponent setIssuedElement(DateTimeType value) { 
625          this.issued = value;
626          return this;
627        }
628
629        /**
630         * @return When this Contract Provision was issued.
631         */
632        public Date getIssued() { 
633          return this.issued == null ? null : this.issued.getValue();
634        }
635
636        /**
637         * @param value When this Contract Provision was issued.
638         */
639        public TermComponent setIssued(Date value) { 
640          if (value == null)
641            this.issued = null;
642          else {
643            if (this.issued == null)
644              this.issued = new DateTimeType();
645            this.issued.setValue(value);
646          }
647          return this;
648        }
649
650        /**
651         * @return {@link #applies} (Relevant time or time-period when this Contract Provision is applicable.)
652         */
653        public Period getApplies() { 
654          if (this.applies == null)
655            if (Configuration.errorOnAutoCreate())
656              throw new Error("Attempt to auto-create TermComponent.applies");
657            else if (Configuration.doAutoCreate())
658              this.applies = new Period(); // cc
659          return this.applies;
660        }
661
662        public boolean hasApplies() { 
663          return this.applies != null && !this.applies.isEmpty();
664        }
665
666        /**
667         * @param value {@link #applies} (Relevant time or time-period when this Contract Provision is applicable.)
668         */
669        public TermComponent setApplies(Period value) { 
670          this.applies = value;
671          return this;
672        }
673
674        /**
675         * @return {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.)
676         */
677        public CodeableConcept getType() { 
678          if (this.type == null)
679            if (Configuration.errorOnAutoCreate())
680              throw new Error("Attempt to auto-create TermComponent.type");
681            else if (Configuration.doAutoCreate())
682              this.type = new CodeableConcept(); // cc
683          return this.type;
684        }
685
686        public boolean hasType() { 
687          return this.type != null && !this.type.isEmpty();
688        }
689
690        /**
691         * @param value {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.)
692         */
693        public TermComponent setType(CodeableConcept value) { 
694          this.type = value;
695          return this;
696        }
697
698        /**
699         * @return {@link #subType} (Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment.)
700         */
701        public CodeableConcept getSubType() { 
702          if (this.subType == null)
703            if (Configuration.errorOnAutoCreate())
704              throw new Error("Attempt to auto-create TermComponent.subType");
705            else if (Configuration.doAutoCreate())
706              this.subType = new CodeableConcept(); // cc
707          return this.subType;
708        }
709
710        public boolean hasSubType() { 
711          return this.subType != null && !this.subType.isEmpty();
712        }
713
714        /**
715         * @param value {@link #subType} (Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment.)
716         */
717        public TermComponent setSubType(CodeableConcept value) { 
718          this.subType = value;
719          return this;
720        }
721
722        /**
723         * @return {@link #offer} (The matter of concern in the context of this provision of the agrement.)
724         */
725        public ContractOfferComponent getOffer() { 
726          if (this.offer == null)
727            if (Configuration.errorOnAutoCreate())
728              throw new Error("Attempt to auto-create TermComponent.offer");
729            else if (Configuration.doAutoCreate())
730              this.offer = new ContractOfferComponent(); // cc
731          return this.offer;
732        }
733
734        public boolean hasOffer() { 
735          return this.offer != null && !this.offer.isEmpty();
736        }
737
738        /**
739         * @param value {@link #offer} (The matter of concern in the context of this provision of the agrement.)
740         */
741        public TermComponent setOffer(ContractOfferComponent value) { 
742          this.offer = value;
743          return this;
744        }
745
746        /**
747         * @return {@link #asset} (Contract Term Asset List.)
748         */
749        public List<ContractAssetComponent> getAsset() { 
750          if (this.asset == null)
751            this.asset = new ArrayList<ContractAssetComponent>();
752          return this.asset;
753        }
754
755        /**
756         * @return Returns a reference to <code>this</code> for easy method chaining
757         */
758        public TermComponent setAsset(List<ContractAssetComponent> theAsset) { 
759          this.asset = theAsset;
760          return this;
761        }
762
763        public boolean hasAsset() { 
764          if (this.asset == null)
765            return false;
766          for (ContractAssetComponent item : this.asset)
767            if (!item.isEmpty())
768              return true;
769          return false;
770        }
771
772        public ContractAssetComponent addAsset() { //3
773          ContractAssetComponent t = new ContractAssetComponent();
774          if (this.asset == null)
775            this.asset = new ArrayList<ContractAssetComponent>();
776          this.asset.add(t);
777          return t;
778        }
779
780        public TermComponent addAsset(ContractAssetComponent t) { //3
781          if (t == null)
782            return this;
783          if (this.asset == null)
784            this.asset = new ArrayList<ContractAssetComponent>();
785          this.asset.add(t);
786          return this;
787        }
788
789        /**
790         * @return The first repetition of repeating field {@link #asset}, creating it if it does not already exist
791         */
792        public ContractAssetComponent getAssetFirstRep() { 
793          if (getAsset().isEmpty()) {
794            addAsset();
795          }
796          return getAsset().get(0);
797        }
798
799        /**
800         * @return {@link #agent} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.)
801         */
802        public List<AgentComponent> getAgent() { 
803          if (this.agent == null)
804            this.agent = new ArrayList<AgentComponent>();
805          return this.agent;
806        }
807
808        /**
809         * @return Returns a reference to <code>this</code> for easy method chaining
810         */
811        public TermComponent setAgent(List<AgentComponent> theAgent) { 
812          this.agent = theAgent;
813          return this;
814        }
815
816        public boolean hasAgent() { 
817          if (this.agent == null)
818            return false;
819          for (AgentComponent item : this.agent)
820            if (!item.isEmpty())
821              return true;
822          return false;
823        }
824
825        public AgentComponent addAgent() { //3
826          AgentComponent t = new AgentComponent();
827          if (this.agent == null)
828            this.agent = new ArrayList<AgentComponent>();
829          this.agent.add(t);
830          return t;
831        }
832
833        public TermComponent addAgent(AgentComponent t) { //3
834          if (t == null)
835            return this;
836          if (this.agent == null)
837            this.agent = new ArrayList<AgentComponent>();
838          this.agent.add(t);
839          return this;
840        }
841
842        /**
843         * @return The first repetition of repeating field {@link #agent}, creating it if it does not already exist
844         */
845        public AgentComponent getAgentFirstRep() { 
846          if (getAgent().isEmpty()) {
847            addAgent();
848          }
849          return getAgent().get(0);
850        }
851
852        /**
853         * @return {@link #action} (Action stipulated by this Contract Provision.)
854         */
855        public List<CodeableConcept> getAction() { 
856          if (this.action == null)
857            this.action = new ArrayList<CodeableConcept>();
858          return this.action;
859        }
860
861        /**
862         * @return Returns a reference to <code>this</code> for easy method chaining
863         */
864        public TermComponent setAction(List<CodeableConcept> theAction) { 
865          this.action = theAction;
866          return this;
867        }
868
869        public boolean hasAction() { 
870          if (this.action == null)
871            return false;
872          for (CodeableConcept item : this.action)
873            if (!item.isEmpty())
874              return true;
875          return false;
876        }
877
878        public CodeableConcept addAction() { //3
879          CodeableConcept t = new CodeableConcept();
880          if (this.action == null)
881            this.action = new ArrayList<CodeableConcept>();
882          this.action.add(t);
883          return t;
884        }
885
886        public TermComponent addAction(CodeableConcept t) { //3
887          if (t == null)
888            return this;
889          if (this.action == null)
890            this.action = new ArrayList<CodeableConcept>();
891          this.action.add(t);
892          return this;
893        }
894
895        /**
896         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist
897         */
898        public CodeableConcept getActionFirstRep() { 
899          if (getAction().isEmpty()) {
900            addAction();
901          }
902          return getAction().get(0);
903        }
904
905        /**
906         * @return {@link #actionReason} (Reason or purpose for the action stipulated by this Contract Provision.)
907         */
908        public List<CodeableConcept> getActionReason() { 
909          if (this.actionReason == null)
910            this.actionReason = new ArrayList<CodeableConcept>();
911          return this.actionReason;
912        }
913
914        /**
915         * @return Returns a reference to <code>this</code> for easy method chaining
916         */
917        public TermComponent setActionReason(List<CodeableConcept> theActionReason) { 
918          this.actionReason = theActionReason;
919          return this;
920        }
921
922        public boolean hasActionReason() { 
923          if (this.actionReason == null)
924            return false;
925          for (CodeableConcept item : this.actionReason)
926            if (!item.isEmpty())
927              return true;
928          return false;
929        }
930
931        public CodeableConcept addActionReason() { //3
932          CodeableConcept t = new CodeableConcept();
933          if (this.actionReason == null)
934            this.actionReason = new ArrayList<CodeableConcept>();
935          this.actionReason.add(t);
936          return t;
937        }
938
939        public TermComponent addActionReason(CodeableConcept t) { //3
940          if (t == null)
941            return this;
942          if (this.actionReason == null)
943            this.actionReason = new ArrayList<CodeableConcept>();
944          this.actionReason.add(t);
945          return this;
946        }
947
948        /**
949         * @return The first repetition of repeating field {@link #actionReason}, creating it if it does not already exist
950         */
951        public CodeableConcept getActionReasonFirstRep() { 
952          if (getActionReason().isEmpty()) {
953            addActionReason();
954          }
955          return getActionReason().get(0);
956        }
957
958        /**
959         * @return {@link #group} (Nested group of Contract Provisions.)
960         */
961        public List<TermComponent> getGroup() { 
962          if (this.group == null)
963            this.group = new ArrayList<TermComponent>();
964          return this.group;
965        }
966
967        /**
968         * @return Returns a reference to <code>this</code> for easy method chaining
969         */
970        public TermComponent setGroup(List<TermComponent> theGroup) { 
971          this.group = theGroup;
972          return this;
973        }
974
975        public boolean hasGroup() { 
976          if (this.group == null)
977            return false;
978          for (TermComponent item : this.group)
979            if (!item.isEmpty())
980              return true;
981          return false;
982        }
983
984        public TermComponent addGroup() { //3
985          TermComponent t = new TermComponent();
986          if (this.group == null)
987            this.group = new ArrayList<TermComponent>();
988          this.group.add(t);
989          return t;
990        }
991
992        public TermComponent addGroup(TermComponent t) { //3
993          if (t == null)
994            return this;
995          if (this.group == null)
996            this.group = new ArrayList<TermComponent>();
997          this.group.add(t);
998          return this;
999        }
1000
1001        /**
1002         * @return The first repetition of repeating field {@link #group}, creating it if it does not already exist
1003         */
1004        public TermComponent getGroupFirstRep() { 
1005          if (getGroup().isEmpty()) {
1006            addGroup();
1007          }
1008          return getGroup().get(0);
1009        }
1010
1011        protected void listChildren(List<Property> children) {
1012          super.listChildren(children);
1013          children.add(new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, 1, identifier));
1014          children.add(new Property("issued", "dateTime", "When this Contract Provision was issued.", 0, 1, issued));
1015          children.add(new Property("applies", "Period", "Relevant time or time-period when this Contract Provision is applicable.", 0, 1, applies));
1016          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));
1017          children.add(new Property("subType", "CodeableConcept", "Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment.", 0, 1, subType));
1018          children.add(new Property("offer", "", "The matter of concern in the context of this provision of the agrement.", 0, 1, offer));
1019          children.add(new Property("asset", "", "Contract Term Asset List.", 0, java.lang.Integer.MAX_VALUE, asset));
1020          children.add(new Property("agent", "", "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, agent));
1021          children.add(new Property("action", "CodeableConcept", "Action stipulated by this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, action));
1022          children.add(new Property("actionReason", "CodeableConcept", "Reason or purpose for the action stipulated by this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, actionReason));
1023          children.add(new Property("group", "@Contract.term", "Nested group of Contract Provisions.", 0, java.lang.Integer.MAX_VALUE, group));
1024        }
1025
1026        @Override
1027        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1028          switch (_hash) {
1029          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, 1, identifier);
1030          case -1179159893: /*issued*/  return new Property("issued", "dateTime", "When this Contract Provision was issued.", 0, 1, issued);
1031          case -793235316: /*applies*/  return new Property("applies", "Period", "Relevant time or time-period when this Contract Provision is applicable.", 0, 1, applies);
1032          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);
1033          case -1868521062: /*subType*/  return new Property("subType", "CodeableConcept", "Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment.", 0, 1, subType);
1034          case 105650780: /*offer*/  return new Property("offer", "", "The matter of concern in the context of this provision of the agrement.", 0, 1, offer);
1035          case 93121264: /*asset*/  return new Property("asset", "", "Contract Term Asset List.", 0, java.lang.Integer.MAX_VALUE, asset);
1036          case 92750597: /*agent*/  return new Property("agent", "", "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, agent);
1037          case -1422950858: /*action*/  return new Property("action", "CodeableConcept", "Action stipulated by this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, action);
1038          case 1465121818: /*actionReason*/  return new Property("actionReason", "CodeableConcept", "Reason or purpose for the action stipulated by this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, actionReason);
1039          case 98629247: /*group*/  return new Property("group", "@Contract.term", "Nested group of Contract Provisions.", 0, java.lang.Integer.MAX_VALUE, group);
1040          default: return super.getNamedProperty(_hash, _name, _checkValid);
1041          }
1042
1043        }
1044
1045      @Override
1046      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1047        switch (hash) {
1048        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
1049        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType
1050        case -793235316: /*applies*/ return this.applies == null ? new Base[0] : new Base[] {this.applies}; // Period
1051        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1052        case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : new Base[] {this.subType}; // CodeableConcept
1053        case 105650780: /*offer*/ return this.offer == null ? new Base[0] : new Base[] {this.offer}; // ContractOfferComponent
1054        case 93121264: /*asset*/ return this.asset == null ? new Base[0] : this.asset.toArray(new Base[this.asset.size()]); // ContractAssetComponent
1055        case 92750597: /*agent*/ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // AgentComponent
1056        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // CodeableConcept
1057        case 1465121818: /*actionReason*/ return this.actionReason == null ? new Base[0] : this.actionReason.toArray(new Base[this.actionReason.size()]); // CodeableConcept
1058        case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // TermComponent
1059        default: return super.getProperty(hash, name, checkValid);
1060        }
1061
1062      }
1063
1064      @Override
1065      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1066        switch (hash) {
1067        case -1618432855: // identifier
1068          this.identifier = castToIdentifier(value); // Identifier
1069          return value;
1070        case -1179159893: // issued
1071          this.issued = castToDateTime(value); // DateTimeType
1072          return value;
1073        case -793235316: // applies
1074          this.applies = castToPeriod(value); // Period
1075          return value;
1076        case 3575610: // type
1077          this.type = castToCodeableConcept(value); // CodeableConcept
1078          return value;
1079        case -1868521062: // subType
1080          this.subType = castToCodeableConcept(value); // CodeableConcept
1081          return value;
1082        case 105650780: // offer
1083          this.offer = (ContractOfferComponent) value; // ContractOfferComponent
1084          return value;
1085        case 93121264: // asset
1086          this.getAsset().add((ContractAssetComponent) value); // ContractAssetComponent
1087          return value;
1088        case 92750597: // agent
1089          this.getAgent().add((AgentComponent) value); // AgentComponent
1090          return value;
1091        case -1422950858: // action
1092          this.getAction().add(castToCodeableConcept(value)); // CodeableConcept
1093          return value;
1094        case 1465121818: // actionReason
1095          this.getActionReason().add(castToCodeableConcept(value)); // CodeableConcept
1096          return value;
1097        case 98629247: // group
1098          this.getGroup().add((TermComponent) value); // TermComponent
1099          return value;
1100        default: return super.setProperty(hash, name, value);
1101        }
1102
1103      }
1104
1105      @Override
1106      public Base setProperty(String name, Base value) throws FHIRException {
1107        if (name.equals("identifier")) {
1108          this.identifier = castToIdentifier(value); // Identifier
1109        } else if (name.equals("issued")) {
1110          this.issued = castToDateTime(value); // DateTimeType
1111        } else if (name.equals("applies")) {
1112          this.applies = castToPeriod(value); // Period
1113        } else if (name.equals("type")) {
1114          this.type = castToCodeableConcept(value); // CodeableConcept
1115        } else if (name.equals("subType")) {
1116          this.subType = castToCodeableConcept(value); // CodeableConcept
1117        } else if (name.equals("offer")) {
1118          this.offer = (ContractOfferComponent) value; // ContractOfferComponent
1119        } else if (name.equals("asset")) {
1120          this.getAsset().add((ContractAssetComponent) value);
1121        } else if (name.equals("agent")) {
1122          this.getAgent().add((AgentComponent) value);
1123        } else if (name.equals("action")) {
1124          this.getAction().add(castToCodeableConcept(value));
1125        } else if (name.equals("actionReason")) {
1126          this.getActionReason().add(castToCodeableConcept(value));
1127        } else if (name.equals("group")) {
1128          this.getGroup().add((TermComponent) value);
1129        } else
1130          return super.setProperty(name, value);
1131        return value;
1132      }
1133
1134      @Override
1135      public Base makeProperty(int hash, String name) throws FHIRException {
1136        switch (hash) {
1137        case -1618432855:  return getIdentifier(); 
1138        case -1179159893:  return getIssuedElement();
1139        case -793235316:  return getApplies(); 
1140        case 3575610:  return getType(); 
1141        case -1868521062:  return getSubType(); 
1142        case 105650780:  return getOffer(); 
1143        case 93121264:  return addAsset(); 
1144        case 92750597:  return addAgent(); 
1145        case -1422950858:  return addAction(); 
1146        case 1465121818:  return addActionReason(); 
1147        case 98629247:  return addGroup(); 
1148        default: return super.makeProperty(hash, name);
1149        }
1150
1151      }
1152
1153      @Override
1154      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1155        switch (hash) {
1156        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1157        case -1179159893: /*issued*/ return new String[] {"dateTime"};
1158        case -793235316: /*applies*/ return new String[] {"Period"};
1159        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1160        case -1868521062: /*subType*/ return new String[] {"CodeableConcept"};
1161        case 105650780: /*offer*/ return new String[] {};
1162        case 93121264: /*asset*/ return new String[] {};
1163        case 92750597: /*agent*/ return new String[] {};
1164        case -1422950858: /*action*/ return new String[] {"CodeableConcept"};
1165        case 1465121818: /*actionReason*/ return new String[] {"CodeableConcept"};
1166        case 98629247: /*group*/ return new String[] {"@Contract.term"};
1167        default: return super.getTypesForProperty(hash, name);
1168        }
1169
1170      }
1171
1172      @Override
1173      public Base addChild(String name) throws FHIRException {
1174        if (name.equals("identifier")) {
1175          this.identifier = new Identifier();
1176          return this.identifier;
1177        }
1178        else if (name.equals("issued")) {
1179          throw new FHIRException("Cannot call addChild on a primitive type Contract.issued");
1180        }
1181        else if (name.equals("applies")) {
1182          this.applies = new Period();
1183          return this.applies;
1184        }
1185        else if (name.equals("type")) {
1186          this.type = new CodeableConcept();
1187          return this.type;
1188        }
1189        else if (name.equals("subType")) {
1190          this.subType = new CodeableConcept();
1191          return this.subType;
1192        }
1193        else if (name.equals("offer")) {
1194          this.offer = new ContractOfferComponent();
1195          return this.offer;
1196        }
1197        else if (name.equals("asset")) {
1198          return addAsset();
1199        }
1200        else if (name.equals("agent")) {
1201          return addAgent();
1202        }
1203        else if (name.equals("action")) {
1204          return addAction();
1205        }
1206        else if (name.equals("actionReason")) {
1207          return addActionReason();
1208        }
1209        else if (name.equals("group")) {
1210          return addGroup();
1211        }
1212        else
1213          return super.addChild(name);
1214      }
1215
1216      public TermComponent copy() {
1217        TermComponent dst = new TermComponent();
1218        copyValues(dst);
1219        dst.identifier = identifier == null ? null : identifier.copy();
1220        dst.issued = issued == null ? null : issued.copy();
1221        dst.applies = applies == null ? null : applies.copy();
1222        dst.type = type == null ? null : type.copy();
1223        dst.subType = subType == null ? null : subType.copy();
1224        dst.offer = offer == null ? null : offer.copy();
1225        if (asset != null) {
1226          dst.asset = new ArrayList<ContractAssetComponent>();
1227          for (ContractAssetComponent i : asset)
1228            dst.asset.add(i.copy());
1229        };
1230        if (agent != null) {
1231          dst.agent = new ArrayList<AgentComponent>();
1232          for (AgentComponent i : agent)
1233            dst.agent.add(i.copy());
1234        };
1235        if (action != null) {
1236          dst.action = new ArrayList<CodeableConcept>();
1237          for (CodeableConcept i : action)
1238            dst.action.add(i.copy());
1239        };
1240        if (actionReason != null) {
1241          dst.actionReason = new ArrayList<CodeableConcept>();
1242          for (CodeableConcept i : actionReason)
1243            dst.actionReason.add(i.copy());
1244        };
1245        if (group != null) {
1246          dst.group = new ArrayList<TermComponent>();
1247          for (TermComponent i : group)
1248            dst.group.add(i.copy());
1249        };
1250        return dst;
1251      }
1252
1253      @Override
1254      public boolean equalsDeep(Base other_) {
1255        if (!super.equalsDeep(other_))
1256          return false;
1257        if (!(other_ instanceof TermComponent))
1258          return false;
1259        TermComponent o = (TermComponent) other_;
1260        return compareDeep(identifier, o.identifier, true) && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true)
1261           && compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) && compareDeep(offer, o.offer, true)
1262           && compareDeep(asset, o.asset, true) && compareDeep(agent, o.agent, true) && compareDeep(action, o.action, true)
1263           && compareDeep(actionReason, o.actionReason, true) && compareDeep(group, o.group, true);
1264      }
1265
1266      @Override
1267      public boolean equalsShallow(Base other_) {
1268        if (!super.equalsShallow(other_))
1269          return false;
1270        if (!(other_ instanceof TermComponent))
1271          return false;
1272        TermComponent o = (TermComponent) other_;
1273        return compareValues(issued, o.issued, true);
1274      }
1275
1276      public boolean isEmpty() {
1277        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, issued, applies
1278          , type, subType, offer, asset, agent, action, actionReason, group);
1279      }
1280
1281  public String fhirType() {
1282    return "Contract.term";
1283
1284  }
1285
1286  }
1287
1288    @Block()
1289    public static class ContractOfferComponent extends BackboneElement implements IBaseBackboneElement {
1290        /**
1291         * 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).
1292         */
1293        @Child(name = "topic", type = {Reference.class}, order=1, min=0, max=1, modifier=false, summary=true)
1294        @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)." )
1295        protected Reference topic;
1296
1297        /**
1298         * 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).)
1299         */
1300        protected Resource topicTarget;
1301
1302        /**
1303         * Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.
1304         */
1305        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
1306        @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." )
1307        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-term-type")
1308        protected CodeableConcept type;
1309
1310        /**
1311         * The type of decision made by a grantor with respect to an offer made by a grantee.
1312         */
1313        @Child(name = "decision", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
1314        @Description(shortDefinition="Decision by Grantor", formalDefinition="The type of decision made by a grantor with respect to an offer made by a grantee." )
1315        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-ActConsentDirective")
1316        protected CodeableConcept decision;
1317
1318        /**
1319         * Human readable form of this Contract Offer.
1320         */
1321        @Child(name = "text", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
1322        @Description(shortDefinition="Human readable offer text", formalDefinition="Human readable form of this Contract Offer." )
1323        protected StringType text;
1324
1325        /**
1326         * The id of the clause or question text of the offer in the referenced questionnaire/response.
1327         */
1328        @Child(name = "linkId", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
1329        @Description(shortDefinition="Pointer to text", formalDefinition="The id of the clause or question text of the offer in the referenced questionnaire/response." )
1330        protected StringType linkId;
1331
1332        private static final long serialVersionUID = 1062084590L;
1333
1334    /**
1335     * Constructor
1336     */
1337      public ContractOfferComponent() {
1338        super();
1339      }
1340
1341        /**
1342         * @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).)
1343         */
1344        public Reference getTopic() { 
1345          if (this.topic == null)
1346            if (Configuration.errorOnAutoCreate())
1347              throw new Error("Attempt to auto-create ContractOfferComponent.topic");
1348            else if (Configuration.doAutoCreate())
1349              this.topic = new Reference(); // cc
1350          return this.topic;
1351        }
1352
1353        public boolean hasTopic() { 
1354          return this.topic != null && !this.topic.isEmpty();
1355        }
1356
1357        /**
1358         * @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).)
1359         */
1360        public ContractOfferComponent setTopic(Reference value) { 
1361          this.topic = value;
1362          return this;
1363        }
1364
1365        /**
1366         * @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).)
1367         */
1368        public Resource getTopicTarget() { 
1369          return this.topicTarget;
1370        }
1371
1372        /**
1373         * @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).)
1374         */
1375        public ContractOfferComponent setTopicTarget(Resource value) { 
1376          this.topicTarget = value;
1377          return this;
1378        }
1379
1380        /**
1381         * @return {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.)
1382         */
1383        public CodeableConcept getType() { 
1384          if (this.type == null)
1385            if (Configuration.errorOnAutoCreate())
1386              throw new Error("Attempt to auto-create ContractOfferComponent.type");
1387            else if (Configuration.doAutoCreate())
1388              this.type = new CodeableConcept(); // cc
1389          return this.type;
1390        }
1391
1392        public boolean hasType() { 
1393          return this.type != null && !this.type.isEmpty();
1394        }
1395
1396        /**
1397         * @param value {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.)
1398         */
1399        public ContractOfferComponent setType(CodeableConcept value) { 
1400          this.type = value;
1401          return this;
1402        }
1403
1404        /**
1405         * @return {@link #decision} (The type of decision made by a grantor with respect to an offer made by a grantee.)
1406         */
1407        public CodeableConcept getDecision() { 
1408          if (this.decision == null)
1409            if (Configuration.errorOnAutoCreate())
1410              throw new Error("Attempt to auto-create ContractOfferComponent.decision");
1411            else if (Configuration.doAutoCreate())
1412              this.decision = new CodeableConcept(); // cc
1413          return this.decision;
1414        }
1415
1416        public boolean hasDecision() { 
1417          return this.decision != null && !this.decision.isEmpty();
1418        }
1419
1420        /**
1421         * @param value {@link #decision} (The type of decision made by a grantor with respect to an offer made by a grantee.)
1422         */
1423        public ContractOfferComponent setDecision(CodeableConcept value) { 
1424          this.decision = value;
1425          return this;
1426        }
1427
1428        /**
1429         * @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
1430         */
1431        public StringType getTextElement() { 
1432          if (this.text == null)
1433            if (Configuration.errorOnAutoCreate())
1434              throw new Error("Attempt to auto-create ContractOfferComponent.text");
1435            else if (Configuration.doAutoCreate())
1436              this.text = new StringType(); // bb
1437          return this.text;
1438        }
1439
1440        public boolean hasTextElement() { 
1441          return this.text != null && !this.text.isEmpty();
1442        }
1443
1444        public boolean hasText() { 
1445          return this.text != null && !this.text.isEmpty();
1446        }
1447
1448        /**
1449         * @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
1450         */
1451        public ContractOfferComponent setTextElement(StringType value) { 
1452          this.text = value;
1453          return this;
1454        }
1455
1456        /**
1457         * @return Human readable form of this Contract Offer.
1458         */
1459        public String getText() { 
1460          return this.text == null ? null : this.text.getValue();
1461        }
1462
1463        /**
1464         * @param value Human readable form of this Contract Offer.
1465         */
1466        public ContractOfferComponent setText(String value) { 
1467          if (Utilities.noString(value))
1468            this.text = null;
1469          else {
1470            if (this.text == null)
1471              this.text = new StringType();
1472            this.text.setValue(value);
1473          }
1474          return this;
1475        }
1476
1477        /**
1478         * @return {@link #linkId} (The id of the clause or question text of the offer in the referenced questionnaire/response.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value
1479         */
1480        public StringType getLinkIdElement() { 
1481          if (this.linkId == null)
1482            if (Configuration.errorOnAutoCreate())
1483              throw new Error("Attempt to auto-create ContractOfferComponent.linkId");
1484            else if (Configuration.doAutoCreate())
1485              this.linkId = new StringType(); // bb
1486          return this.linkId;
1487        }
1488
1489        public boolean hasLinkIdElement() { 
1490          return this.linkId != null && !this.linkId.isEmpty();
1491        }
1492
1493        public boolean hasLinkId() { 
1494          return this.linkId != null && !this.linkId.isEmpty();
1495        }
1496
1497        /**
1498         * @param value {@link #linkId} (The id of the clause or question text of the offer in the referenced questionnaire/response.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value
1499         */
1500        public ContractOfferComponent setLinkIdElement(StringType value) { 
1501          this.linkId = value;
1502          return this;
1503        }
1504
1505        /**
1506         * @return The id of the clause or question text of the offer in the referenced questionnaire/response.
1507         */
1508        public String getLinkId() { 
1509          return this.linkId == null ? null : this.linkId.getValue();
1510        }
1511
1512        /**
1513         * @param value The id of the clause or question text of the offer in the referenced questionnaire/response.
1514         */
1515        public ContractOfferComponent setLinkId(String value) { 
1516          if (Utilities.noString(value))
1517            this.linkId = null;
1518          else {
1519            if (this.linkId == null)
1520              this.linkId = new StringType();
1521            this.linkId.setValue(value);
1522          }
1523          return this;
1524        }
1525
1526        protected void listChildren(List<Property> children) {
1527          super.listChildren(children);
1528          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));
1529          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));
1530          children.add(new Property("decision", "CodeableConcept", "The type of decision made by a grantor with respect to an offer made by a grantee.", 0, 1, decision));
1531          children.add(new Property("text", "string", "Human readable form of this Contract Offer.", 0, 1, text));
1532          children.add(new Property("linkId", "string", "The id of the clause or question text of the offer in the referenced questionnaire/response.", 0, 1, linkId));
1533        }
1534
1535        @Override
1536        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1537          switch (_hash) {
1538          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);
1539          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);
1540          case 565719004: /*decision*/  return new Property("decision", "CodeableConcept", "The type of decision made by a grantor with respect to an offer made by a grantee.", 0, 1, decision);
1541          case 3556653: /*text*/  return new Property("text", "string", "Human readable form of this Contract Offer.", 0, 1, text);
1542          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, 1, linkId);
1543          default: return super.getNamedProperty(_hash, _name, _checkValid);
1544          }
1545
1546        }
1547
1548      @Override
1549      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1550        switch (hash) {
1551        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : new Base[] {this.topic}; // Reference
1552        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1553        case 565719004: /*decision*/ return this.decision == null ? new Base[0] : new Base[] {this.decision}; // CodeableConcept
1554        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
1555        case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : new Base[] {this.linkId}; // StringType
1556        default: return super.getProperty(hash, name, checkValid);
1557        }
1558
1559      }
1560
1561      @Override
1562      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1563        switch (hash) {
1564        case 110546223: // topic
1565          this.topic = castToReference(value); // Reference
1566          return value;
1567        case 3575610: // type
1568          this.type = castToCodeableConcept(value); // CodeableConcept
1569          return value;
1570        case 565719004: // decision
1571          this.decision = castToCodeableConcept(value); // CodeableConcept
1572          return value;
1573        case 3556653: // text
1574          this.text = castToString(value); // StringType
1575          return value;
1576        case -1102667083: // linkId
1577          this.linkId = castToString(value); // StringType
1578          return value;
1579        default: return super.setProperty(hash, name, value);
1580        }
1581
1582      }
1583
1584      @Override
1585      public Base setProperty(String name, Base value) throws FHIRException {
1586        if (name.equals("topic")) {
1587          this.topic = castToReference(value); // Reference
1588        } else if (name.equals("type")) {
1589          this.type = castToCodeableConcept(value); // CodeableConcept
1590        } else if (name.equals("decision")) {
1591          this.decision = castToCodeableConcept(value); // CodeableConcept
1592        } else if (name.equals("text")) {
1593          this.text = castToString(value); // StringType
1594        } else if (name.equals("linkId")) {
1595          this.linkId = castToString(value); // StringType
1596        } else
1597          return super.setProperty(name, value);
1598        return value;
1599      }
1600
1601      @Override
1602      public Base makeProperty(int hash, String name) throws FHIRException {
1603        switch (hash) {
1604        case 110546223:  return getTopic(); 
1605        case 3575610:  return getType(); 
1606        case 565719004:  return getDecision(); 
1607        case 3556653:  return getTextElement();
1608        case -1102667083:  return getLinkIdElement();
1609        default: return super.makeProperty(hash, name);
1610        }
1611
1612      }
1613
1614      @Override
1615      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1616        switch (hash) {
1617        case 110546223: /*topic*/ return new String[] {"Reference"};
1618        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1619        case 565719004: /*decision*/ return new String[] {"CodeableConcept"};
1620        case 3556653: /*text*/ return new String[] {"string"};
1621        case -1102667083: /*linkId*/ return new String[] {"string"};
1622        default: return super.getTypesForProperty(hash, name);
1623        }
1624
1625      }
1626
1627      @Override
1628      public Base addChild(String name) throws FHIRException {
1629        if (name.equals("topic")) {
1630          this.topic = new Reference();
1631          return this.topic;
1632        }
1633        else if (name.equals("type")) {
1634          this.type = new CodeableConcept();
1635          return this.type;
1636        }
1637        else if (name.equals("decision")) {
1638          this.decision = new CodeableConcept();
1639          return this.decision;
1640        }
1641        else if (name.equals("text")) {
1642          throw new FHIRException("Cannot call addChild on a primitive type Contract.text");
1643        }
1644        else if (name.equals("linkId")) {
1645          throw new FHIRException("Cannot call addChild on a primitive type Contract.linkId");
1646        }
1647        else
1648          return super.addChild(name);
1649      }
1650
1651      public ContractOfferComponent copy() {
1652        ContractOfferComponent dst = new ContractOfferComponent();
1653        copyValues(dst);
1654        dst.topic = topic == null ? null : topic.copy();
1655        dst.type = type == null ? null : type.copy();
1656        dst.decision = decision == null ? null : decision.copy();
1657        dst.text = text == null ? null : text.copy();
1658        dst.linkId = linkId == null ? null : linkId.copy();
1659        return dst;
1660      }
1661
1662      @Override
1663      public boolean equalsDeep(Base other_) {
1664        if (!super.equalsDeep(other_))
1665          return false;
1666        if (!(other_ instanceof ContractOfferComponent))
1667          return false;
1668        ContractOfferComponent o = (ContractOfferComponent) other_;
1669        return compareDeep(topic, o.topic, true) && compareDeep(type, o.type, true) && compareDeep(decision, o.decision, true)
1670           && compareDeep(text, o.text, true) && compareDeep(linkId, o.linkId, true);
1671      }
1672
1673      @Override
1674      public boolean equalsShallow(Base other_) {
1675        if (!super.equalsShallow(other_))
1676          return false;
1677        if (!(other_ instanceof ContractOfferComponent))
1678          return false;
1679        ContractOfferComponent o = (ContractOfferComponent) other_;
1680        return compareValues(text, o.text, true) && compareValues(linkId, o.linkId, true);
1681      }
1682
1683      public boolean isEmpty() {
1684        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(topic, type, decision, text
1685          , linkId);
1686      }
1687
1688  public String fhirType() {
1689    return "Contract.term.offer";
1690
1691  }
1692
1693  }
1694
1695    @Block()
1696    public static class ContractAssetComponent extends BackboneElement implements IBaseBackboneElement {
1697        /**
1698         * Categorization of the type of asset.
1699         */
1700        @Child(name = "class", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=false)
1701        @Description(shortDefinition="Resource Type, Profile, or CDA etc.", formalDefinition="Categorization of the type of asset." )
1702        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-content-class")
1703        protected Coding class_;
1704
1705        /**
1706         * Code in the content.
1707         */
1708        @Child(name = "code", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false)
1709        @Description(shortDefinition="Code in the content", formalDefinition="Code in the content." )
1710        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consent-content-code")
1711        protected Coding code;
1712
1713        /**
1714         * Time period of the asset.
1715         */
1716        @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=false)
1717        @Description(shortDefinition="Time period of the asset", formalDefinition="Time period of the asset." )
1718        protected Period period;
1719
1720        /**
1721         * Time period of the data for the asset.
1722         */
1723        @Child(name = "dataPeriod", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=false)
1724        @Description(shortDefinition="Time period of the data for the asset", formalDefinition="Time period of the data for the asset." )
1725        protected Period dataPeriod;
1726
1727        /**
1728         * Data defined by this Asset.
1729         */
1730        @Child(name = "data", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1731        @Description(shortDefinition="Data defined by this Asset", formalDefinition="Data defined by this Asset." )
1732        protected List<AssetDataComponent> data;
1733
1734        /**
1735         * Contract Valued Item List.
1736         */
1737        @Child(name = "valuedItem", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1738        @Description(shortDefinition="Contract Valued Item List", formalDefinition="Contract Valued Item List." )
1739        protected List<ValuedItemComponent> valuedItem;
1740
1741        /**
1742         * A set of security labels that define which terms are controlled by this condition.
1743         */
1744        @Child(name = "securityLabel", type = {Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1745        @Description(shortDefinition="Security Labels that define affected terms", formalDefinition="A set of security labels that define which terms are controlled by this condition." )
1746        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/security-labels")
1747        protected List<Coding> securityLabel;
1748
1749        private static final long serialVersionUID = 1335706802L;
1750
1751    /**
1752     * Constructor
1753     */
1754      public ContractAssetComponent() {
1755        super();
1756      }
1757
1758        /**
1759         * @return {@link #class_} (Categorization of the type of asset.)
1760         */
1761        public Coding getClass_() { 
1762          if (this.class_ == null)
1763            if (Configuration.errorOnAutoCreate())
1764              throw new Error("Attempt to auto-create ContractAssetComponent.class_");
1765            else if (Configuration.doAutoCreate())
1766              this.class_ = new Coding(); // cc
1767          return this.class_;
1768        }
1769
1770        public boolean hasClass_() { 
1771          return this.class_ != null && !this.class_.isEmpty();
1772        }
1773
1774        /**
1775         * @param value {@link #class_} (Categorization of the type of asset.)
1776         */
1777        public ContractAssetComponent setClass_(Coding value) { 
1778          this.class_ = value;
1779          return this;
1780        }
1781
1782        /**
1783         * @return {@link #code} (Code in the content.)
1784         */
1785        public Coding getCode() { 
1786          if (this.code == null)
1787            if (Configuration.errorOnAutoCreate())
1788              throw new Error("Attempt to auto-create ContractAssetComponent.code");
1789            else if (Configuration.doAutoCreate())
1790              this.code = new Coding(); // cc
1791          return this.code;
1792        }
1793
1794        public boolean hasCode() { 
1795          return this.code != null && !this.code.isEmpty();
1796        }
1797
1798        /**
1799         * @param value {@link #code} (Code in the content.)
1800         */
1801        public ContractAssetComponent setCode(Coding value) { 
1802          this.code = value;
1803          return this;
1804        }
1805
1806        /**
1807         * @return {@link #period} (Time period of the asset.)
1808         */
1809        public Period getPeriod() { 
1810          if (this.period == null)
1811            if (Configuration.errorOnAutoCreate())
1812              throw new Error("Attempt to auto-create ContractAssetComponent.period");
1813            else if (Configuration.doAutoCreate())
1814              this.period = new Period(); // cc
1815          return this.period;
1816        }
1817
1818        public boolean hasPeriod() { 
1819          return this.period != null && !this.period.isEmpty();
1820        }
1821
1822        /**
1823         * @param value {@link #period} (Time period of the asset.)
1824         */
1825        public ContractAssetComponent setPeriod(Period value) { 
1826          this.period = value;
1827          return this;
1828        }
1829
1830        /**
1831         * @return {@link #dataPeriod} (Time period of the data for the asset.)
1832         */
1833        public Period getDataPeriod() { 
1834          if (this.dataPeriod == null)
1835            if (Configuration.errorOnAutoCreate())
1836              throw new Error("Attempt to auto-create ContractAssetComponent.dataPeriod");
1837            else if (Configuration.doAutoCreate())
1838              this.dataPeriod = new Period(); // cc
1839          return this.dataPeriod;
1840        }
1841
1842        public boolean hasDataPeriod() { 
1843          return this.dataPeriod != null && !this.dataPeriod.isEmpty();
1844        }
1845
1846        /**
1847         * @param value {@link #dataPeriod} (Time period of the data for the asset.)
1848         */
1849        public ContractAssetComponent setDataPeriod(Period value) { 
1850          this.dataPeriod = value;
1851          return this;
1852        }
1853
1854        /**
1855         * @return {@link #data} (Data defined by this Asset.)
1856         */
1857        public List<AssetDataComponent> getData() { 
1858          if (this.data == null)
1859            this.data = new ArrayList<AssetDataComponent>();
1860          return this.data;
1861        }
1862
1863        /**
1864         * @return Returns a reference to <code>this</code> for easy method chaining
1865         */
1866        public ContractAssetComponent setData(List<AssetDataComponent> theData) { 
1867          this.data = theData;
1868          return this;
1869        }
1870
1871        public boolean hasData() { 
1872          if (this.data == null)
1873            return false;
1874          for (AssetDataComponent item : this.data)
1875            if (!item.isEmpty())
1876              return true;
1877          return false;
1878        }
1879
1880        public AssetDataComponent addData() { //3
1881          AssetDataComponent t = new AssetDataComponent();
1882          if (this.data == null)
1883            this.data = new ArrayList<AssetDataComponent>();
1884          this.data.add(t);
1885          return t;
1886        }
1887
1888        public ContractAssetComponent addData(AssetDataComponent t) { //3
1889          if (t == null)
1890            return this;
1891          if (this.data == null)
1892            this.data = new ArrayList<AssetDataComponent>();
1893          this.data.add(t);
1894          return this;
1895        }
1896
1897        /**
1898         * @return The first repetition of repeating field {@link #data}, creating it if it does not already exist
1899         */
1900        public AssetDataComponent getDataFirstRep() { 
1901          if (getData().isEmpty()) {
1902            addData();
1903          }
1904          return getData().get(0);
1905        }
1906
1907        /**
1908         * @return {@link #valuedItem} (Contract Valued Item List.)
1909         */
1910        public List<ValuedItemComponent> getValuedItem() { 
1911          if (this.valuedItem == null)
1912            this.valuedItem = new ArrayList<ValuedItemComponent>();
1913          return this.valuedItem;
1914        }
1915
1916        /**
1917         * @return Returns a reference to <code>this</code> for easy method chaining
1918         */
1919        public ContractAssetComponent setValuedItem(List<ValuedItemComponent> theValuedItem) { 
1920          this.valuedItem = theValuedItem;
1921          return this;
1922        }
1923
1924        public boolean hasValuedItem() { 
1925          if (this.valuedItem == null)
1926            return false;
1927          for (ValuedItemComponent item : this.valuedItem)
1928            if (!item.isEmpty())
1929              return true;
1930          return false;
1931        }
1932
1933        public ValuedItemComponent addValuedItem() { //3
1934          ValuedItemComponent t = new ValuedItemComponent();
1935          if (this.valuedItem == null)
1936            this.valuedItem = new ArrayList<ValuedItemComponent>();
1937          this.valuedItem.add(t);
1938          return t;
1939        }
1940
1941        public ContractAssetComponent addValuedItem(ValuedItemComponent t) { //3
1942          if (t == null)
1943            return this;
1944          if (this.valuedItem == null)
1945            this.valuedItem = new ArrayList<ValuedItemComponent>();
1946          this.valuedItem.add(t);
1947          return this;
1948        }
1949
1950        /**
1951         * @return The first repetition of repeating field {@link #valuedItem}, creating it if it does not already exist
1952         */
1953        public ValuedItemComponent getValuedItemFirstRep() { 
1954          if (getValuedItem().isEmpty()) {
1955            addValuedItem();
1956          }
1957          return getValuedItem().get(0);
1958        }
1959
1960        /**
1961         * @return {@link #securityLabel} (A set of security labels that define which terms are controlled by this condition.)
1962         */
1963        public List<Coding> getSecurityLabel() { 
1964          if (this.securityLabel == null)
1965            this.securityLabel = new ArrayList<Coding>();
1966          return this.securityLabel;
1967        }
1968
1969        /**
1970         * @return Returns a reference to <code>this</code> for easy method chaining
1971         */
1972        public ContractAssetComponent setSecurityLabel(List<Coding> theSecurityLabel) { 
1973          this.securityLabel = theSecurityLabel;
1974          return this;
1975        }
1976
1977        public boolean hasSecurityLabel() { 
1978          if (this.securityLabel == null)
1979            return false;
1980          for (Coding item : this.securityLabel)
1981            if (!item.isEmpty())
1982              return true;
1983          return false;
1984        }
1985
1986        public Coding addSecurityLabel() { //3
1987          Coding t = new Coding();
1988          if (this.securityLabel == null)
1989            this.securityLabel = new ArrayList<Coding>();
1990          this.securityLabel.add(t);
1991          return t;
1992        }
1993
1994        public ContractAssetComponent addSecurityLabel(Coding t) { //3
1995          if (t == null)
1996            return this;
1997          if (this.securityLabel == null)
1998            this.securityLabel = new ArrayList<Coding>();
1999          this.securityLabel.add(t);
2000          return this;
2001        }
2002
2003        /**
2004         * @return The first repetition of repeating field {@link #securityLabel}, creating it if it does not already exist
2005         */
2006        public Coding getSecurityLabelFirstRep() { 
2007          if (getSecurityLabel().isEmpty()) {
2008            addSecurityLabel();
2009          }
2010          return getSecurityLabel().get(0);
2011        }
2012
2013        protected void listChildren(List<Property> children) {
2014          super.listChildren(children);
2015          children.add(new Property("class", "Coding", "Categorization of the type of asset.", 0, 1, class_));
2016          children.add(new Property("code", "Coding", "Code in the content.", 0, 1, code));
2017          children.add(new Property("period", "Period", "Time period of the asset.", 0, 1, period));
2018          children.add(new Property("dataPeriod", "Period", "Time period of the data for the asset.", 0, 1, dataPeriod));
2019          children.add(new Property("data", "", "Data defined by this Asset.", 0, java.lang.Integer.MAX_VALUE, data));
2020          children.add(new Property("valuedItem", "", "Contract Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem));
2021          children.add(new Property("securityLabel", "Coding", "A set of security labels that define which terms are controlled by this condition.", 0, java.lang.Integer.MAX_VALUE, securityLabel));
2022        }
2023
2024        @Override
2025        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2026          switch (_hash) {
2027          case 94742904: /*class*/  return new Property("class", "Coding", "Categorization of the type of asset.", 0, 1, class_);
2028          case 3059181: /*code*/  return new Property("code", "Coding", "Code in the content.", 0, 1, code);
2029          case -991726143: /*period*/  return new Property("period", "Period", "Time period of the asset.", 0, 1, period);
2030          case 1177250315: /*dataPeriod*/  return new Property("dataPeriod", "Period", "Time period of the data for the asset.", 0, 1, dataPeriod);
2031          case 3076010: /*data*/  return new Property("data", "", "Data defined by this Asset.", 0, java.lang.Integer.MAX_VALUE, data);
2032          case 2046675654: /*valuedItem*/  return new Property("valuedItem", "", "Contract Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem);
2033          case -722296940: /*securityLabel*/  return new Property("securityLabel", "Coding", "A set of security labels that define which terms are controlled by this condition.", 0, java.lang.Integer.MAX_VALUE, securityLabel);
2034          default: return super.getNamedProperty(_hash, _name, _checkValid);
2035          }
2036
2037        }
2038
2039      @Override
2040      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2041        switch (hash) {
2042        case 94742904: /*class*/ return this.class_ == null ? new Base[0] : new Base[] {this.class_}; // Coding
2043        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding
2044        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
2045        case 1177250315: /*dataPeriod*/ return this.dataPeriod == null ? new Base[0] : new Base[] {this.dataPeriod}; // Period
2046        case 3076010: /*data*/ return this.data == null ? new Base[0] : this.data.toArray(new Base[this.data.size()]); // AssetDataComponent
2047        case 2046675654: /*valuedItem*/ return this.valuedItem == null ? new Base[0] : this.valuedItem.toArray(new Base[this.valuedItem.size()]); // ValuedItemComponent
2048        case -722296940: /*securityLabel*/ return this.securityLabel == null ? new Base[0] : this.securityLabel.toArray(new Base[this.securityLabel.size()]); // Coding
2049        default: return super.getProperty(hash, name, checkValid);
2050        }
2051
2052      }
2053
2054      @Override
2055      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2056        switch (hash) {
2057        case 94742904: // class
2058          this.class_ = castToCoding(value); // Coding
2059          return value;
2060        case 3059181: // code
2061          this.code = castToCoding(value); // Coding
2062          return value;
2063        case -991726143: // period
2064          this.period = castToPeriod(value); // Period
2065          return value;
2066        case 1177250315: // dataPeriod
2067          this.dataPeriod = castToPeriod(value); // Period
2068          return value;
2069        case 3076010: // data
2070          this.getData().add((AssetDataComponent) value); // AssetDataComponent
2071          return value;
2072        case 2046675654: // valuedItem
2073          this.getValuedItem().add((ValuedItemComponent) value); // ValuedItemComponent
2074          return value;
2075        case -722296940: // securityLabel
2076          this.getSecurityLabel().add(castToCoding(value)); // Coding
2077          return value;
2078        default: return super.setProperty(hash, name, value);
2079        }
2080
2081      }
2082
2083      @Override
2084      public Base setProperty(String name, Base value) throws FHIRException {
2085        if (name.equals("class")) {
2086          this.class_ = castToCoding(value); // Coding
2087        } else if (name.equals("code")) {
2088          this.code = castToCoding(value); // Coding
2089        } else if (name.equals("period")) {
2090          this.period = castToPeriod(value); // Period
2091        } else if (name.equals("dataPeriod")) {
2092          this.dataPeriod = castToPeriod(value); // Period
2093        } else if (name.equals("data")) {
2094          this.getData().add((AssetDataComponent) value);
2095        } else if (name.equals("valuedItem")) {
2096          this.getValuedItem().add((ValuedItemComponent) value);
2097        } else if (name.equals("securityLabel")) {
2098          this.getSecurityLabel().add(castToCoding(value));
2099        } else
2100          return super.setProperty(name, value);
2101        return value;
2102      }
2103
2104      @Override
2105      public Base makeProperty(int hash, String name) throws FHIRException {
2106        switch (hash) {
2107        case 94742904:  return getClass_(); 
2108        case 3059181:  return getCode(); 
2109        case -991726143:  return getPeriod(); 
2110        case 1177250315:  return getDataPeriod(); 
2111        case 3076010:  return addData(); 
2112        case 2046675654:  return addValuedItem(); 
2113        case -722296940:  return addSecurityLabel(); 
2114        default: return super.makeProperty(hash, name);
2115        }
2116
2117      }
2118
2119      @Override
2120      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2121        switch (hash) {
2122        case 94742904: /*class*/ return new String[] {"Coding"};
2123        case 3059181: /*code*/ return new String[] {"Coding"};
2124        case -991726143: /*period*/ return new String[] {"Period"};
2125        case 1177250315: /*dataPeriod*/ return new String[] {"Period"};
2126        case 3076010: /*data*/ return new String[] {};
2127        case 2046675654: /*valuedItem*/ return new String[] {};
2128        case -722296940: /*securityLabel*/ return new String[] {"Coding"};
2129        default: return super.getTypesForProperty(hash, name);
2130        }
2131
2132      }
2133
2134      @Override
2135      public Base addChild(String name) throws FHIRException {
2136        if (name.equals("class")) {
2137          this.class_ = new Coding();
2138          return this.class_;
2139        }
2140        else if (name.equals("code")) {
2141          this.code = new Coding();
2142          return this.code;
2143        }
2144        else if (name.equals("period")) {
2145          this.period = new Period();
2146          return this.period;
2147        }
2148        else if (name.equals("dataPeriod")) {
2149          this.dataPeriod = new Period();
2150          return this.dataPeriod;
2151        }
2152        else if (name.equals("data")) {
2153          return addData();
2154        }
2155        else if (name.equals("valuedItem")) {
2156          return addValuedItem();
2157        }
2158        else if (name.equals("securityLabel")) {
2159          return addSecurityLabel();
2160        }
2161        else
2162          return super.addChild(name);
2163      }
2164
2165      public ContractAssetComponent copy() {
2166        ContractAssetComponent dst = new ContractAssetComponent();
2167        copyValues(dst);
2168        dst.class_ = class_ == null ? null : class_.copy();
2169        dst.code = code == null ? null : code.copy();
2170        dst.period = period == null ? null : period.copy();
2171        dst.dataPeriod = dataPeriod == null ? null : dataPeriod.copy();
2172        if (data != null) {
2173          dst.data = new ArrayList<AssetDataComponent>();
2174          for (AssetDataComponent i : data)
2175            dst.data.add(i.copy());
2176        };
2177        if (valuedItem != null) {
2178          dst.valuedItem = new ArrayList<ValuedItemComponent>();
2179          for (ValuedItemComponent i : valuedItem)
2180            dst.valuedItem.add(i.copy());
2181        };
2182        if (securityLabel != null) {
2183          dst.securityLabel = new ArrayList<Coding>();
2184          for (Coding i : securityLabel)
2185            dst.securityLabel.add(i.copy());
2186        };
2187        return dst;
2188      }
2189
2190      @Override
2191      public boolean equalsDeep(Base other_) {
2192        if (!super.equalsDeep(other_))
2193          return false;
2194        if (!(other_ instanceof ContractAssetComponent))
2195          return false;
2196        ContractAssetComponent o = (ContractAssetComponent) other_;
2197        return compareDeep(class_, o.class_, true) && compareDeep(code, o.code, true) && compareDeep(period, o.period, true)
2198           && compareDeep(dataPeriod, o.dataPeriod, true) && compareDeep(data, o.data, true) && compareDeep(valuedItem, o.valuedItem, true)
2199           && compareDeep(securityLabel, o.securityLabel, true);
2200      }
2201
2202      @Override
2203      public boolean equalsShallow(Base other_) {
2204        if (!super.equalsShallow(other_))
2205          return false;
2206        if (!(other_ instanceof ContractAssetComponent))
2207          return false;
2208        ContractAssetComponent o = (ContractAssetComponent) other_;
2209        return true;
2210      }
2211
2212      public boolean isEmpty() {
2213        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(class_, code, period, dataPeriod
2214          , data, valuedItem, securityLabel);
2215      }
2216
2217  public String fhirType() {
2218    return "Contract.term.asset";
2219
2220  }
2221
2222  }
2223
2224    @Block()
2225    public static class AssetDataComponent extends BackboneElement implements IBaseBackboneElement {
2226        /**
2227         * instance | related | dependents | authoredby.
2228         */
2229        @Child(name = "meaning", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false)
2230        @Description(shortDefinition="instance | related | dependents | authoredby", formalDefinition="instance | related | dependents | authoredby." )
2231        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-data-meaning")
2232        protected Enumeration<ContractDataMeaning> meaning;
2233
2234        /**
2235         * The actual data reference.
2236         */
2237        @Child(name = "reference", type = {Reference.class}, order=2, min=0, max=1, modifier=false, summary=false)
2238        @Description(shortDefinition="The actual data reference", formalDefinition="The actual data reference." )
2239        protected Reference reference;
2240
2241        /**
2242         * The actual object that is the target of the reference (The actual data reference.)
2243         */
2244        protected Resource referenceTarget;
2245
2246        private static final long serialVersionUID = 2123707153L;
2247
2248    /**
2249     * Constructor
2250     */
2251      public AssetDataComponent() {
2252        super();
2253      }
2254
2255        /**
2256         * @return {@link #meaning} (instance | related | dependents | authoredby.). This is the underlying object with id, value and extensions. The accessor "getMeaning" gives direct access to the value
2257         */
2258        public Enumeration<ContractDataMeaning> getMeaningElement() { 
2259          if (this.meaning == null)
2260            if (Configuration.errorOnAutoCreate())
2261              throw new Error("Attempt to auto-create AssetDataComponent.meaning");
2262            else if (Configuration.doAutoCreate())
2263              this.meaning = new Enumeration<ContractDataMeaning>(new ContractDataMeaningEnumFactory()); // bb
2264          return this.meaning;
2265        }
2266
2267        public boolean hasMeaningElement() { 
2268          return this.meaning != null && !this.meaning.isEmpty();
2269        }
2270
2271        public boolean hasMeaning() { 
2272          return this.meaning != null && !this.meaning.isEmpty();
2273        }
2274
2275        /**
2276         * @param value {@link #meaning} (instance | related | dependents | authoredby.). This is the underlying object with id, value and extensions. The accessor "getMeaning" gives direct access to the value
2277         */
2278        public AssetDataComponent setMeaningElement(Enumeration<ContractDataMeaning> value) { 
2279          this.meaning = value;
2280          return this;
2281        }
2282
2283        /**
2284         * @return instance | related | dependents | authoredby.
2285         */
2286        public ContractDataMeaning getMeaning() { 
2287          return this.meaning == null ? null : this.meaning.getValue();
2288        }
2289
2290        /**
2291         * @param value instance | related | dependents | authoredby.
2292         */
2293        public AssetDataComponent setMeaning(ContractDataMeaning value) { 
2294          if (value == null)
2295            this.meaning = null;
2296          else {
2297            if (this.meaning == null)
2298              this.meaning = new Enumeration<ContractDataMeaning>(new ContractDataMeaningEnumFactory());
2299            this.meaning.setValue(value);
2300          }
2301          return this;
2302        }
2303
2304        /**
2305         * @return {@link #reference} (The actual data reference.)
2306         */
2307        public Reference getReference() { 
2308          if (this.reference == null)
2309            if (Configuration.errorOnAutoCreate())
2310              throw new Error("Attempt to auto-create AssetDataComponent.reference");
2311            else if (Configuration.doAutoCreate())
2312              this.reference = new Reference(); // cc
2313          return this.reference;
2314        }
2315
2316        public boolean hasReference() { 
2317          return this.reference != null && !this.reference.isEmpty();
2318        }
2319
2320        /**
2321         * @param value {@link #reference} (The actual data reference.)
2322         */
2323        public AssetDataComponent setReference(Reference value) { 
2324          this.reference = value;
2325          return this;
2326        }
2327
2328        /**
2329         * @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. (The actual data reference.)
2330         */
2331        public Resource getReferenceTarget() { 
2332          return this.referenceTarget;
2333        }
2334
2335        /**
2336         * @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. (The actual data reference.)
2337         */
2338        public AssetDataComponent setReferenceTarget(Resource value) { 
2339          this.referenceTarget = value;
2340          return this;
2341        }
2342
2343        protected void listChildren(List<Property> children) {
2344          super.listChildren(children);
2345          children.add(new Property("meaning", "code", "instance | related | dependents | authoredby.", 0, 1, meaning));
2346          children.add(new Property("reference", "Reference(Any)", "The actual data reference.", 0, 1, reference));
2347        }
2348
2349        @Override
2350        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2351          switch (_hash) {
2352          case 938160637: /*meaning*/  return new Property("meaning", "code", "instance | related | dependents | authoredby.", 0, 1, meaning);
2353          case -925155509: /*reference*/  return new Property("reference", "Reference(Any)", "The actual data reference.", 0, 1, reference);
2354          default: return super.getNamedProperty(_hash, _name, _checkValid);
2355          }
2356
2357        }
2358
2359      @Override
2360      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2361        switch (hash) {
2362        case 938160637: /*meaning*/ return this.meaning == null ? new Base[0] : new Base[] {this.meaning}; // Enumeration<ContractDataMeaning>
2363        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
2364        default: return super.getProperty(hash, name, checkValid);
2365        }
2366
2367      }
2368
2369      @Override
2370      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2371        switch (hash) {
2372        case 938160637: // meaning
2373          value = new ContractDataMeaningEnumFactory().fromType(castToCode(value));
2374          this.meaning = (Enumeration) value; // Enumeration<ContractDataMeaning>
2375          return value;
2376        case -925155509: // reference
2377          this.reference = castToReference(value); // Reference
2378          return value;
2379        default: return super.setProperty(hash, name, value);
2380        }
2381
2382      }
2383
2384      @Override
2385      public Base setProperty(String name, Base value) throws FHIRException {
2386        if (name.equals("meaning")) {
2387          value = new ContractDataMeaningEnumFactory().fromType(castToCode(value));
2388          this.meaning = (Enumeration) value; // Enumeration<ContractDataMeaning>
2389        } else if (name.equals("reference")) {
2390          this.reference = castToReference(value); // Reference
2391        } else
2392          return super.setProperty(name, value);
2393        return value;
2394      }
2395
2396      @Override
2397      public Base makeProperty(int hash, String name) throws FHIRException {
2398        switch (hash) {
2399        case 938160637:  return getMeaningElement();
2400        case -925155509:  return getReference(); 
2401        default: return super.makeProperty(hash, name);
2402        }
2403
2404      }
2405
2406      @Override
2407      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2408        switch (hash) {
2409        case 938160637: /*meaning*/ return new String[] {"code"};
2410        case -925155509: /*reference*/ return new String[] {"Reference"};
2411        default: return super.getTypesForProperty(hash, name);
2412        }
2413
2414      }
2415
2416      @Override
2417      public Base addChild(String name) throws FHIRException {
2418        if (name.equals("meaning")) {
2419          throw new FHIRException("Cannot call addChild on a primitive type Contract.meaning");
2420        }
2421        else if (name.equals("reference")) {
2422          this.reference = new Reference();
2423          return this.reference;
2424        }
2425        else
2426          return super.addChild(name);
2427      }
2428
2429      public AssetDataComponent copy() {
2430        AssetDataComponent dst = new AssetDataComponent();
2431        copyValues(dst);
2432        dst.meaning = meaning == null ? null : meaning.copy();
2433        dst.reference = reference == null ? null : reference.copy();
2434        return dst;
2435      }
2436
2437      @Override
2438      public boolean equalsDeep(Base other_) {
2439        if (!super.equalsDeep(other_))
2440          return false;
2441        if (!(other_ instanceof AssetDataComponent))
2442          return false;
2443        AssetDataComponent o = (AssetDataComponent) other_;
2444        return compareDeep(meaning, o.meaning, true) && compareDeep(reference, o.reference, true);
2445      }
2446
2447      @Override
2448      public boolean equalsShallow(Base other_) {
2449        if (!super.equalsShallow(other_))
2450          return false;
2451        if (!(other_ instanceof AssetDataComponent))
2452          return false;
2453        AssetDataComponent o = (AssetDataComponent) other_;
2454        return compareValues(meaning, o.meaning, true);
2455      }
2456
2457      public boolean isEmpty() {
2458        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(meaning, reference);
2459      }
2460
2461  public String fhirType() {
2462    return "Contract.term.asset.data";
2463
2464  }
2465
2466  }
2467
2468    @Block()
2469    public static class ValuedItemComponent extends BackboneElement implements IBaseBackboneElement {
2470        /**
2471         * Specific type of Contract Valued Item that may be priced.
2472         */
2473        @Child(name = "entity", type = {CodeableConcept.class, Reference.class}, order=1, min=0, max=1, modifier=false, summary=false)
2474        @Description(shortDefinition="Contract Valued Item Type", formalDefinition="Specific type of Contract Valued Item that may be priced." )
2475        protected Type entity;
2476
2477        /**
2478         * Identifies a Contract Valued Item instance.
2479         */
2480        @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=false)
2481        @Description(shortDefinition="Contract Valued Item Number", formalDefinition="Identifies a Contract Valued Item instance." )
2482        protected Identifier identifier;
2483
2484        /**
2485         * Indicates the time during which this Contract ValuedItem information is effective.
2486         */
2487        @Child(name = "effectiveTime", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2488        @Description(shortDefinition="Contract Valued Item Effective Tiem", formalDefinition="Indicates the time during which this Contract ValuedItem information is effective." )
2489        protected DateTimeType effectiveTime;
2490
2491        /**
2492         * Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.
2493         */
2494        @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=false)
2495        @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." )
2496        protected SimpleQuantity quantity;
2497
2498        /**
2499         * A Contract Valued Item unit valuation measure.
2500         */
2501        @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1, modifier=false, summary=false)
2502        @Description(shortDefinition="Contract Valued Item fee, charge, or cost", formalDefinition="A Contract Valued Item unit valuation measure." )
2503        protected Money unitPrice;
2504
2505        /**
2506         * 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.
2507         */
2508        @Child(name = "factor", type = {DecimalType.class}, order=6, min=0, max=1, modifier=false, summary=false)
2509        @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." )
2510        protected DecimalType factor;
2511
2512        /**
2513         * 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.
2514         */
2515        @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=false)
2516        @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." )
2517        protected DecimalType points;
2518
2519        /**
2520         * 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.
2521         */
2522        @Child(name = "net", type = {Money.class}, order=8, min=0, max=1, modifier=false, summary=false)
2523        @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." )
2524        protected Money net;
2525
2526        private static final long serialVersionUID = 1782449516L;
2527
2528    /**
2529     * Constructor
2530     */
2531      public ValuedItemComponent() {
2532        super();
2533      }
2534
2535        /**
2536         * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.)
2537         */
2538        public Type getEntity() { 
2539          return this.entity;
2540        }
2541
2542        /**
2543         * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.)
2544         */
2545        public CodeableConcept getEntityCodeableConcept() throws FHIRException { 
2546          if (this.entity == null)
2547            return null;
2548          if (!(this.entity instanceof CodeableConcept))
2549            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.entity.getClass().getName()+" was encountered");
2550          return (CodeableConcept) this.entity;
2551        }
2552
2553        public boolean hasEntityCodeableConcept() { 
2554          return this != null && this.entity instanceof CodeableConcept;
2555        }
2556
2557        /**
2558         * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.)
2559         */
2560        public Reference getEntityReference() throws FHIRException { 
2561          if (this.entity == null)
2562            return null;
2563          if (!(this.entity instanceof Reference))
2564            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.entity.getClass().getName()+" was encountered");
2565          return (Reference) this.entity;
2566        }
2567
2568        public boolean hasEntityReference() { 
2569          return this != null && this.entity instanceof Reference;
2570        }
2571
2572        public boolean hasEntity() { 
2573          return this.entity != null && !this.entity.isEmpty();
2574        }
2575
2576        /**
2577         * @param value {@link #entity} (Specific type of Contract Valued Item that may be priced.)
2578         */
2579        public ValuedItemComponent setEntity(Type value) { 
2580          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
2581            throw new Error("Not the right type for Contract.term.asset.valuedItem.entity[x]: "+value.fhirType());
2582          this.entity = value;
2583          return this;
2584        }
2585
2586        /**
2587         * @return {@link #identifier} (Identifies a Contract Valued Item instance.)
2588         */
2589        public Identifier getIdentifier() { 
2590          if (this.identifier == null)
2591            if (Configuration.errorOnAutoCreate())
2592              throw new Error("Attempt to auto-create ValuedItemComponent.identifier");
2593            else if (Configuration.doAutoCreate())
2594              this.identifier = new Identifier(); // cc
2595          return this.identifier;
2596        }
2597
2598        public boolean hasIdentifier() { 
2599          return this.identifier != null && !this.identifier.isEmpty();
2600        }
2601
2602        /**
2603         * @param value {@link #identifier} (Identifies a Contract Valued Item instance.)
2604         */
2605        public ValuedItemComponent setIdentifier(Identifier value) { 
2606          this.identifier = value;
2607          return this;
2608        }
2609
2610        /**
2611         * @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
2612         */
2613        public DateTimeType getEffectiveTimeElement() { 
2614          if (this.effectiveTime == null)
2615            if (Configuration.errorOnAutoCreate())
2616              throw new Error("Attempt to auto-create ValuedItemComponent.effectiveTime");
2617            else if (Configuration.doAutoCreate())
2618              this.effectiveTime = new DateTimeType(); // bb
2619          return this.effectiveTime;
2620        }
2621
2622        public boolean hasEffectiveTimeElement() { 
2623          return this.effectiveTime != null && !this.effectiveTime.isEmpty();
2624        }
2625
2626        public boolean hasEffectiveTime() { 
2627          return this.effectiveTime != null && !this.effectiveTime.isEmpty();
2628        }
2629
2630        /**
2631         * @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
2632         */
2633        public ValuedItemComponent setEffectiveTimeElement(DateTimeType value) { 
2634          this.effectiveTime = value;
2635          return this;
2636        }
2637
2638        /**
2639         * @return Indicates the time during which this Contract ValuedItem information is effective.
2640         */
2641        public Date getEffectiveTime() { 
2642          return this.effectiveTime == null ? null : this.effectiveTime.getValue();
2643        }
2644
2645        /**
2646         * @param value Indicates the time during which this Contract ValuedItem information is effective.
2647         */
2648        public ValuedItemComponent setEffectiveTime(Date value) { 
2649          if (value == null)
2650            this.effectiveTime = null;
2651          else {
2652            if (this.effectiveTime == null)
2653              this.effectiveTime = new DateTimeType();
2654            this.effectiveTime.setValue(value);
2655          }
2656          return this;
2657        }
2658
2659        /**
2660         * @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.)
2661         */
2662        public SimpleQuantity getQuantity() { 
2663          if (this.quantity == null)
2664            if (Configuration.errorOnAutoCreate())
2665              throw new Error("Attempt to auto-create ValuedItemComponent.quantity");
2666            else if (Configuration.doAutoCreate())
2667              this.quantity = new SimpleQuantity(); // cc
2668          return this.quantity;
2669        }
2670
2671        public boolean hasQuantity() { 
2672          return this.quantity != null && !this.quantity.isEmpty();
2673        }
2674
2675        /**
2676         * @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.)
2677         */
2678        public ValuedItemComponent setQuantity(SimpleQuantity value) { 
2679          this.quantity = value;
2680          return this;
2681        }
2682
2683        /**
2684         * @return {@link #unitPrice} (A Contract Valued Item unit valuation measure.)
2685         */
2686        public Money getUnitPrice() { 
2687          if (this.unitPrice == null)
2688            if (Configuration.errorOnAutoCreate())
2689              throw new Error("Attempt to auto-create ValuedItemComponent.unitPrice");
2690            else if (Configuration.doAutoCreate())
2691              this.unitPrice = new Money(); // cc
2692          return this.unitPrice;
2693        }
2694
2695        public boolean hasUnitPrice() { 
2696          return this.unitPrice != null && !this.unitPrice.isEmpty();
2697        }
2698
2699        /**
2700         * @param value {@link #unitPrice} (A Contract Valued Item unit valuation measure.)
2701         */
2702        public ValuedItemComponent setUnitPrice(Money value) { 
2703          this.unitPrice = value;
2704          return this;
2705        }
2706
2707        /**
2708         * @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
2709         */
2710        public DecimalType getFactorElement() { 
2711          if (this.factor == null)
2712            if (Configuration.errorOnAutoCreate())
2713              throw new Error("Attempt to auto-create ValuedItemComponent.factor");
2714            else if (Configuration.doAutoCreate())
2715              this.factor = new DecimalType(); // bb
2716          return this.factor;
2717        }
2718
2719        public boolean hasFactorElement() { 
2720          return this.factor != null && !this.factor.isEmpty();
2721        }
2722
2723        public boolean hasFactor() { 
2724          return this.factor != null && !this.factor.isEmpty();
2725        }
2726
2727        /**
2728         * @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
2729         */
2730        public ValuedItemComponent setFactorElement(DecimalType value) { 
2731          this.factor = value;
2732          return this;
2733        }
2734
2735        /**
2736         * @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.
2737         */
2738        public BigDecimal getFactor() { 
2739          return this.factor == null ? null : this.factor.getValue();
2740        }
2741
2742        /**
2743         * @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.
2744         */
2745        public ValuedItemComponent setFactor(BigDecimal value) { 
2746          if (value == null)
2747            this.factor = null;
2748          else {
2749            if (this.factor == null)
2750              this.factor = new DecimalType();
2751            this.factor.setValue(value);
2752          }
2753          return this;
2754        }
2755
2756        /**
2757         * @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.
2758         */
2759        public ValuedItemComponent setFactor(long value) { 
2760              this.factor = new DecimalType();
2761            this.factor.setValue(value);
2762          return this;
2763        }
2764
2765        /**
2766         * @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.
2767         */
2768        public ValuedItemComponent setFactor(double value) { 
2769              this.factor = new DecimalType();
2770            this.factor.setValue(value);
2771          return this;
2772        }
2773
2774        /**
2775         * @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
2776         */
2777        public DecimalType getPointsElement() { 
2778          if (this.points == null)
2779            if (Configuration.errorOnAutoCreate())
2780              throw new Error("Attempt to auto-create ValuedItemComponent.points");
2781            else if (Configuration.doAutoCreate())
2782              this.points = new DecimalType(); // bb
2783          return this.points;
2784        }
2785
2786        public boolean hasPointsElement() { 
2787          return this.points != null && !this.points.isEmpty();
2788        }
2789
2790        public boolean hasPoints() { 
2791          return this.points != null && !this.points.isEmpty();
2792        }
2793
2794        /**
2795         * @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
2796         */
2797        public ValuedItemComponent setPointsElement(DecimalType value) { 
2798          this.points = value;
2799          return this;
2800        }
2801
2802        /**
2803         * @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.
2804         */
2805        public BigDecimal getPoints() { 
2806          return this.points == null ? null : this.points.getValue();
2807        }
2808
2809        /**
2810         * @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.
2811         */
2812        public ValuedItemComponent setPoints(BigDecimal value) { 
2813          if (value == null)
2814            this.points = null;
2815          else {
2816            if (this.points == null)
2817              this.points = new DecimalType();
2818            this.points.setValue(value);
2819          }
2820          return this;
2821        }
2822
2823        /**
2824         * @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.
2825         */
2826        public ValuedItemComponent setPoints(long value) { 
2827              this.points = new DecimalType();
2828            this.points.setValue(value);
2829          return this;
2830        }
2831
2832        /**
2833         * @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.
2834         */
2835        public ValuedItemComponent setPoints(double value) { 
2836              this.points = new DecimalType();
2837            this.points.setValue(value);
2838          return this;
2839        }
2840
2841        /**
2842         * @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.)
2843         */
2844        public Money getNet() { 
2845          if (this.net == null)
2846            if (Configuration.errorOnAutoCreate())
2847              throw new Error("Attempt to auto-create ValuedItemComponent.net");
2848            else if (Configuration.doAutoCreate())
2849              this.net = new Money(); // cc
2850          return this.net;
2851        }
2852
2853        public boolean hasNet() { 
2854          return this.net != null && !this.net.isEmpty();
2855        }
2856
2857        /**
2858         * @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.)
2859         */
2860        public ValuedItemComponent setNet(Money value) { 
2861          this.net = value;
2862          return this;
2863        }
2864
2865        protected void listChildren(List<Property> children) {
2866          super.listChildren(children);
2867          children.add(new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, 1, entity));
2868          children.add(new Property("identifier", "Identifier", "Identifies a Contract Valued Item instance.", 0, 1, identifier));
2869          children.add(new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract ValuedItem information is effective.", 0, 1, effectiveTime));
2870          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));
2871          children.add(new Property("unitPrice", "Money", "A Contract Valued Item unit valuation measure.", 0, 1, unitPrice));
2872          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));
2873          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));
2874          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));
2875        }
2876
2877        @Override
2878        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2879          switch (_hash) {
2880          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);
2881          case -1298275357: /*entity*/  return new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, 1, entity);
2882          case 924197182: /*entityCodeableConcept*/  return new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, 1, entity);
2883          case -356635992: /*entityReference*/  return new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, 1, entity);
2884          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifies a Contract Valued Item instance.", 0, 1, identifier);
2885          case -929905388: /*effectiveTime*/  return new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract ValuedItem information is effective.", 0, 1, effectiveTime);
2886          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);
2887          case -486196699: /*unitPrice*/  return new Property("unitPrice", "Money", "A Contract Valued Item unit valuation measure.", 0, 1, unitPrice);
2888          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);
2889          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);
2890          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);
2891          default: return super.getNamedProperty(_hash, _name, _checkValid);
2892          }
2893
2894        }
2895
2896      @Override
2897      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2898        switch (hash) {
2899        case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : new Base[] {this.entity}; // Type
2900        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
2901        case -929905388: /*effectiveTime*/ return this.effectiveTime == null ? new Base[0] : new Base[] {this.effectiveTime}; // DateTimeType
2902        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity
2903        case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money
2904        case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType
2905        case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType
2906        case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money
2907        default: return super.getProperty(hash, name, checkValid);
2908        }
2909
2910      }
2911
2912      @Override
2913      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2914        switch (hash) {
2915        case -1298275357: // entity
2916          this.entity = castToType(value); // Type
2917          return value;
2918        case -1618432855: // identifier
2919          this.identifier = castToIdentifier(value); // Identifier
2920          return value;
2921        case -929905388: // effectiveTime
2922          this.effectiveTime = castToDateTime(value); // DateTimeType
2923          return value;
2924        case -1285004149: // quantity
2925          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
2926          return value;
2927        case -486196699: // unitPrice
2928          this.unitPrice = castToMoney(value); // Money
2929          return value;
2930        case -1282148017: // factor
2931          this.factor = castToDecimal(value); // DecimalType
2932          return value;
2933        case -982754077: // points
2934          this.points = castToDecimal(value); // DecimalType
2935          return value;
2936        case 108957: // net
2937          this.net = castToMoney(value); // Money
2938          return value;
2939        default: return super.setProperty(hash, name, value);
2940        }
2941
2942      }
2943
2944      @Override
2945      public Base setProperty(String name, Base value) throws FHIRException {
2946        if (name.equals("entity[x]")) {
2947          this.entity = castToType(value); // Type
2948        } else if (name.equals("identifier")) {
2949          this.identifier = castToIdentifier(value); // Identifier
2950        } else if (name.equals("effectiveTime")) {
2951          this.effectiveTime = castToDateTime(value); // DateTimeType
2952        } else if (name.equals("quantity")) {
2953          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
2954        } else if (name.equals("unitPrice")) {
2955          this.unitPrice = castToMoney(value); // Money
2956        } else if (name.equals("factor")) {
2957          this.factor = castToDecimal(value); // DecimalType
2958        } else if (name.equals("points")) {
2959          this.points = castToDecimal(value); // DecimalType
2960        } else if (name.equals("net")) {
2961          this.net = castToMoney(value); // Money
2962        } else
2963          return super.setProperty(name, value);
2964        return value;
2965      }
2966
2967      @Override
2968      public Base makeProperty(int hash, String name) throws FHIRException {
2969        switch (hash) {
2970        case -740568643:  return getEntity(); 
2971        case -1298275357:  return getEntity(); 
2972        case -1618432855:  return getIdentifier(); 
2973        case -929905388:  return getEffectiveTimeElement();
2974        case -1285004149:  return getQuantity(); 
2975        case -486196699:  return getUnitPrice(); 
2976        case -1282148017:  return getFactorElement();
2977        case -982754077:  return getPointsElement();
2978        case 108957:  return getNet(); 
2979        default: return super.makeProperty(hash, name);
2980        }
2981
2982      }
2983
2984      @Override
2985      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2986        switch (hash) {
2987        case -1298275357: /*entity*/ return new String[] {"CodeableConcept", "Reference"};
2988        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2989        case -929905388: /*effectiveTime*/ return new String[] {"dateTime"};
2990        case -1285004149: /*quantity*/ return new String[] {"SimpleQuantity"};
2991        case -486196699: /*unitPrice*/ return new String[] {"Money"};
2992        case -1282148017: /*factor*/ return new String[] {"decimal"};
2993        case -982754077: /*points*/ return new String[] {"decimal"};
2994        case 108957: /*net*/ return new String[] {"Money"};
2995        default: return super.getTypesForProperty(hash, name);
2996        }
2997
2998      }
2999
3000      @Override
3001      public Base addChild(String name) throws FHIRException {
3002        if (name.equals("entityCodeableConcept")) {
3003          this.entity = new CodeableConcept();
3004          return this.entity;
3005        }
3006        else if (name.equals("entityReference")) {
3007          this.entity = new Reference();
3008          return this.entity;
3009        }
3010        else if (name.equals("identifier")) {
3011          this.identifier = new Identifier();
3012          return this.identifier;
3013        }
3014        else if (name.equals("effectiveTime")) {
3015          throw new FHIRException("Cannot call addChild on a primitive type Contract.effectiveTime");
3016        }
3017        else if (name.equals("quantity")) {
3018          this.quantity = new SimpleQuantity();
3019          return this.quantity;
3020        }
3021        else if (name.equals("unitPrice")) {
3022          this.unitPrice = new Money();
3023          return this.unitPrice;
3024        }
3025        else if (name.equals("factor")) {
3026          throw new FHIRException("Cannot call addChild on a primitive type Contract.factor");
3027        }
3028        else if (name.equals("points")) {
3029          throw new FHIRException("Cannot call addChild on a primitive type Contract.points");
3030        }
3031        else if (name.equals("net")) {
3032          this.net = new Money();
3033          return this.net;
3034        }
3035        else
3036          return super.addChild(name);
3037      }
3038
3039      public ValuedItemComponent copy() {
3040        ValuedItemComponent dst = new ValuedItemComponent();
3041        copyValues(dst);
3042        dst.entity = entity == null ? null : entity.copy();
3043        dst.identifier = identifier == null ? null : identifier.copy();
3044        dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy();
3045        dst.quantity = quantity == null ? null : quantity.copy();
3046        dst.unitPrice = unitPrice == null ? null : unitPrice.copy();
3047        dst.factor = factor == null ? null : factor.copy();
3048        dst.points = points == null ? null : points.copy();
3049        dst.net = net == null ? null : net.copy();
3050        return dst;
3051      }
3052
3053      @Override
3054      public boolean equalsDeep(Base other_) {
3055        if (!super.equalsDeep(other_))
3056          return false;
3057        if (!(other_ instanceof ValuedItemComponent))
3058          return false;
3059        ValuedItemComponent o = (ValuedItemComponent) other_;
3060        return compareDeep(entity, o.entity, true) && compareDeep(identifier, o.identifier, true) && compareDeep(effectiveTime, o.effectiveTime, true)
3061           && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true)
3062           && compareDeep(points, o.points, true) && compareDeep(net, o.net, true);
3063      }
3064
3065      @Override
3066      public boolean equalsShallow(Base other_) {
3067        if (!super.equalsShallow(other_))
3068          return false;
3069        if (!(other_ instanceof ValuedItemComponent))
3070          return false;
3071        ValuedItemComponent o = (ValuedItemComponent) other_;
3072        return compareValues(effectiveTime, o.effectiveTime, true) && compareValues(factor, o.factor, true)
3073           && compareValues(points, o.points, true);
3074      }
3075
3076      public boolean isEmpty() {
3077        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(entity, identifier, effectiveTime
3078          , quantity, unitPrice, factor, points, net);
3079      }
3080
3081  public String fhirType() {
3082    return "Contract.term.asset.valuedItem";
3083
3084  }
3085
3086  }
3087
3088    @Block()
3089    public static class AgentComponent extends BackboneElement implements IBaseBackboneElement {
3090        /**
3091         * Who or what parties are assigned roles in this Contract.
3092         */
3093        @Child(name = "actor", type = {Contract.class, Device.class, Group.class, Location.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, Substance.class}, order=1, min=1, max=1, modifier=false, summary=false)
3094        @Description(shortDefinition="Contract Agent Type", formalDefinition="Who or what parties are assigned roles in this Contract." )
3095        protected Reference actor;
3096
3097        /**
3098         * The actual object that is the target of the reference (Who or what parties are assigned roles in this Contract.)
3099         */
3100        protected Resource actorTarget;
3101
3102        /**
3103         * Role type of agent assigned roles in this Contract.
3104         */
3105        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3106        @Description(shortDefinition="Role type of the agent", formalDefinition="Role type of agent assigned roles in this Contract." )
3107        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-actorrole")
3108        protected List<CodeableConcept> role;
3109
3110        private static final long serialVersionUID = -454551165L;
3111
3112    /**
3113     * Constructor
3114     */
3115      public AgentComponent() {
3116        super();
3117      }
3118
3119    /**
3120     * Constructor
3121     */
3122      public AgentComponent(Reference actor) {
3123        super();
3124        this.actor = actor;
3125      }
3126
3127        /**
3128         * @return {@link #actor} (Who or what parties are assigned roles in this Contract.)
3129         */
3130        public Reference getActor() { 
3131          if (this.actor == null)
3132            if (Configuration.errorOnAutoCreate())
3133              throw new Error("Attempt to auto-create AgentComponent.actor");
3134            else if (Configuration.doAutoCreate())
3135              this.actor = new Reference(); // cc
3136          return this.actor;
3137        }
3138
3139        public boolean hasActor() { 
3140          return this.actor != null && !this.actor.isEmpty();
3141        }
3142
3143        /**
3144         * @param value {@link #actor} (Who or what parties are assigned roles in this Contract.)
3145         */
3146        public AgentComponent setActor(Reference value) { 
3147          this.actor = value;
3148          return this;
3149        }
3150
3151        /**
3152         * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what parties are assigned roles in this Contract.)
3153         */
3154        public Resource getActorTarget() { 
3155          return this.actorTarget;
3156        }
3157
3158        /**
3159         * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what parties are assigned roles in this Contract.)
3160         */
3161        public AgentComponent setActorTarget(Resource value) { 
3162          this.actorTarget = value;
3163          return this;
3164        }
3165
3166        /**
3167         * @return {@link #role} (Role type of agent assigned roles in this Contract.)
3168         */
3169        public List<CodeableConcept> getRole() { 
3170          if (this.role == null)
3171            this.role = new ArrayList<CodeableConcept>();
3172          return this.role;
3173        }
3174
3175        /**
3176         * @return Returns a reference to <code>this</code> for easy method chaining
3177         */
3178        public AgentComponent setRole(List<CodeableConcept> theRole) { 
3179          this.role = theRole;
3180          return this;
3181        }
3182
3183        public boolean hasRole() { 
3184          if (this.role == null)
3185            return false;
3186          for (CodeableConcept item : this.role)
3187            if (!item.isEmpty())
3188              return true;
3189          return false;
3190        }
3191
3192        public CodeableConcept addRole() { //3
3193          CodeableConcept t = new CodeableConcept();
3194          if (this.role == null)
3195            this.role = new ArrayList<CodeableConcept>();
3196          this.role.add(t);
3197          return t;
3198        }
3199
3200        public AgentComponent addRole(CodeableConcept t) { //3
3201          if (t == null)
3202            return this;
3203          if (this.role == null)
3204            this.role = new ArrayList<CodeableConcept>();
3205          this.role.add(t);
3206          return this;
3207        }
3208
3209        /**
3210         * @return The first repetition of repeating field {@link #role}, creating it if it does not already exist
3211         */
3212        public CodeableConcept getRoleFirstRep() { 
3213          if (getRole().isEmpty()) {
3214            addRole();
3215          }
3216          return getRole().get(0);
3217        }
3218
3219        protected void listChildren(List<Property> children) {
3220          super.listChildren(children);
3221          children.add(new Property("actor", "Reference(Contract|Device|Group|Location|Organization|Patient|Practitioner|RelatedPerson|Substance)", "Who or what parties are assigned roles in this Contract.", 0, 1, actor));
3222          children.add(new Property("role", "CodeableConcept", "Role type of agent assigned roles in this Contract.", 0, java.lang.Integer.MAX_VALUE, role));
3223        }
3224
3225        @Override
3226        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3227          switch (_hash) {
3228          case 92645877: /*actor*/  return new Property("actor", "Reference(Contract|Device|Group|Location|Organization|Patient|Practitioner|RelatedPerson|Substance)", "Who or what parties are assigned roles in this Contract.", 0, 1, actor);
3229          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "Role type of agent assigned roles in this Contract.", 0, java.lang.Integer.MAX_VALUE, role);
3230          default: return super.getNamedProperty(_hash, _name, _checkValid);
3231          }
3232
3233        }
3234
3235      @Override
3236      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3237        switch (hash) {
3238        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
3239        case 3506294: /*role*/ return this.role == null ? new Base[0] : this.role.toArray(new Base[this.role.size()]); // CodeableConcept
3240        default: return super.getProperty(hash, name, checkValid);
3241        }
3242
3243      }
3244
3245      @Override
3246      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3247        switch (hash) {
3248        case 92645877: // actor
3249          this.actor = castToReference(value); // Reference
3250          return value;
3251        case 3506294: // role
3252          this.getRole().add(castToCodeableConcept(value)); // CodeableConcept
3253          return value;
3254        default: return super.setProperty(hash, name, value);
3255        }
3256
3257      }
3258
3259      @Override
3260      public Base setProperty(String name, Base value) throws FHIRException {
3261        if (name.equals("actor")) {
3262          this.actor = castToReference(value); // Reference
3263        } else if (name.equals("role")) {
3264          this.getRole().add(castToCodeableConcept(value));
3265        } else
3266          return super.setProperty(name, value);
3267        return value;
3268      }
3269
3270      @Override
3271      public Base makeProperty(int hash, String name) throws FHIRException {
3272        switch (hash) {
3273        case 92645877:  return getActor(); 
3274        case 3506294:  return addRole(); 
3275        default: return super.makeProperty(hash, name);
3276        }
3277
3278      }
3279
3280      @Override
3281      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3282        switch (hash) {
3283        case 92645877: /*actor*/ return new String[] {"Reference"};
3284        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
3285        default: return super.getTypesForProperty(hash, name);
3286        }
3287
3288      }
3289
3290      @Override
3291      public Base addChild(String name) throws FHIRException {
3292        if (name.equals("actor")) {
3293          this.actor = new Reference();
3294          return this.actor;
3295        }
3296        else if (name.equals("role")) {
3297          return addRole();
3298        }
3299        else
3300          return super.addChild(name);
3301      }
3302
3303      public AgentComponent copy() {
3304        AgentComponent dst = new AgentComponent();
3305        copyValues(dst);
3306        dst.actor = actor == null ? null : actor.copy();
3307        if (role != null) {
3308          dst.role = new ArrayList<CodeableConcept>();
3309          for (CodeableConcept i : role)
3310            dst.role.add(i.copy());
3311        };
3312        return dst;
3313      }
3314
3315      @Override
3316      public boolean equalsDeep(Base other_) {
3317        if (!super.equalsDeep(other_))
3318          return false;
3319        if (!(other_ instanceof AgentComponent))
3320          return false;
3321        AgentComponent o = (AgentComponent) other_;
3322        return compareDeep(actor, o.actor, true) && compareDeep(role, o.role, true);
3323      }
3324
3325      @Override
3326      public boolean equalsShallow(Base other_) {
3327        if (!super.equalsShallow(other_))
3328          return false;
3329        if (!(other_ instanceof AgentComponent))
3330          return false;
3331        AgentComponent o = (AgentComponent) other_;
3332        return true;
3333      }
3334
3335      public boolean isEmpty() {
3336        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(actor, role);
3337      }
3338
3339  public String fhirType() {
3340    return "Contract.term.agent";
3341
3342  }
3343
3344  }
3345
3346    @Block()
3347    public static class SignatoryComponent extends BackboneElement implements IBaseBackboneElement {
3348        /**
3349         * Role of this Contract signer, e.g. notary, grantee.
3350         */
3351        @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false)
3352        @Description(shortDefinition="Contract Signatory Role", formalDefinition="Role of this Contract signer, e.g. notary, grantee." )
3353        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-signer-type")
3354        protected Coding type;
3355
3356        /**
3357         * Party which is a signator to this Contract.
3358         */
3359        @Child(name = "party", type = {Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=1, max=1, modifier=false, summary=false)
3360        @Description(shortDefinition="Contract Signatory Party", formalDefinition="Party which is a signator to this Contract." )
3361        protected Reference party;
3362
3363        /**
3364         * The actual object that is the target of the reference (Party which is a signator to this Contract.)
3365         */
3366        protected Resource partyTarget;
3367
3368        /**
3369         * Legally binding Contract DSIG signature contents in Base64.
3370         */
3371        @Child(name = "signature", type = {Signature.class}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3372        @Description(shortDefinition="Contract Documentation Signature", formalDefinition="Legally binding Contract DSIG signature contents in Base64." )
3373        protected List<Signature> signature;
3374
3375        private static final long serialVersionUID = 1948139228L;
3376
3377    /**
3378     * Constructor
3379     */
3380      public SignatoryComponent() {
3381        super();
3382      }
3383
3384    /**
3385     * Constructor
3386     */
3387      public SignatoryComponent(Coding type, Reference party) {
3388        super();
3389        this.type = type;
3390        this.party = party;
3391      }
3392
3393        /**
3394         * @return {@link #type} (Role of this Contract signer, e.g. notary, grantee.)
3395         */
3396        public Coding getType() { 
3397          if (this.type == null)
3398            if (Configuration.errorOnAutoCreate())
3399              throw new Error("Attempt to auto-create SignatoryComponent.type");
3400            else if (Configuration.doAutoCreate())
3401              this.type = new Coding(); // cc
3402          return this.type;
3403        }
3404
3405        public boolean hasType() { 
3406          return this.type != null && !this.type.isEmpty();
3407        }
3408
3409        /**
3410         * @param value {@link #type} (Role of this Contract signer, e.g. notary, grantee.)
3411         */
3412        public SignatoryComponent setType(Coding value) { 
3413          this.type = value;
3414          return this;
3415        }
3416
3417        /**
3418         * @return {@link #party} (Party which is a signator to this Contract.)
3419         */
3420        public Reference getParty() { 
3421          if (this.party == null)
3422            if (Configuration.errorOnAutoCreate())
3423              throw new Error("Attempt to auto-create SignatoryComponent.party");
3424            else if (Configuration.doAutoCreate())
3425              this.party = new Reference(); // cc
3426          return this.party;
3427        }
3428
3429        public boolean hasParty() { 
3430          return this.party != null && !this.party.isEmpty();
3431        }
3432
3433        /**
3434         * @param value {@link #party} (Party which is a signator to this Contract.)
3435         */
3436        public SignatoryComponent setParty(Reference value) { 
3437          this.party = value;
3438          return this;
3439        }
3440
3441        /**
3442         * @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.)
3443         */
3444        public Resource getPartyTarget() { 
3445          return this.partyTarget;
3446        }
3447
3448        /**
3449         * @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.)
3450         */
3451        public SignatoryComponent setPartyTarget(Resource value) { 
3452          this.partyTarget = value;
3453          return this;
3454        }
3455
3456        /**
3457         * @return {@link #signature} (Legally binding Contract DSIG signature contents in Base64.)
3458         */
3459        public List<Signature> getSignature() { 
3460          if (this.signature == null)
3461            this.signature = new ArrayList<Signature>();
3462          return this.signature;
3463        }
3464
3465        /**
3466         * @return Returns a reference to <code>this</code> for easy method chaining
3467         */
3468        public SignatoryComponent setSignature(List<Signature> theSignature) { 
3469          this.signature = theSignature;
3470          return this;
3471        }
3472
3473        public boolean hasSignature() { 
3474          if (this.signature == null)
3475            return false;
3476          for (Signature item : this.signature)
3477            if (!item.isEmpty())
3478              return true;
3479          return false;
3480        }
3481
3482        public Signature addSignature() { //3
3483          Signature t = new Signature();
3484          if (this.signature == null)
3485            this.signature = new ArrayList<Signature>();
3486          this.signature.add(t);
3487          return t;
3488        }
3489
3490        public SignatoryComponent addSignature(Signature t) { //3
3491          if (t == null)
3492            return this;
3493          if (this.signature == null)
3494            this.signature = new ArrayList<Signature>();
3495          this.signature.add(t);
3496          return this;
3497        }
3498
3499        /**
3500         * @return The first repetition of repeating field {@link #signature}, creating it if it does not already exist
3501         */
3502        public Signature getSignatureFirstRep() { 
3503          if (getSignature().isEmpty()) {
3504            addSignature();
3505          }
3506          return getSignature().get(0);
3507        }
3508
3509        protected void listChildren(List<Property> children) {
3510          super.listChildren(children);
3511          children.add(new Property("type", "Coding", "Role of this Contract signer, e.g. notary, grantee.", 0, 1, type));
3512          children.add(new Property("party", "Reference(Organization|Patient|Practitioner|RelatedPerson)", "Party which is a signator to this Contract.", 0, 1, party));
3513          children.add(new Property("signature", "Signature", "Legally binding Contract DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, signature));
3514        }
3515
3516        @Override
3517        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3518          switch (_hash) {
3519          case 3575610: /*type*/  return new Property("type", "Coding", "Role of this Contract signer, e.g. notary, grantee.", 0, 1, type);
3520          case 106437350: /*party*/  return new Property("party", "Reference(Organization|Patient|Practitioner|RelatedPerson)", "Party which is a signator to this Contract.", 0, 1, party);
3521          case 1073584312: /*signature*/  return new Property("signature", "Signature", "Legally binding Contract DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, signature);
3522          default: return super.getNamedProperty(_hash, _name, _checkValid);
3523          }
3524
3525        }
3526
3527      @Override
3528      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3529        switch (hash) {
3530        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
3531        case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference
3532        case 1073584312: /*signature*/ return this.signature == null ? new Base[0] : this.signature.toArray(new Base[this.signature.size()]); // Signature
3533        default: return super.getProperty(hash, name, checkValid);
3534        }
3535
3536      }
3537
3538      @Override
3539      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3540        switch (hash) {
3541        case 3575610: // type
3542          this.type = castToCoding(value); // Coding
3543          return value;
3544        case 106437350: // party
3545          this.party = castToReference(value); // Reference
3546          return value;
3547        case 1073584312: // signature
3548          this.getSignature().add(castToSignature(value)); // Signature
3549          return value;
3550        default: return super.setProperty(hash, name, value);
3551        }
3552
3553      }
3554
3555      @Override
3556      public Base setProperty(String name, Base value) throws FHIRException {
3557        if (name.equals("type")) {
3558          this.type = castToCoding(value); // Coding
3559        } else if (name.equals("party")) {
3560          this.party = castToReference(value); // Reference
3561        } else if (name.equals("signature")) {
3562          this.getSignature().add(castToSignature(value));
3563        } else
3564          return super.setProperty(name, value);
3565        return value;
3566      }
3567
3568      @Override
3569      public Base makeProperty(int hash, String name) throws FHIRException {
3570        switch (hash) {
3571        case 3575610:  return getType(); 
3572        case 106437350:  return getParty(); 
3573        case 1073584312:  return addSignature(); 
3574        default: return super.makeProperty(hash, name);
3575        }
3576
3577      }
3578
3579      @Override
3580      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3581        switch (hash) {
3582        case 3575610: /*type*/ return new String[] {"Coding"};
3583        case 106437350: /*party*/ return new String[] {"Reference"};
3584        case 1073584312: /*signature*/ return new String[] {"Signature"};
3585        default: return super.getTypesForProperty(hash, name);
3586        }
3587
3588      }
3589
3590      @Override
3591      public Base addChild(String name) throws FHIRException {
3592        if (name.equals("type")) {
3593          this.type = new Coding();
3594          return this.type;
3595        }
3596        else if (name.equals("party")) {
3597          this.party = new Reference();
3598          return this.party;
3599        }
3600        else if (name.equals("signature")) {
3601          return addSignature();
3602        }
3603        else
3604          return super.addChild(name);
3605      }
3606
3607      public SignatoryComponent copy() {
3608        SignatoryComponent dst = new SignatoryComponent();
3609        copyValues(dst);
3610        dst.type = type == null ? null : type.copy();
3611        dst.party = party == null ? null : party.copy();
3612        if (signature != null) {
3613          dst.signature = new ArrayList<Signature>();
3614          for (Signature i : signature)
3615            dst.signature.add(i.copy());
3616        };
3617        return dst;
3618      }
3619
3620      @Override
3621      public boolean equalsDeep(Base other_) {
3622        if (!super.equalsDeep(other_))
3623          return false;
3624        if (!(other_ instanceof SignatoryComponent))
3625          return false;
3626        SignatoryComponent o = (SignatoryComponent) other_;
3627        return compareDeep(type, o.type, true) && compareDeep(party, o.party, true) && compareDeep(signature, o.signature, true)
3628          ;
3629      }
3630
3631      @Override
3632      public boolean equalsShallow(Base other_) {
3633        if (!super.equalsShallow(other_))
3634          return false;
3635        if (!(other_ instanceof SignatoryComponent))
3636          return false;
3637        SignatoryComponent o = (SignatoryComponent) other_;
3638        return true;
3639      }
3640
3641      public boolean isEmpty() {
3642        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, party, signature);
3643      }
3644
3645  public String fhirType() {
3646    return "Contract.signer";
3647
3648  }
3649
3650  }
3651
3652    @Block()
3653    public static class FriendlyLanguageComponent extends BackboneElement implements IBaseBackboneElement {
3654        /**
3655         * Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.
3656         */
3657        @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=1, min=1, max=1, modifier=false, summary=false)
3658        @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." )
3659        protected Type content;
3660
3661        private static final long serialVersionUID = -1763459053L;
3662
3663    /**
3664     * Constructor
3665     */
3666      public FriendlyLanguageComponent() {
3667        super();
3668      }
3669
3670    /**
3671     * Constructor
3672     */
3673      public FriendlyLanguageComponent(Type content) {
3674        super();
3675        this.content = content;
3676      }
3677
3678        /**
3679         * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.)
3680         */
3681        public Type getContent() { 
3682          return this.content;
3683        }
3684
3685        /**
3686         * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.)
3687         */
3688        public Attachment getContentAttachment() throws FHIRException { 
3689          if (this.content == null)
3690            return null;
3691          if (!(this.content instanceof Attachment))
3692            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
3693          return (Attachment) this.content;
3694        }
3695
3696        public boolean hasContentAttachment() { 
3697          return this != null && this.content instanceof Attachment;
3698        }
3699
3700        /**
3701         * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.)
3702         */
3703        public Reference getContentReference() throws FHIRException { 
3704          if (this.content == null)
3705            return null;
3706          if (!(this.content instanceof Reference))
3707            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered");
3708          return (Reference) this.content;
3709        }
3710
3711        public boolean hasContentReference() { 
3712          return this != null && this.content instanceof Reference;
3713        }
3714
3715        public boolean hasContent() { 
3716          return this.content != null && !this.content.isEmpty();
3717        }
3718
3719        /**
3720         * @param value {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.)
3721         */
3722        public FriendlyLanguageComponent setContent(Type value) { 
3723          if (value != null && !(value instanceof Attachment || value instanceof Reference))
3724            throw new Error("Not the right type for Contract.friendly.content[x]: "+value.fhirType());
3725          this.content = value;
3726          return this;
3727        }
3728
3729        protected void listChildren(List<Property> children) {
3730          super.listChildren(children);
3731          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));
3732        }
3733
3734        @Override
3735        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3736          switch (_hash) {
3737          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);
3738          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);
3739          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);
3740          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);
3741          default: return super.getNamedProperty(_hash, _name, _checkValid);
3742          }
3743
3744        }
3745
3746      @Override
3747      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3748        switch (hash) {
3749        case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type
3750        default: return super.getProperty(hash, name, checkValid);
3751        }
3752
3753      }
3754
3755      @Override
3756      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3757        switch (hash) {
3758        case 951530617: // content
3759          this.content = castToType(value); // Type
3760          return value;
3761        default: return super.setProperty(hash, name, value);
3762        }
3763
3764      }
3765
3766      @Override
3767      public Base setProperty(String name, Base value) throws FHIRException {
3768        if (name.equals("content[x]")) {
3769          this.content = castToType(value); // Type
3770        } else
3771          return super.setProperty(name, value);
3772        return value;
3773      }
3774
3775      @Override
3776      public Base makeProperty(int hash, String name) throws FHIRException {
3777        switch (hash) {
3778        case 264548711:  return getContent(); 
3779        case 951530617:  return getContent(); 
3780        default: return super.makeProperty(hash, name);
3781        }
3782
3783      }
3784
3785      @Override
3786      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3787        switch (hash) {
3788        case 951530617: /*content*/ return new String[] {"Attachment", "Reference"};
3789        default: return super.getTypesForProperty(hash, name);
3790        }
3791
3792      }
3793
3794      @Override
3795      public Base addChild(String name) throws FHIRException {
3796        if (name.equals("contentAttachment")) {
3797          this.content = new Attachment();
3798          return this.content;
3799        }
3800        else if (name.equals("contentReference")) {
3801          this.content = new Reference();
3802          return this.content;
3803        }
3804        else
3805          return super.addChild(name);
3806      }
3807
3808      public FriendlyLanguageComponent copy() {
3809        FriendlyLanguageComponent dst = new FriendlyLanguageComponent();
3810        copyValues(dst);
3811        dst.content = content == null ? null : content.copy();
3812        return dst;
3813      }
3814
3815      @Override
3816      public boolean equalsDeep(Base other_) {
3817        if (!super.equalsDeep(other_))
3818          return false;
3819        if (!(other_ instanceof FriendlyLanguageComponent))
3820          return false;
3821        FriendlyLanguageComponent o = (FriendlyLanguageComponent) other_;
3822        return compareDeep(content, o.content, true);
3823      }
3824
3825      @Override
3826      public boolean equalsShallow(Base other_) {
3827        if (!super.equalsShallow(other_))
3828          return false;
3829        if (!(other_ instanceof FriendlyLanguageComponent))
3830          return false;
3831        FriendlyLanguageComponent o = (FriendlyLanguageComponent) other_;
3832        return true;
3833      }
3834
3835      public boolean isEmpty() {
3836        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(content);
3837      }
3838
3839  public String fhirType() {
3840    return "Contract.friendly";
3841
3842  }
3843
3844  }
3845
3846    @Block()
3847    public static class LegalLanguageComponent extends BackboneElement implements IBaseBackboneElement {
3848        /**
3849         * Contract legal text in human renderable form.
3850         */
3851        @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=1, min=1, max=1, modifier=false, summary=false)
3852        @Description(shortDefinition="Contract Legal Text", formalDefinition="Contract legal text in human renderable form." )
3853        protected Type content;
3854
3855        private static final long serialVersionUID = -1763459053L;
3856
3857    /**
3858     * Constructor
3859     */
3860      public LegalLanguageComponent() {
3861        super();
3862      }
3863
3864    /**
3865     * Constructor
3866     */
3867      public LegalLanguageComponent(Type content) {
3868        super();
3869        this.content = content;
3870      }
3871
3872        /**
3873         * @return {@link #content} (Contract legal text in human renderable form.)
3874         */
3875        public Type getContent() { 
3876          return this.content;
3877        }
3878
3879        /**
3880         * @return {@link #content} (Contract legal text in human renderable form.)
3881         */
3882        public Attachment getContentAttachment() throws FHIRException { 
3883          if (this.content == null)
3884            return null;
3885          if (!(this.content instanceof Attachment))
3886            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
3887          return (Attachment) this.content;
3888        }
3889
3890        public boolean hasContentAttachment() { 
3891          return this != null && this.content instanceof Attachment;
3892        }
3893
3894        /**
3895         * @return {@link #content} (Contract legal text in human renderable form.)
3896         */
3897        public Reference getContentReference() throws FHIRException { 
3898          if (this.content == null)
3899            return null;
3900          if (!(this.content instanceof Reference))
3901            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered");
3902          return (Reference) this.content;
3903        }
3904
3905        public boolean hasContentReference() { 
3906          return this != null && this.content instanceof Reference;
3907        }
3908
3909        public boolean hasContent() { 
3910          return this.content != null && !this.content.isEmpty();
3911        }
3912
3913        /**
3914         * @param value {@link #content} (Contract legal text in human renderable form.)
3915         */
3916        public LegalLanguageComponent setContent(Type value) { 
3917          if (value != null && !(value instanceof Attachment || value instanceof Reference))
3918            throw new Error("Not the right type for Contract.legal.content[x]: "+value.fhirType());
3919          this.content = value;
3920          return this;
3921        }
3922
3923        protected void listChildren(List<Property> children) {
3924          super.listChildren(children);
3925          children.add(new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content));
3926        }
3927
3928        @Override
3929        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3930          switch (_hash) {
3931          case 264548711: /*content[x]*/  return new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content);
3932          case 951530617: /*content*/  return new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content);
3933          case -702028164: /*contentAttachment*/  return new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content);
3934          case 1193747154: /*contentReference*/  return new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, 1, content);
3935          default: return super.getNamedProperty(_hash, _name, _checkValid);
3936          }
3937
3938        }
3939
3940      @Override
3941      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3942        switch (hash) {
3943        case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type
3944        default: return super.getProperty(hash, name, checkValid);
3945        }
3946
3947      }
3948
3949      @Override
3950      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3951        switch (hash) {
3952        case 951530617: // content
3953          this.content = castToType(value); // Type
3954          return value;
3955        default: return super.setProperty(hash, name, value);
3956        }
3957
3958      }
3959
3960      @Override
3961      public Base setProperty(String name, Base value) throws FHIRException {
3962        if (name.equals("content[x]")) {
3963          this.content = castToType(value); // Type
3964        } else
3965          return super.setProperty(name, value);
3966        return value;
3967      }
3968
3969      @Override
3970      public Base makeProperty(int hash, String name) throws FHIRException {
3971        switch (hash) {
3972        case 264548711:  return getContent(); 
3973        case 951530617:  return getContent(); 
3974        default: return super.makeProperty(hash, name);
3975        }
3976
3977      }
3978
3979      @Override
3980      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3981        switch (hash) {
3982        case 951530617: /*content*/ return new String[] {"Attachment", "Reference"};
3983        default: return super.getTypesForProperty(hash, name);
3984        }
3985
3986      }
3987
3988      @Override
3989      public Base addChild(String name) throws FHIRException {
3990        if (name.equals("contentAttachment")) {
3991          this.content = new Attachment();
3992          return this.content;
3993        }
3994        else if (name.equals("contentReference")) {
3995          this.content = new Reference();
3996          return this.content;
3997        }
3998        else
3999          return super.addChild(name);
4000      }
4001
4002      public LegalLanguageComponent copy() {
4003        LegalLanguageComponent dst = new LegalLanguageComponent();
4004        copyValues(dst);
4005        dst.content = content == null ? null : content.copy();
4006        return dst;
4007      }
4008
4009      @Override
4010      public boolean equalsDeep(Base other_) {
4011        if (!super.equalsDeep(other_))
4012          return false;
4013        if (!(other_ instanceof LegalLanguageComponent))
4014          return false;
4015        LegalLanguageComponent o = (LegalLanguageComponent) other_;
4016        return compareDeep(content, o.content, true);
4017      }
4018
4019      @Override
4020      public boolean equalsShallow(Base other_) {
4021        if (!super.equalsShallow(other_))
4022          return false;
4023        if (!(other_ instanceof LegalLanguageComponent))
4024          return false;
4025        LegalLanguageComponent o = (LegalLanguageComponent) other_;
4026        return true;
4027      }
4028
4029      public boolean isEmpty() {
4030        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(content);
4031      }
4032
4033  public String fhirType() {
4034    return "Contract.legal";
4035
4036  }
4037
4038  }
4039
4040    @Block()
4041    public static class ComputableLanguageComponent extends BackboneElement implements IBaseBackboneElement {
4042        /**
4043         * Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).
4044         */
4045        @Child(name = "content", type = {Attachment.class, DocumentReference.class}, order=1, min=1, max=1, modifier=false, summary=false)
4046        @Description(shortDefinition="Computable Contract Rules", formalDefinition="Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal)." )
4047        protected Type content;
4048
4049        private static final long serialVersionUID = -1763459053L;
4050
4051    /**
4052     * Constructor
4053     */
4054      public ComputableLanguageComponent() {
4055        super();
4056      }
4057
4058    /**
4059     * Constructor
4060     */
4061      public ComputableLanguageComponent(Type content) {
4062        super();
4063        this.content = content;
4064      }
4065
4066        /**
4067         * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).)
4068         */
4069        public Type getContent() { 
4070          return this.content;
4071        }
4072
4073        /**
4074         * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).)
4075         */
4076        public Attachment getContentAttachment() throws FHIRException { 
4077          if (this.content == null)
4078            return null;
4079          if (!(this.content instanceof Attachment))
4080            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
4081          return (Attachment) this.content;
4082        }
4083
4084        public boolean hasContentAttachment() { 
4085          return this != null && this.content instanceof Attachment;
4086        }
4087
4088        /**
4089         * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).)
4090         */
4091        public Reference getContentReference() throws FHIRException { 
4092          if (this.content == null)
4093            return null;
4094          if (!(this.content instanceof Reference))
4095            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered");
4096          return (Reference) this.content;
4097        }
4098
4099        public boolean hasContentReference() { 
4100          return this != null && this.content instanceof Reference;
4101        }
4102
4103        public boolean hasContent() { 
4104          return this.content != null && !this.content.isEmpty();
4105        }
4106
4107        /**
4108         * @param value {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).)
4109         */
4110        public ComputableLanguageComponent setContent(Type value) { 
4111          if (value != null && !(value instanceof Attachment || value instanceof Reference))
4112            throw new Error("Not the right type for Contract.rule.content[x]: "+value.fhirType());
4113          this.content = value;
4114          return this;
4115        }
4116
4117        protected void listChildren(List<Property> children) {
4118          super.listChildren(children);
4119          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));
4120        }
4121
4122        @Override
4123        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4124          switch (_hash) {
4125          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);
4126          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);
4127          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);
4128          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);
4129          default: return super.getNamedProperty(_hash, _name, _checkValid);
4130          }
4131
4132        }
4133
4134      @Override
4135      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4136        switch (hash) {
4137        case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type
4138        default: return super.getProperty(hash, name, checkValid);
4139        }
4140
4141      }
4142
4143      @Override
4144      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4145        switch (hash) {
4146        case 951530617: // content
4147          this.content = castToType(value); // Type
4148          return value;
4149        default: return super.setProperty(hash, name, value);
4150        }
4151
4152      }
4153
4154      @Override
4155      public Base setProperty(String name, Base value) throws FHIRException {
4156        if (name.equals("content[x]")) {
4157          this.content = castToType(value); // Type
4158        } else
4159          return super.setProperty(name, value);
4160        return value;
4161      }
4162
4163      @Override
4164      public Base makeProperty(int hash, String name) throws FHIRException {
4165        switch (hash) {
4166        case 264548711:  return getContent(); 
4167        case 951530617:  return getContent(); 
4168        default: return super.makeProperty(hash, name);
4169        }
4170
4171      }
4172
4173      @Override
4174      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4175        switch (hash) {
4176        case 951530617: /*content*/ return new String[] {"Attachment", "Reference"};
4177        default: return super.getTypesForProperty(hash, name);
4178        }
4179
4180      }
4181
4182      @Override
4183      public Base addChild(String name) throws FHIRException {
4184        if (name.equals("contentAttachment")) {
4185          this.content = new Attachment();
4186          return this.content;
4187        }
4188        else if (name.equals("contentReference")) {
4189          this.content = new Reference();
4190          return this.content;
4191        }
4192        else
4193          return super.addChild(name);
4194      }
4195
4196      public ComputableLanguageComponent copy() {
4197        ComputableLanguageComponent dst = new ComputableLanguageComponent();
4198        copyValues(dst);
4199        dst.content = content == null ? null : content.copy();
4200        return dst;
4201      }
4202
4203      @Override
4204      public boolean equalsDeep(Base other_) {
4205        if (!super.equalsDeep(other_))
4206          return false;
4207        if (!(other_ instanceof ComputableLanguageComponent))
4208          return false;
4209        ComputableLanguageComponent o = (ComputableLanguageComponent) other_;
4210        return compareDeep(content, o.content, true);
4211      }
4212
4213      @Override
4214      public boolean equalsShallow(Base other_) {
4215        if (!super.equalsShallow(other_))
4216          return false;
4217        if (!(other_ instanceof ComputableLanguageComponent))
4218          return false;
4219        ComputableLanguageComponent o = (ComputableLanguageComponent) other_;
4220        return true;
4221      }
4222
4223      public boolean isEmpty() {
4224        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(content);
4225      }
4226
4227  public String fhirType() {
4228    return "Contract.rule";
4229
4230  }
4231
4232  }
4233
4234    /**
4235     * Unique identifier for this Contract or a derivative that references a Source Contract.
4236     */
4237    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4238    @Description(shortDefinition="Contract number", formalDefinition="Unique identifier for this Contract or a derivative that references a Source Contract." )
4239    protected List<Identifier> identifier;
4240
4241    /**
4242     * The status of the resource instance.
4243     */
4244    @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true)
4245    @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." )
4246    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-status")
4247    protected Enumeration<ContractStatus> status;
4248
4249    /**
4250     * The minimal content derived from the basal information source at a specific stage in its lifecycle.
4251     */
4252    @Child(name = "contentDerivative", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
4253    @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." )
4254    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-content-derivative")
4255    protected CodeableConcept contentDerivative;
4256
4257    /**
4258     * When this  Contract was issued.
4259     */
4260    @Child(name = "issued", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
4261    @Description(shortDefinition="When this Contract was issued", formalDefinition="When this  Contract was issued." )
4262    protected DateTimeType issued;
4263
4264    /**
4265     * Relevant time or time-period when this Contract is applicable.
4266     */
4267    @Child(name = "applies", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=true)
4268    @Description(shortDefinition="Effective time", formalDefinition="Relevant time or time-period when this Contract is applicable." )
4269    protected Period applies;
4270
4271    /**
4272     * The target entity impacted by or of interest to parties to the agreement.
4273     */
4274    @Child(name = "subject", type = {Reference.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4275    @Description(shortDefinition="Contract Target Entity", formalDefinition="The target entity impacted by or of interest to parties to the agreement." )
4276    protected List<Reference> subject;
4277    /**
4278     * The actual objects that are the target of the reference (The target entity impacted by or of interest to parties to the agreement.)
4279     */
4280    protected List<Resource> subjectTarget;
4281
4282
4283    /**
4284     * 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.
4285     */
4286    @Child(name = "authority", type = {Organization.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4287    @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." )
4288    protected List<Reference> authority;
4289    /**
4290     * 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.)
4291     */
4292    protected List<Organization> authorityTarget;
4293
4294
4295    /**
4296     * 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.
4297     */
4298    @Child(name = "domain", type = {Location.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4299    @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." )
4300    protected List<Reference> domain;
4301    /**
4302     * 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.)
4303     */
4304    protected List<Location> domainTarget;
4305
4306
4307    /**
4308     * Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.
4309     */
4310    @Child(name = "type", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=true)
4311    @Description(shortDefinition="Type or form", formalDefinition="Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc." )
4312    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-type")
4313    protected CodeableConcept type;
4314
4315    /**
4316     * More specific type or specialization of an overarching or more general contract such as auto insurance, home owner  insurance, prenupial agreement, Advanced-Directive, or privacy consent.
4317     */
4318    @Child(name = "subType", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4319    @Description(shortDefinition="Subtype within the context of type", formalDefinition="More specific type or specialization of an overarching or more general contract such as auto insurance, home owner  insurance, prenupial agreement, Advanced-Directive, or privacy consent." )
4320    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contract-subtype")
4321    protected List<CodeableConcept> subType;
4322
4323    /**
4324     * One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.
4325     */
4326    @Child(name = "term", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4327    @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." )
4328    protected List<TermComponent> term;
4329
4330    /**
4331     * 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.
4332     */
4333    @Child(name = "signer", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4334    @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." )
4335    protected List<SignatoryComponent> signer;
4336
4337    /**
4338     * 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.
4339     */
4340    @Child(name = "friendly", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4341    @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." )
4342    protected List<FriendlyLanguageComponent> friendly;
4343
4344    /**
4345     * List of Legal expressions or representations of this Contract.
4346     */
4347    @Child(name = "legal", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4348    @Description(shortDefinition="Contract Legal Language", formalDefinition="List of Legal expressions or representations of this Contract." )
4349    protected List<LegalLanguageComponent> legal;
4350
4351    /**
4352     * List of Computable Policy Rule Language Representations of this Contract.
4353     */
4354    @Child(name = "rule", type = {}, order=14, min=0, max=1, modifier=false, summary=false)
4355    @Description(shortDefinition="Computable Contract Language", formalDefinition="List of Computable Policy Rule Language Representations of this Contract." )
4356    protected ComputableLanguageComponent rule;
4357
4358    /**
4359     * 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.
4360     */
4361    @Child(name = "legallyBinding", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class, Contract.class}, order=15, min=0, max=1, modifier=false, summary=false)
4362    @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." )
4363    protected Type legallyBinding;
4364
4365    private static final long serialVersionUID = 1347256849L;
4366
4367  /**
4368   * Constructor
4369   */
4370    public Contract() {
4371      super();
4372    }
4373
4374    /**
4375     * @return {@link #identifier} (Unique identifier for this Contract or a derivative that references a Source Contract.)
4376     */
4377    public List<Identifier> getIdentifier() { 
4378      if (this.identifier == null)
4379        this.identifier = new ArrayList<Identifier>();
4380      return this.identifier;
4381    }
4382
4383    /**
4384     * @return Returns a reference to <code>this</code> for easy method chaining
4385     */
4386    public Contract setIdentifier(List<Identifier> theIdentifier) { 
4387      this.identifier = theIdentifier;
4388      return this;
4389    }
4390
4391    public boolean hasIdentifier() { 
4392      if (this.identifier == null)
4393        return false;
4394      for (Identifier item : this.identifier)
4395        if (!item.isEmpty())
4396          return true;
4397      return false;
4398    }
4399
4400    public Identifier addIdentifier() { //3
4401      Identifier t = new Identifier();
4402      if (this.identifier == null)
4403        this.identifier = new ArrayList<Identifier>();
4404      this.identifier.add(t);
4405      return t;
4406    }
4407
4408    public Contract addIdentifier(Identifier t) { //3
4409      if (t == null)
4410        return this;
4411      if (this.identifier == null)
4412        this.identifier = new ArrayList<Identifier>();
4413      this.identifier.add(t);
4414      return this;
4415    }
4416
4417    /**
4418     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
4419     */
4420    public Identifier getIdentifierFirstRep() { 
4421      if (getIdentifier().isEmpty()) {
4422        addIdentifier();
4423      }
4424      return getIdentifier().get(0);
4425    }
4426
4427    /**
4428     * @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
4429     */
4430    public Enumeration<ContractStatus> getStatusElement() { 
4431      if (this.status == null)
4432        if (Configuration.errorOnAutoCreate())
4433          throw new Error("Attempt to auto-create Contract.status");
4434        else if (Configuration.doAutoCreate())
4435          this.status = new Enumeration<ContractStatus>(new ContractStatusEnumFactory()); // bb
4436      return this.status;
4437    }
4438
4439    public boolean hasStatusElement() { 
4440      return this.status != null && !this.status.isEmpty();
4441    }
4442
4443    public boolean hasStatus() { 
4444      return this.status != null && !this.status.isEmpty();
4445    }
4446
4447    /**
4448     * @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
4449     */
4450    public Contract setStatusElement(Enumeration<ContractStatus> value) { 
4451      this.status = value;
4452      return this;
4453    }
4454
4455    /**
4456     * @return The status of the resource instance.
4457     */
4458    public ContractStatus getStatus() { 
4459      return this.status == null ? null : this.status.getValue();
4460    }
4461
4462    /**
4463     * @param value The status of the resource instance.
4464     */
4465    public Contract setStatus(ContractStatus value) { 
4466      if (value == null)
4467        this.status = null;
4468      else {
4469        if (this.status == null)
4470          this.status = new Enumeration<ContractStatus>(new ContractStatusEnumFactory());
4471        this.status.setValue(value);
4472      }
4473      return this;
4474    }
4475
4476    /**
4477     * @return {@link #contentDerivative} (The minimal content derived from the basal information source at a specific stage in its lifecycle.)
4478     */
4479    public CodeableConcept getContentDerivative() { 
4480      if (this.contentDerivative == null)
4481        if (Configuration.errorOnAutoCreate())
4482          throw new Error("Attempt to auto-create Contract.contentDerivative");
4483        else if (Configuration.doAutoCreate())
4484          this.contentDerivative = new CodeableConcept(); // cc
4485      return this.contentDerivative;
4486    }
4487
4488    public boolean hasContentDerivative() { 
4489      return this.contentDerivative != null && !this.contentDerivative.isEmpty();
4490    }
4491
4492    /**
4493     * @param value {@link #contentDerivative} (The minimal content derived from the basal information source at a specific stage in its lifecycle.)
4494     */
4495    public Contract setContentDerivative(CodeableConcept value) { 
4496      this.contentDerivative = value;
4497      return this;
4498    }
4499
4500    /**
4501     * @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
4502     */
4503    public DateTimeType getIssuedElement() { 
4504      if (this.issued == null)
4505        if (Configuration.errorOnAutoCreate())
4506          throw new Error("Attempt to auto-create Contract.issued");
4507        else if (Configuration.doAutoCreate())
4508          this.issued = new DateTimeType(); // bb
4509      return this.issued;
4510    }
4511
4512    public boolean hasIssuedElement() { 
4513      return this.issued != null && !this.issued.isEmpty();
4514    }
4515
4516    public boolean hasIssued() { 
4517      return this.issued != null && !this.issued.isEmpty();
4518    }
4519
4520    /**
4521     * @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
4522     */
4523    public Contract setIssuedElement(DateTimeType value) { 
4524      this.issued = value;
4525      return this;
4526    }
4527
4528    /**
4529     * @return When this  Contract was issued.
4530     */
4531    public Date getIssued() { 
4532      return this.issued == null ? null : this.issued.getValue();
4533    }
4534
4535    /**
4536     * @param value When this  Contract was issued.
4537     */
4538    public Contract setIssued(Date value) { 
4539      if (value == null)
4540        this.issued = null;
4541      else {
4542        if (this.issued == null)
4543          this.issued = new DateTimeType();
4544        this.issued.setValue(value);
4545      }
4546      return this;
4547    }
4548
4549    /**
4550     * @return {@link #applies} (Relevant time or time-period when this Contract is applicable.)
4551     */
4552    public Period getApplies() { 
4553      if (this.applies == null)
4554        if (Configuration.errorOnAutoCreate())
4555          throw new Error("Attempt to auto-create Contract.applies");
4556        else if (Configuration.doAutoCreate())
4557          this.applies = new Period(); // cc
4558      return this.applies;
4559    }
4560
4561    public boolean hasApplies() { 
4562      return this.applies != null && !this.applies.isEmpty();
4563    }
4564
4565    /**
4566     * @param value {@link #applies} (Relevant time or time-period when this Contract is applicable.)
4567     */
4568    public Contract setApplies(Period value) { 
4569      this.applies = value;
4570      return this;
4571    }
4572
4573    /**
4574     * @return {@link #subject} (The target entity impacted by or of interest to parties to the agreement.)
4575     */
4576    public List<Reference> getSubject() { 
4577      if (this.subject == null)
4578        this.subject = new ArrayList<Reference>();
4579      return this.subject;
4580    }
4581
4582    /**
4583     * @return Returns a reference to <code>this</code> for easy method chaining
4584     */
4585    public Contract setSubject(List<Reference> theSubject) { 
4586      this.subject = theSubject;
4587      return this;
4588    }
4589
4590    public boolean hasSubject() { 
4591      if (this.subject == null)
4592        return false;
4593      for (Reference item : this.subject)
4594        if (!item.isEmpty())
4595          return true;
4596      return false;
4597    }
4598
4599    public Reference addSubject() { //3
4600      Reference t = new Reference();
4601      if (this.subject == null)
4602        this.subject = new ArrayList<Reference>();
4603      this.subject.add(t);
4604      return t;
4605    }
4606
4607    public Contract addSubject(Reference t) { //3
4608      if (t == null)
4609        return this;
4610      if (this.subject == null)
4611        this.subject = new ArrayList<Reference>();
4612      this.subject.add(t);
4613      return this;
4614    }
4615
4616    /**
4617     * @return The first repetition of repeating field {@link #subject}, creating it if it does not already exist
4618     */
4619    public Reference getSubjectFirstRep() { 
4620      if (getSubject().isEmpty()) {
4621        addSubject();
4622      }
4623      return getSubject().get(0);
4624    }
4625
4626    /**
4627     * @deprecated Use Reference#setResource(IBaseResource) instead
4628     */
4629    @Deprecated
4630    public List<Resource> getSubjectTarget() { 
4631      if (this.subjectTarget == null)
4632        this.subjectTarget = new ArrayList<Resource>();
4633      return this.subjectTarget;
4634    }
4635
4636    /**
4637     * @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.)
4638     */
4639    public List<Reference> getAuthority() { 
4640      if (this.authority == null)
4641        this.authority = new ArrayList<Reference>();
4642      return this.authority;
4643    }
4644
4645    /**
4646     * @return Returns a reference to <code>this</code> for easy method chaining
4647     */
4648    public Contract setAuthority(List<Reference> theAuthority) { 
4649      this.authority = theAuthority;
4650      return this;
4651    }
4652
4653    public boolean hasAuthority() { 
4654      if (this.authority == null)
4655        return false;
4656      for (Reference item : this.authority)
4657        if (!item.isEmpty())
4658          return true;
4659      return false;
4660    }
4661
4662    public Reference addAuthority() { //3
4663      Reference t = new Reference();
4664      if (this.authority == null)
4665        this.authority = new ArrayList<Reference>();
4666      this.authority.add(t);
4667      return t;
4668    }
4669
4670    public Contract addAuthority(Reference t) { //3
4671      if (t == null)
4672        return this;
4673      if (this.authority == null)
4674        this.authority = new ArrayList<Reference>();
4675      this.authority.add(t);
4676      return this;
4677    }
4678
4679    /**
4680     * @return The first repetition of repeating field {@link #authority}, creating it if it does not already exist
4681     */
4682    public Reference getAuthorityFirstRep() { 
4683      if (getAuthority().isEmpty()) {
4684        addAuthority();
4685      }
4686      return getAuthority().get(0);
4687    }
4688
4689    /**
4690     * @deprecated Use Reference#setResource(IBaseResource) instead
4691     */
4692    @Deprecated
4693    public List<Organization> getAuthorityTarget() { 
4694      if (this.authorityTarget == null)
4695        this.authorityTarget = new ArrayList<Organization>();
4696      return this.authorityTarget;
4697    }
4698
4699    /**
4700     * @deprecated Use Reference#setResource(IBaseResource) instead
4701     */
4702    @Deprecated
4703    public Organization addAuthorityTarget() { 
4704      Organization r = new Organization();
4705      if (this.authorityTarget == null)
4706        this.authorityTarget = new ArrayList<Organization>();
4707      this.authorityTarget.add(r);
4708      return r;
4709    }
4710
4711    /**
4712     * @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.)
4713     */
4714    public List<Reference> getDomain() { 
4715      if (this.domain == null)
4716        this.domain = new ArrayList<Reference>();
4717      return this.domain;
4718    }
4719
4720    /**
4721     * @return Returns a reference to <code>this</code> for easy method chaining
4722     */
4723    public Contract setDomain(List<Reference> theDomain) { 
4724      this.domain = theDomain;
4725      return this;
4726    }
4727
4728    public boolean hasDomain() { 
4729      if (this.domain == null)
4730        return false;
4731      for (Reference item : this.domain)
4732        if (!item.isEmpty())
4733          return true;
4734      return false;
4735    }
4736
4737    public Reference addDomain() { //3
4738      Reference t = new Reference();
4739      if (this.domain == null)
4740        this.domain = new ArrayList<Reference>();
4741      this.domain.add(t);
4742      return t;
4743    }
4744
4745    public Contract addDomain(Reference t) { //3
4746      if (t == null)
4747        return this;
4748      if (this.domain == null)
4749        this.domain = new ArrayList<Reference>();
4750      this.domain.add(t);
4751      return this;
4752    }
4753
4754    /**
4755     * @return The first repetition of repeating field {@link #domain}, creating it if it does not already exist
4756     */
4757    public Reference getDomainFirstRep() { 
4758      if (getDomain().isEmpty()) {
4759        addDomain();
4760      }
4761      return getDomain().get(0);
4762    }
4763
4764    /**
4765     * @deprecated Use Reference#setResource(IBaseResource) instead
4766     */
4767    @Deprecated
4768    public List<Location> getDomainTarget() { 
4769      if (this.domainTarget == null)
4770        this.domainTarget = new ArrayList<Location>();
4771      return this.domainTarget;
4772    }
4773
4774    /**
4775     * @deprecated Use Reference#setResource(IBaseResource) instead
4776     */
4777    @Deprecated
4778    public Location addDomainTarget() { 
4779      Location r = new Location();
4780      if (this.domainTarget == null)
4781        this.domainTarget = new ArrayList<Location>();
4782      this.domainTarget.add(r);
4783      return r;
4784    }
4785
4786    /**
4787     * @return {@link #type} (Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.)
4788     */
4789    public CodeableConcept getType() { 
4790      if (this.type == null)
4791        if (Configuration.errorOnAutoCreate())
4792          throw new Error("Attempt to auto-create Contract.type");
4793        else if (Configuration.doAutoCreate())
4794          this.type = new CodeableConcept(); // cc
4795      return this.type;
4796    }
4797
4798    public boolean hasType() { 
4799      return this.type != null && !this.type.isEmpty();
4800    }
4801
4802    /**
4803     * @param value {@link #type} (Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.)
4804     */
4805    public Contract setType(CodeableConcept value) { 
4806      this.type = value;
4807      return this;
4808    }
4809
4810    /**
4811     * @return {@link #subType} (More specific type or specialization of an overarching or more general contract such as auto insurance, home owner  insurance, prenupial agreement, Advanced-Directive, or privacy consent.)
4812     */
4813    public List<CodeableConcept> getSubType() { 
4814      if (this.subType == null)
4815        this.subType = new ArrayList<CodeableConcept>();
4816      return this.subType;
4817    }
4818
4819    /**
4820     * @return Returns a reference to <code>this</code> for easy method chaining
4821     */
4822    public Contract setSubType(List<CodeableConcept> theSubType) { 
4823      this.subType = theSubType;
4824      return this;
4825    }
4826
4827    public boolean hasSubType() { 
4828      if (this.subType == null)
4829        return false;
4830      for (CodeableConcept item : this.subType)
4831        if (!item.isEmpty())
4832          return true;
4833      return false;
4834    }
4835
4836    public CodeableConcept addSubType() { //3
4837      CodeableConcept t = new CodeableConcept();
4838      if (this.subType == null)
4839        this.subType = new ArrayList<CodeableConcept>();
4840      this.subType.add(t);
4841      return t;
4842    }
4843
4844    public Contract addSubType(CodeableConcept t) { //3
4845      if (t == null)
4846        return this;
4847      if (this.subType == null)
4848        this.subType = new ArrayList<CodeableConcept>();
4849      this.subType.add(t);
4850      return this;
4851    }
4852
4853    /**
4854     * @return The first repetition of repeating field {@link #subType}, creating it if it does not already exist
4855     */
4856    public CodeableConcept getSubTypeFirstRep() { 
4857      if (getSubType().isEmpty()) {
4858        addSubType();
4859      }
4860      return getSubType().get(0);
4861    }
4862
4863    /**
4864     * @return {@link #term} (One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.)
4865     */
4866    public List<TermComponent> getTerm() { 
4867      if (this.term == null)
4868        this.term = new ArrayList<TermComponent>();
4869      return this.term;
4870    }
4871
4872    /**
4873     * @return Returns a reference to <code>this</code> for easy method chaining
4874     */
4875    public Contract setTerm(List<TermComponent> theTerm) { 
4876      this.term = theTerm;
4877      return this;
4878    }
4879
4880    public boolean hasTerm() { 
4881      if (this.term == null)
4882        return false;
4883      for (TermComponent item : this.term)
4884        if (!item.isEmpty())
4885          return true;
4886      return false;
4887    }
4888
4889    public TermComponent addTerm() { //3
4890      TermComponent t = new TermComponent();
4891      if (this.term == null)
4892        this.term = new ArrayList<TermComponent>();
4893      this.term.add(t);
4894      return t;
4895    }
4896
4897    public Contract addTerm(TermComponent t) { //3
4898      if (t == null)
4899        return this;
4900      if (this.term == null)
4901        this.term = new ArrayList<TermComponent>();
4902      this.term.add(t);
4903      return this;
4904    }
4905
4906    /**
4907     * @return The first repetition of repeating field {@link #term}, creating it if it does not already exist
4908     */
4909    public TermComponent getTermFirstRep() { 
4910      if (getTerm().isEmpty()) {
4911        addTerm();
4912      }
4913      return getTerm().get(0);
4914    }
4915
4916    /**
4917     * @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.)
4918     */
4919    public List<SignatoryComponent> getSigner() { 
4920      if (this.signer == null)
4921        this.signer = new ArrayList<SignatoryComponent>();
4922      return this.signer;
4923    }
4924
4925    /**
4926     * @return Returns a reference to <code>this</code> for easy method chaining
4927     */
4928    public Contract setSigner(List<SignatoryComponent> theSigner) { 
4929      this.signer = theSigner;
4930      return this;
4931    }
4932
4933    public boolean hasSigner() { 
4934      if (this.signer == null)
4935        return false;
4936      for (SignatoryComponent item : this.signer)
4937        if (!item.isEmpty())
4938          return true;
4939      return false;
4940    }
4941
4942    public SignatoryComponent addSigner() { //3
4943      SignatoryComponent t = new SignatoryComponent();
4944      if (this.signer == null)
4945        this.signer = new ArrayList<SignatoryComponent>();
4946      this.signer.add(t);
4947      return t;
4948    }
4949
4950    public Contract addSigner(SignatoryComponent t) { //3
4951      if (t == null)
4952        return this;
4953      if (this.signer == null)
4954        this.signer = new ArrayList<SignatoryComponent>();
4955      this.signer.add(t);
4956      return this;
4957    }
4958
4959    /**
4960     * @return The first repetition of repeating field {@link #signer}, creating it if it does not already exist
4961     */
4962    public SignatoryComponent getSignerFirstRep() { 
4963      if (getSigner().isEmpty()) {
4964        addSigner();
4965      }
4966      return getSigner().get(0);
4967    }
4968
4969    /**
4970     * @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.)
4971     */
4972    public List<FriendlyLanguageComponent> getFriendly() { 
4973      if (this.friendly == null)
4974        this.friendly = new ArrayList<FriendlyLanguageComponent>();
4975      return this.friendly;
4976    }
4977
4978    /**
4979     * @return Returns a reference to <code>this</code> for easy method chaining
4980     */
4981    public Contract setFriendly(List<FriendlyLanguageComponent> theFriendly) { 
4982      this.friendly = theFriendly;
4983      return this;
4984    }
4985
4986    public boolean hasFriendly() { 
4987      if (this.friendly == null)
4988        return false;
4989      for (FriendlyLanguageComponent item : this.friendly)
4990        if (!item.isEmpty())
4991          return true;
4992      return false;
4993    }
4994
4995    public FriendlyLanguageComponent addFriendly() { //3
4996      FriendlyLanguageComponent t = new FriendlyLanguageComponent();
4997      if (this.friendly == null)
4998        this.friendly = new ArrayList<FriendlyLanguageComponent>();
4999      this.friendly.add(t);
5000      return t;
5001    }
5002
5003    public Contract addFriendly(FriendlyLanguageComponent t) { //3
5004      if (t == null)
5005        return this;
5006      if (this.friendly == null)
5007        this.friendly = new ArrayList<FriendlyLanguageComponent>();
5008      this.friendly.add(t);
5009      return this;
5010    }
5011
5012    /**
5013     * @return The first repetition of repeating field {@link #friendly}, creating it if it does not already exist
5014     */
5015    public FriendlyLanguageComponent getFriendlyFirstRep() { 
5016      if (getFriendly().isEmpty()) {
5017        addFriendly();
5018      }
5019      return getFriendly().get(0);
5020    }
5021
5022    /**
5023     * @return {@link #legal} (List of Legal expressions or representations of this Contract.)
5024     */
5025    public List<LegalLanguageComponent> getLegal() { 
5026      if (this.legal == null)
5027        this.legal = new ArrayList<LegalLanguageComponent>();
5028      return this.legal;
5029    }
5030
5031    /**
5032     * @return Returns a reference to <code>this</code> for easy method chaining
5033     */
5034    public Contract setLegal(List<LegalLanguageComponent> theLegal) { 
5035      this.legal = theLegal;
5036      return this;
5037    }
5038
5039    public boolean hasLegal() { 
5040      if (this.legal == null)
5041        return false;
5042      for (LegalLanguageComponent item : this.legal)
5043        if (!item.isEmpty())
5044          return true;
5045      return false;
5046    }
5047
5048    public LegalLanguageComponent addLegal() { //3
5049      LegalLanguageComponent t = new LegalLanguageComponent();
5050      if (this.legal == null)
5051        this.legal = new ArrayList<LegalLanguageComponent>();
5052      this.legal.add(t);
5053      return t;
5054    }
5055
5056    public Contract addLegal(LegalLanguageComponent t) { //3
5057      if (t == null)
5058        return this;
5059      if (this.legal == null)
5060        this.legal = new ArrayList<LegalLanguageComponent>();
5061      this.legal.add(t);
5062      return this;
5063    }
5064
5065    /**
5066     * @return The first repetition of repeating field {@link #legal}, creating it if it does not already exist
5067     */
5068    public LegalLanguageComponent getLegalFirstRep() { 
5069      if (getLegal().isEmpty()) {
5070        addLegal();
5071      }
5072      return getLegal().get(0);
5073    }
5074
5075    /**
5076     * @return {@link #rule} (List of Computable Policy Rule Language Representations of this Contract.)
5077     */
5078    public ComputableLanguageComponent getRule() { 
5079      if (this.rule == null)
5080        if (Configuration.errorOnAutoCreate())
5081          throw new Error("Attempt to auto-create Contract.rule");
5082        else if (Configuration.doAutoCreate())
5083          this.rule = new ComputableLanguageComponent(); // cc
5084      return this.rule;
5085    }
5086
5087    public boolean hasRule() { 
5088      return this.rule != null && !this.rule.isEmpty();
5089    }
5090
5091    /**
5092     * @param value {@link #rule} (List of Computable Policy Rule Language Representations of this Contract.)
5093     */
5094    public Contract setRule(ComputableLanguageComponent value) { 
5095      this.rule = value;
5096      return this;
5097    }
5098
5099    /**
5100     * @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.)
5101     */
5102    public Type getLegallyBinding() { 
5103      return this.legallyBinding;
5104    }
5105
5106    /**
5107     * @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.)
5108     */
5109    public Attachment getLegallyBindingAttachment() throws FHIRException { 
5110      if (this.legallyBinding == null)
5111        return null;
5112      if (!(this.legallyBinding instanceof Attachment))
5113        throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.legallyBinding.getClass().getName()+" was encountered");
5114      return (Attachment) this.legallyBinding;
5115    }
5116
5117    public boolean hasLegallyBindingAttachment() { 
5118      return this != null && this.legallyBinding instanceof Attachment;
5119    }
5120
5121    /**
5122     * @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.)
5123     */
5124    public Reference getLegallyBindingReference() throws FHIRException { 
5125      if (this.legallyBinding == null)
5126        return null;
5127      if (!(this.legallyBinding instanceof Reference))
5128        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.legallyBinding.getClass().getName()+" was encountered");
5129      return (Reference) this.legallyBinding;
5130    }
5131
5132    public boolean hasLegallyBindingReference() { 
5133      return this != null && this.legallyBinding instanceof Reference;
5134    }
5135
5136    public boolean hasLegallyBinding() { 
5137      return this.legallyBinding != null && !this.legallyBinding.isEmpty();
5138    }
5139
5140    /**
5141     * @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.)
5142     */
5143    public Contract setLegallyBinding(Type value) { 
5144      if (value != null && !(value instanceof Attachment || value instanceof Reference))
5145        throw new Error("Not the right type for Contract.legallyBinding[x]: "+value.fhirType());
5146      this.legallyBinding = value;
5147      return this;
5148    }
5149
5150      protected void listChildren(List<Property> children) {
5151        super.listChildren(children);
5152        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));
5153        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
5154        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));
5155        children.add(new Property("issued", "dateTime", "When this  Contract was issued.", 0, 1, issued));
5156        children.add(new Property("applies", "Period", "Relevant time or time-period when this Contract is applicable.", 0, 1, applies));
5157        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));
5158        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));
5159        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));
5160        children.add(new Property("type", "CodeableConcept", "Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.", 0, 1, type));
5161        children.add(new Property("subType", "CodeableConcept", "More specific type or specialization of an overarching or more general contract such as auto insurance, home owner  insurance, prenupial agreement, Advanced-Directive, or privacy consent.", 0, java.lang.Integer.MAX_VALUE, subType));
5162        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));
5163        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));
5164        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));
5165        children.add(new Property("legal", "", "List of Legal expressions or representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, legal));
5166        children.add(new Property("rule", "", "List of Computable Policy Rule Language Representations of this Contract.", 0, 1, rule));
5167        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));
5168      }
5169
5170      @Override
5171      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5172        switch (_hash) {
5173        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);
5174        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
5175        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);
5176        case -1179159893: /*issued*/  return new Property("issued", "dateTime", "When this  Contract was issued.", 0, 1, issued);
5177        case -793235316: /*applies*/  return new Property("applies", "Period", "Relevant time or time-period when this Contract is applicable.", 0, 1, applies);
5178        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);
5179        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);
5180        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);
5181        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.", 0, 1, type);
5182        case -1868521062: /*subType*/  return new Property("subType", "CodeableConcept", "More specific type or specialization of an overarching or more general contract such as auto insurance, home owner  insurance, prenupial agreement, Advanced-Directive, or privacy consent.", 0, java.lang.Integer.MAX_VALUE, subType);
5183        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);
5184        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);
5185        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);
5186        case 102851257: /*legal*/  return new Property("legal", "", "List of Legal expressions or representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, legal);
5187        case 3512060: /*rule*/  return new Property("rule", "", "List of Computable Policy Rule Language Representations of this Contract.", 0, 1, rule);
5188        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);
5189        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);
5190        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);
5191        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);
5192        default: return super.getNamedProperty(_hash, _name, _checkValid);
5193        }
5194
5195      }
5196
5197      @Override
5198      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5199        switch (hash) {
5200        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
5201        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ContractStatus>
5202        case -92412192: /*contentDerivative*/ return this.contentDerivative == null ? new Base[0] : new Base[] {this.contentDerivative}; // CodeableConcept
5203        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType
5204        case -793235316: /*applies*/ return this.applies == null ? new Base[0] : new Base[] {this.applies}; // Period
5205        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // Reference
5206        case 1475610435: /*authority*/ return this.authority == null ? new Base[0] : this.authority.toArray(new Base[this.authority.size()]); // Reference
5207        case -1326197564: /*domain*/ return this.domain == null ? new Base[0] : this.domain.toArray(new Base[this.domain.size()]); // Reference
5208        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
5209        case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // CodeableConcept
5210        case 3556460: /*term*/ return this.term == null ? new Base[0] : this.term.toArray(new Base[this.term.size()]); // TermComponent
5211        case -902467798: /*signer*/ return this.signer == null ? new Base[0] : this.signer.toArray(new Base[this.signer.size()]); // SignatoryComponent
5212        case -1423054677: /*friendly*/ return this.friendly == null ? new Base[0] : this.friendly.toArray(new Base[this.friendly.size()]); // FriendlyLanguageComponent
5213        case 102851257: /*legal*/ return this.legal == null ? new Base[0] : this.legal.toArray(new Base[this.legal.size()]); // LegalLanguageComponent
5214        case 3512060: /*rule*/ return this.rule == null ? new Base[0] : new Base[] {this.rule}; // ComputableLanguageComponent
5215        case -126751329: /*legallyBinding*/ return this.legallyBinding == null ? new Base[0] : new Base[] {this.legallyBinding}; // Type
5216        default: return super.getProperty(hash, name, checkValid);
5217        }
5218
5219      }
5220
5221      @Override
5222      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5223        switch (hash) {
5224        case -1618432855: // identifier
5225          this.getIdentifier().add(castToIdentifier(value)); // Identifier
5226          return value;
5227        case -892481550: // status
5228          value = new ContractStatusEnumFactory().fromType(castToCode(value));
5229          this.status = (Enumeration) value; // Enumeration<ContractStatus>
5230          return value;
5231        case -92412192: // contentDerivative
5232          this.contentDerivative = castToCodeableConcept(value); // CodeableConcept
5233          return value;
5234        case -1179159893: // issued
5235          this.issued = castToDateTime(value); // DateTimeType
5236          return value;
5237        case -793235316: // applies
5238          this.applies = castToPeriod(value); // Period
5239          return value;
5240        case -1867885268: // subject
5241          this.getSubject().add(castToReference(value)); // Reference
5242          return value;
5243        case 1475610435: // authority
5244          this.getAuthority().add(castToReference(value)); // Reference
5245          return value;
5246        case -1326197564: // domain
5247          this.getDomain().add(castToReference(value)); // Reference
5248          return value;
5249        case 3575610: // type
5250          this.type = castToCodeableConcept(value); // CodeableConcept
5251          return value;
5252        case -1868521062: // subType
5253          this.getSubType().add(castToCodeableConcept(value)); // CodeableConcept
5254          return value;
5255        case 3556460: // term
5256          this.getTerm().add((TermComponent) value); // TermComponent
5257          return value;
5258        case -902467798: // signer
5259          this.getSigner().add((SignatoryComponent) value); // SignatoryComponent
5260          return value;
5261        case -1423054677: // friendly
5262          this.getFriendly().add((FriendlyLanguageComponent) value); // FriendlyLanguageComponent
5263          return value;
5264        case 102851257: // legal
5265          this.getLegal().add((LegalLanguageComponent) value); // LegalLanguageComponent
5266          return value;
5267        case 3512060: // rule
5268          this.rule = (ComputableLanguageComponent) value; // ComputableLanguageComponent
5269          return value;
5270        case -126751329: // legallyBinding
5271          this.legallyBinding = castToType(value); // Type
5272          return value;
5273        default: return super.setProperty(hash, name, value);
5274        }
5275
5276      }
5277
5278      @Override
5279      public Base setProperty(String name, Base value) throws FHIRException {
5280        if (name.equals("identifier")) {
5281          this.getIdentifier().add(castToIdentifier(value));
5282        } else if (name.equals("status")) {
5283          value = new ContractStatusEnumFactory().fromType(castToCode(value));
5284          this.status = (Enumeration) value; // Enumeration<ContractStatus>
5285        } else if (name.equals("contentDerivative")) {
5286          this.contentDerivative = castToCodeableConcept(value); // CodeableConcept
5287        } else if (name.equals("issued")) {
5288          this.issued = castToDateTime(value); // DateTimeType
5289        } else if (name.equals("applies")) {
5290          this.applies = castToPeriod(value); // Period
5291        } else if (name.equals("subject")) {
5292          this.getSubject().add(castToReference(value));
5293        } else if (name.equals("authority")) {
5294          this.getAuthority().add(castToReference(value));
5295        } else if (name.equals("domain")) {
5296          this.getDomain().add(castToReference(value));
5297        } else if (name.equals("type")) {
5298          this.type = castToCodeableConcept(value); // CodeableConcept
5299        } else if (name.equals("subType")) {
5300          this.getSubType().add(castToCodeableConcept(value));
5301        } else if (name.equals("term")) {
5302          this.getTerm().add((TermComponent) value);
5303        } else if (name.equals("signer")) {
5304          this.getSigner().add((SignatoryComponent) value);
5305        } else if (name.equals("friendly")) {
5306          this.getFriendly().add((FriendlyLanguageComponent) value);
5307        } else if (name.equals("legal")) {
5308          this.getLegal().add((LegalLanguageComponent) value);
5309        } else if (name.equals("rule")) {
5310          this.rule = (ComputableLanguageComponent) value; // ComputableLanguageComponent
5311        } else if (name.equals("legallyBinding[x]")) {
5312          this.legallyBinding = castToType(value); // Type
5313        } else
5314          return super.setProperty(name, value);
5315        return value;
5316      }
5317
5318      @Override
5319      public Base makeProperty(int hash, String name) throws FHIRException {
5320        switch (hash) {
5321        case -1618432855:  return addIdentifier(); 
5322        case -892481550:  return getStatusElement();
5323        case -92412192:  return getContentDerivative(); 
5324        case -1179159893:  return getIssuedElement();
5325        case -793235316:  return getApplies(); 
5326        case -1867885268:  return addSubject(); 
5327        case 1475610435:  return addAuthority(); 
5328        case -1326197564:  return addDomain(); 
5329        case 3575610:  return getType(); 
5330        case -1868521062:  return addSubType(); 
5331        case 3556460:  return addTerm(); 
5332        case -902467798:  return addSigner(); 
5333        case -1423054677:  return addFriendly(); 
5334        case 102851257:  return addLegal(); 
5335        case 3512060:  return getRule(); 
5336        case -772497791:  return getLegallyBinding(); 
5337        case -126751329:  return getLegallyBinding(); 
5338        default: return super.makeProperty(hash, name);
5339        }
5340
5341      }
5342
5343      @Override
5344      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5345        switch (hash) {
5346        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
5347        case -892481550: /*status*/ return new String[] {"code"};
5348        case -92412192: /*contentDerivative*/ return new String[] {"CodeableConcept"};
5349        case -1179159893: /*issued*/ return new String[] {"dateTime"};
5350        case -793235316: /*applies*/ return new String[] {"Period"};
5351        case -1867885268: /*subject*/ return new String[] {"Reference"};
5352        case 1475610435: /*authority*/ return new String[] {"Reference"};
5353        case -1326197564: /*domain*/ return new String[] {"Reference"};
5354        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
5355        case -1868521062: /*subType*/ return new String[] {"CodeableConcept"};
5356        case 3556460: /*term*/ return new String[] {};
5357        case -902467798: /*signer*/ return new String[] {};
5358        case -1423054677: /*friendly*/ return new String[] {};
5359        case 102851257: /*legal*/ return new String[] {};
5360        case 3512060: /*rule*/ return new String[] {};
5361        case -126751329: /*legallyBinding*/ return new String[] {"Attachment", "Reference"};
5362        default: return super.getTypesForProperty(hash, name);
5363        }
5364
5365      }
5366
5367      @Override
5368      public Base addChild(String name) throws FHIRException {
5369        if (name.equals("identifier")) {
5370          return addIdentifier();
5371        }
5372        else if (name.equals("status")) {
5373          throw new FHIRException("Cannot call addChild on a primitive type Contract.status");
5374        }
5375        else if (name.equals("contentDerivative")) {
5376          this.contentDerivative = new CodeableConcept();
5377          return this.contentDerivative;
5378        }
5379        else if (name.equals("issued")) {
5380          throw new FHIRException("Cannot call addChild on a primitive type Contract.issued");
5381        }
5382        else if (name.equals("applies")) {
5383          this.applies = new Period();
5384          return this.applies;
5385        }
5386        else if (name.equals("subject")) {
5387          return addSubject();
5388        }
5389        else if (name.equals("authority")) {
5390          return addAuthority();
5391        }
5392        else if (name.equals("domain")) {
5393          return addDomain();
5394        }
5395        else if (name.equals("type")) {
5396          this.type = new CodeableConcept();
5397          return this.type;
5398        }
5399        else if (name.equals("subType")) {
5400          return addSubType();
5401        }
5402        else if (name.equals("term")) {
5403          return addTerm();
5404        }
5405        else if (name.equals("signer")) {
5406          return addSigner();
5407        }
5408        else if (name.equals("friendly")) {
5409          return addFriendly();
5410        }
5411        else if (name.equals("legal")) {
5412          return addLegal();
5413        }
5414        else if (name.equals("rule")) {
5415          this.rule = new ComputableLanguageComponent();
5416          return this.rule;
5417        }
5418        else if (name.equals("legallyBindingAttachment")) {
5419          this.legallyBinding = new Attachment();
5420          return this.legallyBinding;
5421        }
5422        else if (name.equals("legallyBindingReference")) {
5423          this.legallyBinding = new Reference();
5424          return this.legallyBinding;
5425        }
5426        else
5427          return super.addChild(name);
5428      }
5429
5430  public String fhirType() {
5431    return "Contract";
5432
5433  }
5434
5435      public Contract copy() {
5436        Contract dst = new Contract();
5437        copyValues(dst);
5438        if (identifier != null) {
5439          dst.identifier = new ArrayList<Identifier>();
5440          for (Identifier i : identifier)
5441            dst.identifier.add(i.copy());
5442        };
5443        dst.status = status == null ? null : status.copy();
5444        dst.contentDerivative = contentDerivative == null ? null : contentDerivative.copy();
5445        dst.issued = issued == null ? null : issued.copy();
5446        dst.applies = applies == null ? null : applies.copy();
5447        if (subject != null) {
5448          dst.subject = new ArrayList<Reference>();
5449          for (Reference i : subject)
5450            dst.subject.add(i.copy());
5451        };
5452        if (authority != null) {
5453          dst.authority = new ArrayList<Reference>();
5454          for (Reference i : authority)
5455            dst.authority.add(i.copy());
5456        };
5457        if (domain != null) {
5458          dst.domain = new ArrayList<Reference>();
5459          for (Reference i : domain)
5460            dst.domain.add(i.copy());
5461        };
5462        dst.type = type == null ? null : type.copy();
5463        if (subType != null) {
5464          dst.subType = new ArrayList<CodeableConcept>();
5465          for (CodeableConcept i : subType)
5466            dst.subType.add(i.copy());
5467        };
5468        if (term != null) {
5469          dst.term = new ArrayList<TermComponent>();
5470          for (TermComponent i : term)
5471            dst.term.add(i.copy());
5472        };
5473        if (signer != null) {
5474          dst.signer = new ArrayList<SignatoryComponent>();
5475          for (SignatoryComponent i : signer)
5476            dst.signer.add(i.copy());
5477        };
5478        if (friendly != null) {
5479          dst.friendly = new ArrayList<FriendlyLanguageComponent>();
5480          for (FriendlyLanguageComponent i : friendly)
5481            dst.friendly.add(i.copy());
5482        };
5483        if (legal != null) {
5484          dst.legal = new ArrayList<LegalLanguageComponent>();
5485          for (LegalLanguageComponent i : legal)
5486            dst.legal.add(i.copy());
5487        };
5488        dst.rule = rule == null ? null : rule.copy();
5489        dst.legallyBinding = legallyBinding == null ? null : legallyBinding.copy();
5490        return dst;
5491      }
5492
5493      protected Contract typedCopy() {
5494        return copy();
5495      }
5496
5497      @Override
5498      public boolean equalsDeep(Base other_) {
5499        if (!super.equalsDeep(other_))
5500          return false;
5501        if (!(other_ instanceof Contract))
5502          return false;
5503        Contract o = (Contract) other_;
5504        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(contentDerivative, o.contentDerivative, true)
5505           && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true) && compareDeep(subject, o.subject, true)
5506           && compareDeep(authority, o.authority, true) && compareDeep(domain, o.domain, true) && compareDeep(type, o.type, true)
5507           && compareDeep(subType, o.subType, true) && compareDeep(term, o.term, true) && compareDeep(signer, o.signer, true)
5508           && compareDeep(friendly, o.friendly, true) && compareDeep(legal, o.legal, true) && compareDeep(rule, o.rule, true)
5509           && compareDeep(legallyBinding, o.legallyBinding, true);
5510      }
5511
5512      @Override
5513      public boolean equalsShallow(Base other_) {
5514        if (!super.equalsShallow(other_))
5515          return false;
5516        if (!(other_ instanceof Contract))
5517          return false;
5518        Contract o = (Contract) other_;
5519        return compareValues(status, o.status, true) && compareValues(issued, o.issued, true);
5520      }
5521
5522      public boolean isEmpty() {
5523        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, contentDerivative
5524          , issued, applies, subject, authority, domain, type, subType, term, signer
5525          , friendly, legal, rule, legallyBinding);
5526      }
5527
5528  @Override
5529  public ResourceType getResourceType() {
5530    return ResourceType.Contract;
5531   }
5532
5533 /**
5534   * Search parameter: <b>identifier</b>
5535   * <p>
5536   * Description: <b>The identity of the contract</b><br>
5537   * Type: <b>token</b><br>
5538   * Path: <b>Contract.identifier</b><br>
5539   * </p>
5540   */
5541  @SearchParamDefinition(name="identifier", path="Contract.identifier", description="The identity of the contract", type="token" )
5542  public static final String SP_IDENTIFIER = "identifier";
5543 /**
5544   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
5545   * <p>
5546   * Description: <b>The identity of the contract</b><br>
5547   * Type: <b>token</b><br>
5548   * Path: <b>Contract.identifier</b><br>
5549   * </p>
5550   */
5551  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
5552
5553 /**
5554   * Search parameter: <b>patient</b>
5555   * <p>
5556   * Description: <b>The identity of the subject of the contract (if a patient)</b><br>
5557   * Type: <b>reference</b><br>
5558   * Path: <b>Contract.subject</b><br>
5559   * </p>
5560   */
5561  @SearchParamDefinition(name="patient", path="Contract.subject", description="The identity of the subject of the contract (if a patient)", type="reference", target={Patient.class } )
5562  public static final String SP_PATIENT = "patient";
5563 /**
5564   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
5565   * <p>
5566   * Description: <b>The identity of the subject of the contract (if a patient)</b><br>
5567   * Type: <b>reference</b><br>
5568   * Path: <b>Contract.subject</b><br>
5569   * </p>
5570   */
5571  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
5572
5573/**
5574   * Constant for fluent queries to be used to add include statements. Specifies
5575   * the path value of "<b>Contract:patient</b>".
5576   */
5577  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Contract:patient").toLocked();
5578
5579 /**
5580   * Search parameter: <b>subject</b>
5581   * <p>
5582   * Description: <b>The identity of the subject of the contract</b><br>
5583   * Type: <b>reference</b><br>
5584   * Path: <b>Contract.subject</b><br>
5585   * </p>
5586   */
5587  @SearchParamDefinition(name="subject", path="Contract.subject", description="The identity of the subject of the contract", type="reference" )
5588  public static final String SP_SUBJECT = "subject";
5589 /**
5590   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
5591   * <p>
5592   * Description: <b>The identity of the subject of the contract</b><br>
5593   * Type: <b>reference</b><br>
5594   * Path: <b>Contract.subject</b><br>
5595   * </p>
5596   */
5597  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
5598
5599/**
5600   * Constant for fluent queries to be used to add include statements. Specifies
5601   * the path value of "<b>Contract:subject</b>".
5602   */
5603  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Contract:subject").toLocked();
5604
5605 /**
5606   * Search parameter: <b>authority</b>
5607   * <p>
5608   * Description: <b>The authority of the contract</b><br>
5609   * Type: <b>reference</b><br>
5610   * Path: <b>Contract.authority</b><br>
5611   * </p>
5612   */
5613  @SearchParamDefinition(name="authority", path="Contract.authority", description="The authority of the contract", type="reference", target={Organization.class } )
5614  public static final String SP_AUTHORITY = "authority";
5615 /**
5616   * <b>Fluent Client</b> search parameter constant for <b>authority</b>
5617   * <p>
5618   * Description: <b>The authority of the contract</b><br>
5619   * Type: <b>reference</b><br>
5620   * Path: <b>Contract.authority</b><br>
5621   * </p>
5622   */
5623  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHORITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHORITY);
5624
5625/**
5626   * Constant for fluent queries to be used to add include statements. Specifies
5627   * the path value of "<b>Contract:authority</b>".
5628   */
5629  public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHORITY = new ca.uhn.fhir.model.api.Include("Contract:authority").toLocked();
5630
5631 /**
5632   * Search parameter: <b>domain</b>
5633   * <p>
5634   * Description: <b>The domain of the contract</b><br>
5635   * Type: <b>reference</b><br>
5636   * Path: <b>Contract.domain</b><br>
5637   * </p>
5638   */
5639  @SearchParamDefinition(name="domain", path="Contract.domain", description="The domain of the contract", type="reference", target={Location.class } )
5640  public static final String SP_DOMAIN = "domain";
5641 /**
5642   * <b>Fluent Client</b> search parameter constant for <b>domain</b>
5643   * <p>
5644   * Description: <b>The domain of the contract</b><br>
5645   * Type: <b>reference</b><br>
5646   * Path: <b>Contract.domain</b><br>
5647   * </p>
5648   */
5649  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DOMAIN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DOMAIN);
5650
5651/**
5652   * Constant for fluent queries to be used to add include statements. Specifies
5653   * the path value of "<b>Contract:domain</b>".
5654   */
5655  public static final ca.uhn.fhir.model.api.Include INCLUDE_DOMAIN = new ca.uhn.fhir.model.api.Include("Contract:domain").toLocked();
5656
5657 /**
5658   * Search parameter: <b>issued</b>
5659   * <p>
5660   * Description: <b>The date/time the contract was issued</b><br>
5661   * Type: <b>date</b><br>
5662   * Path: <b>Contract.issued</b><br>
5663   * </p>
5664   */
5665  @SearchParamDefinition(name="issued", path="Contract.issued", description="The date/time the contract was issued", type="date" )
5666  public static final String SP_ISSUED = "issued";
5667 /**
5668   * <b>Fluent Client</b> search parameter constant for <b>issued</b>
5669   * <p>
5670   * Description: <b>The date/time the contract was issued</b><br>
5671   * Type: <b>date</b><br>
5672   * Path: <b>Contract.issued</b><br>
5673   * </p>
5674   */
5675  public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED);
5676
5677 /**
5678   * Search parameter: <b>signer</b>
5679   * <p>
5680   * Description: <b>Contract Signatory Party</b><br>
5681   * Type: <b>reference</b><br>
5682   * Path: <b>Contract.signer.party</b><br>
5683   * </p>
5684   */
5685  @SearchParamDefinition(name="signer", path="Contract.signer.party", description="Contract Signatory Party", type="reference", target={Organization.class, Patient.class, Practitioner.class, RelatedPerson.class } )
5686  public static final String SP_SIGNER = "signer";
5687 /**
5688   * <b>Fluent Client</b> search parameter constant for <b>signer</b>
5689   * <p>
5690   * Description: <b>Contract Signatory Party</b><br>
5691   * Type: <b>reference</b><br>
5692   * Path: <b>Contract.signer.party</b><br>
5693   * </p>
5694   */
5695  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SIGNER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SIGNER);
5696
5697/**
5698   * Constant for fluent queries to be used to add include statements. Specifies
5699   * the path value of "<b>Contract:signer</b>".
5700   */
5701  public static final ca.uhn.fhir.model.api.Include INCLUDE_SIGNER = new ca.uhn.fhir.model.api.Include("Contract:signer").toLocked();
5702
5703 /**
5704   * Search parameter: <b>status</b>
5705   * <p>
5706   * Description: <b>The status of the contract</b><br>
5707   * Type: <b>token</b><br>
5708   * Path: <b>Contract.status</b><br>
5709   * </p>
5710   */
5711  @SearchParamDefinition(name="status", path="Contract.status", description="The status of the contract", type="token" )
5712  public static final String SP_STATUS = "status";
5713 /**
5714   * <b>Fluent Client</b> search parameter constant for <b>status</b>
5715   * <p>
5716   * Description: <b>The status of the contract</b><br>
5717   * Type: <b>token</b><br>
5718   * Path: <b>Contract.status</b><br>
5719   * </p>
5720   */
5721  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
5722
5723
5724}
5725