001package org.hl7.fhir.dstu3.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
035import java.util.ArrayList;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.exceptions.FHIRException;
040import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
041import org.hl7.fhir.utilities.Utilities;
042
043import ca.uhn.fhir.model.api.annotation.Block;
044import ca.uhn.fhir.model.api.annotation.Child;
045import ca.uhn.fhir.model.api.annotation.Description;
046import ca.uhn.fhir.model.api.annotation.ResourceDef;
047import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
048/**
049 * This resource provides processing status, errors and notes from the processing of a resource.
050 */
051@ResourceDef(name="ProcessResponse", profile="http://hl7.org/fhir/Profile/ProcessResponse")
052public class ProcessResponse extends DomainResource {
053
054    public enum ProcessResponseStatus {
055        /**
056         * The instance is currently in-force.
057         */
058        ACTIVE, 
059        /**
060         * The instance is withdrawn, rescinded or reversed.
061         */
062        CANCELLED, 
063        /**
064         * A new instance the contents of which is not complete.
065         */
066        DRAFT, 
067        /**
068         * The instance was entered in error.
069         */
070        ENTEREDINERROR, 
071        /**
072         * added to help the parsers with the generic types
073         */
074        NULL;
075        public static ProcessResponseStatus fromCode(String codeString) throws FHIRException {
076            if (codeString == null || "".equals(codeString))
077                return null;
078        if ("active".equals(codeString))
079          return ACTIVE;
080        if ("cancelled".equals(codeString))
081          return CANCELLED;
082        if ("draft".equals(codeString))
083          return DRAFT;
084        if ("entered-in-error".equals(codeString))
085          return ENTEREDINERROR;
086        if (Configuration.isAcceptInvalidEnums())
087          return null;
088        else
089          throw new FHIRException("Unknown ProcessResponseStatus code '"+codeString+"'");
090        }
091        public String toCode() {
092          switch (this) {
093            case ACTIVE: return "active";
094            case CANCELLED: return "cancelled";
095            case DRAFT: return "draft";
096            case ENTEREDINERROR: return "entered-in-error";
097            case NULL: return null;
098            default: return "?";
099          }
100        }
101        public String getSystem() {
102          switch (this) {
103            case ACTIVE: return "http://hl7.org/fhir/fm-status";
104            case CANCELLED: return "http://hl7.org/fhir/fm-status";
105            case DRAFT: return "http://hl7.org/fhir/fm-status";
106            case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status";
107            case NULL: return null;
108            default: return "?";
109          }
110        }
111        public String getDefinition() {
112          switch (this) {
113            case ACTIVE: return "The instance is currently in-force.";
114            case CANCELLED: return "The instance is withdrawn, rescinded or reversed.";
115            case DRAFT: return "A new instance the contents of which is not complete.";
116            case ENTEREDINERROR: return "The instance was entered in error.";
117            case NULL: return null;
118            default: return "?";
119          }
120        }
121        public String getDisplay() {
122          switch (this) {
123            case ACTIVE: return "Active";
124            case CANCELLED: return "Cancelled";
125            case DRAFT: return "Draft";
126            case ENTEREDINERROR: return "Entered in Error";
127            case NULL: return null;
128            default: return "?";
129          }
130        }
131    }
132
133  public static class ProcessResponseStatusEnumFactory implements EnumFactory<ProcessResponseStatus> {
134    public ProcessResponseStatus fromCode(String codeString) throws IllegalArgumentException {
135      if (codeString == null || "".equals(codeString))
136            if (codeString == null || "".equals(codeString))
137                return null;
138        if ("active".equals(codeString))
139          return ProcessResponseStatus.ACTIVE;
140        if ("cancelled".equals(codeString))
141          return ProcessResponseStatus.CANCELLED;
142        if ("draft".equals(codeString))
143          return ProcessResponseStatus.DRAFT;
144        if ("entered-in-error".equals(codeString))
145          return ProcessResponseStatus.ENTEREDINERROR;
146        throw new IllegalArgumentException("Unknown ProcessResponseStatus code '"+codeString+"'");
147        }
148        public Enumeration<ProcessResponseStatus> fromType(Base code) throws FHIRException {
149          if (code == null)
150            return null;
151          if (code.isEmpty())
152            return new Enumeration<ProcessResponseStatus>(this);
153          String codeString = ((PrimitiveType) code).asStringValue();
154          if (codeString == null || "".equals(codeString))
155            return null;
156        if ("active".equals(codeString))
157          return new Enumeration<ProcessResponseStatus>(this, ProcessResponseStatus.ACTIVE);
158        if ("cancelled".equals(codeString))
159          return new Enumeration<ProcessResponseStatus>(this, ProcessResponseStatus.CANCELLED);
160        if ("draft".equals(codeString))
161          return new Enumeration<ProcessResponseStatus>(this, ProcessResponseStatus.DRAFT);
162        if ("entered-in-error".equals(codeString))
163          return new Enumeration<ProcessResponseStatus>(this, ProcessResponseStatus.ENTEREDINERROR);
164        throw new FHIRException("Unknown ProcessResponseStatus code '"+codeString+"'");
165        }
166    public String toCode(ProcessResponseStatus code) {
167      if (code == ProcessResponseStatus.ACTIVE)
168        return "active";
169      if (code == ProcessResponseStatus.CANCELLED)
170        return "cancelled";
171      if (code == ProcessResponseStatus.DRAFT)
172        return "draft";
173      if (code == ProcessResponseStatus.ENTEREDINERROR)
174        return "entered-in-error";
175      return "?";
176      }
177    public String toSystem(ProcessResponseStatus code) {
178      return code.getSystem();
179      }
180    }
181
182    @Block()
183    public static class ProcessResponseProcessNoteComponent extends BackboneElement implements IBaseBackboneElement {
184        /**
185         * The note purpose: Print/Display.
186         */
187        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
188        @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." )
189        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/note-type")
190        protected CodeableConcept type;
191
192        /**
193         * The note text.
194         */
195        @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
196        @Description(shortDefinition="Comment on the processing", formalDefinition="The note text." )
197        protected StringType text;
198
199        private static final long serialVersionUID = 874830709L;
200
201    /**
202     * Constructor
203     */
204      public ProcessResponseProcessNoteComponent() {
205        super();
206      }
207
208        /**
209         * @return {@link #type} (The note purpose: Print/Display.)
210         */
211        public CodeableConcept getType() { 
212          if (this.type == null)
213            if (Configuration.errorOnAutoCreate())
214              throw new Error("Attempt to auto-create ProcessResponseProcessNoteComponent.type");
215            else if (Configuration.doAutoCreate())
216              this.type = new CodeableConcept(); // cc
217          return this.type;
218        }
219
220        public boolean hasType() { 
221          return this.type != null && !this.type.isEmpty();
222        }
223
224        /**
225         * @param value {@link #type} (The note purpose: Print/Display.)
226         */
227        public ProcessResponseProcessNoteComponent setType(CodeableConcept value)  { 
228          this.type = value;
229          return this;
230        }
231
232        /**
233         * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
234         */
235        public StringType getTextElement() { 
236          if (this.text == null)
237            if (Configuration.errorOnAutoCreate())
238              throw new Error("Attempt to auto-create ProcessResponseProcessNoteComponent.text");
239            else if (Configuration.doAutoCreate())
240              this.text = new StringType(); // bb
241          return this.text;
242        }
243
244        public boolean hasTextElement() { 
245          return this.text != null && !this.text.isEmpty();
246        }
247
248        public boolean hasText() { 
249          return this.text != null && !this.text.isEmpty();
250        }
251
252        /**
253         * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
254         */
255        public ProcessResponseProcessNoteComponent setTextElement(StringType value) { 
256          this.text = value;
257          return this;
258        }
259
260        /**
261         * @return The note text.
262         */
263        public String getText() { 
264          return this.text == null ? null : this.text.getValue();
265        }
266
267        /**
268         * @param value The note text.
269         */
270        public ProcessResponseProcessNoteComponent setText(String value) { 
271          if (Utilities.noString(value))
272            this.text = null;
273          else {
274            if (this.text == null)
275              this.text = new StringType();
276            this.text.setValue(value);
277          }
278          return this;
279        }
280
281        protected void listChildren(List<Property> children) {
282          super.listChildren(children);
283          children.add(new Property("type", "CodeableConcept", "The note purpose: Print/Display.", 0, 1, type));
284          children.add(new Property("text", "string", "The note text.", 0, 1, text));
285        }
286
287        @Override
288        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
289          switch (_hash) {
290          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The note purpose: Print/Display.", 0, 1, type);
291          case 3556653: /*text*/  return new Property("text", "string", "The note text.", 0, 1, text);
292          default: return super.getNamedProperty(_hash, _name, _checkValid);
293          }
294
295        }
296
297      @Override
298      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
299        switch (hash) {
300        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
301        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
302        default: return super.getProperty(hash, name, checkValid);
303        }
304
305      }
306
307      @Override
308      public Base setProperty(int hash, String name, Base value) throws FHIRException {
309        switch (hash) {
310        case 3575610: // type
311          this.type = castToCodeableConcept(value); // CodeableConcept
312          return value;
313        case 3556653: // text
314          this.text = castToString(value); // StringType
315          return value;
316        default: return super.setProperty(hash, name, value);
317        }
318
319      }
320
321      @Override
322      public Base setProperty(String name, Base value) throws FHIRException {
323        if (name.equals("type")) {
324          this.type = castToCodeableConcept(value); // CodeableConcept
325        } else if (name.equals("text")) {
326          this.text = castToString(value); // StringType
327        } else
328          return super.setProperty(name, value);
329        return value;
330      }
331
332      @Override
333      public Base makeProperty(int hash, String name) throws FHIRException {
334        switch (hash) {
335        case 3575610:  return getType(); 
336        case 3556653:  return getTextElement();
337        default: return super.makeProperty(hash, name);
338        }
339
340      }
341
342      @Override
343      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
344        switch (hash) {
345        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
346        case 3556653: /*text*/ return new String[] {"string"};
347        default: return super.getTypesForProperty(hash, name);
348        }
349
350      }
351
352      @Override
353      public Base addChild(String name) throws FHIRException {
354        if (name.equals("type")) {
355          this.type = new CodeableConcept();
356          return this.type;
357        }
358        else if (name.equals("text")) {
359          throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.text");
360        }
361        else
362          return super.addChild(name);
363      }
364
365      public ProcessResponseProcessNoteComponent copy() {
366        ProcessResponseProcessNoteComponent dst = new ProcessResponseProcessNoteComponent();
367        copyValues(dst);
368        dst.type = type == null ? null : type.copy();
369        dst.text = text == null ? null : text.copy();
370        return dst;
371      }
372
373      @Override
374      public boolean equalsDeep(Base other_) {
375        if (!super.equalsDeep(other_))
376          return false;
377        if (!(other_ instanceof ProcessResponseProcessNoteComponent))
378          return false;
379        ProcessResponseProcessNoteComponent o = (ProcessResponseProcessNoteComponent) other_;
380        return compareDeep(type, o.type, true) && compareDeep(text, o.text, true);
381      }
382
383      @Override
384      public boolean equalsShallow(Base other_) {
385        if (!super.equalsShallow(other_))
386          return false;
387        if (!(other_ instanceof ProcessResponseProcessNoteComponent))
388          return false;
389        ProcessResponseProcessNoteComponent o = (ProcessResponseProcessNoteComponent) other_;
390        return compareValues(text, o.text, true);
391      }
392
393      public boolean isEmpty() {
394        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, text);
395      }
396
397  public String fhirType() {
398    return "ProcessResponse.processNote";
399
400  }
401
402  }
403
404    /**
405     * The Response business identifier.
406     */
407    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
408    @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." )
409    protected List<Identifier> identifier;
410
411    /**
412     * The status of the resource instance.
413     */
414    @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true)
415    @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." )
416    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status")
417    protected Enumeration<ProcessResponseStatus> status;
418
419    /**
420     * The date when the enclosed suite of services were performed or completed.
421     */
422    @Child(name = "created", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
423    @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." )
424    protected DateTimeType created;
425
426    /**
427     * The organization who produced this adjudicated response.
428     */
429    @Child(name = "organization", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=false)
430    @Description(shortDefinition="Authoring Organization", formalDefinition="The organization who produced this adjudicated response." )
431    protected Reference organization;
432
433    /**
434     * The actual object that is the target of the reference (The organization who produced this adjudicated response.)
435     */
436    protected Organization organizationTarget;
437
438    /**
439     * Original request resource reference.
440     */
441    @Child(name = "request", type = {Reference.class}, order=4, min=0, max=1, modifier=false, summary=false)
442    @Description(shortDefinition="Request reference", formalDefinition="Original request resource reference." )
443    protected Reference request;
444
445    /**
446     * The actual object that is the target of the reference (Original request resource reference.)
447     */
448    protected Resource requestTarget;
449
450    /**
451     * Transaction status: error, complete, held.
452     */
453    @Child(name = "outcome", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false)
454    @Description(shortDefinition="Processing outcome", formalDefinition="Transaction status: error, complete, held." )
455    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/process-outcome")
456    protected CodeableConcept outcome;
457
458    /**
459     * A description of the status of the adjudication or processing.
460     */
461    @Child(name = "disposition", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
462    @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication or processing." )
463    protected StringType disposition;
464
465    /**
466     * The practitioner who is responsible for the services rendered to the patient.
467     */
468    @Child(name = "requestProvider", type = {Practitioner.class}, order=7, min=0, max=1, modifier=false, summary=false)
469    @Description(shortDefinition="Responsible Practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." )
470    protected Reference requestProvider;
471
472    /**
473     * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.)
474     */
475    protected Practitioner requestProviderTarget;
476
477    /**
478     * The organization which is responsible for the services rendered to the patient.
479     */
480    @Child(name = "requestOrganization", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=false)
481    @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." )
482    protected Reference requestOrganization;
483
484    /**
485     * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.)
486     */
487    protected Organization requestOrganizationTarget;
488
489    /**
490     * The form to be used for printing the content.
491     */
492    @Child(name = "form", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false)
493    @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." )
494    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/forms")
495    protected CodeableConcept form;
496
497    /**
498     * Suite of processing notes or additional requirements if the processing has been held.
499     */
500    @Child(name = "processNote", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
501    @Description(shortDefinition="Processing comments or additional requirements", formalDefinition="Suite of processing notes or additional requirements if the processing has been held." )
502    protected List<ProcessResponseProcessNoteComponent> processNote;
503
504    /**
505     * Processing errors.
506     */
507    @Child(name = "error", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
508    @Description(shortDefinition="Error code", formalDefinition="Processing errors." )
509    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adjudication-error")
510    protected List<CodeableConcept> error;
511
512    /**
513     * Request for additional supporting or authorizing information, such as: documents, images or resources.
514     */
515    @Child(name = "communicationRequest", type = {CommunicationRequest.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
516    @Description(shortDefinition="Request for additional information", formalDefinition="Request for additional supporting or authorizing information, such as: documents, images or resources." )
517    protected List<Reference> communicationRequest;
518    /**
519     * The actual objects that are the target of the reference (Request for additional supporting or authorizing information, such as: documents, images or resources.)
520     */
521    protected List<CommunicationRequest> communicationRequestTarget;
522
523
524    private static final long serialVersionUID = -2058462467L;
525
526  /**
527   * Constructor
528   */
529    public ProcessResponse() {
530      super();
531    }
532
533    /**
534     * @return {@link #identifier} (The Response business identifier.)
535     */
536    public List<Identifier> getIdentifier() { 
537      if (this.identifier == null)
538        this.identifier = new ArrayList<Identifier>();
539      return this.identifier;
540    }
541
542    /**
543     * @return Returns a reference to <code>this</code> for easy method chaining
544     */
545    public ProcessResponse setIdentifier(List<Identifier> theIdentifier) { 
546      this.identifier = theIdentifier;
547      return this;
548    }
549
550    public boolean hasIdentifier() { 
551      if (this.identifier == null)
552        return false;
553      for (Identifier item : this.identifier)
554        if (!item.isEmpty())
555          return true;
556      return false;
557    }
558
559    public Identifier addIdentifier() { //3
560      Identifier t = new Identifier();
561      if (this.identifier == null)
562        this.identifier = new ArrayList<Identifier>();
563      this.identifier.add(t);
564      return t;
565    }
566
567    public ProcessResponse addIdentifier(Identifier t) { //3
568      if (t == null)
569        return this;
570      if (this.identifier == null)
571        this.identifier = new ArrayList<Identifier>();
572      this.identifier.add(t);
573      return this;
574    }
575
576    /**
577     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
578     */
579    public Identifier getIdentifierFirstRep() { 
580      if (getIdentifier().isEmpty()) {
581        addIdentifier();
582      }
583      return getIdentifier().get(0);
584    }
585
586    /**
587     * @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
588     */
589    public Enumeration<ProcessResponseStatus> getStatusElement() { 
590      if (this.status == null)
591        if (Configuration.errorOnAutoCreate())
592          throw new Error("Attempt to auto-create ProcessResponse.status");
593        else if (Configuration.doAutoCreate())
594          this.status = new Enumeration<ProcessResponseStatus>(new ProcessResponseStatusEnumFactory()); // bb
595      return this.status;
596    }
597
598    public boolean hasStatusElement() { 
599      return this.status != null && !this.status.isEmpty();
600    }
601
602    public boolean hasStatus() { 
603      return this.status != null && !this.status.isEmpty();
604    }
605
606    /**
607     * @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
608     */
609    public ProcessResponse setStatusElement(Enumeration<ProcessResponseStatus> value) { 
610      this.status = value;
611      return this;
612    }
613
614    /**
615     * @return The status of the resource instance.
616     */
617    public ProcessResponseStatus getStatus() { 
618      return this.status == null ? null : this.status.getValue();
619    }
620
621    /**
622     * @param value The status of the resource instance.
623     */
624    public ProcessResponse setStatus(ProcessResponseStatus value) { 
625      if (value == null)
626        this.status = null;
627      else {
628        if (this.status == null)
629          this.status = new Enumeration<ProcessResponseStatus>(new ProcessResponseStatusEnumFactory());
630        this.status.setValue(value);
631      }
632      return this;
633    }
634
635    /**
636     * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
637     */
638    public DateTimeType getCreatedElement() { 
639      if (this.created == null)
640        if (Configuration.errorOnAutoCreate())
641          throw new Error("Attempt to auto-create ProcessResponse.created");
642        else if (Configuration.doAutoCreate())
643          this.created = new DateTimeType(); // bb
644      return this.created;
645    }
646
647    public boolean hasCreatedElement() { 
648      return this.created != null && !this.created.isEmpty();
649    }
650
651    public boolean hasCreated() { 
652      return this.created != null && !this.created.isEmpty();
653    }
654
655    /**
656     * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
657     */
658    public ProcessResponse setCreatedElement(DateTimeType value) { 
659      this.created = value;
660      return this;
661    }
662
663    /**
664     * @return The date when the enclosed suite of services were performed or completed.
665     */
666    public Date getCreated() { 
667      return this.created == null ? null : this.created.getValue();
668    }
669
670    /**
671     * @param value The date when the enclosed suite of services were performed or completed.
672     */
673    public ProcessResponse setCreated(Date value) { 
674      if (value == null)
675        this.created = null;
676      else {
677        if (this.created == null)
678          this.created = new DateTimeType();
679        this.created.setValue(value);
680      }
681      return this;
682    }
683
684    /**
685     * @return {@link #organization} (The organization who produced this adjudicated response.)
686     */
687    public Reference getOrganization() { 
688      if (this.organization == null)
689        if (Configuration.errorOnAutoCreate())
690          throw new Error("Attempt to auto-create ProcessResponse.organization");
691        else if (Configuration.doAutoCreate())
692          this.organization = new Reference(); // cc
693      return this.organization;
694    }
695
696    public boolean hasOrganization() { 
697      return this.organization != null && !this.organization.isEmpty();
698    }
699
700    /**
701     * @param value {@link #organization} (The organization who produced this adjudicated response.)
702     */
703    public ProcessResponse setOrganization(Reference value)  { 
704      this.organization = value;
705      return this;
706    }
707
708    /**
709     * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization who produced this adjudicated response.)
710     */
711    public Organization getOrganizationTarget() { 
712      if (this.organizationTarget == null)
713        if (Configuration.errorOnAutoCreate())
714          throw new Error("Attempt to auto-create ProcessResponse.organization");
715        else if (Configuration.doAutoCreate())
716          this.organizationTarget = new Organization(); // aa
717      return this.organizationTarget;
718    }
719
720    /**
721     * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization who produced this adjudicated response.)
722     */
723    public ProcessResponse setOrganizationTarget(Organization value) { 
724      this.organizationTarget = value;
725      return this;
726    }
727
728    /**
729     * @return {@link #request} (Original request resource reference.)
730     */
731    public Reference getRequest() { 
732      if (this.request == null)
733        if (Configuration.errorOnAutoCreate())
734          throw new Error("Attempt to auto-create ProcessResponse.request");
735        else if (Configuration.doAutoCreate())
736          this.request = new Reference(); // cc
737      return this.request;
738    }
739
740    public boolean hasRequest() { 
741      return this.request != null && !this.request.isEmpty();
742    }
743
744    /**
745     * @param value {@link #request} (Original request resource reference.)
746     */
747    public ProcessResponse setRequest(Reference value)  { 
748      this.request = value;
749      return this;
750    }
751
752    /**
753     * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.)
754     */
755    public Resource getRequestTarget() { 
756      return this.requestTarget;
757    }
758
759    /**
760     * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.)
761     */
762    public ProcessResponse setRequestTarget(Resource value) { 
763      this.requestTarget = value;
764      return this;
765    }
766
767    /**
768     * @return {@link #outcome} (Transaction status: error, complete, held.)
769     */
770    public CodeableConcept getOutcome() { 
771      if (this.outcome == null)
772        if (Configuration.errorOnAutoCreate())
773          throw new Error("Attempt to auto-create ProcessResponse.outcome");
774        else if (Configuration.doAutoCreate())
775          this.outcome = new CodeableConcept(); // cc
776      return this.outcome;
777    }
778
779    public boolean hasOutcome() { 
780      return this.outcome != null && !this.outcome.isEmpty();
781    }
782
783    /**
784     * @param value {@link #outcome} (Transaction status: error, complete, held.)
785     */
786    public ProcessResponse setOutcome(CodeableConcept value)  { 
787      this.outcome = value;
788      return this;
789    }
790
791    /**
792     * @return {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value
793     */
794    public StringType getDispositionElement() { 
795      if (this.disposition == null)
796        if (Configuration.errorOnAutoCreate())
797          throw new Error("Attempt to auto-create ProcessResponse.disposition");
798        else if (Configuration.doAutoCreate())
799          this.disposition = new StringType(); // bb
800      return this.disposition;
801    }
802
803    public boolean hasDispositionElement() { 
804      return this.disposition != null && !this.disposition.isEmpty();
805    }
806
807    public boolean hasDisposition() { 
808      return this.disposition != null && !this.disposition.isEmpty();
809    }
810
811    /**
812     * @param value {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value
813     */
814    public ProcessResponse setDispositionElement(StringType value) { 
815      this.disposition = value;
816      return this;
817    }
818
819    /**
820     * @return A description of the status of the adjudication or processing.
821     */
822    public String getDisposition() { 
823      return this.disposition == null ? null : this.disposition.getValue();
824    }
825
826    /**
827     * @param value A description of the status of the adjudication or processing.
828     */
829    public ProcessResponse setDisposition(String value) { 
830      if (Utilities.noString(value))
831        this.disposition = null;
832      else {
833        if (this.disposition == null)
834          this.disposition = new StringType();
835        this.disposition.setValue(value);
836      }
837      return this;
838    }
839
840    /**
841     * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.)
842     */
843    public Reference getRequestProvider() { 
844      if (this.requestProvider == null)
845        if (Configuration.errorOnAutoCreate())
846          throw new Error("Attempt to auto-create ProcessResponse.requestProvider");
847        else if (Configuration.doAutoCreate())
848          this.requestProvider = new Reference(); // cc
849      return this.requestProvider;
850    }
851
852    public boolean hasRequestProvider() { 
853      return this.requestProvider != null && !this.requestProvider.isEmpty();
854    }
855
856    /**
857     * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.)
858     */
859    public ProcessResponse setRequestProvider(Reference value)  { 
860      this.requestProvider = value;
861      return this;
862    }
863
864    /**
865     * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.)
866     */
867    public Practitioner getRequestProviderTarget() { 
868      if (this.requestProviderTarget == null)
869        if (Configuration.errorOnAutoCreate())
870          throw new Error("Attempt to auto-create ProcessResponse.requestProvider");
871        else if (Configuration.doAutoCreate())
872          this.requestProviderTarget = new Practitioner(); // aa
873      return this.requestProviderTarget;
874    }
875
876    /**
877     * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.)
878     */
879    public ProcessResponse setRequestProviderTarget(Practitioner value) { 
880      this.requestProviderTarget = value;
881      return this;
882    }
883
884    /**
885     * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.)
886     */
887    public Reference getRequestOrganization() { 
888      if (this.requestOrganization == null)
889        if (Configuration.errorOnAutoCreate())
890          throw new Error("Attempt to auto-create ProcessResponse.requestOrganization");
891        else if (Configuration.doAutoCreate())
892          this.requestOrganization = new Reference(); // cc
893      return this.requestOrganization;
894    }
895
896    public boolean hasRequestOrganization() { 
897      return this.requestOrganization != null && !this.requestOrganization.isEmpty();
898    }
899
900    /**
901     * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.)
902     */
903    public ProcessResponse setRequestOrganization(Reference value)  { 
904      this.requestOrganization = value;
905      return this;
906    }
907
908    /**
909     * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.)
910     */
911    public Organization getRequestOrganizationTarget() { 
912      if (this.requestOrganizationTarget == null)
913        if (Configuration.errorOnAutoCreate())
914          throw new Error("Attempt to auto-create ProcessResponse.requestOrganization");
915        else if (Configuration.doAutoCreate())
916          this.requestOrganizationTarget = new Organization(); // aa
917      return this.requestOrganizationTarget;
918    }
919
920    /**
921     * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.)
922     */
923    public ProcessResponse setRequestOrganizationTarget(Organization value) { 
924      this.requestOrganizationTarget = value;
925      return this;
926    }
927
928    /**
929     * @return {@link #form} (The form to be used for printing the content.)
930     */
931    public CodeableConcept getForm() { 
932      if (this.form == null)
933        if (Configuration.errorOnAutoCreate())
934          throw new Error("Attempt to auto-create ProcessResponse.form");
935        else if (Configuration.doAutoCreate())
936          this.form = new CodeableConcept(); // cc
937      return this.form;
938    }
939
940    public boolean hasForm() { 
941      return this.form != null && !this.form.isEmpty();
942    }
943
944    /**
945     * @param value {@link #form} (The form to be used for printing the content.)
946     */
947    public ProcessResponse setForm(CodeableConcept value)  { 
948      this.form = value;
949      return this;
950    }
951
952    /**
953     * @return {@link #processNote} (Suite of processing notes or additional requirements if the processing has been held.)
954     */
955    public List<ProcessResponseProcessNoteComponent> getProcessNote() { 
956      if (this.processNote == null)
957        this.processNote = new ArrayList<ProcessResponseProcessNoteComponent>();
958      return this.processNote;
959    }
960
961    /**
962     * @return Returns a reference to <code>this</code> for easy method chaining
963     */
964    public ProcessResponse setProcessNote(List<ProcessResponseProcessNoteComponent> theProcessNote) { 
965      this.processNote = theProcessNote;
966      return this;
967    }
968
969    public boolean hasProcessNote() { 
970      if (this.processNote == null)
971        return false;
972      for (ProcessResponseProcessNoteComponent item : this.processNote)
973        if (!item.isEmpty())
974          return true;
975      return false;
976    }
977
978    public ProcessResponseProcessNoteComponent addProcessNote() { //3
979      ProcessResponseProcessNoteComponent t = new ProcessResponseProcessNoteComponent();
980      if (this.processNote == null)
981        this.processNote = new ArrayList<ProcessResponseProcessNoteComponent>();
982      this.processNote.add(t);
983      return t;
984    }
985
986    public ProcessResponse addProcessNote(ProcessResponseProcessNoteComponent t) { //3
987      if (t == null)
988        return this;
989      if (this.processNote == null)
990        this.processNote = new ArrayList<ProcessResponseProcessNoteComponent>();
991      this.processNote.add(t);
992      return this;
993    }
994
995    /**
996     * @return The first repetition of repeating field {@link #processNote}, creating it if it does not already exist
997     */
998    public ProcessResponseProcessNoteComponent getProcessNoteFirstRep() { 
999      if (getProcessNote().isEmpty()) {
1000        addProcessNote();
1001      }
1002      return getProcessNote().get(0);
1003    }
1004
1005    /**
1006     * @return {@link #error} (Processing errors.)
1007     */
1008    public List<CodeableConcept> getError() { 
1009      if (this.error == null)
1010        this.error = new ArrayList<CodeableConcept>();
1011      return this.error;
1012    }
1013
1014    /**
1015     * @return Returns a reference to <code>this</code> for easy method chaining
1016     */
1017    public ProcessResponse setError(List<CodeableConcept> theError) { 
1018      this.error = theError;
1019      return this;
1020    }
1021
1022    public boolean hasError() { 
1023      if (this.error == null)
1024        return false;
1025      for (CodeableConcept item : this.error)
1026        if (!item.isEmpty())
1027          return true;
1028      return false;
1029    }
1030
1031    public CodeableConcept addError() { //3
1032      CodeableConcept t = new CodeableConcept();
1033      if (this.error == null)
1034        this.error = new ArrayList<CodeableConcept>();
1035      this.error.add(t);
1036      return t;
1037    }
1038
1039    public ProcessResponse addError(CodeableConcept t) { //3
1040      if (t == null)
1041        return this;
1042      if (this.error == null)
1043        this.error = new ArrayList<CodeableConcept>();
1044      this.error.add(t);
1045      return this;
1046    }
1047
1048    /**
1049     * @return The first repetition of repeating field {@link #error}, creating it if it does not already exist
1050     */
1051    public CodeableConcept getErrorFirstRep() { 
1052      if (getError().isEmpty()) {
1053        addError();
1054      }
1055      return getError().get(0);
1056    }
1057
1058    /**
1059     * @return {@link #communicationRequest} (Request for additional supporting or authorizing information, such as: documents, images or resources.)
1060     */
1061    public List<Reference> getCommunicationRequest() { 
1062      if (this.communicationRequest == null)
1063        this.communicationRequest = new ArrayList<Reference>();
1064      return this.communicationRequest;
1065    }
1066
1067    /**
1068     * @return Returns a reference to <code>this</code> for easy method chaining
1069     */
1070    public ProcessResponse setCommunicationRequest(List<Reference> theCommunicationRequest) { 
1071      this.communicationRequest = theCommunicationRequest;
1072      return this;
1073    }
1074
1075    public boolean hasCommunicationRequest() { 
1076      if (this.communicationRequest == null)
1077        return false;
1078      for (Reference item : this.communicationRequest)
1079        if (!item.isEmpty())
1080          return true;
1081      return false;
1082    }
1083
1084    public Reference addCommunicationRequest() { //3
1085      Reference t = new Reference();
1086      if (this.communicationRequest == null)
1087        this.communicationRequest = new ArrayList<Reference>();
1088      this.communicationRequest.add(t);
1089      return t;
1090    }
1091
1092    public ProcessResponse addCommunicationRequest(Reference t) { //3
1093      if (t == null)
1094        return this;
1095      if (this.communicationRequest == null)
1096        this.communicationRequest = new ArrayList<Reference>();
1097      this.communicationRequest.add(t);
1098      return this;
1099    }
1100
1101    /**
1102     * @return The first repetition of repeating field {@link #communicationRequest}, creating it if it does not already exist
1103     */
1104    public Reference getCommunicationRequestFirstRep() { 
1105      if (getCommunicationRequest().isEmpty()) {
1106        addCommunicationRequest();
1107      }
1108      return getCommunicationRequest().get(0);
1109    }
1110
1111    /**
1112     * @deprecated Use Reference#setResource(IBaseResource) instead
1113     */
1114    @Deprecated
1115    public List<CommunicationRequest> getCommunicationRequestTarget() { 
1116      if (this.communicationRequestTarget == null)
1117        this.communicationRequestTarget = new ArrayList<CommunicationRequest>();
1118      return this.communicationRequestTarget;
1119    }
1120
1121    /**
1122     * @deprecated Use Reference#setResource(IBaseResource) instead
1123     */
1124    @Deprecated
1125    public CommunicationRequest addCommunicationRequestTarget() { 
1126      CommunicationRequest r = new CommunicationRequest();
1127      if (this.communicationRequestTarget == null)
1128        this.communicationRequestTarget = new ArrayList<CommunicationRequest>();
1129      this.communicationRequestTarget.add(r);
1130      return r;
1131    }
1132
1133      protected void listChildren(List<Property> children) {
1134        super.listChildren(children);
1135        children.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
1136        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
1137        children.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, 1, created));
1138        children.add(new Property("organization", "Reference(Organization)", "The organization who produced this adjudicated response.", 0, 1, organization));
1139        children.add(new Property("request", "Reference(Any)", "Original request resource reference.", 0, 1, request));
1140        children.add(new Property("outcome", "CodeableConcept", "Transaction status: error, complete, held.", 0, 1, outcome));
1141        children.add(new Property("disposition", "string", "A description of the status of the adjudication or processing.", 0, 1, disposition));
1142        children.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, requestProvider));
1143        children.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, 1, requestOrganization));
1144        children.add(new Property("form", "CodeableConcept", "The form to be used for printing the content.", 0, 1, form));
1145        children.add(new Property("processNote", "", "Suite of processing notes or additional requirements if the processing has been held.", 0, java.lang.Integer.MAX_VALUE, processNote));
1146        children.add(new Property("error", "CodeableConcept", "Processing errors.", 0, java.lang.Integer.MAX_VALUE, error));
1147        children.add(new Property("communicationRequest", "Reference(CommunicationRequest)", "Request for additional supporting or authorizing information, such as: documents, images or resources.", 0, java.lang.Integer.MAX_VALUE, communicationRequest));
1148      }
1149
1150      @Override
1151      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1152        switch (_hash) {
1153        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier);
1154        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
1155        case 1028554472: /*created*/  return new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, 1, created);
1156        case 1178922291: /*organization*/  return new Property("organization", "Reference(Organization)", "The organization who produced this adjudicated response.", 0, 1, organization);
1157        case 1095692943: /*request*/  return new Property("request", "Reference(Any)", "Original request resource reference.", 0, 1, request);
1158        case -1106507950: /*outcome*/  return new Property("outcome", "CodeableConcept", "Transaction status: error, complete, held.", 0, 1, outcome);
1159        case 583380919: /*disposition*/  return new Property("disposition", "string", "A description of the status of the adjudication or processing.", 0, 1, disposition);
1160        case 1601527200: /*requestProvider*/  return new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, requestProvider);
1161        case 599053666: /*requestOrganization*/  return new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, 1, requestOrganization);
1162        case 3148996: /*form*/  return new Property("form", "CodeableConcept", "The form to be used for printing the content.", 0, 1, form);
1163        case 202339073: /*processNote*/  return new Property("processNote", "", "Suite of processing notes or additional requirements if the processing has been held.", 0, java.lang.Integer.MAX_VALUE, processNote);
1164        case 96784904: /*error*/  return new Property("error", "CodeableConcept", "Processing errors.", 0, java.lang.Integer.MAX_VALUE, error);
1165        case -2071896615: /*communicationRequest*/  return new Property("communicationRequest", "Reference(CommunicationRequest)", "Request for additional supporting or authorizing information, such as: documents, images or resources.", 0, java.lang.Integer.MAX_VALUE, communicationRequest);
1166        default: return super.getNamedProperty(_hash, _name, _checkValid);
1167        }
1168
1169      }
1170
1171      @Override
1172      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1173        switch (hash) {
1174        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1175        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ProcessResponseStatus>
1176        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
1177        case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference
1178        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference
1179        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept
1180        case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType
1181        case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Reference
1182        case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Reference
1183        case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // CodeableConcept
1184        case 202339073: /*processNote*/ return this.processNote == null ? new Base[0] : this.processNote.toArray(new Base[this.processNote.size()]); // ProcessResponseProcessNoteComponent
1185        case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // CodeableConcept
1186        case -2071896615: /*communicationRequest*/ return this.communicationRequest == null ? new Base[0] : this.communicationRequest.toArray(new Base[this.communicationRequest.size()]); // Reference
1187        default: return super.getProperty(hash, name, checkValid);
1188        }
1189
1190      }
1191
1192      @Override
1193      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1194        switch (hash) {
1195        case -1618432855: // identifier
1196          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1197          return value;
1198        case -892481550: // status
1199          value = new ProcessResponseStatusEnumFactory().fromType(castToCode(value));
1200          this.status = (Enumeration) value; // Enumeration<ProcessResponseStatus>
1201          return value;
1202        case 1028554472: // created
1203          this.created = castToDateTime(value); // DateTimeType
1204          return value;
1205        case 1178922291: // organization
1206          this.organization = castToReference(value); // Reference
1207          return value;
1208        case 1095692943: // request
1209          this.request = castToReference(value); // Reference
1210          return value;
1211        case -1106507950: // outcome
1212          this.outcome = castToCodeableConcept(value); // CodeableConcept
1213          return value;
1214        case 583380919: // disposition
1215          this.disposition = castToString(value); // StringType
1216          return value;
1217        case 1601527200: // requestProvider
1218          this.requestProvider = castToReference(value); // Reference
1219          return value;
1220        case 599053666: // requestOrganization
1221          this.requestOrganization = castToReference(value); // Reference
1222          return value;
1223        case 3148996: // form
1224          this.form = castToCodeableConcept(value); // CodeableConcept
1225          return value;
1226        case 202339073: // processNote
1227          this.getProcessNote().add((ProcessResponseProcessNoteComponent) value); // ProcessResponseProcessNoteComponent
1228          return value;
1229        case 96784904: // error
1230          this.getError().add(castToCodeableConcept(value)); // CodeableConcept
1231          return value;
1232        case -2071896615: // communicationRequest
1233          this.getCommunicationRequest().add(castToReference(value)); // Reference
1234          return value;
1235        default: return super.setProperty(hash, name, value);
1236        }
1237
1238      }
1239
1240      @Override
1241      public Base setProperty(String name, Base value) throws FHIRException {
1242        if (name.equals("identifier")) {
1243          this.getIdentifier().add(castToIdentifier(value));
1244        } else if (name.equals("status")) {
1245          value = new ProcessResponseStatusEnumFactory().fromType(castToCode(value));
1246          this.status = (Enumeration) value; // Enumeration<ProcessResponseStatus>
1247        } else if (name.equals("created")) {
1248          this.created = castToDateTime(value); // DateTimeType
1249        } else if (name.equals("organization")) {
1250          this.organization = castToReference(value); // Reference
1251        } else if (name.equals("request")) {
1252          this.request = castToReference(value); // Reference
1253        } else if (name.equals("outcome")) {
1254          this.outcome = castToCodeableConcept(value); // CodeableConcept
1255        } else if (name.equals("disposition")) {
1256          this.disposition = castToString(value); // StringType
1257        } else if (name.equals("requestProvider")) {
1258          this.requestProvider = castToReference(value); // Reference
1259        } else if (name.equals("requestOrganization")) {
1260          this.requestOrganization = castToReference(value); // Reference
1261        } else if (name.equals("form")) {
1262          this.form = castToCodeableConcept(value); // CodeableConcept
1263        } else if (name.equals("processNote")) {
1264          this.getProcessNote().add((ProcessResponseProcessNoteComponent) value);
1265        } else if (name.equals("error")) {
1266          this.getError().add(castToCodeableConcept(value));
1267        } else if (name.equals("communicationRequest")) {
1268          this.getCommunicationRequest().add(castToReference(value));
1269        } else
1270          return super.setProperty(name, value);
1271        return value;
1272      }
1273
1274      @Override
1275      public Base makeProperty(int hash, String name) throws FHIRException {
1276        switch (hash) {
1277        case -1618432855:  return addIdentifier(); 
1278        case -892481550:  return getStatusElement();
1279        case 1028554472:  return getCreatedElement();
1280        case 1178922291:  return getOrganization(); 
1281        case 1095692943:  return getRequest(); 
1282        case -1106507950:  return getOutcome(); 
1283        case 583380919:  return getDispositionElement();
1284        case 1601527200:  return getRequestProvider(); 
1285        case 599053666:  return getRequestOrganization(); 
1286        case 3148996:  return getForm(); 
1287        case 202339073:  return addProcessNote(); 
1288        case 96784904:  return addError(); 
1289        case -2071896615:  return addCommunicationRequest(); 
1290        default: return super.makeProperty(hash, name);
1291        }
1292
1293      }
1294
1295      @Override
1296      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1297        switch (hash) {
1298        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1299        case -892481550: /*status*/ return new String[] {"code"};
1300        case 1028554472: /*created*/ return new String[] {"dateTime"};
1301        case 1178922291: /*organization*/ return new String[] {"Reference"};
1302        case 1095692943: /*request*/ return new String[] {"Reference"};
1303        case -1106507950: /*outcome*/ return new String[] {"CodeableConcept"};
1304        case 583380919: /*disposition*/ return new String[] {"string"};
1305        case 1601527200: /*requestProvider*/ return new String[] {"Reference"};
1306        case 599053666: /*requestOrganization*/ return new String[] {"Reference"};
1307        case 3148996: /*form*/ return new String[] {"CodeableConcept"};
1308        case 202339073: /*processNote*/ return new String[] {};
1309        case 96784904: /*error*/ return new String[] {"CodeableConcept"};
1310        case -2071896615: /*communicationRequest*/ return new String[] {"Reference"};
1311        default: return super.getTypesForProperty(hash, name);
1312        }
1313
1314      }
1315
1316      @Override
1317      public Base addChild(String name) throws FHIRException {
1318        if (name.equals("identifier")) {
1319          return addIdentifier();
1320        }
1321        else if (name.equals("status")) {
1322          throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.status");
1323        }
1324        else if (name.equals("created")) {
1325          throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.created");
1326        }
1327        else if (name.equals("organization")) {
1328          this.organization = new Reference();
1329          return this.organization;
1330        }
1331        else if (name.equals("request")) {
1332          this.request = new Reference();
1333          return this.request;
1334        }
1335        else if (name.equals("outcome")) {
1336          this.outcome = new CodeableConcept();
1337          return this.outcome;
1338        }
1339        else if (name.equals("disposition")) {
1340          throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.disposition");
1341        }
1342        else if (name.equals("requestProvider")) {
1343          this.requestProvider = new Reference();
1344          return this.requestProvider;
1345        }
1346        else if (name.equals("requestOrganization")) {
1347          this.requestOrganization = new Reference();
1348          return this.requestOrganization;
1349        }
1350        else if (name.equals("form")) {
1351          this.form = new CodeableConcept();
1352          return this.form;
1353        }
1354        else if (name.equals("processNote")) {
1355          return addProcessNote();
1356        }
1357        else if (name.equals("error")) {
1358          return addError();
1359        }
1360        else if (name.equals("communicationRequest")) {
1361          return addCommunicationRequest();
1362        }
1363        else
1364          return super.addChild(name);
1365      }
1366
1367  public String fhirType() {
1368    return "ProcessResponse";
1369
1370  }
1371
1372      public ProcessResponse copy() {
1373        ProcessResponse dst = new ProcessResponse();
1374        copyValues(dst);
1375        if (identifier != null) {
1376          dst.identifier = new ArrayList<Identifier>();
1377          for (Identifier i : identifier)
1378            dst.identifier.add(i.copy());
1379        };
1380        dst.status = status == null ? null : status.copy();
1381        dst.created = created == null ? null : created.copy();
1382        dst.organization = organization == null ? null : organization.copy();
1383        dst.request = request == null ? null : request.copy();
1384        dst.outcome = outcome == null ? null : outcome.copy();
1385        dst.disposition = disposition == null ? null : disposition.copy();
1386        dst.requestProvider = requestProvider == null ? null : requestProvider.copy();
1387        dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy();
1388        dst.form = form == null ? null : form.copy();
1389        if (processNote != null) {
1390          dst.processNote = new ArrayList<ProcessResponseProcessNoteComponent>();
1391          for (ProcessResponseProcessNoteComponent i : processNote)
1392            dst.processNote.add(i.copy());
1393        };
1394        if (error != null) {
1395          dst.error = new ArrayList<CodeableConcept>();
1396          for (CodeableConcept i : error)
1397            dst.error.add(i.copy());
1398        };
1399        if (communicationRequest != null) {
1400          dst.communicationRequest = new ArrayList<Reference>();
1401          for (Reference i : communicationRequest)
1402            dst.communicationRequest.add(i.copy());
1403        };
1404        return dst;
1405      }
1406
1407      protected ProcessResponse typedCopy() {
1408        return copy();
1409      }
1410
1411      @Override
1412      public boolean equalsDeep(Base other_) {
1413        if (!super.equalsDeep(other_))
1414          return false;
1415        if (!(other_ instanceof ProcessResponse))
1416          return false;
1417        ProcessResponse o = (ProcessResponse) other_;
1418        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(created, o.created, true)
1419           && compareDeep(organization, o.organization, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true)
1420           && compareDeep(disposition, o.disposition, true) && compareDeep(requestProvider, o.requestProvider, true)
1421           && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(form, o.form, true)
1422           && compareDeep(processNote, o.processNote, true) && compareDeep(error, o.error, true) && compareDeep(communicationRequest, o.communicationRequest, true)
1423          ;
1424      }
1425
1426      @Override
1427      public boolean equalsShallow(Base other_) {
1428        if (!super.equalsShallow(other_))
1429          return false;
1430        if (!(other_ instanceof ProcessResponse))
1431          return false;
1432        ProcessResponse o = (ProcessResponse) other_;
1433        return compareValues(status, o.status, true) && compareValues(created, o.created, true) && compareValues(disposition, o.disposition, true)
1434          ;
1435      }
1436
1437      public boolean isEmpty() {
1438        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, created
1439          , organization, request, outcome, disposition, requestProvider, requestOrganization
1440          , form, processNote, error, communicationRequest);
1441      }
1442
1443  @Override
1444  public ResourceType getResourceType() {
1445    return ResourceType.ProcessResponse;
1446   }
1447
1448 /**
1449   * Search parameter: <b>identifier</b>
1450   * <p>
1451   * Description: <b>The business identifier of the Explanation of Benefit</b><br>
1452   * Type: <b>token</b><br>
1453   * Path: <b>ProcessResponse.identifier</b><br>
1454   * </p>
1455   */
1456  @SearchParamDefinition(name="identifier", path="ProcessResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" )
1457  public static final String SP_IDENTIFIER = "identifier";
1458 /**
1459   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1460   * <p>
1461   * Description: <b>The business identifier of the Explanation of Benefit</b><br>
1462   * Type: <b>token</b><br>
1463   * Path: <b>ProcessResponse.identifier</b><br>
1464   * </p>
1465   */
1466  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1467
1468 /**
1469   * Search parameter: <b>request</b>
1470   * <p>
1471   * Description: <b>The reference to the claim</b><br>
1472   * Type: <b>reference</b><br>
1473   * Path: <b>ProcessResponse.request</b><br>
1474   * </p>
1475   */
1476  @SearchParamDefinition(name="request", path="ProcessResponse.request", description="The reference to the claim", type="reference" )
1477  public static final String SP_REQUEST = "request";
1478 /**
1479   * <b>Fluent Client</b> search parameter constant for <b>request</b>
1480   * <p>
1481   * Description: <b>The reference to the claim</b><br>
1482   * Type: <b>reference</b><br>
1483   * Path: <b>ProcessResponse.request</b><br>
1484   * </p>
1485   */
1486  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST);
1487
1488/**
1489   * Constant for fluent queries to be used to add include statements. Specifies
1490   * the path value of "<b>ProcessResponse:request</b>".
1491   */
1492  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("ProcessResponse:request").toLocked();
1493
1494 /**
1495   * Search parameter: <b>organization</b>
1496   * <p>
1497   * Description: <b>The organization who generated this resource</b><br>
1498   * Type: <b>reference</b><br>
1499   * Path: <b>ProcessResponse.organization</b><br>
1500   * </p>
1501   */
1502  @SearchParamDefinition(name="organization", path="ProcessResponse.organization", description="The organization who generated this resource", type="reference", target={Organization.class } )
1503  public static final String SP_ORGANIZATION = "organization";
1504 /**
1505   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
1506   * <p>
1507   * Description: <b>The organization who generated this resource</b><br>
1508   * Type: <b>reference</b><br>
1509   * Path: <b>ProcessResponse.organization</b><br>
1510   * </p>
1511   */
1512  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
1513
1514/**
1515   * Constant for fluent queries to be used to add include statements. Specifies
1516   * the path value of "<b>ProcessResponse:organization</b>".
1517   */
1518  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("ProcessResponse:organization").toLocked();
1519
1520 /**
1521   * Search parameter: <b>request-organization</b>
1522   * <p>
1523   * Description: <b>The Organization who is responsible the request transaction</b><br>
1524   * Type: <b>reference</b><br>
1525   * Path: <b>ProcessResponse.requestOrganization</b><br>
1526   * </p>
1527   */
1528  @SearchParamDefinition(name="request-organization", path="ProcessResponse.requestOrganization", description="The Organization who is responsible the request transaction", type="reference", target={Organization.class } )
1529  public static final String SP_REQUEST_ORGANIZATION = "request-organization";
1530 /**
1531   * <b>Fluent Client</b> search parameter constant for <b>request-organization</b>
1532   * <p>
1533   * Description: <b>The Organization who is responsible the request transaction</b><br>
1534   * Type: <b>reference</b><br>
1535   * Path: <b>ProcessResponse.requestOrganization</b><br>
1536   * </p>
1537   */
1538  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST_ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST_ORGANIZATION);
1539
1540/**
1541   * Constant for fluent queries to be used to add include statements. Specifies
1542   * the path value of "<b>ProcessResponse:request-organization</b>".
1543   */
1544  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST_ORGANIZATION = new ca.uhn.fhir.model.api.Include("ProcessResponse:request-organization").toLocked();
1545
1546 /**
1547   * Search parameter: <b>request-provider</b>
1548   * <p>
1549   * Description: <b>The Provider who is responsible the request transaction</b><br>
1550   * Type: <b>reference</b><br>
1551   * Path: <b>ProcessResponse.requestProvider</b><br>
1552   * </p>
1553   */
1554  @SearchParamDefinition(name="request-provider", path="ProcessResponse.requestProvider", description="The Provider who is responsible the request transaction", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Practitioner.class } )
1555  public static final String SP_REQUEST_PROVIDER = "request-provider";
1556 /**
1557   * <b>Fluent Client</b> search parameter constant for <b>request-provider</b>
1558   * <p>
1559   * Description: <b>The Provider who is responsible the request transaction</b><br>
1560   * Type: <b>reference</b><br>
1561   * Path: <b>ProcessResponse.requestProvider</b><br>
1562   * </p>
1563   */
1564  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST_PROVIDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST_PROVIDER);
1565
1566/**
1567   * Constant for fluent queries to be used to add include statements. Specifies
1568   * the path value of "<b>ProcessResponse:request-provider</b>".
1569   */
1570  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST_PROVIDER = new ca.uhn.fhir.model.api.Include("ProcessResponse:request-provider").toLocked();
1571
1572
1573}