001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
033import java.util.ArrayList;
034import java.util.Date;
035import java.util.List;
036
037import org.hl7.fhir.exceptions.FHIRException;
038import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
039import org.hl7.fhir.r4.model.Enumerations.NoteType;
040import org.hl7.fhir.r4.model.Enumerations.NoteTypeEnumFactory;
041import org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome;
042import org.hl7.fhir.r4.model.Enumerations.RemittanceOutcomeEnumFactory;
043import org.hl7.fhir.utilities.Utilities;
044
045import ca.uhn.fhir.model.api.annotation.Block;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.ResourceDef;
049import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
050
051/**
052 * This resource provides the details including amount of a payment and
053 * allocates the payment items being paid.
054 */
055@ResourceDef(name = "PaymentReconciliation", profile = "http://hl7.org/fhir/StructureDefinition/PaymentReconciliation")
056public class PaymentReconciliation extends DomainResource {
057
058  public enum PaymentReconciliationStatus {
059    /**
060     * The instance is currently in-force.
061     */
062    ACTIVE,
063    /**
064     * The instance is withdrawn, rescinded or reversed.
065     */
066    CANCELLED,
067    /**
068     * A new instance the contents of which is not complete.
069     */
070    DRAFT,
071    /**
072     * The instance was entered in error.
073     */
074    ENTEREDINERROR,
075    /**
076     * added to help the parsers with the generic types
077     */
078    NULL;
079
080    public static PaymentReconciliationStatus fromCode(String codeString) throws FHIRException {
081      if (codeString == null || "".equals(codeString))
082        return null;
083      if ("active".equals(codeString))
084        return ACTIVE;
085      if ("cancelled".equals(codeString))
086        return CANCELLED;
087      if ("draft".equals(codeString))
088        return DRAFT;
089      if ("entered-in-error".equals(codeString))
090        return ENTEREDINERROR;
091      if (Configuration.isAcceptInvalidEnums())
092        return null;
093      else
094        throw new FHIRException("Unknown PaymentReconciliationStatus code '" + codeString + "'");
095    }
096
097    public String toCode() {
098      switch (this) {
099      case ACTIVE:
100        return "active";
101      case CANCELLED:
102        return "cancelled";
103      case DRAFT:
104        return "draft";
105      case ENTEREDINERROR:
106        return "entered-in-error";
107      case NULL:
108        return null;
109      default:
110        return "?";
111      }
112    }
113
114    public String getSystem() {
115      switch (this) {
116      case ACTIVE:
117        return "http://hl7.org/fhir/fm-status";
118      case CANCELLED:
119        return "http://hl7.org/fhir/fm-status";
120      case DRAFT:
121        return "http://hl7.org/fhir/fm-status";
122      case ENTEREDINERROR:
123        return "http://hl7.org/fhir/fm-status";
124      case NULL:
125        return null;
126      default:
127        return "?";
128      }
129    }
130
131    public String getDefinition() {
132      switch (this) {
133      case ACTIVE:
134        return "The instance is currently in-force.";
135      case CANCELLED:
136        return "The instance is withdrawn, rescinded or reversed.";
137      case DRAFT:
138        return "A new instance the contents of which is not complete.";
139      case ENTEREDINERROR:
140        return "The instance was entered in error.";
141      case NULL:
142        return null;
143      default:
144        return "?";
145      }
146    }
147
148    public String getDisplay() {
149      switch (this) {
150      case ACTIVE:
151        return "Active";
152      case CANCELLED:
153        return "Cancelled";
154      case DRAFT:
155        return "Draft";
156      case ENTEREDINERROR:
157        return "Entered in Error";
158      case NULL:
159        return null;
160      default:
161        return "?";
162      }
163    }
164  }
165
166  public static class PaymentReconciliationStatusEnumFactory implements EnumFactory<PaymentReconciliationStatus> {
167    public PaymentReconciliationStatus fromCode(String codeString) throws IllegalArgumentException {
168      if (codeString == null || "".equals(codeString))
169        if (codeString == null || "".equals(codeString))
170          return null;
171      if ("active".equals(codeString))
172        return PaymentReconciliationStatus.ACTIVE;
173      if ("cancelled".equals(codeString))
174        return PaymentReconciliationStatus.CANCELLED;
175      if ("draft".equals(codeString))
176        return PaymentReconciliationStatus.DRAFT;
177      if ("entered-in-error".equals(codeString))
178        return PaymentReconciliationStatus.ENTEREDINERROR;
179      throw new IllegalArgumentException("Unknown PaymentReconciliationStatus code '" + codeString + "'");
180    }
181
182    public Enumeration<PaymentReconciliationStatus> fromType(PrimitiveType<?> code) throws FHIRException {
183      if (code == null)
184        return null;
185      if (code.isEmpty())
186        return new Enumeration<PaymentReconciliationStatus>(this, PaymentReconciliationStatus.NULL, code);
187      String codeString = code.asStringValue();
188      if (codeString == null || "".equals(codeString))
189        return new Enumeration<PaymentReconciliationStatus>(this, PaymentReconciliationStatus.NULL, code);
190      if ("active".equals(codeString))
191        return new Enumeration<PaymentReconciliationStatus>(this, PaymentReconciliationStatus.ACTIVE, code);
192      if ("cancelled".equals(codeString))
193        return new Enumeration<PaymentReconciliationStatus>(this, PaymentReconciliationStatus.CANCELLED, code);
194      if ("draft".equals(codeString))
195        return new Enumeration<PaymentReconciliationStatus>(this, PaymentReconciliationStatus.DRAFT, code);
196      if ("entered-in-error".equals(codeString))
197        return new Enumeration<PaymentReconciliationStatus>(this, PaymentReconciliationStatus.ENTEREDINERROR, code);
198      throw new FHIRException("Unknown PaymentReconciliationStatus code '" + codeString + "'");
199    }
200
201    public String toCode(PaymentReconciliationStatus code) {
202      if (code == PaymentReconciliationStatus.ACTIVE)
203        return "active";
204      if (code == PaymentReconciliationStatus.CANCELLED)
205        return "cancelled";
206      if (code == PaymentReconciliationStatus.DRAFT)
207        return "draft";
208      if (code == PaymentReconciliationStatus.ENTEREDINERROR)
209        return "entered-in-error";
210      return "?";
211    }
212
213    public String toSystem(PaymentReconciliationStatus code) {
214      return code.getSystem();
215    }
216  }
217
218  @Block()
219  public static class DetailsComponent extends BackboneElement implements IBaseBackboneElement {
220    /**
221     * Unique identifier for the current payment item for the referenced payable.
222     */
223    @Child(name = "identifier", type = {
224        Identifier.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
225    @Description(shortDefinition = "Business identifier of the payment detail", formalDefinition = "Unique identifier for the current payment item for the referenced payable.")
226    protected Identifier identifier;
227
228    /**
229     * Unique identifier for the prior payment item for the referenced payable.
230     */
231    @Child(name = "predecessor", type = {
232        Identifier.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
233    @Description(shortDefinition = "Business identifier of the prior payment detail", formalDefinition = "Unique identifier for the prior payment item for the referenced payable.")
234    protected Identifier predecessor;
235
236    /**
237     * Code to indicate the nature of the payment.
238     */
239    @Child(name = "type", type = {
240        CodeableConcept.class }, order = 3, min = 1, max = 1, modifier = false, summary = false)
241    @Description(shortDefinition = "Category of payment", formalDefinition = "Code to indicate the nature of the payment.")
242    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/payment-type")
243    protected CodeableConcept type;
244
245    /**
246     * A resource, such as a Claim, the evaluation of which could lead to payment.
247     */
248    @Child(name = "request", type = { Reference.class }, order = 4, min = 0, max = 1, modifier = false, summary = false)
249    @Description(shortDefinition = "Request giving rise to the payment", formalDefinition = "A resource, such as a Claim, the evaluation of which could lead to payment.")
250    protected Reference request;
251
252    /**
253     * The actual object that is the target of the reference (A resource, such as a
254     * Claim, the evaluation of which could lead to payment.)
255     */
256    protected Resource requestTarget;
257
258    /**
259     * The party which submitted the claim or financial transaction.
260     */
261    @Child(name = "submitter", type = { Practitioner.class, PractitionerRole.class,
262        Organization.class }, order = 5, min = 0, max = 1, modifier = false, summary = false)
263    @Description(shortDefinition = "Submitter of the request", formalDefinition = "The party which submitted the claim or financial transaction.")
264    protected Reference submitter;
265
266    /**
267     * The actual object that is the target of the reference (The party which
268     * submitted the claim or financial transaction.)
269     */
270    protected Resource submitterTarget;
271
272    /**
273     * A resource, such as a ClaimResponse, which contains a commitment to payment.
274     */
275    @Child(name = "response", type = {
276        Reference.class }, order = 6, min = 0, max = 1, modifier = false, summary = false)
277    @Description(shortDefinition = "Response committing to a payment", formalDefinition = "A resource, such as a ClaimResponse, which contains a commitment to payment.")
278    protected Reference response;
279
280    /**
281     * The actual object that is the target of the reference (A resource, such as a
282     * ClaimResponse, which contains a commitment to payment.)
283     */
284    protected Resource responseTarget;
285
286    /**
287     * The date from the response resource containing a commitment to pay.
288     */
289    @Child(name = "date", type = { DateType.class }, order = 7, min = 0, max = 1, modifier = false, summary = false)
290    @Description(shortDefinition = "Date of commitment to pay", formalDefinition = "The date from the response resource containing a commitment to pay.")
291    protected DateType date;
292
293    /**
294     * A reference to the individual who is responsible for inquiries regarding the
295     * response and its payment.
296     */
297    @Child(name = "responsible", type = {
298        PractitionerRole.class }, order = 8, min = 0, max = 1, modifier = false, summary = false)
299    @Description(shortDefinition = "Contact for the response", formalDefinition = "A reference to the individual who is responsible for inquiries regarding the response and its payment.")
300    protected Reference responsible;
301
302    /**
303     * The actual object that is the target of the reference (A reference to the
304     * individual who is responsible for inquiries regarding the response and its
305     * payment.)
306     */
307    protected PractitionerRole responsibleTarget;
308
309    /**
310     * The party which is receiving the payment.
311     */
312    @Child(name = "payee", type = { Practitioner.class, PractitionerRole.class,
313        Organization.class }, order = 9, min = 0, max = 1, modifier = false, summary = false)
314    @Description(shortDefinition = "Recipient of the payment", formalDefinition = "The party which is receiving the payment.")
315    protected Reference payee;
316
317    /**
318     * The actual object that is the target of the reference (The party which is
319     * receiving the payment.)
320     */
321    protected Resource payeeTarget;
322
323    /**
324     * The monetary amount allocated from the total payment to the payable.
325     */
326    @Child(name = "amount", type = { Money.class }, order = 10, min = 0, max = 1, modifier = false, summary = false)
327    @Description(shortDefinition = "Amount allocated to this payable", formalDefinition = "The monetary amount allocated from the total payment to the payable.")
328    protected Money amount;
329
330    private static final long serialVersionUID = -1361848619L;
331
332    /**
333     * Constructor
334     */
335    public DetailsComponent() {
336      super();
337    }
338
339    /**
340     * Constructor
341     */
342    public DetailsComponent(CodeableConcept type) {
343      super();
344      this.type = type;
345    }
346
347    /**
348     * @return {@link #identifier} (Unique identifier for the current payment item
349     *         for the referenced payable.)
350     */
351    public Identifier getIdentifier() {
352      if (this.identifier == null)
353        if (Configuration.errorOnAutoCreate())
354          throw new Error("Attempt to auto-create DetailsComponent.identifier");
355        else if (Configuration.doAutoCreate())
356          this.identifier = new Identifier(); // cc
357      return this.identifier;
358    }
359
360    public boolean hasIdentifier() {
361      return this.identifier != null && !this.identifier.isEmpty();
362    }
363
364    /**
365     * @param value {@link #identifier} (Unique identifier for the current payment
366     *              item for the referenced payable.)
367     */
368    public DetailsComponent setIdentifier(Identifier value) {
369      this.identifier = value;
370      return this;
371    }
372
373    /**
374     * @return {@link #predecessor} (Unique identifier for the prior payment item
375     *         for the referenced payable.)
376     */
377    public Identifier getPredecessor() {
378      if (this.predecessor == null)
379        if (Configuration.errorOnAutoCreate())
380          throw new Error("Attempt to auto-create DetailsComponent.predecessor");
381        else if (Configuration.doAutoCreate())
382          this.predecessor = new Identifier(); // cc
383      return this.predecessor;
384    }
385
386    public boolean hasPredecessor() {
387      return this.predecessor != null && !this.predecessor.isEmpty();
388    }
389
390    /**
391     * @param value {@link #predecessor} (Unique identifier for the prior payment
392     *              item for the referenced payable.)
393     */
394    public DetailsComponent setPredecessor(Identifier value) {
395      this.predecessor = value;
396      return this;
397    }
398
399    /**
400     * @return {@link #type} (Code to indicate the nature of the payment.)
401     */
402    public CodeableConcept getType() {
403      if (this.type == null)
404        if (Configuration.errorOnAutoCreate())
405          throw new Error("Attempt to auto-create DetailsComponent.type");
406        else if (Configuration.doAutoCreate())
407          this.type = new CodeableConcept(); // cc
408      return this.type;
409    }
410
411    public boolean hasType() {
412      return this.type != null && !this.type.isEmpty();
413    }
414
415    /**
416     * @param value {@link #type} (Code to indicate the nature of the payment.)
417     */
418    public DetailsComponent setType(CodeableConcept value) {
419      this.type = value;
420      return this;
421    }
422
423    /**
424     * @return {@link #request} (A resource, such as a Claim, the evaluation of
425     *         which could lead to payment.)
426     */
427    public Reference getRequest() {
428      if (this.request == null)
429        if (Configuration.errorOnAutoCreate())
430          throw new Error("Attempt to auto-create DetailsComponent.request");
431        else if (Configuration.doAutoCreate())
432          this.request = new Reference(); // cc
433      return this.request;
434    }
435
436    public boolean hasRequest() {
437      return this.request != null && !this.request.isEmpty();
438    }
439
440    /**
441     * @param value {@link #request} (A resource, such as a Claim, the evaluation of
442     *              which could lead to payment.)
443     */
444    public DetailsComponent setRequest(Reference value) {
445      this.request = value;
446      return this;
447    }
448
449    /**
450     * @return {@link #request} The actual object that is the target of the
451     *         reference. The reference library doesn't populate this, but you can
452     *         use it to hold the resource if you resolve it. (A resource, such as a
453     *         Claim, the evaluation of which could lead to payment.)
454     */
455    public Resource getRequestTarget() {
456      return this.requestTarget;
457    }
458
459    /**
460     * @param value {@link #request} The actual object that is the target of the
461     *              reference. The reference library doesn't use these, but you can
462     *              use it to hold the resource if you resolve it. (A resource, such
463     *              as a Claim, the evaluation of which could lead to payment.)
464     */
465    public DetailsComponent setRequestTarget(Resource value) {
466      this.requestTarget = value;
467      return this;
468    }
469
470    /**
471     * @return {@link #submitter} (The party which submitted the claim or financial
472     *         transaction.)
473     */
474    public Reference getSubmitter() {
475      if (this.submitter == null)
476        if (Configuration.errorOnAutoCreate())
477          throw new Error("Attempt to auto-create DetailsComponent.submitter");
478        else if (Configuration.doAutoCreate())
479          this.submitter = new Reference(); // cc
480      return this.submitter;
481    }
482
483    public boolean hasSubmitter() {
484      return this.submitter != null && !this.submitter.isEmpty();
485    }
486
487    /**
488     * @param value {@link #submitter} (The party which submitted the claim or
489     *              financial transaction.)
490     */
491    public DetailsComponent setSubmitter(Reference value) {
492      this.submitter = value;
493      return this;
494    }
495
496    /**
497     * @return {@link #submitter} The actual object that is the target of the
498     *         reference. The reference library doesn't populate this, but you can
499     *         use it to hold the resource if you resolve it. (The party which
500     *         submitted the claim or financial transaction.)
501     */
502    public Resource getSubmitterTarget() {
503      return this.submitterTarget;
504    }
505
506    /**
507     * @param value {@link #submitter} The actual object that is the target of the
508     *              reference. The reference library doesn't use these, but you can
509     *              use it to hold the resource if you resolve it. (The party which
510     *              submitted the claim or financial transaction.)
511     */
512    public DetailsComponent setSubmitterTarget(Resource value) {
513      this.submitterTarget = value;
514      return this;
515    }
516
517    /**
518     * @return {@link #response} (A resource, such as a ClaimResponse, which
519     *         contains a commitment to payment.)
520     */
521    public Reference getResponse() {
522      if (this.response == null)
523        if (Configuration.errorOnAutoCreate())
524          throw new Error("Attempt to auto-create DetailsComponent.response");
525        else if (Configuration.doAutoCreate())
526          this.response = new Reference(); // cc
527      return this.response;
528    }
529
530    public boolean hasResponse() {
531      return this.response != null && !this.response.isEmpty();
532    }
533
534    /**
535     * @param value {@link #response} (A resource, such as a ClaimResponse, which
536     *              contains a commitment to payment.)
537     */
538    public DetailsComponent setResponse(Reference value) {
539      this.response = value;
540      return this;
541    }
542
543    /**
544     * @return {@link #response} The actual object that is the target of the
545     *         reference. The reference library doesn't populate this, but you can
546     *         use it to hold the resource if you resolve it. (A resource, such as a
547     *         ClaimResponse, which contains a commitment to payment.)
548     */
549    public Resource getResponseTarget() {
550      return this.responseTarget;
551    }
552
553    /**
554     * @param value {@link #response} The actual object that is the target of the
555     *              reference. The reference library doesn't use these, but you can
556     *              use it to hold the resource if you resolve it. (A resource, such
557     *              as a ClaimResponse, which contains a commitment to payment.)
558     */
559    public DetailsComponent setResponseTarget(Resource value) {
560      this.responseTarget = value;
561      return this;
562    }
563
564    /**
565     * @return {@link #date} (The date from the response resource containing a
566     *         commitment to pay.). This is the underlying object with id, value and
567     *         extensions. The accessor "getDate" gives direct access to the value
568     */
569    public DateType getDateElement() {
570      if (this.date == null)
571        if (Configuration.errorOnAutoCreate())
572          throw new Error("Attempt to auto-create DetailsComponent.date");
573        else if (Configuration.doAutoCreate())
574          this.date = new DateType(); // bb
575      return this.date;
576    }
577
578    public boolean hasDateElement() {
579      return this.date != null && !this.date.isEmpty();
580    }
581
582    public boolean hasDate() {
583      return this.date != null && !this.date.isEmpty();
584    }
585
586    /**
587     * @param value {@link #date} (The date from the response resource containing a
588     *              commitment to pay.). This is the underlying object with id,
589     *              value and extensions. The accessor "getDate" gives direct access
590     *              to the value
591     */
592    public DetailsComponent setDateElement(DateType value) {
593      this.date = value;
594      return this;
595    }
596
597    /**
598     * @return The date from the response resource containing a commitment to pay.
599     */
600    public Date getDate() {
601      return this.date == null ? null : this.date.getValue();
602    }
603
604    /**
605     * @param value The date from the response resource containing a commitment to
606     *              pay.
607     */
608    public DetailsComponent setDate(Date value) {
609      if (value == null)
610        this.date = null;
611      else {
612        if (this.date == null)
613          this.date = new DateType();
614        this.date.setValue(value);
615      }
616      return this;
617    }
618
619    /**
620     * @return {@link #responsible} (A reference to the individual who is
621     *         responsible for inquiries regarding the response and its payment.)
622     */
623    public Reference getResponsible() {
624      if (this.responsible == null)
625        if (Configuration.errorOnAutoCreate())
626          throw new Error("Attempt to auto-create DetailsComponent.responsible");
627        else if (Configuration.doAutoCreate())
628          this.responsible = new Reference(); // cc
629      return this.responsible;
630    }
631
632    public boolean hasResponsible() {
633      return this.responsible != null && !this.responsible.isEmpty();
634    }
635
636    /**
637     * @param value {@link #responsible} (A reference to the individual who is
638     *              responsible for inquiries regarding the response and its
639     *              payment.)
640     */
641    public DetailsComponent setResponsible(Reference value) {
642      this.responsible = value;
643      return this;
644    }
645
646    /**
647     * @return {@link #responsible} The actual object that is the target of the
648     *         reference. The reference library doesn't populate this, but you can
649     *         use it to hold the resource if you resolve it. (A reference to the
650     *         individual who is responsible for inquiries regarding the response
651     *         and its payment.)
652     */
653    public PractitionerRole getResponsibleTarget() {
654      if (this.responsibleTarget == null)
655        if (Configuration.errorOnAutoCreate())
656          throw new Error("Attempt to auto-create DetailsComponent.responsible");
657        else if (Configuration.doAutoCreate())
658          this.responsibleTarget = new PractitionerRole(); // aa
659      return this.responsibleTarget;
660    }
661
662    /**
663     * @param value {@link #responsible} The actual object that is the target of the
664     *              reference. The reference library doesn't use these, but you can
665     *              use it to hold the resource if you resolve it. (A reference to
666     *              the individual who is responsible for inquiries regarding the
667     *              response and its payment.)
668     */
669    public DetailsComponent setResponsibleTarget(PractitionerRole value) {
670      this.responsibleTarget = value;
671      return this;
672    }
673
674    /**
675     * @return {@link #payee} (The party which is receiving the payment.)
676     */
677    public Reference getPayee() {
678      if (this.payee == null)
679        if (Configuration.errorOnAutoCreate())
680          throw new Error("Attempt to auto-create DetailsComponent.payee");
681        else if (Configuration.doAutoCreate())
682          this.payee = new Reference(); // cc
683      return this.payee;
684    }
685
686    public boolean hasPayee() {
687      return this.payee != null && !this.payee.isEmpty();
688    }
689
690    /**
691     * @param value {@link #payee} (The party which is receiving the payment.)
692     */
693    public DetailsComponent setPayee(Reference value) {
694      this.payee = value;
695      return this;
696    }
697
698    /**
699     * @return {@link #payee} The actual object that is the target of the reference.
700     *         The reference library doesn't populate this, but you can use it to
701     *         hold the resource if you resolve it. (The party which is receiving
702     *         the payment.)
703     */
704    public Resource getPayeeTarget() {
705      return this.payeeTarget;
706    }
707
708    /**
709     * @param value {@link #payee} The actual object that is the target of the
710     *              reference. The reference library doesn't use these, but you can
711     *              use it to hold the resource if you resolve it. (The party which
712     *              is receiving the payment.)
713     */
714    public DetailsComponent setPayeeTarget(Resource value) {
715      this.payeeTarget = value;
716      return this;
717    }
718
719    /**
720     * @return {@link #amount} (The monetary amount allocated from the total payment
721     *         to the payable.)
722     */
723    public Money getAmount() {
724      if (this.amount == null)
725        if (Configuration.errorOnAutoCreate())
726          throw new Error("Attempt to auto-create DetailsComponent.amount");
727        else if (Configuration.doAutoCreate())
728          this.amount = new Money(); // cc
729      return this.amount;
730    }
731
732    public boolean hasAmount() {
733      return this.amount != null && !this.amount.isEmpty();
734    }
735
736    /**
737     * @param value {@link #amount} (The monetary amount allocated from the total
738     *              payment to the payable.)
739     */
740    public DetailsComponent setAmount(Money value) {
741      this.amount = value;
742      return this;
743    }
744
745    protected void listChildren(List<Property> children) {
746      super.listChildren(children);
747      children.add(new Property("identifier", "Identifier",
748          "Unique identifier for the current payment item for the referenced payable.", 0, 1, identifier));
749      children.add(new Property("predecessor", "Identifier",
750          "Unique identifier for the prior payment item for the referenced payable.", 0, 1, predecessor));
751      children.add(new Property("type", "CodeableConcept", "Code to indicate the nature of the payment.", 0, 1, type));
752      children.add(new Property("request", "Reference(Any)",
753          "A resource, such as a Claim, the evaluation of which could lead to payment.", 0, 1, request));
754      children.add(new Property("submitter", "Reference(Practitioner|PractitionerRole|Organization)",
755          "The party which submitted the claim or financial transaction.", 0, 1, submitter));
756      children.add(new Property("response", "Reference(Any)",
757          "A resource, such as a ClaimResponse, which contains a commitment to payment.", 0, 1, response));
758      children.add(new Property("date", "date", "The date from the response resource containing a commitment to pay.",
759          0, 1, date));
760      children.add(new Property("responsible", "Reference(PractitionerRole)",
761          "A reference to the individual who is responsible for inquiries regarding the response and its payment.", 0,
762          1, responsible));
763      children.add(new Property("payee", "Reference(Practitioner|PractitionerRole|Organization)",
764          "The party which is receiving the payment.", 0, 1, payee));
765      children.add(new Property("amount", "Money",
766          "The monetary amount allocated from the total payment to the payable.", 0, 1, amount));
767    }
768
769    @Override
770    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
771      switch (_hash) {
772      case -1618432855:
773        /* identifier */ return new Property("identifier", "Identifier",
774            "Unique identifier for the current payment item for the referenced payable.", 0, 1, identifier);
775      case -1925032183:
776        /* predecessor */ return new Property("predecessor", "Identifier",
777            "Unique identifier for the prior payment item for the referenced payable.", 0, 1, predecessor);
778      case 3575610:
779        /* type */ return new Property("type", "CodeableConcept", "Code to indicate the nature of the payment.", 0, 1,
780            type);
781      case 1095692943:
782        /* request */ return new Property("request", "Reference(Any)",
783            "A resource, such as a Claim, the evaluation of which could lead to payment.", 0, 1, request);
784      case 348678409:
785        /* submitter */ return new Property("submitter", "Reference(Practitioner|PractitionerRole|Organization)",
786            "The party which submitted the claim or financial transaction.", 0, 1, submitter);
787      case -340323263:
788        /* response */ return new Property("response", "Reference(Any)",
789            "A resource, such as a ClaimResponse, which contains a commitment to payment.", 0, 1, response);
790      case 3076014:
791        /* date */ return new Property("date", "date",
792            "The date from the response resource containing a commitment to pay.", 0, 1, date);
793      case 1847674614:
794        /* responsible */ return new Property("responsible", "Reference(PractitionerRole)",
795            "A reference to the individual who is responsible for inquiries regarding the response and its payment.", 0,
796            1, responsible);
797      case 106443592:
798        /* payee */ return new Property("payee", "Reference(Practitioner|PractitionerRole|Organization)",
799            "The party which is receiving the payment.", 0, 1, payee);
800      case -1413853096:
801        /* amount */ return new Property("amount", "Money",
802            "The monetary amount allocated from the total payment to the payable.", 0, 1, amount);
803      default:
804        return super.getNamedProperty(_hash, _name, _checkValid);
805      }
806
807    }
808
809    @Override
810    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
811      switch (hash) {
812      case -1618432855:
813        /* identifier */ return this.identifier == null ? new Base[0] : new Base[] { this.identifier }; // Identifier
814      case -1925032183:
815        /* predecessor */ return this.predecessor == null ? new Base[0] : new Base[] { this.predecessor }; // Identifier
816      case 3575610:
817        /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // CodeableConcept
818      case 1095692943:
819        /* request */ return this.request == null ? new Base[0] : new Base[] { this.request }; // Reference
820      case 348678409:
821        /* submitter */ return this.submitter == null ? new Base[0] : new Base[] { this.submitter }; // Reference
822      case -340323263:
823        /* response */ return this.response == null ? new Base[0] : new Base[] { this.response }; // Reference
824      case 3076014:
825        /* date */ return this.date == null ? new Base[0] : new Base[] { this.date }; // DateType
826      case 1847674614:
827        /* responsible */ return this.responsible == null ? new Base[0] : new Base[] { this.responsible }; // Reference
828      case 106443592:
829        /* payee */ return this.payee == null ? new Base[0] : new Base[] { this.payee }; // Reference
830      case -1413853096:
831        /* amount */ return this.amount == null ? new Base[0] : new Base[] { this.amount }; // Money
832      default:
833        return super.getProperty(hash, name, checkValid);
834      }
835
836    }
837
838    @Override
839    public Base setProperty(int hash, String name, Base value) throws FHIRException {
840      switch (hash) {
841      case -1618432855: // identifier
842        this.identifier = castToIdentifier(value); // Identifier
843        return value;
844      case -1925032183: // predecessor
845        this.predecessor = castToIdentifier(value); // Identifier
846        return value;
847      case 3575610: // type
848        this.type = castToCodeableConcept(value); // CodeableConcept
849        return value;
850      case 1095692943: // request
851        this.request = castToReference(value); // Reference
852        return value;
853      case 348678409: // submitter
854        this.submitter = castToReference(value); // Reference
855        return value;
856      case -340323263: // response
857        this.response = castToReference(value); // Reference
858        return value;
859      case 3076014: // date
860        this.date = castToDate(value); // DateType
861        return value;
862      case 1847674614: // responsible
863        this.responsible = castToReference(value); // Reference
864        return value;
865      case 106443592: // payee
866        this.payee = castToReference(value); // Reference
867        return value;
868      case -1413853096: // amount
869        this.amount = castToMoney(value); // Money
870        return value;
871      default:
872        return super.setProperty(hash, name, value);
873      }
874
875    }
876
877    @Override
878    public Base setProperty(String name, Base value) throws FHIRException {
879      if (name.equals("identifier")) {
880        this.identifier = castToIdentifier(value); // Identifier
881      } else if (name.equals("predecessor")) {
882        this.predecessor = castToIdentifier(value); // Identifier
883      } else if (name.equals("type")) {
884        this.type = castToCodeableConcept(value); // CodeableConcept
885      } else if (name.equals("request")) {
886        this.request = castToReference(value); // Reference
887      } else if (name.equals("submitter")) {
888        this.submitter = castToReference(value); // Reference
889      } else if (name.equals("response")) {
890        this.response = castToReference(value); // Reference
891      } else if (name.equals("date")) {
892        this.date = castToDate(value); // DateType
893      } else if (name.equals("responsible")) {
894        this.responsible = castToReference(value); // Reference
895      } else if (name.equals("payee")) {
896        this.payee = castToReference(value); // Reference
897      } else if (name.equals("amount")) {
898        this.amount = castToMoney(value); // Money
899      } else
900        return super.setProperty(name, value);
901      return value;
902    }
903
904  @Override
905  public void removeChild(String name, Base value) throws FHIRException {
906      if (name.equals("identifier")) {
907        this.identifier = null;
908      } else if (name.equals("predecessor")) {
909        this.predecessor = null;
910      } else if (name.equals("type")) {
911        this.type = null;
912      } else if (name.equals("request")) {
913        this.request = null;
914      } else if (name.equals("submitter")) {
915        this.submitter = null;
916      } else if (name.equals("response")) {
917        this.response = null;
918      } else if (name.equals("date")) {
919        this.date = null;
920      } else if (name.equals("responsible")) {
921        this.responsible = null;
922      } else if (name.equals("payee")) {
923        this.payee = null;
924      } else if (name.equals("amount")) {
925        this.amount = null;
926      } else
927        super.removeChild(name, value);
928      
929    }
930
931    @Override
932    public Base makeProperty(int hash, String name) throws FHIRException {
933      switch (hash) {
934      case -1618432855:
935        return getIdentifier();
936      case -1925032183:
937        return getPredecessor();
938      case 3575610:
939        return getType();
940      case 1095692943:
941        return getRequest();
942      case 348678409:
943        return getSubmitter();
944      case -340323263:
945        return getResponse();
946      case 3076014:
947        return getDateElement();
948      case 1847674614:
949        return getResponsible();
950      case 106443592:
951        return getPayee();
952      case -1413853096:
953        return getAmount();
954      default:
955        return super.makeProperty(hash, name);
956      }
957
958    }
959
960    @Override
961    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
962      switch (hash) {
963      case -1618432855:
964        /* identifier */ return new String[] { "Identifier" };
965      case -1925032183:
966        /* predecessor */ return new String[] { "Identifier" };
967      case 3575610:
968        /* type */ return new String[] { "CodeableConcept" };
969      case 1095692943:
970        /* request */ return new String[] { "Reference" };
971      case 348678409:
972        /* submitter */ return new String[] { "Reference" };
973      case -340323263:
974        /* response */ return new String[] { "Reference" };
975      case 3076014:
976        /* date */ return new String[] { "date" };
977      case 1847674614:
978        /* responsible */ return new String[] { "Reference" };
979      case 106443592:
980        /* payee */ return new String[] { "Reference" };
981      case -1413853096:
982        /* amount */ return new String[] { "Money" };
983      default:
984        return super.getTypesForProperty(hash, name);
985      }
986
987    }
988
989    @Override
990    public Base addChild(String name) throws FHIRException {
991      if (name.equals("identifier")) {
992        this.identifier = new Identifier();
993        return this.identifier;
994      } else if (name.equals("predecessor")) {
995        this.predecessor = new Identifier();
996        return this.predecessor;
997      } else if (name.equals("type")) {
998        this.type = new CodeableConcept();
999        return this.type;
1000      } else if (name.equals("request")) {
1001        this.request = new Reference();
1002        return this.request;
1003      } else if (name.equals("submitter")) {
1004        this.submitter = new Reference();
1005        return this.submitter;
1006      } else if (name.equals("response")) {
1007        this.response = new Reference();
1008        return this.response;
1009      } else if (name.equals("date")) {
1010        throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.date");
1011      } else if (name.equals("responsible")) {
1012        this.responsible = new Reference();
1013        return this.responsible;
1014      } else if (name.equals("payee")) {
1015        this.payee = new Reference();
1016        return this.payee;
1017      } else if (name.equals("amount")) {
1018        this.amount = new Money();
1019        return this.amount;
1020      } else
1021        return super.addChild(name);
1022    }
1023
1024    public DetailsComponent copy() {
1025      DetailsComponent dst = new DetailsComponent();
1026      copyValues(dst);
1027      return dst;
1028    }
1029
1030    public void copyValues(DetailsComponent dst) {
1031      super.copyValues(dst);
1032      dst.identifier = identifier == null ? null : identifier.copy();
1033      dst.predecessor = predecessor == null ? null : predecessor.copy();
1034      dst.type = type == null ? null : type.copy();
1035      dst.request = request == null ? null : request.copy();
1036      dst.submitter = submitter == null ? null : submitter.copy();
1037      dst.response = response == null ? null : response.copy();
1038      dst.date = date == null ? null : date.copy();
1039      dst.responsible = responsible == null ? null : responsible.copy();
1040      dst.payee = payee == null ? null : payee.copy();
1041      dst.amount = amount == null ? null : amount.copy();
1042    }
1043
1044    @Override
1045    public boolean equalsDeep(Base other_) {
1046      if (!super.equalsDeep(other_))
1047        return false;
1048      if (!(other_ instanceof DetailsComponent))
1049        return false;
1050      DetailsComponent o = (DetailsComponent) other_;
1051      return compareDeep(identifier, o.identifier, true) && compareDeep(predecessor, o.predecessor, true)
1052          && compareDeep(type, o.type, true) && compareDeep(request, o.request, true)
1053          && compareDeep(submitter, o.submitter, true) && compareDeep(response, o.response, true)
1054          && compareDeep(date, o.date, true) && compareDeep(responsible, o.responsible, true)
1055          && compareDeep(payee, o.payee, true) && compareDeep(amount, o.amount, true);
1056    }
1057
1058    @Override
1059    public boolean equalsShallow(Base other_) {
1060      if (!super.equalsShallow(other_))
1061        return false;
1062      if (!(other_ instanceof DetailsComponent))
1063        return false;
1064      DetailsComponent o = (DetailsComponent) other_;
1065      return compareValues(date, o.date, true);
1066    }
1067
1068    public boolean isEmpty() {
1069      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, predecessor, type, request, submitter,
1070          response, date, responsible, payee, amount);
1071    }
1072
1073    public String fhirType() {
1074      return "PaymentReconciliation.detail";
1075
1076    }
1077
1078  }
1079
1080  @Block()
1081  public static class NotesComponent extends BackboneElement implements IBaseBackboneElement {
1082    /**
1083     * The business purpose of the note text.
1084     */
1085    @Child(name = "type", type = { CodeType.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
1086    @Description(shortDefinition = "display | print | printoper", formalDefinition = "The business purpose of the note text.")
1087    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/note-type")
1088    protected Enumeration<NoteType> type;
1089
1090    /**
1091     * The explanation or description associated with the processing.
1092     */
1093    @Child(name = "text", type = { StringType.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
1094    @Description(shortDefinition = "Note explanatory text", formalDefinition = "The explanation or description associated with the processing.")
1095    protected StringType text;
1096
1097    private static final long serialVersionUID = 529250161L;
1098
1099    /**
1100     * Constructor
1101     */
1102    public NotesComponent() {
1103      super();
1104    }
1105
1106    /**
1107     * @return {@link #type} (The business purpose of the note text.). This is the
1108     *         underlying object with id, value and extensions. The accessor
1109     *         "getType" gives direct access to the value
1110     */
1111    public Enumeration<NoteType> getTypeElement() {
1112      if (this.type == null)
1113        if (Configuration.errorOnAutoCreate())
1114          throw new Error("Attempt to auto-create NotesComponent.type");
1115        else if (Configuration.doAutoCreate())
1116          this.type = new Enumeration<NoteType>(new NoteTypeEnumFactory()); // bb
1117      return this.type;
1118    }
1119
1120    public boolean hasTypeElement() {
1121      return this.type != null && !this.type.isEmpty();
1122    }
1123
1124    public boolean hasType() {
1125      return this.type != null && !this.type.isEmpty();
1126    }
1127
1128    /**
1129     * @param value {@link #type} (The business purpose of the note text.). This is
1130     *              the underlying object with id, value and extensions. The
1131     *              accessor "getType" gives direct access to the value
1132     */
1133    public NotesComponent setTypeElement(Enumeration<NoteType> value) {
1134      this.type = value;
1135      return this;
1136    }
1137
1138    /**
1139     * @return The business purpose of the note text.
1140     */
1141    public NoteType getType() {
1142      return this.type == null ? null : this.type.getValue();
1143    }
1144
1145    /**
1146     * @param value The business purpose of the note text.
1147     */
1148    public NotesComponent setType(NoteType value) {
1149      if (value == null)
1150        this.type = null;
1151      else {
1152        if (this.type == null)
1153          this.type = new Enumeration<NoteType>(new NoteTypeEnumFactory());
1154        this.type.setValue(value);
1155      }
1156      return this;
1157    }
1158
1159    /**
1160     * @return {@link #text} (The explanation or description associated with the
1161     *         processing.). This is the underlying object with id, value and
1162     *         extensions. The accessor "getText" gives direct access to the value
1163     */
1164    public StringType getTextElement() {
1165      if (this.text == null)
1166        if (Configuration.errorOnAutoCreate())
1167          throw new Error("Attempt to auto-create NotesComponent.text");
1168        else if (Configuration.doAutoCreate())
1169          this.text = new StringType(); // bb
1170      return this.text;
1171    }
1172
1173    public boolean hasTextElement() {
1174      return this.text != null && !this.text.isEmpty();
1175    }
1176
1177    public boolean hasText() {
1178      return this.text != null && !this.text.isEmpty();
1179    }
1180
1181    /**
1182     * @param value {@link #text} (The explanation or description associated with
1183     *              the processing.). This is the underlying object with id, value
1184     *              and extensions. The accessor "getText" gives direct access to
1185     *              the value
1186     */
1187    public NotesComponent setTextElement(StringType value) {
1188      this.text = value;
1189      return this;
1190    }
1191
1192    /**
1193     * @return The explanation or description associated with the processing.
1194     */
1195    public String getText() {
1196      return this.text == null ? null : this.text.getValue();
1197    }
1198
1199    /**
1200     * @param value The explanation or description associated with the processing.
1201     */
1202    public NotesComponent setText(String value) {
1203      if (Utilities.noString(value))
1204        this.text = null;
1205      else {
1206        if (this.text == null)
1207          this.text = new StringType();
1208        this.text.setValue(value);
1209      }
1210      return this;
1211    }
1212
1213    protected void listChildren(List<Property> children) {
1214      super.listChildren(children);
1215      children.add(new Property("type", "code", "The business purpose of the note text.", 0, 1, type));
1216      children.add(
1217          new Property("text", "string", "The explanation or description associated with the processing.", 0, 1, text));
1218    }
1219
1220    @Override
1221    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1222      switch (_hash) {
1223      case 3575610:
1224        /* type */ return new Property("type", "code", "The business purpose of the note text.", 0, 1, type);
1225      case 3556653:
1226        /* text */ return new Property("text", "string",
1227            "The explanation or description associated with the processing.", 0, 1, text);
1228      default:
1229        return super.getNamedProperty(_hash, _name, _checkValid);
1230      }
1231
1232    }
1233
1234    @Override
1235    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1236      switch (hash) {
1237      case 3575610:
1238        /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // Enumeration<NoteType>
1239      case 3556653:
1240        /* text */ return this.text == null ? new Base[0] : new Base[] { this.text }; // StringType
1241      default:
1242        return super.getProperty(hash, name, checkValid);
1243      }
1244
1245    }
1246
1247    @Override
1248    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1249      switch (hash) {
1250      case 3575610: // type
1251        value = new NoteTypeEnumFactory().fromType(castToCode(value));
1252        this.type = (Enumeration) value; // Enumeration<NoteType>
1253        return value;
1254      case 3556653: // text
1255        this.text = castToString(value); // StringType
1256        return value;
1257      default:
1258        return super.setProperty(hash, name, value);
1259      }
1260
1261    }
1262
1263    @Override
1264    public Base setProperty(String name, Base value) throws FHIRException {
1265      if (name.equals("type")) {
1266        value = new NoteTypeEnumFactory().fromType(castToCode(value));
1267        this.type = (Enumeration) value; // Enumeration<NoteType>
1268      } else if (name.equals("text")) {
1269        this.text = castToString(value); // StringType
1270      } else
1271        return super.setProperty(name, value);
1272      return value;
1273    }
1274
1275  @Override
1276  public void removeChild(String name, Base value) throws FHIRException {
1277      if (name.equals("type")) {
1278        this.type = null;
1279      } else if (name.equals("text")) {
1280        this.text = null;
1281      } else
1282        super.removeChild(name, value);
1283      
1284    }
1285
1286    @Override
1287    public Base makeProperty(int hash, String name) throws FHIRException {
1288      switch (hash) {
1289      case 3575610:
1290        return getTypeElement();
1291      case 3556653:
1292        return getTextElement();
1293      default:
1294        return super.makeProperty(hash, name);
1295      }
1296
1297    }
1298
1299    @Override
1300    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1301      switch (hash) {
1302      case 3575610:
1303        /* type */ return new String[] { "code" };
1304      case 3556653:
1305        /* text */ return new String[] { "string" };
1306      default:
1307        return super.getTypesForProperty(hash, name);
1308      }
1309
1310    }
1311
1312    @Override
1313    public Base addChild(String name) throws FHIRException {
1314      if (name.equals("type")) {
1315        throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.type");
1316      } else if (name.equals("text")) {
1317        throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.text");
1318      } else
1319        return super.addChild(name);
1320    }
1321
1322    public NotesComponent copy() {
1323      NotesComponent dst = new NotesComponent();
1324      copyValues(dst);
1325      return dst;
1326    }
1327
1328    public void copyValues(NotesComponent dst) {
1329      super.copyValues(dst);
1330      dst.type = type == null ? null : type.copy();
1331      dst.text = text == null ? null : text.copy();
1332    }
1333
1334    @Override
1335    public boolean equalsDeep(Base other_) {
1336      if (!super.equalsDeep(other_))
1337        return false;
1338      if (!(other_ instanceof NotesComponent))
1339        return false;
1340      NotesComponent o = (NotesComponent) other_;
1341      return compareDeep(type, o.type, true) && compareDeep(text, o.text, true);
1342    }
1343
1344    @Override
1345    public boolean equalsShallow(Base other_) {
1346      if (!super.equalsShallow(other_))
1347        return false;
1348      if (!(other_ instanceof NotesComponent))
1349        return false;
1350      NotesComponent o = (NotesComponent) other_;
1351      return compareValues(type, o.type, true) && compareValues(text, o.text, true);
1352    }
1353
1354    public boolean isEmpty() {
1355      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, text);
1356    }
1357
1358    public String fhirType() {
1359      return "PaymentReconciliation.processNote";
1360
1361    }
1362
1363  }
1364
1365  /**
1366   * A unique identifier assigned to this payment reconciliation.
1367   */
1368  @Child(name = "identifier", type = {
1369      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1370  @Description(shortDefinition = "Business Identifier for a payment reconciliation", formalDefinition = "A unique identifier assigned to this payment reconciliation.")
1371  protected List<Identifier> identifier;
1372
1373  /**
1374   * The status of the resource instance.
1375   */
1376  @Child(name = "status", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = true, summary = true)
1377  @Description(shortDefinition = "active | cancelled | draft | entered-in-error", formalDefinition = "The status of the resource instance.")
1378  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/fm-status")
1379  protected Enumeration<PaymentReconciliationStatus> status;
1380
1381  /**
1382   * The period of time for which payments have been gathered into this bulk
1383   * payment for settlement.
1384   */
1385  @Child(name = "period", type = { Period.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
1386  @Description(shortDefinition = "Period covered", formalDefinition = "The period of time for which payments have been gathered into this bulk payment for settlement.")
1387  protected Period period;
1388
1389  /**
1390   * The date when the resource was created.
1391   */
1392  @Child(name = "created", type = { DateTimeType.class }, order = 3, min = 1, max = 1, modifier = false, summary = true)
1393  @Description(shortDefinition = "Creation date", formalDefinition = "The date when the resource was created.")
1394  protected DateTimeType created;
1395
1396  /**
1397   * The party who generated the payment.
1398   */
1399  @Child(name = "paymentIssuer", type = {
1400      Organization.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
1401  @Description(shortDefinition = "Party generating payment", formalDefinition = "The party who generated the payment.")
1402  protected Reference paymentIssuer;
1403
1404  /**
1405   * The actual object that is the target of the reference (The party who
1406   * generated the payment.)
1407   */
1408  protected Organization paymentIssuerTarget;
1409
1410  /**
1411   * Original request resource reference.
1412   */
1413  @Child(name = "request", type = { Task.class }, order = 5, min = 0, max = 1, modifier = false, summary = false)
1414  @Description(shortDefinition = "Reference to requesting resource", formalDefinition = "Original request resource reference.")
1415  protected Reference request;
1416
1417  /**
1418   * The actual object that is the target of the reference (Original request
1419   * resource reference.)
1420   */
1421  protected Task requestTarget;
1422
1423  /**
1424   * The practitioner who is responsible for the services rendered to the patient.
1425   */
1426  @Child(name = "requestor", type = { Practitioner.class, PractitionerRole.class,
1427      Organization.class }, order = 6, min = 0, max = 1, modifier = false, summary = false)
1428  @Description(shortDefinition = "Responsible practitioner", formalDefinition = "The practitioner who is responsible for the services rendered to the patient.")
1429  protected Reference requestor;
1430
1431  /**
1432   * The actual object that is the target of the reference (The practitioner who
1433   * is responsible for the services rendered to the patient.)
1434   */
1435  protected Resource requestorTarget;
1436
1437  /**
1438   * The outcome of a request for a reconciliation.
1439   */
1440  @Child(name = "outcome", type = { CodeType.class }, order = 7, min = 0, max = 1, modifier = false, summary = false)
1441  @Description(shortDefinition = "queued | complete | error | partial", formalDefinition = "The outcome of a request for a reconciliation.")
1442  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/remittance-outcome")
1443  protected Enumeration<RemittanceOutcome> outcome;
1444
1445  /**
1446   * A human readable description of the status of the request for the
1447   * reconciliation.
1448   */
1449  @Child(name = "disposition", type = {
1450      StringType.class }, order = 8, min = 0, max = 1, modifier = false, summary = false)
1451  @Description(shortDefinition = "Disposition message", formalDefinition = "A human readable description of the status of the request for the reconciliation.")
1452  protected StringType disposition;
1453
1454  /**
1455   * The date of payment as indicated on the financial instrument.
1456   */
1457  @Child(name = "paymentDate", type = { DateType.class }, order = 9, min = 1, max = 1, modifier = false, summary = true)
1458  @Description(shortDefinition = "When payment issued", formalDefinition = "The date of payment as indicated on the financial instrument.")
1459  protected DateType paymentDate;
1460
1461  /**
1462   * Total payment amount as indicated on the financial instrument.
1463   */
1464  @Child(name = "paymentAmount", type = { Money.class }, order = 10, min = 1, max = 1, modifier = false, summary = true)
1465  @Description(shortDefinition = "Total amount of Payment", formalDefinition = "Total payment amount as indicated on the financial instrument.")
1466  protected Money paymentAmount;
1467
1468  /**
1469   * Issuer's unique identifier for the payment instrument.
1470   */
1471  @Child(name = "paymentIdentifier", type = {
1472      Identifier.class }, order = 11, min = 0, max = 1, modifier = false, summary = false)
1473  @Description(shortDefinition = "Business identifier for the payment", formalDefinition = "Issuer's unique identifier for the payment instrument.")
1474  protected Identifier paymentIdentifier;
1475
1476  /**
1477   * Distribution of the payment amount for a previously acknowledged payable.
1478   */
1479  @Child(name = "detail", type = {}, order = 12, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1480  @Description(shortDefinition = "Settlement particulars", formalDefinition = "Distribution of the payment amount for a previously acknowledged payable.")
1481  protected List<DetailsComponent> detail;
1482
1483  /**
1484   * A code for the form to be used for printing the content.
1485   */
1486  @Child(name = "formCode", type = {
1487      CodeableConcept.class }, order = 13, min = 0, max = 1, modifier = false, summary = false)
1488  @Description(shortDefinition = "Printed form identifier", formalDefinition = "A code for the form to be used for printing the content.")
1489  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/forms")
1490  protected CodeableConcept formCode;
1491
1492  /**
1493   * A note that describes or explains the processing in a human readable form.
1494   */
1495  @Child(name = "processNote", type = {}, order = 14, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1496  @Description(shortDefinition = "Note concerning processing", formalDefinition = "A note that describes or explains the processing in a human readable form.")
1497  protected List<NotesComponent> processNote;
1498
1499  private static final long serialVersionUID = -1620965037L;
1500
1501  /**
1502   * Constructor
1503   */
1504  public PaymentReconciliation() {
1505    super();
1506  }
1507
1508  /**
1509   * Constructor
1510   */
1511  public PaymentReconciliation(Enumeration<PaymentReconciliationStatus> status, DateTimeType created,
1512      DateType paymentDate, Money paymentAmount) {
1513    super();
1514    this.status = status;
1515    this.created = created;
1516    this.paymentDate = paymentDate;
1517    this.paymentAmount = paymentAmount;
1518  }
1519
1520  /**
1521   * @return {@link #identifier} (A unique identifier assigned to this payment
1522   *         reconciliation.)
1523   */
1524  public List<Identifier> getIdentifier() {
1525    if (this.identifier == null)
1526      this.identifier = new ArrayList<Identifier>();
1527    return this.identifier;
1528  }
1529
1530  /**
1531   * @return Returns a reference to <code>this</code> for easy method chaining
1532   */
1533  public PaymentReconciliation setIdentifier(List<Identifier> theIdentifier) {
1534    this.identifier = theIdentifier;
1535    return this;
1536  }
1537
1538  public boolean hasIdentifier() {
1539    if (this.identifier == null)
1540      return false;
1541    for (Identifier item : this.identifier)
1542      if (!item.isEmpty())
1543        return true;
1544    return false;
1545  }
1546
1547  public Identifier addIdentifier() { // 3
1548    Identifier t = new Identifier();
1549    if (this.identifier == null)
1550      this.identifier = new ArrayList<Identifier>();
1551    this.identifier.add(t);
1552    return t;
1553  }
1554
1555  public PaymentReconciliation addIdentifier(Identifier t) { // 3
1556    if (t == null)
1557      return this;
1558    if (this.identifier == null)
1559      this.identifier = new ArrayList<Identifier>();
1560    this.identifier.add(t);
1561    return this;
1562  }
1563
1564  /**
1565   * @return The first repetition of repeating field {@link #identifier}, creating
1566   *         it if it does not already exist
1567   */
1568  public Identifier getIdentifierFirstRep() {
1569    if (getIdentifier().isEmpty()) {
1570      addIdentifier();
1571    }
1572    return getIdentifier().get(0);
1573  }
1574
1575  /**
1576   * @return {@link #status} (The status of the resource instance.). This is the
1577   *         underlying object with id, value and extensions. The accessor
1578   *         "getStatus" gives direct access to the value
1579   */
1580  public Enumeration<PaymentReconciliationStatus> getStatusElement() {
1581    if (this.status == null)
1582      if (Configuration.errorOnAutoCreate())
1583        throw new Error("Attempt to auto-create PaymentReconciliation.status");
1584      else if (Configuration.doAutoCreate())
1585        this.status = new Enumeration<PaymentReconciliationStatus>(new PaymentReconciliationStatusEnumFactory()); // bb
1586    return this.status;
1587  }
1588
1589  public boolean hasStatusElement() {
1590    return this.status != null && !this.status.isEmpty();
1591  }
1592
1593  public boolean hasStatus() {
1594    return this.status != null && !this.status.isEmpty();
1595  }
1596
1597  /**
1598   * @param value {@link #status} (The status of the resource instance.). This is
1599   *              the underlying object with id, value and extensions. The
1600   *              accessor "getStatus" gives direct access to the value
1601   */
1602  public PaymentReconciliation setStatusElement(Enumeration<PaymentReconciliationStatus> value) {
1603    this.status = value;
1604    return this;
1605  }
1606
1607  /**
1608   * @return The status of the resource instance.
1609   */
1610  public PaymentReconciliationStatus getStatus() {
1611    return this.status == null ? null : this.status.getValue();
1612  }
1613
1614  /**
1615   * @param value The status of the resource instance.
1616   */
1617  public PaymentReconciliation setStatus(PaymentReconciliationStatus value) {
1618    if (this.status == null)
1619      this.status = new Enumeration<PaymentReconciliationStatus>(new PaymentReconciliationStatusEnumFactory());
1620    this.status.setValue(value);
1621    return this;
1622  }
1623
1624  /**
1625   * @return {@link #period} (The period of time for which payments have been
1626   *         gathered into this bulk payment for settlement.)
1627   */
1628  public Period getPeriod() {
1629    if (this.period == null)
1630      if (Configuration.errorOnAutoCreate())
1631        throw new Error("Attempt to auto-create PaymentReconciliation.period");
1632      else if (Configuration.doAutoCreate())
1633        this.period = new Period(); // cc
1634    return this.period;
1635  }
1636
1637  public boolean hasPeriod() {
1638    return this.period != null && !this.period.isEmpty();
1639  }
1640
1641  /**
1642   * @param value {@link #period} (The period of time for which payments have been
1643   *              gathered into this bulk payment for settlement.)
1644   */
1645  public PaymentReconciliation setPeriod(Period value) {
1646    this.period = value;
1647    return this;
1648  }
1649
1650  /**
1651   * @return {@link #created} (The date when the resource was created.). This is
1652   *         the underlying object with id, value and extensions. The accessor
1653   *         "getCreated" gives direct access to the value
1654   */
1655  public DateTimeType getCreatedElement() {
1656    if (this.created == null)
1657      if (Configuration.errorOnAutoCreate())
1658        throw new Error("Attempt to auto-create PaymentReconciliation.created");
1659      else if (Configuration.doAutoCreate())
1660        this.created = new DateTimeType(); // bb
1661    return this.created;
1662  }
1663
1664  public boolean hasCreatedElement() {
1665    return this.created != null && !this.created.isEmpty();
1666  }
1667
1668  public boolean hasCreated() {
1669    return this.created != null && !this.created.isEmpty();
1670  }
1671
1672  /**
1673   * @param value {@link #created} (The date when the resource was created.). This
1674   *              is the underlying object with id, value and extensions. The
1675   *              accessor "getCreated" gives direct access to the value
1676   */
1677  public PaymentReconciliation setCreatedElement(DateTimeType value) {
1678    this.created = value;
1679    return this;
1680  }
1681
1682  /**
1683   * @return The date when the resource was created.
1684   */
1685  public Date getCreated() {
1686    return this.created == null ? null : this.created.getValue();
1687  }
1688
1689  /**
1690   * @param value The date when the resource was created.
1691   */
1692  public PaymentReconciliation setCreated(Date value) {
1693    if (this.created == null)
1694      this.created = new DateTimeType();
1695    this.created.setValue(value);
1696    return this;
1697  }
1698
1699  /**
1700   * @return {@link #paymentIssuer} (The party who generated the payment.)
1701   */
1702  public Reference getPaymentIssuer() {
1703    if (this.paymentIssuer == null)
1704      if (Configuration.errorOnAutoCreate())
1705        throw new Error("Attempt to auto-create PaymentReconciliation.paymentIssuer");
1706      else if (Configuration.doAutoCreate())
1707        this.paymentIssuer = new Reference(); // cc
1708    return this.paymentIssuer;
1709  }
1710
1711  public boolean hasPaymentIssuer() {
1712    return this.paymentIssuer != null && !this.paymentIssuer.isEmpty();
1713  }
1714
1715  /**
1716   * @param value {@link #paymentIssuer} (The party who generated the payment.)
1717   */
1718  public PaymentReconciliation setPaymentIssuer(Reference value) {
1719    this.paymentIssuer = value;
1720    return this;
1721  }
1722
1723  /**
1724   * @return {@link #paymentIssuer} The actual object that is the target of the
1725   *         reference. The reference library doesn't populate this, but you can
1726   *         use it to hold the resource if you resolve it. (The party who
1727   *         generated the payment.)
1728   */
1729  public Organization getPaymentIssuerTarget() {
1730    if (this.paymentIssuerTarget == null)
1731      if (Configuration.errorOnAutoCreate())
1732        throw new Error("Attempt to auto-create PaymentReconciliation.paymentIssuer");
1733      else if (Configuration.doAutoCreate())
1734        this.paymentIssuerTarget = new Organization(); // aa
1735    return this.paymentIssuerTarget;
1736  }
1737
1738  /**
1739   * @param value {@link #paymentIssuer} The actual object that is the target of
1740   *              the reference. The reference library doesn't use these, but you
1741   *              can use it to hold the resource if you resolve it. (The party
1742   *              who generated the payment.)
1743   */
1744  public PaymentReconciliation setPaymentIssuerTarget(Organization value) {
1745    this.paymentIssuerTarget = value;
1746    return this;
1747  }
1748
1749  /**
1750   * @return {@link #request} (Original request resource reference.)
1751   */
1752  public Reference getRequest() {
1753    if (this.request == null)
1754      if (Configuration.errorOnAutoCreate())
1755        throw new Error("Attempt to auto-create PaymentReconciliation.request");
1756      else if (Configuration.doAutoCreate())
1757        this.request = new Reference(); // cc
1758    return this.request;
1759  }
1760
1761  public boolean hasRequest() {
1762    return this.request != null && !this.request.isEmpty();
1763  }
1764
1765  /**
1766   * @param value {@link #request} (Original request resource reference.)
1767   */
1768  public PaymentReconciliation setRequest(Reference value) {
1769    this.request = value;
1770    return this;
1771  }
1772
1773  /**
1774   * @return {@link #request} The actual object that is the target of the
1775   *         reference. The reference library doesn't populate this, but you can
1776   *         use it to hold the resource if you resolve it. (Original request
1777   *         resource reference.)
1778   */
1779  public Task getRequestTarget() {
1780    if (this.requestTarget == null)
1781      if (Configuration.errorOnAutoCreate())
1782        throw new Error("Attempt to auto-create PaymentReconciliation.request");
1783      else if (Configuration.doAutoCreate())
1784        this.requestTarget = new Task(); // aa
1785    return this.requestTarget;
1786  }
1787
1788  /**
1789   * @param value {@link #request} The actual object that is the target of the
1790   *              reference. The reference library doesn't use these, but you can
1791   *              use it to hold the resource if you resolve it. (Original request
1792   *              resource reference.)
1793   */
1794  public PaymentReconciliation setRequestTarget(Task value) {
1795    this.requestTarget = value;
1796    return this;
1797  }
1798
1799  /**
1800   * @return {@link #requestor} (The practitioner who is responsible for the
1801   *         services rendered to the patient.)
1802   */
1803  public Reference getRequestor() {
1804    if (this.requestor == null)
1805      if (Configuration.errorOnAutoCreate())
1806        throw new Error("Attempt to auto-create PaymentReconciliation.requestor");
1807      else if (Configuration.doAutoCreate())
1808        this.requestor = new Reference(); // cc
1809    return this.requestor;
1810  }
1811
1812  public boolean hasRequestor() {
1813    return this.requestor != null && !this.requestor.isEmpty();
1814  }
1815
1816  /**
1817   * @param value {@link #requestor} (The practitioner who is responsible for the
1818   *              services rendered to the patient.)
1819   */
1820  public PaymentReconciliation setRequestor(Reference value) {
1821    this.requestor = value;
1822    return this;
1823  }
1824
1825  /**
1826   * @return {@link #requestor} The actual object that is the target of the
1827   *         reference. The reference library doesn't populate this, but you can
1828   *         use it to hold the resource if you resolve it. (The practitioner who
1829   *         is responsible for the services rendered to the patient.)
1830   */
1831  public Resource getRequestorTarget() {
1832    return this.requestorTarget;
1833  }
1834
1835  /**
1836   * @param value {@link #requestor} The actual object that is the target of the
1837   *              reference. The reference library doesn't use these, but you can
1838   *              use it to hold the resource if you resolve it. (The practitioner
1839   *              who is responsible for the services rendered to the patient.)
1840   */
1841  public PaymentReconciliation setRequestorTarget(Resource value) {
1842    this.requestorTarget = value;
1843    return this;
1844  }
1845
1846  /**
1847   * @return {@link #outcome} (The outcome of a request for a reconciliation.).
1848   *         This is the underlying object with id, value and extensions. The
1849   *         accessor "getOutcome" gives direct access to the value
1850   */
1851  public Enumeration<RemittanceOutcome> getOutcomeElement() {
1852    if (this.outcome == null)
1853      if (Configuration.errorOnAutoCreate())
1854        throw new Error("Attempt to auto-create PaymentReconciliation.outcome");
1855      else if (Configuration.doAutoCreate())
1856        this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory()); // bb
1857    return this.outcome;
1858  }
1859
1860  public boolean hasOutcomeElement() {
1861    return this.outcome != null && !this.outcome.isEmpty();
1862  }
1863
1864  public boolean hasOutcome() {
1865    return this.outcome != null && !this.outcome.isEmpty();
1866  }
1867
1868  /**
1869   * @param value {@link #outcome} (The outcome of a request for a
1870   *              reconciliation.). This is the underlying object with id, value
1871   *              and extensions. The accessor "getOutcome" gives direct access to
1872   *              the value
1873   */
1874  public PaymentReconciliation setOutcomeElement(Enumeration<RemittanceOutcome> value) {
1875    this.outcome = value;
1876    return this;
1877  }
1878
1879  /**
1880   * @return The outcome of a request for a reconciliation.
1881   */
1882  public RemittanceOutcome getOutcome() {
1883    return this.outcome == null ? null : this.outcome.getValue();
1884  }
1885
1886  /**
1887   * @param value The outcome of a request for a reconciliation.
1888   */
1889  public PaymentReconciliation setOutcome(RemittanceOutcome value) {
1890    if (value == null)
1891      this.outcome = null;
1892    else {
1893      if (this.outcome == null)
1894        this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory());
1895      this.outcome.setValue(value);
1896    }
1897    return this;
1898  }
1899
1900  /**
1901   * @return {@link #disposition} (A human readable description of the status of
1902   *         the request for the reconciliation.). This is the underlying object
1903   *         with id, value and extensions. The accessor "getDisposition" gives
1904   *         direct access to the value
1905   */
1906  public StringType getDispositionElement() {
1907    if (this.disposition == null)
1908      if (Configuration.errorOnAutoCreate())
1909        throw new Error("Attempt to auto-create PaymentReconciliation.disposition");
1910      else if (Configuration.doAutoCreate())
1911        this.disposition = new StringType(); // bb
1912    return this.disposition;
1913  }
1914
1915  public boolean hasDispositionElement() {
1916    return this.disposition != null && !this.disposition.isEmpty();
1917  }
1918
1919  public boolean hasDisposition() {
1920    return this.disposition != null && !this.disposition.isEmpty();
1921  }
1922
1923  /**
1924   * @param value {@link #disposition} (A human readable description of the status
1925   *              of the request for the reconciliation.). This is the underlying
1926   *              object with id, value and extensions. The accessor
1927   *              "getDisposition" gives direct access to the value
1928   */
1929  public PaymentReconciliation setDispositionElement(StringType value) {
1930    this.disposition = value;
1931    return this;
1932  }
1933
1934  /**
1935   * @return A human readable description of the status of the request for the
1936   *         reconciliation.
1937   */
1938  public String getDisposition() {
1939    return this.disposition == null ? null : this.disposition.getValue();
1940  }
1941
1942  /**
1943   * @param value A human readable description of the status of the request for
1944   *              the reconciliation.
1945   */
1946  public PaymentReconciliation setDisposition(String value) {
1947    if (Utilities.noString(value))
1948      this.disposition = null;
1949    else {
1950      if (this.disposition == null)
1951        this.disposition = new StringType();
1952      this.disposition.setValue(value);
1953    }
1954    return this;
1955  }
1956
1957  /**
1958   * @return {@link #paymentDate} (The date of payment as indicated on the
1959   *         financial instrument.). This is the underlying object with id, value
1960   *         and extensions. The accessor "getPaymentDate" gives direct access to
1961   *         the value
1962   */
1963  public DateType getPaymentDateElement() {
1964    if (this.paymentDate == null)
1965      if (Configuration.errorOnAutoCreate())
1966        throw new Error("Attempt to auto-create PaymentReconciliation.paymentDate");
1967      else if (Configuration.doAutoCreate())
1968        this.paymentDate = new DateType(); // bb
1969    return this.paymentDate;
1970  }
1971
1972  public boolean hasPaymentDateElement() {
1973    return this.paymentDate != null && !this.paymentDate.isEmpty();
1974  }
1975
1976  public boolean hasPaymentDate() {
1977    return this.paymentDate != null && !this.paymentDate.isEmpty();
1978  }
1979
1980  /**
1981   * @param value {@link #paymentDate} (The date of payment as indicated on the
1982   *              financial instrument.). This is the underlying object with id,
1983   *              value and extensions. The accessor "getPaymentDate" gives direct
1984   *              access to the value
1985   */
1986  public PaymentReconciliation setPaymentDateElement(DateType value) {
1987    this.paymentDate = value;
1988    return this;
1989  }
1990
1991  /**
1992   * @return The date of payment as indicated on the financial instrument.
1993   */
1994  public Date getPaymentDate() {
1995    return this.paymentDate == null ? null : this.paymentDate.getValue();
1996  }
1997
1998  /**
1999   * @param value The date of payment as indicated on the financial instrument.
2000   */
2001  public PaymentReconciliation setPaymentDate(Date value) {
2002    if (this.paymentDate == null)
2003      this.paymentDate = new DateType();
2004    this.paymentDate.setValue(value);
2005    return this;
2006  }
2007
2008  /**
2009   * @return {@link #paymentAmount} (Total payment amount as indicated on the
2010   *         financial instrument.)
2011   */
2012  public Money getPaymentAmount() {
2013    if (this.paymentAmount == null)
2014      if (Configuration.errorOnAutoCreate())
2015        throw new Error("Attempt to auto-create PaymentReconciliation.paymentAmount");
2016      else if (Configuration.doAutoCreate())
2017        this.paymentAmount = new Money(); // cc
2018    return this.paymentAmount;
2019  }
2020
2021  public boolean hasPaymentAmount() {
2022    return this.paymentAmount != null && !this.paymentAmount.isEmpty();
2023  }
2024
2025  /**
2026   * @param value {@link #paymentAmount} (Total payment amount as indicated on the
2027   *              financial instrument.)
2028   */
2029  public PaymentReconciliation setPaymentAmount(Money value) {
2030    this.paymentAmount = value;
2031    return this;
2032  }
2033
2034  /**
2035   * @return {@link #paymentIdentifier} (Issuer's unique identifier for the
2036   *         payment instrument.)
2037   */
2038  public Identifier getPaymentIdentifier() {
2039    if (this.paymentIdentifier == null)
2040      if (Configuration.errorOnAutoCreate())
2041        throw new Error("Attempt to auto-create PaymentReconciliation.paymentIdentifier");
2042      else if (Configuration.doAutoCreate())
2043        this.paymentIdentifier = new Identifier(); // cc
2044    return this.paymentIdentifier;
2045  }
2046
2047  public boolean hasPaymentIdentifier() {
2048    return this.paymentIdentifier != null && !this.paymentIdentifier.isEmpty();
2049  }
2050
2051  /**
2052   * @param value {@link #paymentIdentifier} (Issuer's unique identifier for the
2053   *              payment instrument.)
2054   */
2055  public PaymentReconciliation setPaymentIdentifier(Identifier value) {
2056    this.paymentIdentifier = value;
2057    return this;
2058  }
2059
2060  /**
2061   * @return {@link #detail} (Distribution of the payment amount for a previously
2062   *         acknowledged payable.)
2063   */
2064  public List<DetailsComponent> getDetail() {
2065    if (this.detail == null)
2066      this.detail = new ArrayList<DetailsComponent>();
2067    return this.detail;
2068  }
2069
2070  /**
2071   * @return Returns a reference to <code>this</code> for easy method chaining
2072   */
2073  public PaymentReconciliation setDetail(List<DetailsComponent> theDetail) {
2074    this.detail = theDetail;
2075    return this;
2076  }
2077
2078  public boolean hasDetail() {
2079    if (this.detail == null)
2080      return false;
2081    for (DetailsComponent item : this.detail)
2082      if (!item.isEmpty())
2083        return true;
2084    return false;
2085  }
2086
2087  public DetailsComponent addDetail() { // 3
2088    DetailsComponent t = new DetailsComponent();
2089    if (this.detail == null)
2090      this.detail = new ArrayList<DetailsComponent>();
2091    this.detail.add(t);
2092    return t;
2093  }
2094
2095  public PaymentReconciliation addDetail(DetailsComponent t) { // 3
2096    if (t == null)
2097      return this;
2098    if (this.detail == null)
2099      this.detail = new ArrayList<DetailsComponent>();
2100    this.detail.add(t);
2101    return this;
2102  }
2103
2104  /**
2105   * @return The first repetition of repeating field {@link #detail}, creating it
2106   *         if it does not already exist
2107   */
2108  public DetailsComponent getDetailFirstRep() {
2109    if (getDetail().isEmpty()) {
2110      addDetail();
2111    }
2112    return getDetail().get(0);
2113  }
2114
2115  /**
2116   * @return {@link #formCode} (A code for the form to be used for printing the
2117   *         content.)
2118   */
2119  public CodeableConcept getFormCode() {
2120    if (this.formCode == null)
2121      if (Configuration.errorOnAutoCreate())
2122        throw new Error("Attempt to auto-create PaymentReconciliation.formCode");
2123      else if (Configuration.doAutoCreate())
2124        this.formCode = new CodeableConcept(); // cc
2125    return this.formCode;
2126  }
2127
2128  public boolean hasFormCode() {
2129    return this.formCode != null && !this.formCode.isEmpty();
2130  }
2131
2132  /**
2133   * @param value {@link #formCode} (A code for the form to be used for printing
2134   *              the content.)
2135   */
2136  public PaymentReconciliation setFormCode(CodeableConcept value) {
2137    this.formCode = value;
2138    return this;
2139  }
2140
2141  /**
2142   * @return {@link #processNote} (A note that describes or explains the
2143   *         processing in a human readable form.)
2144   */
2145  public List<NotesComponent> getProcessNote() {
2146    if (this.processNote == null)
2147      this.processNote = new ArrayList<NotesComponent>();
2148    return this.processNote;
2149  }
2150
2151  /**
2152   * @return Returns a reference to <code>this</code> for easy method chaining
2153   */
2154  public PaymentReconciliation setProcessNote(List<NotesComponent> theProcessNote) {
2155    this.processNote = theProcessNote;
2156    return this;
2157  }
2158
2159  public boolean hasProcessNote() {
2160    if (this.processNote == null)
2161      return false;
2162    for (NotesComponent item : this.processNote)
2163      if (!item.isEmpty())
2164        return true;
2165    return false;
2166  }
2167
2168  public NotesComponent addProcessNote() { // 3
2169    NotesComponent t = new NotesComponent();
2170    if (this.processNote == null)
2171      this.processNote = new ArrayList<NotesComponent>();
2172    this.processNote.add(t);
2173    return t;
2174  }
2175
2176  public PaymentReconciliation addProcessNote(NotesComponent t) { // 3
2177    if (t == null)
2178      return this;
2179    if (this.processNote == null)
2180      this.processNote = new ArrayList<NotesComponent>();
2181    this.processNote.add(t);
2182    return this;
2183  }
2184
2185  /**
2186   * @return The first repetition of repeating field {@link #processNote},
2187   *         creating it if it does not already exist
2188   */
2189  public NotesComponent getProcessNoteFirstRep() {
2190    if (getProcessNote().isEmpty()) {
2191      addProcessNote();
2192    }
2193    return getProcessNote().get(0);
2194  }
2195
2196  protected void listChildren(List<Property> children) {
2197    super.listChildren(children);
2198    children.add(new Property("identifier", "Identifier",
2199        "A unique identifier assigned to this payment reconciliation.", 0, java.lang.Integer.MAX_VALUE, identifier));
2200    children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
2201    children.add(new Property("period", "Period",
2202        "The period of time for which payments have been gathered into this bulk payment for settlement.", 0, 1,
2203        period));
2204    children.add(new Property("created", "dateTime", "The date when the resource was created.", 0, 1, created));
2205    children.add(new Property("paymentIssuer", "Reference(Organization)", "The party who generated the payment.", 0, 1,
2206        paymentIssuer));
2207    children.add(new Property("request", "Reference(Task)", "Original request resource reference.", 0, 1, request));
2208    children.add(new Property("requestor", "Reference(Practitioner|PractitionerRole|Organization)",
2209        "The practitioner who is responsible for the services rendered to the patient.", 0, 1, requestor));
2210    children.add(new Property("outcome", "code", "The outcome of a request for a reconciliation.", 0, 1, outcome));
2211    children.add(new Property("disposition", "string",
2212        "A human readable description of the status of the request for the reconciliation.", 0, 1, disposition));
2213    children.add(new Property("paymentDate", "date", "The date of payment as indicated on the financial instrument.", 0,
2214        1, paymentDate));
2215    children.add(new Property("paymentAmount", "Money",
2216        "Total payment amount as indicated on the financial instrument.", 0, 1, paymentAmount));
2217    children.add(new Property("paymentIdentifier", "Identifier",
2218        "Issuer's unique identifier for the payment instrument.", 0, 1, paymentIdentifier));
2219    children.add(new Property("detail", "", "Distribution of the payment amount for a previously acknowledged payable.",
2220        0, java.lang.Integer.MAX_VALUE, detail));
2221    children.add(new Property("formCode", "CodeableConcept", "A code for the form to be used for printing the content.",
2222        0, 1, formCode));
2223    children.add(
2224        new Property("processNote", "", "A note that describes or explains the processing in a human readable form.", 0,
2225            java.lang.Integer.MAX_VALUE, processNote));
2226  }
2227
2228  @Override
2229  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2230    switch (_hash) {
2231    case -1618432855:
2232      /* identifier */ return new Property("identifier", "Identifier",
2233          "A unique identifier assigned to this payment reconciliation.", 0, java.lang.Integer.MAX_VALUE, identifier);
2234    case -892481550:
2235      /* status */ return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
2236    case -991726143:
2237      /* period */ return new Property("period", "Period",
2238          "The period of time for which payments have been gathered into this bulk payment for settlement.", 0, 1,
2239          period);
2240    case 1028554472:
2241      /* created */ return new Property("created", "dateTime", "The date when the resource was created.", 0, 1,
2242          created);
2243    case 1144026207:
2244      /* paymentIssuer */ return new Property("paymentIssuer", "Reference(Organization)",
2245          "The party who generated the payment.", 0, 1, paymentIssuer);
2246    case 1095692943:
2247      /* request */ return new Property("request", "Reference(Task)", "Original request resource reference.", 0, 1,
2248          request);
2249    case 693934258:
2250      /* requestor */ return new Property("requestor", "Reference(Practitioner|PractitionerRole|Organization)",
2251          "The practitioner who is responsible for the services rendered to the patient.", 0, 1, requestor);
2252    case -1106507950:
2253      /* outcome */ return new Property("outcome", "code", "The outcome of a request for a reconciliation.", 0, 1,
2254          outcome);
2255    case 583380919:
2256      /* disposition */ return new Property("disposition", "string",
2257          "A human readable description of the status of the request for the reconciliation.", 0, 1, disposition);
2258    case -1540873516:
2259      /* paymentDate */ return new Property("paymentDate", "date",
2260          "The date of payment as indicated on the financial instrument.", 0, 1, paymentDate);
2261    case 909332990:
2262      /* paymentAmount */ return new Property("paymentAmount", "Money",
2263          "Total payment amount as indicated on the financial instrument.", 0, 1, paymentAmount);
2264    case 1555852111:
2265      /* paymentIdentifier */ return new Property("paymentIdentifier", "Identifier",
2266          "Issuer's unique identifier for the payment instrument.", 0, 1, paymentIdentifier);
2267    case -1335224239:
2268      /* detail */ return new Property("detail", "",
2269          "Distribution of the payment amount for a previously acknowledged payable.", 0, java.lang.Integer.MAX_VALUE,
2270          detail);
2271    case 473181393:
2272      /* formCode */ return new Property("formCode", "CodeableConcept",
2273          "A code for the form to be used for printing the content.", 0, 1, formCode);
2274    case 202339073:
2275      /* processNote */ return new Property("processNote", "",
2276          "A note that describes or explains the processing in a human readable form.", 0, java.lang.Integer.MAX_VALUE,
2277          processNote);
2278    default:
2279      return super.getNamedProperty(_hash, _name, _checkValid);
2280    }
2281
2282  }
2283
2284  @Override
2285  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2286    switch (hash) {
2287    case -1618432855:
2288      /* identifier */ return this.identifier == null ? new Base[0]
2289          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2290    case -892481550:
2291      /* status */ return this.status == null ? new Base[0] : new Base[] { this.status }; // Enumeration<PaymentReconciliationStatus>
2292    case -991726143:
2293      /* period */ return this.period == null ? new Base[0] : new Base[] { this.period }; // Period
2294    case 1028554472:
2295      /* created */ return this.created == null ? new Base[0] : new Base[] { this.created }; // DateTimeType
2296    case 1144026207:
2297      /* paymentIssuer */ return this.paymentIssuer == null ? new Base[0] : new Base[] { this.paymentIssuer }; // Reference
2298    case 1095692943:
2299      /* request */ return this.request == null ? new Base[0] : new Base[] { this.request }; // Reference
2300    case 693934258:
2301      /* requestor */ return this.requestor == null ? new Base[0] : new Base[] { this.requestor }; // Reference
2302    case -1106507950:
2303      /* outcome */ return this.outcome == null ? new Base[0] : new Base[] { this.outcome }; // Enumeration<RemittanceOutcome>
2304    case 583380919:
2305      /* disposition */ return this.disposition == null ? new Base[0] : new Base[] { this.disposition }; // StringType
2306    case -1540873516:
2307      /* paymentDate */ return this.paymentDate == null ? new Base[0] : new Base[] { this.paymentDate }; // DateType
2308    case 909332990:
2309      /* paymentAmount */ return this.paymentAmount == null ? new Base[0] : new Base[] { this.paymentAmount }; // Money
2310    case 1555852111:
2311      /* paymentIdentifier */ return this.paymentIdentifier == null ? new Base[0]
2312          : new Base[] { this.paymentIdentifier }; // Identifier
2313    case -1335224239:
2314      /* detail */ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // DetailsComponent
2315    case 473181393:
2316      /* formCode */ return this.formCode == null ? new Base[0] : new Base[] { this.formCode }; // CodeableConcept
2317    case 202339073:
2318      /* processNote */ return this.processNote == null ? new Base[0]
2319          : this.processNote.toArray(new Base[this.processNote.size()]); // NotesComponent
2320    default:
2321      return super.getProperty(hash, name, checkValid);
2322    }
2323
2324  }
2325
2326  @Override
2327  public Base setProperty(int hash, String name, Base value) throws FHIRException {
2328    switch (hash) {
2329    case -1618432855: // identifier
2330      this.getIdentifier().add(castToIdentifier(value)); // Identifier
2331      return value;
2332    case -892481550: // status
2333      value = new PaymentReconciliationStatusEnumFactory().fromType(castToCode(value));
2334      this.status = (Enumeration) value; // Enumeration<PaymentReconciliationStatus>
2335      return value;
2336    case -991726143: // period
2337      this.period = castToPeriod(value); // Period
2338      return value;
2339    case 1028554472: // created
2340      this.created = castToDateTime(value); // DateTimeType
2341      return value;
2342    case 1144026207: // paymentIssuer
2343      this.paymentIssuer = castToReference(value); // Reference
2344      return value;
2345    case 1095692943: // request
2346      this.request = castToReference(value); // Reference
2347      return value;
2348    case 693934258: // requestor
2349      this.requestor = castToReference(value); // Reference
2350      return value;
2351    case -1106507950: // outcome
2352      value = new RemittanceOutcomeEnumFactory().fromType(castToCode(value));
2353      this.outcome = (Enumeration) value; // Enumeration<RemittanceOutcome>
2354      return value;
2355    case 583380919: // disposition
2356      this.disposition = castToString(value); // StringType
2357      return value;
2358    case -1540873516: // paymentDate
2359      this.paymentDate = castToDate(value); // DateType
2360      return value;
2361    case 909332990: // paymentAmount
2362      this.paymentAmount = castToMoney(value); // Money
2363      return value;
2364    case 1555852111: // paymentIdentifier
2365      this.paymentIdentifier = castToIdentifier(value); // Identifier
2366      return value;
2367    case -1335224239: // detail
2368      this.getDetail().add((DetailsComponent) value); // DetailsComponent
2369      return value;
2370    case 473181393: // formCode
2371      this.formCode = castToCodeableConcept(value); // CodeableConcept
2372      return value;
2373    case 202339073: // processNote
2374      this.getProcessNote().add((NotesComponent) value); // NotesComponent
2375      return value;
2376    default:
2377      return super.setProperty(hash, name, value);
2378    }
2379
2380  }
2381
2382  @Override
2383  public Base setProperty(String name, Base value) throws FHIRException {
2384    if (name.equals("identifier")) {
2385      this.getIdentifier().add(castToIdentifier(value));
2386    } else if (name.equals("status")) {
2387      value = new PaymentReconciliationStatusEnumFactory().fromType(castToCode(value));
2388      this.status = (Enumeration) value; // Enumeration<PaymentReconciliationStatus>
2389    } else if (name.equals("period")) {
2390      this.period = castToPeriod(value); // Period
2391    } else if (name.equals("created")) {
2392      this.created = castToDateTime(value); // DateTimeType
2393    } else if (name.equals("paymentIssuer")) {
2394      this.paymentIssuer = castToReference(value); // Reference
2395    } else if (name.equals("request")) {
2396      this.request = castToReference(value); // Reference
2397    } else if (name.equals("requestor")) {
2398      this.requestor = castToReference(value); // Reference
2399    } else if (name.equals("outcome")) {
2400      value = new RemittanceOutcomeEnumFactory().fromType(castToCode(value));
2401      this.outcome = (Enumeration) value; // Enumeration<RemittanceOutcome>
2402    } else if (name.equals("disposition")) {
2403      this.disposition = castToString(value); // StringType
2404    } else if (name.equals("paymentDate")) {
2405      this.paymentDate = castToDate(value); // DateType
2406    } else if (name.equals("paymentAmount")) {
2407      this.paymentAmount = castToMoney(value); // Money
2408    } else if (name.equals("paymentIdentifier")) {
2409      this.paymentIdentifier = castToIdentifier(value); // Identifier
2410    } else if (name.equals("detail")) {
2411      this.getDetail().add((DetailsComponent) value);
2412    } else if (name.equals("formCode")) {
2413      this.formCode = castToCodeableConcept(value); // CodeableConcept
2414    } else if (name.equals("processNote")) {
2415      this.getProcessNote().add((NotesComponent) value);
2416    } else
2417      return super.setProperty(name, value);
2418    return value;
2419  }
2420
2421  @Override
2422  public void removeChild(String name, Base value) throws FHIRException {
2423    if (name.equals("identifier")) {
2424      this.getIdentifier().remove(castToIdentifier(value));
2425    } else if (name.equals("status")) {
2426      this.status = null;
2427    } else if (name.equals("period")) {
2428      this.period = null;
2429    } else if (name.equals("created")) {
2430      this.created = null;
2431    } else if (name.equals("paymentIssuer")) {
2432      this.paymentIssuer = null;
2433    } else if (name.equals("request")) {
2434      this.request = null;
2435    } else if (name.equals("requestor")) {
2436      this.requestor = null;
2437    } else if (name.equals("outcome")) {
2438      this.outcome = null;
2439    } else if (name.equals("disposition")) {
2440      this.disposition = null;
2441    } else if (name.equals("paymentDate")) {
2442      this.paymentDate = null;
2443    } else if (name.equals("paymentAmount")) {
2444      this.paymentAmount = null;
2445    } else if (name.equals("paymentIdentifier")) {
2446      this.paymentIdentifier = null;
2447    } else if (name.equals("detail")) {
2448      this.getDetail().remove((DetailsComponent) value);
2449    } else if (name.equals("formCode")) {
2450      this.formCode = null;
2451    } else if (name.equals("processNote")) {
2452      this.getProcessNote().remove((NotesComponent) value);
2453    } else
2454      super.removeChild(name, value);
2455    
2456  }
2457
2458  @Override
2459  public Base makeProperty(int hash, String name) throws FHIRException {
2460    switch (hash) {
2461    case -1618432855:
2462      return addIdentifier();
2463    case -892481550:
2464      return getStatusElement();
2465    case -991726143:
2466      return getPeriod();
2467    case 1028554472:
2468      return getCreatedElement();
2469    case 1144026207:
2470      return getPaymentIssuer();
2471    case 1095692943:
2472      return getRequest();
2473    case 693934258:
2474      return getRequestor();
2475    case -1106507950:
2476      return getOutcomeElement();
2477    case 583380919:
2478      return getDispositionElement();
2479    case -1540873516:
2480      return getPaymentDateElement();
2481    case 909332990:
2482      return getPaymentAmount();
2483    case 1555852111:
2484      return getPaymentIdentifier();
2485    case -1335224239:
2486      return addDetail();
2487    case 473181393:
2488      return getFormCode();
2489    case 202339073:
2490      return addProcessNote();
2491    default:
2492      return super.makeProperty(hash, name);
2493    }
2494
2495  }
2496
2497  @Override
2498  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2499    switch (hash) {
2500    case -1618432855:
2501      /* identifier */ return new String[] { "Identifier" };
2502    case -892481550:
2503      /* status */ return new String[] { "code" };
2504    case -991726143:
2505      /* period */ return new String[] { "Period" };
2506    case 1028554472:
2507      /* created */ return new String[] { "dateTime" };
2508    case 1144026207:
2509      /* paymentIssuer */ return new String[] { "Reference" };
2510    case 1095692943:
2511      /* request */ return new String[] { "Reference" };
2512    case 693934258:
2513      /* requestor */ return new String[] { "Reference" };
2514    case -1106507950:
2515      /* outcome */ return new String[] { "code" };
2516    case 583380919:
2517      /* disposition */ return new String[] { "string" };
2518    case -1540873516:
2519      /* paymentDate */ return new String[] { "date" };
2520    case 909332990:
2521      /* paymentAmount */ return new String[] { "Money" };
2522    case 1555852111:
2523      /* paymentIdentifier */ return new String[] { "Identifier" };
2524    case -1335224239:
2525      /* detail */ return new String[] {};
2526    case 473181393:
2527      /* formCode */ return new String[] { "CodeableConcept" };
2528    case 202339073:
2529      /* processNote */ return new String[] {};
2530    default:
2531      return super.getTypesForProperty(hash, name);
2532    }
2533
2534  }
2535
2536  @Override
2537  public Base addChild(String name) throws FHIRException {
2538    if (name.equals("identifier")) {
2539      return addIdentifier();
2540    } else if (name.equals("status")) {
2541      throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.status");
2542    } else if (name.equals("period")) {
2543      this.period = new Period();
2544      return this.period;
2545    } else if (name.equals("created")) {
2546      throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.created");
2547    } else if (name.equals("paymentIssuer")) {
2548      this.paymentIssuer = new Reference();
2549      return this.paymentIssuer;
2550    } else if (name.equals("request")) {
2551      this.request = new Reference();
2552      return this.request;
2553    } else if (name.equals("requestor")) {
2554      this.requestor = new Reference();
2555      return this.requestor;
2556    } else if (name.equals("outcome")) {
2557      throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.outcome");
2558    } else if (name.equals("disposition")) {
2559      throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.disposition");
2560    } else if (name.equals("paymentDate")) {
2561      throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.paymentDate");
2562    } else if (name.equals("paymentAmount")) {
2563      this.paymentAmount = new Money();
2564      return this.paymentAmount;
2565    } else if (name.equals("paymentIdentifier")) {
2566      this.paymentIdentifier = new Identifier();
2567      return this.paymentIdentifier;
2568    } else if (name.equals("detail")) {
2569      return addDetail();
2570    } else if (name.equals("formCode")) {
2571      this.formCode = new CodeableConcept();
2572      return this.formCode;
2573    } else if (name.equals("processNote")) {
2574      return addProcessNote();
2575    } else
2576      return super.addChild(name);
2577  }
2578
2579  public String fhirType() {
2580    return "PaymentReconciliation";
2581
2582  }
2583
2584  public PaymentReconciliation copy() {
2585    PaymentReconciliation dst = new PaymentReconciliation();
2586    copyValues(dst);
2587    return dst;
2588  }
2589
2590  public void copyValues(PaymentReconciliation dst) {
2591    super.copyValues(dst);
2592    if (identifier != null) {
2593      dst.identifier = new ArrayList<Identifier>();
2594      for (Identifier i : identifier)
2595        dst.identifier.add(i.copy());
2596    }
2597    ;
2598    dst.status = status == null ? null : status.copy();
2599    dst.period = period == null ? null : period.copy();
2600    dst.created = created == null ? null : created.copy();
2601    dst.paymentIssuer = paymentIssuer == null ? null : paymentIssuer.copy();
2602    dst.request = request == null ? null : request.copy();
2603    dst.requestor = requestor == null ? null : requestor.copy();
2604    dst.outcome = outcome == null ? null : outcome.copy();
2605    dst.disposition = disposition == null ? null : disposition.copy();
2606    dst.paymentDate = paymentDate == null ? null : paymentDate.copy();
2607    dst.paymentAmount = paymentAmount == null ? null : paymentAmount.copy();
2608    dst.paymentIdentifier = paymentIdentifier == null ? null : paymentIdentifier.copy();
2609    if (detail != null) {
2610      dst.detail = new ArrayList<DetailsComponent>();
2611      for (DetailsComponent i : detail)
2612        dst.detail.add(i.copy());
2613    }
2614    ;
2615    dst.formCode = formCode == null ? null : formCode.copy();
2616    if (processNote != null) {
2617      dst.processNote = new ArrayList<NotesComponent>();
2618      for (NotesComponent i : processNote)
2619        dst.processNote.add(i.copy());
2620    }
2621    ;
2622  }
2623
2624  protected PaymentReconciliation typedCopy() {
2625    return copy();
2626  }
2627
2628  @Override
2629  public boolean equalsDeep(Base other_) {
2630    if (!super.equalsDeep(other_))
2631      return false;
2632    if (!(other_ instanceof PaymentReconciliation))
2633      return false;
2634    PaymentReconciliation o = (PaymentReconciliation) other_;
2635    return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true)
2636        && compareDeep(period, o.period, true) && compareDeep(created, o.created, true)
2637        && compareDeep(paymentIssuer, o.paymentIssuer, true) && compareDeep(request, o.request, true)
2638        && compareDeep(requestor, o.requestor, true) && compareDeep(outcome, o.outcome, true)
2639        && compareDeep(disposition, o.disposition, true) && compareDeep(paymentDate, o.paymentDate, true)
2640        && compareDeep(paymentAmount, o.paymentAmount, true)
2641        && compareDeep(paymentIdentifier, o.paymentIdentifier, true) && compareDeep(detail, o.detail, true)
2642        && compareDeep(formCode, o.formCode, true) && compareDeep(processNote, o.processNote, true);
2643  }
2644
2645  @Override
2646  public boolean equalsShallow(Base other_) {
2647    if (!super.equalsShallow(other_))
2648      return false;
2649    if (!(other_ instanceof PaymentReconciliation))
2650      return false;
2651    PaymentReconciliation o = (PaymentReconciliation) other_;
2652    return compareValues(status, o.status, true) && compareValues(created, o.created, true)
2653        && compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true)
2654        && compareValues(paymentDate, o.paymentDate, true);
2655  }
2656
2657  public boolean isEmpty() {
2658    return super.isEmpty()
2659        && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, period, created, paymentIssuer, request, requestor,
2660            outcome, disposition, paymentDate, paymentAmount, paymentIdentifier, detail, formCode, processNote);
2661  }
2662
2663  @Override
2664  public ResourceType getResourceType() {
2665    return ResourceType.PaymentReconciliation;
2666  }
2667
2668  /**
2669   * Search parameter: <b>identifier</b>
2670   * <p>
2671   * Description: <b>The business identifier of the ExplanationOfBenefit</b><br>
2672   * Type: <b>token</b><br>
2673   * Path: <b>PaymentReconciliation.identifier</b><br>
2674   * </p>
2675   */
2676  @SearchParamDefinition(name = "identifier", path = "PaymentReconciliation.identifier", description = "The business identifier of the ExplanationOfBenefit", type = "token")
2677  public static final String SP_IDENTIFIER = "identifier";
2678  /**
2679   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2680   * <p>
2681   * Description: <b>The business identifier of the ExplanationOfBenefit</b><br>
2682   * Type: <b>token</b><br>
2683   * Path: <b>PaymentReconciliation.identifier</b><br>
2684   * </p>
2685   */
2686  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2687      SP_IDENTIFIER);
2688
2689  /**
2690   * Search parameter: <b>request</b>
2691   * <p>
2692   * Description: <b>The reference to the claim</b><br>
2693   * Type: <b>reference</b><br>
2694   * Path: <b>PaymentReconciliation.request</b><br>
2695   * </p>
2696   */
2697  @SearchParamDefinition(name = "request", path = "PaymentReconciliation.request", description = "The reference to the claim", type = "reference", target = {
2698      Task.class })
2699  public static final String SP_REQUEST = "request";
2700  /**
2701   * <b>Fluent Client</b> search parameter constant for <b>request</b>
2702   * <p>
2703   * Description: <b>The reference to the claim</b><br>
2704   * Type: <b>reference</b><br>
2705   * Path: <b>PaymentReconciliation.request</b><br>
2706   * </p>
2707   */
2708  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2709      SP_REQUEST);
2710
2711  /**
2712   * Constant for fluent queries to be used to add include statements. Specifies
2713   * the path value of "<b>PaymentReconciliation:request</b>".
2714   */
2715  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include(
2716      "PaymentReconciliation:request").toLocked();
2717
2718  /**
2719   * Search parameter: <b>disposition</b>
2720   * <p>
2721   * Description: <b>The contents of the disposition message</b><br>
2722   * Type: <b>string</b><br>
2723   * Path: <b>PaymentReconciliation.disposition</b><br>
2724   * </p>
2725   */
2726  @SearchParamDefinition(name = "disposition", path = "PaymentReconciliation.disposition", description = "The contents of the disposition message", type = "string")
2727  public static final String SP_DISPOSITION = "disposition";
2728  /**
2729   * <b>Fluent Client</b> search parameter constant for <b>disposition</b>
2730   * <p>
2731   * Description: <b>The contents of the disposition message</b><br>
2732   * Type: <b>string</b><br>
2733   * Path: <b>PaymentReconciliation.disposition</b><br>
2734   * </p>
2735   */
2736  public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(
2737      SP_DISPOSITION);
2738
2739  /**
2740   * Search parameter: <b>created</b>
2741   * <p>
2742   * Description: <b>The creation date</b><br>
2743   * Type: <b>date</b><br>
2744   * Path: <b>PaymentReconciliation.created</b><br>
2745   * </p>
2746   */
2747  @SearchParamDefinition(name = "created", path = "PaymentReconciliation.created", description = "The creation date", type = "date")
2748  public static final String SP_CREATED = "created";
2749  /**
2750   * <b>Fluent Client</b> search parameter constant for <b>created</b>
2751   * <p>
2752   * Description: <b>The creation date</b><br>
2753   * Type: <b>date</b><br>
2754   * Path: <b>PaymentReconciliation.created</b><br>
2755   * </p>
2756   */
2757  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(
2758      SP_CREATED);
2759
2760  /**
2761   * Search parameter: <b>payment-issuer</b>
2762   * <p>
2763   * Description: <b>The organization which generated this resource</b><br>
2764   * Type: <b>reference</b><br>
2765   * Path: <b>PaymentReconciliation.paymentIssuer</b><br>
2766   * </p>
2767   */
2768  @SearchParamDefinition(name = "payment-issuer", path = "PaymentReconciliation.paymentIssuer", description = "The organization which generated this resource", type = "reference", target = {
2769      Organization.class })
2770  public static final String SP_PAYMENT_ISSUER = "payment-issuer";
2771  /**
2772   * <b>Fluent Client</b> search parameter constant for <b>payment-issuer</b>
2773   * <p>
2774   * Description: <b>The organization which generated this resource</b><br>
2775   * Type: <b>reference</b><br>
2776   * Path: <b>PaymentReconciliation.paymentIssuer</b><br>
2777   * </p>
2778   */
2779  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PAYMENT_ISSUER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2780      SP_PAYMENT_ISSUER);
2781
2782  /**
2783   * Constant for fluent queries to be used to add include statements. Specifies
2784   * the path value of "<b>PaymentReconciliation:payment-issuer</b>".
2785   */
2786  public static final ca.uhn.fhir.model.api.Include INCLUDE_PAYMENT_ISSUER = new ca.uhn.fhir.model.api.Include(
2787      "PaymentReconciliation:payment-issuer").toLocked();
2788
2789  /**
2790   * Search parameter: <b>outcome</b>
2791   * <p>
2792   * Description: <b>The processing outcome</b><br>
2793   * Type: <b>token</b><br>
2794   * Path: <b>PaymentReconciliation.outcome</b><br>
2795   * </p>
2796   */
2797  @SearchParamDefinition(name = "outcome", path = "PaymentReconciliation.outcome", description = "The processing outcome", type = "token")
2798  public static final String SP_OUTCOME = "outcome";
2799  /**
2800   * <b>Fluent Client</b> search parameter constant for <b>outcome</b>
2801   * <p>
2802   * Description: <b>The processing outcome</b><br>
2803   * Type: <b>token</b><br>
2804   * Path: <b>PaymentReconciliation.outcome</b><br>
2805   * </p>
2806   */
2807  public static final ca.uhn.fhir.rest.gclient.TokenClientParam OUTCOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2808      SP_OUTCOME);
2809
2810  /**
2811   * Search parameter: <b>requestor</b>
2812   * <p>
2813   * Description: <b>The reference to the provider who submitted the claim</b><br>
2814   * Type: <b>reference</b><br>
2815   * Path: <b>PaymentReconciliation.requestor</b><br>
2816   * </p>
2817   */
2818  @SearchParamDefinition(name = "requestor", path = "PaymentReconciliation.requestor", description = "The reference to the provider who submitted the claim", type = "reference", providesMembershipIn = {
2819      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Practitioner") }, target = { Organization.class,
2820          Practitioner.class, PractitionerRole.class })
2821  public static final String SP_REQUESTOR = "requestor";
2822  /**
2823   * <b>Fluent Client</b> search parameter constant for <b>requestor</b>
2824   * <p>
2825   * Description: <b>The reference to the provider who submitted the claim</b><br>
2826   * Type: <b>reference</b><br>
2827   * Path: <b>PaymentReconciliation.requestor</b><br>
2828   * </p>
2829   */
2830  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2831      SP_REQUESTOR);
2832
2833  /**
2834   * Constant for fluent queries to be used to add include statements. Specifies
2835   * the path value of "<b>PaymentReconciliation:requestor</b>".
2836   */
2837  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTOR = new ca.uhn.fhir.model.api.Include(
2838      "PaymentReconciliation:requestor").toLocked();
2839
2840  /**
2841   * Search parameter: <b>status</b>
2842   * <p>
2843   * Description: <b>The status of the payment reconciliation</b><br>
2844   * Type: <b>token</b><br>
2845   * Path: <b>PaymentReconciliation.status</b><br>
2846   * </p>
2847   */
2848  @SearchParamDefinition(name = "status", path = "PaymentReconciliation.status", description = "The status of the payment reconciliation", type = "token")
2849  public static final String SP_STATUS = "status";
2850  /**
2851   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2852   * <p>
2853   * Description: <b>The status of the payment reconciliation</b><br>
2854   * Type: <b>token</b><br>
2855   * Path: <b>PaymentReconciliation.status</b><br>
2856   * </p>
2857   */
2858  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2859      SP_STATUS);
2860
2861}