001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * This resource provides the status of the payment for goods and services rendered, and the request and response resource references.
052 */
053@ResourceDef(name="PaymentNotice", profile="http://hl7.org/fhir/StructureDefinition/PaymentNotice")
054public class PaymentNotice extends DomainResource {
055
056    /**
057     * A unique identifier assigned to this payment notice.
058     */
059    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
060    @Description(shortDefinition="Business Identifier for the payment noctice", formalDefinition="A unique identifier assigned to this payment notice." )
061    protected List<Identifier> identifier;
062
063    /**
064     * The status of the resource instance.
065     */
066    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
067    @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." )
068    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status")
069    protected Enumeration<FinancialResourceStatusCodes> status;
070
071    /**
072     * Reference of resource for which payment is being made.
073     */
074    @Child(name = "request", type = {Reference.class}, order=2, min=0, max=1, modifier=false, summary=false)
075    @Description(shortDefinition="Request reference", formalDefinition="Reference of resource for which payment is being made." )
076    protected Reference request;
077
078    /**
079     * Reference of response to resource for which payment is being made.
080     */
081    @Child(name = "response", type = {Reference.class}, order=3, min=0, max=1, modifier=false, summary=false)
082    @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource for which payment is being made." )
083    protected Reference response;
084
085    /**
086     * The date when this resource was created.
087     */
088    @Child(name = "created", type = {DateTimeType.class}, order=4, min=1, max=1, modifier=false, summary=true)
089    @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." )
090    protected DateTimeType created;
091
092    /**
093     * The practitioner who is responsible for the services rendered to the patient.
094     */
095    @Child(name = "provider", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=false)
096    @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." )
097    protected Reference provider;
098
099    /**
100     * A reference to the payment which is the subject of this notice.
101     */
102    @Child(name = "payment", type = {PaymentReconciliation.class}, order=6, min=1, max=1, modifier=false, summary=true)
103    @Description(shortDefinition="Payment reference", formalDefinition="A reference to the payment which is the subject of this notice." )
104    protected Reference payment;
105
106    /**
107     * The date when the above payment action occurred.
108     */
109    @Child(name = "paymentDate", type = {DateType.class}, order=7, min=0, max=1, modifier=false, summary=false)
110    @Description(shortDefinition="Payment or clearing date", formalDefinition="The date when the above payment action occurred." )
111    protected DateType paymentDate;
112
113    /**
114     * The party who will receive or has received payment that is the subject of this notification.
115     */
116    @Child(name = "payee", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=false)
117    @Description(shortDefinition="Party being paid", formalDefinition="The party who will receive or has received payment that is the subject of this notification." )
118    protected Reference payee;
119
120    /**
121     * The party who is notified of the payment status.
122     */
123    @Child(name = "recipient", type = {Organization.class}, order=9, min=1, max=1, modifier=false, summary=true)
124    @Description(shortDefinition="Party being notified", formalDefinition="The party who is notified of the payment status." )
125    protected Reference recipient;
126
127    /**
128     * The amount sent to the payee.
129     */
130    @Child(name = "amount", type = {Money.class}, order=10, min=1, max=1, modifier=false, summary=true)
131    @Description(shortDefinition="Monetary amount of the payment", formalDefinition="The amount sent to the payee." )
132    protected Money amount;
133
134    /**
135     * A code indicating whether payment has been sent or cleared.
136     */
137    @Child(name = "paymentStatus", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=false)
138    @Description(shortDefinition="Issued or cleared Status of the payment", formalDefinition="A code indicating whether payment has been sent or cleared." )
139    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payment-status")
140    protected CodeableConcept paymentStatus;
141
142    private static final long serialVersionUID = 1832126720L;
143
144  /**
145   * Constructor
146   */
147    public PaymentNotice() {
148      super();
149    }
150
151  /**
152   * Constructor
153   */
154    public PaymentNotice(FinancialResourceStatusCodes status, Date created, Reference payment, Reference recipient, Money amount) {
155      super();
156      this.setStatus(status);
157      this.setCreated(created);
158      this.setPayment(payment);
159      this.setRecipient(recipient);
160      this.setAmount(amount);
161    }
162
163    /**
164     * @return {@link #identifier} (A unique identifier assigned to this payment notice.)
165     */
166    public List<Identifier> getIdentifier() { 
167      if (this.identifier == null)
168        this.identifier = new ArrayList<Identifier>();
169      return this.identifier;
170    }
171
172    /**
173     * @return Returns a reference to <code>this</code> for easy method chaining
174     */
175    public PaymentNotice setIdentifier(List<Identifier> theIdentifier) { 
176      this.identifier = theIdentifier;
177      return this;
178    }
179
180    public boolean hasIdentifier() { 
181      if (this.identifier == null)
182        return false;
183      for (Identifier item : this.identifier)
184        if (!item.isEmpty())
185          return true;
186      return false;
187    }
188
189    public Identifier addIdentifier() { //3
190      Identifier t = new Identifier();
191      if (this.identifier == null)
192        this.identifier = new ArrayList<Identifier>();
193      this.identifier.add(t);
194      return t;
195    }
196
197    public PaymentNotice addIdentifier(Identifier t) { //3
198      if (t == null)
199        return this;
200      if (this.identifier == null)
201        this.identifier = new ArrayList<Identifier>();
202      this.identifier.add(t);
203      return this;
204    }
205
206    /**
207     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
208     */
209    public Identifier getIdentifierFirstRep() { 
210      if (getIdentifier().isEmpty()) {
211        addIdentifier();
212      }
213      return getIdentifier().get(0);
214    }
215
216    /**
217     * @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
218     */
219    public Enumeration<FinancialResourceStatusCodes> getStatusElement() { 
220      if (this.status == null)
221        if (Configuration.errorOnAutoCreate())
222          throw new Error("Attempt to auto-create PaymentNotice.status");
223        else if (Configuration.doAutoCreate())
224          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory()); // bb
225      return this.status;
226    }
227
228    public boolean hasStatusElement() { 
229      return this.status != null && !this.status.isEmpty();
230    }
231
232    public boolean hasStatus() { 
233      return this.status != null && !this.status.isEmpty();
234    }
235
236    /**
237     * @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
238     */
239    public PaymentNotice setStatusElement(Enumeration<FinancialResourceStatusCodes> value) { 
240      this.status = value;
241      return this;
242    }
243
244    /**
245     * @return The status of the resource instance.
246     */
247    public FinancialResourceStatusCodes getStatus() { 
248      return this.status == null ? null : this.status.getValue();
249    }
250
251    /**
252     * @param value The status of the resource instance.
253     */
254    public PaymentNotice setStatus(FinancialResourceStatusCodes value) { 
255        if (this.status == null)
256          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory());
257        this.status.setValue(value);
258      return this;
259    }
260
261    /**
262     * @return {@link #request} (Reference of resource for which payment is being made.)
263     */
264    public Reference getRequest() { 
265      if (this.request == null)
266        if (Configuration.errorOnAutoCreate())
267          throw new Error("Attempt to auto-create PaymentNotice.request");
268        else if (Configuration.doAutoCreate())
269          this.request = new Reference(); // cc
270      return this.request;
271    }
272
273    public boolean hasRequest() { 
274      return this.request != null && !this.request.isEmpty();
275    }
276
277    /**
278     * @param value {@link #request} (Reference of resource for which payment is being made.)
279     */
280    public PaymentNotice setRequest(Reference value) { 
281      this.request = value;
282      return this;
283    }
284
285    /**
286     * @return {@link #response} (Reference of response to resource for which payment is being made.)
287     */
288    public Reference getResponse() { 
289      if (this.response == null)
290        if (Configuration.errorOnAutoCreate())
291          throw new Error("Attempt to auto-create PaymentNotice.response");
292        else if (Configuration.doAutoCreate())
293          this.response = new Reference(); // cc
294      return this.response;
295    }
296
297    public boolean hasResponse() { 
298      return this.response != null && !this.response.isEmpty();
299    }
300
301    /**
302     * @param value {@link #response} (Reference of response to resource for which payment is being made.)
303     */
304    public PaymentNotice setResponse(Reference value) { 
305      this.response = value;
306      return this;
307    }
308
309    /**
310     * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
311     */
312    public DateTimeType getCreatedElement() { 
313      if (this.created == null)
314        if (Configuration.errorOnAutoCreate())
315          throw new Error("Attempt to auto-create PaymentNotice.created");
316        else if (Configuration.doAutoCreate())
317          this.created = new DateTimeType(); // bb
318      return this.created;
319    }
320
321    public boolean hasCreatedElement() { 
322      return this.created != null && !this.created.isEmpty();
323    }
324
325    public boolean hasCreated() { 
326      return this.created != null && !this.created.isEmpty();
327    }
328
329    /**
330     * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
331     */
332    public PaymentNotice setCreatedElement(DateTimeType value) { 
333      this.created = value;
334      return this;
335    }
336
337    /**
338     * @return The date when this resource was created.
339     */
340    public Date getCreated() { 
341      return this.created == null ? null : this.created.getValue();
342    }
343
344    /**
345     * @param value The date when this resource was created.
346     */
347    public PaymentNotice setCreated(Date value) { 
348        if (this.created == null)
349          this.created = new DateTimeType();
350        this.created.setValue(value);
351      return this;
352    }
353
354    /**
355     * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
356     */
357    public Reference getProvider() { 
358      if (this.provider == null)
359        if (Configuration.errorOnAutoCreate())
360          throw new Error("Attempt to auto-create PaymentNotice.provider");
361        else if (Configuration.doAutoCreate())
362          this.provider = new Reference(); // cc
363      return this.provider;
364    }
365
366    public boolean hasProvider() { 
367      return this.provider != null && !this.provider.isEmpty();
368    }
369
370    /**
371     * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
372     */
373    public PaymentNotice setProvider(Reference value) { 
374      this.provider = value;
375      return this;
376    }
377
378    /**
379     * @return {@link #payment} (A reference to the payment which is the subject of this notice.)
380     */
381    public Reference getPayment() { 
382      if (this.payment == null)
383        if (Configuration.errorOnAutoCreate())
384          throw new Error("Attempt to auto-create PaymentNotice.payment");
385        else if (Configuration.doAutoCreate())
386          this.payment = new Reference(); // cc
387      return this.payment;
388    }
389
390    public boolean hasPayment() { 
391      return this.payment != null && !this.payment.isEmpty();
392    }
393
394    /**
395     * @param value {@link #payment} (A reference to the payment which is the subject of this notice.)
396     */
397    public PaymentNotice setPayment(Reference value) { 
398      this.payment = value;
399      return this;
400    }
401
402    /**
403     * @return {@link #paymentDate} (The date when the above payment action occurred.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value
404     */
405    public DateType getPaymentDateElement() { 
406      if (this.paymentDate == null)
407        if (Configuration.errorOnAutoCreate())
408          throw new Error("Attempt to auto-create PaymentNotice.paymentDate");
409        else if (Configuration.doAutoCreate())
410          this.paymentDate = new DateType(); // bb
411      return this.paymentDate;
412    }
413
414    public boolean hasPaymentDateElement() { 
415      return this.paymentDate != null && !this.paymentDate.isEmpty();
416    }
417
418    public boolean hasPaymentDate() { 
419      return this.paymentDate != null && !this.paymentDate.isEmpty();
420    }
421
422    /**
423     * @param value {@link #paymentDate} (The date when the above payment action occurred.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value
424     */
425    public PaymentNotice setPaymentDateElement(DateType value) { 
426      this.paymentDate = value;
427      return this;
428    }
429
430    /**
431     * @return The date when the above payment action occurred.
432     */
433    public Date getPaymentDate() { 
434      return this.paymentDate == null ? null : this.paymentDate.getValue();
435    }
436
437    /**
438     * @param value The date when the above payment action occurred.
439     */
440    public PaymentNotice setPaymentDate(Date value) { 
441      if (value == null)
442        this.paymentDate = null;
443      else {
444        if (this.paymentDate == null)
445          this.paymentDate = new DateType();
446        this.paymentDate.setValue(value);
447      }
448      return this;
449    }
450
451    /**
452     * @return {@link #payee} (The party who will receive or has received payment that is the subject of this notification.)
453     */
454    public Reference getPayee() { 
455      if (this.payee == null)
456        if (Configuration.errorOnAutoCreate())
457          throw new Error("Attempt to auto-create PaymentNotice.payee");
458        else if (Configuration.doAutoCreate())
459          this.payee = new Reference(); // cc
460      return this.payee;
461    }
462
463    public boolean hasPayee() { 
464      return this.payee != null && !this.payee.isEmpty();
465    }
466
467    /**
468     * @param value {@link #payee} (The party who will receive or has received payment that is the subject of this notification.)
469     */
470    public PaymentNotice setPayee(Reference value) { 
471      this.payee = value;
472      return this;
473    }
474
475    /**
476     * @return {@link #recipient} (The party who is notified of the payment status.)
477     */
478    public Reference getRecipient() { 
479      if (this.recipient == null)
480        if (Configuration.errorOnAutoCreate())
481          throw new Error("Attempt to auto-create PaymentNotice.recipient");
482        else if (Configuration.doAutoCreate())
483          this.recipient = new Reference(); // cc
484      return this.recipient;
485    }
486
487    public boolean hasRecipient() { 
488      return this.recipient != null && !this.recipient.isEmpty();
489    }
490
491    /**
492     * @param value {@link #recipient} (The party who is notified of the payment status.)
493     */
494    public PaymentNotice setRecipient(Reference value) { 
495      this.recipient = value;
496      return this;
497    }
498
499    /**
500     * @return {@link #amount} (The amount sent to the payee.)
501     */
502    public Money getAmount() { 
503      if (this.amount == null)
504        if (Configuration.errorOnAutoCreate())
505          throw new Error("Attempt to auto-create PaymentNotice.amount");
506        else if (Configuration.doAutoCreate())
507          this.amount = new Money(); // cc
508      return this.amount;
509    }
510
511    public boolean hasAmount() { 
512      return this.amount != null && !this.amount.isEmpty();
513    }
514
515    /**
516     * @param value {@link #amount} (The amount sent to the payee.)
517     */
518    public PaymentNotice setAmount(Money value) { 
519      this.amount = value;
520      return this;
521    }
522
523    /**
524     * @return {@link #paymentStatus} (A code indicating whether payment has been sent or cleared.)
525     */
526    public CodeableConcept getPaymentStatus() { 
527      if (this.paymentStatus == null)
528        if (Configuration.errorOnAutoCreate())
529          throw new Error("Attempt to auto-create PaymentNotice.paymentStatus");
530        else if (Configuration.doAutoCreate())
531          this.paymentStatus = new CodeableConcept(); // cc
532      return this.paymentStatus;
533    }
534
535    public boolean hasPaymentStatus() { 
536      return this.paymentStatus != null && !this.paymentStatus.isEmpty();
537    }
538
539    /**
540     * @param value {@link #paymentStatus} (A code indicating whether payment has been sent or cleared.)
541     */
542    public PaymentNotice setPaymentStatus(CodeableConcept value) { 
543      this.paymentStatus = value;
544      return this;
545    }
546
547      protected void listChildren(List<Property> children) {
548        super.listChildren(children);
549        children.add(new Property("identifier", "Identifier", "A unique identifier assigned to this payment notice.", 0, java.lang.Integer.MAX_VALUE, identifier));
550        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
551        children.add(new Property("request", "Reference(Any)", "Reference of resource for which payment is being made.", 0, 1, request));
552        children.add(new Property("response", "Reference(Any)", "Reference of response to resource for which payment is being made.", 0, 1, response));
553        children.add(new Property("created", "dateTime", "The date when this resource was created.", 0, 1, created));
554        children.add(new Property("provider", "Reference(Practitioner|PractitionerRole|Organization)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, provider));
555        children.add(new Property("payment", "Reference(PaymentReconciliation)", "A reference to the payment which is the subject of this notice.", 0, 1, payment));
556        children.add(new Property("paymentDate", "date", "The date when the above payment action occurred.", 0, 1, paymentDate));
557        children.add(new Property("payee", "Reference(Practitioner|PractitionerRole|Organization)", "The party who will receive or has received payment that is the subject of this notification.", 0, 1, payee));
558        children.add(new Property("recipient", "Reference(Organization)", "The party who is notified of the payment status.", 0, 1, recipient));
559        children.add(new Property("amount", "Money", "The amount sent to the payee.", 0, 1, amount));
560        children.add(new Property("paymentStatus", "CodeableConcept", "A code indicating whether payment has been sent or cleared.", 0, 1, paymentStatus));
561      }
562
563      @Override
564      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
565        switch (_hash) {
566        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier assigned to this payment notice.", 0, java.lang.Integer.MAX_VALUE, identifier);
567        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
568        case 1095692943: /*request*/  return new Property("request", "Reference(Any)", "Reference of resource for which payment is being made.", 0, 1, request);
569        case -340323263: /*response*/  return new Property("response", "Reference(Any)", "Reference of response to resource for which payment is being made.", 0, 1, response);
570        case 1028554472: /*created*/  return new Property("created", "dateTime", "The date when this resource was created.", 0, 1, created);
571        case -987494927: /*provider*/  return new Property("provider", "Reference(Practitioner|PractitionerRole|Organization)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, provider);
572        case -786681338: /*payment*/  return new Property("payment", "Reference(PaymentReconciliation)", "A reference to the payment which is the subject of this notice.", 0, 1, payment);
573        case -1540873516: /*paymentDate*/  return new Property("paymentDate", "date", "The date when the above payment action occurred.", 0, 1, paymentDate);
574        case 106443592: /*payee*/  return new Property("payee", "Reference(Practitioner|PractitionerRole|Organization)", "The party who will receive or has received payment that is the subject of this notification.", 0, 1, payee);
575        case 820081177: /*recipient*/  return new Property("recipient", "Reference(Organization)", "The party who is notified of the payment status.", 0, 1, recipient);
576        case -1413853096: /*amount*/  return new Property("amount", "Money", "The amount sent to the payee.", 0, 1, amount);
577        case 1430704536: /*paymentStatus*/  return new Property("paymentStatus", "CodeableConcept", "A code indicating whether payment has been sent or cleared.", 0, 1, paymentStatus);
578        default: return super.getNamedProperty(_hash, _name, _checkValid);
579        }
580
581      }
582
583      @Override
584      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
585        switch (hash) {
586        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
587        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FinancialResourceStatusCodes>
588        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference
589        case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Reference
590        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
591        case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference
592        case -786681338: /*payment*/ return this.payment == null ? new Base[0] : new Base[] {this.payment}; // Reference
593        case -1540873516: /*paymentDate*/ return this.paymentDate == null ? new Base[0] : new Base[] {this.paymentDate}; // DateType
594        case 106443592: /*payee*/ return this.payee == null ? new Base[0] : new Base[] {this.payee}; // Reference
595        case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : new Base[] {this.recipient}; // Reference
596        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
597        case 1430704536: /*paymentStatus*/ return this.paymentStatus == null ? new Base[0] : new Base[] {this.paymentStatus}; // CodeableConcept
598        default: return super.getProperty(hash, name, checkValid);
599        }
600
601      }
602
603      @Override
604      public Base setProperty(int hash, String name, Base value) throws FHIRException {
605        switch (hash) {
606        case -1618432855: // identifier
607          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
608          return value;
609        case -892481550: // status
610          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
611          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
612          return value;
613        case 1095692943: // request
614          this.request = TypeConvertor.castToReference(value); // Reference
615          return value;
616        case -340323263: // response
617          this.response = TypeConvertor.castToReference(value); // Reference
618          return value;
619        case 1028554472: // created
620          this.created = TypeConvertor.castToDateTime(value); // DateTimeType
621          return value;
622        case -987494927: // provider
623          this.provider = TypeConvertor.castToReference(value); // Reference
624          return value;
625        case -786681338: // payment
626          this.payment = TypeConvertor.castToReference(value); // Reference
627          return value;
628        case -1540873516: // paymentDate
629          this.paymentDate = TypeConvertor.castToDate(value); // DateType
630          return value;
631        case 106443592: // payee
632          this.payee = TypeConvertor.castToReference(value); // Reference
633          return value;
634        case 820081177: // recipient
635          this.recipient = TypeConvertor.castToReference(value); // Reference
636          return value;
637        case -1413853096: // amount
638          this.amount = TypeConvertor.castToMoney(value); // Money
639          return value;
640        case 1430704536: // paymentStatus
641          this.paymentStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
642          return value;
643        default: return super.setProperty(hash, name, value);
644        }
645
646      }
647
648      @Override
649      public Base setProperty(String name, Base value) throws FHIRException {
650        if (name.equals("identifier")) {
651          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
652        } else if (name.equals("status")) {
653          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
654          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
655        } else if (name.equals("request")) {
656          this.request = TypeConvertor.castToReference(value); // Reference
657        } else if (name.equals("response")) {
658          this.response = TypeConvertor.castToReference(value); // Reference
659        } else if (name.equals("created")) {
660          this.created = TypeConvertor.castToDateTime(value); // DateTimeType
661        } else if (name.equals("provider")) {
662          this.provider = TypeConvertor.castToReference(value); // Reference
663        } else if (name.equals("payment")) {
664          this.payment = TypeConvertor.castToReference(value); // Reference
665        } else if (name.equals("paymentDate")) {
666          this.paymentDate = TypeConvertor.castToDate(value); // DateType
667        } else if (name.equals("payee")) {
668          this.payee = TypeConvertor.castToReference(value); // Reference
669        } else if (name.equals("recipient")) {
670          this.recipient = TypeConvertor.castToReference(value); // Reference
671        } else if (name.equals("amount")) {
672          this.amount = TypeConvertor.castToMoney(value); // Money
673        } else if (name.equals("paymentStatus")) {
674          this.paymentStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
675        } else
676          return super.setProperty(name, value);
677        return value;
678      }
679
680      @Override
681      public Base makeProperty(int hash, String name) throws FHIRException {
682        switch (hash) {
683        case -1618432855:  return addIdentifier(); 
684        case -892481550:  return getStatusElement();
685        case 1095692943:  return getRequest();
686        case -340323263:  return getResponse();
687        case 1028554472:  return getCreatedElement();
688        case -987494927:  return getProvider();
689        case -786681338:  return getPayment();
690        case -1540873516:  return getPaymentDateElement();
691        case 106443592:  return getPayee();
692        case 820081177:  return getRecipient();
693        case -1413853096:  return getAmount();
694        case 1430704536:  return getPaymentStatus();
695        default: return super.makeProperty(hash, name);
696        }
697
698      }
699
700      @Override
701      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
702        switch (hash) {
703        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
704        case -892481550: /*status*/ return new String[] {"code"};
705        case 1095692943: /*request*/ return new String[] {"Reference"};
706        case -340323263: /*response*/ return new String[] {"Reference"};
707        case 1028554472: /*created*/ return new String[] {"dateTime"};
708        case -987494927: /*provider*/ return new String[] {"Reference"};
709        case -786681338: /*payment*/ return new String[] {"Reference"};
710        case -1540873516: /*paymentDate*/ return new String[] {"date"};
711        case 106443592: /*payee*/ return new String[] {"Reference"};
712        case 820081177: /*recipient*/ return new String[] {"Reference"};
713        case -1413853096: /*amount*/ return new String[] {"Money"};
714        case 1430704536: /*paymentStatus*/ return new String[] {"CodeableConcept"};
715        default: return super.getTypesForProperty(hash, name);
716        }
717
718      }
719
720      @Override
721      public Base addChild(String name) throws FHIRException {
722        if (name.equals("identifier")) {
723          return addIdentifier();
724        }
725        else if (name.equals("status")) {
726          throw new FHIRException("Cannot call addChild on a primitive type PaymentNotice.status");
727        }
728        else if (name.equals("request")) {
729          this.request = new Reference();
730          return this.request;
731        }
732        else if (name.equals("response")) {
733          this.response = new Reference();
734          return this.response;
735        }
736        else if (name.equals("created")) {
737          throw new FHIRException("Cannot call addChild on a primitive type PaymentNotice.created");
738        }
739        else if (name.equals("provider")) {
740          this.provider = new Reference();
741          return this.provider;
742        }
743        else if (name.equals("payment")) {
744          this.payment = new Reference();
745          return this.payment;
746        }
747        else if (name.equals("paymentDate")) {
748          throw new FHIRException("Cannot call addChild on a primitive type PaymentNotice.paymentDate");
749        }
750        else if (name.equals("payee")) {
751          this.payee = new Reference();
752          return this.payee;
753        }
754        else if (name.equals("recipient")) {
755          this.recipient = new Reference();
756          return this.recipient;
757        }
758        else if (name.equals("amount")) {
759          this.amount = new Money();
760          return this.amount;
761        }
762        else if (name.equals("paymentStatus")) {
763          this.paymentStatus = new CodeableConcept();
764          return this.paymentStatus;
765        }
766        else
767          return super.addChild(name);
768      }
769
770  public String fhirType() {
771    return "PaymentNotice";
772
773  }
774
775      public PaymentNotice copy() {
776        PaymentNotice dst = new PaymentNotice();
777        copyValues(dst);
778        return dst;
779      }
780
781      public void copyValues(PaymentNotice dst) {
782        super.copyValues(dst);
783        if (identifier != null) {
784          dst.identifier = new ArrayList<Identifier>();
785          for (Identifier i : identifier)
786            dst.identifier.add(i.copy());
787        };
788        dst.status = status == null ? null : status.copy();
789        dst.request = request == null ? null : request.copy();
790        dst.response = response == null ? null : response.copy();
791        dst.created = created == null ? null : created.copy();
792        dst.provider = provider == null ? null : provider.copy();
793        dst.payment = payment == null ? null : payment.copy();
794        dst.paymentDate = paymentDate == null ? null : paymentDate.copy();
795        dst.payee = payee == null ? null : payee.copy();
796        dst.recipient = recipient == null ? null : recipient.copy();
797        dst.amount = amount == null ? null : amount.copy();
798        dst.paymentStatus = paymentStatus == null ? null : paymentStatus.copy();
799      }
800
801      protected PaymentNotice typedCopy() {
802        return copy();
803      }
804
805      @Override
806      public boolean equalsDeep(Base other_) {
807        if (!super.equalsDeep(other_))
808          return false;
809        if (!(other_ instanceof PaymentNotice))
810          return false;
811        PaymentNotice o = (PaymentNotice) other_;
812        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(request, o.request, true)
813           && compareDeep(response, o.response, true) && compareDeep(created, o.created, true) && compareDeep(provider, o.provider, true)
814           && compareDeep(payment, o.payment, true) && compareDeep(paymentDate, o.paymentDate, true) && compareDeep(payee, o.payee, true)
815           && compareDeep(recipient, o.recipient, true) && compareDeep(amount, o.amount, true) && compareDeep(paymentStatus, o.paymentStatus, true)
816          ;
817      }
818
819      @Override
820      public boolean equalsShallow(Base other_) {
821        if (!super.equalsShallow(other_))
822          return false;
823        if (!(other_ instanceof PaymentNotice))
824          return false;
825        PaymentNotice o = (PaymentNotice) other_;
826        return compareValues(status, o.status, true) && compareValues(created, o.created, true) && compareValues(paymentDate, o.paymentDate, true)
827          ;
828      }
829
830      public boolean isEmpty() {
831        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, request
832          , response, created, provider, payment, paymentDate, payee, recipient, amount
833          , paymentStatus);
834      }
835
836  @Override
837  public ResourceType getResourceType() {
838    return ResourceType.PaymentNotice;
839   }
840
841 /**
842   * Search parameter: <b>created</b>
843   * <p>
844   * Description: <b>Creation date fro the notice</b><br>
845   * Type: <b>date</b><br>
846   * Path: <b>PaymentNotice.created</b><br>
847   * </p>
848   */
849  @SearchParamDefinition(name="created", path="PaymentNotice.created", description="Creation date fro the notice", type="date" )
850  public static final String SP_CREATED = "created";
851 /**
852   * <b>Fluent Client</b> search parameter constant for <b>created</b>
853   * <p>
854   * Description: <b>Creation date fro the notice</b><br>
855   * Type: <b>date</b><br>
856   * Path: <b>PaymentNotice.created</b><br>
857   * </p>
858   */
859  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED);
860
861 /**
862   * Search parameter: <b>identifier</b>
863   * <p>
864   * Description: <b>The business identifier of the notice</b><br>
865   * Type: <b>token</b><br>
866   * Path: <b>PaymentNotice.identifier</b><br>
867   * </p>
868   */
869  @SearchParamDefinition(name="identifier", path="PaymentNotice.identifier", description="The business identifier of the notice", type="token" )
870  public static final String SP_IDENTIFIER = "identifier";
871 /**
872   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
873   * <p>
874   * Description: <b>The business identifier of the notice</b><br>
875   * Type: <b>token</b><br>
876   * Path: <b>PaymentNotice.identifier</b><br>
877   * </p>
878   */
879  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
880
881 /**
882   * Search parameter: <b>payment-status</b>
883   * <p>
884   * Description: <b>The type of payment notice</b><br>
885   * Type: <b>token</b><br>
886   * Path: <b>PaymentNotice.paymentStatus</b><br>
887   * </p>
888   */
889  @SearchParamDefinition(name="payment-status", path="PaymentNotice.paymentStatus", description="The type of payment notice", type="token" )
890  public static final String SP_PAYMENT_STATUS = "payment-status";
891 /**
892   * <b>Fluent Client</b> search parameter constant for <b>payment-status</b>
893   * <p>
894   * Description: <b>The type of payment notice</b><br>
895   * Type: <b>token</b><br>
896   * Path: <b>PaymentNotice.paymentStatus</b><br>
897   * </p>
898   */
899  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PAYMENT_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PAYMENT_STATUS);
900
901 /**
902   * Search parameter: <b>provider</b>
903   * <p>
904   * Description: <b>The reference to the provider</b><br>
905   * Type: <b>reference</b><br>
906   * Path: <b>PaymentNotice.provider</b><br>
907   * </p>
908   */
909  @SearchParamDefinition(name="provider", path="PaymentNotice.provider", description="The reference to the provider", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Organization.class, Practitioner.class, PractitionerRole.class } )
910  public static final String SP_PROVIDER = "provider";
911 /**
912   * <b>Fluent Client</b> search parameter constant for <b>provider</b>
913   * <p>
914   * Description: <b>The reference to the provider</b><br>
915   * Type: <b>reference</b><br>
916   * Path: <b>PaymentNotice.provider</b><br>
917   * </p>
918   */
919  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDER);
920
921/**
922   * Constant for fluent queries to be used to add include statements. Specifies
923   * the path value of "<b>PaymentNotice:provider</b>".
924   */
925  public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDER = new ca.uhn.fhir.model.api.Include("PaymentNotice:provider").toLocked();
926
927 /**
928   * Search parameter: <b>request</b>
929   * <p>
930   * Description: <b>The Claim</b><br>
931   * Type: <b>reference</b><br>
932   * Path: <b>PaymentNotice.request</b><br>
933   * </p>
934   */
935  @SearchParamDefinition(name="request", path="PaymentNotice.request", description="The Claim", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, ArtifactAssessment.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, ClinicalUseIssue.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, ConceptMap2.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceDispense.class, DeviceMetric.class, DeviceRequest.class, DeviceUsage.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceReport.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingSelection.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, InventoryReport.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Permission.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
936  public static final String SP_REQUEST = "request";
937 /**
938   * <b>Fluent Client</b> search parameter constant for <b>request</b>
939   * <p>
940   * Description: <b>The Claim</b><br>
941   * Type: <b>reference</b><br>
942   * Path: <b>PaymentNotice.request</b><br>
943   * </p>
944   */
945  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST);
946
947/**
948   * Constant for fluent queries to be used to add include statements. Specifies
949   * the path value of "<b>PaymentNotice:request</b>".
950   */
951  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("PaymentNotice:request").toLocked();
952
953 /**
954   * Search parameter: <b>response</b>
955   * <p>
956   * Description: <b>The ClaimResponse</b><br>
957   * Type: <b>reference</b><br>
958   * Path: <b>PaymentNotice.response</b><br>
959   * </p>
960   */
961  @SearchParamDefinition(name="response", path="PaymentNotice.response", description="The ClaimResponse", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, ArtifactAssessment.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, ClinicalUseIssue.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, ConceptMap2.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceDispense.class, DeviceMetric.class, DeviceRequest.class, DeviceUsage.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceReport.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingSelection.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, InventoryReport.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Permission.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
962  public static final String SP_RESPONSE = "response";
963 /**
964   * <b>Fluent Client</b> search parameter constant for <b>response</b>
965   * <p>
966   * Description: <b>The ClaimResponse</b><br>
967   * Type: <b>reference</b><br>
968   * Path: <b>PaymentNotice.response</b><br>
969   * </p>
970   */
971  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESPONSE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESPONSE);
972
973/**
974   * Constant for fluent queries to be used to add include statements. Specifies
975   * the path value of "<b>PaymentNotice:response</b>".
976   */
977  public static final ca.uhn.fhir.model.api.Include INCLUDE_RESPONSE = new ca.uhn.fhir.model.api.Include("PaymentNotice:response").toLocked();
978
979 /**
980   * Search parameter: <b>status</b>
981   * <p>
982   * Description: <b>The status of the payment notice</b><br>
983   * Type: <b>token</b><br>
984   * Path: <b>PaymentNotice.status</b><br>
985   * </p>
986   */
987  @SearchParamDefinition(name="status", path="PaymentNotice.status", description="The status of the payment notice", type="token" )
988  public static final String SP_STATUS = "status";
989 /**
990   * <b>Fluent Client</b> search parameter constant for <b>status</b>
991   * <p>
992   * Description: <b>The status of the payment notice</b><br>
993   * Type: <b>token</b><br>
994   * Path: <b>PaymentNotice.status</b><br>
995   * </p>
996   */
997  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
998
999
1000}
1001