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