001package org.hl7.fhir.r4b.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 Fri, Dec 31, 2021 05:58+1100 for FHIR v4.3.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r4b.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    @Block()
057    public static class DetailsComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * Unique identifier for the current payment item for the referenced payable.
060         */
061        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=false)
062        @Description(shortDefinition="Business identifier of the payment detail", formalDefinition="Unique identifier for the current payment item for the referenced payable." )
063        protected Identifier identifier;
064
065        /**
066         * Unique identifier for the prior payment item for the referenced payable.
067         */
068        @Child(name = "predecessor", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=false)
069        @Description(shortDefinition="Business identifier of the prior payment detail", formalDefinition="Unique identifier for the prior payment item for the referenced payable." )
070        protected Identifier predecessor;
071
072        /**
073         * Code to indicate the nature of the payment.
074         */
075        @Child(name = "type", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=false)
076        @Description(shortDefinition="Category of payment", formalDefinition="Code to indicate the nature of the payment." )
077        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payment-type")
078        protected CodeableConcept type;
079
080        /**
081         * A resource, such as a Claim, the evaluation of which could lead to payment.
082         */
083        @Child(name = "request", type = {Reference.class}, order=4, min=0, max=1, modifier=false, summary=false)
084        @Description(shortDefinition="Request giving rise to the payment", formalDefinition="A resource, such as a Claim, the evaluation of which could lead to payment." )
085        protected Reference request;
086
087        /**
088         * The party which submitted the claim or financial transaction.
089         */
090        @Child(name = "submitter", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=false)
091        @Description(shortDefinition="Submitter of the request", formalDefinition="The party which submitted the claim or financial transaction." )
092        protected Reference submitter;
093
094        /**
095         * A resource, such as a ClaimResponse, which contains a commitment to payment.
096         */
097        @Child(name = "response", type = {Reference.class}, order=6, min=0, max=1, modifier=false, summary=false)
098        @Description(shortDefinition="Response committing to a payment", formalDefinition="A resource, such as a ClaimResponse, which contains a commitment to payment." )
099        protected Reference response;
100
101        /**
102         * The date from the response resource containing a commitment to pay.
103         */
104        @Child(name = "date", type = {DateType.class}, order=7, min=0, max=1, modifier=false, summary=false)
105        @Description(shortDefinition="Date of commitment to pay", formalDefinition="The date from the response resource containing a commitment to pay." )
106        protected DateType date;
107
108        /**
109         * A reference to the individual who is responsible for inquiries regarding the response and its payment.
110         */
111        @Child(name = "responsible", type = {PractitionerRole.class}, order=8, min=0, max=1, modifier=false, summary=false)
112        @Description(shortDefinition="Contact for the response", formalDefinition="A reference to the individual who is responsible for inquiries regarding the response and its payment." )
113        protected Reference responsible;
114
115        /**
116         * The party which is receiving the payment.
117         */
118        @Child(name = "payee", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=9, min=0, max=1, modifier=false, summary=false)
119        @Description(shortDefinition="Recipient of the payment", formalDefinition="The party which is receiving the payment." )
120        protected Reference payee;
121
122        /**
123         * The monetary amount allocated from the total payment to the payable.
124         */
125        @Child(name = "amount", type = {Money.class}, order=10, min=0, max=1, modifier=false, summary=false)
126        @Description(shortDefinition="Amount allocated to this payable", formalDefinition="The monetary amount allocated from the total payment to the payable." )
127        protected Money amount;
128
129        private static final long serialVersionUID = 1747960963L;
130
131    /**
132     * Constructor
133     */
134      public DetailsComponent() {
135        super();
136      }
137
138    /**
139     * Constructor
140     */
141      public DetailsComponent(CodeableConcept type) {
142        super();
143        this.setType(type);
144      }
145
146        /**
147         * @return {@link #identifier} (Unique identifier for the current payment item for the referenced payable.)
148         */
149        public Identifier getIdentifier() { 
150          if (this.identifier == null)
151            if (Configuration.errorOnAutoCreate())
152              throw new Error("Attempt to auto-create DetailsComponent.identifier");
153            else if (Configuration.doAutoCreate())
154              this.identifier = new Identifier(); // cc
155          return this.identifier;
156        }
157
158        public boolean hasIdentifier() { 
159          return this.identifier != null && !this.identifier.isEmpty();
160        }
161
162        /**
163         * @param value {@link #identifier} (Unique identifier for the current payment item for the referenced payable.)
164         */
165        public DetailsComponent setIdentifier(Identifier value) { 
166          this.identifier = value;
167          return this;
168        }
169
170        /**
171         * @return {@link #predecessor} (Unique identifier for the prior payment item for the referenced payable.)
172         */
173        public Identifier getPredecessor() { 
174          if (this.predecessor == null)
175            if (Configuration.errorOnAutoCreate())
176              throw new Error("Attempt to auto-create DetailsComponent.predecessor");
177            else if (Configuration.doAutoCreate())
178              this.predecessor = new Identifier(); // cc
179          return this.predecessor;
180        }
181
182        public boolean hasPredecessor() { 
183          return this.predecessor != null && !this.predecessor.isEmpty();
184        }
185
186        /**
187         * @param value {@link #predecessor} (Unique identifier for the prior payment item for the referenced payable.)
188         */
189        public DetailsComponent setPredecessor(Identifier value) { 
190          this.predecessor = value;
191          return this;
192        }
193
194        /**
195         * @return {@link #type} (Code to indicate the nature of the payment.)
196         */
197        public CodeableConcept getType() { 
198          if (this.type == null)
199            if (Configuration.errorOnAutoCreate())
200              throw new Error("Attempt to auto-create DetailsComponent.type");
201            else if (Configuration.doAutoCreate())
202              this.type = new CodeableConcept(); // cc
203          return this.type;
204        }
205
206        public boolean hasType() { 
207          return this.type != null && !this.type.isEmpty();
208        }
209
210        /**
211         * @param value {@link #type} (Code to indicate the nature of the payment.)
212         */
213        public DetailsComponent setType(CodeableConcept value) { 
214          this.type = value;
215          return this;
216        }
217
218        /**
219         * @return {@link #request} (A resource, such as a Claim, the evaluation of which could lead to payment.)
220         */
221        public Reference getRequest() { 
222          if (this.request == null)
223            if (Configuration.errorOnAutoCreate())
224              throw new Error("Attempt to auto-create DetailsComponent.request");
225            else if (Configuration.doAutoCreate())
226              this.request = new Reference(); // cc
227          return this.request;
228        }
229
230        public boolean hasRequest() { 
231          return this.request != null && !this.request.isEmpty();
232        }
233
234        /**
235         * @param value {@link #request} (A resource, such as a Claim, the evaluation of which could lead to payment.)
236         */
237        public DetailsComponent setRequest(Reference value) { 
238          this.request = value;
239          return this;
240        }
241
242        /**
243         * @return {@link #submitter} (The party which submitted the claim or financial transaction.)
244         */
245        public Reference getSubmitter() { 
246          if (this.submitter == null)
247            if (Configuration.errorOnAutoCreate())
248              throw new Error("Attempt to auto-create DetailsComponent.submitter");
249            else if (Configuration.doAutoCreate())
250              this.submitter = new Reference(); // cc
251          return this.submitter;
252        }
253
254        public boolean hasSubmitter() { 
255          return this.submitter != null && !this.submitter.isEmpty();
256        }
257
258        /**
259         * @param value {@link #submitter} (The party which submitted the claim or financial transaction.)
260         */
261        public DetailsComponent setSubmitter(Reference value) { 
262          this.submitter = value;
263          return this;
264        }
265
266        /**
267         * @return {@link #response} (A resource, such as a ClaimResponse, which contains a commitment to payment.)
268         */
269        public Reference getResponse() { 
270          if (this.response == null)
271            if (Configuration.errorOnAutoCreate())
272              throw new Error("Attempt to auto-create DetailsComponent.response");
273            else if (Configuration.doAutoCreate())
274              this.response = new Reference(); // cc
275          return this.response;
276        }
277
278        public boolean hasResponse() { 
279          return this.response != null && !this.response.isEmpty();
280        }
281
282        /**
283         * @param value {@link #response} (A resource, such as a ClaimResponse, which contains a commitment to payment.)
284         */
285        public DetailsComponent setResponse(Reference value) { 
286          this.response = value;
287          return this;
288        }
289
290        /**
291         * @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
292         */
293        public DateType getDateElement() { 
294          if (this.date == null)
295            if (Configuration.errorOnAutoCreate())
296              throw new Error("Attempt to auto-create DetailsComponent.date");
297            else if (Configuration.doAutoCreate())
298              this.date = new DateType(); // bb
299          return this.date;
300        }
301
302        public boolean hasDateElement() { 
303          return this.date != null && !this.date.isEmpty();
304        }
305
306        public boolean hasDate() { 
307          return this.date != null && !this.date.isEmpty();
308        }
309
310        /**
311         * @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
312         */
313        public DetailsComponent setDateElement(DateType value) { 
314          this.date = value;
315          return this;
316        }
317
318        /**
319         * @return The date from the response resource containing a commitment to pay.
320         */
321        public Date getDate() { 
322          return this.date == null ? null : this.date.getValue();
323        }
324
325        /**
326         * @param value The date from the response resource containing a commitment to pay.
327         */
328        public DetailsComponent setDate(Date value) { 
329          if (value == null)
330            this.date = null;
331          else {
332            if (this.date == null)
333              this.date = new DateType();
334            this.date.setValue(value);
335          }
336          return this;
337        }
338
339        /**
340         * @return {@link #responsible} (A reference to the individual who is responsible for inquiries regarding the response and its payment.)
341         */
342        public Reference getResponsible() { 
343          if (this.responsible == null)
344            if (Configuration.errorOnAutoCreate())
345              throw new Error("Attempt to auto-create DetailsComponent.responsible");
346            else if (Configuration.doAutoCreate())
347              this.responsible = new Reference(); // cc
348          return this.responsible;
349        }
350
351        public boolean hasResponsible() { 
352          return this.responsible != null && !this.responsible.isEmpty();
353        }
354
355        /**
356         * @param value {@link #responsible} (A reference to the individual who is responsible for inquiries regarding the response and its payment.)
357         */
358        public DetailsComponent setResponsible(Reference value) { 
359          this.responsible = value;
360          return this;
361        }
362
363        /**
364         * @return {@link #payee} (The party which is receiving the payment.)
365         */
366        public Reference getPayee() { 
367          if (this.payee == null)
368            if (Configuration.errorOnAutoCreate())
369              throw new Error("Attempt to auto-create DetailsComponent.payee");
370            else if (Configuration.doAutoCreate())
371              this.payee = new Reference(); // cc
372          return this.payee;
373        }
374
375        public boolean hasPayee() { 
376          return this.payee != null && !this.payee.isEmpty();
377        }
378
379        /**
380         * @param value {@link #payee} (The party which is receiving the payment.)
381         */
382        public DetailsComponent setPayee(Reference value) { 
383          this.payee = value;
384          return this;
385        }
386
387        /**
388         * @return {@link #amount} (The monetary amount allocated from the total payment to the payable.)
389         */
390        public Money getAmount() { 
391          if (this.amount == null)
392            if (Configuration.errorOnAutoCreate())
393              throw new Error("Attempt to auto-create DetailsComponent.amount");
394            else if (Configuration.doAutoCreate())
395              this.amount = new Money(); // cc
396          return this.amount;
397        }
398
399        public boolean hasAmount() { 
400          return this.amount != null && !this.amount.isEmpty();
401        }
402
403        /**
404         * @param value {@link #amount} (The monetary amount allocated from the total payment to the payable.)
405         */
406        public DetailsComponent setAmount(Money value) { 
407          this.amount = value;
408          return this;
409        }
410
411        protected void listChildren(List<Property> children) {
412          super.listChildren(children);
413          children.add(new Property("identifier", "Identifier", "Unique identifier for the current payment item for the referenced payable.", 0, 1, identifier));
414          children.add(new Property("predecessor", "Identifier", "Unique identifier for the prior payment item for the referenced payable.", 0, 1, predecessor));
415          children.add(new Property("type", "CodeableConcept", "Code to indicate the nature of the payment.", 0, 1, type));
416          children.add(new Property("request", "Reference(Any)", "A resource, such as a Claim, the evaluation of which could lead to payment.", 0, 1, request));
417          children.add(new Property("submitter", "Reference(Practitioner|PractitionerRole|Organization)", "The party which submitted the claim or financial transaction.", 0, 1, submitter));
418          children.add(new Property("response", "Reference(Any)", "A resource, such as a ClaimResponse, which contains a commitment to payment.", 0, 1, response));
419          children.add(new Property("date", "date", "The date from the response resource containing a commitment to pay.", 0, 1, date));
420          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));
421          children.add(new Property("payee", "Reference(Practitioner|PractitionerRole|Organization)", "The party which is receiving the payment.", 0, 1, payee));
422          children.add(new Property("amount", "Money", "The monetary amount allocated from the total payment to the payable.", 0, 1, amount));
423        }
424
425        @Override
426        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
427          switch (_hash) {
428          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique identifier for the current payment item for the referenced payable.", 0, 1, identifier);
429          case -1925032183: /*predecessor*/  return new Property("predecessor", "Identifier", "Unique identifier for the prior payment item for the referenced payable.", 0, 1, predecessor);
430          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Code to indicate the nature of the payment.", 0, 1, type);
431          case 1095692943: /*request*/  return new Property("request", "Reference(Any)", "A resource, such as a Claim, the evaluation of which could lead to payment.", 0, 1, request);
432          case 348678409: /*submitter*/  return new Property("submitter", "Reference(Practitioner|PractitionerRole|Organization)", "The party which submitted the claim or financial transaction.", 0, 1, submitter);
433          case -340323263: /*response*/  return new Property("response", "Reference(Any)", "A resource, such as a ClaimResponse, which contains a commitment to payment.", 0, 1, response);
434          case 3076014: /*date*/  return new Property("date", "date", "The date from the response resource containing a commitment to pay.", 0, 1, date);
435          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);
436          case 106443592: /*payee*/  return new Property("payee", "Reference(Practitioner|PractitionerRole|Organization)", "The party which is receiving the payment.", 0, 1, payee);
437          case -1413853096: /*amount*/  return new Property("amount", "Money", "The monetary amount allocated from the total payment to the payable.", 0, 1, amount);
438          default: return super.getNamedProperty(_hash, _name, _checkValid);
439          }
440
441        }
442
443      @Override
444      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
445        switch (hash) {
446        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
447        case -1925032183: /*predecessor*/ return this.predecessor == null ? new Base[0] : new Base[] {this.predecessor}; // Identifier
448        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
449        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference
450        case 348678409: /*submitter*/ return this.submitter == null ? new Base[0] : new Base[] {this.submitter}; // Reference
451        case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Reference
452        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType
453        case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // Reference
454        case 106443592: /*payee*/ return this.payee == null ? new Base[0] : new Base[] {this.payee}; // Reference
455        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
456        default: return super.getProperty(hash, name, checkValid);
457        }
458
459      }
460
461      @Override
462      public Base setProperty(int hash, String name, Base value) throws FHIRException {
463        switch (hash) {
464        case -1618432855: // identifier
465          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
466          return value;
467        case -1925032183: // predecessor
468          this.predecessor = TypeConvertor.castToIdentifier(value); // Identifier
469          return value;
470        case 3575610: // type
471          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
472          return value;
473        case 1095692943: // request
474          this.request = TypeConvertor.castToReference(value); // Reference
475          return value;
476        case 348678409: // submitter
477          this.submitter = TypeConvertor.castToReference(value); // Reference
478          return value;
479        case -340323263: // response
480          this.response = TypeConvertor.castToReference(value); // Reference
481          return value;
482        case 3076014: // date
483          this.date = TypeConvertor.castToDate(value); // DateType
484          return value;
485        case 1847674614: // responsible
486          this.responsible = TypeConvertor.castToReference(value); // Reference
487          return value;
488        case 106443592: // payee
489          this.payee = TypeConvertor.castToReference(value); // Reference
490          return value;
491        case -1413853096: // amount
492          this.amount = TypeConvertor.castToMoney(value); // Money
493          return value;
494        default: return super.setProperty(hash, name, value);
495        }
496
497      }
498
499      @Override
500      public Base setProperty(String name, Base value) throws FHIRException {
501        if (name.equals("identifier")) {
502          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
503        } else if (name.equals("predecessor")) {
504          this.predecessor = TypeConvertor.castToIdentifier(value); // Identifier
505        } else if (name.equals("type")) {
506          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
507        } else if (name.equals("request")) {
508          this.request = TypeConvertor.castToReference(value); // Reference
509        } else if (name.equals("submitter")) {
510          this.submitter = TypeConvertor.castToReference(value); // Reference
511        } else if (name.equals("response")) {
512          this.response = TypeConvertor.castToReference(value); // Reference
513        } else if (name.equals("date")) {
514          this.date = TypeConvertor.castToDate(value); // DateType
515        } else if (name.equals("responsible")) {
516          this.responsible = TypeConvertor.castToReference(value); // Reference
517        } else if (name.equals("payee")) {
518          this.payee = TypeConvertor.castToReference(value); // Reference
519        } else if (name.equals("amount")) {
520          this.amount = TypeConvertor.castToMoney(value); // Money
521        } else
522          return super.setProperty(name, value);
523        return value;
524      }
525
526      @Override
527      public Base makeProperty(int hash, String name) throws FHIRException {
528        switch (hash) {
529        case -1618432855:  return getIdentifier();
530        case -1925032183:  return getPredecessor();
531        case 3575610:  return getType();
532        case 1095692943:  return getRequest();
533        case 348678409:  return getSubmitter();
534        case -340323263:  return getResponse();
535        case 3076014:  return getDateElement();
536        case 1847674614:  return getResponsible();
537        case 106443592:  return getPayee();
538        case -1413853096:  return getAmount();
539        default: return super.makeProperty(hash, name);
540        }
541
542      }
543
544      @Override
545      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
546        switch (hash) {
547        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
548        case -1925032183: /*predecessor*/ return new String[] {"Identifier"};
549        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
550        case 1095692943: /*request*/ return new String[] {"Reference"};
551        case 348678409: /*submitter*/ return new String[] {"Reference"};
552        case -340323263: /*response*/ return new String[] {"Reference"};
553        case 3076014: /*date*/ return new String[] {"date"};
554        case 1847674614: /*responsible*/ return new String[] {"Reference"};
555        case 106443592: /*payee*/ return new String[] {"Reference"};
556        case -1413853096: /*amount*/ return new String[] {"Money"};
557        default: return super.getTypesForProperty(hash, name);
558        }
559
560      }
561
562      @Override
563      public Base addChild(String name) throws FHIRException {
564        if (name.equals("identifier")) {
565          this.identifier = new Identifier();
566          return this.identifier;
567        }
568        else if (name.equals("predecessor")) {
569          this.predecessor = new Identifier();
570          return this.predecessor;
571        }
572        else if (name.equals("type")) {
573          this.type = new CodeableConcept();
574          return this.type;
575        }
576        else if (name.equals("request")) {
577          this.request = new Reference();
578          return this.request;
579        }
580        else if (name.equals("submitter")) {
581          this.submitter = new Reference();
582          return this.submitter;
583        }
584        else if (name.equals("response")) {
585          this.response = new Reference();
586          return this.response;
587        }
588        else if (name.equals("date")) {
589          throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.detail.date");
590        }
591        else if (name.equals("responsible")) {
592          this.responsible = new Reference();
593          return this.responsible;
594        }
595        else if (name.equals("payee")) {
596          this.payee = new Reference();
597          return this.payee;
598        }
599        else if (name.equals("amount")) {
600          this.amount = new Money();
601          return this.amount;
602        }
603        else
604          return super.addChild(name);
605      }
606
607      public DetailsComponent copy() {
608        DetailsComponent dst = new DetailsComponent();
609        copyValues(dst);
610        return dst;
611      }
612
613      public void copyValues(DetailsComponent dst) {
614        super.copyValues(dst);
615        dst.identifier = identifier == null ? null : identifier.copy();
616        dst.predecessor = predecessor == null ? null : predecessor.copy();
617        dst.type = type == null ? null : type.copy();
618        dst.request = request == null ? null : request.copy();
619        dst.submitter = submitter == null ? null : submitter.copy();
620        dst.response = response == null ? null : response.copy();
621        dst.date = date == null ? null : date.copy();
622        dst.responsible = responsible == null ? null : responsible.copy();
623        dst.payee = payee == null ? null : payee.copy();
624        dst.amount = amount == null ? null : amount.copy();
625      }
626
627      @Override
628      public boolean equalsDeep(Base other_) {
629        if (!super.equalsDeep(other_))
630          return false;
631        if (!(other_ instanceof DetailsComponent))
632          return false;
633        DetailsComponent o = (DetailsComponent) other_;
634        return compareDeep(identifier, o.identifier, true) && compareDeep(predecessor, o.predecessor, true)
635           && compareDeep(type, o.type, true) && compareDeep(request, o.request, true) && compareDeep(submitter, o.submitter, true)
636           && compareDeep(response, o.response, true) && compareDeep(date, o.date, true) && compareDeep(responsible, o.responsible, true)
637           && compareDeep(payee, o.payee, true) && compareDeep(amount, o.amount, true);
638      }
639
640      @Override
641      public boolean equalsShallow(Base other_) {
642        if (!super.equalsShallow(other_))
643          return false;
644        if (!(other_ instanceof DetailsComponent))
645          return false;
646        DetailsComponent o = (DetailsComponent) other_;
647        return compareValues(date, o.date, true);
648      }
649
650      public boolean isEmpty() {
651        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, predecessor, type
652          , request, submitter, response, date, responsible, payee, amount);
653      }
654
655  public String fhirType() {
656    return "PaymentReconciliation.detail";
657
658  }
659
660  }
661
662    @Block()
663    public static class NotesComponent extends BackboneElement implements IBaseBackboneElement {
664        /**
665         * The business purpose of the note text.
666         */
667        @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false)
668        @Description(shortDefinition="display | print | printoper", formalDefinition="The business purpose of the note text." )
669        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/note-type")
670        protected Enumeration<NoteType> type;
671
672        /**
673         * The explanation or description associated with the processing.
674         */
675        @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
676        @Description(shortDefinition="Note explanatory text", formalDefinition="The explanation or description associated with the processing." )
677        protected StringType text;
678
679        private static final long serialVersionUID = 529250161L;
680
681    /**
682     * Constructor
683     */
684      public NotesComponent() {
685        super();
686      }
687
688        /**
689         * @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
690         */
691        public Enumeration<NoteType> getTypeElement() { 
692          if (this.type == null)
693            if (Configuration.errorOnAutoCreate())
694              throw new Error("Attempt to auto-create NotesComponent.type");
695            else if (Configuration.doAutoCreate())
696              this.type = new Enumeration<NoteType>(new NoteTypeEnumFactory()); // bb
697          return this.type;
698        }
699
700        public boolean hasTypeElement() { 
701          return this.type != null && !this.type.isEmpty();
702        }
703
704        public boolean hasType() { 
705          return this.type != null && !this.type.isEmpty();
706        }
707
708        /**
709         * @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
710         */
711        public NotesComponent setTypeElement(Enumeration<NoteType> value) { 
712          this.type = value;
713          return this;
714        }
715
716        /**
717         * @return The business purpose of the note text.
718         */
719        public NoteType getType() { 
720          return this.type == null ? null : this.type.getValue();
721        }
722
723        /**
724         * @param value The business purpose of the note text.
725         */
726        public NotesComponent setType(NoteType value) { 
727          if (value == null)
728            this.type = null;
729          else {
730            if (this.type == null)
731              this.type = new Enumeration<NoteType>(new NoteTypeEnumFactory());
732            this.type.setValue(value);
733          }
734          return this;
735        }
736
737        /**
738         * @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
739         */
740        public StringType getTextElement() { 
741          if (this.text == null)
742            if (Configuration.errorOnAutoCreate())
743              throw new Error("Attempt to auto-create NotesComponent.text");
744            else if (Configuration.doAutoCreate())
745              this.text = new StringType(); // bb
746          return this.text;
747        }
748
749        public boolean hasTextElement() { 
750          return this.text != null && !this.text.isEmpty();
751        }
752
753        public boolean hasText() { 
754          return this.text != null && !this.text.isEmpty();
755        }
756
757        /**
758         * @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
759         */
760        public NotesComponent setTextElement(StringType value) { 
761          this.text = value;
762          return this;
763        }
764
765        /**
766         * @return The explanation or description associated with the processing.
767         */
768        public String getText() { 
769          return this.text == null ? null : this.text.getValue();
770        }
771
772        /**
773         * @param value The explanation or description associated with the processing.
774         */
775        public NotesComponent setText(String value) { 
776          if (Utilities.noString(value))
777            this.text = null;
778          else {
779            if (this.text == null)
780              this.text = new StringType();
781            this.text.setValue(value);
782          }
783          return this;
784        }
785
786        protected void listChildren(List<Property> children) {
787          super.listChildren(children);
788          children.add(new Property("type", "code", "The business purpose of the note text.", 0, 1, type));
789          children.add(new Property("text", "string", "The explanation or description associated with the processing.", 0, 1, text));
790        }
791
792        @Override
793        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
794          switch (_hash) {
795          case 3575610: /*type*/  return new Property("type", "code", "The business purpose of the note text.", 0, 1, type);
796          case 3556653: /*text*/  return new Property("text", "string", "The explanation or description associated with the processing.", 0, 1, text);
797          default: return super.getNamedProperty(_hash, _name, _checkValid);
798          }
799
800        }
801
802      @Override
803      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
804        switch (hash) {
805        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<NoteType>
806        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
807        default: return super.getProperty(hash, name, checkValid);
808        }
809
810      }
811
812      @Override
813      public Base setProperty(int hash, String name, Base value) throws FHIRException {
814        switch (hash) {
815        case 3575610: // type
816          value = new NoteTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
817          this.type = (Enumeration) value; // Enumeration<NoteType>
818          return value;
819        case 3556653: // text
820          this.text = TypeConvertor.castToString(value); // StringType
821          return value;
822        default: return super.setProperty(hash, name, value);
823        }
824
825      }
826
827      @Override
828      public Base setProperty(String name, Base value) throws FHIRException {
829        if (name.equals("type")) {
830          value = new NoteTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
831          this.type = (Enumeration) value; // Enumeration<NoteType>
832        } else if (name.equals("text")) {
833          this.text = TypeConvertor.castToString(value); // StringType
834        } else
835          return super.setProperty(name, value);
836        return value;
837      }
838
839      @Override
840      public Base makeProperty(int hash, String name) throws FHIRException {
841        switch (hash) {
842        case 3575610:  return getTypeElement();
843        case 3556653:  return getTextElement();
844        default: return super.makeProperty(hash, name);
845        }
846
847      }
848
849      @Override
850      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
851        switch (hash) {
852        case 3575610: /*type*/ return new String[] {"code"};
853        case 3556653: /*text*/ return new String[] {"string"};
854        default: return super.getTypesForProperty(hash, name);
855        }
856
857      }
858
859      @Override
860      public Base addChild(String name) throws FHIRException {
861        if (name.equals("type")) {
862          throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.processNote.type");
863        }
864        else if (name.equals("text")) {
865          throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.processNote.text");
866        }
867        else
868          return super.addChild(name);
869      }
870
871      public NotesComponent copy() {
872        NotesComponent dst = new NotesComponent();
873        copyValues(dst);
874        return dst;
875      }
876
877      public void copyValues(NotesComponent dst) {
878        super.copyValues(dst);
879        dst.type = type == null ? null : type.copy();
880        dst.text = text == null ? null : text.copy();
881      }
882
883      @Override
884      public boolean equalsDeep(Base other_) {
885        if (!super.equalsDeep(other_))
886          return false;
887        if (!(other_ instanceof NotesComponent))
888          return false;
889        NotesComponent o = (NotesComponent) other_;
890        return compareDeep(type, o.type, true) && compareDeep(text, o.text, true);
891      }
892
893      @Override
894      public boolean equalsShallow(Base other_) {
895        if (!super.equalsShallow(other_))
896          return false;
897        if (!(other_ instanceof NotesComponent))
898          return false;
899        NotesComponent o = (NotesComponent) other_;
900        return compareValues(type, o.type, true) && compareValues(text, o.text, true);
901      }
902
903      public boolean isEmpty() {
904        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, text);
905      }
906
907  public String fhirType() {
908    return "PaymentReconciliation.processNote";
909
910  }
911
912  }
913
914    /**
915     * A unique identifier assigned to this payment reconciliation.
916     */
917    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
918    @Description(shortDefinition="Business Identifier for a payment reconciliation", formalDefinition="A unique identifier assigned to this payment reconciliation." )
919    protected List<Identifier> identifier;
920
921    /**
922     * The status of the resource instance.
923     */
924    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
925    @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." )
926    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status")
927    protected Enumeration<FinancialResourceStatusCodes> status;
928
929    /**
930     * The period of time for which payments have been gathered into this bulk payment for settlement.
931     */
932    @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true)
933    @Description(shortDefinition="Period covered", formalDefinition="The period of time for which payments have been gathered into this bulk payment for settlement." )
934    protected Period period;
935
936    /**
937     * The date when the resource was created.
938     */
939    @Child(name = "created", type = {DateTimeType.class}, order=3, min=1, max=1, modifier=false, summary=true)
940    @Description(shortDefinition="Creation date", formalDefinition="The date when the resource was created." )
941    protected DateTimeType created;
942
943    /**
944     * The party who generated the payment.
945     */
946    @Child(name = "paymentIssuer", type = {Organization.class}, order=4, min=0, max=1, modifier=false, summary=true)
947    @Description(shortDefinition="Party generating payment", formalDefinition="The party who generated the payment." )
948    protected Reference paymentIssuer;
949
950    /**
951     * Original request resource reference.
952     */
953    @Child(name = "request", type = {Task.class}, order=5, min=0, max=1, modifier=false, summary=false)
954    @Description(shortDefinition="Reference to requesting resource", formalDefinition="Original request resource reference." )
955    protected Reference request;
956
957    /**
958     * The practitioner who is responsible for the services rendered to the patient.
959     */
960    @Child(name = "requestor", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=6, min=0, max=1, modifier=false, summary=false)
961    @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." )
962    protected Reference requestor;
963
964    /**
965     * The outcome of a request for a reconciliation.
966     */
967    @Child(name = "outcome", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=false)
968    @Description(shortDefinition="queued | complete | error | partial", formalDefinition="The outcome of a request for a reconciliation." )
969    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/remittance-outcome")
970    protected Enumeration<RemittanceOutcome> outcome;
971
972    /**
973     * A human readable description of the status of the request for the reconciliation.
974     */
975    @Child(name = "disposition", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
976    @Description(shortDefinition="Disposition message", formalDefinition="A human readable description of the status of the request for the reconciliation." )
977    protected StringType disposition;
978
979    /**
980     * The date of payment as indicated on the financial instrument.
981     */
982    @Child(name = "paymentDate", type = {DateType.class}, order=9, min=1, max=1, modifier=false, summary=true)
983    @Description(shortDefinition="When payment issued", formalDefinition="The date of payment as indicated on the financial instrument." )
984    protected DateType paymentDate;
985
986    /**
987     * Total payment amount as indicated on the financial instrument.
988     */
989    @Child(name = "paymentAmount", type = {Money.class}, order=10, min=1, max=1, modifier=false, summary=true)
990    @Description(shortDefinition="Total amount of Payment", formalDefinition="Total payment amount as indicated on the financial instrument." )
991    protected Money paymentAmount;
992
993    /**
994     * Issuer's unique identifier for the payment instrument.
995     */
996    @Child(name = "paymentIdentifier", type = {Identifier.class}, order=11, min=0, max=1, modifier=false, summary=false)
997    @Description(shortDefinition="Business identifier for the payment", formalDefinition="Issuer's unique identifier for the payment instrument." )
998    protected Identifier paymentIdentifier;
999
1000    /**
1001     * Distribution of the payment amount for a previously acknowledged payable.
1002     */
1003    @Child(name = "detail", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1004    @Description(shortDefinition="Settlement particulars", formalDefinition="Distribution of the payment amount for a previously acknowledged payable." )
1005    protected List<DetailsComponent> detail;
1006
1007    /**
1008     * A code for the form to be used for printing the content.
1009     */
1010    @Child(name = "formCode", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=false)
1011    @Description(shortDefinition="Printed form identifier", formalDefinition="A code for the form to be used for printing the content." )
1012    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/forms")
1013    protected CodeableConcept formCode;
1014
1015    /**
1016     * A note that describes or explains the processing in a human readable form.
1017     */
1018    @Child(name = "processNote", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1019    @Description(shortDefinition="Note concerning processing", formalDefinition="A note that describes or explains the processing in a human readable form." )
1020    protected List<NotesComponent> processNote;
1021
1022    private static final long serialVersionUID = -934593916L;
1023
1024  /**
1025   * Constructor
1026   */
1027    public PaymentReconciliation() {
1028      super();
1029    }
1030
1031  /**
1032   * Constructor
1033   */
1034    public PaymentReconciliation(FinancialResourceStatusCodes status, Date created, Date paymentDate, Money paymentAmount) {
1035      super();
1036      this.setStatus(status);
1037      this.setCreated(created);
1038      this.setPaymentDate(paymentDate);
1039      this.setPaymentAmount(paymentAmount);
1040    }
1041
1042    /**
1043     * @return {@link #identifier} (A unique identifier assigned to this payment reconciliation.)
1044     */
1045    public List<Identifier> getIdentifier() { 
1046      if (this.identifier == null)
1047        this.identifier = new ArrayList<Identifier>();
1048      return this.identifier;
1049    }
1050
1051    /**
1052     * @return Returns a reference to <code>this</code> for easy method chaining
1053     */
1054    public PaymentReconciliation setIdentifier(List<Identifier> theIdentifier) { 
1055      this.identifier = theIdentifier;
1056      return this;
1057    }
1058
1059    public boolean hasIdentifier() { 
1060      if (this.identifier == null)
1061        return false;
1062      for (Identifier item : this.identifier)
1063        if (!item.isEmpty())
1064          return true;
1065      return false;
1066    }
1067
1068    public Identifier addIdentifier() { //3
1069      Identifier t = new Identifier();
1070      if (this.identifier == null)
1071        this.identifier = new ArrayList<Identifier>();
1072      this.identifier.add(t);
1073      return t;
1074    }
1075
1076    public PaymentReconciliation addIdentifier(Identifier t) { //3
1077      if (t == null)
1078        return this;
1079      if (this.identifier == null)
1080        this.identifier = new ArrayList<Identifier>();
1081      this.identifier.add(t);
1082      return this;
1083    }
1084
1085    /**
1086     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1087     */
1088    public Identifier getIdentifierFirstRep() { 
1089      if (getIdentifier().isEmpty()) {
1090        addIdentifier();
1091      }
1092      return getIdentifier().get(0);
1093    }
1094
1095    /**
1096     * @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
1097     */
1098    public Enumeration<FinancialResourceStatusCodes> getStatusElement() { 
1099      if (this.status == null)
1100        if (Configuration.errorOnAutoCreate())
1101          throw new Error("Attempt to auto-create PaymentReconciliation.status");
1102        else if (Configuration.doAutoCreate())
1103          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory()); // bb
1104      return this.status;
1105    }
1106
1107    public boolean hasStatusElement() { 
1108      return this.status != null && !this.status.isEmpty();
1109    }
1110
1111    public boolean hasStatus() { 
1112      return this.status != null && !this.status.isEmpty();
1113    }
1114
1115    /**
1116     * @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
1117     */
1118    public PaymentReconciliation setStatusElement(Enumeration<FinancialResourceStatusCodes> value) { 
1119      this.status = value;
1120      return this;
1121    }
1122
1123    /**
1124     * @return The status of the resource instance.
1125     */
1126    public FinancialResourceStatusCodes getStatus() { 
1127      return this.status == null ? null : this.status.getValue();
1128    }
1129
1130    /**
1131     * @param value The status of the resource instance.
1132     */
1133    public PaymentReconciliation setStatus(FinancialResourceStatusCodes value) { 
1134        if (this.status == null)
1135          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory());
1136        this.status.setValue(value);
1137      return this;
1138    }
1139
1140    /**
1141     * @return {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.)
1142     */
1143    public Period getPeriod() { 
1144      if (this.period == null)
1145        if (Configuration.errorOnAutoCreate())
1146          throw new Error("Attempt to auto-create PaymentReconciliation.period");
1147        else if (Configuration.doAutoCreate())
1148          this.period = new Period(); // cc
1149      return this.period;
1150    }
1151
1152    public boolean hasPeriod() { 
1153      return this.period != null && !this.period.isEmpty();
1154    }
1155
1156    /**
1157     * @param value {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.)
1158     */
1159    public PaymentReconciliation setPeriod(Period value) { 
1160      this.period = value;
1161      return this;
1162    }
1163
1164    /**
1165     * @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
1166     */
1167    public DateTimeType getCreatedElement() { 
1168      if (this.created == null)
1169        if (Configuration.errorOnAutoCreate())
1170          throw new Error("Attempt to auto-create PaymentReconciliation.created");
1171        else if (Configuration.doAutoCreate())
1172          this.created = new DateTimeType(); // bb
1173      return this.created;
1174    }
1175
1176    public boolean hasCreatedElement() { 
1177      return this.created != null && !this.created.isEmpty();
1178    }
1179
1180    public boolean hasCreated() { 
1181      return this.created != null && !this.created.isEmpty();
1182    }
1183
1184    /**
1185     * @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
1186     */
1187    public PaymentReconciliation setCreatedElement(DateTimeType value) { 
1188      this.created = value;
1189      return this;
1190    }
1191
1192    /**
1193     * @return The date when the resource was created.
1194     */
1195    public Date getCreated() { 
1196      return this.created == null ? null : this.created.getValue();
1197    }
1198
1199    /**
1200     * @param value The date when the resource was created.
1201     */
1202    public PaymentReconciliation setCreated(Date value) { 
1203        if (this.created == null)
1204          this.created = new DateTimeType();
1205        this.created.setValue(value);
1206      return this;
1207    }
1208
1209    /**
1210     * @return {@link #paymentIssuer} (The party who generated the payment.)
1211     */
1212    public Reference getPaymentIssuer() { 
1213      if (this.paymentIssuer == null)
1214        if (Configuration.errorOnAutoCreate())
1215          throw new Error("Attempt to auto-create PaymentReconciliation.paymentIssuer");
1216        else if (Configuration.doAutoCreate())
1217          this.paymentIssuer = new Reference(); // cc
1218      return this.paymentIssuer;
1219    }
1220
1221    public boolean hasPaymentIssuer() { 
1222      return this.paymentIssuer != null && !this.paymentIssuer.isEmpty();
1223    }
1224
1225    /**
1226     * @param value {@link #paymentIssuer} (The party who generated the payment.)
1227     */
1228    public PaymentReconciliation setPaymentIssuer(Reference value) { 
1229      this.paymentIssuer = value;
1230      return this;
1231    }
1232
1233    /**
1234     * @return {@link #request} (Original request resource reference.)
1235     */
1236    public Reference getRequest() { 
1237      if (this.request == null)
1238        if (Configuration.errorOnAutoCreate())
1239          throw new Error("Attempt to auto-create PaymentReconciliation.request");
1240        else if (Configuration.doAutoCreate())
1241          this.request = new Reference(); // cc
1242      return this.request;
1243    }
1244
1245    public boolean hasRequest() { 
1246      return this.request != null && !this.request.isEmpty();
1247    }
1248
1249    /**
1250     * @param value {@link #request} (Original request resource reference.)
1251     */
1252    public PaymentReconciliation setRequest(Reference value) { 
1253      this.request = value;
1254      return this;
1255    }
1256
1257    /**
1258     * @return {@link #requestor} (The practitioner who is responsible for the services rendered to the patient.)
1259     */
1260    public Reference getRequestor() { 
1261      if (this.requestor == null)
1262        if (Configuration.errorOnAutoCreate())
1263          throw new Error("Attempt to auto-create PaymentReconciliation.requestor");
1264        else if (Configuration.doAutoCreate())
1265          this.requestor = new Reference(); // cc
1266      return this.requestor;
1267    }
1268
1269    public boolean hasRequestor() { 
1270      return this.requestor != null && !this.requestor.isEmpty();
1271    }
1272
1273    /**
1274     * @param value {@link #requestor} (The practitioner who is responsible for the services rendered to the patient.)
1275     */
1276    public PaymentReconciliation setRequestor(Reference value) { 
1277      this.requestor = value;
1278      return this;
1279    }
1280
1281    /**
1282     * @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
1283     */
1284    public Enumeration<RemittanceOutcome> getOutcomeElement() { 
1285      if (this.outcome == null)
1286        if (Configuration.errorOnAutoCreate())
1287          throw new Error("Attempt to auto-create PaymentReconciliation.outcome");
1288        else if (Configuration.doAutoCreate())
1289          this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory()); // bb
1290      return this.outcome;
1291    }
1292
1293    public boolean hasOutcomeElement() { 
1294      return this.outcome != null && !this.outcome.isEmpty();
1295    }
1296
1297    public boolean hasOutcome() { 
1298      return this.outcome != null && !this.outcome.isEmpty();
1299    }
1300
1301    /**
1302     * @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
1303     */
1304    public PaymentReconciliation setOutcomeElement(Enumeration<RemittanceOutcome> value) { 
1305      this.outcome = value;
1306      return this;
1307    }
1308
1309    /**
1310     * @return The outcome of a request for a reconciliation.
1311     */
1312    public RemittanceOutcome getOutcome() { 
1313      return this.outcome == null ? null : this.outcome.getValue();
1314    }
1315
1316    /**
1317     * @param value The outcome of a request for a reconciliation.
1318     */
1319    public PaymentReconciliation setOutcome(RemittanceOutcome value) { 
1320      if (value == null)
1321        this.outcome = null;
1322      else {
1323        if (this.outcome == null)
1324          this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory());
1325        this.outcome.setValue(value);
1326      }
1327      return this;
1328    }
1329
1330    /**
1331     * @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
1332     */
1333    public StringType getDispositionElement() { 
1334      if (this.disposition == null)
1335        if (Configuration.errorOnAutoCreate())
1336          throw new Error("Attempt to auto-create PaymentReconciliation.disposition");
1337        else if (Configuration.doAutoCreate())
1338          this.disposition = new StringType(); // bb
1339      return this.disposition;
1340    }
1341
1342    public boolean hasDispositionElement() { 
1343      return this.disposition != null && !this.disposition.isEmpty();
1344    }
1345
1346    public boolean hasDisposition() { 
1347      return this.disposition != null && !this.disposition.isEmpty();
1348    }
1349
1350    /**
1351     * @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
1352     */
1353    public PaymentReconciliation setDispositionElement(StringType value) { 
1354      this.disposition = value;
1355      return this;
1356    }
1357
1358    /**
1359     * @return A human readable description of the status of the request for the reconciliation.
1360     */
1361    public String getDisposition() { 
1362      return this.disposition == null ? null : this.disposition.getValue();
1363    }
1364
1365    /**
1366     * @param value A human readable description of the status of the request for the reconciliation.
1367     */
1368    public PaymentReconciliation setDisposition(String value) { 
1369      if (Utilities.noString(value))
1370        this.disposition = null;
1371      else {
1372        if (this.disposition == null)
1373          this.disposition = new StringType();
1374        this.disposition.setValue(value);
1375      }
1376      return this;
1377    }
1378
1379    /**
1380     * @return {@link #paymentDate} (The date of payment as indicated on the financial instrument.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value
1381     */
1382    public DateType getPaymentDateElement() { 
1383      if (this.paymentDate == null)
1384        if (Configuration.errorOnAutoCreate())
1385          throw new Error("Attempt to auto-create PaymentReconciliation.paymentDate");
1386        else if (Configuration.doAutoCreate())
1387          this.paymentDate = new DateType(); // bb
1388      return this.paymentDate;
1389    }
1390
1391    public boolean hasPaymentDateElement() { 
1392      return this.paymentDate != null && !this.paymentDate.isEmpty();
1393    }
1394
1395    public boolean hasPaymentDate() { 
1396      return this.paymentDate != null && !this.paymentDate.isEmpty();
1397    }
1398
1399    /**
1400     * @param value {@link #paymentDate} (The date of payment as indicated on the financial instrument.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value
1401     */
1402    public PaymentReconciliation setPaymentDateElement(DateType value) { 
1403      this.paymentDate = value;
1404      return this;
1405    }
1406
1407    /**
1408     * @return The date of payment as indicated on the financial instrument.
1409     */
1410    public Date getPaymentDate() { 
1411      return this.paymentDate == null ? null : this.paymentDate.getValue();
1412    }
1413
1414    /**
1415     * @param value The date of payment as indicated on the financial instrument.
1416     */
1417    public PaymentReconciliation setPaymentDate(Date value) { 
1418        if (this.paymentDate == null)
1419          this.paymentDate = new DateType();
1420        this.paymentDate.setValue(value);
1421      return this;
1422    }
1423
1424    /**
1425     * @return {@link #paymentAmount} (Total payment amount as indicated on the financial instrument.)
1426     */
1427    public Money getPaymentAmount() { 
1428      if (this.paymentAmount == null)
1429        if (Configuration.errorOnAutoCreate())
1430          throw new Error("Attempt to auto-create PaymentReconciliation.paymentAmount");
1431        else if (Configuration.doAutoCreate())
1432          this.paymentAmount = new Money(); // cc
1433      return this.paymentAmount;
1434    }
1435
1436    public boolean hasPaymentAmount() { 
1437      return this.paymentAmount != null && !this.paymentAmount.isEmpty();
1438    }
1439
1440    /**
1441     * @param value {@link #paymentAmount} (Total payment amount as indicated on the financial instrument.)
1442     */
1443    public PaymentReconciliation setPaymentAmount(Money value) { 
1444      this.paymentAmount = value;
1445      return this;
1446    }
1447
1448    /**
1449     * @return {@link #paymentIdentifier} (Issuer's unique identifier for the payment instrument.)
1450     */
1451    public Identifier getPaymentIdentifier() { 
1452      if (this.paymentIdentifier == null)
1453        if (Configuration.errorOnAutoCreate())
1454          throw new Error("Attempt to auto-create PaymentReconciliation.paymentIdentifier");
1455        else if (Configuration.doAutoCreate())
1456          this.paymentIdentifier = new Identifier(); // cc
1457      return this.paymentIdentifier;
1458    }
1459
1460    public boolean hasPaymentIdentifier() { 
1461      return this.paymentIdentifier != null && !this.paymentIdentifier.isEmpty();
1462    }
1463
1464    /**
1465     * @param value {@link #paymentIdentifier} (Issuer's unique identifier for the payment instrument.)
1466     */
1467    public PaymentReconciliation setPaymentIdentifier(Identifier value) { 
1468      this.paymentIdentifier = value;
1469      return this;
1470    }
1471
1472    /**
1473     * @return {@link #detail} (Distribution of the payment amount for a previously acknowledged payable.)
1474     */
1475    public List<DetailsComponent> getDetail() { 
1476      if (this.detail == null)
1477        this.detail = new ArrayList<DetailsComponent>();
1478      return this.detail;
1479    }
1480
1481    /**
1482     * @return Returns a reference to <code>this</code> for easy method chaining
1483     */
1484    public PaymentReconciliation setDetail(List<DetailsComponent> theDetail) { 
1485      this.detail = theDetail;
1486      return this;
1487    }
1488
1489    public boolean hasDetail() { 
1490      if (this.detail == null)
1491        return false;
1492      for (DetailsComponent item : this.detail)
1493        if (!item.isEmpty())
1494          return true;
1495      return false;
1496    }
1497
1498    public DetailsComponent addDetail() { //3
1499      DetailsComponent t = new DetailsComponent();
1500      if (this.detail == null)
1501        this.detail = new ArrayList<DetailsComponent>();
1502      this.detail.add(t);
1503      return t;
1504    }
1505
1506    public PaymentReconciliation addDetail(DetailsComponent t) { //3
1507      if (t == null)
1508        return this;
1509      if (this.detail == null)
1510        this.detail = new ArrayList<DetailsComponent>();
1511      this.detail.add(t);
1512      return this;
1513    }
1514
1515    /**
1516     * @return The first repetition of repeating field {@link #detail}, creating it if it does not already exist {3}
1517     */
1518    public DetailsComponent getDetailFirstRep() { 
1519      if (getDetail().isEmpty()) {
1520        addDetail();
1521      }
1522      return getDetail().get(0);
1523    }
1524
1525    /**
1526     * @return {@link #formCode} (A code for the form to be used for printing the content.)
1527     */
1528    public CodeableConcept getFormCode() { 
1529      if (this.formCode == null)
1530        if (Configuration.errorOnAutoCreate())
1531          throw new Error("Attempt to auto-create PaymentReconciliation.formCode");
1532        else if (Configuration.doAutoCreate())
1533          this.formCode = new CodeableConcept(); // cc
1534      return this.formCode;
1535    }
1536
1537    public boolean hasFormCode() { 
1538      return this.formCode != null && !this.formCode.isEmpty();
1539    }
1540
1541    /**
1542     * @param value {@link #formCode} (A code for the form to be used for printing the content.)
1543     */
1544    public PaymentReconciliation setFormCode(CodeableConcept value) { 
1545      this.formCode = value;
1546      return this;
1547    }
1548
1549    /**
1550     * @return {@link #processNote} (A note that describes or explains the processing in a human readable form.)
1551     */
1552    public List<NotesComponent> getProcessNote() { 
1553      if (this.processNote == null)
1554        this.processNote = new ArrayList<NotesComponent>();
1555      return this.processNote;
1556    }
1557
1558    /**
1559     * @return Returns a reference to <code>this</code> for easy method chaining
1560     */
1561    public PaymentReconciliation setProcessNote(List<NotesComponent> theProcessNote) { 
1562      this.processNote = theProcessNote;
1563      return this;
1564    }
1565
1566    public boolean hasProcessNote() { 
1567      if (this.processNote == null)
1568        return false;
1569      for (NotesComponent item : this.processNote)
1570        if (!item.isEmpty())
1571          return true;
1572      return false;
1573    }
1574
1575    public NotesComponent addProcessNote() { //3
1576      NotesComponent t = new NotesComponent();
1577      if (this.processNote == null)
1578        this.processNote = new ArrayList<NotesComponent>();
1579      this.processNote.add(t);
1580      return t;
1581    }
1582
1583    public PaymentReconciliation addProcessNote(NotesComponent t) { //3
1584      if (t == null)
1585        return this;
1586      if (this.processNote == null)
1587        this.processNote = new ArrayList<NotesComponent>();
1588      this.processNote.add(t);
1589      return this;
1590    }
1591
1592    /**
1593     * @return The first repetition of repeating field {@link #processNote}, creating it if it does not already exist {3}
1594     */
1595    public NotesComponent getProcessNoteFirstRep() { 
1596      if (getProcessNote().isEmpty()) {
1597        addProcessNote();
1598      }
1599      return getProcessNote().get(0);
1600    }
1601
1602      protected void listChildren(List<Property> children) {
1603        super.listChildren(children);
1604        children.add(new Property("identifier", "Identifier", "A unique identifier assigned to this payment reconciliation.", 0, java.lang.Integer.MAX_VALUE, identifier));
1605        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
1606        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));
1607        children.add(new Property("created", "dateTime", "The date when the resource was created.", 0, 1, created));
1608        children.add(new Property("paymentIssuer", "Reference(Organization)", "The party who generated the payment.", 0, 1, paymentIssuer));
1609        children.add(new Property("request", "Reference(Task)", "Original request resource reference.", 0, 1, request));
1610        children.add(new Property("requestor", "Reference(Practitioner|PractitionerRole|Organization)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, requestor));
1611        children.add(new Property("outcome", "code", "The outcome of a request for a reconciliation.", 0, 1, outcome));
1612        children.add(new Property("disposition", "string", "A human readable description of the status of the request for the reconciliation.", 0, 1, disposition));
1613        children.add(new Property("paymentDate", "date", "The date of payment as indicated on the financial instrument.", 0, 1, paymentDate));
1614        children.add(new Property("paymentAmount", "Money", "Total payment amount as indicated on the financial instrument.", 0, 1, paymentAmount));
1615        children.add(new Property("paymentIdentifier", "Identifier", "Issuer's unique identifier for the payment instrument.", 0, 1, paymentIdentifier));
1616        children.add(new Property("detail", "", "Distribution of the payment amount for a previously acknowledged payable.", 0, java.lang.Integer.MAX_VALUE, detail));
1617        children.add(new Property("formCode", "CodeableConcept", "A code for the form to be used for printing the content.", 0, 1, formCode));
1618        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));
1619      }
1620
1621      @Override
1622      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1623        switch (_hash) {
1624        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier assigned to this payment reconciliation.", 0, java.lang.Integer.MAX_VALUE, identifier);
1625        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
1626        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);
1627        case 1028554472: /*created*/  return new Property("created", "dateTime", "The date when the resource was created.", 0, 1, created);
1628        case 1144026207: /*paymentIssuer*/  return new Property("paymentIssuer", "Reference(Organization)", "The party who generated the payment.", 0, 1, paymentIssuer);
1629        case 1095692943: /*request*/  return new Property("request", "Reference(Task)", "Original request resource reference.", 0, 1, request);
1630        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);
1631        case -1106507950: /*outcome*/  return new Property("outcome", "code", "The outcome of a request for a reconciliation.", 0, 1, outcome);
1632        case 583380919: /*disposition*/  return new Property("disposition", "string", "A human readable description of the status of the request for the reconciliation.", 0, 1, disposition);
1633        case -1540873516: /*paymentDate*/  return new Property("paymentDate", "date", "The date of payment as indicated on the financial instrument.", 0, 1, paymentDate);
1634        case 909332990: /*paymentAmount*/  return new Property("paymentAmount", "Money", "Total payment amount as indicated on the financial instrument.", 0, 1, paymentAmount);
1635        case 1555852111: /*paymentIdentifier*/  return new Property("paymentIdentifier", "Identifier", "Issuer's unique identifier for the payment instrument.", 0, 1, paymentIdentifier);
1636        case -1335224239: /*detail*/  return new Property("detail", "", "Distribution of the payment amount for a previously acknowledged payable.", 0, java.lang.Integer.MAX_VALUE, detail);
1637        case 473181393: /*formCode*/  return new Property("formCode", "CodeableConcept", "A code for the form to be used for printing the content.", 0, 1, formCode);
1638        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);
1639        default: return super.getNamedProperty(_hash, _name, _checkValid);
1640        }
1641
1642      }
1643
1644      @Override
1645      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1646        switch (hash) {
1647        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1648        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FinancialResourceStatusCodes>
1649        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1650        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
1651        case 1144026207: /*paymentIssuer*/ return this.paymentIssuer == null ? new Base[0] : new Base[] {this.paymentIssuer}; // Reference
1652        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference
1653        case 693934258: /*requestor*/ return this.requestor == null ? new Base[0] : new Base[] {this.requestor}; // Reference
1654        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration<RemittanceOutcome>
1655        case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType
1656        case -1540873516: /*paymentDate*/ return this.paymentDate == null ? new Base[0] : new Base[] {this.paymentDate}; // DateType
1657        case 909332990: /*paymentAmount*/ return this.paymentAmount == null ? new Base[0] : new Base[] {this.paymentAmount}; // Money
1658        case 1555852111: /*paymentIdentifier*/ return this.paymentIdentifier == null ? new Base[0] : new Base[] {this.paymentIdentifier}; // Identifier
1659        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // DetailsComponent
1660        case 473181393: /*formCode*/ return this.formCode == null ? new Base[0] : new Base[] {this.formCode}; // CodeableConcept
1661        case 202339073: /*processNote*/ return this.processNote == null ? new Base[0] : this.processNote.toArray(new Base[this.processNote.size()]); // NotesComponent
1662        default: return super.getProperty(hash, name, checkValid);
1663        }
1664
1665      }
1666
1667      @Override
1668      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1669        switch (hash) {
1670        case -1618432855: // identifier
1671          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1672          return value;
1673        case -892481550: // status
1674          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
1675          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
1676          return value;
1677        case -991726143: // period
1678          this.period = TypeConvertor.castToPeriod(value); // Period
1679          return value;
1680        case 1028554472: // created
1681          this.created = TypeConvertor.castToDateTime(value); // DateTimeType
1682          return value;
1683        case 1144026207: // paymentIssuer
1684          this.paymentIssuer = TypeConvertor.castToReference(value); // Reference
1685          return value;
1686        case 1095692943: // request
1687          this.request = TypeConvertor.castToReference(value); // Reference
1688          return value;
1689        case 693934258: // requestor
1690          this.requestor = TypeConvertor.castToReference(value); // Reference
1691          return value;
1692        case -1106507950: // outcome
1693          value = new RemittanceOutcomeEnumFactory().fromType(TypeConvertor.castToCode(value));
1694          this.outcome = (Enumeration) value; // Enumeration<RemittanceOutcome>
1695          return value;
1696        case 583380919: // disposition
1697          this.disposition = TypeConvertor.castToString(value); // StringType
1698          return value;
1699        case -1540873516: // paymentDate
1700          this.paymentDate = TypeConvertor.castToDate(value); // DateType
1701          return value;
1702        case 909332990: // paymentAmount
1703          this.paymentAmount = TypeConvertor.castToMoney(value); // Money
1704          return value;
1705        case 1555852111: // paymentIdentifier
1706          this.paymentIdentifier = TypeConvertor.castToIdentifier(value); // Identifier
1707          return value;
1708        case -1335224239: // detail
1709          this.getDetail().add((DetailsComponent) value); // DetailsComponent
1710          return value;
1711        case 473181393: // formCode
1712          this.formCode = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1713          return value;
1714        case 202339073: // processNote
1715          this.getProcessNote().add((NotesComponent) value); // NotesComponent
1716          return value;
1717        default: return super.setProperty(hash, name, value);
1718        }
1719
1720      }
1721
1722      @Override
1723      public Base setProperty(String name, Base value) throws FHIRException {
1724        if (name.equals("identifier")) {
1725          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1726        } else if (name.equals("status")) {
1727          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
1728          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
1729        } else if (name.equals("period")) {
1730          this.period = TypeConvertor.castToPeriod(value); // Period
1731        } else if (name.equals("created")) {
1732          this.created = TypeConvertor.castToDateTime(value); // DateTimeType
1733        } else if (name.equals("paymentIssuer")) {
1734          this.paymentIssuer = TypeConvertor.castToReference(value); // Reference
1735        } else if (name.equals("request")) {
1736          this.request = TypeConvertor.castToReference(value); // Reference
1737        } else if (name.equals("requestor")) {
1738          this.requestor = TypeConvertor.castToReference(value); // Reference
1739        } else if (name.equals("outcome")) {
1740          value = new RemittanceOutcomeEnumFactory().fromType(TypeConvertor.castToCode(value));
1741          this.outcome = (Enumeration) value; // Enumeration<RemittanceOutcome>
1742        } else if (name.equals("disposition")) {
1743          this.disposition = TypeConvertor.castToString(value); // StringType
1744        } else if (name.equals("paymentDate")) {
1745          this.paymentDate = TypeConvertor.castToDate(value); // DateType
1746        } else if (name.equals("paymentAmount")) {
1747          this.paymentAmount = TypeConvertor.castToMoney(value); // Money
1748        } else if (name.equals("paymentIdentifier")) {
1749          this.paymentIdentifier = TypeConvertor.castToIdentifier(value); // Identifier
1750        } else if (name.equals("detail")) {
1751          this.getDetail().add((DetailsComponent) value);
1752        } else if (name.equals("formCode")) {
1753          this.formCode = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1754        } else if (name.equals("processNote")) {
1755          this.getProcessNote().add((NotesComponent) value);
1756        } else
1757          return super.setProperty(name, value);
1758        return value;
1759      }
1760
1761      @Override
1762      public Base makeProperty(int hash, String name) throws FHIRException {
1763        switch (hash) {
1764        case -1618432855:  return addIdentifier(); 
1765        case -892481550:  return getStatusElement();
1766        case -991726143:  return getPeriod();
1767        case 1028554472:  return getCreatedElement();
1768        case 1144026207:  return getPaymentIssuer();
1769        case 1095692943:  return getRequest();
1770        case 693934258:  return getRequestor();
1771        case -1106507950:  return getOutcomeElement();
1772        case 583380919:  return getDispositionElement();
1773        case -1540873516:  return getPaymentDateElement();
1774        case 909332990:  return getPaymentAmount();
1775        case 1555852111:  return getPaymentIdentifier();
1776        case -1335224239:  return addDetail(); 
1777        case 473181393:  return getFormCode();
1778        case 202339073:  return addProcessNote(); 
1779        default: return super.makeProperty(hash, name);
1780        }
1781
1782      }
1783
1784      @Override
1785      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1786        switch (hash) {
1787        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1788        case -892481550: /*status*/ return new String[] {"code"};
1789        case -991726143: /*period*/ return new String[] {"Period"};
1790        case 1028554472: /*created*/ return new String[] {"dateTime"};
1791        case 1144026207: /*paymentIssuer*/ return new String[] {"Reference"};
1792        case 1095692943: /*request*/ return new String[] {"Reference"};
1793        case 693934258: /*requestor*/ return new String[] {"Reference"};
1794        case -1106507950: /*outcome*/ return new String[] {"code"};
1795        case 583380919: /*disposition*/ return new String[] {"string"};
1796        case -1540873516: /*paymentDate*/ return new String[] {"date"};
1797        case 909332990: /*paymentAmount*/ return new String[] {"Money"};
1798        case 1555852111: /*paymentIdentifier*/ return new String[] {"Identifier"};
1799        case -1335224239: /*detail*/ return new String[] {};
1800        case 473181393: /*formCode*/ return new String[] {"CodeableConcept"};
1801        case 202339073: /*processNote*/ return new String[] {};
1802        default: return super.getTypesForProperty(hash, name);
1803        }
1804
1805      }
1806
1807      @Override
1808      public Base addChild(String name) throws FHIRException {
1809        if (name.equals("identifier")) {
1810          return addIdentifier();
1811        }
1812        else if (name.equals("status")) {
1813          throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.status");
1814        }
1815        else if (name.equals("period")) {
1816          this.period = new Period();
1817          return this.period;
1818        }
1819        else if (name.equals("created")) {
1820          throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.created");
1821        }
1822        else if (name.equals("paymentIssuer")) {
1823          this.paymentIssuer = new Reference();
1824          return this.paymentIssuer;
1825        }
1826        else if (name.equals("request")) {
1827          this.request = new Reference();
1828          return this.request;
1829        }
1830        else if (name.equals("requestor")) {
1831          this.requestor = new Reference();
1832          return this.requestor;
1833        }
1834        else if (name.equals("outcome")) {
1835          throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.outcome");
1836        }
1837        else if (name.equals("disposition")) {
1838          throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.disposition");
1839        }
1840        else if (name.equals("paymentDate")) {
1841          throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.paymentDate");
1842        }
1843        else if (name.equals("paymentAmount")) {
1844          this.paymentAmount = new Money();
1845          return this.paymentAmount;
1846        }
1847        else if (name.equals("paymentIdentifier")) {
1848          this.paymentIdentifier = new Identifier();
1849          return this.paymentIdentifier;
1850        }
1851        else if (name.equals("detail")) {
1852          return addDetail();
1853        }
1854        else if (name.equals("formCode")) {
1855          this.formCode = new CodeableConcept();
1856          return this.formCode;
1857        }
1858        else if (name.equals("processNote")) {
1859          return addProcessNote();
1860        }
1861        else
1862          return super.addChild(name);
1863      }
1864
1865  public String fhirType() {
1866    return "PaymentReconciliation";
1867
1868  }
1869
1870      public PaymentReconciliation copy() {
1871        PaymentReconciliation dst = new PaymentReconciliation();
1872        copyValues(dst);
1873        return dst;
1874      }
1875
1876      public void copyValues(PaymentReconciliation dst) {
1877        super.copyValues(dst);
1878        if (identifier != null) {
1879          dst.identifier = new ArrayList<Identifier>();
1880          for (Identifier i : identifier)
1881            dst.identifier.add(i.copy());
1882        };
1883        dst.status = status == null ? null : status.copy();
1884        dst.period = period == null ? null : period.copy();
1885        dst.created = created == null ? null : created.copy();
1886        dst.paymentIssuer = paymentIssuer == null ? null : paymentIssuer.copy();
1887        dst.request = request == null ? null : request.copy();
1888        dst.requestor = requestor == null ? null : requestor.copy();
1889        dst.outcome = outcome == null ? null : outcome.copy();
1890        dst.disposition = disposition == null ? null : disposition.copy();
1891        dst.paymentDate = paymentDate == null ? null : paymentDate.copy();
1892        dst.paymentAmount = paymentAmount == null ? null : paymentAmount.copy();
1893        dst.paymentIdentifier = paymentIdentifier == null ? null : paymentIdentifier.copy();
1894        if (detail != null) {
1895          dst.detail = new ArrayList<DetailsComponent>();
1896          for (DetailsComponent i : detail)
1897            dst.detail.add(i.copy());
1898        };
1899        dst.formCode = formCode == null ? null : formCode.copy();
1900        if (processNote != null) {
1901          dst.processNote = new ArrayList<NotesComponent>();
1902          for (NotesComponent i : processNote)
1903            dst.processNote.add(i.copy());
1904        };
1905      }
1906
1907      protected PaymentReconciliation typedCopy() {
1908        return copy();
1909      }
1910
1911      @Override
1912      public boolean equalsDeep(Base other_) {
1913        if (!super.equalsDeep(other_))
1914          return false;
1915        if (!(other_ instanceof PaymentReconciliation))
1916          return false;
1917        PaymentReconciliation o = (PaymentReconciliation) other_;
1918        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(period, o.period, true)
1919           && compareDeep(created, o.created, true) && compareDeep(paymentIssuer, o.paymentIssuer, true) && compareDeep(request, o.request, true)
1920           && compareDeep(requestor, o.requestor, true) && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true)
1921           && compareDeep(paymentDate, o.paymentDate, true) && compareDeep(paymentAmount, o.paymentAmount, true)
1922           && compareDeep(paymentIdentifier, o.paymentIdentifier, true) && compareDeep(detail, o.detail, true)
1923           && compareDeep(formCode, o.formCode, true) && compareDeep(processNote, o.processNote, true);
1924      }
1925
1926      @Override
1927      public boolean equalsShallow(Base other_) {
1928        if (!super.equalsShallow(other_))
1929          return false;
1930        if (!(other_ instanceof PaymentReconciliation))
1931          return false;
1932        PaymentReconciliation o = (PaymentReconciliation) other_;
1933        return compareValues(status, o.status, true) && compareValues(created, o.created, true) && compareValues(outcome, o.outcome, true)
1934           && compareValues(disposition, o.disposition, true) && compareValues(paymentDate, o.paymentDate, true)
1935          ;
1936      }
1937
1938      public boolean isEmpty() {
1939        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, period
1940          , created, paymentIssuer, request, requestor, outcome, disposition, paymentDate
1941          , paymentAmount, paymentIdentifier, detail, formCode, processNote);
1942      }
1943
1944  @Override
1945  public ResourceType getResourceType() {
1946    return ResourceType.PaymentReconciliation;
1947   }
1948
1949 /**
1950   * Search parameter: <b>created</b>
1951   * <p>
1952   * Description: <b>The creation date</b><br>
1953   * Type: <b>date</b><br>
1954   * Path: <b>PaymentReconciliation.created</b><br>
1955   * </p>
1956   */
1957  @SearchParamDefinition(name="created", path="PaymentReconciliation.created", description="The creation date", type="date" )
1958  public static final String SP_CREATED = "created";
1959 /**
1960   * <b>Fluent Client</b> search parameter constant for <b>created</b>
1961   * <p>
1962   * Description: <b>The creation date</b><br>
1963   * Type: <b>date</b><br>
1964   * Path: <b>PaymentReconciliation.created</b><br>
1965   * </p>
1966   */
1967  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED);
1968
1969 /**
1970   * Search parameter: <b>disposition</b>
1971   * <p>
1972   * Description: <b>The contents of the disposition message</b><br>
1973   * Type: <b>string</b><br>
1974   * Path: <b>PaymentReconciliation.disposition</b><br>
1975   * </p>
1976   */
1977  @SearchParamDefinition(name="disposition", path="PaymentReconciliation.disposition", description="The contents of the disposition message", type="string" )
1978  public static final String SP_DISPOSITION = "disposition";
1979 /**
1980   * <b>Fluent Client</b> search parameter constant for <b>disposition</b>
1981   * <p>
1982   * Description: <b>The contents of the disposition message</b><br>
1983   * Type: <b>string</b><br>
1984   * Path: <b>PaymentReconciliation.disposition</b><br>
1985   * </p>
1986   */
1987  public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION);
1988
1989 /**
1990   * Search parameter: <b>identifier</b>
1991   * <p>
1992   * Description: <b>The business identifier of the ExplanationOfBenefit</b><br>
1993   * Type: <b>token</b><br>
1994   * Path: <b>PaymentReconciliation.identifier</b><br>
1995   * </p>
1996   */
1997  @SearchParamDefinition(name="identifier", path="PaymentReconciliation.identifier", description="The business identifier of the ExplanationOfBenefit", type="token" )
1998  public static final String SP_IDENTIFIER = "identifier";
1999 /**
2000   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2001   * <p>
2002   * Description: <b>The business identifier of the ExplanationOfBenefit</b><br>
2003   * Type: <b>token</b><br>
2004   * Path: <b>PaymentReconciliation.identifier</b><br>
2005   * </p>
2006   */
2007  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2008
2009 /**
2010   * Search parameter: <b>outcome</b>
2011   * <p>
2012   * Description: <b>The processing outcome</b><br>
2013   * Type: <b>token</b><br>
2014   * Path: <b>PaymentReconciliation.outcome</b><br>
2015   * </p>
2016   */
2017  @SearchParamDefinition(name="outcome", path="PaymentReconciliation.outcome", description="The processing outcome", type="token" )
2018  public static final String SP_OUTCOME = "outcome";
2019 /**
2020   * <b>Fluent Client</b> search parameter constant for <b>outcome</b>
2021   * <p>
2022   * Description: <b>The processing outcome</b><br>
2023   * Type: <b>token</b><br>
2024   * Path: <b>PaymentReconciliation.outcome</b><br>
2025   * </p>
2026   */
2027  public static final ca.uhn.fhir.rest.gclient.TokenClientParam OUTCOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_OUTCOME);
2028
2029 /**
2030   * Search parameter: <b>payment-issuer</b>
2031   * <p>
2032   * Description: <b>The organization which generated this resource</b><br>
2033   * Type: <b>reference</b><br>
2034   * Path: <b>PaymentReconciliation.paymentIssuer</b><br>
2035   * </p>
2036   */
2037  @SearchParamDefinition(name="payment-issuer", path="PaymentReconciliation.paymentIssuer", description="The organization which generated this resource", type="reference", target={Organization.class } )
2038  public static final String SP_PAYMENT_ISSUER = "payment-issuer";
2039 /**
2040   * <b>Fluent Client</b> search parameter constant for <b>payment-issuer</b>
2041   * <p>
2042   * Description: <b>The organization which generated this resource</b><br>
2043   * Type: <b>reference</b><br>
2044   * Path: <b>PaymentReconciliation.paymentIssuer</b><br>
2045   * </p>
2046   */
2047  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PAYMENT_ISSUER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PAYMENT_ISSUER);
2048
2049/**
2050   * Constant for fluent queries to be used to add include statements. Specifies
2051   * the path value of "<b>PaymentReconciliation:payment-issuer</b>".
2052   */
2053  public static final ca.uhn.fhir.model.api.Include INCLUDE_PAYMENT_ISSUER = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:payment-issuer").toLocked();
2054
2055 /**
2056   * Search parameter: <b>request</b>
2057   * <p>
2058   * Description: <b>The reference to the claim</b><br>
2059   * Type: <b>reference</b><br>
2060   * Path: <b>PaymentReconciliation.request</b><br>
2061   * </p>
2062   */
2063  @SearchParamDefinition(name="request", path="PaymentReconciliation.request", description="The reference to the claim", type="reference", target={Task.class } )
2064  public static final String SP_REQUEST = "request";
2065 /**
2066   * <b>Fluent Client</b> search parameter constant for <b>request</b>
2067   * <p>
2068   * Description: <b>The reference to the claim</b><br>
2069   * Type: <b>reference</b><br>
2070   * Path: <b>PaymentReconciliation.request</b><br>
2071   * </p>
2072   */
2073  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST);
2074
2075/**
2076   * Constant for fluent queries to be used to add include statements. Specifies
2077   * the path value of "<b>PaymentReconciliation:request</b>".
2078   */
2079  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:request").toLocked();
2080
2081 /**
2082   * Search parameter: <b>requestor</b>
2083   * <p>
2084   * Description: <b>The reference to the provider who submitted the claim</b><br>
2085   * Type: <b>reference</b><br>
2086   * Path: <b>PaymentReconciliation.requestor</b><br>
2087   * </p>
2088   */
2089  @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 } )
2090  public static final String SP_REQUESTOR = "requestor";
2091 /**
2092   * <b>Fluent Client</b> search parameter constant for <b>requestor</b>
2093   * <p>
2094   * Description: <b>The reference to the provider who submitted the claim</b><br>
2095   * Type: <b>reference</b><br>
2096   * Path: <b>PaymentReconciliation.requestor</b><br>
2097   * </p>
2098   */
2099  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTOR);
2100
2101/**
2102   * Constant for fluent queries to be used to add include statements. Specifies
2103   * the path value of "<b>PaymentReconciliation:requestor</b>".
2104   */
2105  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTOR = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:requestor").toLocked();
2106
2107 /**
2108   * Search parameter: <b>status</b>
2109   * <p>
2110   * Description: <b>The status of the payment reconciliation</b><br>
2111   * Type: <b>token</b><br>
2112   * Path: <b>PaymentReconciliation.status</b><br>
2113   * </p>
2114   */
2115  @SearchParamDefinition(name="status", path="PaymentReconciliation.status", description="The status of the payment reconciliation", type="token" )
2116  public static final String SP_STATUS = "status";
2117 /**
2118   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2119   * <p>
2120   * Description: <b>The status of the payment reconciliation</b><br>
2121   * Type: <b>token</b><br>
2122   * Path: <b>PaymentReconciliation.status</b><br>
2123   * </p>
2124   */
2125  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2126
2127
2128}
2129