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