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