001package org.hl7.fhir.dstu2016may.model;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0
036import java.util.ArrayList;
037import java.util.Date;
038import java.util.List;
039
040import org.hl7.fhir.exceptions.FHIRException;
041
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.Description;
044import ca.uhn.fhir.model.api.annotation.ResourceDef;
045import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
046/**
047 * This resource provides the status of the payment for goods and services rendered, and the request and response resource references.
048 */
049@ResourceDef(name="PaymentNotice", profile="http://hl7.org/fhir/Profile/PaymentNotice")
050public class PaymentNotice extends DomainResource {
051
052    /**
053     * The Response business identifier.
054     */
055    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
056    @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." )
057    protected List<Identifier> identifier;
058
059    /**
060     * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.
061     */
062    @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true)
063    @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." )
064    protected Coding ruleset;
065
066    /**
067     * The style (standard) and version of the original material which was converted into this resource.
068     */
069    @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
070    @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." )
071    protected Coding originalRuleset;
072
073    /**
074     * The date when this resource was created.
075     */
076    @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
077    @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." )
078    protected DateTimeType created;
079
080    /**
081     * The Insurer who is target  of the request.
082     */
083    @Child(name = "target", type = {Identifier.class, Organization.class}, order=4, min=0, max=1, modifier=false, summary=true)
084    @Description(shortDefinition="Insurer or Regulatory body", formalDefinition="The Insurer who is target  of the request." )
085    protected Type target;
086
087    /**
088     * The practitioner who is responsible for the services rendered to the patient.
089     */
090    @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true)
091    @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." )
092    protected Type provider;
093
094    /**
095     * The organization which is responsible for the services rendered to the patient.
096     */
097    @Child(name = "organization", type = {Identifier.class, Organization.class}, order=6, min=0, max=1, modifier=false, summary=true)
098    @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." )
099    protected Type organization;
100
101    /**
102     * Reference of resource to reverse.
103     */
104    @Child(name = "request", type = {Identifier.class}, order=7, min=0, max=1, modifier=false, summary=true)
105    @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." )
106    protected Type request;
107
108    /**
109     * Reference of response to resource to reverse.
110     */
111    @Child(name = "response", type = {Identifier.class}, order=8, min=0, max=1, modifier=false, summary=true)
112    @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource to reverse." )
113    protected Type response;
114
115    /**
116     * The payment status, typically paid: payment sent, cleared: payment received.
117     */
118    @Child(name = "paymentStatus", type = {Coding.class}, order=9, min=1, max=1, modifier=false, summary=true)
119    @Description(shortDefinition="Status of the payment", formalDefinition="The payment status, typically paid: payment sent, cleared: payment received." )
120    protected Coding paymentStatus;
121
122    /**
123     * The date when the above payment action occurrred.
124     */
125    @Child(name = "statusDate", type = {DateType.class}, order=10, min=0, max=1, modifier=false, summary=true)
126    @Description(shortDefinition="Payment or clearing date", formalDefinition="The date when the above payment action occurrred." )
127    protected DateType statusDate;
128
129    private static final long serialVersionUID = -771143315L;
130
131  /**
132   * Constructor
133   */
134    public PaymentNotice() {
135      super();
136    }
137
138  /**
139   * Constructor
140   */
141    public PaymentNotice(Coding paymentStatus) {
142      super();
143      this.paymentStatus = paymentStatus;
144    }
145
146    /**
147     * @return {@link #identifier} (The Response business identifier.)
148     */
149    public List<Identifier> getIdentifier() { 
150      if (this.identifier == null)
151        this.identifier = new ArrayList<Identifier>();
152      return this.identifier;
153    }
154
155    public boolean hasIdentifier() { 
156      if (this.identifier == null)
157        return false;
158      for (Identifier item : this.identifier)
159        if (!item.isEmpty())
160          return true;
161      return false;
162    }
163
164    /**
165     * @return {@link #identifier} (The Response business identifier.)
166     */
167    // syntactic sugar
168    public Identifier addIdentifier() { //3
169      Identifier t = new Identifier();
170      if (this.identifier == null)
171        this.identifier = new ArrayList<Identifier>();
172      this.identifier.add(t);
173      return t;
174    }
175
176    // syntactic sugar
177    public PaymentNotice addIdentifier(Identifier t) { //3
178      if (t == null)
179        return this;
180      if (this.identifier == null)
181        this.identifier = new ArrayList<Identifier>();
182      this.identifier.add(t);
183      return this;
184    }
185
186    /**
187     * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.)
188     */
189    public Coding getRuleset() { 
190      if (this.ruleset == null)
191        if (Configuration.errorOnAutoCreate())
192          throw new Error("Attempt to auto-create PaymentNotice.ruleset");
193        else if (Configuration.doAutoCreate())
194          this.ruleset = new Coding(); // cc
195      return this.ruleset;
196    }
197
198    public boolean hasRuleset() { 
199      return this.ruleset != null && !this.ruleset.isEmpty();
200    }
201
202    /**
203     * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.)
204     */
205    public PaymentNotice setRuleset(Coding value) { 
206      this.ruleset = value;
207      return this;
208    }
209
210    /**
211     * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
212     */
213    public Coding getOriginalRuleset() { 
214      if (this.originalRuleset == null)
215        if (Configuration.errorOnAutoCreate())
216          throw new Error("Attempt to auto-create PaymentNotice.originalRuleset");
217        else if (Configuration.doAutoCreate())
218          this.originalRuleset = new Coding(); // cc
219      return this.originalRuleset;
220    }
221
222    public boolean hasOriginalRuleset() { 
223      return this.originalRuleset != null && !this.originalRuleset.isEmpty();
224    }
225
226    /**
227     * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
228     */
229    public PaymentNotice setOriginalRuleset(Coding value) { 
230      this.originalRuleset = value;
231      return this;
232    }
233
234    /**
235     * @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
236     */
237    public DateTimeType getCreatedElement() { 
238      if (this.created == null)
239        if (Configuration.errorOnAutoCreate())
240          throw new Error("Attempt to auto-create PaymentNotice.created");
241        else if (Configuration.doAutoCreate())
242          this.created = new DateTimeType(); // bb
243      return this.created;
244    }
245
246    public boolean hasCreatedElement() { 
247      return this.created != null && !this.created.isEmpty();
248    }
249
250    public boolean hasCreated() { 
251      return this.created != null && !this.created.isEmpty();
252    }
253
254    /**
255     * @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
256     */
257    public PaymentNotice setCreatedElement(DateTimeType value) { 
258      this.created = value;
259      return this;
260    }
261
262    /**
263     * @return The date when this resource was created.
264     */
265    public Date getCreated() { 
266      return this.created == null ? null : this.created.getValue();
267    }
268
269    /**
270     * @param value The date when this resource was created.
271     */
272    public PaymentNotice setCreated(Date value) { 
273      if (value == null)
274        this.created = null;
275      else {
276        if (this.created == null)
277          this.created = new DateTimeType();
278        this.created.setValue(value);
279      }
280      return this;
281    }
282
283    /**
284     * @return {@link #target} (The Insurer who is target  of the request.)
285     */
286    public Type getTarget() { 
287      return this.target;
288    }
289
290    /**
291     * @return {@link #target} (The Insurer who is target  of the request.)
292     */
293    public Identifier getTargetIdentifier() throws FHIRException { 
294      if (!(this.target instanceof Identifier))
295        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.target.getClass().getName()+" was encountered");
296      return (Identifier) this.target;
297    }
298
299    public boolean hasTargetIdentifier() { 
300      return this.target instanceof Identifier;
301    }
302
303    /**
304     * @return {@link #target} (The Insurer who is target  of the request.)
305     */
306    public Reference getTargetReference() throws FHIRException { 
307      if (!(this.target instanceof Reference))
308        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered");
309      return (Reference) this.target;
310    }
311
312    public boolean hasTargetReference() { 
313      return this.target instanceof Reference;
314    }
315
316    public boolean hasTarget() { 
317      return this.target != null && !this.target.isEmpty();
318    }
319
320    /**
321     * @param value {@link #target} (The Insurer who is target  of the request.)
322     */
323    public PaymentNotice setTarget(Type value) { 
324      this.target = value;
325      return this;
326    }
327
328    /**
329     * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
330     */
331    public Type getProvider() { 
332      return this.provider;
333    }
334
335    /**
336     * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
337     */
338    public Identifier getProviderIdentifier() throws FHIRException { 
339      if (!(this.provider instanceof Identifier))
340        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered");
341      return (Identifier) this.provider;
342    }
343
344    public boolean hasProviderIdentifier() { 
345      return this.provider instanceof Identifier;
346    }
347
348    /**
349     * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
350     */
351    public Reference getProviderReference() throws FHIRException { 
352      if (!(this.provider instanceof Reference))
353        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered");
354      return (Reference) this.provider;
355    }
356
357    public boolean hasProviderReference() { 
358      return this.provider instanceof Reference;
359    }
360
361    public boolean hasProvider() { 
362      return this.provider != null && !this.provider.isEmpty();
363    }
364
365    /**
366     * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
367     */
368    public PaymentNotice setProvider(Type value) { 
369      this.provider = value;
370      return this;
371    }
372
373    /**
374     * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.)
375     */
376    public Type getOrganization() { 
377      return this.organization;
378    }
379
380    /**
381     * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.)
382     */
383    public Identifier getOrganizationIdentifier() throws FHIRException { 
384      if (!(this.organization instanceof Identifier))
385        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered");
386      return (Identifier) this.organization;
387    }
388
389    public boolean hasOrganizationIdentifier() { 
390      return this.organization instanceof Identifier;
391    }
392
393    /**
394     * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.)
395     */
396    public Reference getOrganizationReference() throws FHIRException { 
397      if (!(this.organization instanceof Reference))
398        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered");
399      return (Reference) this.organization;
400    }
401
402    public boolean hasOrganizationReference() { 
403      return this.organization instanceof Reference;
404    }
405
406    public boolean hasOrganization() { 
407      return this.organization != null && !this.organization.isEmpty();
408    }
409
410    /**
411     * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.)
412     */
413    public PaymentNotice setOrganization(Type value) { 
414      this.organization = value;
415      return this;
416    }
417
418    /**
419     * @return {@link #request} (Reference of resource to reverse.)
420     */
421    public Type getRequest() { 
422      return this.request;
423    }
424
425    /**
426     * @return {@link #request} (Reference of resource to reverse.)
427     */
428    public Identifier getRequestIdentifier() throws FHIRException { 
429      if (!(this.request instanceof Identifier))
430        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered");
431      return (Identifier) this.request;
432    }
433
434    public boolean hasRequestIdentifier() { 
435      return this.request instanceof Identifier;
436    }
437
438    /**
439     * @return {@link #request} (Reference of resource to reverse.)
440     */
441    public Reference getRequestReference() throws FHIRException { 
442      if (!(this.request instanceof Reference))
443        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered");
444      return (Reference) this.request;
445    }
446
447    public boolean hasRequestReference() { 
448      return this.request instanceof Reference;
449    }
450
451    public boolean hasRequest() { 
452      return this.request != null && !this.request.isEmpty();
453    }
454
455    /**
456     * @param value {@link #request} (Reference of resource to reverse.)
457     */
458    public PaymentNotice setRequest(Type value) { 
459      this.request = value;
460      return this;
461    }
462
463    /**
464     * @return {@link #response} (Reference of response to resource to reverse.)
465     */
466    public Type getResponse() { 
467      return this.response;
468    }
469
470    /**
471     * @return {@link #response} (Reference of response to resource to reverse.)
472     */
473    public Identifier getResponseIdentifier() throws FHIRException { 
474      if (!(this.response instanceof Identifier))
475        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.response.getClass().getName()+" was encountered");
476      return (Identifier) this.response;
477    }
478
479    public boolean hasResponseIdentifier() { 
480      return this.response instanceof Identifier;
481    }
482
483    /**
484     * @return {@link #response} (Reference of response to resource to reverse.)
485     */
486    public Reference getResponseReference() throws FHIRException { 
487      if (!(this.response instanceof Reference))
488        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.response.getClass().getName()+" was encountered");
489      return (Reference) this.response;
490    }
491
492    public boolean hasResponseReference() { 
493      return this.response instanceof Reference;
494    }
495
496    public boolean hasResponse() { 
497      return this.response != null && !this.response.isEmpty();
498    }
499
500    /**
501     * @param value {@link #response} (Reference of response to resource to reverse.)
502     */
503    public PaymentNotice setResponse(Type value) { 
504      this.response = value;
505      return this;
506    }
507
508    /**
509     * @return {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.)
510     */
511    public Coding getPaymentStatus() { 
512      if (this.paymentStatus == null)
513        if (Configuration.errorOnAutoCreate())
514          throw new Error("Attempt to auto-create PaymentNotice.paymentStatus");
515        else if (Configuration.doAutoCreate())
516          this.paymentStatus = new Coding(); // cc
517      return this.paymentStatus;
518    }
519
520    public boolean hasPaymentStatus() { 
521      return this.paymentStatus != null && !this.paymentStatus.isEmpty();
522    }
523
524    /**
525     * @param value {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.)
526     */
527    public PaymentNotice setPaymentStatus(Coding value) { 
528      this.paymentStatus = value;
529      return this;
530    }
531
532    /**
533     * @return {@link #statusDate} (The date when the above payment action occurrred.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value
534     */
535    public DateType getStatusDateElement() { 
536      if (this.statusDate == null)
537        if (Configuration.errorOnAutoCreate())
538          throw new Error("Attempt to auto-create PaymentNotice.statusDate");
539        else if (Configuration.doAutoCreate())
540          this.statusDate = new DateType(); // bb
541      return this.statusDate;
542    }
543
544    public boolean hasStatusDateElement() { 
545      return this.statusDate != null && !this.statusDate.isEmpty();
546    }
547
548    public boolean hasStatusDate() { 
549      return this.statusDate != null && !this.statusDate.isEmpty();
550    }
551
552    /**
553     * @param value {@link #statusDate} (The date when the above payment action occurrred.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value
554     */
555    public PaymentNotice setStatusDateElement(DateType value) { 
556      this.statusDate = value;
557      return this;
558    }
559
560    /**
561     * @return The date when the above payment action occurrred.
562     */
563    public Date getStatusDate() { 
564      return this.statusDate == null ? null : this.statusDate.getValue();
565    }
566
567    /**
568     * @param value The date when the above payment action occurrred.
569     */
570    public PaymentNotice setStatusDate(Date value) { 
571      if (value == null)
572        this.statusDate = null;
573      else {
574        if (this.statusDate == null)
575          this.statusDate = new DateType();
576        this.statusDate.setValue(value);
577      }
578      return this;
579    }
580
581      protected void listChildren(List<Property> childrenList) {
582        super.listChildren(childrenList);
583        childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
584        childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset));
585        childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
586        childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created));
587        childrenList.add(new Property("target[x]", "Identifier|Reference(Organization)", "The Insurer who is target  of the request.", 0, java.lang.Integer.MAX_VALUE, target));
588        childrenList.add(new Property("provider[x]", "Identifier|Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider));
589        childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization));
590        childrenList.add(new Property("request[x]", "Identifier|Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request));
591        childrenList.add(new Property("response[x]", "Identifier|Reference(Any)", "Reference of response to resource to reverse.", 0, java.lang.Integer.MAX_VALUE, response));
592        childrenList.add(new Property("paymentStatus", "Coding", "The payment status, typically paid: payment sent, cleared: payment received.", 0, java.lang.Integer.MAX_VALUE, paymentStatus));
593        childrenList.add(new Property("statusDate", "date", "The date when the above payment action occurrred.", 0, java.lang.Integer.MAX_VALUE, statusDate));
594      }
595
596      @Override
597      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
598        switch (hash) {
599        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
600        case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding
601        case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding
602        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
603        case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type
604        case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type
605        case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type
606        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type
607        case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Type
608        case 1430704536: /*paymentStatus*/ return this.paymentStatus == null ? new Base[0] : new Base[] {this.paymentStatus}; // Coding
609        case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : new Base[] {this.statusDate}; // DateType
610        default: return super.getProperty(hash, name, checkValid);
611        }
612
613      }
614
615      @Override
616      public void setProperty(int hash, String name, Base value) throws FHIRException {
617        switch (hash) {
618        case -1618432855: // identifier
619          this.getIdentifier().add(castToIdentifier(value)); // Identifier
620          break;
621        case 1548678118: // ruleset
622          this.ruleset = castToCoding(value); // Coding
623          break;
624        case 1089373397: // originalRuleset
625          this.originalRuleset = castToCoding(value); // Coding
626          break;
627        case 1028554472: // created
628          this.created = castToDateTime(value); // DateTimeType
629          break;
630        case -880905839: // target
631          this.target = (Type) value; // Type
632          break;
633        case -987494927: // provider
634          this.provider = (Type) value; // Type
635          break;
636        case 1178922291: // organization
637          this.organization = (Type) value; // Type
638          break;
639        case 1095692943: // request
640          this.request = (Type) value; // Type
641          break;
642        case -340323263: // response
643          this.response = (Type) value; // Type
644          break;
645        case 1430704536: // paymentStatus
646          this.paymentStatus = castToCoding(value); // Coding
647          break;
648        case 247524032: // statusDate
649          this.statusDate = castToDate(value); // DateType
650          break;
651        default: super.setProperty(hash, name, value);
652        }
653
654      }
655
656      @Override
657      public void setProperty(String name, Base value) throws FHIRException {
658        if (name.equals("identifier"))
659          this.getIdentifier().add(castToIdentifier(value));
660        else if (name.equals("ruleset"))
661          this.ruleset = castToCoding(value); // Coding
662        else if (name.equals("originalRuleset"))
663          this.originalRuleset = castToCoding(value); // Coding
664        else if (name.equals("created"))
665          this.created = castToDateTime(value); // DateTimeType
666        else if (name.equals("target[x]"))
667          this.target = (Type) value; // Type
668        else if (name.equals("provider[x]"))
669          this.provider = (Type) value; // Type
670        else if (name.equals("organization[x]"))
671          this.organization = (Type) value; // Type
672        else if (name.equals("request[x]"))
673          this.request = (Type) value; // Type
674        else if (name.equals("response[x]"))
675          this.response = (Type) value; // Type
676        else if (name.equals("paymentStatus"))
677          this.paymentStatus = castToCoding(value); // Coding
678        else if (name.equals("statusDate"))
679          this.statusDate = castToDate(value); // DateType
680        else
681          super.setProperty(name, value);
682      }
683
684      @Override
685      public Base makeProperty(int hash, String name) throws FHIRException {
686        switch (hash) {
687        case -1618432855:  return addIdentifier(); // Identifier
688        case 1548678118:  return getRuleset(); // Coding
689        case 1089373397:  return getOriginalRuleset(); // Coding
690        case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType
691        case -815579825:  return getTarget(); // Type
692        case 2064698607:  return getProvider(); // Type
693        case 1326483053:  return getOrganization(); // Type
694        case 37106577:  return getRequest(); // Type
695        case 1847549087:  return getResponse(); // Type
696        case 1430704536:  return getPaymentStatus(); // Coding
697        case 247524032: throw new FHIRException("Cannot make property statusDate as it is not a complex type"); // DateType
698        default: return super.makeProperty(hash, name);
699        }
700
701      }
702
703      @Override
704      public Base addChild(String name) throws FHIRException {
705        if (name.equals("identifier")) {
706          return addIdentifier();
707        }
708        else if (name.equals("ruleset")) {
709          this.ruleset = new Coding();
710          return this.ruleset;
711        }
712        else if (name.equals("originalRuleset")) {
713          this.originalRuleset = new Coding();
714          return this.originalRuleset;
715        }
716        else if (name.equals("created")) {
717          throw new FHIRException("Cannot call addChild on a primitive type PaymentNotice.created");
718        }
719        else if (name.equals("targetIdentifier")) {
720          this.target = new Identifier();
721          return this.target;
722        }
723        else if (name.equals("targetReference")) {
724          this.target = new Reference();
725          return this.target;
726        }
727        else if (name.equals("providerIdentifier")) {
728          this.provider = new Identifier();
729          return this.provider;
730        }
731        else if (name.equals("providerReference")) {
732          this.provider = new Reference();
733          return this.provider;
734        }
735        else if (name.equals("organizationIdentifier")) {
736          this.organization = new Identifier();
737          return this.organization;
738        }
739        else if (name.equals("organizationReference")) {
740          this.organization = new Reference();
741          return this.organization;
742        }
743        else if (name.equals("requestIdentifier")) {
744          this.request = new Identifier();
745          return this.request;
746        }
747        else if (name.equals("requestReference")) {
748          this.request = new Reference();
749          return this.request;
750        }
751        else if (name.equals("responseIdentifier")) {
752          this.response = new Identifier();
753          return this.response;
754        }
755        else if (name.equals("responseReference")) {
756          this.response = new Reference();
757          return this.response;
758        }
759        else if (name.equals("paymentStatus")) {
760          this.paymentStatus = new Coding();
761          return this.paymentStatus;
762        }
763        else if (name.equals("statusDate")) {
764          throw new FHIRException("Cannot call addChild on a primitive type PaymentNotice.statusDate");
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        if (identifier != null) {
779          dst.identifier = new ArrayList<Identifier>();
780          for (Identifier i : identifier)
781            dst.identifier.add(i.copy());
782        };
783        dst.ruleset = ruleset == null ? null : ruleset.copy();
784        dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
785        dst.created = created == null ? null : created.copy();
786        dst.target = target == null ? null : target.copy();
787        dst.provider = provider == null ? null : provider.copy();
788        dst.organization = organization == null ? null : organization.copy();
789        dst.request = request == null ? null : request.copy();
790        dst.response = response == null ? null : response.copy();
791        dst.paymentStatus = paymentStatus == null ? null : paymentStatus.copy();
792        dst.statusDate = statusDate == null ? null : statusDate.copy();
793        return dst;
794      }
795
796      protected PaymentNotice typedCopy() {
797        return copy();
798      }
799
800      @Override
801      public boolean equalsDeep(Base other) {
802        if (!super.equalsDeep(other))
803          return false;
804        if (!(other instanceof PaymentNotice))
805          return false;
806        PaymentNotice o = (PaymentNotice) other;
807        return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true)
808           && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true)
809           && compareDeep(organization, o.organization, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true)
810           && compareDeep(paymentStatus, o.paymentStatus, true) && compareDeep(statusDate, o.statusDate, true)
811          ;
812      }
813
814      @Override
815      public boolean equalsShallow(Base other) {
816        if (!super.equalsShallow(other))
817          return false;
818        if (!(other instanceof PaymentNotice))
819          return false;
820        PaymentNotice o = (PaymentNotice) other;
821        return compareValues(created, o.created, true) && compareValues(statusDate, o.statusDate, true);
822      }
823
824      public boolean isEmpty() {
825        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty())
826           && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty())
827           && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty())
828           && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (paymentStatus == null || paymentStatus.isEmpty())
829           && (statusDate == null || statusDate.isEmpty());
830      }
831
832  @Override
833  public ResourceType getResourceType() {
834    return ResourceType.PaymentNotice;
835   }
836
837 /**
838   * Search parameter: <b>paymentstatus</b>
839   * <p>
840   * Description: <b>The type of payment notice</b><br>
841   * Type: <b>token</b><br>
842   * Path: <b>PaymentNotice.paymentStatus</b><br>
843   * </p>
844   */
845  @SearchParamDefinition(name="paymentstatus", path="PaymentNotice.paymentStatus", description="The type of payment notice", type="token" )
846  public static final String SP_PAYMENTSTATUS = "paymentstatus";
847 /**
848   * <b>Fluent Client</b> search parameter constant for <b>paymentstatus</b>
849   * <p>
850   * Description: <b>The type of payment notice</b><br>
851   * Type: <b>token</b><br>
852   * Path: <b>PaymentNotice.paymentStatus</b><br>
853   * </p>
854   */
855  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PAYMENTSTATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PAYMENTSTATUS);
856
857 /**
858   * Search parameter: <b>statusdate</b>
859   * <p>
860   * Description: <b>The date of the payment action</b><br>
861   * Type: <b>date</b><br>
862   * Path: <b>PaymentNotice.statusDate</b><br>
863   * </p>
864   */
865  @SearchParamDefinition(name="statusdate", path="PaymentNotice.statusDate", description="The date of the payment action", type="date" )
866  public static final String SP_STATUSDATE = "statusdate";
867 /**
868   * <b>Fluent Client</b> search parameter constant for <b>statusdate</b>
869   * <p>
870   * Description: <b>The date of the payment action</b><br>
871   * Type: <b>date</b><br>
872   * Path: <b>PaymentNotice.statusDate</b><br>
873   * </p>
874   */
875  public static final ca.uhn.fhir.rest.gclient.DateClientParam STATUSDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_STATUSDATE);
876
877 /**
878   * Search parameter: <b>created</b>
879   * <p>
880   * Description: <b>Creation date fro the notice</b><br>
881   * Type: <b>date</b><br>
882   * Path: <b>PaymentNotice.created</b><br>
883   * </p>
884   */
885  @SearchParamDefinition(name="created", path="PaymentNotice.created", description="Creation date fro the notice", type="date" )
886  public static final String SP_CREATED = "created";
887 /**
888   * <b>Fluent Client</b> search parameter constant for <b>created</b>
889   * <p>
890   * Description: <b>Creation date fro the notice</b><br>
891   * Type: <b>date</b><br>
892   * Path: <b>PaymentNotice.created</b><br>
893   * </p>
894   */
895  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED);
896
897 /**
898   * Search parameter: <b>requestidentifier</b>
899   * <p>
900   * Description: <b>The Claim</b><br>
901   * Type: <b>token</b><br>
902   * Path: <b>PaymentNotice.requestIdentifier</b><br>
903   * </p>
904   */
905  @SearchParamDefinition(name="requestidentifier", path="PaymentNotice.request.as(Identifier)", description="The Claim", type="token" )
906  public static final String SP_REQUESTIDENTIFIER = "requestidentifier";
907 /**
908   * <b>Fluent Client</b> search parameter constant for <b>requestidentifier</b>
909   * <p>
910   * Description: <b>The Claim</b><br>
911   * Type: <b>token</b><br>
912   * Path: <b>PaymentNotice.requestIdentifier</b><br>
913   * </p>
914   */
915  public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTIDENTIFIER);
916
917 /**
918   * Search parameter: <b>providerreference</b>
919   * <p>
920   * Description: <b>The reference to the provider</b><br>
921   * Type: <b>reference</b><br>
922   * Path: <b>PaymentNotice.providerReference</b><br>
923   * </p>
924   */
925  @SearchParamDefinition(name="providerreference", path="PaymentNotice.provider.as(Reference)", description="The reference to the provider", type="reference" )
926  public static final String SP_PROVIDERREFERENCE = "providerreference";
927 /**
928   * <b>Fluent Client</b> search parameter constant for <b>providerreference</b>
929   * <p>
930   * Description: <b>The reference to the provider</b><br>
931   * Type: <b>reference</b><br>
932   * Path: <b>PaymentNotice.providerReference</b><br>
933   * </p>
934   */
935  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDERREFERENCE);
936
937/**
938   * Constant for fluent queries to be used to add include statements. Specifies
939   * the path value of "<b>PaymentNotice:providerreference</b>".
940   */
941  public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentNotice:providerreference").toLocked();
942
943 /**
944   * Search parameter: <b>requestreference</b>
945   * <p>
946   * Description: <b>The Claim</b><br>
947   * Type: <b>reference</b><br>
948   * Path: <b>PaymentNotice.requestReference</b><br>
949   * </p>
950   */
951  @SearchParamDefinition(name="requestreference", path="PaymentNotice.request.as(Reference)", description="The Claim", type="reference" )
952  public static final String SP_REQUESTREFERENCE = "requestreference";
953 /**
954   * <b>Fluent Client</b> search parameter constant for <b>requestreference</b>
955   * <p>
956   * Description: <b>The Claim</b><br>
957   * Type: <b>reference</b><br>
958   * Path: <b>PaymentNotice.requestReference</b><br>
959   * </p>
960   */
961  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTREFERENCE);
962
963/**
964   * Constant for fluent queries to be used to add include statements. Specifies
965   * the path value of "<b>PaymentNotice:requestreference</b>".
966   */
967  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentNotice:requestreference").toLocked();
968
969 /**
970   * Search parameter: <b>responsereference</b>
971   * <p>
972   * Description: <b>The ClaimResponse</b><br>
973   * Type: <b>reference</b><br>
974   * Path: <b>PaymentNotice.responseReference</b><br>
975   * </p>
976   */
977  @SearchParamDefinition(name="responsereference", path="PaymentNotice.response.as(Reference)", description="The ClaimResponse", type="reference" )
978  public static final String SP_RESPONSEREFERENCE = "responsereference";
979 /**
980   * <b>Fluent Client</b> search parameter constant for <b>responsereference</b>
981   * <p>
982   * Description: <b>The ClaimResponse</b><br>
983   * Type: <b>reference</b><br>
984   * Path: <b>PaymentNotice.responseReference</b><br>
985   * </p>
986   */
987  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESPONSEREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESPONSEREFERENCE);
988
989/**
990   * Constant for fluent queries to be used to add include statements. Specifies
991   * the path value of "<b>PaymentNotice:responsereference</b>".
992   */
993  public static final ca.uhn.fhir.model.api.Include INCLUDE_RESPONSEREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentNotice:responsereference").toLocked();
994
995 /**
996   * Search parameter: <b>organizationidentifier</b>
997   * <p>
998   * Description: <b>The organization who generated this resource</b><br>
999   * Type: <b>token</b><br>
1000   * Path: <b>PaymentNotice.organizationIdentifier</b><br>
1001   * </p>
1002   */
1003  @SearchParamDefinition(name="organizationidentifier", path="PaymentNotice.organization.as(Identifier)", description="The organization who generated this resource", type="token" )
1004  public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier";
1005 /**
1006   * <b>Fluent Client</b> search parameter constant for <b>organizationidentifier</b>
1007   * <p>
1008   * Description: <b>The organization who generated this resource</b><br>
1009   * Type: <b>token</b><br>
1010   * Path: <b>PaymentNotice.organizationIdentifier</b><br>
1011   * </p>
1012   */
1013  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER);
1014
1015 /**
1016   * Search parameter: <b>organizationreference</b>
1017   * <p>
1018   * Description: <b>The organization who generated this resource</b><br>
1019   * Type: <b>reference</b><br>
1020   * Path: <b>PaymentNotice.organizationReference</b><br>
1021   * </p>
1022   */
1023  @SearchParamDefinition(name="organizationreference", path="PaymentNotice.organization.as(Reference)", description="The organization who generated this resource", type="reference" )
1024  public static final String SP_ORGANIZATIONREFERENCE = "organizationreference";
1025 /**
1026   * <b>Fluent Client</b> search parameter constant for <b>organizationreference</b>
1027   * <p>
1028   * Description: <b>The organization who generated this resource</b><br>
1029   * Type: <b>reference</b><br>
1030   * Path: <b>PaymentNotice.organizationReference</b><br>
1031   * </p>
1032   */
1033  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE);
1034
1035/**
1036   * Constant for fluent queries to be used to add include statements. Specifies
1037   * the path value of "<b>PaymentNotice:organizationreference</b>".
1038   */
1039  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentNotice:organizationreference").toLocked();
1040
1041 /**
1042   * Search parameter: <b>responseidentifier</b>
1043   * <p>
1044   * Description: <b>The ClaimResponse</b><br>
1045   * Type: <b>token</b><br>
1046   * Path: <b>PaymentNotice.responseIdentifier</b><br>
1047   * </p>
1048   */
1049  @SearchParamDefinition(name="responseidentifier", path="PaymentNotice.response.as(Identifier)", description="The ClaimResponse", type="token" )
1050  public static final String SP_RESPONSEIDENTIFIER = "responseidentifier";
1051 /**
1052   * <b>Fluent Client</b> search parameter constant for <b>responseidentifier</b>
1053   * <p>
1054   * Description: <b>The ClaimResponse</b><br>
1055   * Type: <b>token</b><br>
1056   * Path: <b>PaymentNotice.responseIdentifier</b><br>
1057   * </p>
1058   */
1059  public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESPONSEIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESPONSEIDENTIFIER);
1060
1061 /**
1062   * Search parameter: <b>identifier</b>
1063   * <p>
1064   * Description: <b>The business identifier of the notice</b><br>
1065   * Type: <b>token</b><br>
1066   * Path: <b>PaymentNotice.identifier</b><br>
1067   * </p>
1068   */
1069  @SearchParamDefinition(name="identifier", path="PaymentNotice.identifier", description="The business identifier of the notice", type="token" )
1070  public static final String SP_IDENTIFIER = "identifier";
1071 /**
1072   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1073   * <p>
1074   * Description: <b>The business identifier of the notice</b><br>
1075   * Type: <b>token</b><br>
1076   * Path: <b>PaymentNotice.identifier</b><br>
1077   * </p>
1078   */
1079  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1080
1081 /**
1082   * Search parameter: <b>provideridentifier</b>
1083   * <p>
1084   * Description: <b>The reference to the provider</b><br>
1085   * Type: <b>token</b><br>
1086   * Path: <b>PaymentNotice.providerIdentifier</b><br>
1087   * </p>
1088   */
1089  @SearchParamDefinition(name="provideridentifier", path="PaymentNotice.provider.as(Identifier)", description="The reference to the provider", type="token" )
1090  public static final String SP_PROVIDERIDENTIFIER = "provideridentifier";
1091 /**
1092   * <b>Fluent Client</b> search parameter constant for <b>provideridentifier</b>
1093   * <p>
1094   * Description: <b>The reference to the provider</b><br>
1095   * Type: <b>token</b><br>
1096   * Path: <b>PaymentNotice.providerIdentifier</b><br>
1097   * </p>
1098   */
1099  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PROVIDERIDENTIFIER);
1100
1101
1102}