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