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