001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * This resource provides the details including amount of a payment and allocates the payment items being paid.
052 */
053@ResourceDef(name="PaymentReconciliation", profile="http://hl7.org/fhir/StructureDefinition/PaymentReconciliation")
054public class PaymentReconciliation extends DomainResource {
055
056    public enum NoteType {
057        /**
058         * Display the note.
059         */
060        DISPLAY, 
061        /**
062         * Print the note on the form.
063         */
064        PRINT, 
065        /**
066         * Print the note for the operator.
067         */
068        PRINTOPER, 
069        /**
070         * added to help the parsers with the generic types
071         */
072        NULL;
073        public static NoteType fromCode(String codeString) throws FHIRException {
074            if (codeString == null || "".equals(codeString))
075                return null;
076        if ("display".equals(codeString))
077          return DISPLAY;
078        if ("print".equals(codeString))
079          return PRINT;
080        if ("printoper".equals(codeString))
081          return PRINTOPER;
082        if (Configuration.isAcceptInvalidEnums())
083          return null;
084        else
085          throw new FHIRException("Unknown NoteType code '"+codeString+"'");
086        }
087        public String toCode() {
088          switch (this) {
089            case DISPLAY: return "display";
090            case PRINT: return "print";
091            case PRINTOPER: return "printoper";
092            case NULL: return null;
093            default: return "?";
094          }
095        }
096        public String getSystem() {
097          switch (this) {
098            case DISPLAY: return "http://hl7.org/fhir/note-type";
099            case PRINT: return "http://hl7.org/fhir/note-type";
100            case PRINTOPER: return "http://hl7.org/fhir/note-type";
101            case NULL: return null;
102            default: return "?";
103          }
104        }
105        public String getDefinition() {
106          switch (this) {
107            case DISPLAY: return "Display the note.";
108            case PRINT: return "Print the note on the form.";
109            case PRINTOPER: return "Print the note for the operator.";
110            case NULL: return null;
111            default: return "?";
112          }
113        }
114        public String getDisplay() {
115          switch (this) {
116            case DISPLAY: return "Display";
117            case PRINT: return "Print (Form)";
118            case PRINTOPER: return "Print (Operator)";
119            case NULL: return null;
120            default: return "?";
121          }
122        }
123    }
124
125  public static class NoteTypeEnumFactory implements EnumFactory<NoteType> {
126    public NoteType fromCode(String codeString) throws IllegalArgumentException {
127      if (codeString == null || "".equals(codeString))
128            if (codeString == null || "".equals(codeString))
129                return null;
130        if ("display".equals(codeString))
131          return NoteType.DISPLAY;
132        if ("print".equals(codeString))
133          return NoteType.PRINT;
134        if ("printoper".equals(codeString))
135          return NoteType.PRINTOPER;
136        throw new IllegalArgumentException("Unknown NoteType code '"+codeString+"'");
137        }
138        public Enumeration<NoteType> fromType(PrimitiveType<?> code) throws FHIRException {
139          if (code == null)
140            return null;
141          if (code.isEmpty())
142            return new Enumeration<NoteType>(this, NoteType.NULL, code);
143          String codeString = ((PrimitiveType) code).asStringValue();
144          if (codeString == null || "".equals(codeString))
145            return new Enumeration<NoteType>(this, NoteType.NULL, code);
146        if ("display".equals(codeString))
147          return new Enumeration<NoteType>(this, NoteType.DISPLAY, code);
148        if ("print".equals(codeString))
149          return new Enumeration<NoteType>(this, NoteType.PRINT, code);
150        if ("printoper".equals(codeString))
151          return new Enumeration<NoteType>(this, NoteType.PRINTOPER, code);
152        throw new FHIRException("Unknown NoteType code '"+codeString+"'");
153        }
154    public String toCode(NoteType code) {
155      if (code == NoteType.DISPLAY)
156        return "display";
157      if (code == NoteType.PRINT)
158        return "print";
159      if (code == NoteType.PRINTOPER)
160        return "printoper";
161      return "?";
162      }
163    public String toSystem(NoteType code) {
164      return code.getSystem();
165      }
166    }
167
168    public enum PaymentOutcome {
169        /**
170         * The Claim/Pre-authorization/Pre-determination has been received but processing has not begun.
171         */
172        QUEUED, 
173        /**
174         * The processing has completed without errors
175         */
176        COMPLETE, 
177        /**
178         * One or more errors have been detected in the Claim
179         */
180        ERROR, 
181        /**
182         * No errors have been detected in the Claim and some of the adjudication has been performed.
183         */
184        PARTIAL, 
185        /**
186         * added to help the parsers with the generic types
187         */
188        NULL;
189        public static PaymentOutcome fromCode(String codeString) throws FHIRException {
190            if (codeString == null || "".equals(codeString))
191                return null;
192        if ("queued".equals(codeString))
193          return QUEUED;
194        if ("complete".equals(codeString))
195          return COMPLETE;
196        if ("error".equals(codeString))
197          return ERROR;
198        if ("partial".equals(codeString))
199          return PARTIAL;
200        if (Configuration.isAcceptInvalidEnums())
201          return null;
202        else
203          throw new FHIRException("Unknown PaymentOutcome code '"+codeString+"'");
204        }
205        public String toCode() {
206          switch (this) {
207            case QUEUED: return "queued";
208            case COMPLETE: return "complete";
209            case ERROR: return "error";
210            case PARTIAL: return "partial";
211            case NULL: return null;
212            default: return "?";
213          }
214        }
215        public String getSystem() {
216          switch (this) {
217            case QUEUED: return "http://hl7.org/fhir/payment-outcome";
218            case COMPLETE: return "http://hl7.org/fhir/payment-outcome";
219            case ERROR: return "http://hl7.org/fhir/payment-outcome";
220            case PARTIAL: return "http://hl7.org/fhir/payment-outcome";
221            case NULL: return null;
222            default: return "?";
223          }
224        }
225        public String getDefinition() {
226          switch (this) {
227            case QUEUED: return "The Claim/Pre-authorization/Pre-determination has been received but processing has not begun.";
228            case COMPLETE: return "The processing has completed without errors";
229            case ERROR: return "One or more errors have been detected in the Claim";
230            case PARTIAL: return "No errors have been detected in the Claim and some of the adjudication has been performed.";
231            case NULL: return null;
232            default: return "?";
233          }
234        }
235        public String getDisplay() {
236          switch (this) {
237            case QUEUED: return "Queued";
238            case COMPLETE: return "Processing Complete";
239            case ERROR: return "Error";
240            case PARTIAL: return "Partial Processing";
241            case NULL: return null;
242            default: return "?";
243          }
244        }
245    }
246
247  public static class PaymentOutcomeEnumFactory implements EnumFactory<PaymentOutcome> {
248    public PaymentOutcome fromCode(String codeString) throws IllegalArgumentException {
249      if (codeString == null || "".equals(codeString))
250            if (codeString == null || "".equals(codeString))
251                return null;
252        if ("queued".equals(codeString))
253          return PaymentOutcome.QUEUED;
254        if ("complete".equals(codeString))
255          return PaymentOutcome.COMPLETE;
256        if ("error".equals(codeString))
257          return PaymentOutcome.ERROR;
258        if ("partial".equals(codeString))
259          return PaymentOutcome.PARTIAL;
260        throw new IllegalArgumentException("Unknown PaymentOutcome code '"+codeString+"'");
261        }
262        public Enumeration<PaymentOutcome> fromType(PrimitiveType<?> code) throws FHIRException {
263          if (code == null)
264            return null;
265          if (code.isEmpty())
266            return new Enumeration<PaymentOutcome>(this, PaymentOutcome.NULL, code);
267          String codeString = ((PrimitiveType) code).asStringValue();
268          if (codeString == null || "".equals(codeString))
269            return new Enumeration<PaymentOutcome>(this, PaymentOutcome.NULL, code);
270        if ("queued".equals(codeString))
271          return new Enumeration<PaymentOutcome>(this, PaymentOutcome.QUEUED, code);
272        if ("complete".equals(codeString))
273          return new Enumeration<PaymentOutcome>(this, PaymentOutcome.COMPLETE, code);
274        if ("error".equals(codeString))
275          return new Enumeration<PaymentOutcome>(this, PaymentOutcome.ERROR, code);
276        if ("partial".equals(codeString))
277          return new Enumeration<PaymentOutcome>(this, PaymentOutcome.PARTIAL, code);
278        throw new FHIRException("Unknown PaymentOutcome code '"+codeString+"'");
279        }
280    public String toCode(PaymentOutcome code) {
281      if (code == PaymentOutcome.QUEUED)
282        return "queued";
283      if (code == PaymentOutcome.COMPLETE)
284        return "complete";
285      if (code == PaymentOutcome.ERROR)
286        return "error";
287      if (code == PaymentOutcome.PARTIAL)
288        return "partial";
289      return "?";
290      }
291    public String toSystem(PaymentOutcome code) {
292      return code.getSystem();
293      }
294    }
295
296    @Block()
297    public static class PaymentReconciliationAllocationComponent extends BackboneElement implements IBaseBackboneElement {
298        /**
299         * Unique identifier for the current payment item for the referenced payable.
300         */
301        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=false)
302        @Description(shortDefinition="Business identifier of the payment detail", formalDefinition="Unique identifier for the current payment item for the referenced payable." )
303        protected Identifier identifier;
304
305        /**
306         * Unique identifier for the prior payment item for the referenced payable.
307         */
308        @Child(name = "predecessor", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=false)
309        @Description(shortDefinition="Business identifier of the prior payment detail", formalDefinition="Unique identifier for the prior payment item for the referenced payable." )
310        protected Identifier predecessor;
311
312        /**
313         * Specific resource to which the payment/adjustment/advance applies.
314         */
315        @Child(name = "target", type = {Claim.class, Account.class, Invoice.class, ChargeItem.class, Encounter.class, Contract.class}, order=3, min=0, max=1, modifier=false, summary=false)
316        @Description(shortDefinition="Subject of the payment", formalDefinition="Specific resource to which the payment/adjustment/advance applies." )
317        protected Reference target;
318
319        /**
320         *  Identifies the claim line item, encounter or other sub-element being paid. Note payment may be partial, that is not match the then outstanding balance or amount incurred.
321         */
322        @Child(name = "targetItem", type = {StringType.class, Identifier.class, PositiveIntType.class}, order=4, min=0, max=1, modifier=false, summary=false)
323        @Description(shortDefinition="Sub-element of the subject", formalDefinition=" Identifies the claim line item, encounter or other sub-element being paid. Note payment may be partial, that is not match the then outstanding balance or amount incurred." )
324        protected DataType targetItem;
325
326        /**
327         * The Encounter to which this payment applies, may be completed by the receiver, used for search.
328         */
329        @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1, modifier=false, summary=false)
330        @Description(shortDefinition="Applied-to encounter", formalDefinition="The Encounter to which this payment applies, may be completed by the receiver, used for search." )
331        protected Reference encounter;
332
333        /**
334         * The Account to which this payment applies, may be completed by the receiver, used for search.
335         */
336        @Child(name = "account", type = {Account.class}, order=6, min=0, max=1, modifier=false, summary=false)
337        @Description(shortDefinition="Applied-to account", formalDefinition="The Account to which this payment applies, may be completed by the receiver, used for search." )
338        protected Reference account;
339
340        /**
341         * Code to indicate the nature of the payment.
342         */
343        @Child(name = "type", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false)
344        @Description(shortDefinition="Category of payment", formalDefinition="Code to indicate the nature of the payment." )
345        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payment-type")
346        protected CodeableConcept type;
347
348        /**
349         * The party which submitted the claim or financial transaction.
350         */
351        @Child(name = "submitter", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=false)
352        @Description(shortDefinition="Submitter of the request", formalDefinition="The party which submitted the claim or financial transaction." )
353        protected Reference submitter;
354
355        /**
356         * A resource, such as a ClaimResponse, which contains a commitment to payment.
357         */
358        @Child(name = "response", type = {ClaimResponse.class}, order=9, min=0, max=1, modifier=false, summary=false)
359        @Description(shortDefinition="Response committing to a payment", formalDefinition="A resource, such as a ClaimResponse, which contains a commitment to payment." )
360        protected Reference response;
361
362        /**
363         * The date from the response resource containing a commitment to pay.
364         */
365        @Child(name = "date", type = {DateType.class}, order=10, min=0, max=1, modifier=false, summary=false)
366        @Description(shortDefinition="Date of commitment to pay", formalDefinition="The date from the response resource containing a commitment to pay." )
367        protected DateType date;
368
369        /**
370         * A reference to the individual who is responsible for inquiries regarding the response and its payment.
371         */
372        @Child(name = "responsible", type = {PractitionerRole.class}, order=11, min=0, max=1, modifier=false, summary=false)
373        @Description(shortDefinition="Contact for the response", formalDefinition="A reference to the individual who is responsible for inquiries regarding the response and its payment." )
374        protected Reference responsible;
375
376        /**
377         * The party which is receiving the payment.
378         */
379        @Child(name = "payee", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=12, min=0, max=1, modifier=false, summary=false)
380        @Description(shortDefinition="Recipient of the payment", formalDefinition="The party which is receiving the payment." )
381        protected Reference payee;
382
383        /**
384         * The monetary amount allocated from the total payment to the payable.
385         */
386        @Child(name = "amount", type = {Money.class}, order=13, min=0, max=1, modifier=false, summary=false)
387        @Description(shortDefinition="Amount allocated to this payable", formalDefinition="The monetary amount allocated from the total payment to the payable." )
388        protected Money amount;
389
390        private static final long serialVersionUID = -1153705409L;
391
392    /**
393     * Constructor
394     */
395      public PaymentReconciliationAllocationComponent() {
396        super();
397      }
398
399        /**
400         * @return {@link #identifier} (Unique identifier for the current payment item for the referenced payable.)
401         */
402        public Identifier getIdentifier() { 
403          if (this.identifier == null)
404            if (Configuration.errorOnAutoCreate())
405              throw new Error("Attempt to auto-create PaymentReconciliationAllocationComponent.identifier");
406            else if (Configuration.doAutoCreate())
407              this.identifier = new Identifier(); // cc
408          return this.identifier;
409        }
410
411        public boolean hasIdentifier() { 
412          return this.identifier != null && !this.identifier.isEmpty();
413        }
414
415        /**
416         * @param value {@link #identifier} (Unique identifier for the current payment item for the referenced payable.)
417         */
418        public PaymentReconciliationAllocationComponent setIdentifier(Identifier value) { 
419          this.identifier = value;
420          return this;
421        }
422
423        /**
424         * @return {@link #predecessor} (Unique identifier for the prior payment item for the referenced payable.)
425         */
426        public Identifier getPredecessor() { 
427          if (this.predecessor == null)
428            if (Configuration.errorOnAutoCreate())
429              throw new Error("Attempt to auto-create PaymentReconciliationAllocationComponent.predecessor");
430            else if (Configuration.doAutoCreate())
431              this.predecessor = new Identifier(); // cc
432          return this.predecessor;
433        }
434
435        public boolean hasPredecessor() { 
436          return this.predecessor != null && !this.predecessor.isEmpty();
437        }
438
439        /**
440         * @param value {@link #predecessor} (Unique identifier for the prior payment item for the referenced payable.)
441         */
442        public PaymentReconciliationAllocationComponent setPredecessor(Identifier value) { 
443          this.predecessor = value;
444          return this;
445        }
446
447        /**
448         * @return {@link #target} (Specific resource to which the payment/adjustment/advance applies.)
449         */
450        public Reference getTarget() { 
451          if (this.target == null)
452            if (Configuration.errorOnAutoCreate())
453              throw new Error("Attempt to auto-create PaymentReconciliationAllocationComponent.target");
454            else if (Configuration.doAutoCreate())
455              this.target = new Reference(); // cc
456          return this.target;
457        }
458
459        public boolean hasTarget() { 
460          return this.target != null && !this.target.isEmpty();
461        }
462
463        /**
464         * @param value {@link #target} (Specific resource to which the payment/adjustment/advance applies.)
465         */
466        public PaymentReconciliationAllocationComponent setTarget(Reference value) { 
467          this.target = value;
468          return this;
469        }
470
471        /**
472         * @return {@link #targetItem} ( Identifies the claim line item, encounter or other sub-element being paid. Note payment may be partial, that is not match the then outstanding balance or amount incurred.)
473         */
474        public DataType getTargetItem() { 
475          return this.targetItem;
476        }
477
478        /**
479         * @return {@link #targetItem} ( Identifies the claim line item, encounter or other sub-element being paid. Note payment may be partial, that is not match the then outstanding balance or amount incurred.)
480         */
481        public StringType getTargetItemStringType() throws FHIRException { 
482          if (this.targetItem == null)
483            this.targetItem = new StringType();
484          if (!(this.targetItem instanceof StringType))
485            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.targetItem.getClass().getName()+" was encountered");
486          return (StringType) this.targetItem;
487        }
488
489        public boolean hasTargetItemStringType() { 
490          return this != null && this.targetItem instanceof StringType;
491        }
492
493        /**
494         * @return {@link #targetItem} ( Identifies the claim line item, encounter or other sub-element being paid. Note payment may be partial, that is not match the then outstanding balance or amount incurred.)
495         */
496        public Identifier getTargetItemIdentifier() throws FHIRException { 
497          if (this.targetItem == null)
498            this.targetItem = new Identifier();
499          if (!(this.targetItem instanceof Identifier))
500            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.targetItem.getClass().getName()+" was encountered");
501          return (Identifier) this.targetItem;
502        }
503
504        public boolean hasTargetItemIdentifier() { 
505          return this != null && this.targetItem instanceof Identifier;
506        }
507
508        /**
509         * @return {@link #targetItem} ( Identifies the claim line item, encounter or other sub-element being paid. Note payment may be partial, that is not match the then outstanding balance or amount incurred.)
510         */
511        public PositiveIntType getTargetItemPositiveIntType() throws FHIRException { 
512          if (this.targetItem == null)
513            this.targetItem = new PositiveIntType();
514          if (!(this.targetItem instanceof PositiveIntType))
515            throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.targetItem.getClass().getName()+" was encountered");
516          return (PositiveIntType) this.targetItem;
517        }
518
519        public boolean hasTargetItemPositiveIntType() { 
520          return this != null && this.targetItem instanceof PositiveIntType;
521        }
522
523        public boolean hasTargetItem() { 
524          return this.targetItem != null && !this.targetItem.isEmpty();
525        }
526
527        /**
528         * @param value {@link #targetItem} ( Identifies the claim line item, encounter or other sub-element being paid. Note payment may be partial, that is not match the then outstanding balance or amount incurred.)
529         */
530        public PaymentReconciliationAllocationComponent setTargetItem(DataType value) { 
531          if (value != null && !(value instanceof StringType || value instanceof Identifier || value instanceof PositiveIntType))
532            throw new FHIRException("Not the right type for PaymentReconciliation.allocation.targetItem[x]: "+value.fhirType());
533          this.targetItem = value;
534          return this;
535        }
536
537        /**
538         * @return {@link #encounter} (The Encounter to which this payment applies, may be completed by the receiver, used for search.)
539         */
540        public Reference getEncounter() { 
541          if (this.encounter == null)
542            if (Configuration.errorOnAutoCreate())
543              throw new Error("Attempt to auto-create PaymentReconciliationAllocationComponent.encounter");
544            else if (Configuration.doAutoCreate())
545              this.encounter = new Reference(); // cc
546          return this.encounter;
547        }
548
549        public boolean hasEncounter() { 
550          return this.encounter != null && !this.encounter.isEmpty();
551        }
552
553        /**
554         * @param value {@link #encounter} (The Encounter to which this payment applies, may be completed by the receiver, used for search.)
555         */
556        public PaymentReconciliationAllocationComponent setEncounter(Reference value) { 
557          this.encounter = value;
558          return this;
559        }
560
561        /**
562         * @return {@link #account} (The Account to which this payment applies, may be completed by the receiver, used for search.)
563         */
564        public Reference getAccount() { 
565          if (this.account == null)
566            if (Configuration.errorOnAutoCreate())
567              throw new Error("Attempt to auto-create PaymentReconciliationAllocationComponent.account");
568            else if (Configuration.doAutoCreate())
569              this.account = new Reference(); // cc
570          return this.account;
571        }
572
573        public boolean hasAccount() { 
574          return this.account != null && !this.account.isEmpty();
575        }
576
577        /**
578         * @param value {@link #account} (The Account to which this payment applies, may be completed by the receiver, used for search.)
579         */
580        public PaymentReconciliationAllocationComponent setAccount(Reference value) { 
581          this.account = value;
582          return this;
583        }
584
585        /**
586         * @return {@link #type} (Code to indicate the nature of the payment.)
587         */
588        public CodeableConcept getType() { 
589          if (this.type == null)
590            if (Configuration.errorOnAutoCreate())
591              throw new Error("Attempt to auto-create PaymentReconciliationAllocationComponent.type");
592            else if (Configuration.doAutoCreate())
593              this.type = new CodeableConcept(); // cc
594          return this.type;
595        }
596
597        public boolean hasType() { 
598          return this.type != null && !this.type.isEmpty();
599        }
600
601        /**
602         * @param value {@link #type} (Code to indicate the nature of the payment.)
603         */
604        public PaymentReconciliationAllocationComponent setType(CodeableConcept value) { 
605          this.type = value;
606          return this;
607        }
608
609        /**
610         * @return {@link #submitter} (The party which submitted the claim or financial transaction.)
611         */
612        public Reference getSubmitter() { 
613          if (this.submitter == null)
614            if (Configuration.errorOnAutoCreate())
615              throw new Error("Attempt to auto-create PaymentReconciliationAllocationComponent.submitter");
616            else if (Configuration.doAutoCreate())
617              this.submitter = new Reference(); // cc
618          return this.submitter;
619        }
620
621        public boolean hasSubmitter() { 
622          return this.submitter != null && !this.submitter.isEmpty();
623        }
624
625        /**
626         * @param value {@link #submitter} (The party which submitted the claim or financial transaction.)
627         */
628        public PaymentReconciliationAllocationComponent setSubmitter(Reference value) { 
629          this.submitter = value;
630          return this;
631        }
632
633        /**
634         * @return {@link #response} (A resource, such as a ClaimResponse, which contains a commitment to payment.)
635         */
636        public Reference getResponse() { 
637          if (this.response == null)
638            if (Configuration.errorOnAutoCreate())
639              throw new Error("Attempt to auto-create PaymentReconciliationAllocationComponent.response");
640            else if (Configuration.doAutoCreate())
641              this.response = new Reference(); // cc
642          return this.response;
643        }
644
645        public boolean hasResponse() { 
646          return this.response != null && !this.response.isEmpty();
647        }
648
649        /**
650         * @param value {@link #response} (A resource, such as a ClaimResponse, which contains a commitment to payment.)
651         */
652        public PaymentReconciliationAllocationComponent setResponse(Reference value) { 
653          this.response = value;
654          return this;
655        }
656
657        /**
658         * @return {@link #date} (The date from the response resource containing a commitment to pay.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
659         */
660        public DateType getDateElement() { 
661          if (this.date == null)
662            if (Configuration.errorOnAutoCreate())
663              throw new Error("Attempt to auto-create PaymentReconciliationAllocationComponent.date");
664            else if (Configuration.doAutoCreate())
665              this.date = new DateType(); // bb
666          return this.date;
667        }
668
669        public boolean hasDateElement() { 
670          return this.date != null && !this.date.isEmpty();
671        }
672
673        public boolean hasDate() { 
674          return this.date != null && !this.date.isEmpty();
675        }
676
677        /**
678         * @param value {@link #date} (The date from the response resource containing a commitment to pay.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
679         */
680        public PaymentReconciliationAllocationComponent setDateElement(DateType value) { 
681          this.date = value;
682          return this;
683        }
684
685        /**
686         * @return The date from the response resource containing a commitment to pay.
687         */
688        public Date getDate() { 
689          return this.date == null ? null : this.date.getValue();
690        }
691
692        /**
693         * @param value The date from the response resource containing a commitment to pay.
694         */
695        public PaymentReconciliationAllocationComponent setDate(Date value) { 
696          if (value == null)
697            this.date = null;
698          else {
699            if (this.date == null)
700              this.date = new DateType();
701            this.date.setValue(value);
702          }
703          return this;
704        }
705
706        /**
707         * @return {@link #responsible} (A reference to the individual who is responsible for inquiries regarding the response and its payment.)
708         */
709        public Reference getResponsible() { 
710          if (this.responsible == null)
711            if (Configuration.errorOnAutoCreate())
712              throw new Error("Attempt to auto-create PaymentReconciliationAllocationComponent.responsible");
713            else if (Configuration.doAutoCreate())
714              this.responsible = new Reference(); // cc
715          return this.responsible;
716        }
717
718        public boolean hasResponsible() { 
719          return this.responsible != null && !this.responsible.isEmpty();
720        }
721
722        /**
723         * @param value {@link #responsible} (A reference to the individual who is responsible for inquiries regarding the response and its payment.)
724         */
725        public PaymentReconciliationAllocationComponent setResponsible(Reference value) { 
726          this.responsible = value;
727          return this;
728        }
729
730        /**
731         * @return {@link #payee} (The party which is receiving the payment.)
732         */
733        public Reference getPayee() { 
734          if (this.payee == null)
735            if (Configuration.errorOnAutoCreate())
736              throw new Error("Attempt to auto-create PaymentReconciliationAllocationComponent.payee");
737            else if (Configuration.doAutoCreate())
738              this.payee = new Reference(); // cc
739          return this.payee;
740        }
741
742        public boolean hasPayee() { 
743          return this.payee != null && !this.payee.isEmpty();
744        }
745
746        /**
747         * @param value {@link #payee} (The party which is receiving the payment.)
748         */
749        public PaymentReconciliationAllocationComponent setPayee(Reference value) { 
750          this.payee = value;
751          return this;
752        }
753
754        /**
755         * @return {@link #amount} (The monetary amount allocated from the total payment to the payable.)
756         */
757        public Money getAmount() { 
758          if (this.amount == null)
759            if (Configuration.errorOnAutoCreate())
760              throw new Error("Attempt to auto-create PaymentReconciliationAllocationComponent.amount");
761            else if (Configuration.doAutoCreate())
762              this.amount = new Money(); // cc
763          return this.amount;
764        }
765
766        public boolean hasAmount() { 
767          return this.amount != null && !this.amount.isEmpty();
768        }
769
770        /**
771         * @param value {@link #amount} (The monetary amount allocated from the total payment to the payable.)
772         */
773        public PaymentReconciliationAllocationComponent setAmount(Money value) { 
774          this.amount = value;
775          return this;
776        }
777
778        protected void listChildren(List<Property> children) {
779          super.listChildren(children);
780          children.add(new Property("identifier", "Identifier", "Unique identifier for the current payment item for the referenced payable.", 0, 1, identifier));
781          children.add(new Property("predecessor", "Identifier", "Unique identifier for the prior payment item for the referenced payable.", 0, 1, predecessor));
782          children.add(new Property("target", "Reference(Claim|Account|Invoice|ChargeItem|Encounter|Contract)", "Specific resource to which the payment/adjustment/advance applies.", 0, 1, target));
783          children.add(new Property("targetItem[x]", "string|Identifier|positiveInt", " Identifies the claim line item, encounter or other sub-element being paid. Note payment may be partial, that is not match the then outstanding balance or amount incurred.", 0, 1, targetItem));
784          children.add(new Property("encounter", "Reference(Encounter)", "The Encounter to which this payment applies, may be completed by the receiver, used for search.", 0, 1, encounter));
785          children.add(new Property("account", "Reference(Account)", "The Account to which this payment applies, may be completed by the receiver, used for search.", 0, 1, account));
786          children.add(new Property("type", "CodeableConcept", "Code to indicate the nature of the payment.", 0, 1, type));
787          children.add(new Property("submitter", "Reference(Practitioner|PractitionerRole|Organization)", "The party which submitted the claim or financial transaction.", 0, 1, submitter));
788          children.add(new Property("response", "Reference(ClaimResponse)", "A resource, such as a ClaimResponse, which contains a commitment to payment.", 0, 1, response));
789          children.add(new Property("date", "date", "The date from the response resource containing a commitment to pay.", 0, 1, date));
790          children.add(new Property("responsible", "Reference(PractitionerRole)", "A reference to the individual who is responsible for inquiries regarding the response and its payment.", 0, 1, responsible));
791          children.add(new Property("payee", "Reference(Practitioner|PractitionerRole|Organization)", "The party which is receiving the payment.", 0, 1, payee));
792          children.add(new Property("amount", "Money", "The monetary amount allocated from the total payment to the payable.", 0, 1, amount));
793        }
794
795        @Override
796        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
797          switch (_hash) {
798          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique identifier for the current payment item for the referenced payable.", 0, 1, identifier);
799          case -1925032183: /*predecessor*/  return new Property("predecessor", "Identifier", "Unique identifier for the prior payment item for the referenced payable.", 0, 1, predecessor);
800          case -880905839: /*target*/  return new Property("target", "Reference(Claim|Account|Invoice|ChargeItem|Encounter|Contract)", "Specific resource to which the payment/adjustment/advance applies.", 0, 1, target);
801          case 125181372: /*targetItem[x]*/  return new Property("targetItem[x]", "string|Identifier|positiveInt", " Identifies the claim line item, encounter or other sub-element being paid. Note payment may be partial, that is not match the then outstanding balance or amount incurred.", 0, 1, targetItem);
802          case 486289476: /*targetItem*/  return new Property("targetItem[x]", "string|Identifier|positiveInt", " Identifies the claim line item, encounter or other sub-element being paid. Note payment may be partial, that is not match the then outstanding balance or amount incurred.", 0, 1, targetItem);
803          case 1014643061: /*targetItemString*/  return new Property("targetItem[x]", "string", " Identifies the claim line item, encounter or other sub-element being paid. Note payment may be partial, that is not match the then outstanding balance or amount incurred.", 0, 1, targetItem);
804          case -1768279027: /*targetItemIdentifier*/  return new Property("targetItem[x]", "Identifier", " Identifies the claim line item, encounter or other sub-element being paid. Note payment may be partial, that is not match the then outstanding balance or amount incurred.", 0, 1, targetItem);
805          case -481526702: /*targetItemPositiveInt*/  return new Property("targetItem[x]", "positiveInt", " Identifies the claim line item, encounter or other sub-element being paid. Note payment may be partial, that is not match the then outstanding balance or amount incurred.", 0, 1, targetItem);
806          case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The Encounter to which this payment applies, may be completed by the receiver, used for search.", 0, 1, encounter);
807          case -1177318867: /*account*/  return new Property("account", "Reference(Account)", "The Account to which this payment applies, may be completed by the receiver, used for search.", 0, 1, account);
808          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Code to indicate the nature of the payment.", 0, 1, type);
809          case 348678409: /*submitter*/  return new Property("submitter", "Reference(Practitioner|PractitionerRole|Organization)", "The party which submitted the claim or financial transaction.", 0, 1, submitter);
810          case -340323263: /*response*/  return new Property("response", "Reference(ClaimResponse)", "A resource, such as a ClaimResponse, which contains a commitment to payment.", 0, 1, response);
811          case 3076014: /*date*/  return new Property("date", "date", "The date from the response resource containing a commitment to pay.", 0, 1, date);
812          case 1847674614: /*responsible*/  return new Property("responsible", "Reference(PractitionerRole)", "A reference to the individual who is responsible for inquiries regarding the response and its payment.", 0, 1, responsible);
813          case 106443592: /*payee*/  return new Property("payee", "Reference(Practitioner|PractitionerRole|Organization)", "The party which is receiving the payment.", 0, 1, payee);
814          case -1413853096: /*amount*/  return new Property("amount", "Money", "The monetary amount allocated from the total payment to the payable.", 0, 1, amount);
815          default: return super.getNamedProperty(_hash, _name, _checkValid);
816          }
817
818        }
819
820      @Override
821      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
822        switch (hash) {
823        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
824        case -1925032183: /*predecessor*/ return this.predecessor == null ? new Base[0] : new Base[] {this.predecessor}; // Identifier
825        case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference
826        case 486289476: /*targetItem*/ return this.targetItem == null ? new Base[0] : new Base[] {this.targetItem}; // DataType
827        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
828        case -1177318867: /*account*/ return this.account == null ? new Base[0] : new Base[] {this.account}; // Reference
829        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
830        case 348678409: /*submitter*/ return this.submitter == null ? new Base[0] : new Base[] {this.submitter}; // Reference
831        case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Reference
832        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType
833        case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // Reference
834        case 106443592: /*payee*/ return this.payee == null ? new Base[0] : new Base[] {this.payee}; // Reference
835        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
836        default: return super.getProperty(hash, name, checkValid);
837        }
838
839      }
840
841      @Override
842      public Base setProperty(int hash, String name, Base value) throws FHIRException {
843        switch (hash) {
844        case -1618432855: // identifier
845          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
846          return value;
847        case -1925032183: // predecessor
848          this.predecessor = TypeConvertor.castToIdentifier(value); // Identifier
849          return value;
850        case -880905839: // target
851          this.target = TypeConvertor.castToReference(value); // Reference
852          return value;
853        case 486289476: // targetItem
854          this.targetItem = TypeConvertor.castToType(value); // DataType
855          return value;
856        case 1524132147: // encounter
857          this.encounter = TypeConvertor.castToReference(value); // Reference
858          return value;
859        case -1177318867: // account
860          this.account = TypeConvertor.castToReference(value); // Reference
861          return value;
862        case 3575610: // type
863          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
864          return value;
865        case 348678409: // submitter
866          this.submitter = TypeConvertor.castToReference(value); // Reference
867          return value;
868        case -340323263: // response
869          this.response = TypeConvertor.castToReference(value); // Reference
870          return value;
871        case 3076014: // date
872          this.date = TypeConvertor.castToDate(value); // DateType
873          return value;
874        case 1847674614: // responsible
875          this.responsible = TypeConvertor.castToReference(value); // Reference
876          return value;
877        case 106443592: // payee
878          this.payee = TypeConvertor.castToReference(value); // Reference
879          return value;
880        case -1413853096: // amount
881          this.amount = TypeConvertor.castToMoney(value); // Money
882          return value;
883        default: return super.setProperty(hash, name, value);
884        }
885
886      }
887
888      @Override
889      public Base setProperty(String name, Base value) throws FHIRException {
890        if (name.equals("identifier")) {
891          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
892        } else if (name.equals("predecessor")) {
893          this.predecessor = TypeConvertor.castToIdentifier(value); // Identifier
894        } else if (name.equals("target")) {
895          this.target = TypeConvertor.castToReference(value); // Reference
896        } else if (name.equals("targetItem[x]")) {
897          this.targetItem = TypeConvertor.castToType(value); // DataType
898        } else if (name.equals("encounter")) {
899          this.encounter = TypeConvertor.castToReference(value); // Reference
900        } else if (name.equals("account")) {
901          this.account = TypeConvertor.castToReference(value); // Reference
902        } else if (name.equals("type")) {
903          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
904        } else if (name.equals("submitter")) {
905          this.submitter = TypeConvertor.castToReference(value); // Reference
906        } else if (name.equals("response")) {
907          this.response = TypeConvertor.castToReference(value); // Reference
908        } else if (name.equals("date")) {
909          this.date = TypeConvertor.castToDate(value); // DateType
910        } else if (name.equals("responsible")) {
911          this.responsible = TypeConvertor.castToReference(value); // Reference
912        } else if (name.equals("payee")) {
913          this.payee = TypeConvertor.castToReference(value); // Reference
914        } else if (name.equals("amount")) {
915          this.amount = TypeConvertor.castToMoney(value); // Money
916        } else
917          return super.setProperty(name, value);
918        return value;
919      }
920
921  @Override
922  public void removeChild(String name, Base value) throws FHIRException {
923        if (name.equals("identifier")) {
924          this.identifier = null;
925        } else if (name.equals("predecessor")) {
926          this.predecessor = null;
927        } else if (name.equals("target")) {
928          this.target = null;
929        } else if (name.equals("targetItem[x]")) {
930          this.targetItem = null;
931        } else if (name.equals("encounter")) {
932          this.encounter = null;
933        } else if (name.equals("account")) {
934          this.account = null;
935        } else if (name.equals("type")) {
936          this.type = null;
937        } else if (name.equals("submitter")) {
938          this.submitter = null;
939        } else if (name.equals("response")) {
940          this.response = null;
941        } else if (name.equals("date")) {
942          this.date = null;
943        } else if (name.equals("responsible")) {
944          this.responsible = null;
945        } else if (name.equals("payee")) {
946          this.payee = null;
947        } else if (name.equals("amount")) {
948          this.amount = null;
949        } else
950          super.removeChild(name, value);
951        
952      }
953
954      @Override
955      public Base makeProperty(int hash, String name) throws FHIRException {
956        switch (hash) {
957        case -1618432855:  return getIdentifier();
958        case -1925032183:  return getPredecessor();
959        case -880905839:  return getTarget();
960        case 125181372:  return getTargetItem();
961        case 486289476:  return getTargetItem();
962        case 1524132147:  return getEncounter();
963        case -1177318867:  return getAccount();
964        case 3575610:  return getType();
965        case 348678409:  return getSubmitter();
966        case -340323263:  return getResponse();
967        case 3076014:  return getDateElement();
968        case 1847674614:  return getResponsible();
969        case 106443592:  return getPayee();
970        case -1413853096:  return getAmount();
971        default: return super.makeProperty(hash, name);
972        }
973
974      }
975
976      @Override
977      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
978        switch (hash) {
979        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
980        case -1925032183: /*predecessor*/ return new String[] {"Identifier"};
981        case -880905839: /*target*/ return new String[] {"Reference"};
982        case 486289476: /*targetItem*/ return new String[] {"string", "Identifier", "positiveInt"};
983        case 1524132147: /*encounter*/ return new String[] {"Reference"};
984        case -1177318867: /*account*/ return new String[] {"Reference"};
985        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
986        case 348678409: /*submitter*/ return new String[] {"Reference"};
987        case -340323263: /*response*/ return new String[] {"Reference"};
988        case 3076014: /*date*/ return new String[] {"date"};
989        case 1847674614: /*responsible*/ return new String[] {"Reference"};
990        case 106443592: /*payee*/ return new String[] {"Reference"};
991        case -1413853096: /*amount*/ return new String[] {"Money"};
992        default: return super.getTypesForProperty(hash, name);
993        }
994
995      }
996
997      @Override
998      public Base addChild(String name) throws FHIRException {
999        if (name.equals("identifier")) {
1000          this.identifier = new Identifier();
1001          return this.identifier;
1002        }
1003        else if (name.equals("predecessor")) {
1004          this.predecessor = new Identifier();
1005          return this.predecessor;
1006        }
1007        else if (name.equals("target")) {
1008          this.target = new Reference();
1009          return this.target;
1010        }
1011        else if (name.equals("targetItemString")) {
1012          this.targetItem = new StringType();
1013          return this.targetItem;
1014        }
1015        else if (name.equals("targetItemIdentifier")) {
1016          this.targetItem = new Identifier();
1017          return this.targetItem;
1018        }
1019        else if (name.equals("targetItemPositiveInt")) {
1020          this.targetItem = new PositiveIntType();
1021          return this.targetItem;
1022        }
1023        else if (name.equals("encounter")) {
1024          this.encounter = new Reference();
1025          return this.encounter;
1026        }
1027        else if (name.equals("account")) {
1028          this.account = new Reference();
1029          return this.account;
1030        }
1031        else if (name.equals("type")) {
1032          this.type = new CodeableConcept();
1033          return this.type;
1034        }
1035        else if (name.equals("submitter")) {
1036          this.submitter = new Reference();
1037          return this.submitter;
1038        }
1039        else if (name.equals("response")) {
1040          this.response = new Reference();
1041          return this.response;
1042        }
1043        else if (name.equals("date")) {
1044          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.allocation.date");
1045        }
1046        else if (name.equals("responsible")) {
1047          this.responsible = new Reference();
1048          return this.responsible;
1049        }
1050        else if (name.equals("payee")) {
1051          this.payee = new Reference();
1052          return this.payee;
1053        }
1054        else if (name.equals("amount")) {
1055          this.amount = new Money();
1056          return this.amount;
1057        }
1058        else
1059          return super.addChild(name);
1060      }
1061
1062      public PaymentReconciliationAllocationComponent copy() {
1063        PaymentReconciliationAllocationComponent dst = new PaymentReconciliationAllocationComponent();
1064        copyValues(dst);
1065        return dst;
1066      }
1067
1068      public void copyValues(PaymentReconciliationAllocationComponent dst) {
1069        super.copyValues(dst);
1070        dst.identifier = identifier == null ? null : identifier.copy();
1071        dst.predecessor = predecessor == null ? null : predecessor.copy();
1072        dst.target = target == null ? null : target.copy();
1073        dst.targetItem = targetItem == null ? null : targetItem.copy();
1074        dst.encounter = encounter == null ? null : encounter.copy();
1075        dst.account = account == null ? null : account.copy();
1076        dst.type = type == null ? null : type.copy();
1077        dst.submitter = submitter == null ? null : submitter.copy();
1078        dst.response = response == null ? null : response.copy();
1079        dst.date = date == null ? null : date.copy();
1080        dst.responsible = responsible == null ? null : responsible.copy();
1081        dst.payee = payee == null ? null : payee.copy();
1082        dst.amount = amount == null ? null : amount.copy();
1083      }
1084
1085      @Override
1086      public boolean equalsDeep(Base other_) {
1087        if (!super.equalsDeep(other_))
1088          return false;
1089        if (!(other_ instanceof PaymentReconciliationAllocationComponent))
1090          return false;
1091        PaymentReconciliationAllocationComponent o = (PaymentReconciliationAllocationComponent) other_;
1092        return compareDeep(identifier, o.identifier, true) && compareDeep(predecessor, o.predecessor, true)
1093           && compareDeep(target, o.target, true) && compareDeep(targetItem, o.targetItem, true) && compareDeep(encounter, o.encounter, true)
1094           && compareDeep(account, o.account, true) && compareDeep(type, o.type, true) && compareDeep(submitter, o.submitter, true)
1095           && compareDeep(response, o.response, true) && compareDeep(date, o.date, true) && compareDeep(responsible, o.responsible, true)
1096           && compareDeep(payee, o.payee, true) && compareDeep(amount, o.amount, true);
1097      }
1098
1099      @Override
1100      public boolean equalsShallow(Base other_) {
1101        if (!super.equalsShallow(other_))
1102          return false;
1103        if (!(other_ instanceof PaymentReconciliationAllocationComponent))
1104          return false;
1105        PaymentReconciliationAllocationComponent o = (PaymentReconciliationAllocationComponent) other_;
1106        return compareValues(date, o.date, true);
1107      }
1108
1109      public boolean isEmpty() {
1110        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, predecessor, target
1111          , targetItem, encounter, account, type, submitter, response, date, responsible
1112          , payee, amount);
1113      }
1114
1115  public String fhirType() {
1116    return "PaymentReconciliation.allocation";
1117
1118  }
1119
1120  }
1121
1122    @Block()
1123    public static class NotesComponent extends BackboneElement implements IBaseBackboneElement {
1124        /**
1125         * The business purpose of the note text.
1126         */
1127        @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1128        @Description(shortDefinition="display | print | printoper", formalDefinition="The business purpose of the note text." )
1129        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/note-type")
1130        protected Enumeration<NoteType> type;
1131
1132        /**
1133         * The explanation or description associated with the processing.
1134         */
1135        @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1136        @Description(shortDefinition="Note explanatory text", formalDefinition="The explanation or description associated with the processing." )
1137        protected StringType text;
1138
1139        private static final long serialVersionUID = 529250161L;
1140
1141    /**
1142     * Constructor
1143     */
1144      public NotesComponent() {
1145        super();
1146      }
1147
1148        /**
1149         * @return {@link #type} (The business purpose of the note text.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1150         */
1151        public Enumeration<NoteType> getTypeElement() { 
1152          if (this.type == null)
1153            if (Configuration.errorOnAutoCreate())
1154              throw new Error("Attempt to auto-create NotesComponent.type");
1155            else if (Configuration.doAutoCreate())
1156              this.type = new Enumeration<NoteType>(new NoteTypeEnumFactory()); // bb
1157          return this.type;
1158        }
1159
1160        public boolean hasTypeElement() { 
1161          return this.type != null && !this.type.isEmpty();
1162        }
1163
1164        public boolean hasType() { 
1165          return this.type != null && !this.type.isEmpty();
1166        }
1167
1168        /**
1169         * @param value {@link #type} (The business purpose of the note text.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1170         */
1171        public NotesComponent setTypeElement(Enumeration<NoteType> value) { 
1172          this.type = value;
1173          return this;
1174        }
1175
1176        /**
1177         * @return The business purpose of the note text.
1178         */
1179        public NoteType getType() { 
1180          return this.type == null ? null : this.type.getValue();
1181        }
1182
1183        /**
1184         * @param value The business purpose of the note text.
1185         */
1186        public NotesComponent setType(NoteType value) { 
1187          if (value == null)
1188            this.type = null;
1189          else {
1190            if (this.type == null)
1191              this.type = new Enumeration<NoteType>(new NoteTypeEnumFactory());
1192            this.type.setValue(value);
1193          }
1194          return this;
1195        }
1196
1197        /**
1198         * @return {@link #text} (The explanation or description associated with the processing.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
1199         */
1200        public StringType getTextElement() { 
1201          if (this.text == null)
1202            if (Configuration.errorOnAutoCreate())
1203              throw new Error("Attempt to auto-create NotesComponent.text");
1204            else if (Configuration.doAutoCreate())
1205              this.text = new StringType(); // bb
1206          return this.text;
1207        }
1208
1209        public boolean hasTextElement() { 
1210          return this.text != null && !this.text.isEmpty();
1211        }
1212
1213        public boolean hasText() { 
1214          return this.text != null && !this.text.isEmpty();
1215        }
1216
1217        /**
1218         * @param value {@link #text} (The explanation or description associated with the processing.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
1219         */
1220        public NotesComponent setTextElement(StringType value) { 
1221          this.text = value;
1222          return this;
1223        }
1224
1225        /**
1226         * @return The explanation or description associated with the processing.
1227         */
1228        public String getText() { 
1229          return this.text == null ? null : this.text.getValue();
1230        }
1231
1232        /**
1233         * @param value The explanation or description associated with the processing.
1234         */
1235        public NotesComponent setText(String value) { 
1236          if (Utilities.noString(value))
1237            this.text = null;
1238          else {
1239            if (this.text == null)
1240              this.text = new StringType();
1241            this.text.setValue(value);
1242          }
1243          return this;
1244        }
1245
1246        protected void listChildren(List<Property> children) {
1247          super.listChildren(children);
1248          children.add(new Property("type", "code", "The business purpose of the note text.", 0, 1, type));
1249          children.add(new Property("text", "string", "The explanation or description associated with the processing.", 0, 1, text));
1250        }
1251
1252        @Override
1253        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1254          switch (_hash) {
1255          case 3575610: /*type*/  return new Property("type", "code", "The business purpose of the note text.", 0, 1, type);
1256          case 3556653: /*text*/  return new Property("text", "string", "The explanation or description associated with the processing.", 0, 1, text);
1257          default: return super.getNamedProperty(_hash, _name, _checkValid);
1258          }
1259
1260        }
1261
1262      @Override
1263      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1264        switch (hash) {
1265        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<NoteType>
1266        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
1267        default: return super.getProperty(hash, name, checkValid);
1268        }
1269
1270      }
1271
1272      @Override
1273      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1274        switch (hash) {
1275        case 3575610: // type
1276          value = new NoteTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1277          this.type = (Enumeration) value; // Enumeration<NoteType>
1278          return value;
1279        case 3556653: // text
1280          this.text = TypeConvertor.castToString(value); // StringType
1281          return value;
1282        default: return super.setProperty(hash, name, value);
1283        }
1284
1285      }
1286
1287      @Override
1288      public Base setProperty(String name, Base value) throws FHIRException {
1289        if (name.equals("type")) {
1290          value = new NoteTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1291          this.type = (Enumeration) value; // Enumeration<NoteType>
1292        } else if (name.equals("text")) {
1293          this.text = TypeConvertor.castToString(value); // StringType
1294        } else
1295          return super.setProperty(name, value);
1296        return value;
1297      }
1298
1299  @Override
1300  public void removeChild(String name, Base value) throws FHIRException {
1301        if (name.equals("type")) {
1302          value = new NoteTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1303          this.type = (Enumeration) value; // Enumeration<NoteType>
1304        } else if (name.equals("text")) {
1305          this.text = null;
1306        } else
1307          super.removeChild(name, value);
1308        
1309      }
1310
1311      @Override
1312      public Base makeProperty(int hash, String name) throws FHIRException {
1313        switch (hash) {
1314        case 3575610:  return getTypeElement();
1315        case 3556653:  return getTextElement();
1316        default: return super.makeProperty(hash, name);
1317        }
1318
1319      }
1320
1321      @Override
1322      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1323        switch (hash) {
1324        case 3575610: /*type*/ return new String[] {"code"};
1325        case 3556653: /*text*/ return new String[] {"string"};
1326        default: return super.getTypesForProperty(hash, name);
1327        }
1328
1329      }
1330
1331      @Override
1332      public Base addChild(String name) throws FHIRException {
1333        if (name.equals("type")) {
1334          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.processNote.type");
1335        }
1336        else if (name.equals("text")) {
1337          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.processNote.text");
1338        }
1339        else
1340          return super.addChild(name);
1341      }
1342
1343      public NotesComponent copy() {
1344        NotesComponent dst = new NotesComponent();
1345        copyValues(dst);
1346        return dst;
1347      }
1348
1349      public void copyValues(NotesComponent dst) {
1350        super.copyValues(dst);
1351        dst.type = type == null ? null : type.copy();
1352        dst.text = text == null ? null : text.copy();
1353      }
1354
1355      @Override
1356      public boolean equalsDeep(Base other_) {
1357        if (!super.equalsDeep(other_))
1358          return false;
1359        if (!(other_ instanceof NotesComponent))
1360          return false;
1361        NotesComponent o = (NotesComponent) other_;
1362        return compareDeep(type, o.type, true) && compareDeep(text, o.text, true);
1363      }
1364
1365      @Override
1366      public boolean equalsShallow(Base other_) {
1367        if (!super.equalsShallow(other_))
1368          return false;
1369        if (!(other_ instanceof NotesComponent))
1370          return false;
1371        NotesComponent o = (NotesComponent) other_;
1372        return compareValues(type, o.type, true) && compareValues(text, o.text, true);
1373      }
1374
1375      public boolean isEmpty() {
1376        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, text);
1377      }
1378
1379  public String fhirType() {
1380    return "PaymentReconciliation.processNote";
1381
1382  }
1383
1384  }
1385
1386    /**
1387     * A unique identifier assigned to this payment reconciliation.
1388     */
1389    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1390    @Description(shortDefinition="Business Identifier for a payment reconciliation", formalDefinition="A unique identifier assigned to this payment reconciliation." )
1391    protected List<Identifier> identifier;
1392
1393    /**
1394     * Code to indicate the nature of the payment such as payment, adjustment.
1395     */
1396    @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
1397    @Description(shortDefinition="Category of payment", formalDefinition="Code to indicate the nature of the payment such as payment, adjustment." )
1398    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payment-type")
1399    protected CodeableConcept type;
1400
1401    /**
1402     * The status of the resource instance.
1403     */
1404    @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true)
1405    @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." )
1406    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status")
1407    protected Enumeration<FinancialResourceStatusCodes> status;
1408
1409    /**
1410     * The workflow or activity which gave rise to or during which the payment ocurred such as a kiosk, deposit on account, periodic payment etc.
1411     */
1412    @Child(name = "kind", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
1413    @Description(shortDefinition="Workflow originating payment", formalDefinition="The workflow or activity which gave rise to or during which the payment ocurred such as a kiosk, deposit on account, periodic payment etc." )
1414    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payment-kind")
1415    protected CodeableConcept kind;
1416
1417    /**
1418     * The period of time for which payments have been gathered into this bulk payment for settlement.
1419     */
1420    @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=true)
1421    @Description(shortDefinition="Period covered", formalDefinition="The period of time for which payments have been gathered into this bulk payment for settlement." )
1422    protected Period period;
1423
1424    /**
1425     * The date when the resource was created.
1426     */
1427    @Child(name = "created", type = {DateTimeType.class}, order=5, min=1, max=1, modifier=false, summary=true)
1428    @Description(shortDefinition="Creation date", formalDefinition="The date when the resource was created." )
1429    protected DateTimeType created;
1430
1431    /**
1432     * Payment enterer if not the actual payment issuer.
1433     */
1434    @Child(name = "enterer", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=6, min=0, max=1, modifier=false, summary=false)
1435    @Description(shortDefinition="Who entered the payment", formalDefinition="Payment enterer if not the actual payment issuer." )
1436    protected Reference enterer;
1437
1438    /**
1439     * The type of the source such as patient or insurance.
1440     */
1441    @Child(name = "issuerType", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false)
1442    @Description(shortDefinition="Nature of the source", formalDefinition="The type of the source such as patient or insurance." )
1443    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payment-issuertype")
1444    protected CodeableConcept issuerType;
1445
1446    /**
1447     * The party who generated the payment.
1448     */
1449    @Child(name = "paymentIssuer", type = {Organization.class, Patient.class, RelatedPerson.class}, order=8, min=0, max=1, modifier=false, summary=true)
1450    @Description(shortDefinition="Party generating payment", formalDefinition="The party who generated the payment." )
1451    protected Reference paymentIssuer;
1452
1453    /**
1454     * Original request resource reference.
1455     */
1456    @Child(name = "request", type = {Task.class}, order=9, min=0, max=1, modifier=false, summary=false)
1457    @Description(shortDefinition="Reference to requesting resource", formalDefinition="Original request resource reference." )
1458    protected Reference request;
1459
1460    /**
1461     * The practitioner who is responsible for the services rendered to the patient.
1462     */
1463    @Child(name = "requestor", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=10, min=0, max=1, modifier=false, summary=false)
1464    @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." )
1465    protected Reference requestor;
1466
1467    /**
1468     * The outcome of a request for a reconciliation.
1469     */
1470    @Child(name = "outcome", type = {CodeType.class}, order=11, min=0, max=1, modifier=false, summary=false)
1471    @Description(shortDefinition="queued | complete | error | partial", formalDefinition="The outcome of a request for a reconciliation." )
1472    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payment-outcome")
1473    protected Enumeration<PaymentOutcome> outcome;
1474
1475    /**
1476     * A human readable description of the status of the request for the reconciliation.
1477     */
1478    @Child(name = "disposition", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false)
1479    @Description(shortDefinition="Disposition message", formalDefinition="A human readable description of the status of the request for the reconciliation." )
1480    protected StringType disposition;
1481
1482    /**
1483     * The date of payment as indicated on the financial instrument.
1484     */
1485    @Child(name = "date", type = {DateType.class}, order=13, min=1, max=1, modifier=false, summary=true)
1486    @Description(shortDefinition="When payment issued", formalDefinition="The date of payment as indicated on the financial instrument." )
1487    protected DateType date;
1488
1489    /**
1490     * The location of the site or device for electronic transfers or physical location for cash payments.
1491     */
1492    @Child(name = "location", type = {Location.class}, order=14, min=0, max=1, modifier=false, summary=false)
1493    @Description(shortDefinition="Where payment collected", formalDefinition="The location of the site or device for electronic transfers or physical location for cash payments." )
1494    protected Reference location;
1495
1496    /**
1497     * The means of payment such as check, card cash, or electronic funds transfer.
1498     */
1499    @Child(name = "method", type = {CodeableConcept.class}, order=15, min=0, max=1, modifier=false, summary=false)
1500    @Description(shortDefinition="Payment instrument", formalDefinition="The means of payment such as check, card cash, or electronic funds transfer." )
1501    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v2-0570")
1502    protected CodeableConcept method;
1503
1504    /**
1505     * The card brand such as debit, Visa, Amex etc. used if a card is the method of payment.
1506     */
1507    @Child(name = "cardBrand", type = {StringType.class}, order=16, min=0, max=1, modifier=false, summary=false)
1508    @Description(shortDefinition="Type of card", formalDefinition="The card brand such as debit, Visa, Amex etc. used if a card is the method of payment." )
1509    protected StringType cardBrand;
1510
1511    /**
1512     * A portion of the account number, often the last 4 digits, used for verification not charging purposes.
1513     */
1514    @Child(name = "accountNumber", type = {StringType.class}, order=17, min=0, max=1, modifier=false, summary=false)
1515    @Description(shortDefinition="Digits for verification", formalDefinition="A portion of the account number, often the last 4 digits, used for verification not charging purposes." )
1516    protected StringType accountNumber;
1517
1518    /**
1519     * The year and month (YYYY-MM) when the instrument, typically card, expires.
1520     */
1521    @Child(name = "expirationDate", type = {DateType.class}, order=18, min=0, max=1, modifier=false, summary=false)
1522    @Description(shortDefinition="Expiration year-month", formalDefinition="The year and month (YYYY-MM) when the instrument, typically card, expires." )
1523    protected DateType expirationDate;
1524
1525    /**
1526     * The name of the card processor, etf processor, bank for checks.
1527     */
1528    @Child(name = "processor", type = {StringType.class}, order=19, min=0, max=1, modifier=false, summary=false)
1529    @Description(shortDefinition="Processor name", formalDefinition="The name of the card processor, etf processor, bank for checks." )
1530    protected StringType processor;
1531
1532    /**
1533     * The check number, eft reference, car processor reference.
1534     */
1535    @Child(name = "referenceNumber", type = {StringType.class}, order=20, min=0, max=1, modifier=false, summary=false)
1536    @Description(shortDefinition="Check number or payment reference", formalDefinition="The check number, eft reference, car processor reference." )
1537    protected StringType referenceNumber;
1538
1539    /**
1540     * An alphanumeric issued by the processor to confirm the successful issuance of payment.
1541     */
1542    @Child(name = "authorization", type = {StringType.class}, order=21, min=0, max=1, modifier=false, summary=false)
1543    @Description(shortDefinition="Authorization number", formalDefinition="An alphanumeric issued by the processor to confirm the successful issuance of payment." )
1544    protected StringType authorization;
1545
1546    /**
1547     * The amount offered by the issuer, typically applies to cash when the issuer provides an amount in bank note denominations equal to or excess of the amount actually being paid.
1548     */
1549    @Child(name = "tenderedAmount", type = {Money.class}, order=22, min=0, max=1, modifier=false, summary=false)
1550    @Description(shortDefinition="Amount offered by the issuer", formalDefinition="The amount offered by the issuer, typically applies to cash when the issuer provides an amount in bank note denominations equal to or excess of the amount actually being paid." )
1551    protected Money tenderedAmount;
1552
1553    /**
1554     * The amount returned by the receiver which is excess to the amount payable, often referred to as 'change'.
1555     */
1556    @Child(name = "returnedAmount", type = {Money.class}, order=23, min=0, max=1, modifier=false, summary=false)
1557    @Description(shortDefinition="Amount returned by the receiver", formalDefinition="The amount returned by the receiver which is excess to the amount payable, often referred to as 'change'." )
1558    protected Money returnedAmount;
1559
1560    /**
1561     * Total payment amount as indicated on the financial instrument.
1562     */
1563    @Child(name = "amount", type = {Money.class}, order=24, min=1, max=1, modifier=false, summary=true)
1564    @Description(shortDefinition="Total amount of Payment", formalDefinition="Total payment amount as indicated on the financial instrument." )
1565    protected Money amount;
1566
1567    /**
1568     * Issuer's unique identifier for the payment instrument.
1569     */
1570    @Child(name = "paymentIdentifier", type = {Identifier.class}, order=25, min=0, max=1, modifier=false, summary=false)
1571    @Description(shortDefinition="Business identifier for the payment", formalDefinition="Issuer's unique identifier for the payment instrument." )
1572    protected Identifier paymentIdentifier;
1573
1574    /**
1575     * Distribution of the payment amount for a previously acknowledged payable.
1576     */
1577    @Child(name = "allocation", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1578    @Description(shortDefinition="Settlement particulars", formalDefinition="Distribution of the payment amount for a previously acknowledged payable." )
1579    protected List<PaymentReconciliationAllocationComponent> allocation;
1580
1581    /**
1582     * A code for the form to be used for printing the content.
1583     */
1584    @Child(name = "formCode", type = {CodeableConcept.class}, order=27, min=0, max=1, modifier=false, summary=false)
1585    @Description(shortDefinition="Printed form identifier", formalDefinition="A code for the form to be used for printing the content." )
1586    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/forms")
1587    protected CodeableConcept formCode;
1588
1589    /**
1590     * A note that describes or explains the processing in a human readable form.
1591     */
1592    @Child(name = "processNote", type = {}, order=28, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1593    @Description(shortDefinition="Note concerning processing", formalDefinition="A note that describes or explains the processing in a human readable form." )
1594    protected List<NotesComponent> processNote;
1595
1596    private static final long serialVersionUID = 705873820L;
1597
1598  /**
1599   * Constructor
1600   */
1601    public PaymentReconciliation() {
1602      super();
1603    }
1604
1605  /**
1606   * Constructor
1607   */
1608    public PaymentReconciliation(CodeableConcept type, FinancialResourceStatusCodes status, Date created, Date date, Money amount) {
1609      super();
1610      this.setType(type);
1611      this.setStatus(status);
1612      this.setCreated(created);
1613      this.setDate(date);
1614      this.setAmount(amount);
1615    }
1616
1617    /**
1618     * @return {@link #identifier} (A unique identifier assigned to this payment reconciliation.)
1619     */
1620    public List<Identifier> getIdentifier() { 
1621      if (this.identifier == null)
1622        this.identifier = new ArrayList<Identifier>();
1623      return this.identifier;
1624    }
1625
1626    /**
1627     * @return Returns a reference to <code>this</code> for easy method chaining
1628     */
1629    public PaymentReconciliation setIdentifier(List<Identifier> theIdentifier) { 
1630      this.identifier = theIdentifier;
1631      return this;
1632    }
1633
1634    public boolean hasIdentifier() { 
1635      if (this.identifier == null)
1636        return false;
1637      for (Identifier item : this.identifier)
1638        if (!item.isEmpty())
1639          return true;
1640      return false;
1641    }
1642
1643    public Identifier addIdentifier() { //3
1644      Identifier t = new Identifier();
1645      if (this.identifier == null)
1646        this.identifier = new ArrayList<Identifier>();
1647      this.identifier.add(t);
1648      return t;
1649    }
1650
1651    public PaymentReconciliation addIdentifier(Identifier t) { //3
1652      if (t == null)
1653        return this;
1654      if (this.identifier == null)
1655        this.identifier = new ArrayList<Identifier>();
1656      this.identifier.add(t);
1657      return this;
1658    }
1659
1660    /**
1661     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1662     */
1663    public Identifier getIdentifierFirstRep() { 
1664      if (getIdentifier().isEmpty()) {
1665        addIdentifier();
1666      }
1667      return getIdentifier().get(0);
1668    }
1669
1670    /**
1671     * @return {@link #type} (Code to indicate the nature of the payment such as payment, adjustment.)
1672     */
1673    public CodeableConcept getType() { 
1674      if (this.type == null)
1675        if (Configuration.errorOnAutoCreate())
1676          throw new Error("Attempt to auto-create PaymentReconciliation.type");
1677        else if (Configuration.doAutoCreate())
1678          this.type = new CodeableConcept(); // cc
1679      return this.type;
1680    }
1681
1682    public boolean hasType() { 
1683      return this.type != null && !this.type.isEmpty();
1684    }
1685
1686    /**
1687     * @param value {@link #type} (Code to indicate the nature of the payment such as payment, adjustment.)
1688     */
1689    public PaymentReconciliation setType(CodeableConcept value) { 
1690      this.type = value;
1691      return this;
1692    }
1693
1694    /**
1695     * @return {@link #status} (The status of the resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1696     */
1697    public Enumeration<FinancialResourceStatusCodes> getStatusElement() { 
1698      if (this.status == null)
1699        if (Configuration.errorOnAutoCreate())
1700          throw new Error("Attempt to auto-create PaymentReconciliation.status");
1701        else if (Configuration.doAutoCreate())
1702          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory()); // bb
1703      return this.status;
1704    }
1705
1706    public boolean hasStatusElement() { 
1707      return this.status != null && !this.status.isEmpty();
1708    }
1709
1710    public boolean hasStatus() { 
1711      return this.status != null && !this.status.isEmpty();
1712    }
1713
1714    /**
1715     * @param value {@link #status} (The status of the resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1716     */
1717    public PaymentReconciliation setStatusElement(Enumeration<FinancialResourceStatusCodes> value) { 
1718      this.status = value;
1719      return this;
1720    }
1721
1722    /**
1723     * @return The status of the resource instance.
1724     */
1725    public FinancialResourceStatusCodes getStatus() { 
1726      return this.status == null ? null : this.status.getValue();
1727    }
1728
1729    /**
1730     * @param value The status of the resource instance.
1731     */
1732    public PaymentReconciliation setStatus(FinancialResourceStatusCodes value) { 
1733        if (this.status == null)
1734          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory());
1735        this.status.setValue(value);
1736      return this;
1737    }
1738
1739    /**
1740     * @return {@link #kind} (The workflow or activity which gave rise to or during which the payment ocurred such as a kiosk, deposit on account, periodic payment etc.)
1741     */
1742    public CodeableConcept getKind() { 
1743      if (this.kind == null)
1744        if (Configuration.errorOnAutoCreate())
1745          throw new Error("Attempt to auto-create PaymentReconciliation.kind");
1746        else if (Configuration.doAutoCreate())
1747          this.kind = new CodeableConcept(); // cc
1748      return this.kind;
1749    }
1750
1751    public boolean hasKind() { 
1752      return this.kind != null && !this.kind.isEmpty();
1753    }
1754
1755    /**
1756     * @param value {@link #kind} (The workflow or activity which gave rise to or during which the payment ocurred such as a kiosk, deposit on account, periodic payment etc.)
1757     */
1758    public PaymentReconciliation setKind(CodeableConcept value) { 
1759      this.kind = value;
1760      return this;
1761    }
1762
1763    /**
1764     * @return {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.)
1765     */
1766    public Period getPeriod() { 
1767      if (this.period == null)
1768        if (Configuration.errorOnAutoCreate())
1769          throw new Error("Attempt to auto-create PaymentReconciliation.period");
1770        else if (Configuration.doAutoCreate())
1771          this.period = new Period(); // cc
1772      return this.period;
1773    }
1774
1775    public boolean hasPeriod() { 
1776      return this.period != null && !this.period.isEmpty();
1777    }
1778
1779    /**
1780     * @param value {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.)
1781     */
1782    public PaymentReconciliation setPeriod(Period value) { 
1783      this.period = value;
1784      return this;
1785    }
1786
1787    /**
1788     * @return {@link #created} (The date when the resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
1789     */
1790    public DateTimeType getCreatedElement() { 
1791      if (this.created == null)
1792        if (Configuration.errorOnAutoCreate())
1793          throw new Error("Attempt to auto-create PaymentReconciliation.created");
1794        else if (Configuration.doAutoCreate())
1795          this.created = new DateTimeType(); // bb
1796      return this.created;
1797    }
1798
1799    public boolean hasCreatedElement() { 
1800      return this.created != null && !this.created.isEmpty();
1801    }
1802
1803    public boolean hasCreated() { 
1804      return this.created != null && !this.created.isEmpty();
1805    }
1806
1807    /**
1808     * @param value {@link #created} (The date when the resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
1809     */
1810    public PaymentReconciliation setCreatedElement(DateTimeType value) { 
1811      this.created = value;
1812      return this;
1813    }
1814
1815    /**
1816     * @return The date when the resource was created.
1817     */
1818    public Date getCreated() { 
1819      return this.created == null ? null : this.created.getValue();
1820    }
1821
1822    /**
1823     * @param value The date when the resource was created.
1824     */
1825    public PaymentReconciliation setCreated(Date value) { 
1826        if (this.created == null)
1827          this.created = new DateTimeType();
1828        this.created.setValue(value);
1829      return this;
1830    }
1831
1832    /**
1833     * @return {@link #enterer} (Payment enterer if not the actual payment issuer.)
1834     */
1835    public Reference getEnterer() { 
1836      if (this.enterer == null)
1837        if (Configuration.errorOnAutoCreate())
1838          throw new Error("Attempt to auto-create PaymentReconciliation.enterer");
1839        else if (Configuration.doAutoCreate())
1840          this.enterer = new Reference(); // cc
1841      return this.enterer;
1842    }
1843
1844    public boolean hasEnterer() { 
1845      return this.enterer != null && !this.enterer.isEmpty();
1846    }
1847
1848    /**
1849     * @param value {@link #enterer} (Payment enterer if not the actual payment issuer.)
1850     */
1851    public PaymentReconciliation setEnterer(Reference value) { 
1852      this.enterer = value;
1853      return this;
1854    }
1855
1856    /**
1857     * @return {@link #issuerType} (The type of the source such as patient or insurance.)
1858     */
1859    public CodeableConcept getIssuerType() { 
1860      if (this.issuerType == null)
1861        if (Configuration.errorOnAutoCreate())
1862          throw new Error("Attempt to auto-create PaymentReconciliation.issuerType");
1863        else if (Configuration.doAutoCreate())
1864          this.issuerType = new CodeableConcept(); // cc
1865      return this.issuerType;
1866    }
1867
1868    public boolean hasIssuerType() { 
1869      return this.issuerType != null && !this.issuerType.isEmpty();
1870    }
1871
1872    /**
1873     * @param value {@link #issuerType} (The type of the source such as patient or insurance.)
1874     */
1875    public PaymentReconciliation setIssuerType(CodeableConcept value) { 
1876      this.issuerType = value;
1877      return this;
1878    }
1879
1880    /**
1881     * @return {@link #paymentIssuer} (The party who generated the payment.)
1882     */
1883    public Reference getPaymentIssuer() { 
1884      if (this.paymentIssuer == null)
1885        if (Configuration.errorOnAutoCreate())
1886          throw new Error("Attempt to auto-create PaymentReconciliation.paymentIssuer");
1887        else if (Configuration.doAutoCreate())
1888          this.paymentIssuer = new Reference(); // cc
1889      return this.paymentIssuer;
1890    }
1891
1892    public boolean hasPaymentIssuer() { 
1893      return this.paymentIssuer != null && !this.paymentIssuer.isEmpty();
1894    }
1895
1896    /**
1897     * @param value {@link #paymentIssuer} (The party who generated the payment.)
1898     */
1899    public PaymentReconciliation setPaymentIssuer(Reference value) { 
1900      this.paymentIssuer = value;
1901      return this;
1902    }
1903
1904    /**
1905     * @return {@link #request} (Original request resource reference.)
1906     */
1907    public Reference getRequest() { 
1908      if (this.request == null)
1909        if (Configuration.errorOnAutoCreate())
1910          throw new Error("Attempt to auto-create PaymentReconciliation.request");
1911        else if (Configuration.doAutoCreate())
1912          this.request = new Reference(); // cc
1913      return this.request;
1914    }
1915
1916    public boolean hasRequest() { 
1917      return this.request != null && !this.request.isEmpty();
1918    }
1919
1920    /**
1921     * @param value {@link #request} (Original request resource reference.)
1922     */
1923    public PaymentReconciliation setRequest(Reference value) { 
1924      this.request = value;
1925      return this;
1926    }
1927
1928    /**
1929     * @return {@link #requestor} (The practitioner who is responsible for the services rendered to the patient.)
1930     */
1931    public Reference getRequestor() { 
1932      if (this.requestor == null)
1933        if (Configuration.errorOnAutoCreate())
1934          throw new Error("Attempt to auto-create PaymentReconciliation.requestor");
1935        else if (Configuration.doAutoCreate())
1936          this.requestor = new Reference(); // cc
1937      return this.requestor;
1938    }
1939
1940    public boolean hasRequestor() { 
1941      return this.requestor != null && !this.requestor.isEmpty();
1942    }
1943
1944    /**
1945     * @param value {@link #requestor} (The practitioner who is responsible for the services rendered to the patient.)
1946     */
1947    public PaymentReconciliation setRequestor(Reference value) { 
1948      this.requestor = value;
1949      return this;
1950    }
1951
1952    /**
1953     * @return {@link #outcome} (The outcome of a request for a reconciliation.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
1954     */
1955    public Enumeration<PaymentOutcome> getOutcomeElement() { 
1956      if (this.outcome == null)
1957        if (Configuration.errorOnAutoCreate())
1958          throw new Error("Attempt to auto-create PaymentReconciliation.outcome");
1959        else if (Configuration.doAutoCreate())
1960          this.outcome = new Enumeration<PaymentOutcome>(new PaymentOutcomeEnumFactory()); // bb
1961      return this.outcome;
1962    }
1963
1964    public boolean hasOutcomeElement() { 
1965      return this.outcome != null && !this.outcome.isEmpty();
1966    }
1967
1968    public boolean hasOutcome() { 
1969      return this.outcome != null && !this.outcome.isEmpty();
1970    }
1971
1972    /**
1973     * @param value {@link #outcome} (The outcome of a request for a reconciliation.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
1974     */
1975    public PaymentReconciliation setOutcomeElement(Enumeration<PaymentOutcome> value) { 
1976      this.outcome = value;
1977      return this;
1978    }
1979
1980    /**
1981     * @return The outcome of a request for a reconciliation.
1982     */
1983    public PaymentOutcome getOutcome() { 
1984      return this.outcome == null ? null : this.outcome.getValue();
1985    }
1986
1987    /**
1988     * @param value The outcome of a request for a reconciliation.
1989     */
1990    public PaymentReconciliation setOutcome(PaymentOutcome value) { 
1991      if (value == null)
1992        this.outcome = null;
1993      else {
1994        if (this.outcome == null)
1995          this.outcome = new Enumeration<PaymentOutcome>(new PaymentOutcomeEnumFactory());
1996        this.outcome.setValue(value);
1997      }
1998      return this;
1999    }
2000
2001    /**
2002     * @return {@link #disposition} (A human readable description of the status of the request for the reconciliation.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value
2003     */
2004    public StringType getDispositionElement() { 
2005      if (this.disposition == null)
2006        if (Configuration.errorOnAutoCreate())
2007          throw new Error("Attempt to auto-create PaymentReconciliation.disposition");
2008        else if (Configuration.doAutoCreate())
2009          this.disposition = new StringType(); // bb
2010      return this.disposition;
2011    }
2012
2013    public boolean hasDispositionElement() { 
2014      return this.disposition != null && !this.disposition.isEmpty();
2015    }
2016
2017    public boolean hasDisposition() { 
2018      return this.disposition != null && !this.disposition.isEmpty();
2019    }
2020
2021    /**
2022     * @param value {@link #disposition} (A human readable description of the status of the request for the reconciliation.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value
2023     */
2024    public PaymentReconciliation setDispositionElement(StringType value) { 
2025      this.disposition = value;
2026      return this;
2027    }
2028
2029    /**
2030     * @return A human readable description of the status of the request for the reconciliation.
2031     */
2032    public String getDisposition() { 
2033      return this.disposition == null ? null : this.disposition.getValue();
2034    }
2035
2036    /**
2037     * @param value A human readable description of the status of the request for the reconciliation.
2038     */
2039    public PaymentReconciliation setDisposition(String value) { 
2040      if (Utilities.noString(value))
2041        this.disposition = null;
2042      else {
2043        if (this.disposition == null)
2044          this.disposition = new StringType();
2045        this.disposition.setValue(value);
2046      }
2047      return this;
2048    }
2049
2050    /**
2051     * @return {@link #date} (The date of payment as indicated on the financial instrument.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2052     */
2053    public DateType getDateElement() { 
2054      if (this.date == null)
2055        if (Configuration.errorOnAutoCreate())
2056          throw new Error("Attempt to auto-create PaymentReconciliation.date");
2057        else if (Configuration.doAutoCreate())
2058          this.date = new DateType(); // bb
2059      return this.date;
2060    }
2061
2062    public boolean hasDateElement() { 
2063      return this.date != null && !this.date.isEmpty();
2064    }
2065
2066    public boolean hasDate() { 
2067      return this.date != null && !this.date.isEmpty();
2068    }
2069
2070    /**
2071     * @param value {@link #date} (The date of payment as indicated on the financial instrument.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2072     */
2073    public PaymentReconciliation setDateElement(DateType value) { 
2074      this.date = value;
2075      return this;
2076    }
2077
2078    /**
2079     * @return The date of payment as indicated on the financial instrument.
2080     */
2081    public Date getDate() { 
2082      return this.date == null ? null : this.date.getValue();
2083    }
2084
2085    /**
2086     * @param value The date of payment as indicated on the financial instrument.
2087     */
2088    public PaymentReconciliation setDate(Date value) { 
2089        if (this.date == null)
2090          this.date = new DateType();
2091        this.date.setValue(value);
2092      return this;
2093    }
2094
2095    /**
2096     * @return {@link #location} (The location of the site or device for electronic transfers or physical location for cash payments.)
2097     */
2098    public Reference getLocation() { 
2099      if (this.location == null)
2100        if (Configuration.errorOnAutoCreate())
2101          throw new Error("Attempt to auto-create PaymentReconciliation.location");
2102        else if (Configuration.doAutoCreate())
2103          this.location = new Reference(); // cc
2104      return this.location;
2105    }
2106
2107    public boolean hasLocation() { 
2108      return this.location != null && !this.location.isEmpty();
2109    }
2110
2111    /**
2112     * @param value {@link #location} (The location of the site or device for electronic transfers or physical location for cash payments.)
2113     */
2114    public PaymentReconciliation setLocation(Reference value) { 
2115      this.location = value;
2116      return this;
2117    }
2118
2119    /**
2120     * @return {@link #method} (The means of payment such as check, card cash, or electronic funds transfer.)
2121     */
2122    public CodeableConcept getMethod() { 
2123      if (this.method == null)
2124        if (Configuration.errorOnAutoCreate())
2125          throw new Error("Attempt to auto-create PaymentReconciliation.method");
2126        else if (Configuration.doAutoCreate())
2127          this.method = new CodeableConcept(); // cc
2128      return this.method;
2129    }
2130
2131    public boolean hasMethod() { 
2132      return this.method != null && !this.method.isEmpty();
2133    }
2134
2135    /**
2136     * @param value {@link #method} (The means of payment such as check, card cash, or electronic funds transfer.)
2137     */
2138    public PaymentReconciliation setMethod(CodeableConcept value) { 
2139      this.method = value;
2140      return this;
2141    }
2142
2143    /**
2144     * @return {@link #cardBrand} (The card brand such as debit, Visa, Amex etc. used if a card is the method of payment.). This is the underlying object with id, value and extensions. The accessor "getCardBrand" gives direct access to the value
2145     */
2146    public StringType getCardBrandElement() { 
2147      if (this.cardBrand == null)
2148        if (Configuration.errorOnAutoCreate())
2149          throw new Error("Attempt to auto-create PaymentReconciliation.cardBrand");
2150        else if (Configuration.doAutoCreate())
2151          this.cardBrand = new StringType(); // bb
2152      return this.cardBrand;
2153    }
2154
2155    public boolean hasCardBrandElement() { 
2156      return this.cardBrand != null && !this.cardBrand.isEmpty();
2157    }
2158
2159    public boolean hasCardBrand() { 
2160      return this.cardBrand != null && !this.cardBrand.isEmpty();
2161    }
2162
2163    /**
2164     * @param value {@link #cardBrand} (The card brand such as debit, Visa, Amex etc. used if a card is the method of payment.). This is the underlying object with id, value and extensions. The accessor "getCardBrand" gives direct access to the value
2165     */
2166    public PaymentReconciliation setCardBrandElement(StringType value) { 
2167      this.cardBrand = value;
2168      return this;
2169    }
2170
2171    /**
2172     * @return The card brand such as debit, Visa, Amex etc. used if a card is the method of payment.
2173     */
2174    public String getCardBrand() { 
2175      return this.cardBrand == null ? null : this.cardBrand.getValue();
2176    }
2177
2178    /**
2179     * @param value The card brand such as debit, Visa, Amex etc. used if a card is the method of payment.
2180     */
2181    public PaymentReconciliation setCardBrand(String value) { 
2182      if (Utilities.noString(value))
2183        this.cardBrand = null;
2184      else {
2185        if (this.cardBrand == null)
2186          this.cardBrand = new StringType();
2187        this.cardBrand.setValue(value);
2188      }
2189      return this;
2190    }
2191
2192    /**
2193     * @return {@link #accountNumber} (A portion of the account number, often the last 4 digits, used for verification not charging purposes.). This is the underlying object with id, value and extensions. The accessor "getAccountNumber" gives direct access to the value
2194     */
2195    public StringType getAccountNumberElement() { 
2196      if (this.accountNumber == null)
2197        if (Configuration.errorOnAutoCreate())
2198          throw new Error("Attempt to auto-create PaymentReconciliation.accountNumber");
2199        else if (Configuration.doAutoCreate())
2200          this.accountNumber = new StringType(); // bb
2201      return this.accountNumber;
2202    }
2203
2204    public boolean hasAccountNumberElement() { 
2205      return this.accountNumber != null && !this.accountNumber.isEmpty();
2206    }
2207
2208    public boolean hasAccountNumber() { 
2209      return this.accountNumber != null && !this.accountNumber.isEmpty();
2210    }
2211
2212    /**
2213     * @param value {@link #accountNumber} (A portion of the account number, often the last 4 digits, used for verification not charging purposes.). This is the underlying object with id, value and extensions. The accessor "getAccountNumber" gives direct access to the value
2214     */
2215    public PaymentReconciliation setAccountNumberElement(StringType value) { 
2216      this.accountNumber = value;
2217      return this;
2218    }
2219
2220    /**
2221     * @return A portion of the account number, often the last 4 digits, used for verification not charging purposes.
2222     */
2223    public String getAccountNumber() { 
2224      return this.accountNumber == null ? null : this.accountNumber.getValue();
2225    }
2226
2227    /**
2228     * @param value A portion of the account number, often the last 4 digits, used for verification not charging purposes.
2229     */
2230    public PaymentReconciliation setAccountNumber(String value) { 
2231      if (Utilities.noString(value))
2232        this.accountNumber = null;
2233      else {
2234        if (this.accountNumber == null)
2235          this.accountNumber = new StringType();
2236        this.accountNumber.setValue(value);
2237      }
2238      return this;
2239    }
2240
2241    /**
2242     * @return {@link #expirationDate} (The year and month (YYYY-MM) when the instrument, typically card, expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value
2243     */
2244    public DateType getExpirationDateElement() { 
2245      if (this.expirationDate == null)
2246        if (Configuration.errorOnAutoCreate())
2247          throw new Error("Attempt to auto-create PaymentReconciliation.expirationDate");
2248        else if (Configuration.doAutoCreate())
2249          this.expirationDate = new DateType(); // bb
2250      return this.expirationDate;
2251    }
2252
2253    public boolean hasExpirationDateElement() { 
2254      return this.expirationDate != null && !this.expirationDate.isEmpty();
2255    }
2256
2257    public boolean hasExpirationDate() { 
2258      return this.expirationDate != null && !this.expirationDate.isEmpty();
2259    }
2260
2261    /**
2262     * @param value {@link #expirationDate} (The year and month (YYYY-MM) when the instrument, typically card, expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value
2263     */
2264    public PaymentReconciliation setExpirationDateElement(DateType value) { 
2265      this.expirationDate = value;
2266      return this;
2267    }
2268
2269    /**
2270     * @return The year and month (YYYY-MM) when the instrument, typically card, expires.
2271     */
2272    public Date getExpirationDate() { 
2273      return this.expirationDate == null ? null : this.expirationDate.getValue();
2274    }
2275
2276    /**
2277     * @param value The year and month (YYYY-MM) when the instrument, typically card, expires.
2278     */
2279    public PaymentReconciliation setExpirationDate(Date value) { 
2280      if (value == null)
2281        this.expirationDate = null;
2282      else {
2283        if (this.expirationDate == null)
2284          this.expirationDate = new DateType();
2285        this.expirationDate.setValue(value);
2286      }
2287      return this;
2288    }
2289
2290    /**
2291     * @return {@link #processor} (The name of the card processor, etf processor, bank for checks.). This is the underlying object with id, value and extensions. The accessor "getProcessor" gives direct access to the value
2292     */
2293    public StringType getProcessorElement() { 
2294      if (this.processor == null)
2295        if (Configuration.errorOnAutoCreate())
2296          throw new Error("Attempt to auto-create PaymentReconciliation.processor");
2297        else if (Configuration.doAutoCreate())
2298          this.processor = new StringType(); // bb
2299      return this.processor;
2300    }
2301
2302    public boolean hasProcessorElement() { 
2303      return this.processor != null && !this.processor.isEmpty();
2304    }
2305
2306    public boolean hasProcessor() { 
2307      return this.processor != null && !this.processor.isEmpty();
2308    }
2309
2310    /**
2311     * @param value {@link #processor} (The name of the card processor, etf processor, bank for checks.). This is the underlying object with id, value and extensions. The accessor "getProcessor" gives direct access to the value
2312     */
2313    public PaymentReconciliation setProcessorElement(StringType value) { 
2314      this.processor = value;
2315      return this;
2316    }
2317
2318    /**
2319     * @return The name of the card processor, etf processor, bank for checks.
2320     */
2321    public String getProcessor() { 
2322      return this.processor == null ? null : this.processor.getValue();
2323    }
2324
2325    /**
2326     * @param value The name of the card processor, etf processor, bank for checks.
2327     */
2328    public PaymentReconciliation setProcessor(String value) { 
2329      if (Utilities.noString(value))
2330        this.processor = null;
2331      else {
2332        if (this.processor == null)
2333          this.processor = new StringType();
2334        this.processor.setValue(value);
2335      }
2336      return this;
2337    }
2338
2339    /**
2340     * @return {@link #referenceNumber} (The check number, eft reference, car processor reference.). This is the underlying object with id, value and extensions. The accessor "getReferenceNumber" gives direct access to the value
2341     */
2342    public StringType getReferenceNumberElement() { 
2343      if (this.referenceNumber == null)
2344        if (Configuration.errorOnAutoCreate())
2345          throw new Error("Attempt to auto-create PaymentReconciliation.referenceNumber");
2346        else if (Configuration.doAutoCreate())
2347          this.referenceNumber = new StringType(); // bb
2348      return this.referenceNumber;
2349    }
2350
2351    public boolean hasReferenceNumberElement() { 
2352      return this.referenceNumber != null && !this.referenceNumber.isEmpty();
2353    }
2354
2355    public boolean hasReferenceNumber() { 
2356      return this.referenceNumber != null && !this.referenceNumber.isEmpty();
2357    }
2358
2359    /**
2360     * @param value {@link #referenceNumber} (The check number, eft reference, car processor reference.). This is the underlying object with id, value and extensions. The accessor "getReferenceNumber" gives direct access to the value
2361     */
2362    public PaymentReconciliation setReferenceNumberElement(StringType value) { 
2363      this.referenceNumber = value;
2364      return this;
2365    }
2366
2367    /**
2368     * @return The check number, eft reference, car processor reference.
2369     */
2370    public String getReferenceNumber() { 
2371      return this.referenceNumber == null ? null : this.referenceNumber.getValue();
2372    }
2373
2374    /**
2375     * @param value The check number, eft reference, car processor reference.
2376     */
2377    public PaymentReconciliation setReferenceNumber(String value) { 
2378      if (Utilities.noString(value))
2379        this.referenceNumber = null;
2380      else {
2381        if (this.referenceNumber == null)
2382          this.referenceNumber = new StringType();
2383        this.referenceNumber.setValue(value);
2384      }
2385      return this;
2386    }
2387
2388    /**
2389     * @return {@link #authorization} (An alphanumeric issued by the processor to confirm the successful issuance of payment.). This is the underlying object with id, value and extensions. The accessor "getAuthorization" gives direct access to the value
2390     */
2391    public StringType getAuthorizationElement() { 
2392      if (this.authorization == null)
2393        if (Configuration.errorOnAutoCreate())
2394          throw new Error("Attempt to auto-create PaymentReconciliation.authorization");
2395        else if (Configuration.doAutoCreate())
2396          this.authorization = new StringType(); // bb
2397      return this.authorization;
2398    }
2399
2400    public boolean hasAuthorizationElement() { 
2401      return this.authorization != null && !this.authorization.isEmpty();
2402    }
2403
2404    public boolean hasAuthorization() { 
2405      return this.authorization != null && !this.authorization.isEmpty();
2406    }
2407
2408    /**
2409     * @param value {@link #authorization} (An alphanumeric issued by the processor to confirm the successful issuance of payment.). This is the underlying object with id, value and extensions. The accessor "getAuthorization" gives direct access to the value
2410     */
2411    public PaymentReconciliation setAuthorizationElement(StringType value) { 
2412      this.authorization = value;
2413      return this;
2414    }
2415
2416    /**
2417     * @return An alphanumeric issued by the processor to confirm the successful issuance of payment.
2418     */
2419    public String getAuthorization() { 
2420      return this.authorization == null ? null : this.authorization.getValue();
2421    }
2422
2423    /**
2424     * @param value An alphanumeric issued by the processor to confirm the successful issuance of payment.
2425     */
2426    public PaymentReconciliation setAuthorization(String value) { 
2427      if (Utilities.noString(value))
2428        this.authorization = null;
2429      else {
2430        if (this.authorization == null)
2431          this.authorization = new StringType();
2432        this.authorization.setValue(value);
2433      }
2434      return this;
2435    }
2436
2437    /**
2438     * @return {@link #tenderedAmount} (The amount offered by the issuer, typically applies to cash when the issuer provides an amount in bank note denominations equal to or excess of the amount actually being paid.)
2439     */
2440    public Money getTenderedAmount() { 
2441      if (this.tenderedAmount == null)
2442        if (Configuration.errorOnAutoCreate())
2443          throw new Error("Attempt to auto-create PaymentReconciliation.tenderedAmount");
2444        else if (Configuration.doAutoCreate())
2445          this.tenderedAmount = new Money(); // cc
2446      return this.tenderedAmount;
2447    }
2448
2449    public boolean hasTenderedAmount() { 
2450      return this.tenderedAmount != null && !this.tenderedAmount.isEmpty();
2451    }
2452
2453    /**
2454     * @param value {@link #tenderedAmount} (The amount offered by the issuer, typically applies to cash when the issuer provides an amount in bank note denominations equal to or excess of the amount actually being paid.)
2455     */
2456    public PaymentReconciliation setTenderedAmount(Money value) { 
2457      this.tenderedAmount = value;
2458      return this;
2459    }
2460
2461    /**
2462     * @return {@link #returnedAmount} (The amount returned by the receiver which is excess to the amount payable, often referred to as 'change'.)
2463     */
2464    public Money getReturnedAmount() { 
2465      if (this.returnedAmount == null)
2466        if (Configuration.errorOnAutoCreate())
2467          throw new Error("Attempt to auto-create PaymentReconciliation.returnedAmount");
2468        else if (Configuration.doAutoCreate())
2469          this.returnedAmount = new Money(); // cc
2470      return this.returnedAmount;
2471    }
2472
2473    public boolean hasReturnedAmount() { 
2474      return this.returnedAmount != null && !this.returnedAmount.isEmpty();
2475    }
2476
2477    /**
2478     * @param value {@link #returnedAmount} (The amount returned by the receiver which is excess to the amount payable, often referred to as 'change'.)
2479     */
2480    public PaymentReconciliation setReturnedAmount(Money value) { 
2481      this.returnedAmount = value;
2482      return this;
2483    }
2484
2485    /**
2486     * @return {@link #amount} (Total payment amount as indicated on the financial instrument.)
2487     */
2488    public Money getAmount() { 
2489      if (this.amount == null)
2490        if (Configuration.errorOnAutoCreate())
2491          throw new Error("Attempt to auto-create PaymentReconciliation.amount");
2492        else if (Configuration.doAutoCreate())
2493          this.amount = new Money(); // cc
2494      return this.amount;
2495    }
2496
2497    public boolean hasAmount() { 
2498      return this.amount != null && !this.amount.isEmpty();
2499    }
2500
2501    /**
2502     * @param value {@link #amount} (Total payment amount as indicated on the financial instrument.)
2503     */
2504    public PaymentReconciliation setAmount(Money value) { 
2505      this.amount = value;
2506      return this;
2507    }
2508
2509    /**
2510     * @return {@link #paymentIdentifier} (Issuer's unique identifier for the payment instrument.)
2511     */
2512    public Identifier getPaymentIdentifier() { 
2513      if (this.paymentIdentifier == null)
2514        if (Configuration.errorOnAutoCreate())
2515          throw new Error("Attempt to auto-create PaymentReconciliation.paymentIdentifier");
2516        else if (Configuration.doAutoCreate())
2517          this.paymentIdentifier = new Identifier(); // cc
2518      return this.paymentIdentifier;
2519    }
2520
2521    public boolean hasPaymentIdentifier() { 
2522      return this.paymentIdentifier != null && !this.paymentIdentifier.isEmpty();
2523    }
2524
2525    /**
2526     * @param value {@link #paymentIdentifier} (Issuer's unique identifier for the payment instrument.)
2527     */
2528    public PaymentReconciliation setPaymentIdentifier(Identifier value) { 
2529      this.paymentIdentifier = value;
2530      return this;
2531    }
2532
2533    /**
2534     * @return {@link #allocation} (Distribution of the payment amount for a previously acknowledged payable.)
2535     */
2536    public List<PaymentReconciliationAllocationComponent> getAllocation() { 
2537      if (this.allocation == null)
2538        this.allocation = new ArrayList<PaymentReconciliationAllocationComponent>();
2539      return this.allocation;
2540    }
2541
2542    /**
2543     * @return Returns a reference to <code>this</code> for easy method chaining
2544     */
2545    public PaymentReconciliation setAllocation(List<PaymentReconciliationAllocationComponent> theAllocation) { 
2546      this.allocation = theAllocation;
2547      return this;
2548    }
2549
2550    public boolean hasAllocation() { 
2551      if (this.allocation == null)
2552        return false;
2553      for (PaymentReconciliationAllocationComponent item : this.allocation)
2554        if (!item.isEmpty())
2555          return true;
2556      return false;
2557    }
2558
2559    public PaymentReconciliationAllocationComponent addAllocation() { //3
2560      PaymentReconciliationAllocationComponent t = new PaymentReconciliationAllocationComponent();
2561      if (this.allocation == null)
2562        this.allocation = new ArrayList<PaymentReconciliationAllocationComponent>();
2563      this.allocation.add(t);
2564      return t;
2565    }
2566
2567    public PaymentReconciliation addAllocation(PaymentReconciliationAllocationComponent t) { //3
2568      if (t == null)
2569        return this;
2570      if (this.allocation == null)
2571        this.allocation = new ArrayList<PaymentReconciliationAllocationComponent>();
2572      this.allocation.add(t);
2573      return this;
2574    }
2575
2576    /**
2577     * @return The first repetition of repeating field {@link #allocation}, creating it if it does not already exist {3}
2578     */
2579    public PaymentReconciliationAllocationComponent getAllocationFirstRep() { 
2580      if (getAllocation().isEmpty()) {
2581        addAllocation();
2582      }
2583      return getAllocation().get(0);
2584    }
2585
2586    /**
2587     * @return {@link #formCode} (A code for the form to be used for printing the content.)
2588     */
2589    public CodeableConcept getFormCode() { 
2590      if (this.formCode == null)
2591        if (Configuration.errorOnAutoCreate())
2592          throw new Error("Attempt to auto-create PaymentReconciliation.formCode");
2593        else if (Configuration.doAutoCreate())
2594          this.formCode = new CodeableConcept(); // cc
2595      return this.formCode;
2596    }
2597
2598    public boolean hasFormCode() { 
2599      return this.formCode != null && !this.formCode.isEmpty();
2600    }
2601
2602    /**
2603     * @param value {@link #formCode} (A code for the form to be used for printing the content.)
2604     */
2605    public PaymentReconciliation setFormCode(CodeableConcept value) { 
2606      this.formCode = value;
2607      return this;
2608    }
2609
2610    /**
2611     * @return {@link #processNote} (A note that describes or explains the processing in a human readable form.)
2612     */
2613    public List<NotesComponent> getProcessNote() { 
2614      if (this.processNote == null)
2615        this.processNote = new ArrayList<NotesComponent>();
2616      return this.processNote;
2617    }
2618
2619    /**
2620     * @return Returns a reference to <code>this</code> for easy method chaining
2621     */
2622    public PaymentReconciliation setProcessNote(List<NotesComponent> theProcessNote) { 
2623      this.processNote = theProcessNote;
2624      return this;
2625    }
2626
2627    public boolean hasProcessNote() { 
2628      if (this.processNote == null)
2629        return false;
2630      for (NotesComponent item : this.processNote)
2631        if (!item.isEmpty())
2632          return true;
2633      return false;
2634    }
2635
2636    public NotesComponent addProcessNote() { //3
2637      NotesComponent t = new NotesComponent();
2638      if (this.processNote == null)
2639        this.processNote = new ArrayList<NotesComponent>();
2640      this.processNote.add(t);
2641      return t;
2642    }
2643
2644    public PaymentReconciliation addProcessNote(NotesComponent t) { //3
2645      if (t == null)
2646        return this;
2647      if (this.processNote == null)
2648        this.processNote = new ArrayList<NotesComponent>();
2649      this.processNote.add(t);
2650      return this;
2651    }
2652
2653    /**
2654     * @return The first repetition of repeating field {@link #processNote}, creating it if it does not already exist {3}
2655     */
2656    public NotesComponent getProcessNoteFirstRep() { 
2657      if (getProcessNote().isEmpty()) {
2658        addProcessNote();
2659      }
2660      return getProcessNote().get(0);
2661    }
2662
2663      protected void listChildren(List<Property> children) {
2664        super.listChildren(children);
2665        children.add(new Property("identifier", "Identifier", "A unique identifier assigned to this payment reconciliation.", 0, java.lang.Integer.MAX_VALUE, identifier));
2666        children.add(new Property("type", "CodeableConcept", "Code to indicate the nature of the payment such as payment, adjustment.", 0, 1, type));
2667        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
2668        children.add(new Property("kind", "CodeableConcept", "The workflow or activity which gave rise to or during which the payment ocurred such as a kiosk, deposit on account, periodic payment etc.", 0, 1, kind));
2669        children.add(new Property("period", "Period", "The period of time for which payments have been gathered into this bulk payment for settlement.", 0, 1, period));
2670        children.add(new Property("created", "dateTime", "The date when the resource was created.", 0, 1, created));
2671        children.add(new Property("enterer", "Reference(Practitioner|PractitionerRole|Organization)", "Payment enterer if not the actual payment issuer.", 0, 1, enterer));
2672        children.add(new Property("issuerType", "CodeableConcept", "The type of the source such as patient or insurance.", 0, 1, issuerType));
2673        children.add(new Property("paymentIssuer", "Reference(Organization|Patient|RelatedPerson)", "The party who generated the payment.", 0, 1, paymentIssuer));
2674        children.add(new Property("request", "Reference(Task)", "Original request resource reference.", 0, 1, request));
2675        children.add(new Property("requestor", "Reference(Practitioner|PractitionerRole|Organization)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, requestor));
2676        children.add(new Property("outcome", "code", "The outcome of a request for a reconciliation.", 0, 1, outcome));
2677        children.add(new Property("disposition", "string", "A human readable description of the status of the request for the reconciliation.", 0, 1, disposition));
2678        children.add(new Property("date", "date", "The date of payment as indicated on the financial instrument.", 0, 1, date));
2679        children.add(new Property("location", "Reference(Location)", "The location of the site or device for electronic transfers or physical location for cash payments.", 0, 1, location));
2680        children.add(new Property("method", "CodeableConcept", "The means of payment such as check, card cash, or electronic funds transfer.", 0, 1, method));
2681        children.add(new Property("cardBrand", "string", "The card brand such as debit, Visa, Amex etc. used if a card is the method of payment.", 0, 1, cardBrand));
2682        children.add(new Property("accountNumber", "string", "A portion of the account number, often the last 4 digits, used for verification not charging purposes.", 0, 1, accountNumber));
2683        children.add(new Property("expirationDate", "date", "The year and month (YYYY-MM) when the instrument, typically card, expires.", 0, 1, expirationDate));
2684        children.add(new Property("processor", "string", "The name of the card processor, etf processor, bank for checks.", 0, 1, processor));
2685        children.add(new Property("referenceNumber", "string", "The check number, eft reference, car processor reference.", 0, 1, referenceNumber));
2686        children.add(new Property("authorization", "string", "An alphanumeric issued by the processor to confirm the successful issuance of payment.", 0, 1, authorization));
2687        children.add(new Property("tenderedAmount", "Money", "The amount offered by the issuer, typically applies to cash when the issuer provides an amount in bank note denominations equal to or excess of the amount actually being paid.", 0, 1, tenderedAmount));
2688        children.add(new Property("returnedAmount", "Money", "The amount returned by the receiver which is excess to the amount payable, often referred to as 'change'.", 0, 1, returnedAmount));
2689        children.add(new Property("amount", "Money", "Total payment amount as indicated on the financial instrument.", 0, 1, amount));
2690        children.add(new Property("paymentIdentifier", "Identifier", "Issuer's unique identifier for the payment instrument.", 0, 1, paymentIdentifier));
2691        children.add(new Property("allocation", "", "Distribution of the payment amount for a previously acknowledged payable.", 0, java.lang.Integer.MAX_VALUE, allocation));
2692        children.add(new Property("formCode", "CodeableConcept", "A code for the form to be used for printing the content.", 0, 1, formCode));
2693        children.add(new Property("processNote", "", "A note that describes or explains the processing in a human readable form.", 0, java.lang.Integer.MAX_VALUE, processNote));
2694      }
2695
2696      @Override
2697      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2698        switch (_hash) {
2699        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier assigned to this payment reconciliation.", 0, java.lang.Integer.MAX_VALUE, identifier);
2700        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Code to indicate the nature of the payment such as payment, adjustment.", 0, 1, type);
2701        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
2702        case 3292052: /*kind*/  return new Property("kind", "CodeableConcept", "The workflow or activity which gave rise to or during which the payment ocurred such as a kiosk, deposit on account, periodic payment etc.", 0, 1, kind);
2703        case -991726143: /*period*/  return new Property("period", "Period", "The period of time for which payments have been gathered into this bulk payment for settlement.", 0, 1, period);
2704        case 1028554472: /*created*/  return new Property("created", "dateTime", "The date when the resource was created.", 0, 1, created);
2705        case -1591951995: /*enterer*/  return new Property("enterer", "Reference(Practitioner|PractitionerRole|Organization)", "Payment enterer if not the actual payment issuer.", 0, 1, enterer);
2706        case 1459974547: /*issuerType*/  return new Property("issuerType", "CodeableConcept", "The type of the source such as patient or insurance.", 0, 1, issuerType);
2707        case 1144026207: /*paymentIssuer*/  return new Property("paymentIssuer", "Reference(Organization|Patient|RelatedPerson)", "The party who generated the payment.", 0, 1, paymentIssuer);
2708        case 1095692943: /*request*/  return new Property("request", "Reference(Task)", "Original request resource reference.", 0, 1, request);
2709        case 693934258: /*requestor*/  return new Property("requestor", "Reference(Practitioner|PractitionerRole|Organization)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, requestor);
2710        case -1106507950: /*outcome*/  return new Property("outcome", "code", "The outcome of a request for a reconciliation.", 0, 1, outcome);
2711        case 583380919: /*disposition*/  return new Property("disposition", "string", "A human readable description of the status of the request for the reconciliation.", 0, 1, disposition);
2712        case 3076014: /*date*/  return new Property("date", "date", "The date of payment as indicated on the financial instrument.", 0, 1, date);
2713        case 1901043637: /*location*/  return new Property("location", "Reference(Location)", "The location of the site or device for electronic transfers or physical location for cash payments.", 0, 1, location);
2714        case -1077554975: /*method*/  return new Property("method", "CodeableConcept", "The means of payment such as check, card cash, or electronic funds transfer.", 0, 1, method);
2715        case -271889833: /*cardBrand*/  return new Property("cardBrand", "string", "The card brand such as debit, Visa, Amex etc. used if a card is the method of payment.", 0, 1, cardBrand);
2716        case -1011205162: /*accountNumber*/  return new Property("accountNumber", "string", "A portion of the account number, often the last 4 digits, used for verification not charging purposes.", 0, 1, accountNumber);
2717        case -668811523: /*expirationDate*/  return new Property("expirationDate", "date", "The year and month (YYYY-MM) when the instrument, typically card, expires.", 0, 1, expirationDate);
2718        case -1094759278: /*processor*/  return new Property("processor", "string", "The name of the card processor, etf processor, bank for checks.", 0, 1, processor);
2719        case 744563316: /*referenceNumber*/  return new Property("referenceNumber", "string", "The check number, eft reference, car processor reference.", 0, 1, referenceNumber);
2720        case -1385570183: /*authorization*/  return new Property("authorization", "string", "An alphanumeric issued by the processor to confirm the successful issuance of payment.", 0, 1, authorization);
2721        case 1815344299: /*tenderedAmount*/  return new Property("tenderedAmount", "Money", "The amount offered by the issuer, typically applies to cash when the issuer provides an amount in bank note denominations equal to or excess of the amount actually being paid.", 0, 1, tenderedAmount);
2722        case -797236473: /*returnedAmount*/  return new Property("returnedAmount", "Money", "The amount returned by the receiver which is excess to the amount payable, often referred to as 'change'.", 0, 1, returnedAmount);
2723        case -1413853096: /*amount*/  return new Property("amount", "Money", "Total payment amount as indicated on the financial instrument.", 0, 1, amount);
2724        case 1555852111: /*paymentIdentifier*/  return new Property("paymentIdentifier", "Identifier", "Issuer's unique identifier for the payment instrument.", 0, 1, paymentIdentifier);
2725        case -1912450848: /*allocation*/  return new Property("allocation", "", "Distribution of the payment amount for a previously acknowledged payable.", 0, java.lang.Integer.MAX_VALUE, allocation);
2726        case 473181393: /*formCode*/  return new Property("formCode", "CodeableConcept", "A code for the form to be used for printing the content.", 0, 1, formCode);
2727        case 202339073: /*processNote*/  return new Property("processNote", "", "A note that describes or explains the processing in a human readable form.", 0, java.lang.Integer.MAX_VALUE, processNote);
2728        default: return super.getNamedProperty(_hash, _name, _checkValid);
2729        }
2730
2731      }
2732
2733      @Override
2734      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2735        switch (hash) {
2736        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2737        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2738        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FinancialResourceStatusCodes>
2739        case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // CodeableConcept
2740        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
2741        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
2742        case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Reference
2743        case 1459974547: /*issuerType*/ return this.issuerType == null ? new Base[0] : new Base[] {this.issuerType}; // CodeableConcept
2744        case 1144026207: /*paymentIssuer*/ return this.paymentIssuer == null ? new Base[0] : new Base[] {this.paymentIssuer}; // Reference
2745        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference
2746        case 693934258: /*requestor*/ return this.requestor == null ? new Base[0] : new Base[] {this.requestor}; // Reference
2747        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration<PaymentOutcome>
2748        case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType
2749        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType
2750        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
2751        case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept
2752        case -271889833: /*cardBrand*/ return this.cardBrand == null ? new Base[0] : new Base[] {this.cardBrand}; // StringType
2753        case -1011205162: /*accountNumber*/ return this.accountNumber == null ? new Base[0] : new Base[] {this.accountNumber}; // StringType
2754        case -668811523: /*expirationDate*/ return this.expirationDate == null ? new Base[0] : new Base[] {this.expirationDate}; // DateType
2755        case -1094759278: /*processor*/ return this.processor == null ? new Base[0] : new Base[] {this.processor}; // StringType
2756        case 744563316: /*referenceNumber*/ return this.referenceNumber == null ? new Base[0] : new Base[] {this.referenceNumber}; // StringType
2757        case -1385570183: /*authorization*/ return this.authorization == null ? new Base[0] : new Base[] {this.authorization}; // StringType
2758        case 1815344299: /*tenderedAmount*/ return this.tenderedAmount == null ? new Base[0] : new Base[] {this.tenderedAmount}; // Money
2759        case -797236473: /*returnedAmount*/ return this.returnedAmount == null ? new Base[0] : new Base[] {this.returnedAmount}; // Money
2760        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
2761        case 1555852111: /*paymentIdentifier*/ return this.paymentIdentifier == null ? new Base[0] : new Base[] {this.paymentIdentifier}; // Identifier
2762        case -1912450848: /*allocation*/ return this.allocation == null ? new Base[0] : this.allocation.toArray(new Base[this.allocation.size()]); // PaymentReconciliationAllocationComponent
2763        case 473181393: /*formCode*/ return this.formCode == null ? new Base[0] : new Base[] {this.formCode}; // CodeableConcept
2764        case 202339073: /*processNote*/ return this.processNote == null ? new Base[0] : this.processNote.toArray(new Base[this.processNote.size()]); // NotesComponent
2765        default: return super.getProperty(hash, name, checkValid);
2766        }
2767
2768      }
2769
2770      @Override
2771      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2772        switch (hash) {
2773        case -1618432855: // identifier
2774          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2775          return value;
2776        case 3575610: // type
2777          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2778          return value;
2779        case -892481550: // status
2780          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2781          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
2782          return value;
2783        case 3292052: // kind
2784          this.kind = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2785          return value;
2786        case -991726143: // period
2787          this.period = TypeConvertor.castToPeriod(value); // Period
2788          return value;
2789        case 1028554472: // created
2790          this.created = TypeConvertor.castToDateTime(value); // DateTimeType
2791          return value;
2792        case -1591951995: // enterer
2793          this.enterer = TypeConvertor.castToReference(value); // Reference
2794          return value;
2795        case 1459974547: // issuerType
2796          this.issuerType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2797          return value;
2798        case 1144026207: // paymentIssuer
2799          this.paymentIssuer = TypeConvertor.castToReference(value); // Reference
2800          return value;
2801        case 1095692943: // request
2802          this.request = TypeConvertor.castToReference(value); // Reference
2803          return value;
2804        case 693934258: // requestor
2805          this.requestor = TypeConvertor.castToReference(value); // Reference
2806          return value;
2807        case -1106507950: // outcome
2808          value = new PaymentOutcomeEnumFactory().fromType(TypeConvertor.castToCode(value));
2809          this.outcome = (Enumeration) value; // Enumeration<PaymentOutcome>
2810          return value;
2811        case 583380919: // disposition
2812          this.disposition = TypeConvertor.castToString(value); // StringType
2813          return value;
2814        case 3076014: // date
2815          this.date = TypeConvertor.castToDate(value); // DateType
2816          return value;
2817        case 1901043637: // location
2818          this.location = TypeConvertor.castToReference(value); // Reference
2819          return value;
2820        case -1077554975: // method
2821          this.method = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2822          return value;
2823        case -271889833: // cardBrand
2824          this.cardBrand = TypeConvertor.castToString(value); // StringType
2825          return value;
2826        case -1011205162: // accountNumber
2827          this.accountNumber = TypeConvertor.castToString(value); // StringType
2828          return value;
2829        case -668811523: // expirationDate
2830          this.expirationDate = TypeConvertor.castToDate(value); // DateType
2831          return value;
2832        case -1094759278: // processor
2833          this.processor = TypeConvertor.castToString(value); // StringType
2834          return value;
2835        case 744563316: // referenceNumber
2836          this.referenceNumber = TypeConvertor.castToString(value); // StringType
2837          return value;
2838        case -1385570183: // authorization
2839          this.authorization = TypeConvertor.castToString(value); // StringType
2840          return value;
2841        case 1815344299: // tenderedAmount
2842          this.tenderedAmount = TypeConvertor.castToMoney(value); // Money
2843          return value;
2844        case -797236473: // returnedAmount
2845          this.returnedAmount = TypeConvertor.castToMoney(value); // Money
2846          return value;
2847        case -1413853096: // amount
2848          this.amount = TypeConvertor.castToMoney(value); // Money
2849          return value;
2850        case 1555852111: // paymentIdentifier
2851          this.paymentIdentifier = TypeConvertor.castToIdentifier(value); // Identifier
2852          return value;
2853        case -1912450848: // allocation
2854          this.getAllocation().add((PaymentReconciliationAllocationComponent) value); // PaymentReconciliationAllocationComponent
2855          return value;
2856        case 473181393: // formCode
2857          this.formCode = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2858          return value;
2859        case 202339073: // processNote
2860          this.getProcessNote().add((NotesComponent) value); // NotesComponent
2861          return value;
2862        default: return super.setProperty(hash, name, value);
2863        }
2864
2865      }
2866
2867      @Override
2868      public Base setProperty(String name, Base value) throws FHIRException {
2869        if (name.equals("identifier")) {
2870          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2871        } else if (name.equals("type")) {
2872          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2873        } else if (name.equals("status")) {
2874          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2875          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
2876        } else if (name.equals("kind")) {
2877          this.kind = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2878        } else if (name.equals("period")) {
2879          this.period = TypeConvertor.castToPeriod(value); // Period
2880        } else if (name.equals("created")) {
2881          this.created = TypeConvertor.castToDateTime(value); // DateTimeType
2882        } else if (name.equals("enterer")) {
2883          this.enterer = TypeConvertor.castToReference(value); // Reference
2884        } else if (name.equals("issuerType")) {
2885          this.issuerType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2886        } else if (name.equals("paymentIssuer")) {
2887          this.paymentIssuer = TypeConvertor.castToReference(value); // Reference
2888        } else if (name.equals("request")) {
2889          this.request = TypeConvertor.castToReference(value); // Reference
2890        } else if (name.equals("requestor")) {
2891          this.requestor = TypeConvertor.castToReference(value); // Reference
2892        } else if (name.equals("outcome")) {
2893          value = new PaymentOutcomeEnumFactory().fromType(TypeConvertor.castToCode(value));
2894          this.outcome = (Enumeration) value; // Enumeration<PaymentOutcome>
2895        } else if (name.equals("disposition")) {
2896          this.disposition = TypeConvertor.castToString(value); // StringType
2897        } else if (name.equals("date")) {
2898          this.date = TypeConvertor.castToDate(value); // DateType
2899        } else if (name.equals("location")) {
2900          this.location = TypeConvertor.castToReference(value); // Reference
2901        } else if (name.equals("method")) {
2902          this.method = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2903        } else if (name.equals("cardBrand")) {
2904          this.cardBrand = TypeConvertor.castToString(value); // StringType
2905        } else if (name.equals("accountNumber")) {
2906          this.accountNumber = TypeConvertor.castToString(value); // StringType
2907        } else if (name.equals("expirationDate")) {
2908          this.expirationDate = TypeConvertor.castToDate(value); // DateType
2909        } else if (name.equals("processor")) {
2910          this.processor = TypeConvertor.castToString(value); // StringType
2911        } else if (name.equals("referenceNumber")) {
2912          this.referenceNumber = TypeConvertor.castToString(value); // StringType
2913        } else if (name.equals("authorization")) {
2914          this.authorization = TypeConvertor.castToString(value); // StringType
2915        } else if (name.equals("tenderedAmount")) {
2916          this.tenderedAmount = TypeConvertor.castToMoney(value); // Money
2917        } else if (name.equals("returnedAmount")) {
2918          this.returnedAmount = TypeConvertor.castToMoney(value); // Money
2919        } else if (name.equals("amount")) {
2920          this.amount = TypeConvertor.castToMoney(value); // Money
2921        } else if (name.equals("paymentIdentifier")) {
2922          this.paymentIdentifier = TypeConvertor.castToIdentifier(value); // Identifier
2923        } else if (name.equals("allocation")) {
2924          this.getAllocation().add((PaymentReconciliationAllocationComponent) value);
2925        } else if (name.equals("formCode")) {
2926          this.formCode = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2927        } else if (name.equals("processNote")) {
2928          this.getProcessNote().add((NotesComponent) value);
2929        } else
2930          return super.setProperty(name, value);
2931        return value;
2932      }
2933
2934  @Override
2935  public void removeChild(String name, Base value) throws FHIRException {
2936        if (name.equals("identifier")) {
2937          this.getIdentifier().remove(value);
2938        } else if (name.equals("type")) {
2939          this.type = null;
2940        } else if (name.equals("status")) {
2941          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2942          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
2943        } else if (name.equals("kind")) {
2944          this.kind = null;
2945        } else if (name.equals("period")) {
2946          this.period = null;
2947        } else if (name.equals("created")) {
2948          this.created = null;
2949        } else if (name.equals("enterer")) {
2950          this.enterer = null;
2951        } else if (name.equals("issuerType")) {
2952          this.issuerType = null;
2953        } else if (name.equals("paymentIssuer")) {
2954          this.paymentIssuer = null;
2955        } else if (name.equals("request")) {
2956          this.request = null;
2957        } else if (name.equals("requestor")) {
2958          this.requestor = null;
2959        } else if (name.equals("outcome")) {
2960          value = new PaymentOutcomeEnumFactory().fromType(TypeConvertor.castToCode(value));
2961          this.outcome = (Enumeration) value; // Enumeration<PaymentOutcome>
2962        } else if (name.equals("disposition")) {
2963          this.disposition = null;
2964        } else if (name.equals("date")) {
2965          this.date = null;
2966        } else if (name.equals("location")) {
2967          this.location = null;
2968        } else if (name.equals("method")) {
2969          this.method = null;
2970        } else if (name.equals("cardBrand")) {
2971          this.cardBrand = null;
2972        } else if (name.equals("accountNumber")) {
2973          this.accountNumber = null;
2974        } else if (name.equals("expirationDate")) {
2975          this.expirationDate = null;
2976        } else if (name.equals("processor")) {
2977          this.processor = null;
2978        } else if (name.equals("referenceNumber")) {
2979          this.referenceNumber = null;
2980        } else if (name.equals("authorization")) {
2981          this.authorization = null;
2982        } else if (name.equals("tenderedAmount")) {
2983          this.tenderedAmount = null;
2984        } else if (name.equals("returnedAmount")) {
2985          this.returnedAmount = null;
2986        } else if (name.equals("amount")) {
2987          this.amount = null;
2988        } else if (name.equals("paymentIdentifier")) {
2989          this.paymentIdentifier = null;
2990        } else if (name.equals("allocation")) {
2991          this.getAllocation().remove((PaymentReconciliationAllocationComponent) value);
2992        } else if (name.equals("formCode")) {
2993          this.formCode = null;
2994        } else if (name.equals("processNote")) {
2995          this.getProcessNote().remove((NotesComponent) value);
2996        } else
2997          super.removeChild(name, value);
2998        
2999      }
3000
3001      @Override
3002      public Base makeProperty(int hash, String name) throws FHIRException {
3003        switch (hash) {
3004        case -1618432855:  return addIdentifier(); 
3005        case 3575610:  return getType();
3006        case -892481550:  return getStatusElement();
3007        case 3292052:  return getKind();
3008        case -991726143:  return getPeriod();
3009        case 1028554472:  return getCreatedElement();
3010        case -1591951995:  return getEnterer();
3011        case 1459974547:  return getIssuerType();
3012        case 1144026207:  return getPaymentIssuer();
3013        case 1095692943:  return getRequest();
3014        case 693934258:  return getRequestor();
3015        case -1106507950:  return getOutcomeElement();
3016        case 583380919:  return getDispositionElement();
3017        case 3076014:  return getDateElement();
3018        case 1901043637:  return getLocation();
3019        case -1077554975:  return getMethod();
3020        case -271889833:  return getCardBrandElement();
3021        case -1011205162:  return getAccountNumberElement();
3022        case -668811523:  return getExpirationDateElement();
3023        case -1094759278:  return getProcessorElement();
3024        case 744563316:  return getReferenceNumberElement();
3025        case -1385570183:  return getAuthorizationElement();
3026        case 1815344299:  return getTenderedAmount();
3027        case -797236473:  return getReturnedAmount();
3028        case -1413853096:  return getAmount();
3029        case 1555852111:  return getPaymentIdentifier();
3030        case -1912450848:  return addAllocation(); 
3031        case 473181393:  return getFormCode();
3032        case 202339073:  return addProcessNote(); 
3033        default: return super.makeProperty(hash, name);
3034        }
3035
3036      }
3037
3038      @Override
3039      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3040        switch (hash) {
3041        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3042        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3043        case -892481550: /*status*/ return new String[] {"code"};
3044        case 3292052: /*kind*/ return new String[] {"CodeableConcept"};
3045        case -991726143: /*period*/ return new String[] {"Period"};
3046        case 1028554472: /*created*/ return new String[] {"dateTime"};
3047        case -1591951995: /*enterer*/ return new String[] {"Reference"};
3048        case 1459974547: /*issuerType*/ return new String[] {"CodeableConcept"};
3049        case 1144026207: /*paymentIssuer*/ return new String[] {"Reference"};
3050        case 1095692943: /*request*/ return new String[] {"Reference"};
3051        case 693934258: /*requestor*/ return new String[] {"Reference"};
3052        case -1106507950: /*outcome*/ return new String[] {"code"};
3053        case 583380919: /*disposition*/ return new String[] {"string"};
3054        case 3076014: /*date*/ return new String[] {"date"};
3055        case 1901043637: /*location*/ return new String[] {"Reference"};
3056        case -1077554975: /*method*/ return new String[] {"CodeableConcept"};
3057        case -271889833: /*cardBrand*/ return new String[] {"string"};
3058        case -1011205162: /*accountNumber*/ return new String[] {"string"};
3059        case -668811523: /*expirationDate*/ return new String[] {"date"};
3060        case -1094759278: /*processor*/ return new String[] {"string"};
3061        case 744563316: /*referenceNumber*/ return new String[] {"string"};
3062        case -1385570183: /*authorization*/ return new String[] {"string"};
3063        case 1815344299: /*tenderedAmount*/ return new String[] {"Money"};
3064        case -797236473: /*returnedAmount*/ return new String[] {"Money"};
3065        case -1413853096: /*amount*/ return new String[] {"Money"};
3066        case 1555852111: /*paymentIdentifier*/ return new String[] {"Identifier"};
3067        case -1912450848: /*allocation*/ return new String[] {};
3068        case 473181393: /*formCode*/ return new String[] {"CodeableConcept"};
3069        case 202339073: /*processNote*/ return new String[] {};
3070        default: return super.getTypesForProperty(hash, name);
3071        }
3072
3073      }
3074
3075      @Override
3076      public Base addChild(String name) throws FHIRException {
3077        if (name.equals("identifier")) {
3078          return addIdentifier();
3079        }
3080        else if (name.equals("type")) {
3081          this.type = new CodeableConcept();
3082          return this.type;
3083        }
3084        else if (name.equals("status")) {
3085          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.status");
3086        }
3087        else if (name.equals("kind")) {
3088          this.kind = new CodeableConcept();
3089          return this.kind;
3090        }
3091        else if (name.equals("period")) {
3092          this.period = new Period();
3093          return this.period;
3094        }
3095        else if (name.equals("created")) {
3096          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.created");
3097        }
3098        else if (name.equals("enterer")) {
3099          this.enterer = new Reference();
3100          return this.enterer;
3101        }
3102        else if (name.equals("issuerType")) {
3103          this.issuerType = new CodeableConcept();
3104          return this.issuerType;
3105        }
3106        else if (name.equals("paymentIssuer")) {
3107          this.paymentIssuer = new Reference();
3108          return this.paymentIssuer;
3109        }
3110        else if (name.equals("request")) {
3111          this.request = new Reference();
3112          return this.request;
3113        }
3114        else if (name.equals("requestor")) {
3115          this.requestor = new Reference();
3116          return this.requestor;
3117        }
3118        else if (name.equals("outcome")) {
3119          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.outcome");
3120        }
3121        else if (name.equals("disposition")) {
3122          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.disposition");
3123        }
3124        else if (name.equals("date")) {
3125          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.date");
3126        }
3127        else if (name.equals("location")) {
3128          this.location = new Reference();
3129          return this.location;
3130        }
3131        else if (name.equals("method")) {
3132          this.method = new CodeableConcept();
3133          return this.method;
3134        }
3135        else if (name.equals("cardBrand")) {
3136          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.cardBrand");
3137        }
3138        else if (name.equals("accountNumber")) {
3139          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.accountNumber");
3140        }
3141        else if (name.equals("expirationDate")) {
3142          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.expirationDate");
3143        }
3144        else if (name.equals("processor")) {
3145          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.processor");
3146        }
3147        else if (name.equals("referenceNumber")) {
3148          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.referenceNumber");
3149        }
3150        else if (name.equals("authorization")) {
3151          throw new FHIRException("Cannot call addChild on a singleton property PaymentReconciliation.authorization");
3152        }
3153        else if (name.equals("tenderedAmount")) {
3154          this.tenderedAmount = new Money();
3155          return this.tenderedAmount;
3156        }
3157        else if (name.equals("returnedAmount")) {
3158          this.returnedAmount = new Money();
3159          return this.returnedAmount;
3160        }
3161        else if (name.equals("amount")) {
3162          this.amount = new Money();
3163          return this.amount;
3164        }
3165        else if (name.equals("paymentIdentifier")) {
3166          this.paymentIdentifier = new Identifier();
3167          return this.paymentIdentifier;
3168        }
3169        else if (name.equals("allocation")) {
3170          return addAllocation();
3171        }
3172        else if (name.equals("formCode")) {
3173          this.formCode = new CodeableConcept();
3174          return this.formCode;
3175        }
3176        else if (name.equals("processNote")) {
3177          return addProcessNote();
3178        }
3179        else
3180          return super.addChild(name);
3181      }
3182
3183  public String fhirType() {
3184    return "PaymentReconciliation";
3185
3186  }
3187
3188      public PaymentReconciliation copy() {
3189        PaymentReconciliation dst = new PaymentReconciliation();
3190        copyValues(dst);
3191        return dst;
3192      }
3193
3194      public void copyValues(PaymentReconciliation dst) {
3195        super.copyValues(dst);
3196        if (identifier != null) {
3197          dst.identifier = new ArrayList<Identifier>();
3198          for (Identifier i : identifier)
3199            dst.identifier.add(i.copy());
3200        };
3201        dst.type = type == null ? null : type.copy();
3202        dst.status = status == null ? null : status.copy();
3203        dst.kind = kind == null ? null : kind.copy();
3204        dst.period = period == null ? null : period.copy();
3205        dst.created = created == null ? null : created.copy();
3206        dst.enterer = enterer == null ? null : enterer.copy();
3207        dst.issuerType = issuerType == null ? null : issuerType.copy();
3208        dst.paymentIssuer = paymentIssuer == null ? null : paymentIssuer.copy();
3209        dst.request = request == null ? null : request.copy();
3210        dst.requestor = requestor == null ? null : requestor.copy();
3211        dst.outcome = outcome == null ? null : outcome.copy();
3212        dst.disposition = disposition == null ? null : disposition.copy();
3213        dst.date = date == null ? null : date.copy();
3214        dst.location = location == null ? null : location.copy();
3215        dst.method = method == null ? null : method.copy();
3216        dst.cardBrand = cardBrand == null ? null : cardBrand.copy();
3217        dst.accountNumber = accountNumber == null ? null : accountNumber.copy();
3218        dst.expirationDate = expirationDate == null ? null : expirationDate.copy();
3219        dst.processor = processor == null ? null : processor.copy();
3220        dst.referenceNumber = referenceNumber == null ? null : referenceNumber.copy();
3221        dst.authorization = authorization == null ? null : authorization.copy();
3222        dst.tenderedAmount = tenderedAmount == null ? null : tenderedAmount.copy();
3223        dst.returnedAmount = returnedAmount == null ? null : returnedAmount.copy();
3224        dst.amount = amount == null ? null : amount.copy();
3225        dst.paymentIdentifier = paymentIdentifier == null ? null : paymentIdentifier.copy();
3226        if (allocation != null) {
3227          dst.allocation = new ArrayList<PaymentReconciliationAllocationComponent>();
3228          for (PaymentReconciliationAllocationComponent i : allocation)
3229            dst.allocation.add(i.copy());
3230        };
3231        dst.formCode = formCode == null ? null : formCode.copy();
3232        if (processNote != null) {
3233          dst.processNote = new ArrayList<NotesComponent>();
3234          for (NotesComponent i : processNote)
3235            dst.processNote.add(i.copy());
3236        };
3237      }
3238
3239      protected PaymentReconciliation typedCopy() {
3240        return copy();
3241      }
3242
3243      @Override
3244      public boolean equalsDeep(Base other_) {
3245        if (!super.equalsDeep(other_))
3246          return false;
3247        if (!(other_ instanceof PaymentReconciliation))
3248          return false;
3249        PaymentReconciliation o = (PaymentReconciliation) other_;
3250        return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(status, o.status, true)
3251           && compareDeep(kind, o.kind, true) && compareDeep(period, o.period, true) && compareDeep(created, o.created, true)
3252           && compareDeep(enterer, o.enterer, true) && compareDeep(issuerType, o.issuerType, true) && compareDeep(paymentIssuer, o.paymentIssuer, true)
3253           && compareDeep(request, o.request, true) && compareDeep(requestor, o.requestor, true) && compareDeep(outcome, o.outcome, true)
3254           && compareDeep(disposition, o.disposition, true) && compareDeep(date, o.date, true) && compareDeep(location, o.location, true)
3255           && compareDeep(method, o.method, true) && compareDeep(cardBrand, o.cardBrand, true) && compareDeep(accountNumber, o.accountNumber, true)
3256           && compareDeep(expirationDate, o.expirationDate, true) && compareDeep(processor, o.processor, true)
3257           && compareDeep(referenceNumber, o.referenceNumber, true) && compareDeep(authorization, o.authorization, true)
3258           && compareDeep(tenderedAmount, o.tenderedAmount, true) && compareDeep(returnedAmount, o.returnedAmount, true)
3259           && compareDeep(amount, o.amount, true) && compareDeep(paymentIdentifier, o.paymentIdentifier, true)
3260           && compareDeep(allocation, o.allocation, true) && compareDeep(formCode, o.formCode, true) && compareDeep(processNote, o.processNote, true)
3261          ;
3262      }
3263
3264      @Override
3265      public boolean equalsShallow(Base other_) {
3266        if (!super.equalsShallow(other_))
3267          return false;
3268        if (!(other_ instanceof PaymentReconciliation))
3269          return false;
3270        PaymentReconciliation o = (PaymentReconciliation) other_;
3271        return compareValues(status, o.status, true) && compareValues(created, o.created, true) && compareValues(outcome, o.outcome, true)
3272           && compareValues(disposition, o.disposition, true) && compareValues(date, o.date, true) && compareValues(cardBrand, o.cardBrand, true)
3273           && compareValues(accountNumber, o.accountNumber, true) && compareValues(expirationDate, o.expirationDate, true)
3274           && compareValues(processor, o.processor, true) && compareValues(referenceNumber, o.referenceNumber, true)
3275           && compareValues(authorization, o.authorization, true);
3276      }
3277
3278      public boolean isEmpty() {
3279        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, status
3280          , kind, period, created, enterer, issuerType, paymentIssuer, request, requestor
3281          , outcome, disposition, date, location, method, cardBrand, accountNumber, expirationDate
3282          , processor, referenceNumber, authorization, tenderedAmount, returnedAmount, amount
3283          , paymentIdentifier, allocation, formCode, processNote);
3284      }
3285
3286  @Override
3287  public ResourceType getResourceType() {
3288    return ResourceType.PaymentReconciliation;
3289   }
3290
3291 /**
3292   * Search parameter: <b>allocation-account</b>
3293   * <p>
3294   * Description: <b>The account to which payment or adjustment was applied.</b><br>
3295   * Type: <b>reference</b><br>
3296   * Path: <b>PaymentReconciliation.allocation.account</b><br>
3297   * </p>
3298   */
3299  @SearchParamDefinition(name="allocation-account", path="PaymentReconciliation.allocation.account", description="The account to which payment or adjustment was applied.", type="reference", target={Account.class } )
3300  public static final String SP_ALLOCATION_ACCOUNT = "allocation-account";
3301 /**
3302   * <b>Fluent Client</b> search parameter constant for <b>allocation-account</b>
3303   * <p>
3304   * Description: <b>The account to which payment or adjustment was applied.</b><br>
3305   * Type: <b>reference</b><br>
3306   * Path: <b>PaymentReconciliation.allocation.account</b><br>
3307   * </p>
3308   */
3309  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ALLOCATION_ACCOUNT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ALLOCATION_ACCOUNT);
3310
3311/**
3312   * Constant for fluent queries to be used to add include statements. Specifies
3313   * the path value of "<b>PaymentReconciliation:allocation-account</b>".
3314   */
3315  public static final ca.uhn.fhir.model.api.Include INCLUDE_ALLOCATION_ACCOUNT = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:allocation-account").toLocked();
3316
3317 /**
3318   * Search parameter: <b>allocation-encounter</b>
3319   * <p>
3320   * Description: <b>The encounter to which payment or adjustment was applied.</b><br>
3321   * Type: <b>reference</b><br>
3322   * Path: <b>PaymentReconciliation.allocation.encounter</b><br>
3323   * </p>
3324   */
3325  @SearchParamDefinition(name="allocation-encounter", path="PaymentReconciliation.allocation.encounter", description="The encounter to which payment or adjustment was applied.", type="reference", target={Encounter.class } )
3326  public static final String SP_ALLOCATION_ENCOUNTER = "allocation-encounter";
3327 /**
3328   * <b>Fluent Client</b> search parameter constant for <b>allocation-encounter</b>
3329   * <p>
3330   * Description: <b>The encounter to which payment or adjustment was applied.</b><br>
3331   * Type: <b>reference</b><br>
3332   * Path: <b>PaymentReconciliation.allocation.encounter</b><br>
3333   * </p>
3334   */
3335  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ALLOCATION_ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ALLOCATION_ENCOUNTER);
3336
3337/**
3338   * Constant for fluent queries to be used to add include statements. Specifies
3339   * the path value of "<b>PaymentReconciliation:allocation-encounter</b>".
3340   */
3341  public static final ca.uhn.fhir.model.api.Include INCLUDE_ALLOCATION_ENCOUNTER = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:allocation-encounter").toLocked();
3342
3343 /**
3344   * Search parameter: <b>created</b>
3345   * <p>
3346   * Description: <b>The creation date</b><br>
3347   * Type: <b>date</b><br>
3348   * Path: <b>PaymentReconciliation.created</b><br>
3349   * </p>
3350   */
3351  @SearchParamDefinition(name="created", path="PaymentReconciliation.created", description="The creation date", type="date" )
3352  public static final String SP_CREATED = "created";
3353 /**
3354   * <b>Fluent Client</b> search parameter constant for <b>created</b>
3355   * <p>
3356   * Description: <b>The creation date</b><br>
3357   * Type: <b>date</b><br>
3358   * Path: <b>PaymentReconciliation.created</b><br>
3359   * </p>
3360   */
3361  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED);
3362
3363 /**
3364   * Search parameter: <b>disposition</b>
3365   * <p>
3366   * Description: <b>The contents of the disposition message</b><br>
3367   * Type: <b>string</b><br>
3368   * Path: <b>PaymentReconciliation.disposition</b><br>
3369   * </p>
3370   */
3371  @SearchParamDefinition(name="disposition", path="PaymentReconciliation.disposition", description="The contents of the disposition message", type="string" )
3372  public static final String SP_DISPOSITION = "disposition";
3373 /**
3374   * <b>Fluent Client</b> search parameter constant for <b>disposition</b>
3375   * <p>
3376   * Description: <b>The contents of the disposition message</b><br>
3377   * Type: <b>string</b><br>
3378   * Path: <b>PaymentReconciliation.disposition</b><br>
3379   * </p>
3380   */
3381  public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION);
3382
3383 /**
3384   * Search parameter: <b>identifier</b>
3385   * <p>
3386   * Description: <b>The business identifier of the ExplanationOfBenefit</b><br>
3387   * Type: <b>token</b><br>
3388   * Path: <b>PaymentReconciliation.identifier</b><br>
3389   * </p>
3390   */
3391  @SearchParamDefinition(name="identifier", path="PaymentReconciliation.identifier", description="The business identifier of the ExplanationOfBenefit", type="token" )
3392  public static final String SP_IDENTIFIER = "identifier";
3393 /**
3394   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3395   * <p>
3396   * Description: <b>The business identifier of the ExplanationOfBenefit</b><br>
3397   * Type: <b>token</b><br>
3398   * Path: <b>PaymentReconciliation.identifier</b><br>
3399   * </p>
3400   */
3401  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3402
3403 /**
3404   * Search parameter: <b>outcome</b>
3405   * <p>
3406   * Description: <b>The processing outcome</b><br>
3407   * Type: <b>token</b><br>
3408   * Path: <b>PaymentReconciliation.outcome</b><br>
3409   * </p>
3410   */
3411  @SearchParamDefinition(name="outcome", path="PaymentReconciliation.outcome", description="The processing outcome", type="token" )
3412  public static final String SP_OUTCOME = "outcome";
3413 /**
3414   * <b>Fluent Client</b> search parameter constant for <b>outcome</b>
3415   * <p>
3416   * Description: <b>The processing outcome</b><br>
3417   * Type: <b>token</b><br>
3418   * Path: <b>PaymentReconciliation.outcome</b><br>
3419   * </p>
3420   */
3421  public static final ca.uhn.fhir.rest.gclient.TokenClientParam OUTCOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_OUTCOME);
3422
3423 /**
3424   * Search parameter: <b>payment-issuer</b>
3425   * <p>
3426   * Description: <b>The organization which generated this resource</b><br>
3427   * Type: <b>reference</b><br>
3428   * Path: <b>PaymentReconciliation.paymentIssuer</b><br>
3429   * </p>
3430   */
3431  @SearchParamDefinition(name="payment-issuer", path="PaymentReconciliation.paymentIssuer", description="The organization which generated this resource", type="reference", target={Organization.class, Patient.class, RelatedPerson.class } )
3432  public static final String SP_PAYMENT_ISSUER = "payment-issuer";
3433 /**
3434   * <b>Fluent Client</b> search parameter constant for <b>payment-issuer</b>
3435   * <p>
3436   * Description: <b>The organization which generated this resource</b><br>
3437   * Type: <b>reference</b><br>
3438   * Path: <b>PaymentReconciliation.paymentIssuer</b><br>
3439   * </p>
3440   */
3441  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PAYMENT_ISSUER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PAYMENT_ISSUER);
3442
3443/**
3444   * Constant for fluent queries to be used to add include statements. Specifies
3445   * the path value of "<b>PaymentReconciliation:payment-issuer</b>".
3446   */
3447  public static final ca.uhn.fhir.model.api.Include INCLUDE_PAYMENT_ISSUER = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:payment-issuer").toLocked();
3448
3449 /**
3450   * Search parameter: <b>request</b>
3451   * <p>
3452   * Description: <b>The reference to the claim</b><br>
3453   * Type: <b>reference</b><br>
3454   * Path: <b>PaymentReconciliation.request</b><br>
3455   * </p>
3456   */
3457  @SearchParamDefinition(name="request", path="PaymentReconciliation.request", description="The reference to the claim", type="reference", target={Task.class } )
3458  public static final String SP_REQUEST = "request";
3459 /**
3460   * <b>Fluent Client</b> search parameter constant for <b>request</b>
3461   * <p>
3462   * Description: <b>The reference to the claim</b><br>
3463   * Type: <b>reference</b><br>
3464   * Path: <b>PaymentReconciliation.request</b><br>
3465   * </p>
3466   */
3467  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST);
3468
3469/**
3470   * Constant for fluent queries to be used to add include statements. Specifies
3471   * the path value of "<b>PaymentReconciliation:request</b>".
3472   */
3473  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:request").toLocked();
3474
3475 /**
3476   * Search parameter: <b>requestor</b>
3477   * <p>
3478   * Description: <b>The reference to the provider who submitted the claim</b><br>
3479   * Type: <b>reference</b><br>
3480   * Path: <b>PaymentReconciliation.requestor</b><br>
3481   * </p>
3482   */
3483  @SearchParamDefinition(name="requestor", path="PaymentReconciliation.requestor", description="The reference to the provider who submitted the claim", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Organization.class, Practitioner.class, PractitionerRole.class } )
3484  public static final String SP_REQUESTOR = "requestor";
3485 /**
3486   * <b>Fluent Client</b> search parameter constant for <b>requestor</b>
3487   * <p>
3488   * Description: <b>The reference to the provider who submitted the claim</b><br>
3489   * Type: <b>reference</b><br>
3490   * Path: <b>PaymentReconciliation.requestor</b><br>
3491   * </p>
3492   */
3493  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTOR);
3494
3495/**
3496   * Constant for fluent queries to be used to add include statements. Specifies
3497   * the path value of "<b>PaymentReconciliation:requestor</b>".
3498   */
3499  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTOR = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:requestor").toLocked();
3500
3501 /**
3502   * Search parameter: <b>status</b>
3503   * <p>
3504   * Description: <b>The status of the payment reconciliation</b><br>
3505   * Type: <b>token</b><br>
3506   * Path: <b>PaymentReconciliation.status</b><br>
3507   * </p>
3508   */
3509  @SearchParamDefinition(name="status", path="PaymentReconciliation.status", description="The status of the payment reconciliation", type="token" )
3510  public static final String SP_STATUS = "status";
3511 /**
3512   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3513   * <p>
3514   * Description: <b>The status of the payment reconciliation</b><br>
3515   * Type: <b>token</b><br>
3516   * Path: <b>PaymentReconciliation.status</b><br>
3517   * </p>
3518   */
3519  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3520
3521
3522}
3523