001package org.hl7.fhir.r5.model;
002
003
004/*
005 * #%L
006 * org.hl7.fhir.r5
007 * %%
008 * Copyright (C) 2014 - 2019 Health Level 7
009 * %%
010 * Licensed under the Apache License, Version 2.0 (the \"License\");
011 * you may not use this file except in compliance with the License.
012 * You may obtain a copy of the License at
013 * 
014 *      http://www.apache.org/licenses/LICENSE-2.0
015 * 
016 * Unless required by applicable law or agreed to in writing, software
017 * distributed under the License is distributed on an \"AS IS\" BASIS,
018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
019 * See the License for the specific language governing permissions and
020 * limitations under the License.
021 * #L%
022 */
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, \
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this \
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, \
034     this list of conditions and the following disclaimer in the documentation \
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
049  POSSIBILITY OF SUCH DAMAGE.
050  */
051
052// Generated on Tue, Dec 31, 2019 12:12+1100 for FHIR vcurrent
053
054import java.util.ArrayList;
055import java.util.Date;
056import java.util.List;
057import org.hl7.fhir.utilities.Utilities;
058import org.hl7.fhir.r5.model.Enumerations.*;
059import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
060import org.hl7.fhir.exceptions.FHIRException;
061import org.hl7.fhir.instance.model.api.ICompositeType;
062import ca.uhn.fhir.model.api.annotation.ResourceDef;
063import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
064import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
065import ca.uhn.fhir.model.api.annotation.Child;
066import ca.uhn.fhir.model.api.annotation.ChildOrder;
067import ca.uhn.fhir.model.api.annotation.Description;
068import ca.uhn.fhir.model.api.annotation.Block;
069
070/**
071 * A task to be performed.
072 */
073@ResourceDef(name="Task", profile="http://hl7.org/fhir/StructureDefinition/Task")
074public class Task extends DomainResource {
075
076    public enum TaskIntent {
077        /**
078         * The intent is not known.  When dealing with Task, it's not always known (or relevant) how the task was initiated - i.e. whether it was proposed, planned, ordered or just done spontaneously.
079         */
080        UNKNOWN, 
081        /**
082         * The request is a suggestion made by someone/something that does not have an intention to ensure it occurs and without providing an authorization to act.
083         */
084        PROPOSAL, 
085        /**
086         * The request represents an intention to ensure something occurs without providing an authorization for others to act.
087         */
088        PLAN, 
089        /**
090         * The request represents a request/demand and authorization for action by a Practitioner.
091         */
092        ORDER, 
093        /**
094         * The request represents an original authorization for action.
095         */
096        ORIGINALORDER, 
097        /**
098         * The request represents an automatically generated supplemental authorization for action based on a parent authorization together with initial results of the action taken against that parent authorization.
099         */
100        REFLEXORDER, 
101        /**
102         * The request represents the view of an authorization instantiated by a fulfilling system representing the details of the fulfiller's intention to act upon a submitted order.
103         */
104        FILLERORDER, 
105        /**
106         * An order created in fulfillment of a broader order that represents the authorization for a single activity occurrence.  E.g. The administration of a single dose of a drug.
107         */
108        INSTANCEORDER, 
109        /**
110         * The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests.  Refer to [[[RequestGroup]]] for additional information on how this status is used.
111         */
112        OPTION, 
113        /**
114         * added to help the parsers with the generic types
115         */
116        NULL;
117        public static TaskIntent fromCode(String codeString) throws FHIRException {
118            if (codeString == null || "".equals(codeString))
119                return null;
120        if ("unknown".equals(codeString))
121          return UNKNOWN;
122        if ("proposal".equals(codeString))
123          return PROPOSAL;
124        if ("plan".equals(codeString))
125          return PLAN;
126        if ("order".equals(codeString))
127          return ORDER;
128        if ("original-order".equals(codeString))
129          return ORIGINALORDER;
130        if ("reflex-order".equals(codeString))
131          return REFLEXORDER;
132        if ("filler-order".equals(codeString))
133          return FILLERORDER;
134        if ("instance-order".equals(codeString))
135          return INSTANCEORDER;
136        if ("option".equals(codeString))
137          return OPTION;
138        if (Configuration.isAcceptInvalidEnums())
139          return null;
140        else
141          throw new FHIRException("Unknown TaskIntent code '"+codeString+"'");
142        }
143        public String toCode() {
144          switch (this) {
145            case UNKNOWN: return "unknown";
146            case PROPOSAL: return "proposal";
147            case PLAN: return "plan";
148            case ORDER: return "order";
149            case ORIGINALORDER: return "original-order";
150            case REFLEXORDER: return "reflex-order";
151            case FILLERORDER: return "filler-order";
152            case INSTANCEORDER: return "instance-order";
153            case OPTION: return "option";
154            default: return "?";
155          }
156        }
157        public String getSystem() {
158          switch (this) {
159            case UNKNOWN: return "http://hl7.org/fhir/task-intent";
160            case PROPOSAL: return "http://hl7.org/fhir/request-intent";
161            case PLAN: return "http://hl7.org/fhir/request-intent";
162            case ORDER: return "http://hl7.org/fhir/request-intent";
163            case ORIGINALORDER: return "http://hl7.org/fhir/request-intent";
164            case REFLEXORDER: return "http://hl7.org/fhir/request-intent";
165            case FILLERORDER: return "http://hl7.org/fhir/request-intent";
166            case INSTANCEORDER: return "http://hl7.org/fhir/request-intent";
167            case OPTION: return "http://hl7.org/fhir/request-intent";
168            default: return "?";
169          }
170        }
171        public String getDefinition() {
172          switch (this) {
173            case UNKNOWN: return "The intent is not known.  When dealing with Task, it's not always known (or relevant) how the task was initiated - i.e. whether it was proposed, planned, ordered or just done spontaneously.";
174            case PROPOSAL: return "The request is a suggestion made by someone/something that does not have an intention to ensure it occurs and without providing an authorization to act.";
175            case PLAN: return "The request represents an intention to ensure something occurs without providing an authorization for others to act.";
176            case ORDER: return "The request represents a request/demand and authorization for action by a Practitioner.";
177            case ORIGINALORDER: return "The request represents an original authorization for action.";
178            case REFLEXORDER: return "The request represents an automatically generated supplemental authorization for action based on a parent authorization together with initial results of the action taken against that parent authorization.";
179            case FILLERORDER: return "The request represents the view of an authorization instantiated by a fulfilling system representing the details of the fulfiller's intention to act upon a submitted order.";
180            case INSTANCEORDER: return "An order created in fulfillment of a broader order that represents the authorization for a single activity occurrence.  E.g. The administration of a single dose of a drug.";
181            case OPTION: return "The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests.  Refer to [[[RequestGroup]]] for additional information on how this status is used.";
182            default: return "?";
183          }
184        }
185        public String getDisplay() {
186          switch (this) {
187            case UNKNOWN: return "Unknown";
188            case PROPOSAL: return "Proposal";
189            case PLAN: return "Plan";
190            case ORDER: return "Order";
191            case ORIGINALORDER: return "Original Order";
192            case REFLEXORDER: return "Reflex Order";
193            case FILLERORDER: return "Filler Order";
194            case INSTANCEORDER: return "Instance Order";
195            case OPTION: return "Option";
196            default: return "?";
197          }
198        }
199    }
200
201  public static class TaskIntentEnumFactory implements EnumFactory<TaskIntent> {
202    public TaskIntent fromCode(String codeString) throws IllegalArgumentException {
203      if (codeString == null || "".equals(codeString))
204            if (codeString == null || "".equals(codeString))
205                return null;
206        if ("unknown".equals(codeString))
207          return TaskIntent.UNKNOWN;
208        if ("proposal".equals(codeString))
209          return TaskIntent.PROPOSAL;
210        if ("plan".equals(codeString))
211          return TaskIntent.PLAN;
212        if ("order".equals(codeString))
213          return TaskIntent.ORDER;
214        if ("original-order".equals(codeString))
215          return TaskIntent.ORIGINALORDER;
216        if ("reflex-order".equals(codeString))
217          return TaskIntent.REFLEXORDER;
218        if ("filler-order".equals(codeString))
219          return TaskIntent.FILLERORDER;
220        if ("instance-order".equals(codeString))
221          return TaskIntent.INSTANCEORDER;
222        if ("option".equals(codeString))
223          return TaskIntent.OPTION;
224        throw new IllegalArgumentException("Unknown TaskIntent code '"+codeString+"'");
225        }
226        public Enumeration<TaskIntent> fromType(Base code) throws FHIRException {
227          if (code == null)
228            return null;
229          if (code.isEmpty())
230            return new Enumeration<TaskIntent>(this);
231          String codeString = ((PrimitiveType) code).asStringValue();
232          if (codeString == null || "".equals(codeString))
233            return null;
234        if ("unknown".equals(codeString))
235          return new Enumeration<TaskIntent>(this, TaskIntent.UNKNOWN);
236        if ("proposal".equals(codeString))
237          return new Enumeration<TaskIntent>(this, TaskIntent.PROPOSAL);
238        if ("plan".equals(codeString))
239          return new Enumeration<TaskIntent>(this, TaskIntent.PLAN);
240        if ("order".equals(codeString))
241          return new Enumeration<TaskIntent>(this, TaskIntent.ORDER);
242        if ("original-order".equals(codeString))
243          return new Enumeration<TaskIntent>(this, TaskIntent.ORIGINALORDER);
244        if ("reflex-order".equals(codeString))
245          return new Enumeration<TaskIntent>(this, TaskIntent.REFLEXORDER);
246        if ("filler-order".equals(codeString))
247          return new Enumeration<TaskIntent>(this, TaskIntent.FILLERORDER);
248        if ("instance-order".equals(codeString))
249          return new Enumeration<TaskIntent>(this, TaskIntent.INSTANCEORDER);
250        if ("option".equals(codeString))
251          return new Enumeration<TaskIntent>(this, TaskIntent.OPTION);
252        throw new FHIRException("Unknown TaskIntent code '"+codeString+"'");
253        }
254    public String toCode(TaskIntent code) {
255      if (code == TaskIntent.UNKNOWN)
256        return "unknown";
257      if (code == TaskIntent.PROPOSAL)
258        return "proposal";
259      if (code == TaskIntent.PLAN)
260        return "plan";
261      if (code == TaskIntent.ORDER)
262        return "order";
263      if (code == TaskIntent.ORIGINALORDER)
264        return "original-order";
265      if (code == TaskIntent.REFLEXORDER)
266        return "reflex-order";
267      if (code == TaskIntent.FILLERORDER)
268        return "filler-order";
269      if (code == TaskIntent.INSTANCEORDER)
270        return "instance-order";
271      if (code == TaskIntent.OPTION)
272        return "option";
273      return "?";
274      }
275    public String toSystem(TaskIntent code) {
276      return code.getSystem();
277      }
278    }
279
280    public enum TaskStatus {
281        /**
282         * The task is not yet ready to be acted upon.
283         */
284        DRAFT, 
285        /**
286         * The task is ready to be acted upon and action is sought.
287         */
288        REQUESTED, 
289        /**
290         * A potential performer has claimed ownership of the task and is evaluating whether to perform it.
291         */
292        RECEIVED, 
293        /**
294         * The potential performer has agreed to execute the task but has not yet started work.
295         */
296        ACCEPTED, 
297        /**
298         * The potential performer who claimed ownership of the task has decided not to execute it prior to performing any action.
299         */
300        REJECTED, 
301        /**
302         * The task is ready to be performed, but no action has yet been taken.  Used in place of requested/received/accepted/rejected when request assignment and acceptance is a given.
303         */
304        READY, 
305        /**
306         * The task was not completed.
307         */
308        CANCELLED, 
309        /**
310         * The task has been started but is not yet complete.
311         */
312        INPROGRESS, 
313        /**
314         * The task has been started but work has been paused.
315         */
316        ONHOLD, 
317        /**
318         * The task was attempted but could not be completed due to some error.
319         */
320        FAILED, 
321        /**
322         * The task has been completed.
323         */
324        COMPLETED, 
325        /**
326         * The task should never have existed and is retained only because of the possibility it may have used.
327         */
328        ENTEREDINERROR, 
329        /**
330         * added to help the parsers with the generic types
331         */
332        NULL;
333        public static TaskStatus fromCode(String codeString) throws FHIRException {
334            if (codeString == null || "".equals(codeString))
335                return null;
336        if ("draft".equals(codeString))
337          return DRAFT;
338        if ("requested".equals(codeString))
339          return REQUESTED;
340        if ("received".equals(codeString))
341          return RECEIVED;
342        if ("accepted".equals(codeString))
343          return ACCEPTED;
344        if ("rejected".equals(codeString))
345          return REJECTED;
346        if ("ready".equals(codeString))
347          return READY;
348        if ("cancelled".equals(codeString))
349          return CANCELLED;
350        if ("in-progress".equals(codeString))
351          return INPROGRESS;
352        if ("on-hold".equals(codeString))
353          return ONHOLD;
354        if ("failed".equals(codeString))
355          return FAILED;
356        if ("completed".equals(codeString))
357          return COMPLETED;
358        if ("entered-in-error".equals(codeString))
359          return ENTEREDINERROR;
360        if (Configuration.isAcceptInvalidEnums())
361          return null;
362        else
363          throw new FHIRException("Unknown TaskStatus code '"+codeString+"'");
364        }
365        public String toCode() {
366          switch (this) {
367            case DRAFT: return "draft";
368            case REQUESTED: return "requested";
369            case RECEIVED: return "received";
370            case ACCEPTED: return "accepted";
371            case REJECTED: return "rejected";
372            case READY: return "ready";
373            case CANCELLED: return "cancelled";
374            case INPROGRESS: return "in-progress";
375            case ONHOLD: return "on-hold";
376            case FAILED: return "failed";
377            case COMPLETED: return "completed";
378            case ENTEREDINERROR: return "entered-in-error";
379            default: return "?";
380          }
381        }
382        public String getSystem() {
383          switch (this) {
384            case DRAFT: return "http://hl7.org/fhir/task-status";
385            case REQUESTED: return "http://hl7.org/fhir/task-status";
386            case RECEIVED: return "http://hl7.org/fhir/task-status";
387            case ACCEPTED: return "http://hl7.org/fhir/task-status";
388            case REJECTED: return "http://hl7.org/fhir/task-status";
389            case READY: return "http://hl7.org/fhir/task-status";
390            case CANCELLED: return "http://hl7.org/fhir/task-status";
391            case INPROGRESS: return "http://hl7.org/fhir/task-status";
392            case ONHOLD: return "http://hl7.org/fhir/task-status";
393            case FAILED: return "http://hl7.org/fhir/task-status";
394            case COMPLETED: return "http://hl7.org/fhir/task-status";
395            case ENTEREDINERROR: return "http://hl7.org/fhir/task-status";
396            default: return "?";
397          }
398        }
399        public String getDefinition() {
400          switch (this) {
401            case DRAFT: return "The task is not yet ready to be acted upon.";
402            case REQUESTED: return "The task is ready to be acted upon and action is sought.";
403            case RECEIVED: return "A potential performer has claimed ownership of the task and is evaluating whether to perform it.";
404            case ACCEPTED: return "The potential performer has agreed to execute the task but has not yet started work.";
405            case REJECTED: return "The potential performer who claimed ownership of the task has decided not to execute it prior to performing any action.";
406            case READY: return "The task is ready to be performed, but no action has yet been taken.  Used in place of requested/received/accepted/rejected when request assignment and acceptance is a given.";
407            case CANCELLED: return "The task was not completed.";
408            case INPROGRESS: return "The task has been started but is not yet complete.";
409            case ONHOLD: return "The task has been started but work has been paused.";
410            case FAILED: return "The task was attempted but could not be completed due to some error.";
411            case COMPLETED: return "The task has been completed.";
412            case ENTEREDINERROR: return "The task should never have existed and is retained only because of the possibility it may have used.";
413            default: return "?";
414          }
415        }
416        public String getDisplay() {
417          switch (this) {
418            case DRAFT: return "Draft";
419            case REQUESTED: return "Requested";
420            case RECEIVED: return "Received";
421            case ACCEPTED: return "Accepted";
422            case REJECTED: return "Rejected";
423            case READY: return "Ready";
424            case CANCELLED: return "Cancelled";
425            case INPROGRESS: return "In Progress";
426            case ONHOLD: return "On Hold";
427            case FAILED: return "Failed";
428            case COMPLETED: return "Completed";
429            case ENTEREDINERROR: return "Entered in Error";
430            default: return "?";
431          }
432        }
433    }
434
435  public static class TaskStatusEnumFactory implements EnumFactory<TaskStatus> {
436    public TaskStatus fromCode(String codeString) throws IllegalArgumentException {
437      if (codeString == null || "".equals(codeString))
438            if (codeString == null || "".equals(codeString))
439                return null;
440        if ("draft".equals(codeString))
441          return TaskStatus.DRAFT;
442        if ("requested".equals(codeString))
443          return TaskStatus.REQUESTED;
444        if ("received".equals(codeString))
445          return TaskStatus.RECEIVED;
446        if ("accepted".equals(codeString))
447          return TaskStatus.ACCEPTED;
448        if ("rejected".equals(codeString))
449          return TaskStatus.REJECTED;
450        if ("ready".equals(codeString))
451          return TaskStatus.READY;
452        if ("cancelled".equals(codeString))
453          return TaskStatus.CANCELLED;
454        if ("in-progress".equals(codeString))
455          return TaskStatus.INPROGRESS;
456        if ("on-hold".equals(codeString))
457          return TaskStatus.ONHOLD;
458        if ("failed".equals(codeString))
459          return TaskStatus.FAILED;
460        if ("completed".equals(codeString))
461          return TaskStatus.COMPLETED;
462        if ("entered-in-error".equals(codeString))
463          return TaskStatus.ENTEREDINERROR;
464        throw new IllegalArgumentException("Unknown TaskStatus code '"+codeString+"'");
465        }
466        public Enumeration<TaskStatus> fromType(Base code) throws FHIRException {
467          if (code == null)
468            return null;
469          if (code.isEmpty())
470            return new Enumeration<TaskStatus>(this);
471          String codeString = ((PrimitiveType) code).asStringValue();
472          if (codeString == null || "".equals(codeString))
473            return null;
474        if ("draft".equals(codeString))
475          return new Enumeration<TaskStatus>(this, TaskStatus.DRAFT);
476        if ("requested".equals(codeString))
477          return new Enumeration<TaskStatus>(this, TaskStatus.REQUESTED);
478        if ("received".equals(codeString))
479          return new Enumeration<TaskStatus>(this, TaskStatus.RECEIVED);
480        if ("accepted".equals(codeString))
481          return new Enumeration<TaskStatus>(this, TaskStatus.ACCEPTED);
482        if ("rejected".equals(codeString))
483          return new Enumeration<TaskStatus>(this, TaskStatus.REJECTED);
484        if ("ready".equals(codeString))
485          return new Enumeration<TaskStatus>(this, TaskStatus.READY);
486        if ("cancelled".equals(codeString))
487          return new Enumeration<TaskStatus>(this, TaskStatus.CANCELLED);
488        if ("in-progress".equals(codeString))
489          return new Enumeration<TaskStatus>(this, TaskStatus.INPROGRESS);
490        if ("on-hold".equals(codeString))
491          return new Enumeration<TaskStatus>(this, TaskStatus.ONHOLD);
492        if ("failed".equals(codeString))
493          return new Enumeration<TaskStatus>(this, TaskStatus.FAILED);
494        if ("completed".equals(codeString))
495          return new Enumeration<TaskStatus>(this, TaskStatus.COMPLETED);
496        if ("entered-in-error".equals(codeString))
497          return new Enumeration<TaskStatus>(this, TaskStatus.ENTEREDINERROR);
498        throw new FHIRException("Unknown TaskStatus code '"+codeString+"'");
499        }
500    public String toCode(TaskStatus code) {
501      if (code == TaskStatus.DRAFT)
502        return "draft";
503      if (code == TaskStatus.REQUESTED)
504        return "requested";
505      if (code == TaskStatus.RECEIVED)
506        return "received";
507      if (code == TaskStatus.ACCEPTED)
508        return "accepted";
509      if (code == TaskStatus.REJECTED)
510        return "rejected";
511      if (code == TaskStatus.READY)
512        return "ready";
513      if (code == TaskStatus.CANCELLED)
514        return "cancelled";
515      if (code == TaskStatus.INPROGRESS)
516        return "in-progress";
517      if (code == TaskStatus.ONHOLD)
518        return "on-hold";
519      if (code == TaskStatus.FAILED)
520        return "failed";
521      if (code == TaskStatus.COMPLETED)
522        return "completed";
523      if (code == TaskStatus.ENTEREDINERROR)
524        return "entered-in-error";
525      return "?";
526      }
527    public String toSystem(TaskStatus code) {
528      return code.getSystem();
529      }
530    }
531
532    @Block()
533    public static class TaskRestrictionComponent extends BackboneElement implements IBaseBackboneElement {
534        /**
535         * Indicates the number of times the requested action should occur.
536         */
537        @Child(name = "repetitions", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=false)
538        @Description(shortDefinition="How many times to repeat", formalDefinition="Indicates the number of times the requested action should occur." )
539        protected PositiveIntType repetitions;
540
541        /**
542         * Over what time-period is fulfillment sought.
543         */
544        @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false)
545        @Description(shortDefinition="When fulfillment sought", formalDefinition="Over what time-period is fulfillment sought." )
546        protected Period period;
547
548        /**
549         * For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?
550         */
551        @Child(name = "recipient", type = {Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class, Group.class, Organization.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
552        @Description(shortDefinition="For whom is fulfillment sought?", formalDefinition="For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?" )
553        protected List<Reference> recipient;
554
555        private static final long serialVersionUID = 1673996066L;
556
557    /**
558     * Constructor
559     */
560      public TaskRestrictionComponent() {
561        super();
562      }
563
564        /**
565         * @return {@link #repetitions} (Indicates the number of times the requested action should occur.). This is the underlying object with id, value and extensions. The accessor "getRepetitions" gives direct access to the value
566         */
567        public PositiveIntType getRepetitionsElement() { 
568          if (this.repetitions == null)
569            if (Configuration.errorOnAutoCreate())
570              throw new Error("Attempt to auto-create TaskRestrictionComponent.repetitions");
571            else if (Configuration.doAutoCreate())
572              this.repetitions = new PositiveIntType(); // bb
573          return this.repetitions;
574        }
575
576        public boolean hasRepetitionsElement() { 
577          return this.repetitions != null && !this.repetitions.isEmpty();
578        }
579
580        public boolean hasRepetitions() { 
581          return this.repetitions != null && !this.repetitions.isEmpty();
582        }
583
584        /**
585         * @param value {@link #repetitions} (Indicates the number of times the requested action should occur.). This is the underlying object with id, value and extensions. The accessor "getRepetitions" gives direct access to the value
586         */
587        public TaskRestrictionComponent setRepetitionsElement(PositiveIntType value) { 
588          this.repetitions = value;
589          return this;
590        }
591
592        /**
593         * @return Indicates the number of times the requested action should occur.
594         */
595        public int getRepetitions() { 
596          return this.repetitions == null || this.repetitions.isEmpty() ? 0 : this.repetitions.getValue();
597        }
598
599        /**
600         * @param value Indicates the number of times the requested action should occur.
601         */
602        public TaskRestrictionComponent setRepetitions(int value) { 
603            if (this.repetitions == null)
604              this.repetitions = new PositiveIntType();
605            this.repetitions.setValue(value);
606          return this;
607        }
608
609        /**
610         * @return {@link #period} (Over what time-period is fulfillment sought.)
611         */
612        public Period getPeriod() { 
613          if (this.period == null)
614            if (Configuration.errorOnAutoCreate())
615              throw new Error("Attempt to auto-create TaskRestrictionComponent.period");
616            else if (Configuration.doAutoCreate())
617              this.period = new Period(); // cc
618          return this.period;
619        }
620
621        public boolean hasPeriod() { 
622          return this.period != null && !this.period.isEmpty();
623        }
624
625        /**
626         * @param value {@link #period} (Over what time-period is fulfillment sought.)
627         */
628        public TaskRestrictionComponent setPeriod(Period value) { 
629          this.period = value;
630          return this;
631        }
632
633        /**
634         * @return {@link #recipient} (For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?)
635         */
636        public List<Reference> getRecipient() { 
637          if (this.recipient == null)
638            this.recipient = new ArrayList<Reference>();
639          return this.recipient;
640        }
641
642        /**
643         * @return Returns a reference to <code>this</code> for easy method chaining
644         */
645        public TaskRestrictionComponent setRecipient(List<Reference> theRecipient) { 
646          this.recipient = theRecipient;
647          return this;
648        }
649
650        public boolean hasRecipient() { 
651          if (this.recipient == null)
652            return false;
653          for (Reference item : this.recipient)
654            if (!item.isEmpty())
655              return true;
656          return false;
657        }
658
659        public Reference addRecipient() { //3
660          Reference t = new Reference();
661          if (this.recipient == null)
662            this.recipient = new ArrayList<Reference>();
663          this.recipient.add(t);
664          return t;
665        }
666
667        public TaskRestrictionComponent addRecipient(Reference t) { //3
668          if (t == null)
669            return this;
670          if (this.recipient == null)
671            this.recipient = new ArrayList<Reference>();
672          this.recipient.add(t);
673          return this;
674        }
675
676        /**
677         * @return The first repetition of repeating field {@link #recipient}, creating it if it does not already exist {3}
678         */
679        public Reference getRecipientFirstRep() { 
680          if (getRecipient().isEmpty()) {
681            addRecipient();
682          }
683          return getRecipient().get(0);
684        }
685
686        protected void listChildren(List<Property> children) {
687          super.listChildren(children);
688          children.add(new Property("repetitions", "positiveInt", "Indicates the number of times the requested action should occur.", 0, 1, repetitions));
689          children.add(new Property("period", "Period", "Over what time-period is fulfillment sought.", 0, 1, period));
690          children.add(new Property("recipient", "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson|Group|Organization)", "For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?", 0, java.lang.Integer.MAX_VALUE, recipient));
691        }
692
693        @Override
694        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
695          switch (_hash) {
696          case 984367650: /*repetitions*/  return new Property("repetitions", "positiveInt", "Indicates the number of times the requested action should occur.", 0, 1, repetitions);
697          case -991726143: /*period*/  return new Property("period", "Period", "Over what time-period is fulfillment sought.", 0, 1, period);
698          case 820081177: /*recipient*/  return new Property("recipient", "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson|Group|Organization)", "For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?", 0, java.lang.Integer.MAX_VALUE, recipient);
699          default: return super.getNamedProperty(_hash, _name, _checkValid);
700          }
701
702        }
703
704      @Override
705      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
706        switch (hash) {
707        case 984367650: /*repetitions*/ return this.repetitions == null ? new Base[0] : new Base[] {this.repetitions}; // PositiveIntType
708        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
709        case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference
710        default: return super.getProperty(hash, name, checkValid);
711        }
712
713      }
714
715      @Override
716      public Base setProperty(int hash, String name, Base value) throws FHIRException {
717        switch (hash) {
718        case 984367650: // repetitions
719          this.repetitions = TypeConvertor.castToPositiveInt(value); // PositiveIntType
720          return value;
721        case -991726143: // period
722          this.period = TypeConvertor.castToPeriod(value); // Period
723          return value;
724        case 820081177: // recipient
725          this.getRecipient().add(TypeConvertor.castToReference(value)); // Reference
726          return value;
727        default: return super.setProperty(hash, name, value);
728        }
729
730      }
731
732      @Override
733      public Base setProperty(String name, Base value) throws FHIRException {
734        if (name.equals("repetitions")) {
735          this.repetitions = TypeConvertor.castToPositiveInt(value); // PositiveIntType
736        } else if (name.equals("period")) {
737          this.period = TypeConvertor.castToPeriod(value); // Period
738        } else if (name.equals("recipient")) {
739          this.getRecipient().add(TypeConvertor.castToReference(value));
740        } else
741          return super.setProperty(name, value);
742        return value;
743      }
744
745      @Override
746      public Base makeProperty(int hash, String name) throws FHIRException {
747        switch (hash) {
748        case 984367650:  return getRepetitionsElement();
749        case -991726143:  return getPeriod();
750        case 820081177:  return addRecipient(); 
751        default: return super.makeProperty(hash, name);
752        }
753
754      }
755
756      @Override
757      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
758        switch (hash) {
759        case 984367650: /*repetitions*/ return new String[] {"positiveInt"};
760        case -991726143: /*period*/ return new String[] {"Period"};
761        case 820081177: /*recipient*/ return new String[] {"Reference"};
762        default: return super.getTypesForProperty(hash, name);
763        }
764
765      }
766
767      @Override
768      public Base addChild(String name) throws FHIRException {
769        if (name.equals("repetitions")) {
770          throw new FHIRException("Cannot call addChild on a primitive type Task.restriction.repetitions");
771        }
772        else if (name.equals("period")) {
773          this.period = new Period();
774          return this.period;
775        }
776        else if (name.equals("recipient")) {
777          return addRecipient();
778        }
779        else
780          return super.addChild(name);
781      }
782
783      public TaskRestrictionComponent copy() {
784        TaskRestrictionComponent dst = new TaskRestrictionComponent();
785        copyValues(dst);
786        return dst;
787      }
788
789      public void copyValues(TaskRestrictionComponent dst) {
790        super.copyValues(dst);
791        dst.repetitions = repetitions == null ? null : repetitions.copy();
792        dst.period = period == null ? null : period.copy();
793        if (recipient != null) {
794          dst.recipient = new ArrayList<Reference>();
795          for (Reference i : recipient)
796            dst.recipient.add(i.copy());
797        };
798      }
799
800      @Override
801      public boolean equalsDeep(Base other_) {
802        if (!super.equalsDeep(other_))
803          return false;
804        if (!(other_ instanceof TaskRestrictionComponent))
805          return false;
806        TaskRestrictionComponent o = (TaskRestrictionComponent) other_;
807        return compareDeep(repetitions, o.repetitions, true) && compareDeep(period, o.period, true) && compareDeep(recipient, o.recipient, true)
808          ;
809      }
810
811      @Override
812      public boolean equalsShallow(Base other_) {
813        if (!super.equalsShallow(other_))
814          return false;
815        if (!(other_ instanceof TaskRestrictionComponent))
816          return false;
817        TaskRestrictionComponent o = (TaskRestrictionComponent) other_;
818        return compareValues(repetitions, o.repetitions, true);
819      }
820
821      public boolean isEmpty() {
822        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(repetitions, period, recipient
823          );
824      }
825
826  public String fhirType() {
827    return "Task.restriction";
828
829  }
830
831  }
832
833    @Block()
834    public static class ParameterComponent extends BackboneElement implements IBaseBackboneElement {
835        /**
836         * A code or description indicating how the input is intended to be used as part of the task execution.
837         */
838        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
839        @Description(shortDefinition="Label for the input", formalDefinition="A code or description indicating how the input is intended to be used as part of the task execution." )
840        protected CodeableConcept type;
841
842        /**
843         * The value of the input parameter as a basic type.
844         */
845        @Child(name = "value", type = {Base64BinaryType.class, BooleanType.class, CanonicalType.class, CodeType.class, DateType.class, DateTimeType.class, DecimalType.class, IdType.class, InstantType.class, IntegerType.class, Integer64Type.class, MarkdownType.class, OidType.class, PositiveIntType.class, StringType.class, TimeType.class, UnsignedIntType.class, UriType.class, UrlType.class, UuidType.class, Address.class, Age.class, Annotation.class, Attachment.class, CodeableConcept.class, Coding.class, ContactPoint.class, Count.class, Distance.class, Duration.class, HumanName.class, Identifier.class, Money.class, Period.class, Quantity.class, Range.class, Ratio.class, Reference.class, SampledData.class, Signature.class, Timing.class, ContactDetail.class, Contributor.class, DataRequirement.class, Expression.class, ParameterDefinition.class, RelatedArtifact.class, TriggerDefinition.class, UsageContext.class, Dosage.class, Meta.class}, order=2, min=1, max=1, modifier=false, summary=false)
846        @Description(shortDefinition="Content to use in performing the task", formalDefinition="The value of the input parameter as a basic type." )
847        protected DataType value;
848
849        private static final long serialVersionUID = -1659186716L;
850
851    /**
852     * Constructor
853     */
854      public ParameterComponent() {
855        super();
856      }
857
858    /**
859     * Constructor
860     */
861      public ParameterComponent(CodeableConcept type, DataType value) {
862        super();
863        this.setType(type);
864        this.setValue(value);
865      }
866
867        /**
868         * @return {@link #type} (A code or description indicating how the input is intended to be used as part of the task execution.)
869         */
870        public CodeableConcept getType() { 
871          if (this.type == null)
872            if (Configuration.errorOnAutoCreate())
873              throw new Error("Attempt to auto-create ParameterComponent.type");
874            else if (Configuration.doAutoCreate())
875              this.type = new CodeableConcept(); // cc
876          return this.type;
877        }
878
879        public boolean hasType() { 
880          return this.type != null && !this.type.isEmpty();
881        }
882
883        /**
884         * @param value {@link #type} (A code or description indicating how the input is intended to be used as part of the task execution.)
885         */
886        public ParameterComponent setType(CodeableConcept value) { 
887          this.type = value;
888          return this;
889        }
890
891        /**
892         * @return {@link #value} (The value of the input parameter as a basic type.)
893         */
894        public DataType getValue() { 
895          return this.value;
896        }
897
898        /**
899         * @return {@link #value} (The value of the input parameter as a basic type.)
900         */
901        public Base64BinaryType getValueBase64BinaryType() throws FHIRException { 
902          if (this.value == null)
903            this.value = new Base64BinaryType();
904          if (!(this.value instanceof Base64BinaryType))
905            throw new FHIRException("Type mismatch: the type Base64BinaryType was expected, but "+this.value.getClass().getName()+" was encountered");
906          return (Base64BinaryType) this.value;
907        }
908
909        public boolean hasValueBase64BinaryType() { 
910          return this != null && this.value instanceof Base64BinaryType;
911        }
912
913        /**
914         * @return {@link #value} (The value of the input parameter as a basic type.)
915         */
916        public BooleanType getValueBooleanType() throws FHIRException { 
917          if (this.value == null)
918            this.value = new BooleanType();
919          if (!(this.value instanceof BooleanType))
920            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
921          return (BooleanType) this.value;
922        }
923
924        public boolean hasValueBooleanType() { 
925          return this != null && this.value instanceof BooleanType;
926        }
927
928        /**
929         * @return {@link #value} (The value of the input parameter as a basic type.)
930         */
931        public CanonicalType getValueCanonicalType() throws FHIRException { 
932          if (this.value == null)
933            this.value = new CanonicalType();
934          if (!(this.value instanceof CanonicalType))
935            throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.value.getClass().getName()+" was encountered");
936          return (CanonicalType) this.value;
937        }
938
939        public boolean hasValueCanonicalType() { 
940          return this != null && this.value instanceof CanonicalType;
941        }
942
943        /**
944         * @return {@link #value} (The value of the input parameter as a basic type.)
945         */
946        public CodeType getValueCodeType() throws FHIRException { 
947          if (this.value == null)
948            this.value = new CodeType();
949          if (!(this.value instanceof CodeType))
950            throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.value.getClass().getName()+" was encountered");
951          return (CodeType) this.value;
952        }
953
954        public boolean hasValueCodeType() { 
955          return this != null && this.value instanceof CodeType;
956        }
957
958        /**
959         * @return {@link #value} (The value of the input parameter as a basic type.)
960         */
961        public DateType getValueDateType() throws FHIRException { 
962          if (this.value == null)
963            this.value = new DateType();
964          if (!(this.value instanceof DateType))
965            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered");
966          return (DateType) this.value;
967        }
968
969        public boolean hasValueDateType() { 
970          return this != null && this.value instanceof DateType;
971        }
972
973        /**
974         * @return {@link #value} (The value of the input parameter as a basic type.)
975         */
976        public DateTimeType getValueDateTimeType() throws FHIRException { 
977          if (this.value == null)
978            this.value = new DateTimeType();
979          if (!(this.value instanceof DateTimeType))
980            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered");
981          return (DateTimeType) this.value;
982        }
983
984        public boolean hasValueDateTimeType() { 
985          return this != null && this.value instanceof DateTimeType;
986        }
987
988        /**
989         * @return {@link #value} (The value of the input parameter as a basic type.)
990         */
991        public DecimalType getValueDecimalType() throws FHIRException { 
992          if (this.value == null)
993            this.value = new DecimalType();
994          if (!(this.value instanceof DecimalType))
995            throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered");
996          return (DecimalType) this.value;
997        }
998
999        public boolean hasValueDecimalType() { 
1000          return this != null && this.value instanceof DecimalType;
1001        }
1002
1003        /**
1004         * @return {@link #value} (The value of the input parameter as a basic type.)
1005         */
1006        public IdType getValueIdType() throws FHIRException { 
1007          if (this.value == null)
1008            this.value = new IdType();
1009          if (!(this.value instanceof IdType))
1010            throw new FHIRException("Type mismatch: the type IdType was expected, but "+this.value.getClass().getName()+" was encountered");
1011          return (IdType) this.value;
1012        }
1013
1014        public boolean hasValueIdType() { 
1015          return this != null && this.value instanceof IdType;
1016        }
1017
1018        /**
1019         * @return {@link #value} (The value of the input parameter as a basic type.)
1020         */
1021        public InstantType getValueInstantType() throws FHIRException { 
1022          if (this.value == null)
1023            this.value = new InstantType();
1024          if (!(this.value instanceof InstantType))
1025            throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.value.getClass().getName()+" was encountered");
1026          return (InstantType) this.value;
1027        }
1028
1029        public boolean hasValueInstantType() { 
1030          return this != null && this.value instanceof InstantType;
1031        }
1032
1033        /**
1034         * @return {@link #value} (The value of the input parameter as a basic type.)
1035         */
1036        public IntegerType getValueIntegerType() throws FHIRException { 
1037          if (this.value == null)
1038            this.value = new IntegerType();
1039          if (!(this.value instanceof IntegerType))
1040            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
1041          return (IntegerType) this.value;
1042        }
1043
1044        public boolean hasValueIntegerType() { 
1045          return this != null && this.value instanceof IntegerType;
1046        }
1047
1048        /**
1049         * @return {@link #value} (The value of the input parameter as a basic type.)
1050         */
1051        public Integer64Type getValueInteger64Type() throws FHIRException { 
1052          if (this.value == null)
1053            this.value = new Integer64Type();
1054          if (!(this.value instanceof Integer64Type))
1055            throw new FHIRException("Type mismatch: the type Integer64Type was expected, but "+this.value.getClass().getName()+" was encountered");
1056          return (Integer64Type) this.value;
1057        }
1058
1059        public boolean hasValueInteger64Type() { 
1060          return this != null && this.value instanceof Integer64Type;
1061        }
1062
1063        /**
1064         * @return {@link #value} (The value of the input parameter as a basic type.)
1065         */
1066        public MarkdownType getValueMarkdownType() throws FHIRException { 
1067          if (this.value == null)
1068            this.value = new MarkdownType();
1069          if (!(this.value instanceof MarkdownType))
1070            throw new FHIRException("Type mismatch: the type MarkdownType was expected, but "+this.value.getClass().getName()+" was encountered");
1071          return (MarkdownType) this.value;
1072        }
1073
1074        public boolean hasValueMarkdownType() { 
1075          return this != null && this.value instanceof MarkdownType;
1076        }
1077
1078        /**
1079         * @return {@link #value} (The value of the input parameter as a basic type.)
1080         */
1081        public OidType getValueOidType() throws FHIRException { 
1082          if (this.value == null)
1083            this.value = new OidType();
1084          if (!(this.value instanceof OidType))
1085            throw new FHIRException("Type mismatch: the type OidType was expected, but "+this.value.getClass().getName()+" was encountered");
1086          return (OidType) this.value;
1087        }
1088
1089        public boolean hasValueOidType() { 
1090          return this != null && this.value instanceof OidType;
1091        }
1092
1093        /**
1094         * @return {@link #value} (The value of the input parameter as a basic type.)
1095         */
1096        public PositiveIntType getValuePositiveIntType() throws FHIRException { 
1097          if (this.value == null)
1098            this.value = new PositiveIntType();
1099          if (!(this.value instanceof PositiveIntType))
1100            throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.value.getClass().getName()+" was encountered");
1101          return (PositiveIntType) this.value;
1102        }
1103
1104        public boolean hasValuePositiveIntType() { 
1105          return this != null && this.value instanceof PositiveIntType;
1106        }
1107
1108        /**
1109         * @return {@link #value} (The value of the input parameter as a basic type.)
1110         */
1111        public StringType getValueStringType() throws FHIRException { 
1112          if (this.value == null)
1113            this.value = new StringType();
1114          if (!(this.value instanceof StringType))
1115            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
1116          return (StringType) this.value;
1117        }
1118
1119        public boolean hasValueStringType() { 
1120          return this != null && this.value instanceof StringType;
1121        }
1122
1123        /**
1124         * @return {@link #value} (The value of the input parameter as a basic type.)
1125         */
1126        public TimeType getValueTimeType() throws FHIRException { 
1127          if (this.value == null)
1128            this.value = new TimeType();
1129          if (!(this.value instanceof TimeType))
1130            throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered");
1131          return (TimeType) this.value;
1132        }
1133
1134        public boolean hasValueTimeType() { 
1135          return this != null && this.value instanceof TimeType;
1136        }
1137
1138        /**
1139         * @return {@link #value} (The value of the input parameter as a basic type.)
1140         */
1141        public UnsignedIntType getValueUnsignedIntType() throws FHIRException { 
1142          if (this.value == null)
1143            this.value = new UnsignedIntType();
1144          if (!(this.value instanceof UnsignedIntType))
1145            throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.value.getClass().getName()+" was encountered");
1146          return (UnsignedIntType) this.value;
1147        }
1148
1149        public boolean hasValueUnsignedIntType() { 
1150          return this != null && this.value instanceof UnsignedIntType;
1151        }
1152
1153        /**
1154         * @return {@link #value} (The value of the input parameter as a basic type.)
1155         */
1156        public UriType getValueUriType() throws FHIRException { 
1157          if (this.value == null)
1158            this.value = new UriType();
1159          if (!(this.value instanceof UriType))
1160            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered");
1161          return (UriType) this.value;
1162        }
1163
1164        public boolean hasValueUriType() { 
1165          return this != null && this.value instanceof UriType;
1166        }
1167
1168        /**
1169         * @return {@link #value} (The value of the input parameter as a basic type.)
1170         */
1171        public UrlType getValueUrlType() throws FHIRException { 
1172          if (this.value == null)
1173            this.value = new UrlType();
1174          if (!(this.value instanceof UrlType))
1175            throw new FHIRException("Type mismatch: the type UrlType was expected, but "+this.value.getClass().getName()+" was encountered");
1176          return (UrlType) this.value;
1177        }
1178
1179        public boolean hasValueUrlType() { 
1180          return this != null && this.value instanceof UrlType;
1181        }
1182
1183        /**
1184         * @return {@link #value} (The value of the input parameter as a basic type.)
1185         */
1186        public UuidType getValueUuidType() throws FHIRException { 
1187          if (this.value == null)
1188            this.value = new UuidType();
1189          if (!(this.value instanceof UuidType))
1190            throw new FHIRException("Type mismatch: the type UuidType was expected, but "+this.value.getClass().getName()+" was encountered");
1191          return (UuidType) this.value;
1192        }
1193
1194        public boolean hasValueUuidType() { 
1195          return this != null && this.value instanceof UuidType;
1196        }
1197
1198        /**
1199         * @return {@link #value} (The value of the input parameter as a basic type.)
1200         */
1201        public Address getValueAddress() throws FHIRException { 
1202          if (this.value == null)
1203            this.value = new Address();
1204          if (!(this.value instanceof Address))
1205            throw new FHIRException("Type mismatch: the type Address was expected, but "+this.value.getClass().getName()+" was encountered");
1206          return (Address) this.value;
1207        }
1208
1209        public boolean hasValueAddress() { 
1210          return this != null && this.value instanceof Address;
1211        }
1212
1213        /**
1214         * @return {@link #value} (The value of the input parameter as a basic type.)
1215         */
1216        public Age getValueAge() throws FHIRException { 
1217          if (this.value == null)
1218            this.value = new Age();
1219          if (!(this.value instanceof Age))
1220            throw new FHIRException("Type mismatch: the type Age was expected, but "+this.value.getClass().getName()+" was encountered");
1221          return (Age) this.value;
1222        }
1223
1224        public boolean hasValueAge() { 
1225          return this != null && this.value instanceof Age;
1226        }
1227
1228        /**
1229         * @return {@link #value} (The value of the input parameter as a basic type.)
1230         */
1231        public Annotation getValueAnnotation() throws FHIRException { 
1232          if (this.value == null)
1233            this.value = new Annotation();
1234          if (!(this.value instanceof Annotation))
1235            throw new FHIRException("Type mismatch: the type Annotation was expected, but "+this.value.getClass().getName()+" was encountered");
1236          return (Annotation) this.value;
1237        }
1238
1239        public boolean hasValueAnnotation() { 
1240          return this != null && this.value instanceof Annotation;
1241        }
1242
1243        /**
1244         * @return {@link #value} (The value of the input parameter as a basic type.)
1245         */
1246        public Attachment getValueAttachment() throws FHIRException { 
1247          if (this.value == null)
1248            this.value = new Attachment();
1249          if (!(this.value instanceof Attachment))
1250            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
1251          return (Attachment) this.value;
1252        }
1253
1254        public boolean hasValueAttachment() { 
1255          return this != null && this.value instanceof Attachment;
1256        }
1257
1258        /**
1259         * @return {@link #value} (The value of the input parameter as a basic type.)
1260         */
1261        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
1262          if (this.value == null)
1263            this.value = new CodeableConcept();
1264          if (!(this.value instanceof CodeableConcept))
1265            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
1266          return (CodeableConcept) this.value;
1267        }
1268
1269        public boolean hasValueCodeableConcept() { 
1270          return this != null && this.value instanceof CodeableConcept;
1271        }
1272
1273        /**
1274         * @return {@link #value} (The value of the input parameter as a basic type.)
1275         */
1276        public Coding getValueCoding() throws FHIRException { 
1277          if (this.value == null)
1278            this.value = new Coding();
1279          if (!(this.value instanceof Coding))
1280            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered");
1281          return (Coding) this.value;
1282        }
1283
1284        public boolean hasValueCoding() { 
1285          return this != null && this.value instanceof Coding;
1286        }
1287
1288        /**
1289         * @return {@link #value} (The value of the input parameter as a basic type.)
1290         */
1291        public ContactPoint getValueContactPoint() throws FHIRException { 
1292          if (this.value == null)
1293            this.value = new ContactPoint();
1294          if (!(this.value instanceof ContactPoint))
1295            throw new FHIRException("Type mismatch: the type ContactPoint was expected, but "+this.value.getClass().getName()+" was encountered");
1296          return (ContactPoint) this.value;
1297        }
1298
1299        public boolean hasValueContactPoint() { 
1300          return this != null && this.value instanceof ContactPoint;
1301        }
1302
1303        /**
1304         * @return {@link #value} (The value of the input parameter as a basic type.)
1305         */
1306        public Count getValueCount() throws FHIRException { 
1307          if (this.value == null)
1308            this.value = new Count();
1309          if (!(this.value instanceof Count))
1310            throw new FHIRException("Type mismatch: the type Count was expected, but "+this.value.getClass().getName()+" was encountered");
1311          return (Count) this.value;
1312        }
1313
1314        public boolean hasValueCount() { 
1315          return this != null && this.value instanceof Count;
1316        }
1317
1318        /**
1319         * @return {@link #value} (The value of the input parameter as a basic type.)
1320         */
1321        public Distance getValueDistance() throws FHIRException { 
1322          if (this.value == null)
1323            this.value = new Distance();
1324          if (!(this.value instanceof Distance))
1325            throw new FHIRException("Type mismatch: the type Distance was expected, but "+this.value.getClass().getName()+" was encountered");
1326          return (Distance) this.value;
1327        }
1328
1329        public boolean hasValueDistance() { 
1330          return this != null && this.value instanceof Distance;
1331        }
1332
1333        /**
1334         * @return {@link #value} (The value of the input parameter as a basic type.)
1335         */
1336        public Duration getValueDuration() throws FHIRException { 
1337          if (this.value == null)
1338            this.value = new Duration();
1339          if (!(this.value instanceof Duration))
1340            throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.value.getClass().getName()+" was encountered");
1341          return (Duration) this.value;
1342        }
1343
1344        public boolean hasValueDuration() { 
1345          return this != null && this.value instanceof Duration;
1346        }
1347
1348        /**
1349         * @return {@link #value} (The value of the input parameter as a basic type.)
1350         */
1351        public HumanName getValueHumanName() throws FHIRException { 
1352          if (this.value == null)
1353            this.value = new HumanName();
1354          if (!(this.value instanceof HumanName))
1355            throw new FHIRException("Type mismatch: the type HumanName was expected, but "+this.value.getClass().getName()+" was encountered");
1356          return (HumanName) this.value;
1357        }
1358
1359        public boolean hasValueHumanName() { 
1360          return this != null && this.value instanceof HumanName;
1361        }
1362
1363        /**
1364         * @return {@link #value} (The value of the input parameter as a basic type.)
1365         */
1366        public Identifier getValueIdentifier() throws FHIRException { 
1367          if (this.value == null)
1368            this.value = new Identifier();
1369          if (!(this.value instanceof Identifier))
1370            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.value.getClass().getName()+" was encountered");
1371          return (Identifier) this.value;
1372        }
1373
1374        public boolean hasValueIdentifier() { 
1375          return this != null && this.value instanceof Identifier;
1376        }
1377
1378        /**
1379         * @return {@link #value} (The value of the input parameter as a basic type.)
1380         */
1381        public Money getValueMoney() throws FHIRException { 
1382          if (this.value == null)
1383            this.value = new Money();
1384          if (!(this.value instanceof Money))
1385            throw new FHIRException("Type mismatch: the type Money was expected, but "+this.value.getClass().getName()+" was encountered");
1386          return (Money) this.value;
1387        }
1388
1389        public boolean hasValueMoney() { 
1390          return this != null && this.value instanceof Money;
1391        }
1392
1393        /**
1394         * @return {@link #value} (The value of the input parameter as a basic type.)
1395         */
1396        public Period getValuePeriod() throws FHIRException { 
1397          if (this.value == null)
1398            this.value = new Period();
1399          if (!(this.value instanceof Period))
1400            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered");
1401          return (Period) this.value;
1402        }
1403
1404        public boolean hasValuePeriod() { 
1405          return this != null && this.value instanceof Period;
1406        }
1407
1408        /**
1409         * @return {@link #value} (The value of the input parameter as a basic type.)
1410         */
1411        public Quantity getValueQuantity() throws FHIRException { 
1412          if (this.value == null)
1413            this.value = new Quantity();
1414          if (!(this.value instanceof Quantity))
1415            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
1416          return (Quantity) this.value;
1417        }
1418
1419        public boolean hasValueQuantity() { 
1420          return this != null && this.value instanceof Quantity;
1421        }
1422
1423        /**
1424         * @return {@link #value} (The value of the input parameter as a basic type.)
1425         */
1426        public Range getValueRange() throws FHIRException { 
1427          if (this.value == null)
1428            this.value = new Range();
1429          if (!(this.value instanceof Range))
1430            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
1431          return (Range) this.value;
1432        }
1433
1434        public boolean hasValueRange() { 
1435          return this != null && this.value instanceof Range;
1436        }
1437
1438        /**
1439         * @return {@link #value} (The value of the input parameter as a basic type.)
1440         */
1441        public Ratio getValueRatio() throws FHIRException { 
1442          if (this.value == null)
1443            this.value = new Ratio();
1444          if (!(this.value instanceof Ratio))
1445            throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered");
1446          return (Ratio) this.value;
1447        }
1448
1449        public boolean hasValueRatio() { 
1450          return this != null && this.value instanceof Ratio;
1451        }
1452
1453        /**
1454         * @return {@link #value} (The value of the input parameter as a basic type.)
1455         */
1456        public Reference getValueReference() throws FHIRException { 
1457          if (this.value == null)
1458            this.value = new Reference();
1459          if (!(this.value instanceof Reference))
1460            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered");
1461          return (Reference) this.value;
1462        }
1463
1464        public boolean hasValueReference() { 
1465          return this != null && this.value instanceof Reference;
1466        }
1467
1468        /**
1469         * @return {@link #value} (The value of the input parameter as a basic type.)
1470         */
1471        public SampledData getValueSampledData() throws FHIRException { 
1472          if (this.value == null)
1473            this.value = new SampledData();
1474          if (!(this.value instanceof SampledData))
1475            throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered");
1476          return (SampledData) this.value;
1477        }
1478
1479        public boolean hasValueSampledData() { 
1480          return this != null && this.value instanceof SampledData;
1481        }
1482
1483        /**
1484         * @return {@link #value} (The value of the input parameter as a basic type.)
1485         */
1486        public Signature getValueSignature() throws FHIRException { 
1487          if (this.value == null)
1488            this.value = new Signature();
1489          if (!(this.value instanceof Signature))
1490            throw new FHIRException("Type mismatch: the type Signature was expected, but "+this.value.getClass().getName()+" was encountered");
1491          return (Signature) this.value;
1492        }
1493
1494        public boolean hasValueSignature() { 
1495          return this != null && this.value instanceof Signature;
1496        }
1497
1498        /**
1499         * @return {@link #value} (The value of the input parameter as a basic type.)
1500         */
1501        public Timing getValueTiming() throws FHIRException { 
1502          if (this.value == null)
1503            this.value = new Timing();
1504          if (!(this.value instanceof Timing))
1505            throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.value.getClass().getName()+" was encountered");
1506          return (Timing) this.value;
1507        }
1508
1509        public boolean hasValueTiming() { 
1510          return this != null && this.value instanceof Timing;
1511        }
1512
1513        /**
1514         * @return {@link #value} (The value of the input parameter as a basic type.)
1515         */
1516        public ContactDetail getValueContactDetail() throws FHIRException { 
1517          if (this.value == null)
1518            this.value = new ContactDetail();
1519          if (!(this.value instanceof ContactDetail))
1520            throw new FHIRException("Type mismatch: the type ContactDetail was expected, but "+this.value.getClass().getName()+" was encountered");
1521          return (ContactDetail) this.value;
1522        }
1523
1524        public boolean hasValueContactDetail() { 
1525          return this != null && this.value instanceof ContactDetail;
1526        }
1527
1528        /**
1529         * @return {@link #value} (The value of the input parameter as a basic type.)
1530         */
1531        public Contributor getValueContributor() throws FHIRException { 
1532          if (this.value == null)
1533            this.value = new Contributor();
1534          if (!(this.value instanceof Contributor))
1535            throw new FHIRException("Type mismatch: the type Contributor was expected, but "+this.value.getClass().getName()+" was encountered");
1536          return (Contributor) this.value;
1537        }
1538
1539        public boolean hasValueContributor() { 
1540          return this != null && this.value instanceof Contributor;
1541        }
1542
1543        /**
1544         * @return {@link #value} (The value of the input parameter as a basic type.)
1545         */
1546        public DataRequirement getValueDataRequirement() throws FHIRException { 
1547          if (this.value == null)
1548            this.value = new DataRequirement();
1549          if (!(this.value instanceof DataRequirement))
1550            throw new FHIRException("Type mismatch: the type DataRequirement was expected, but "+this.value.getClass().getName()+" was encountered");
1551          return (DataRequirement) this.value;
1552        }
1553
1554        public boolean hasValueDataRequirement() { 
1555          return this != null && this.value instanceof DataRequirement;
1556        }
1557
1558        /**
1559         * @return {@link #value} (The value of the input parameter as a basic type.)
1560         */
1561        public Expression getValueExpression() throws FHIRException { 
1562          if (this.value == null)
1563            this.value = new Expression();
1564          if (!(this.value instanceof Expression))
1565            throw new FHIRException("Type mismatch: the type Expression was expected, but "+this.value.getClass().getName()+" was encountered");
1566          return (Expression) this.value;
1567        }
1568
1569        public boolean hasValueExpression() { 
1570          return this != null && this.value instanceof Expression;
1571        }
1572
1573        /**
1574         * @return {@link #value} (The value of the input parameter as a basic type.)
1575         */
1576        public ParameterDefinition getValueParameterDefinition() throws FHIRException { 
1577          if (this.value == null)
1578            this.value = new ParameterDefinition();
1579          if (!(this.value instanceof ParameterDefinition))
1580            throw new FHIRException("Type mismatch: the type ParameterDefinition was expected, but "+this.value.getClass().getName()+" was encountered");
1581          return (ParameterDefinition) this.value;
1582        }
1583
1584        public boolean hasValueParameterDefinition() { 
1585          return this != null && this.value instanceof ParameterDefinition;
1586        }
1587
1588        /**
1589         * @return {@link #value} (The value of the input parameter as a basic type.)
1590         */
1591        public RelatedArtifact getValueRelatedArtifact() throws FHIRException { 
1592          if (this.value == null)
1593            this.value = new RelatedArtifact();
1594          if (!(this.value instanceof RelatedArtifact))
1595            throw new FHIRException("Type mismatch: the type RelatedArtifact was expected, but "+this.value.getClass().getName()+" was encountered");
1596          return (RelatedArtifact) this.value;
1597        }
1598
1599        public boolean hasValueRelatedArtifact() { 
1600          return this != null && this.value instanceof RelatedArtifact;
1601        }
1602
1603        /**
1604         * @return {@link #value} (The value of the input parameter as a basic type.)
1605         */
1606        public TriggerDefinition getValueTriggerDefinition() throws FHIRException { 
1607          if (this.value == null)
1608            this.value = new TriggerDefinition();
1609          if (!(this.value instanceof TriggerDefinition))
1610            throw new FHIRException("Type mismatch: the type TriggerDefinition was expected, but "+this.value.getClass().getName()+" was encountered");
1611          return (TriggerDefinition) this.value;
1612        }
1613
1614        public boolean hasValueTriggerDefinition() { 
1615          return this != null && this.value instanceof TriggerDefinition;
1616        }
1617
1618        /**
1619         * @return {@link #value} (The value of the input parameter as a basic type.)
1620         */
1621        public UsageContext getValueUsageContext() throws FHIRException { 
1622          if (this.value == null)
1623            this.value = new UsageContext();
1624          if (!(this.value instanceof UsageContext))
1625            throw new FHIRException("Type mismatch: the type UsageContext was expected, but "+this.value.getClass().getName()+" was encountered");
1626          return (UsageContext) this.value;
1627        }
1628
1629        public boolean hasValueUsageContext() { 
1630          return this != null && this.value instanceof UsageContext;
1631        }
1632
1633        /**
1634         * @return {@link #value} (The value of the input parameter as a basic type.)
1635         */
1636        public Dosage getValueDosage() throws FHIRException { 
1637          if (this.value == null)
1638            this.value = new Dosage();
1639          if (!(this.value instanceof Dosage))
1640            throw new FHIRException("Type mismatch: the type Dosage was expected, but "+this.value.getClass().getName()+" was encountered");
1641          return (Dosage) this.value;
1642        }
1643
1644        public boolean hasValueDosage() { 
1645          return this != null && this.value instanceof Dosage;
1646        }
1647
1648        /**
1649         * @return {@link #value} (The value of the input parameter as a basic type.)
1650         */
1651        public Meta getValueMeta() throws FHIRException { 
1652          if (this.value == null)
1653            this.value = new Meta();
1654          if (!(this.value instanceof Meta))
1655            throw new FHIRException("Type mismatch: the type Meta was expected, but "+this.value.getClass().getName()+" was encountered");
1656          return (Meta) this.value;
1657        }
1658
1659        public boolean hasValueMeta() { 
1660          return this != null && this.value instanceof Meta;
1661        }
1662
1663        public boolean hasValue() { 
1664          return this.value != null && !this.value.isEmpty();
1665        }
1666
1667        /**
1668         * @param value {@link #value} (The value of the input parameter as a basic type.)
1669         */
1670        public ParameterComponent setValue(DataType value) { 
1671          if (value != null && !(value instanceof Base64BinaryType || value instanceof BooleanType || value instanceof CanonicalType || value instanceof CodeType || value instanceof DateType || value instanceof DateTimeType || value instanceof DecimalType || value instanceof IdType || value instanceof InstantType || value instanceof IntegerType || value instanceof Integer64Type || value instanceof MarkdownType || value instanceof OidType || value instanceof PositiveIntType || value instanceof StringType || value instanceof TimeType || value instanceof UnsignedIntType || value instanceof UriType || value instanceof UrlType || value instanceof UuidType || value instanceof Address || value instanceof Age || value instanceof Annotation || value instanceof Attachment || value instanceof CodeableConcept || value instanceof Coding || value instanceof ContactPoint || value instanceof Count || value instanceof Distance || value instanceof Duration || value instanceof HumanName || value instanceof Identifier || value instanceof Money || value instanceof Period || value instanceof Quantity || value instanceof Range || value instanceof Ratio || value instanceof Reference || value instanceof SampledData || value instanceof Signature || value instanceof Timing || value instanceof ContactDetail || value instanceof Contributor || value instanceof DataRequirement || value instanceof Expression || value instanceof ParameterDefinition || value instanceof RelatedArtifact || value instanceof TriggerDefinition || value instanceof UsageContext || value instanceof Dosage || value instanceof Meta))
1672            throw new Error("Not the right type for Task.input.value[x]: "+value.fhirType());
1673          this.value = value;
1674          return this;
1675        }
1676
1677        protected void listChildren(List<Property> children) {
1678          super.listChildren(children);
1679          children.add(new Property("type", "CodeableConcept", "A code or description indicating how the input is intended to be used as part of the task execution.", 0, 1, type));
1680          children.add(new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "The value of the input parameter as a basic type.", 0, 1, value));
1681        }
1682
1683        @Override
1684        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1685          switch (_hash) {
1686          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A code or description indicating how the input is intended to be used as part of the task execution.", 0, 1, type);
1687          case -1410166417: /*value[x]*/  return new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "The value of the input parameter as a basic type.", 0, 1, value);
1688          case 111972721: /*value*/  return new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "The value of the input parameter as a basic type.", 0, 1, value);
1689          case -1535024575: /*valueBase64Binary*/  return new Property("value[x]", "base64Binary", "The value of the input parameter as a basic type.", 0, 1, value);
1690          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "The value of the input parameter as a basic type.", 0, 1, value);
1691          case -786218365: /*valueCanonical*/  return new Property("value[x]", "canonical", "The value of the input parameter as a basic type.", 0, 1, value);
1692          case -766209282: /*valueCode*/  return new Property("value[x]", "code", "The value of the input parameter as a basic type.", 0, 1, value);
1693          case -766192449: /*valueDate*/  return new Property("value[x]", "date", "The value of the input parameter as a basic type.", 0, 1, value);
1694          case 1047929900: /*valueDateTime*/  return new Property("value[x]", "dateTime", "The value of the input parameter as a basic type.", 0, 1, value);
1695          case -2083993440: /*valueDecimal*/  return new Property("value[x]", "decimal", "The value of the input parameter as a basic type.", 0, 1, value);
1696          case 231604844: /*valueId*/  return new Property("value[x]", "id", "The value of the input parameter as a basic type.", 0, 1, value);
1697          case -1668687056: /*valueInstant*/  return new Property("value[x]", "instant", "The value of the input parameter as a basic type.", 0, 1, value);
1698          case -1668204915: /*valueInteger*/  return new Property("value[x]", "integer", "The value of the input parameter as a basic type.", 0, 1, value);
1699          case -1122120181: /*valueInteger64*/  return new Property("value[x]", "integer64", "The value of the input parameter as a basic type.", 0, 1, value);
1700          case -497880704: /*valueMarkdown*/  return new Property("value[x]", "markdown", "The value of the input parameter as a basic type.", 0, 1, value);
1701          case -1410178407: /*valueOid*/  return new Property("value[x]", "oid", "The value of the input parameter as a basic type.", 0, 1, value);
1702          case -1249932027: /*valuePositiveInt*/  return new Property("value[x]", "positiveInt", "The value of the input parameter as a basic type.", 0, 1, value);
1703          case -1424603934: /*valueString*/  return new Property("value[x]", "string", "The value of the input parameter as a basic type.", 0, 1, value);
1704          case -765708322: /*valueTime*/  return new Property("value[x]", "time", "The value of the input parameter as a basic type.", 0, 1, value);
1705          case 26529417: /*valueUnsignedInt*/  return new Property("value[x]", "unsignedInt", "The value of the input parameter as a basic type.", 0, 1, value);
1706          case -1410172357: /*valueUri*/  return new Property("value[x]", "uri", "The value of the input parameter as a basic type.", 0, 1, value);
1707          case -1410172354: /*valueUrl*/  return new Property("value[x]", "url", "The value of the input parameter as a basic type.", 0, 1, value);
1708          case -765667124: /*valueUuid*/  return new Property("value[x]", "uuid", "The value of the input parameter as a basic type.", 0, 1, value);
1709          case -478981821: /*valueAddress*/  return new Property("value[x]", "Address", "The value of the input parameter as a basic type.", 0, 1, value);
1710          case -1410191922: /*valueAge*/  return new Property("value[x]", "Age", "The value of the input parameter as a basic type.", 0, 1, value);
1711          case -67108992: /*valueAnnotation*/  return new Property("value[x]", "Annotation", "The value of the input parameter as a basic type.", 0, 1, value);
1712          case -475566732: /*valueAttachment*/  return new Property("value[x]", "Attachment", "The value of the input parameter as a basic type.", 0, 1, value);
1713          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept", "The value of the input parameter as a basic type.", 0, 1, value);
1714          case -1887705029: /*valueCoding*/  return new Property("value[x]", "Coding", "The value of the input parameter as a basic type.", 0, 1, value);
1715          case 944904545: /*valueContactPoint*/  return new Property("value[x]", "ContactPoint", "The value of the input parameter as a basic type.", 0, 1, value);
1716          case 2017332766: /*valueCount*/  return new Property("value[x]", "Count", "The value of the input parameter as a basic type.", 0, 1, value);
1717          case -456359802: /*valueDistance*/  return new Property("value[x]", "Distance", "The value of the input parameter as a basic type.", 0, 1, value);
1718          case 1558135333: /*valueDuration*/  return new Property("value[x]", "Duration", "The value of the input parameter as a basic type.", 0, 1, value);
1719          case -2026205465: /*valueHumanName*/  return new Property("value[x]", "HumanName", "The value of the input parameter as a basic type.", 0, 1, value);
1720          case -130498310: /*valueIdentifier*/  return new Property("value[x]", "Identifier", "The value of the input parameter as a basic type.", 0, 1, value);
1721          case 2026560975: /*valueMoney*/  return new Property("value[x]", "Money", "The value of the input parameter as a basic type.", 0, 1, value);
1722          case -1524344174: /*valuePeriod*/  return new Property("value[x]", "Period", "The value of the input parameter as a basic type.", 0, 1, value);
1723          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "The value of the input parameter as a basic type.", 0, 1, value);
1724          case 2030761548: /*valueRange*/  return new Property("value[x]", "Range", "The value of the input parameter as a basic type.", 0, 1, value);
1725          case 2030767386: /*valueRatio*/  return new Property("value[x]", "Ratio", "The value of the input parameter as a basic type.", 0, 1, value);
1726          case 1755241690: /*valueReference*/  return new Property("value[x]", "Reference", "The value of the input parameter as a basic type.", 0, 1, value);
1727          case -962229101: /*valueSampledData*/  return new Property("value[x]", "SampledData", "The value of the input parameter as a basic type.", 0, 1, value);
1728          case -540985785: /*valueSignature*/  return new Property("value[x]", "Signature", "The value of the input parameter as a basic type.", 0, 1, value);
1729          case -1406282469: /*valueTiming*/  return new Property("value[x]", "Timing", "The value of the input parameter as a basic type.", 0, 1, value);
1730          case -1125200224: /*valueContactDetail*/  return new Property("value[x]", "ContactDetail", "The value of the input parameter as a basic type.", 0, 1, value);
1731          case 1281021610: /*valueContributor*/  return new Property("value[x]", "Contributor", "The value of the input parameter as a basic type.", 0, 1, value);
1732          case 1710554248: /*valueDataRequirement*/  return new Property("value[x]", "DataRequirement", "The value of the input parameter as a basic type.", 0, 1, value);
1733          case -307517719: /*valueExpression*/  return new Property("value[x]", "Expression", "The value of the input parameter as a basic type.", 0, 1, value);
1734          case 1387478187: /*valueParameterDefinition*/  return new Property("value[x]", "ParameterDefinition", "The value of the input parameter as a basic type.", 0, 1, value);
1735          case 1748214124: /*valueRelatedArtifact*/  return new Property("value[x]", "RelatedArtifact", "The value of the input parameter as a basic type.", 0, 1, value);
1736          case 976830394: /*valueTriggerDefinition*/  return new Property("value[x]", "TriggerDefinition", "The value of the input parameter as a basic type.", 0, 1, value);
1737          case 588000479: /*valueUsageContext*/  return new Property("value[x]", "UsageContext", "The value of the input parameter as a basic type.", 0, 1, value);
1738          case -1858636920: /*valueDosage*/  return new Property("value[x]", "Dosage", "The value of the input parameter as a basic type.", 0, 1, value);
1739          case -765920490: /*valueMeta*/  return new Property("value[x]", "Meta", "The value of the input parameter as a basic type.", 0, 1, value);
1740          default: return super.getNamedProperty(_hash, _name, _checkValid);
1741          }
1742
1743        }
1744
1745      @Override
1746      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1747        switch (hash) {
1748        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1749        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
1750        default: return super.getProperty(hash, name, checkValid);
1751        }
1752
1753      }
1754
1755      @Override
1756      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1757        switch (hash) {
1758        case 3575610: // type
1759          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1760          return value;
1761        case 111972721: // value
1762          this.value = TypeConvertor.castToType(value); // DataType
1763          return value;
1764        default: return super.setProperty(hash, name, value);
1765        }
1766
1767      }
1768
1769      @Override
1770      public Base setProperty(String name, Base value) throws FHIRException {
1771        if (name.equals("type")) {
1772          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1773        } else if (name.equals("value[x]")) {
1774          this.value = TypeConvertor.castToType(value); // DataType
1775        } else
1776          return super.setProperty(name, value);
1777        return value;
1778      }
1779
1780      @Override
1781      public Base makeProperty(int hash, String name) throws FHIRException {
1782        switch (hash) {
1783        case 3575610:  return getType();
1784        case -1410166417:  return getValue();
1785        case 111972721:  return getValue();
1786        default: return super.makeProperty(hash, name);
1787        }
1788
1789      }
1790
1791      @Override
1792      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1793        switch (hash) {
1794        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1795        case 111972721: /*value*/ return new String[] {"base64Binary", "boolean", "canonical", "code", "date", "dateTime", "decimal", "id", "instant", "integer", "integer64", "markdown", "oid", "positiveInt", "string", "time", "unsignedInt", "uri", "url", "uuid", "Address", "Age", "Annotation", "Attachment", "CodeableConcept", "Coding", "ContactPoint", "Count", "Distance", "Duration", "HumanName", "Identifier", "Money", "Period", "Quantity", "Range", "Ratio", "Reference", "SampledData", "Signature", "Timing", "ContactDetail", "Contributor", "DataRequirement", "Expression", "ParameterDefinition", "RelatedArtifact", "TriggerDefinition", "UsageContext", "Dosage", "Meta"};
1796        default: return super.getTypesForProperty(hash, name);
1797        }
1798
1799      }
1800
1801      @Override
1802      public Base addChild(String name) throws FHIRException {
1803        if (name.equals("type")) {
1804          this.type = new CodeableConcept();
1805          return this.type;
1806        }
1807        else if (name.equals("valueBase64Binary")) {
1808          this.value = new Base64BinaryType();
1809          return this.value;
1810        }
1811        else if (name.equals("valueBoolean")) {
1812          this.value = new BooleanType();
1813          return this.value;
1814        }
1815        else if (name.equals("valueCanonical")) {
1816          this.value = new CanonicalType();
1817          return this.value;
1818        }
1819        else if (name.equals("valueCode")) {
1820          this.value = new CodeType();
1821          return this.value;
1822        }
1823        else if (name.equals("valueDate")) {
1824          this.value = new DateType();
1825          return this.value;
1826        }
1827        else if (name.equals("valueDateTime")) {
1828          this.value = new DateTimeType();
1829          return this.value;
1830        }
1831        else if (name.equals("valueDecimal")) {
1832          this.value = new DecimalType();
1833          return this.value;
1834        }
1835        else if (name.equals("valueId")) {
1836          this.value = new IdType();
1837          return this.value;
1838        }
1839        else if (name.equals("valueInstant")) {
1840          this.value = new InstantType();
1841          return this.value;
1842        }
1843        else if (name.equals("valueInteger")) {
1844          this.value = new IntegerType();
1845          return this.value;
1846        }
1847        else if (name.equals("valueInteger64")) {
1848          this.value = new Integer64Type();
1849          return this.value;
1850        }
1851        else if (name.equals("valueMarkdown")) {
1852          this.value = new MarkdownType();
1853          return this.value;
1854        }
1855        else if (name.equals("valueOid")) {
1856          this.value = new OidType();
1857          return this.value;
1858        }
1859        else if (name.equals("valuePositiveInt")) {
1860          this.value = new PositiveIntType();
1861          return this.value;
1862        }
1863        else if (name.equals("valueString")) {
1864          this.value = new StringType();
1865          return this.value;
1866        }
1867        else if (name.equals("valueTime")) {
1868          this.value = new TimeType();
1869          return this.value;
1870        }
1871        else if (name.equals("valueUnsignedInt")) {
1872          this.value = new UnsignedIntType();
1873          return this.value;
1874        }
1875        else if (name.equals("valueUri")) {
1876          this.value = new UriType();
1877          return this.value;
1878        }
1879        else if (name.equals("valueUrl")) {
1880          this.value = new UrlType();
1881          return this.value;
1882        }
1883        else if (name.equals("valueUuid")) {
1884          this.value = new UuidType();
1885          return this.value;
1886        }
1887        else if (name.equals("valueAddress")) {
1888          this.value = new Address();
1889          return this.value;
1890        }
1891        else if (name.equals("valueAge")) {
1892          this.value = new Age();
1893          return this.value;
1894        }
1895        else if (name.equals("valueAnnotation")) {
1896          this.value = new Annotation();
1897          return this.value;
1898        }
1899        else if (name.equals("valueAttachment")) {
1900          this.value = new Attachment();
1901          return this.value;
1902        }
1903        else if (name.equals("valueCodeableConcept")) {
1904          this.value = new CodeableConcept();
1905          return this.value;
1906        }
1907        else if (name.equals("valueCoding")) {
1908          this.value = new Coding();
1909          return this.value;
1910        }
1911        else if (name.equals("valueContactPoint")) {
1912          this.value = new ContactPoint();
1913          return this.value;
1914        }
1915        else if (name.equals("valueCount")) {
1916          this.value = new Count();
1917          return this.value;
1918        }
1919        else if (name.equals("valueDistance")) {
1920          this.value = new Distance();
1921          return this.value;
1922        }
1923        else if (name.equals("valueDuration")) {
1924          this.value = new Duration();
1925          return this.value;
1926        }
1927        else if (name.equals("valueHumanName")) {
1928          this.value = new HumanName();
1929          return this.value;
1930        }
1931        else if (name.equals("valueIdentifier")) {
1932          this.value = new Identifier();
1933          return this.value;
1934        }
1935        else if (name.equals("valueMoney")) {
1936          this.value = new Money();
1937          return this.value;
1938        }
1939        else if (name.equals("valuePeriod")) {
1940          this.value = new Period();
1941          return this.value;
1942        }
1943        else if (name.equals("valueQuantity")) {
1944          this.value = new Quantity();
1945          return this.value;
1946        }
1947        else if (name.equals("valueRange")) {
1948          this.value = new Range();
1949          return this.value;
1950        }
1951        else if (name.equals("valueRatio")) {
1952          this.value = new Ratio();
1953          return this.value;
1954        }
1955        else if (name.equals("valueReference")) {
1956          this.value = new Reference();
1957          return this.value;
1958        }
1959        else if (name.equals("valueSampledData")) {
1960          this.value = new SampledData();
1961          return this.value;
1962        }
1963        else if (name.equals("valueSignature")) {
1964          this.value = new Signature();
1965          return this.value;
1966        }
1967        else if (name.equals("valueTiming")) {
1968          this.value = new Timing();
1969          return this.value;
1970        }
1971        else if (name.equals("valueContactDetail")) {
1972          this.value = new ContactDetail();
1973          return this.value;
1974        }
1975        else if (name.equals("valueContributor")) {
1976          this.value = new Contributor();
1977          return this.value;
1978        }
1979        else if (name.equals("valueDataRequirement")) {
1980          this.value = new DataRequirement();
1981          return this.value;
1982        }
1983        else if (name.equals("valueExpression")) {
1984          this.value = new Expression();
1985          return this.value;
1986        }
1987        else if (name.equals("valueParameterDefinition")) {
1988          this.value = new ParameterDefinition();
1989          return this.value;
1990        }
1991        else if (name.equals("valueRelatedArtifact")) {
1992          this.value = new RelatedArtifact();
1993          return this.value;
1994        }
1995        else if (name.equals("valueTriggerDefinition")) {
1996          this.value = new TriggerDefinition();
1997          return this.value;
1998        }
1999        else if (name.equals("valueUsageContext")) {
2000          this.value = new UsageContext();
2001          return this.value;
2002        }
2003        else if (name.equals("valueDosage")) {
2004          this.value = new Dosage();
2005          return this.value;
2006        }
2007        else if (name.equals("valueMeta")) {
2008          this.value = new Meta();
2009          return this.value;
2010        }
2011        else
2012          return super.addChild(name);
2013      }
2014
2015      public ParameterComponent copy() {
2016        ParameterComponent dst = new ParameterComponent();
2017        copyValues(dst);
2018        return dst;
2019      }
2020
2021      public void copyValues(ParameterComponent dst) {
2022        super.copyValues(dst);
2023        dst.type = type == null ? null : type.copy();
2024        dst.value = value == null ? null : value.copy();
2025      }
2026
2027      @Override
2028      public boolean equalsDeep(Base other_) {
2029        if (!super.equalsDeep(other_))
2030          return false;
2031        if (!(other_ instanceof ParameterComponent))
2032          return false;
2033        ParameterComponent o = (ParameterComponent) other_;
2034        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true);
2035      }
2036
2037      @Override
2038      public boolean equalsShallow(Base other_) {
2039        if (!super.equalsShallow(other_))
2040          return false;
2041        if (!(other_ instanceof ParameterComponent))
2042          return false;
2043        ParameterComponent o = (ParameterComponent) other_;
2044        return true;
2045      }
2046
2047      public boolean isEmpty() {
2048        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value);
2049      }
2050
2051  public String fhirType() {
2052    return "Task.input";
2053
2054  }
2055
2056  }
2057
2058    @Block()
2059    public static class TaskOutputComponent extends BackboneElement implements IBaseBackboneElement {
2060        /**
2061         * The name of the Output parameter.
2062         */
2063        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
2064        @Description(shortDefinition="Label for output", formalDefinition="The name of the Output parameter." )
2065        protected CodeableConcept type;
2066
2067        /**
2068         * The value of the Output parameter as a basic type.
2069         */
2070        @Child(name = "value", type = {Base64BinaryType.class, BooleanType.class, CanonicalType.class, CodeType.class, DateType.class, DateTimeType.class, DecimalType.class, IdType.class, InstantType.class, IntegerType.class, Integer64Type.class, MarkdownType.class, OidType.class, PositiveIntType.class, StringType.class, TimeType.class, UnsignedIntType.class, UriType.class, UrlType.class, UuidType.class, Address.class, Age.class, Annotation.class, Attachment.class, CodeableConcept.class, Coding.class, ContactPoint.class, Count.class, Distance.class, Duration.class, HumanName.class, Identifier.class, Money.class, Period.class, Quantity.class, Range.class, Ratio.class, Reference.class, SampledData.class, Signature.class, Timing.class, ContactDetail.class, Contributor.class, DataRequirement.class, Expression.class, ParameterDefinition.class, RelatedArtifact.class, TriggerDefinition.class, UsageContext.class, Dosage.class, Meta.class}, order=2, min=1, max=1, modifier=false, summary=false)
2071        @Description(shortDefinition="Result of output", formalDefinition="The value of the Output parameter as a basic type." )
2072        protected DataType value;
2073
2074        private static final long serialVersionUID = -1659186716L;
2075
2076    /**
2077     * Constructor
2078     */
2079      public TaskOutputComponent() {
2080        super();
2081      }
2082
2083    /**
2084     * Constructor
2085     */
2086      public TaskOutputComponent(CodeableConcept type, DataType value) {
2087        super();
2088        this.setType(type);
2089        this.setValue(value);
2090      }
2091
2092        /**
2093         * @return {@link #type} (The name of the Output parameter.)
2094         */
2095        public CodeableConcept getType() { 
2096          if (this.type == null)
2097            if (Configuration.errorOnAutoCreate())
2098              throw new Error("Attempt to auto-create TaskOutputComponent.type");
2099            else if (Configuration.doAutoCreate())
2100              this.type = new CodeableConcept(); // cc
2101          return this.type;
2102        }
2103
2104        public boolean hasType() { 
2105          return this.type != null && !this.type.isEmpty();
2106        }
2107
2108        /**
2109         * @param value {@link #type} (The name of the Output parameter.)
2110         */
2111        public TaskOutputComponent setType(CodeableConcept value) { 
2112          this.type = value;
2113          return this;
2114        }
2115
2116        /**
2117         * @return {@link #value} (The value of the Output parameter as a basic type.)
2118         */
2119        public DataType getValue() { 
2120          return this.value;
2121        }
2122
2123        /**
2124         * @return {@link #value} (The value of the Output parameter as a basic type.)
2125         */
2126        public Base64BinaryType getValueBase64BinaryType() throws FHIRException { 
2127          if (this.value == null)
2128            this.value = new Base64BinaryType();
2129          if (!(this.value instanceof Base64BinaryType))
2130            throw new FHIRException("Type mismatch: the type Base64BinaryType was expected, but "+this.value.getClass().getName()+" was encountered");
2131          return (Base64BinaryType) this.value;
2132        }
2133
2134        public boolean hasValueBase64BinaryType() { 
2135          return this != null && this.value instanceof Base64BinaryType;
2136        }
2137
2138        /**
2139         * @return {@link #value} (The value of the Output parameter as a basic type.)
2140         */
2141        public BooleanType getValueBooleanType() throws FHIRException { 
2142          if (this.value == null)
2143            this.value = new BooleanType();
2144          if (!(this.value instanceof BooleanType))
2145            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
2146          return (BooleanType) this.value;
2147        }
2148
2149        public boolean hasValueBooleanType() { 
2150          return this != null && this.value instanceof BooleanType;
2151        }
2152
2153        /**
2154         * @return {@link #value} (The value of the Output parameter as a basic type.)
2155         */
2156        public CanonicalType getValueCanonicalType() throws FHIRException { 
2157          if (this.value == null)
2158            this.value = new CanonicalType();
2159          if (!(this.value instanceof CanonicalType))
2160            throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.value.getClass().getName()+" was encountered");
2161          return (CanonicalType) this.value;
2162        }
2163
2164        public boolean hasValueCanonicalType() { 
2165          return this != null && this.value instanceof CanonicalType;
2166        }
2167
2168        /**
2169         * @return {@link #value} (The value of the Output parameter as a basic type.)
2170         */
2171        public CodeType getValueCodeType() throws FHIRException { 
2172          if (this.value == null)
2173            this.value = new CodeType();
2174          if (!(this.value instanceof CodeType))
2175            throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.value.getClass().getName()+" was encountered");
2176          return (CodeType) this.value;
2177        }
2178
2179        public boolean hasValueCodeType() { 
2180          return this != null && this.value instanceof CodeType;
2181        }
2182
2183        /**
2184         * @return {@link #value} (The value of the Output parameter as a basic type.)
2185         */
2186        public DateType getValueDateType() throws FHIRException { 
2187          if (this.value == null)
2188            this.value = new DateType();
2189          if (!(this.value instanceof DateType))
2190            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered");
2191          return (DateType) this.value;
2192        }
2193
2194        public boolean hasValueDateType() { 
2195          return this != null && this.value instanceof DateType;
2196        }
2197
2198        /**
2199         * @return {@link #value} (The value of the Output parameter as a basic type.)
2200         */
2201        public DateTimeType getValueDateTimeType() throws FHIRException { 
2202          if (this.value == null)
2203            this.value = new DateTimeType();
2204          if (!(this.value instanceof DateTimeType))
2205            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered");
2206          return (DateTimeType) this.value;
2207        }
2208
2209        public boolean hasValueDateTimeType() { 
2210          return this != null && this.value instanceof DateTimeType;
2211        }
2212
2213        /**
2214         * @return {@link #value} (The value of the Output parameter as a basic type.)
2215         */
2216        public DecimalType getValueDecimalType() throws FHIRException { 
2217          if (this.value == null)
2218            this.value = new DecimalType();
2219          if (!(this.value instanceof DecimalType))
2220            throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered");
2221          return (DecimalType) this.value;
2222        }
2223
2224        public boolean hasValueDecimalType() { 
2225          return this != null && this.value instanceof DecimalType;
2226        }
2227
2228        /**
2229         * @return {@link #value} (The value of the Output parameter as a basic type.)
2230         */
2231        public IdType getValueIdType() throws FHIRException { 
2232          if (this.value == null)
2233            this.value = new IdType();
2234          if (!(this.value instanceof IdType))
2235            throw new FHIRException("Type mismatch: the type IdType was expected, but "+this.value.getClass().getName()+" was encountered");
2236          return (IdType) this.value;
2237        }
2238
2239        public boolean hasValueIdType() { 
2240          return this != null && this.value instanceof IdType;
2241        }
2242
2243        /**
2244         * @return {@link #value} (The value of the Output parameter as a basic type.)
2245         */
2246        public InstantType getValueInstantType() throws FHIRException { 
2247          if (this.value == null)
2248            this.value = new InstantType();
2249          if (!(this.value instanceof InstantType))
2250            throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.value.getClass().getName()+" was encountered");
2251          return (InstantType) this.value;
2252        }
2253
2254        public boolean hasValueInstantType() { 
2255          return this != null && this.value instanceof InstantType;
2256        }
2257
2258        /**
2259         * @return {@link #value} (The value of the Output parameter as a basic type.)
2260         */
2261        public IntegerType getValueIntegerType() throws FHIRException { 
2262          if (this.value == null)
2263            this.value = new IntegerType();
2264          if (!(this.value instanceof IntegerType))
2265            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
2266          return (IntegerType) this.value;
2267        }
2268
2269        public boolean hasValueIntegerType() { 
2270          return this != null && this.value instanceof IntegerType;
2271        }
2272
2273        /**
2274         * @return {@link #value} (The value of the Output parameter as a basic type.)
2275         */
2276        public Integer64Type getValueInteger64Type() throws FHIRException { 
2277          if (this.value == null)
2278            this.value = new Integer64Type();
2279          if (!(this.value instanceof Integer64Type))
2280            throw new FHIRException("Type mismatch: the type Integer64Type was expected, but "+this.value.getClass().getName()+" was encountered");
2281          return (Integer64Type) this.value;
2282        }
2283
2284        public boolean hasValueInteger64Type() { 
2285          return this != null && this.value instanceof Integer64Type;
2286        }
2287
2288        /**
2289         * @return {@link #value} (The value of the Output parameter as a basic type.)
2290         */
2291        public MarkdownType getValueMarkdownType() throws FHIRException { 
2292          if (this.value == null)
2293            this.value = new MarkdownType();
2294          if (!(this.value instanceof MarkdownType))
2295            throw new FHIRException("Type mismatch: the type MarkdownType was expected, but "+this.value.getClass().getName()+" was encountered");
2296          return (MarkdownType) this.value;
2297        }
2298
2299        public boolean hasValueMarkdownType() { 
2300          return this != null && this.value instanceof MarkdownType;
2301        }
2302
2303        /**
2304         * @return {@link #value} (The value of the Output parameter as a basic type.)
2305         */
2306        public OidType getValueOidType() throws FHIRException { 
2307          if (this.value == null)
2308            this.value = new OidType();
2309          if (!(this.value instanceof OidType))
2310            throw new FHIRException("Type mismatch: the type OidType was expected, but "+this.value.getClass().getName()+" was encountered");
2311          return (OidType) this.value;
2312        }
2313
2314        public boolean hasValueOidType() { 
2315          return this != null && this.value instanceof OidType;
2316        }
2317
2318        /**
2319         * @return {@link #value} (The value of the Output parameter as a basic type.)
2320         */
2321        public PositiveIntType getValuePositiveIntType() throws FHIRException { 
2322          if (this.value == null)
2323            this.value = new PositiveIntType();
2324          if (!(this.value instanceof PositiveIntType))
2325            throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.value.getClass().getName()+" was encountered");
2326          return (PositiveIntType) this.value;
2327        }
2328
2329        public boolean hasValuePositiveIntType() { 
2330          return this != null && this.value instanceof PositiveIntType;
2331        }
2332
2333        /**
2334         * @return {@link #value} (The value of the Output parameter as a basic type.)
2335         */
2336        public StringType getValueStringType() throws FHIRException { 
2337          if (this.value == null)
2338            this.value = new StringType();
2339          if (!(this.value instanceof StringType))
2340            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
2341          return (StringType) this.value;
2342        }
2343
2344        public boolean hasValueStringType() { 
2345          return this != null && this.value instanceof StringType;
2346        }
2347
2348        /**
2349         * @return {@link #value} (The value of the Output parameter as a basic type.)
2350         */
2351        public TimeType getValueTimeType() throws FHIRException { 
2352          if (this.value == null)
2353            this.value = new TimeType();
2354          if (!(this.value instanceof TimeType))
2355            throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered");
2356          return (TimeType) this.value;
2357        }
2358
2359        public boolean hasValueTimeType() { 
2360          return this != null && this.value instanceof TimeType;
2361        }
2362
2363        /**
2364         * @return {@link #value} (The value of the Output parameter as a basic type.)
2365         */
2366        public UnsignedIntType getValueUnsignedIntType() throws FHIRException { 
2367          if (this.value == null)
2368            this.value = new UnsignedIntType();
2369          if (!(this.value instanceof UnsignedIntType))
2370            throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.value.getClass().getName()+" was encountered");
2371          return (UnsignedIntType) this.value;
2372        }
2373
2374        public boolean hasValueUnsignedIntType() { 
2375          return this != null && this.value instanceof UnsignedIntType;
2376        }
2377
2378        /**
2379         * @return {@link #value} (The value of the Output parameter as a basic type.)
2380         */
2381        public UriType getValueUriType() throws FHIRException { 
2382          if (this.value == null)
2383            this.value = new UriType();
2384          if (!(this.value instanceof UriType))
2385            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered");
2386          return (UriType) this.value;
2387        }
2388
2389        public boolean hasValueUriType() { 
2390          return this != null && this.value instanceof UriType;
2391        }
2392
2393        /**
2394         * @return {@link #value} (The value of the Output parameter as a basic type.)
2395         */
2396        public UrlType getValueUrlType() throws FHIRException { 
2397          if (this.value == null)
2398            this.value = new UrlType();
2399          if (!(this.value instanceof UrlType))
2400            throw new FHIRException("Type mismatch: the type UrlType was expected, but "+this.value.getClass().getName()+" was encountered");
2401          return (UrlType) this.value;
2402        }
2403
2404        public boolean hasValueUrlType() { 
2405          return this != null && this.value instanceof UrlType;
2406        }
2407
2408        /**
2409         * @return {@link #value} (The value of the Output parameter as a basic type.)
2410         */
2411        public UuidType getValueUuidType() throws FHIRException { 
2412          if (this.value == null)
2413            this.value = new UuidType();
2414          if (!(this.value instanceof UuidType))
2415            throw new FHIRException("Type mismatch: the type UuidType was expected, but "+this.value.getClass().getName()+" was encountered");
2416          return (UuidType) this.value;
2417        }
2418
2419        public boolean hasValueUuidType() { 
2420          return this != null && this.value instanceof UuidType;
2421        }
2422
2423        /**
2424         * @return {@link #value} (The value of the Output parameter as a basic type.)
2425         */
2426        public Address getValueAddress() throws FHIRException { 
2427          if (this.value == null)
2428            this.value = new Address();
2429          if (!(this.value instanceof Address))
2430            throw new FHIRException("Type mismatch: the type Address was expected, but "+this.value.getClass().getName()+" was encountered");
2431          return (Address) this.value;
2432        }
2433
2434        public boolean hasValueAddress() { 
2435          return this != null && this.value instanceof Address;
2436        }
2437
2438        /**
2439         * @return {@link #value} (The value of the Output parameter as a basic type.)
2440         */
2441        public Age getValueAge() throws FHIRException { 
2442          if (this.value == null)
2443            this.value = new Age();
2444          if (!(this.value instanceof Age))
2445            throw new FHIRException("Type mismatch: the type Age was expected, but "+this.value.getClass().getName()+" was encountered");
2446          return (Age) this.value;
2447        }
2448
2449        public boolean hasValueAge() { 
2450          return this != null && this.value instanceof Age;
2451        }
2452
2453        /**
2454         * @return {@link #value} (The value of the Output parameter as a basic type.)
2455         */
2456        public Annotation getValueAnnotation() throws FHIRException { 
2457          if (this.value == null)
2458            this.value = new Annotation();
2459          if (!(this.value instanceof Annotation))
2460            throw new FHIRException("Type mismatch: the type Annotation was expected, but "+this.value.getClass().getName()+" was encountered");
2461          return (Annotation) this.value;
2462        }
2463
2464        public boolean hasValueAnnotation() { 
2465          return this != null && this.value instanceof Annotation;
2466        }
2467
2468        /**
2469         * @return {@link #value} (The value of the Output parameter as a basic type.)
2470         */
2471        public Attachment getValueAttachment() throws FHIRException { 
2472          if (this.value == null)
2473            this.value = new Attachment();
2474          if (!(this.value instanceof Attachment))
2475            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
2476          return (Attachment) this.value;
2477        }
2478
2479        public boolean hasValueAttachment() { 
2480          return this != null && this.value instanceof Attachment;
2481        }
2482
2483        /**
2484         * @return {@link #value} (The value of the Output parameter as a basic type.)
2485         */
2486        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
2487          if (this.value == null)
2488            this.value = new CodeableConcept();
2489          if (!(this.value instanceof CodeableConcept))
2490            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
2491          return (CodeableConcept) this.value;
2492        }
2493
2494        public boolean hasValueCodeableConcept() { 
2495          return this != null && this.value instanceof CodeableConcept;
2496        }
2497
2498        /**
2499         * @return {@link #value} (The value of the Output parameter as a basic type.)
2500         */
2501        public Coding getValueCoding() throws FHIRException { 
2502          if (this.value == null)
2503            this.value = new Coding();
2504          if (!(this.value instanceof Coding))
2505            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered");
2506          return (Coding) this.value;
2507        }
2508
2509        public boolean hasValueCoding() { 
2510          return this != null && this.value instanceof Coding;
2511        }
2512
2513        /**
2514         * @return {@link #value} (The value of the Output parameter as a basic type.)
2515         */
2516        public ContactPoint getValueContactPoint() throws FHIRException { 
2517          if (this.value == null)
2518            this.value = new ContactPoint();
2519          if (!(this.value instanceof ContactPoint))
2520            throw new FHIRException("Type mismatch: the type ContactPoint was expected, but "+this.value.getClass().getName()+" was encountered");
2521          return (ContactPoint) this.value;
2522        }
2523
2524        public boolean hasValueContactPoint() { 
2525          return this != null && this.value instanceof ContactPoint;
2526        }
2527
2528        /**
2529         * @return {@link #value} (The value of the Output parameter as a basic type.)
2530         */
2531        public Count getValueCount() throws FHIRException { 
2532          if (this.value == null)
2533            this.value = new Count();
2534          if (!(this.value instanceof Count))
2535            throw new FHIRException("Type mismatch: the type Count was expected, but "+this.value.getClass().getName()+" was encountered");
2536          return (Count) this.value;
2537        }
2538
2539        public boolean hasValueCount() { 
2540          return this != null && this.value instanceof Count;
2541        }
2542
2543        /**
2544         * @return {@link #value} (The value of the Output parameter as a basic type.)
2545         */
2546        public Distance getValueDistance() throws FHIRException { 
2547          if (this.value == null)
2548            this.value = new Distance();
2549          if (!(this.value instanceof Distance))
2550            throw new FHIRException("Type mismatch: the type Distance was expected, but "+this.value.getClass().getName()+" was encountered");
2551          return (Distance) this.value;
2552        }
2553
2554        public boolean hasValueDistance() { 
2555          return this != null && this.value instanceof Distance;
2556        }
2557
2558        /**
2559         * @return {@link #value} (The value of the Output parameter as a basic type.)
2560         */
2561        public Duration getValueDuration() throws FHIRException { 
2562          if (this.value == null)
2563            this.value = new Duration();
2564          if (!(this.value instanceof Duration))
2565            throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.value.getClass().getName()+" was encountered");
2566          return (Duration) this.value;
2567        }
2568
2569        public boolean hasValueDuration() { 
2570          return this != null && this.value instanceof Duration;
2571        }
2572
2573        /**
2574         * @return {@link #value} (The value of the Output parameter as a basic type.)
2575         */
2576        public HumanName getValueHumanName() throws FHIRException { 
2577          if (this.value == null)
2578            this.value = new HumanName();
2579          if (!(this.value instanceof HumanName))
2580            throw new FHIRException("Type mismatch: the type HumanName was expected, but "+this.value.getClass().getName()+" was encountered");
2581          return (HumanName) this.value;
2582        }
2583
2584        public boolean hasValueHumanName() { 
2585          return this != null && this.value instanceof HumanName;
2586        }
2587
2588        /**
2589         * @return {@link #value} (The value of the Output parameter as a basic type.)
2590         */
2591        public Identifier getValueIdentifier() throws FHIRException { 
2592          if (this.value == null)
2593            this.value = new Identifier();
2594          if (!(this.value instanceof Identifier))
2595            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.value.getClass().getName()+" was encountered");
2596          return (Identifier) this.value;
2597        }
2598
2599        public boolean hasValueIdentifier() { 
2600          return this != null && this.value instanceof Identifier;
2601        }
2602
2603        /**
2604         * @return {@link #value} (The value of the Output parameter as a basic type.)
2605         */
2606        public Money getValueMoney() throws FHIRException { 
2607          if (this.value == null)
2608            this.value = new Money();
2609          if (!(this.value instanceof Money))
2610            throw new FHIRException("Type mismatch: the type Money was expected, but "+this.value.getClass().getName()+" was encountered");
2611          return (Money) this.value;
2612        }
2613
2614        public boolean hasValueMoney() { 
2615          return this != null && this.value instanceof Money;
2616        }
2617
2618        /**
2619         * @return {@link #value} (The value of the Output parameter as a basic type.)
2620         */
2621        public Period getValuePeriod() throws FHIRException { 
2622          if (this.value == null)
2623            this.value = new Period();
2624          if (!(this.value instanceof Period))
2625            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered");
2626          return (Period) this.value;
2627        }
2628
2629        public boolean hasValuePeriod() { 
2630          return this != null && this.value instanceof Period;
2631        }
2632
2633        /**
2634         * @return {@link #value} (The value of the Output parameter as a basic type.)
2635         */
2636        public Quantity getValueQuantity() throws FHIRException { 
2637          if (this.value == null)
2638            this.value = new Quantity();
2639          if (!(this.value instanceof Quantity))
2640            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
2641          return (Quantity) this.value;
2642        }
2643
2644        public boolean hasValueQuantity() { 
2645          return this != null && this.value instanceof Quantity;
2646        }
2647
2648        /**
2649         * @return {@link #value} (The value of the Output parameter as a basic type.)
2650         */
2651        public Range getValueRange() throws FHIRException { 
2652          if (this.value == null)
2653            this.value = new Range();
2654          if (!(this.value instanceof Range))
2655            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
2656          return (Range) this.value;
2657        }
2658
2659        public boolean hasValueRange() { 
2660          return this != null && this.value instanceof Range;
2661        }
2662
2663        /**
2664         * @return {@link #value} (The value of the Output parameter as a basic type.)
2665         */
2666        public Ratio getValueRatio() throws FHIRException { 
2667          if (this.value == null)
2668            this.value = new Ratio();
2669          if (!(this.value instanceof Ratio))
2670            throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered");
2671          return (Ratio) this.value;
2672        }
2673
2674        public boolean hasValueRatio() { 
2675          return this != null && this.value instanceof Ratio;
2676        }
2677
2678        /**
2679         * @return {@link #value} (The value of the Output parameter as a basic type.)
2680         */
2681        public Reference getValueReference() throws FHIRException { 
2682          if (this.value == null)
2683            this.value = new Reference();
2684          if (!(this.value instanceof Reference))
2685            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered");
2686          return (Reference) this.value;
2687        }
2688
2689        public boolean hasValueReference() { 
2690          return this != null && this.value instanceof Reference;
2691        }
2692
2693        /**
2694         * @return {@link #value} (The value of the Output parameter as a basic type.)
2695         */
2696        public SampledData getValueSampledData() throws FHIRException { 
2697          if (this.value == null)
2698            this.value = new SampledData();
2699          if (!(this.value instanceof SampledData))
2700            throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered");
2701          return (SampledData) this.value;
2702        }
2703
2704        public boolean hasValueSampledData() { 
2705          return this != null && this.value instanceof SampledData;
2706        }
2707
2708        /**
2709         * @return {@link #value} (The value of the Output parameter as a basic type.)
2710         */
2711        public Signature getValueSignature() throws FHIRException { 
2712          if (this.value == null)
2713            this.value = new Signature();
2714          if (!(this.value instanceof Signature))
2715            throw new FHIRException("Type mismatch: the type Signature was expected, but "+this.value.getClass().getName()+" was encountered");
2716          return (Signature) this.value;
2717        }
2718
2719        public boolean hasValueSignature() { 
2720          return this != null && this.value instanceof Signature;
2721        }
2722
2723        /**
2724         * @return {@link #value} (The value of the Output parameter as a basic type.)
2725         */
2726        public Timing getValueTiming() throws FHIRException { 
2727          if (this.value == null)
2728            this.value = new Timing();
2729          if (!(this.value instanceof Timing))
2730            throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.value.getClass().getName()+" was encountered");
2731          return (Timing) this.value;
2732        }
2733
2734        public boolean hasValueTiming() { 
2735          return this != null && this.value instanceof Timing;
2736        }
2737
2738        /**
2739         * @return {@link #value} (The value of the Output parameter as a basic type.)
2740         */
2741        public ContactDetail getValueContactDetail() throws FHIRException { 
2742          if (this.value == null)
2743            this.value = new ContactDetail();
2744          if (!(this.value instanceof ContactDetail))
2745            throw new FHIRException("Type mismatch: the type ContactDetail was expected, but "+this.value.getClass().getName()+" was encountered");
2746          return (ContactDetail) this.value;
2747        }
2748
2749        public boolean hasValueContactDetail() { 
2750          return this != null && this.value instanceof ContactDetail;
2751        }
2752
2753        /**
2754         * @return {@link #value} (The value of the Output parameter as a basic type.)
2755         */
2756        public Contributor getValueContributor() throws FHIRException { 
2757          if (this.value == null)
2758            this.value = new Contributor();
2759          if (!(this.value instanceof Contributor))
2760            throw new FHIRException("Type mismatch: the type Contributor was expected, but "+this.value.getClass().getName()+" was encountered");
2761          return (Contributor) this.value;
2762        }
2763
2764        public boolean hasValueContributor() { 
2765          return this != null && this.value instanceof Contributor;
2766        }
2767
2768        /**
2769         * @return {@link #value} (The value of the Output parameter as a basic type.)
2770         */
2771        public DataRequirement getValueDataRequirement() throws FHIRException { 
2772          if (this.value == null)
2773            this.value = new DataRequirement();
2774          if (!(this.value instanceof DataRequirement))
2775            throw new FHIRException("Type mismatch: the type DataRequirement was expected, but "+this.value.getClass().getName()+" was encountered");
2776          return (DataRequirement) this.value;
2777        }
2778
2779        public boolean hasValueDataRequirement() { 
2780          return this != null && this.value instanceof DataRequirement;
2781        }
2782
2783        /**
2784         * @return {@link #value} (The value of the Output parameter as a basic type.)
2785         */
2786        public Expression getValueExpression() throws FHIRException { 
2787          if (this.value == null)
2788            this.value = new Expression();
2789          if (!(this.value instanceof Expression))
2790            throw new FHIRException("Type mismatch: the type Expression was expected, but "+this.value.getClass().getName()+" was encountered");
2791          return (Expression) this.value;
2792        }
2793
2794        public boolean hasValueExpression() { 
2795          return this != null && this.value instanceof Expression;
2796        }
2797
2798        /**
2799         * @return {@link #value} (The value of the Output parameter as a basic type.)
2800         */
2801        public ParameterDefinition getValueParameterDefinition() throws FHIRException { 
2802          if (this.value == null)
2803            this.value = new ParameterDefinition();
2804          if (!(this.value instanceof ParameterDefinition))
2805            throw new FHIRException("Type mismatch: the type ParameterDefinition was expected, but "+this.value.getClass().getName()+" was encountered");
2806          return (ParameterDefinition) this.value;
2807        }
2808
2809        public boolean hasValueParameterDefinition() { 
2810          return this != null && this.value instanceof ParameterDefinition;
2811        }
2812
2813        /**
2814         * @return {@link #value} (The value of the Output parameter as a basic type.)
2815         */
2816        public RelatedArtifact getValueRelatedArtifact() throws FHIRException { 
2817          if (this.value == null)
2818            this.value = new RelatedArtifact();
2819          if (!(this.value instanceof RelatedArtifact))
2820            throw new FHIRException("Type mismatch: the type RelatedArtifact was expected, but "+this.value.getClass().getName()+" was encountered");
2821          return (RelatedArtifact) this.value;
2822        }
2823
2824        public boolean hasValueRelatedArtifact() { 
2825          return this != null && this.value instanceof RelatedArtifact;
2826        }
2827
2828        /**
2829         * @return {@link #value} (The value of the Output parameter as a basic type.)
2830         */
2831        public TriggerDefinition getValueTriggerDefinition() throws FHIRException { 
2832          if (this.value == null)
2833            this.value = new TriggerDefinition();
2834          if (!(this.value instanceof TriggerDefinition))
2835            throw new FHIRException("Type mismatch: the type TriggerDefinition was expected, but "+this.value.getClass().getName()+" was encountered");
2836          return (TriggerDefinition) this.value;
2837        }
2838
2839        public boolean hasValueTriggerDefinition() { 
2840          return this != null && this.value instanceof TriggerDefinition;
2841        }
2842
2843        /**
2844         * @return {@link #value} (The value of the Output parameter as a basic type.)
2845         */
2846        public UsageContext getValueUsageContext() throws FHIRException { 
2847          if (this.value == null)
2848            this.value = new UsageContext();
2849          if (!(this.value instanceof UsageContext))
2850            throw new FHIRException("Type mismatch: the type UsageContext was expected, but "+this.value.getClass().getName()+" was encountered");
2851          return (UsageContext) this.value;
2852        }
2853
2854        public boolean hasValueUsageContext() { 
2855          return this != null && this.value instanceof UsageContext;
2856        }
2857
2858        /**
2859         * @return {@link #value} (The value of the Output parameter as a basic type.)
2860         */
2861        public Dosage getValueDosage() throws FHIRException { 
2862          if (this.value == null)
2863            this.value = new Dosage();
2864          if (!(this.value instanceof Dosage))
2865            throw new FHIRException("Type mismatch: the type Dosage was expected, but "+this.value.getClass().getName()+" was encountered");
2866          return (Dosage) this.value;
2867        }
2868
2869        public boolean hasValueDosage() { 
2870          return this != null && this.value instanceof Dosage;
2871        }
2872
2873        /**
2874         * @return {@link #value} (The value of the Output parameter as a basic type.)
2875         */
2876        public Meta getValueMeta() throws FHIRException { 
2877          if (this.value == null)
2878            this.value = new Meta();
2879          if (!(this.value instanceof Meta))
2880            throw new FHIRException("Type mismatch: the type Meta was expected, but "+this.value.getClass().getName()+" was encountered");
2881          return (Meta) this.value;
2882        }
2883
2884        public boolean hasValueMeta() { 
2885          return this != null && this.value instanceof Meta;
2886        }
2887
2888        public boolean hasValue() { 
2889          return this.value != null && !this.value.isEmpty();
2890        }
2891
2892        /**
2893         * @param value {@link #value} (The value of the Output parameter as a basic type.)
2894         */
2895        public TaskOutputComponent setValue(DataType value) { 
2896          if (value != null && !(value instanceof Base64BinaryType || value instanceof BooleanType || value instanceof CanonicalType || value instanceof CodeType || value instanceof DateType || value instanceof DateTimeType || value instanceof DecimalType || value instanceof IdType || value instanceof InstantType || value instanceof IntegerType || value instanceof Integer64Type || value instanceof MarkdownType || value instanceof OidType || value instanceof PositiveIntType || value instanceof StringType || value instanceof TimeType || value instanceof UnsignedIntType || value instanceof UriType || value instanceof UrlType || value instanceof UuidType || value instanceof Address || value instanceof Age || value instanceof Annotation || value instanceof Attachment || value instanceof CodeableConcept || value instanceof Coding || value instanceof ContactPoint || value instanceof Count || value instanceof Distance || value instanceof Duration || value instanceof HumanName || value instanceof Identifier || value instanceof Money || value instanceof Period || value instanceof Quantity || value instanceof Range || value instanceof Ratio || value instanceof Reference || value instanceof SampledData || value instanceof Signature || value instanceof Timing || value instanceof ContactDetail || value instanceof Contributor || value instanceof DataRequirement || value instanceof Expression || value instanceof ParameterDefinition || value instanceof RelatedArtifact || value instanceof TriggerDefinition || value instanceof UsageContext || value instanceof Dosage || value instanceof Meta))
2897            throw new Error("Not the right type for Task.output.value[x]: "+value.fhirType());
2898          this.value = value;
2899          return this;
2900        }
2901
2902        protected void listChildren(List<Property> children) {
2903          super.listChildren(children);
2904          children.add(new Property("type", "CodeableConcept", "The name of the Output parameter.", 0, 1, type));
2905          children.add(new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "The value of the Output parameter as a basic type.", 0, 1, value));
2906        }
2907
2908        @Override
2909        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2910          switch (_hash) {
2911          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The name of the Output parameter.", 0, 1, type);
2912          case -1410166417: /*value[x]*/  return new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "The value of the Output parameter as a basic type.", 0, 1, value);
2913          case 111972721: /*value*/  return new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "The value of the Output parameter as a basic type.", 0, 1, value);
2914          case -1535024575: /*valueBase64Binary*/  return new Property("value[x]", "base64Binary", "The value of the Output parameter as a basic type.", 0, 1, value);
2915          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "The value of the Output parameter as a basic type.", 0, 1, value);
2916          case -786218365: /*valueCanonical*/  return new Property("value[x]", "canonical", "The value of the Output parameter as a basic type.", 0, 1, value);
2917          case -766209282: /*valueCode*/  return new Property("value[x]", "code", "The value of the Output parameter as a basic type.", 0, 1, value);
2918          case -766192449: /*valueDate*/  return new Property("value[x]", "date", "The value of the Output parameter as a basic type.", 0, 1, value);
2919          case 1047929900: /*valueDateTime*/  return new Property("value[x]", "dateTime", "The value of the Output parameter as a basic type.", 0, 1, value);
2920          case -2083993440: /*valueDecimal*/  return new Property("value[x]", "decimal", "The value of the Output parameter as a basic type.", 0, 1, value);
2921          case 231604844: /*valueId*/  return new Property("value[x]", "id", "The value of the Output parameter as a basic type.", 0, 1, value);
2922          case -1668687056: /*valueInstant*/  return new Property("value[x]", "instant", "The value of the Output parameter as a basic type.", 0, 1, value);
2923          case -1668204915: /*valueInteger*/  return new Property("value[x]", "integer", "The value of the Output parameter as a basic type.", 0, 1, value);
2924          case -1122120181: /*valueInteger64*/  return new Property("value[x]", "integer64", "The value of the Output parameter as a basic type.", 0, 1, value);
2925          case -497880704: /*valueMarkdown*/  return new Property("value[x]", "markdown", "The value of the Output parameter as a basic type.", 0, 1, value);
2926          case -1410178407: /*valueOid*/  return new Property("value[x]", "oid", "The value of the Output parameter as a basic type.", 0, 1, value);
2927          case -1249932027: /*valuePositiveInt*/  return new Property("value[x]", "positiveInt", "The value of the Output parameter as a basic type.", 0, 1, value);
2928          case -1424603934: /*valueString*/  return new Property("value[x]", "string", "The value of the Output parameter as a basic type.", 0, 1, value);
2929          case -765708322: /*valueTime*/  return new Property("value[x]", "time", "The value of the Output parameter as a basic type.", 0, 1, value);
2930          case 26529417: /*valueUnsignedInt*/  return new Property("value[x]", "unsignedInt", "The value of the Output parameter as a basic type.", 0, 1, value);
2931          case -1410172357: /*valueUri*/  return new Property("value[x]", "uri", "The value of the Output parameter as a basic type.", 0, 1, value);
2932          case -1410172354: /*valueUrl*/  return new Property("value[x]", "url", "The value of the Output parameter as a basic type.", 0, 1, value);
2933          case -765667124: /*valueUuid*/  return new Property("value[x]", "uuid", "The value of the Output parameter as a basic type.", 0, 1, value);
2934          case -478981821: /*valueAddress*/  return new Property("value[x]", "Address", "The value of the Output parameter as a basic type.", 0, 1, value);
2935          case -1410191922: /*valueAge*/  return new Property("value[x]", "Age", "The value of the Output parameter as a basic type.", 0, 1, value);
2936          case -67108992: /*valueAnnotation*/  return new Property("value[x]", "Annotation", "The value of the Output parameter as a basic type.", 0, 1, value);
2937          case -475566732: /*valueAttachment*/  return new Property("value[x]", "Attachment", "The value of the Output parameter as a basic type.", 0, 1, value);
2938          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept", "The value of the Output parameter as a basic type.", 0, 1, value);
2939          case -1887705029: /*valueCoding*/  return new Property("value[x]", "Coding", "The value of the Output parameter as a basic type.", 0, 1, value);
2940          case 944904545: /*valueContactPoint*/  return new Property("value[x]", "ContactPoint", "The value of the Output parameter as a basic type.", 0, 1, value);
2941          case 2017332766: /*valueCount*/  return new Property("value[x]", "Count", "The value of the Output parameter as a basic type.", 0, 1, value);
2942          case -456359802: /*valueDistance*/  return new Property("value[x]", "Distance", "The value of the Output parameter as a basic type.", 0, 1, value);
2943          case 1558135333: /*valueDuration*/  return new Property("value[x]", "Duration", "The value of the Output parameter as a basic type.", 0, 1, value);
2944          case -2026205465: /*valueHumanName*/  return new Property("value[x]", "HumanName", "The value of the Output parameter as a basic type.", 0, 1, value);
2945          case -130498310: /*valueIdentifier*/  return new Property("value[x]", "Identifier", "The value of the Output parameter as a basic type.", 0, 1, value);
2946          case 2026560975: /*valueMoney*/  return new Property("value[x]", "Money", "The value of the Output parameter as a basic type.", 0, 1, value);
2947          case -1524344174: /*valuePeriod*/  return new Property("value[x]", "Period", "The value of the Output parameter as a basic type.", 0, 1, value);
2948          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "The value of the Output parameter as a basic type.", 0, 1, value);
2949          case 2030761548: /*valueRange*/  return new Property("value[x]", "Range", "The value of the Output parameter as a basic type.", 0, 1, value);
2950          case 2030767386: /*valueRatio*/  return new Property("value[x]", "Ratio", "The value of the Output parameter as a basic type.", 0, 1, value);
2951          case 1755241690: /*valueReference*/  return new Property("value[x]", "Reference", "The value of the Output parameter as a basic type.", 0, 1, value);
2952          case -962229101: /*valueSampledData*/  return new Property("value[x]", "SampledData", "The value of the Output parameter as a basic type.", 0, 1, value);
2953          case -540985785: /*valueSignature*/  return new Property("value[x]", "Signature", "The value of the Output parameter as a basic type.", 0, 1, value);
2954          case -1406282469: /*valueTiming*/  return new Property("value[x]", "Timing", "The value of the Output parameter as a basic type.", 0, 1, value);
2955          case -1125200224: /*valueContactDetail*/  return new Property("value[x]", "ContactDetail", "The value of the Output parameter as a basic type.", 0, 1, value);
2956          case 1281021610: /*valueContributor*/  return new Property("value[x]", "Contributor", "The value of the Output parameter as a basic type.", 0, 1, value);
2957          case 1710554248: /*valueDataRequirement*/  return new Property("value[x]", "DataRequirement", "The value of the Output parameter as a basic type.", 0, 1, value);
2958          case -307517719: /*valueExpression*/  return new Property("value[x]", "Expression", "The value of the Output parameter as a basic type.", 0, 1, value);
2959          case 1387478187: /*valueParameterDefinition*/  return new Property("value[x]", "ParameterDefinition", "The value of the Output parameter as a basic type.", 0, 1, value);
2960          case 1748214124: /*valueRelatedArtifact*/  return new Property("value[x]", "RelatedArtifact", "The value of the Output parameter as a basic type.", 0, 1, value);
2961          case 976830394: /*valueTriggerDefinition*/  return new Property("value[x]", "TriggerDefinition", "The value of the Output parameter as a basic type.", 0, 1, value);
2962          case 588000479: /*valueUsageContext*/  return new Property("value[x]", "UsageContext", "The value of the Output parameter as a basic type.", 0, 1, value);
2963          case -1858636920: /*valueDosage*/  return new Property("value[x]", "Dosage", "The value of the Output parameter as a basic type.", 0, 1, value);
2964          case -765920490: /*valueMeta*/  return new Property("value[x]", "Meta", "The value of the Output parameter as a basic type.", 0, 1, value);
2965          default: return super.getNamedProperty(_hash, _name, _checkValid);
2966          }
2967
2968        }
2969
2970      @Override
2971      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2972        switch (hash) {
2973        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2974        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
2975        default: return super.getProperty(hash, name, checkValid);
2976        }
2977
2978      }
2979
2980      @Override
2981      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2982        switch (hash) {
2983        case 3575610: // type
2984          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2985          return value;
2986        case 111972721: // value
2987          this.value = TypeConvertor.castToType(value); // DataType
2988          return value;
2989        default: return super.setProperty(hash, name, value);
2990        }
2991
2992      }
2993
2994      @Override
2995      public Base setProperty(String name, Base value) throws FHIRException {
2996        if (name.equals("type")) {
2997          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2998        } else if (name.equals("value[x]")) {
2999          this.value = TypeConvertor.castToType(value); // DataType
3000        } else
3001          return super.setProperty(name, value);
3002        return value;
3003      }
3004
3005      @Override
3006      public Base makeProperty(int hash, String name) throws FHIRException {
3007        switch (hash) {
3008        case 3575610:  return getType();
3009        case -1410166417:  return getValue();
3010        case 111972721:  return getValue();
3011        default: return super.makeProperty(hash, name);
3012        }
3013
3014      }
3015
3016      @Override
3017      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3018        switch (hash) {
3019        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3020        case 111972721: /*value*/ return new String[] {"base64Binary", "boolean", "canonical", "code", "date", "dateTime", "decimal", "id", "instant", "integer", "integer64", "markdown", "oid", "positiveInt", "string", "time", "unsignedInt", "uri", "url", "uuid", "Address", "Age", "Annotation", "Attachment", "CodeableConcept", "Coding", "ContactPoint", "Count", "Distance", "Duration", "HumanName", "Identifier", "Money", "Period", "Quantity", "Range", "Ratio", "Reference", "SampledData", "Signature", "Timing", "ContactDetail", "Contributor", "DataRequirement", "Expression", "ParameterDefinition", "RelatedArtifact", "TriggerDefinition", "UsageContext", "Dosage", "Meta"};
3021        default: return super.getTypesForProperty(hash, name);
3022        }
3023
3024      }
3025
3026      @Override
3027      public Base addChild(String name) throws FHIRException {
3028        if (name.equals("type")) {
3029          this.type = new CodeableConcept();
3030          return this.type;
3031        }
3032        else if (name.equals("valueBase64Binary")) {
3033          this.value = new Base64BinaryType();
3034          return this.value;
3035        }
3036        else if (name.equals("valueBoolean")) {
3037          this.value = new BooleanType();
3038          return this.value;
3039        }
3040        else if (name.equals("valueCanonical")) {
3041          this.value = new CanonicalType();
3042          return this.value;
3043        }
3044        else if (name.equals("valueCode")) {
3045          this.value = new CodeType();
3046          return this.value;
3047        }
3048        else if (name.equals("valueDate")) {
3049          this.value = new DateType();
3050          return this.value;
3051        }
3052        else if (name.equals("valueDateTime")) {
3053          this.value = new DateTimeType();
3054          return this.value;
3055        }
3056        else if (name.equals("valueDecimal")) {
3057          this.value = new DecimalType();
3058          return this.value;
3059        }
3060        else if (name.equals("valueId")) {
3061          this.value = new IdType();
3062          return this.value;
3063        }
3064        else if (name.equals("valueInstant")) {
3065          this.value = new InstantType();
3066          return this.value;
3067        }
3068        else if (name.equals("valueInteger")) {
3069          this.value = new IntegerType();
3070          return this.value;
3071        }
3072        else if (name.equals("valueInteger64")) {
3073          this.value = new Integer64Type();
3074          return this.value;
3075        }
3076        else if (name.equals("valueMarkdown")) {
3077          this.value = new MarkdownType();
3078          return this.value;
3079        }
3080        else if (name.equals("valueOid")) {
3081          this.value = new OidType();
3082          return this.value;
3083        }
3084        else if (name.equals("valuePositiveInt")) {
3085          this.value = new PositiveIntType();
3086          return this.value;
3087        }
3088        else if (name.equals("valueString")) {
3089          this.value = new StringType();
3090          return this.value;
3091        }
3092        else if (name.equals("valueTime")) {
3093          this.value = new TimeType();
3094          return this.value;
3095        }
3096        else if (name.equals("valueUnsignedInt")) {
3097          this.value = new UnsignedIntType();
3098          return this.value;
3099        }
3100        else if (name.equals("valueUri")) {
3101          this.value = new UriType();
3102          return this.value;
3103        }
3104        else if (name.equals("valueUrl")) {
3105          this.value = new UrlType();
3106          return this.value;
3107        }
3108        else if (name.equals("valueUuid")) {
3109          this.value = new UuidType();
3110          return this.value;
3111        }
3112        else if (name.equals("valueAddress")) {
3113          this.value = new Address();
3114          return this.value;
3115        }
3116        else if (name.equals("valueAge")) {
3117          this.value = new Age();
3118          return this.value;
3119        }
3120        else if (name.equals("valueAnnotation")) {
3121          this.value = new Annotation();
3122          return this.value;
3123        }
3124        else if (name.equals("valueAttachment")) {
3125          this.value = new Attachment();
3126          return this.value;
3127        }
3128        else if (name.equals("valueCodeableConcept")) {
3129          this.value = new CodeableConcept();
3130          return this.value;
3131        }
3132        else if (name.equals("valueCoding")) {
3133          this.value = new Coding();
3134          return this.value;
3135        }
3136        else if (name.equals("valueContactPoint")) {
3137          this.value = new ContactPoint();
3138          return this.value;
3139        }
3140        else if (name.equals("valueCount")) {
3141          this.value = new Count();
3142          return this.value;
3143        }
3144        else if (name.equals("valueDistance")) {
3145          this.value = new Distance();
3146          return this.value;
3147        }
3148        else if (name.equals("valueDuration")) {
3149          this.value = new Duration();
3150          return this.value;
3151        }
3152        else if (name.equals("valueHumanName")) {
3153          this.value = new HumanName();
3154          return this.value;
3155        }
3156        else if (name.equals("valueIdentifier")) {
3157          this.value = new Identifier();
3158          return this.value;
3159        }
3160        else if (name.equals("valueMoney")) {
3161          this.value = new Money();
3162          return this.value;
3163        }
3164        else if (name.equals("valuePeriod")) {
3165          this.value = new Period();
3166          return this.value;
3167        }
3168        else if (name.equals("valueQuantity")) {
3169          this.value = new Quantity();
3170          return this.value;
3171        }
3172        else if (name.equals("valueRange")) {
3173          this.value = new Range();
3174          return this.value;
3175        }
3176        else if (name.equals("valueRatio")) {
3177          this.value = new Ratio();
3178          return this.value;
3179        }
3180        else if (name.equals("valueReference")) {
3181          this.value = new Reference();
3182          return this.value;
3183        }
3184        else if (name.equals("valueSampledData")) {
3185          this.value = new SampledData();
3186          return this.value;
3187        }
3188        else if (name.equals("valueSignature")) {
3189          this.value = new Signature();
3190          return this.value;
3191        }
3192        else if (name.equals("valueTiming")) {
3193          this.value = new Timing();
3194          return this.value;
3195        }
3196        else if (name.equals("valueContactDetail")) {
3197          this.value = new ContactDetail();
3198          return this.value;
3199        }
3200        else if (name.equals("valueContributor")) {
3201          this.value = new Contributor();
3202          return this.value;
3203        }
3204        else if (name.equals("valueDataRequirement")) {
3205          this.value = new DataRequirement();
3206          return this.value;
3207        }
3208        else if (name.equals("valueExpression")) {
3209          this.value = new Expression();
3210          return this.value;
3211        }
3212        else if (name.equals("valueParameterDefinition")) {
3213          this.value = new ParameterDefinition();
3214          return this.value;
3215        }
3216        else if (name.equals("valueRelatedArtifact")) {
3217          this.value = new RelatedArtifact();
3218          return this.value;
3219        }
3220        else if (name.equals("valueTriggerDefinition")) {
3221          this.value = new TriggerDefinition();
3222          return this.value;
3223        }
3224        else if (name.equals("valueUsageContext")) {
3225          this.value = new UsageContext();
3226          return this.value;
3227        }
3228        else if (name.equals("valueDosage")) {
3229          this.value = new Dosage();
3230          return this.value;
3231        }
3232        else if (name.equals("valueMeta")) {
3233          this.value = new Meta();
3234          return this.value;
3235        }
3236        else
3237          return super.addChild(name);
3238      }
3239
3240      public TaskOutputComponent copy() {
3241        TaskOutputComponent dst = new TaskOutputComponent();
3242        copyValues(dst);
3243        return dst;
3244      }
3245
3246      public void copyValues(TaskOutputComponent dst) {
3247        super.copyValues(dst);
3248        dst.type = type == null ? null : type.copy();
3249        dst.value = value == null ? null : value.copy();
3250      }
3251
3252      @Override
3253      public boolean equalsDeep(Base other_) {
3254        if (!super.equalsDeep(other_))
3255          return false;
3256        if (!(other_ instanceof TaskOutputComponent))
3257          return false;
3258        TaskOutputComponent o = (TaskOutputComponent) other_;
3259        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true);
3260      }
3261
3262      @Override
3263      public boolean equalsShallow(Base other_) {
3264        if (!super.equalsShallow(other_))
3265          return false;
3266        if (!(other_ instanceof TaskOutputComponent))
3267          return false;
3268        TaskOutputComponent o = (TaskOutputComponent) other_;
3269        return true;
3270      }
3271
3272      public boolean isEmpty() {
3273        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value);
3274      }
3275
3276  public String fhirType() {
3277    return "Task.output";
3278
3279  }
3280
3281  }
3282
3283    /**
3284     * The business identifier for this task.
3285     */
3286    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3287    @Description(shortDefinition="Task Instance Identifier", formalDefinition="The business identifier for this task." )
3288    protected List<Identifier> identifier;
3289
3290    /**
3291     * The URL pointing to a *FHIR*-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.
3292     */
3293    @Child(name = "instantiatesCanonical", type = {CanonicalType.class}, order=1, min=0, max=1, modifier=false, summary=true)
3294    @Description(shortDefinition="Formal definition of task", formalDefinition="The URL pointing to a *FHIR*-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task." )
3295    protected CanonicalType instantiatesCanonical;
3296
3297    /**
3298     * The URL pointing to an *externally* maintained  protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.
3299     */
3300    @Child(name = "instantiatesUri", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true)
3301    @Description(shortDefinition="Formal definition of task", formalDefinition="The URL pointing to an *externally* maintained  protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task." )
3302    protected UriType instantiatesUri;
3303
3304    /**
3305     * BasedOn refers to a higher-level authorization that triggered the creation of the task.  It references a "request" resource such as a ServiceRequest, MedicationRequest, ServiceRequest, CarePlan, etc. which is distinct from the "request" resource the task is seeking to fulfill.  This latter resource is referenced by FocusOn.  For example, based on a ServiceRequest (= BasedOn), a task is created to fulfill a procedureRequest ( = FocusOn ) to collect a specimen from a patient.
3306     */
3307    @Child(name = "basedOn", type = {Reference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3308    @Description(shortDefinition="Request fulfilled by this task", formalDefinition="BasedOn refers to a higher-level authorization that triggered the creation of the task.  It references a \"request\" resource such as a ServiceRequest, MedicationRequest, ServiceRequest, CarePlan, etc. which is distinct from the \"request\" resource the task is seeking to fulfill.  This latter resource is referenced by FocusOn.  For example, based on a ServiceRequest (= BasedOn), a task is created to fulfill a procedureRequest ( = FocusOn ) to collect a specimen from a patient." )
3309    protected List<Reference> basedOn;
3310
3311    /**
3312     * An identifier that links together multiple tasks and other requests that were created in the same context.
3313     */
3314    @Child(name = "groupIdentifier", type = {Identifier.class}, order=4, min=0, max=1, modifier=false, summary=true)
3315    @Description(shortDefinition="Requisition or grouper id", formalDefinition="An identifier that links together multiple tasks and other requests that were created in the same context." )
3316    protected Identifier groupIdentifier;
3317
3318    /**
3319     * Task that this particular task is part of.
3320     */
3321    @Child(name = "partOf", type = {Task.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3322    @Description(shortDefinition="Composite task", formalDefinition="Task that this particular task is part of." )
3323    protected List<Reference> partOf;
3324
3325    /**
3326     * The current status of the task.
3327     */
3328    @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true)
3329    @Description(shortDefinition="draft | requested | received | accepted | +", formalDefinition="The current status of the task." )
3330    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/task-status")
3331    protected Enumeration<TaskStatus> status;
3332
3333    /**
3334     * An explanation as to why this task is held, failed, was refused, etc.
3335     */
3336    @Child(name = "statusReason", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true)
3337    @Description(shortDefinition="Reason for current status", formalDefinition="An explanation as to why this task is held, failed, was refused, etc." )
3338    protected CodeableConcept statusReason;
3339
3340    /**
3341     * Contains business-specific nuances of the business state.
3342     */
3343    @Child(name = "businessStatus", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=true)
3344    @Description(shortDefinition="E.g. \"Specimen collected\", \"IV prepped\"", formalDefinition="Contains business-specific nuances of the business state." )
3345    protected CodeableConcept businessStatus;
3346
3347    /**
3348     * Indicates the "level" of actionability associated with the Task, i.e. i+R[9]Cs this a proposed task, a planned task, an actionable task, etc.
3349     */
3350    @Child(name = "intent", type = {CodeType.class}, order=9, min=1, max=1, modifier=false, summary=true)
3351    @Description(shortDefinition="unknown | proposal | plan | order | original-order | reflex-order | filler-order | instance-order | option", formalDefinition="Indicates the \"level\" of actionability associated with the Task, i.e. i+R[9]Cs this a proposed task, a planned task, an actionable task, etc." )
3352    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/task-intent")
3353    protected Enumeration<TaskIntent> intent;
3354
3355    /**
3356     * Indicates how quickly the Task should be addressed with respect to other requests.
3357     */
3358    @Child(name = "priority", type = {CodeType.class}, order=10, min=0, max=1, modifier=false, summary=false)
3359    @Description(shortDefinition="routine | urgent | asap | stat", formalDefinition="Indicates how quickly the Task should be addressed with respect to other requests." )
3360    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-priority")
3361    protected Enumeration<RequestPriority> priority;
3362
3363    /**
3364     * A name or code (or both) briefly describing what the task involves.
3365     */
3366    @Child(name = "code", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=true)
3367    @Description(shortDefinition="Task Type", formalDefinition="A name or code (or both) briefly describing what the task involves." )
3368    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/task-code")
3369    protected CodeableConcept code;
3370
3371    /**
3372     * A free-text description of what is to be performed.
3373     */
3374    @Child(name = "description", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=true)
3375    @Description(shortDefinition="Human-readable explanation of task", formalDefinition="A free-text description of what is to be performed." )
3376    protected StringType description;
3377
3378    /**
3379     * The request being actioned or the resource being manipulated by this task.
3380     */
3381    @Child(name = "focus", type = {Reference.class}, order=13, min=0, max=1, modifier=false, summary=true)
3382    @Description(shortDefinition="What task is acting on", formalDefinition="The request being actioned or the resource being manipulated by this task." )
3383    protected Reference focus;
3384
3385    /**
3386     * The entity who benefits from the performance of the service specified in the task (e.g., the patient).
3387     */
3388    @Child(name = "for", type = {Reference.class}, order=14, min=0, max=1, modifier=false, summary=true)
3389    @Description(shortDefinition="Beneficiary of the Task", formalDefinition="The entity who benefits from the performance of the service specified in the task (e.g., the patient)." )
3390    protected Reference for_;
3391
3392    /**
3393     * The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.
3394     */
3395    @Child(name = "encounter", type = {Encounter.class}, order=15, min=0, max=1, modifier=false, summary=true)
3396    @Description(shortDefinition="Healthcare event during which this task originated", formalDefinition="The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created." )
3397    protected Reference encounter;
3398
3399    /**
3400     * Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end).
3401     */
3402    @Child(name = "executionPeriod", type = {Period.class}, order=16, min=0, max=1, modifier=false, summary=true)
3403    @Description(shortDefinition="Start and end time of execution", formalDefinition="Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end)." )
3404    protected Period executionPeriod;
3405
3406    /**
3407     * The date and time this task was created.
3408     */
3409    @Child(name = "authoredOn", type = {DateTimeType.class}, order=17, min=0, max=1, modifier=false, summary=false)
3410    @Description(shortDefinition="Task Creation Date", formalDefinition="The date and time this task was created." )
3411    protected DateTimeType authoredOn;
3412
3413    /**
3414     * The date and time of last modification to this task.
3415     */
3416    @Child(name = "lastModified", type = {DateTimeType.class}, order=18, min=0, max=1, modifier=false, summary=true)
3417    @Description(shortDefinition="Task Last Modified Date", formalDefinition="The date and time of last modification to this task." )
3418    protected DateTimeType lastModified;
3419
3420    /**
3421     * The creator of the task.
3422     */
3423    @Child(name = "requester", type = {Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class}, order=19, min=0, max=1, modifier=false, summary=true)
3424    @Description(shortDefinition="Who is asking for task to be done", formalDefinition="The creator of the task." )
3425    protected Reference requester;
3426
3427    /**
3428     * The kind of participant that should perform the task.
3429     */
3430    @Child(name = "performerType", type = {CodeableConcept.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3431    @Description(shortDefinition="Requested performer", formalDefinition="The kind of participant that should perform the task." )
3432    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/performer-role")
3433    protected List<CodeableConcept> performerType;
3434
3435    /**
3436     * Individual organization or Device currently responsible for task execution.
3437     */
3438    @Child(name = "owner", type = {Practitioner.class, PractitionerRole.class, Organization.class, CareTeam.class, HealthcareService.class, Patient.class, Device.class, RelatedPerson.class}, order=21, min=0, max=1, modifier=false, summary=true)
3439    @Description(shortDefinition="Responsible individual", formalDefinition="Individual organization or Device currently responsible for task execution." )
3440    protected Reference owner;
3441
3442    /**
3443     * Principal physical location where the this task is performed.
3444     */
3445    @Child(name = "location", type = {Location.class}, order=22, min=0, max=1, modifier=false, summary=true)
3446    @Description(shortDefinition="Where task occurs", formalDefinition="Principal physical location where the this task is performed." )
3447    protected Reference location;
3448
3449    /**
3450     * A description or code indicating why this task needs to be performed.
3451     */
3452    @Child(name = "reasonCode", type = {CodeableConcept.class}, order=23, min=0, max=1, modifier=false, summary=false)
3453    @Description(shortDefinition="Why task is needed", formalDefinition="A description or code indicating why this task needs to be performed." )
3454    protected CodeableConcept reasonCode;
3455
3456    /**
3457     * A resource reference indicating why this task needs to be performed.
3458     */
3459    @Child(name = "reasonReference", type = {Reference.class}, order=24, min=0, max=1, modifier=false, summary=false)
3460    @Description(shortDefinition="Why task is needed", formalDefinition="A resource reference indicating why this task needs to be performed." )
3461    protected Reference reasonReference;
3462
3463    /**
3464     * Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be relevant to the Task.
3465     */
3466    @Child(name = "insurance", type = {Coverage.class, ClaimResponse.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3467    @Description(shortDefinition="Associated insurance coverage", formalDefinition="Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be relevant to the Task." )
3468    protected List<Reference> insurance;
3469
3470    /**
3471     * Free-text information captured about the task as it progresses.
3472     */
3473    @Child(name = "note", type = {Annotation.class}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3474    @Description(shortDefinition="Comments made about the task", formalDefinition="Free-text information captured about the task as it progresses." )
3475    protected List<Annotation> note;
3476
3477    /**
3478     * Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task.
3479     */
3480    @Child(name = "relevantHistory", type = {Provenance.class}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3481    @Description(shortDefinition="Key events in history of the Task", formalDefinition="Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task." )
3482    protected List<Reference> relevantHistory;
3483
3484    /**
3485     * If the Task.focus is a request resource and the task is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned.
3486     */
3487    @Child(name = "restriction", type = {}, order=28, min=0, max=1, modifier=false, summary=false)
3488    @Description(shortDefinition="Constraints on fulfillment tasks", formalDefinition="If the Task.focus is a request resource and the task is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned." )
3489    protected TaskRestrictionComponent restriction;
3490
3491    /**
3492     * Additional information that may be needed in the execution of the task.
3493     */
3494    @Child(name = "input", type = {}, order=29, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3495    @Description(shortDefinition="Information used to perform task", formalDefinition="Additional information that may be needed in the execution of the task." )
3496    protected List<ParameterComponent> input;
3497
3498    /**
3499     * Outputs produced by the Task.
3500     */
3501    @Child(name = "output", type = {}, order=30, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3502    @Description(shortDefinition="Information produced as part of task", formalDefinition="Outputs produced by the Task." )
3503    protected List<TaskOutputComponent> output;
3504
3505    private static final long serialVersionUID = -1820039698L;
3506
3507  /**
3508   * Constructor
3509   */
3510    public Task() {
3511      super();
3512    }
3513
3514  /**
3515   * Constructor
3516   */
3517    public Task(TaskStatus status, TaskIntent intent) {
3518      super();
3519      this.setStatus(status);
3520      this.setIntent(intent);
3521    }
3522
3523    /**
3524     * @return {@link #identifier} (The business identifier for this task.)
3525     */
3526    public List<Identifier> getIdentifier() { 
3527      if (this.identifier == null)
3528        this.identifier = new ArrayList<Identifier>();
3529      return this.identifier;
3530    }
3531
3532    /**
3533     * @return Returns a reference to <code>this</code> for easy method chaining
3534     */
3535    public Task setIdentifier(List<Identifier> theIdentifier) { 
3536      this.identifier = theIdentifier;
3537      return this;
3538    }
3539
3540    public boolean hasIdentifier() { 
3541      if (this.identifier == null)
3542        return false;
3543      for (Identifier item : this.identifier)
3544        if (!item.isEmpty())
3545          return true;
3546      return false;
3547    }
3548
3549    public Identifier addIdentifier() { //3
3550      Identifier t = new Identifier();
3551      if (this.identifier == null)
3552        this.identifier = new ArrayList<Identifier>();
3553      this.identifier.add(t);
3554      return t;
3555    }
3556
3557    public Task addIdentifier(Identifier t) { //3
3558      if (t == null)
3559        return this;
3560      if (this.identifier == null)
3561        this.identifier = new ArrayList<Identifier>();
3562      this.identifier.add(t);
3563      return this;
3564    }
3565
3566    /**
3567     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
3568     */
3569    public Identifier getIdentifierFirstRep() { 
3570      if (getIdentifier().isEmpty()) {
3571        addIdentifier();
3572      }
3573      return getIdentifier().get(0);
3574    }
3575
3576    /**
3577     * @return {@link #instantiatesCanonical} (The URL pointing to a *FHIR*-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesCanonical" gives direct access to the value
3578     */
3579    public CanonicalType getInstantiatesCanonicalElement() { 
3580      if (this.instantiatesCanonical == null)
3581        if (Configuration.errorOnAutoCreate())
3582          throw new Error("Attempt to auto-create Task.instantiatesCanonical");
3583        else if (Configuration.doAutoCreate())
3584          this.instantiatesCanonical = new CanonicalType(); // bb
3585      return this.instantiatesCanonical;
3586    }
3587
3588    public boolean hasInstantiatesCanonicalElement() { 
3589      return this.instantiatesCanonical != null && !this.instantiatesCanonical.isEmpty();
3590    }
3591
3592    public boolean hasInstantiatesCanonical() { 
3593      return this.instantiatesCanonical != null && !this.instantiatesCanonical.isEmpty();
3594    }
3595
3596    /**
3597     * @param value {@link #instantiatesCanonical} (The URL pointing to a *FHIR*-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesCanonical" gives direct access to the value
3598     */
3599    public Task setInstantiatesCanonicalElement(CanonicalType value) { 
3600      this.instantiatesCanonical = value;
3601      return this;
3602    }
3603
3604    /**
3605     * @return The URL pointing to a *FHIR*-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.
3606     */
3607    public String getInstantiatesCanonical() { 
3608      return this.instantiatesCanonical == null ? null : this.instantiatesCanonical.getValue();
3609    }
3610
3611    /**
3612     * @param value The URL pointing to a *FHIR*-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.
3613     */
3614    public Task setInstantiatesCanonical(String value) { 
3615      if (Utilities.noString(value))
3616        this.instantiatesCanonical = null;
3617      else {
3618        if (this.instantiatesCanonical == null)
3619          this.instantiatesCanonical = new CanonicalType();
3620        this.instantiatesCanonical.setValue(value);
3621      }
3622      return this;
3623    }
3624
3625    /**
3626     * @return {@link #instantiatesUri} (The URL pointing to an *externally* maintained  protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesUri" gives direct access to the value
3627     */
3628    public UriType getInstantiatesUriElement() { 
3629      if (this.instantiatesUri == null)
3630        if (Configuration.errorOnAutoCreate())
3631          throw new Error("Attempt to auto-create Task.instantiatesUri");
3632        else if (Configuration.doAutoCreate())
3633          this.instantiatesUri = new UriType(); // bb
3634      return this.instantiatesUri;
3635    }
3636
3637    public boolean hasInstantiatesUriElement() { 
3638      return this.instantiatesUri != null && !this.instantiatesUri.isEmpty();
3639    }
3640
3641    public boolean hasInstantiatesUri() { 
3642      return this.instantiatesUri != null && !this.instantiatesUri.isEmpty();
3643    }
3644
3645    /**
3646     * @param value {@link #instantiatesUri} (The URL pointing to an *externally* maintained  protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesUri" gives direct access to the value
3647     */
3648    public Task setInstantiatesUriElement(UriType value) { 
3649      this.instantiatesUri = value;
3650      return this;
3651    }
3652
3653    /**
3654     * @return The URL pointing to an *externally* maintained  protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.
3655     */
3656    public String getInstantiatesUri() { 
3657      return this.instantiatesUri == null ? null : this.instantiatesUri.getValue();
3658    }
3659
3660    /**
3661     * @param value The URL pointing to an *externally* maintained  protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.
3662     */
3663    public Task setInstantiatesUri(String value) { 
3664      if (Utilities.noString(value))
3665        this.instantiatesUri = null;
3666      else {
3667        if (this.instantiatesUri == null)
3668          this.instantiatesUri = new UriType();
3669        this.instantiatesUri.setValue(value);
3670      }
3671      return this;
3672    }
3673
3674    /**
3675     * @return {@link #basedOn} (BasedOn refers to a higher-level authorization that triggered the creation of the task.  It references a "request" resource such as a ServiceRequest, MedicationRequest, ServiceRequest, CarePlan, etc. which is distinct from the "request" resource the task is seeking to fulfill.  This latter resource is referenced by FocusOn.  For example, based on a ServiceRequest (= BasedOn), a task is created to fulfill a procedureRequest ( = FocusOn ) to collect a specimen from a patient.)
3676     */
3677    public List<Reference> getBasedOn() { 
3678      if (this.basedOn == null)
3679        this.basedOn = new ArrayList<Reference>();
3680      return this.basedOn;
3681    }
3682
3683    /**
3684     * @return Returns a reference to <code>this</code> for easy method chaining
3685     */
3686    public Task setBasedOn(List<Reference> theBasedOn) { 
3687      this.basedOn = theBasedOn;
3688      return this;
3689    }
3690
3691    public boolean hasBasedOn() { 
3692      if (this.basedOn == null)
3693        return false;
3694      for (Reference item : this.basedOn)
3695        if (!item.isEmpty())
3696          return true;
3697      return false;
3698    }
3699
3700    public Reference addBasedOn() { //3
3701      Reference t = new Reference();
3702      if (this.basedOn == null)
3703        this.basedOn = new ArrayList<Reference>();
3704      this.basedOn.add(t);
3705      return t;
3706    }
3707
3708    public Task addBasedOn(Reference t) { //3
3709      if (t == null)
3710        return this;
3711      if (this.basedOn == null)
3712        this.basedOn = new ArrayList<Reference>();
3713      this.basedOn.add(t);
3714      return this;
3715    }
3716
3717    /**
3718     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
3719     */
3720    public Reference getBasedOnFirstRep() { 
3721      if (getBasedOn().isEmpty()) {
3722        addBasedOn();
3723      }
3724      return getBasedOn().get(0);
3725    }
3726
3727    /**
3728     * @return {@link #groupIdentifier} (An identifier that links together multiple tasks and other requests that were created in the same context.)
3729     */
3730    public Identifier getGroupIdentifier() { 
3731      if (this.groupIdentifier == null)
3732        if (Configuration.errorOnAutoCreate())
3733          throw new Error("Attempt to auto-create Task.groupIdentifier");
3734        else if (Configuration.doAutoCreate())
3735          this.groupIdentifier = new Identifier(); // cc
3736      return this.groupIdentifier;
3737    }
3738
3739    public boolean hasGroupIdentifier() { 
3740      return this.groupIdentifier != null && !this.groupIdentifier.isEmpty();
3741    }
3742
3743    /**
3744     * @param value {@link #groupIdentifier} (An identifier that links together multiple tasks and other requests that were created in the same context.)
3745     */
3746    public Task setGroupIdentifier(Identifier value) { 
3747      this.groupIdentifier = value;
3748      return this;
3749    }
3750
3751    /**
3752     * @return {@link #partOf} (Task that this particular task is part of.)
3753     */
3754    public List<Reference> getPartOf() { 
3755      if (this.partOf == null)
3756        this.partOf = new ArrayList<Reference>();
3757      return this.partOf;
3758    }
3759
3760    /**
3761     * @return Returns a reference to <code>this</code> for easy method chaining
3762     */
3763    public Task setPartOf(List<Reference> thePartOf) { 
3764      this.partOf = thePartOf;
3765      return this;
3766    }
3767
3768    public boolean hasPartOf() { 
3769      if (this.partOf == null)
3770        return false;
3771      for (Reference item : this.partOf)
3772        if (!item.isEmpty())
3773          return true;
3774      return false;
3775    }
3776
3777    public Reference addPartOf() { //3
3778      Reference t = new Reference();
3779      if (this.partOf == null)
3780        this.partOf = new ArrayList<Reference>();
3781      this.partOf.add(t);
3782      return t;
3783    }
3784
3785    public Task addPartOf(Reference t) { //3
3786      if (t == null)
3787        return this;
3788      if (this.partOf == null)
3789        this.partOf = new ArrayList<Reference>();
3790      this.partOf.add(t);
3791      return this;
3792    }
3793
3794    /**
3795     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist {3}
3796     */
3797    public Reference getPartOfFirstRep() { 
3798      if (getPartOf().isEmpty()) {
3799        addPartOf();
3800      }
3801      return getPartOf().get(0);
3802    }
3803
3804    /**
3805     * @return {@link #status} (The current status of the task.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
3806     */
3807    public Enumeration<TaskStatus> getStatusElement() { 
3808      if (this.status == null)
3809        if (Configuration.errorOnAutoCreate())
3810          throw new Error("Attempt to auto-create Task.status");
3811        else if (Configuration.doAutoCreate())
3812          this.status = new Enumeration<TaskStatus>(new TaskStatusEnumFactory()); // bb
3813      return this.status;
3814    }
3815
3816    public boolean hasStatusElement() { 
3817      return this.status != null && !this.status.isEmpty();
3818    }
3819
3820    public boolean hasStatus() { 
3821      return this.status != null && !this.status.isEmpty();
3822    }
3823
3824    /**
3825     * @param value {@link #status} (The current status of the task.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
3826     */
3827    public Task setStatusElement(Enumeration<TaskStatus> value) { 
3828      this.status = value;
3829      return this;
3830    }
3831
3832    /**
3833     * @return The current status of the task.
3834     */
3835    public TaskStatus getStatus() { 
3836      return this.status == null ? null : this.status.getValue();
3837    }
3838
3839    /**
3840     * @param value The current status of the task.
3841     */
3842    public Task setStatus(TaskStatus value) { 
3843        if (this.status == null)
3844          this.status = new Enumeration<TaskStatus>(new TaskStatusEnumFactory());
3845        this.status.setValue(value);
3846      return this;
3847    }
3848
3849    /**
3850     * @return {@link #statusReason} (An explanation as to why this task is held, failed, was refused, etc.)
3851     */
3852    public CodeableConcept getStatusReason() { 
3853      if (this.statusReason == null)
3854        if (Configuration.errorOnAutoCreate())
3855          throw new Error("Attempt to auto-create Task.statusReason");
3856        else if (Configuration.doAutoCreate())
3857          this.statusReason = new CodeableConcept(); // cc
3858      return this.statusReason;
3859    }
3860
3861    public boolean hasStatusReason() { 
3862      return this.statusReason != null && !this.statusReason.isEmpty();
3863    }
3864
3865    /**
3866     * @param value {@link #statusReason} (An explanation as to why this task is held, failed, was refused, etc.)
3867     */
3868    public Task setStatusReason(CodeableConcept value) { 
3869      this.statusReason = value;
3870      return this;
3871    }
3872
3873    /**
3874     * @return {@link #businessStatus} (Contains business-specific nuances of the business state.)
3875     */
3876    public CodeableConcept getBusinessStatus() { 
3877      if (this.businessStatus == null)
3878        if (Configuration.errorOnAutoCreate())
3879          throw new Error("Attempt to auto-create Task.businessStatus");
3880        else if (Configuration.doAutoCreate())
3881          this.businessStatus = new CodeableConcept(); // cc
3882      return this.businessStatus;
3883    }
3884
3885    public boolean hasBusinessStatus() { 
3886      return this.businessStatus != null && !this.businessStatus.isEmpty();
3887    }
3888
3889    /**
3890     * @param value {@link #businessStatus} (Contains business-specific nuances of the business state.)
3891     */
3892    public Task setBusinessStatus(CodeableConcept value) { 
3893      this.businessStatus = value;
3894      return this;
3895    }
3896
3897    /**
3898     * @return {@link #intent} (Indicates the "level" of actionability associated with the Task, i.e. i+R[9]Cs this a proposed task, a planned task, an actionable task, etc.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value
3899     */
3900    public Enumeration<TaskIntent> getIntentElement() { 
3901      if (this.intent == null)
3902        if (Configuration.errorOnAutoCreate())
3903          throw new Error("Attempt to auto-create Task.intent");
3904        else if (Configuration.doAutoCreate())
3905          this.intent = new Enumeration<TaskIntent>(new TaskIntentEnumFactory()); // bb
3906      return this.intent;
3907    }
3908
3909    public boolean hasIntentElement() { 
3910      return this.intent != null && !this.intent.isEmpty();
3911    }
3912
3913    public boolean hasIntent() { 
3914      return this.intent != null && !this.intent.isEmpty();
3915    }
3916
3917    /**
3918     * @param value {@link #intent} (Indicates the "level" of actionability associated with the Task, i.e. i+R[9]Cs this a proposed task, a planned task, an actionable task, etc.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value
3919     */
3920    public Task setIntentElement(Enumeration<TaskIntent> value) { 
3921      this.intent = value;
3922      return this;
3923    }
3924
3925    /**
3926     * @return Indicates the "level" of actionability associated with the Task, i.e. i+R[9]Cs this a proposed task, a planned task, an actionable task, etc.
3927     */
3928    public TaskIntent getIntent() { 
3929      return this.intent == null ? null : this.intent.getValue();
3930    }
3931
3932    /**
3933     * @param value Indicates the "level" of actionability associated with the Task, i.e. i+R[9]Cs this a proposed task, a planned task, an actionable task, etc.
3934     */
3935    public Task setIntent(TaskIntent value) { 
3936        if (this.intent == null)
3937          this.intent = new Enumeration<TaskIntent>(new TaskIntentEnumFactory());
3938        this.intent.setValue(value);
3939      return this;
3940    }
3941
3942    /**
3943     * @return {@link #priority} (Indicates how quickly the Task should be addressed with respect to other requests.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
3944     */
3945    public Enumeration<RequestPriority> getPriorityElement() { 
3946      if (this.priority == null)
3947        if (Configuration.errorOnAutoCreate())
3948          throw new Error("Attempt to auto-create Task.priority");
3949        else if (Configuration.doAutoCreate())
3950          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory()); // bb
3951      return this.priority;
3952    }
3953
3954    public boolean hasPriorityElement() { 
3955      return this.priority != null && !this.priority.isEmpty();
3956    }
3957
3958    public boolean hasPriority() { 
3959      return this.priority != null && !this.priority.isEmpty();
3960    }
3961
3962    /**
3963     * @param value {@link #priority} (Indicates how quickly the Task should be addressed with respect to other requests.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
3964     */
3965    public Task setPriorityElement(Enumeration<RequestPriority> value) { 
3966      this.priority = value;
3967      return this;
3968    }
3969
3970    /**
3971     * @return Indicates how quickly the Task should be addressed with respect to other requests.
3972     */
3973    public RequestPriority getPriority() { 
3974      return this.priority == null ? null : this.priority.getValue();
3975    }
3976
3977    /**
3978     * @param value Indicates how quickly the Task should be addressed with respect to other requests.
3979     */
3980    public Task setPriority(RequestPriority value) { 
3981      if (value == null)
3982        this.priority = null;
3983      else {
3984        if (this.priority == null)
3985          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory());
3986        this.priority.setValue(value);
3987      }
3988      return this;
3989    }
3990
3991    /**
3992     * @return {@link #code} (A name or code (or both) briefly describing what the task involves.)
3993     */
3994    public CodeableConcept getCode() { 
3995      if (this.code == null)
3996        if (Configuration.errorOnAutoCreate())
3997          throw new Error("Attempt to auto-create Task.code");
3998        else if (Configuration.doAutoCreate())
3999          this.code = new CodeableConcept(); // cc
4000      return this.code;
4001    }
4002
4003    public boolean hasCode() { 
4004      return this.code != null && !this.code.isEmpty();
4005    }
4006
4007    /**
4008     * @param value {@link #code} (A name or code (or both) briefly describing what the task involves.)
4009     */
4010    public Task setCode(CodeableConcept value) { 
4011      this.code = value;
4012      return this;
4013    }
4014
4015    /**
4016     * @return {@link #description} (A free-text description of what is to be performed.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
4017     */
4018    public StringType getDescriptionElement() { 
4019      if (this.description == null)
4020        if (Configuration.errorOnAutoCreate())
4021          throw new Error("Attempt to auto-create Task.description");
4022        else if (Configuration.doAutoCreate())
4023          this.description = new StringType(); // bb
4024      return this.description;
4025    }
4026
4027    public boolean hasDescriptionElement() { 
4028      return this.description != null && !this.description.isEmpty();
4029    }
4030
4031    public boolean hasDescription() { 
4032      return this.description != null && !this.description.isEmpty();
4033    }
4034
4035    /**
4036     * @param value {@link #description} (A free-text description of what is to be performed.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
4037     */
4038    public Task setDescriptionElement(StringType value) { 
4039      this.description = value;
4040      return this;
4041    }
4042
4043    /**
4044     * @return A free-text description of what is to be performed.
4045     */
4046    public String getDescription() { 
4047      return this.description == null ? null : this.description.getValue();
4048    }
4049
4050    /**
4051     * @param value A free-text description of what is to be performed.
4052     */
4053    public Task setDescription(String value) { 
4054      if (Utilities.noString(value))
4055        this.description = null;
4056      else {
4057        if (this.description == null)
4058          this.description = new StringType();
4059        this.description.setValue(value);
4060      }
4061      return this;
4062    }
4063
4064    /**
4065     * @return {@link #focus} (The request being actioned or the resource being manipulated by this task.)
4066     */
4067    public Reference getFocus() { 
4068      if (this.focus == null)
4069        if (Configuration.errorOnAutoCreate())
4070          throw new Error("Attempt to auto-create Task.focus");
4071        else if (Configuration.doAutoCreate())
4072          this.focus = new Reference(); // cc
4073      return this.focus;
4074    }
4075
4076    public boolean hasFocus() { 
4077      return this.focus != null && !this.focus.isEmpty();
4078    }
4079
4080    /**
4081     * @param value {@link #focus} (The request being actioned or the resource being manipulated by this task.)
4082     */
4083    public Task setFocus(Reference value) { 
4084      this.focus = value;
4085      return this;
4086    }
4087
4088    /**
4089     * @return {@link #for_} (The entity who benefits from the performance of the service specified in the task (e.g., the patient).)
4090     */
4091    public Reference getFor() { 
4092      if (this.for_ == null)
4093        if (Configuration.errorOnAutoCreate())
4094          throw new Error("Attempt to auto-create Task.for_");
4095        else if (Configuration.doAutoCreate())
4096          this.for_ = new Reference(); // cc
4097      return this.for_;
4098    }
4099
4100    public boolean hasFor() { 
4101      return this.for_ != null && !this.for_.isEmpty();
4102    }
4103
4104    /**
4105     * @param value {@link #for_} (The entity who benefits from the performance of the service specified in the task (e.g., the patient).)
4106     */
4107    public Task setFor(Reference value) { 
4108      this.for_ = value;
4109      return this;
4110    }
4111
4112    /**
4113     * @return {@link #encounter} (The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.)
4114     */
4115    public Reference getEncounter() { 
4116      if (this.encounter == null)
4117        if (Configuration.errorOnAutoCreate())
4118          throw new Error("Attempt to auto-create Task.encounter");
4119        else if (Configuration.doAutoCreate())
4120          this.encounter = new Reference(); // cc
4121      return this.encounter;
4122    }
4123
4124    public boolean hasEncounter() { 
4125      return this.encounter != null && !this.encounter.isEmpty();
4126    }
4127
4128    /**
4129     * @param value {@link #encounter} (The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.)
4130     */
4131    public Task setEncounter(Reference value) { 
4132      this.encounter = value;
4133      return this;
4134    }
4135
4136    /**
4137     * @return {@link #executionPeriod} (Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end).)
4138     */
4139    public Period getExecutionPeriod() { 
4140      if (this.executionPeriod == null)
4141        if (Configuration.errorOnAutoCreate())
4142          throw new Error("Attempt to auto-create Task.executionPeriod");
4143        else if (Configuration.doAutoCreate())
4144          this.executionPeriod = new Period(); // cc
4145      return this.executionPeriod;
4146    }
4147
4148    public boolean hasExecutionPeriod() { 
4149      return this.executionPeriod != null && !this.executionPeriod.isEmpty();
4150    }
4151
4152    /**
4153     * @param value {@link #executionPeriod} (Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end).)
4154     */
4155    public Task setExecutionPeriod(Period value) { 
4156      this.executionPeriod = value;
4157      return this;
4158    }
4159
4160    /**
4161     * @return {@link #authoredOn} (The date and time this task was created.). This is the underlying object with id, value and extensions. The accessor "getAuthoredOn" gives direct access to the value
4162     */
4163    public DateTimeType getAuthoredOnElement() { 
4164      if (this.authoredOn == null)
4165        if (Configuration.errorOnAutoCreate())
4166          throw new Error("Attempt to auto-create Task.authoredOn");
4167        else if (Configuration.doAutoCreate())
4168          this.authoredOn = new DateTimeType(); // bb
4169      return this.authoredOn;
4170    }
4171
4172    public boolean hasAuthoredOnElement() { 
4173      return this.authoredOn != null && !this.authoredOn.isEmpty();
4174    }
4175
4176    public boolean hasAuthoredOn() { 
4177      return this.authoredOn != null && !this.authoredOn.isEmpty();
4178    }
4179
4180    /**
4181     * @param value {@link #authoredOn} (The date and time this task was created.). This is the underlying object with id, value and extensions. The accessor "getAuthoredOn" gives direct access to the value
4182     */
4183    public Task setAuthoredOnElement(DateTimeType value) { 
4184      this.authoredOn = value;
4185      return this;
4186    }
4187
4188    /**
4189     * @return The date and time this task was created.
4190     */
4191    public Date getAuthoredOn() { 
4192      return this.authoredOn == null ? null : this.authoredOn.getValue();
4193    }
4194
4195    /**
4196     * @param value The date and time this task was created.
4197     */
4198    public Task setAuthoredOn(Date value) { 
4199      if (value == null)
4200        this.authoredOn = null;
4201      else {
4202        if (this.authoredOn == null)
4203          this.authoredOn = new DateTimeType();
4204        this.authoredOn.setValue(value);
4205      }
4206      return this;
4207    }
4208
4209    /**
4210     * @return {@link #lastModified} (The date and time of last modification to this task.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value
4211     */
4212    public DateTimeType getLastModifiedElement() { 
4213      if (this.lastModified == null)
4214        if (Configuration.errorOnAutoCreate())
4215          throw new Error("Attempt to auto-create Task.lastModified");
4216        else if (Configuration.doAutoCreate())
4217          this.lastModified = new DateTimeType(); // bb
4218      return this.lastModified;
4219    }
4220
4221    public boolean hasLastModifiedElement() { 
4222      return this.lastModified != null && !this.lastModified.isEmpty();
4223    }
4224
4225    public boolean hasLastModified() { 
4226      return this.lastModified != null && !this.lastModified.isEmpty();
4227    }
4228
4229    /**
4230     * @param value {@link #lastModified} (The date and time of last modification to this task.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value
4231     */
4232    public Task setLastModifiedElement(DateTimeType value) { 
4233      this.lastModified = value;
4234      return this;
4235    }
4236
4237    /**
4238     * @return The date and time of last modification to this task.
4239     */
4240    public Date getLastModified() { 
4241      return this.lastModified == null ? null : this.lastModified.getValue();
4242    }
4243
4244    /**
4245     * @param value The date and time of last modification to this task.
4246     */
4247    public Task setLastModified(Date value) { 
4248      if (value == null)
4249        this.lastModified = null;
4250      else {
4251        if (this.lastModified == null)
4252          this.lastModified = new DateTimeType();
4253        this.lastModified.setValue(value);
4254      }
4255      return this;
4256    }
4257
4258    /**
4259     * @return {@link #requester} (The creator of the task.)
4260     */
4261    public Reference getRequester() { 
4262      if (this.requester == null)
4263        if (Configuration.errorOnAutoCreate())
4264          throw new Error("Attempt to auto-create Task.requester");
4265        else if (Configuration.doAutoCreate())
4266          this.requester = new Reference(); // cc
4267      return this.requester;
4268    }
4269
4270    public boolean hasRequester() { 
4271      return this.requester != null && !this.requester.isEmpty();
4272    }
4273
4274    /**
4275     * @param value {@link #requester} (The creator of the task.)
4276     */
4277    public Task setRequester(Reference value) { 
4278      this.requester = value;
4279      return this;
4280    }
4281
4282    /**
4283     * @return {@link #performerType} (The kind of participant that should perform the task.)
4284     */
4285    public List<CodeableConcept> getPerformerType() { 
4286      if (this.performerType == null)
4287        this.performerType = new ArrayList<CodeableConcept>();
4288      return this.performerType;
4289    }
4290
4291    /**
4292     * @return Returns a reference to <code>this</code> for easy method chaining
4293     */
4294    public Task setPerformerType(List<CodeableConcept> thePerformerType) { 
4295      this.performerType = thePerformerType;
4296      return this;
4297    }
4298
4299    public boolean hasPerformerType() { 
4300      if (this.performerType == null)
4301        return false;
4302      for (CodeableConcept item : this.performerType)
4303        if (!item.isEmpty())
4304          return true;
4305      return false;
4306    }
4307
4308    public CodeableConcept addPerformerType() { //3
4309      CodeableConcept t = new CodeableConcept();
4310      if (this.performerType == null)
4311        this.performerType = new ArrayList<CodeableConcept>();
4312      this.performerType.add(t);
4313      return t;
4314    }
4315
4316    public Task addPerformerType(CodeableConcept t) { //3
4317      if (t == null)
4318        return this;
4319      if (this.performerType == null)
4320        this.performerType = new ArrayList<CodeableConcept>();
4321      this.performerType.add(t);
4322      return this;
4323    }
4324
4325    /**
4326     * @return The first repetition of repeating field {@link #performerType}, creating it if it does not already exist {3}
4327     */
4328    public CodeableConcept getPerformerTypeFirstRep() { 
4329      if (getPerformerType().isEmpty()) {
4330        addPerformerType();
4331      }
4332      return getPerformerType().get(0);
4333    }
4334
4335    /**
4336     * @return {@link #owner} (Individual organization or Device currently responsible for task execution.)
4337     */
4338    public Reference getOwner() { 
4339      if (this.owner == null)
4340        if (Configuration.errorOnAutoCreate())
4341          throw new Error("Attempt to auto-create Task.owner");
4342        else if (Configuration.doAutoCreate())
4343          this.owner = new Reference(); // cc
4344      return this.owner;
4345    }
4346
4347    public boolean hasOwner() { 
4348      return this.owner != null && !this.owner.isEmpty();
4349    }
4350
4351    /**
4352     * @param value {@link #owner} (Individual organization or Device currently responsible for task execution.)
4353     */
4354    public Task setOwner(Reference value) { 
4355      this.owner = value;
4356      return this;
4357    }
4358
4359    /**
4360     * @return {@link #location} (Principal physical location where the this task is performed.)
4361     */
4362    public Reference getLocation() { 
4363      if (this.location == null)
4364        if (Configuration.errorOnAutoCreate())
4365          throw new Error("Attempt to auto-create Task.location");
4366        else if (Configuration.doAutoCreate())
4367          this.location = new Reference(); // cc
4368      return this.location;
4369    }
4370
4371    public boolean hasLocation() { 
4372      return this.location != null && !this.location.isEmpty();
4373    }
4374
4375    /**
4376     * @param value {@link #location} (Principal physical location where the this task is performed.)
4377     */
4378    public Task setLocation(Reference value) { 
4379      this.location = value;
4380      return this;
4381    }
4382
4383    /**
4384     * @return {@link #reasonCode} (A description or code indicating why this task needs to be performed.)
4385     */
4386    public CodeableConcept getReasonCode() { 
4387      if (this.reasonCode == null)
4388        if (Configuration.errorOnAutoCreate())
4389          throw new Error("Attempt to auto-create Task.reasonCode");
4390        else if (Configuration.doAutoCreate())
4391          this.reasonCode = new CodeableConcept(); // cc
4392      return this.reasonCode;
4393    }
4394
4395    public boolean hasReasonCode() { 
4396      return this.reasonCode != null && !this.reasonCode.isEmpty();
4397    }
4398
4399    /**
4400     * @param value {@link #reasonCode} (A description or code indicating why this task needs to be performed.)
4401     */
4402    public Task setReasonCode(CodeableConcept value) { 
4403      this.reasonCode = value;
4404      return this;
4405    }
4406
4407    /**
4408     * @return {@link #reasonReference} (A resource reference indicating why this task needs to be performed.)
4409     */
4410    public Reference getReasonReference() { 
4411      if (this.reasonReference == null)
4412        if (Configuration.errorOnAutoCreate())
4413          throw new Error("Attempt to auto-create Task.reasonReference");
4414        else if (Configuration.doAutoCreate())
4415          this.reasonReference = new Reference(); // cc
4416      return this.reasonReference;
4417    }
4418
4419    public boolean hasReasonReference() { 
4420      return this.reasonReference != null && !this.reasonReference.isEmpty();
4421    }
4422
4423    /**
4424     * @param value {@link #reasonReference} (A resource reference indicating why this task needs to be performed.)
4425     */
4426    public Task setReasonReference(Reference value) { 
4427      this.reasonReference = value;
4428      return this;
4429    }
4430
4431    /**
4432     * @return {@link #insurance} (Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be relevant to the Task.)
4433     */
4434    public List<Reference> getInsurance() { 
4435      if (this.insurance == null)
4436        this.insurance = new ArrayList<Reference>();
4437      return this.insurance;
4438    }
4439
4440    /**
4441     * @return Returns a reference to <code>this</code> for easy method chaining
4442     */
4443    public Task setInsurance(List<Reference> theInsurance) { 
4444      this.insurance = theInsurance;
4445      return this;
4446    }
4447
4448    public boolean hasInsurance() { 
4449      if (this.insurance == null)
4450        return false;
4451      for (Reference item : this.insurance)
4452        if (!item.isEmpty())
4453          return true;
4454      return false;
4455    }
4456
4457    public Reference addInsurance() { //3
4458      Reference t = new Reference();
4459      if (this.insurance == null)
4460        this.insurance = new ArrayList<Reference>();
4461      this.insurance.add(t);
4462      return t;
4463    }
4464
4465    public Task addInsurance(Reference t) { //3
4466      if (t == null)
4467        return this;
4468      if (this.insurance == null)
4469        this.insurance = new ArrayList<Reference>();
4470      this.insurance.add(t);
4471      return this;
4472    }
4473
4474    /**
4475     * @return The first repetition of repeating field {@link #insurance}, creating it if it does not already exist {3}
4476     */
4477    public Reference getInsuranceFirstRep() { 
4478      if (getInsurance().isEmpty()) {
4479        addInsurance();
4480      }
4481      return getInsurance().get(0);
4482    }
4483
4484    /**
4485     * @return {@link #note} (Free-text information captured about the task as it progresses.)
4486     */
4487    public List<Annotation> getNote() { 
4488      if (this.note == null)
4489        this.note = new ArrayList<Annotation>();
4490      return this.note;
4491    }
4492
4493    /**
4494     * @return Returns a reference to <code>this</code> for easy method chaining
4495     */
4496    public Task setNote(List<Annotation> theNote) { 
4497      this.note = theNote;
4498      return this;
4499    }
4500
4501    public boolean hasNote() { 
4502      if (this.note == null)
4503        return false;
4504      for (Annotation item : this.note)
4505        if (!item.isEmpty())
4506          return true;
4507      return false;
4508    }
4509
4510    public Annotation addNote() { //3
4511      Annotation t = new Annotation();
4512      if (this.note == null)
4513        this.note = new ArrayList<Annotation>();
4514      this.note.add(t);
4515      return t;
4516    }
4517
4518    public Task addNote(Annotation t) { //3
4519      if (t == null)
4520        return this;
4521      if (this.note == null)
4522        this.note = new ArrayList<Annotation>();
4523      this.note.add(t);
4524      return this;
4525    }
4526
4527    /**
4528     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
4529     */
4530    public Annotation getNoteFirstRep() { 
4531      if (getNote().isEmpty()) {
4532        addNote();
4533      }
4534      return getNote().get(0);
4535    }
4536
4537    /**
4538     * @return {@link #relevantHistory} (Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task.)
4539     */
4540    public List<Reference> getRelevantHistory() { 
4541      if (this.relevantHistory == null)
4542        this.relevantHistory = new ArrayList<Reference>();
4543      return this.relevantHistory;
4544    }
4545
4546    /**
4547     * @return Returns a reference to <code>this</code> for easy method chaining
4548     */
4549    public Task setRelevantHistory(List<Reference> theRelevantHistory) { 
4550      this.relevantHistory = theRelevantHistory;
4551      return this;
4552    }
4553
4554    public boolean hasRelevantHistory() { 
4555      if (this.relevantHistory == null)
4556        return false;
4557      for (Reference item : this.relevantHistory)
4558        if (!item.isEmpty())
4559          return true;
4560      return false;
4561    }
4562
4563    public Reference addRelevantHistory() { //3
4564      Reference t = new Reference();
4565      if (this.relevantHistory == null)
4566        this.relevantHistory = new ArrayList<Reference>();
4567      this.relevantHistory.add(t);
4568      return t;
4569    }
4570
4571    public Task addRelevantHistory(Reference t) { //3
4572      if (t == null)
4573        return this;
4574      if (this.relevantHistory == null)
4575        this.relevantHistory = new ArrayList<Reference>();
4576      this.relevantHistory.add(t);
4577      return this;
4578    }
4579
4580    /**
4581     * @return The first repetition of repeating field {@link #relevantHistory}, creating it if it does not already exist {3}
4582     */
4583    public Reference getRelevantHistoryFirstRep() { 
4584      if (getRelevantHistory().isEmpty()) {
4585        addRelevantHistory();
4586      }
4587      return getRelevantHistory().get(0);
4588    }
4589
4590    /**
4591     * @return {@link #restriction} (If the Task.focus is a request resource and the task is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned.)
4592     */
4593    public TaskRestrictionComponent getRestriction() { 
4594      if (this.restriction == null)
4595        if (Configuration.errorOnAutoCreate())
4596          throw new Error("Attempt to auto-create Task.restriction");
4597        else if (Configuration.doAutoCreate())
4598          this.restriction = new TaskRestrictionComponent(); // cc
4599      return this.restriction;
4600    }
4601
4602    public boolean hasRestriction() { 
4603      return this.restriction != null && !this.restriction.isEmpty();
4604    }
4605
4606    /**
4607     * @param value {@link #restriction} (If the Task.focus is a request resource and the task is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned.)
4608     */
4609    public Task setRestriction(TaskRestrictionComponent value) { 
4610      this.restriction = value;
4611      return this;
4612    }
4613
4614    /**
4615     * @return {@link #input} (Additional information that may be needed in the execution of the task.)
4616     */
4617    public List<ParameterComponent> getInput() { 
4618      if (this.input == null)
4619        this.input = new ArrayList<ParameterComponent>();
4620      return this.input;
4621    }
4622
4623    /**
4624     * @return Returns a reference to <code>this</code> for easy method chaining
4625     */
4626    public Task setInput(List<ParameterComponent> theInput) { 
4627      this.input = theInput;
4628      return this;
4629    }
4630
4631    public boolean hasInput() { 
4632      if (this.input == null)
4633        return false;
4634      for (ParameterComponent item : this.input)
4635        if (!item.isEmpty())
4636          return true;
4637      return false;
4638    }
4639
4640    public ParameterComponent addInput() { //3
4641      ParameterComponent t = new ParameterComponent();
4642      if (this.input == null)
4643        this.input = new ArrayList<ParameterComponent>();
4644      this.input.add(t);
4645      return t;
4646    }
4647
4648    public Task addInput(ParameterComponent t) { //3
4649      if (t == null)
4650        return this;
4651      if (this.input == null)
4652        this.input = new ArrayList<ParameterComponent>();
4653      this.input.add(t);
4654      return this;
4655    }
4656
4657    /**
4658     * @return The first repetition of repeating field {@link #input}, creating it if it does not already exist {3}
4659     */
4660    public ParameterComponent getInputFirstRep() { 
4661      if (getInput().isEmpty()) {
4662        addInput();
4663      }
4664      return getInput().get(0);
4665    }
4666
4667    /**
4668     * @return {@link #output} (Outputs produced by the Task.)
4669     */
4670    public List<TaskOutputComponent> getOutput() { 
4671      if (this.output == null)
4672        this.output = new ArrayList<TaskOutputComponent>();
4673      return this.output;
4674    }
4675
4676    /**
4677     * @return Returns a reference to <code>this</code> for easy method chaining
4678     */
4679    public Task setOutput(List<TaskOutputComponent> theOutput) { 
4680      this.output = theOutput;
4681      return this;
4682    }
4683
4684    public boolean hasOutput() { 
4685      if (this.output == null)
4686        return false;
4687      for (TaskOutputComponent item : this.output)
4688        if (!item.isEmpty())
4689          return true;
4690      return false;
4691    }
4692
4693    public TaskOutputComponent addOutput() { //3
4694      TaskOutputComponent t = new TaskOutputComponent();
4695      if (this.output == null)
4696        this.output = new ArrayList<TaskOutputComponent>();
4697      this.output.add(t);
4698      return t;
4699    }
4700
4701    public Task addOutput(TaskOutputComponent t) { //3
4702      if (t == null)
4703        return this;
4704      if (this.output == null)
4705        this.output = new ArrayList<TaskOutputComponent>();
4706      this.output.add(t);
4707      return this;
4708    }
4709
4710    /**
4711     * @return The first repetition of repeating field {@link #output}, creating it if it does not already exist {3}
4712     */
4713    public TaskOutputComponent getOutputFirstRep() { 
4714      if (getOutput().isEmpty()) {
4715        addOutput();
4716      }
4717      return getOutput().get(0);
4718    }
4719
4720      protected void listChildren(List<Property> children) {
4721        super.listChildren(children);
4722        children.add(new Property("identifier", "Identifier", "The business identifier for this task.", 0, java.lang.Integer.MAX_VALUE, identifier));
4723        children.add(new Property("instantiatesCanonical", "canonical(ActivityDefinition)", "The URL pointing to a *FHIR*-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.", 0, 1, instantiatesCanonical));
4724        children.add(new Property("instantiatesUri", "uri", "The URL pointing to an *externally* maintained  protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.", 0, 1, instantiatesUri));
4725        children.add(new Property("basedOn", "Reference(Any)", "BasedOn refers to a higher-level authorization that triggered the creation of the task.  It references a \"request\" resource such as a ServiceRequest, MedicationRequest, ServiceRequest, CarePlan, etc. which is distinct from the \"request\" resource the task is seeking to fulfill.  This latter resource is referenced by FocusOn.  For example, based on a ServiceRequest (= BasedOn), a task is created to fulfill a procedureRequest ( = FocusOn ) to collect a specimen from a patient.", 0, java.lang.Integer.MAX_VALUE, basedOn));
4726        children.add(new Property("groupIdentifier", "Identifier", "An identifier that links together multiple tasks and other requests that were created in the same context.", 0, 1, groupIdentifier));
4727        children.add(new Property("partOf", "Reference(Task)", "Task that this particular task is part of.", 0, java.lang.Integer.MAX_VALUE, partOf));
4728        children.add(new Property("status", "code", "The current status of the task.", 0, 1, status));
4729        children.add(new Property("statusReason", "CodeableConcept", "An explanation as to why this task is held, failed, was refused, etc.", 0, 1, statusReason));
4730        children.add(new Property("businessStatus", "CodeableConcept", "Contains business-specific nuances of the business state.", 0, 1, businessStatus));
4731        children.add(new Property("intent", "code", "Indicates the \"level\" of actionability associated with the Task, i.e. i+R[9]Cs this a proposed task, a planned task, an actionable task, etc.", 0, 1, intent));
4732        children.add(new Property("priority", "code", "Indicates how quickly the Task should be addressed with respect to other requests.", 0, 1, priority));
4733        children.add(new Property("code", "CodeableConcept", "A name or code (or both) briefly describing what the task involves.", 0, 1, code));
4734        children.add(new Property("description", "string", "A free-text description of what is to be performed.", 0, 1, description));
4735        children.add(new Property("focus", "Reference(Any)", "The request being actioned or the resource being manipulated by this task.", 0, 1, focus));
4736        children.add(new Property("for", "Reference(Any)", "The entity who benefits from the performance of the service specified in the task (e.g., the patient).", 0, 1, for_));
4737        children.add(new Property("encounter", "Reference(Encounter)", "The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.", 0, 1, encounter));
4738        children.add(new Property("executionPeriod", "Period", "Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end).", 0, 1, executionPeriod));
4739        children.add(new Property("authoredOn", "dateTime", "The date and time this task was created.", 0, 1, authoredOn));
4740        children.add(new Property("lastModified", "dateTime", "The date and time of last modification to this task.", 0, 1, lastModified));
4741        children.add(new Property("requester", "Reference(Device|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "The creator of the task.", 0, 1, requester));
4742        children.add(new Property("performerType", "CodeableConcept", "The kind of participant that should perform the task.", 0, java.lang.Integer.MAX_VALUE, performerType));
4743        children.add(new Property("owner", "Reference(Practitioner|PractitionerRole|Organization|CareTeam|HealthcareService|Patient|Device|RelatedPerson)", "Individual organization or Device currently responsible for task execution.", 0, 1, owner));
4744        children.add(new Property("location", "Reference(Location)", "Principal physical location where the this task is performed.", 0, 1, location));
4745        children.add(new Property("reasonCode", "CodeableConcept", "A description or code indicating why this task needs to be performed.", 0, 1, reasonCode));
4746        children.add(new Property("reasonReference", "Reference(Any)", "A resource reference indicating why this task needs to be performed.", 0, 1, reasonReference));
4747        children.add(new Property("insurance", "Reference(Coverage|ClaimResponse)", "Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be relevant to the Task.", 0, java.lang.Integer.MAX_VALUE, insurance));
4748        children.add(new Property("note", "Annotation", "Free-text information captured about the task as it progresses.", 0, java.lang.Integer.MAX_VALUE, note));
4749        children.add(new Property("relevantHistory", "Reference(Provenance)", "Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task.", 0, java.lang.Integer.MAX_VALUE, relevantHistory));
4750        children.add(new Property("restriction", "", "If the Task.focus is a request resource and the task is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned.", 0, 1, restriction));
4751        children.add(new Property("input", "", "Additional information that may be needed in the execution of the task.", 0, java.lang.Integer.MAX_VALUE, input));
4752        children.add(new Property("output", "", "Outputs produced by the Task.", 0, java.lang.Integer.MAX_VALUE, output));
4753      }
4754
4755      @Override
4756      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4757        switch (_hash) {
4758        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "The business identifier for this task.", 0, java.lang.Integer.MAX_VALUE, identifier);
4759        case 8911915: /*instantiatesCanonical*/  return new Property("instantiatesCanonical", "canonical(ActivityDefinition)", "The URL pointing to a *FHIR*-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.", 0, 1, instantiatesCanonical);
4760        case -1926393373: /*instantiatesUri*/  return new Property("instantiatesUri", "uri", "The URL pointing to an *externally* maintained  protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.", 0, 1, instantiatesUri);
4761        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(Any)", "BasedOn refers to a higher-level authorization that triggered the creation of the task.  It references a \"request\" resource such as a ServiceRequest, MedicationRequest, ServiceRequest, CarePlan, etc. which is distinct from the \"request\" resource the task is seeking to fulfill.  This latter resource is referenced by FocusOn.  For example, based on a ServiceRequest (= BasedOn), a task is created to fulfill a procedureRequest ( = FocusOn ) to collect a specimen from a patient.", 0, java.lang.Integer.MAX_VALUE, basedOn);
4762        case -445338488: /*groupIdentifier*/  return new Property("groupIdentifier", "Identifier", "An identifier that links together multiple tasks and other requests that were created in the same context.", 0, 1, groupIdentifier);
4763        case -995410646: /*partOf*/  return new Property("partOf", "Reference(Task)", "Task that this particular task is part of.", 0, java.lang.Integer.MAX_VALUE, partOf);
4764        case -892481550: /*status*/  return new Property("status", "code", "The current status of the task.", 0, 1, status);
4765        case 2051346646: /*statusReason*/  return new Property("statusReason", "CodeableConcept", "An explanation as to why this task is held, failed, was refused, etc.", 0, 1, statusReason);
4766        case 2008591314: /*businessStatus*/  return new Property("businessStatus", "CodeableConcept", "Contains business-specific nuances of the business state.", 0, 1, businessStatus);
4767        case -1183762788: /*intent*/  return new Property("intent", "code", "Indicates the \"level\" of actionability associated with the Task, i.e. i+R[9]Cs this a proposed task, a planned task, an actionable task, etc.", 0, 1, intent);
4768        case -1165461084: /*priority*/  return new Property("priority", "code", "Indicates how quickly the Task should be addressed with respect to other requests.", 0, 1, priority);
4769        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A name or code (or both) briefly describing what the task involves.", 0, 1, code);
4770        case -1724546052: /*description*/  return new Property("description", "string", "A free-text description of what is to be performed.", 0, 1, description);
4771        case 97604824: /*focus*/  return new Property("focus", "Reference(Any)", "The request being actioned or the resource being manipulated by this task.", 0, 1, focus);
4772        case 101577: /*for*/  return new Property("for", "Reference(Any)", "The entity who benefits from the performance of the service specified in the task (e.g., the patient).", 0, 1, for_);
4773        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.", 0, 1, encounter);
4774        case 1218624249: /*executionPeriod*/  return new Property("executionPeriod", "Period", "Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end).", 0, 1, executionPeriod);
4775        case -1500852503: /*authoredOn*/  return new Property("authoredOn", "dateTime", "The date and time this task was created.", 0, 1, authoredOn);
4776        case 1959003007: /*lastModified*/  return new Property("lastModified", "dateTime", "The date and time of last modification to this task.", 0, 1, lastModified);
4777        case 693933948: /*requester*/  return new Property("requester", "Reference(Device|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "The creator of the task.", 0, 1, requester);
4778        case -901444568: /*performerType*/  return new Property("performerType", "CodeableConcept", "The kind of participant that should perform the task.", 0, java.lang.Integer.MAX_VALUE, performerType);
4779        case 106164915: /*owner*/  return new Property("owner", "Reference(Practitioner|PractitionerRole|Organization|CareTeam|HealthcareService|Patient|Device|RelatedPerson)", "Individual organization or Device currently responsible for task execution.", 0, 1, owner);
4780        case 1901043637: /*location*/  return new Property("location", "Reference(Location)", "Principal physical location where the this task is performed.", 0, 1, location);
4781        case 722137681: /*reasonCode*/  return new Property("reasonCode", "CodeableConcept", "A description or code indicating why this task needs to be performed.", 0, 1, reasonCode);
4782        case -1146218137: /*reasonReference*/  return new Property("reasonReference", "Reference(Any)", "A resource reference indicating why this task needs to be performed.", 0, 1, reasonReference);
4783        case 73049818: /*insurance*/  return new Property("insurance", "Reference(Coverage|ClaimResponse)", "Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be relevant to the Task.", 0, java.lang.Integer.MAX_VALUE, insurance);
4784        case 3387378: /*note*/  return new Property("note", "Annotation", "Free-text information captured about the task as it progresses.", 0, java.lang.Integer.MAX_VALUE, note);
4785        case 1538891575: /*relevantHistory*/  return new Property("relevantHistory", "Reference(Provenance)", "Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task.", 0, java.lang.Integer.MAX_VALUE, relevantHistory);
4786        case -1561062452: /*restriction*/  return new Property("restriction", "", "If the Task.focus is a request resource and the task is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned.", 0, 1, restriction);
4787        case 100358090: /*input*/  return new Property("input", "", "Additional information that may be needed in the execution of the task.", 0, java.lang.Integer.MAX_VALUE, input);
4788        case -1005512447: /*output*/  return new Property("output", "", "Outputs produced by the Task.", 0, java.lang.Integer.MAX_VALUE, output);
4789        default: return super.getNamedProperty(_hash, _name, _checkValid);
4790        }
4791
4792      }
4793
4794      @Override
4795      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4796        switch (hash) {
4797        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
4798        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : new Base[] {this.instantiatesCanonical}; // CanonicalType
4799        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : new Base[] {this.instantiatesUri}; // UriType
4800        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
4801        case -445338488: /*groupIdentifier*/ return this.groupIdentifier == null ? new Base[0] : new Base[] {this.groupIdentifier}; // Identifier
4802        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
4803        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<TaskStatus>
4804        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // CodeableConcept
4805        case 2008591314: /*businessStatus*/ return this.businessStatus == null ? new Base[0] : new Base[] {this.businessStatus}; // CodeableConcept
4806        case -1183762788: /*intent*/ return this.intent == null ? new Base[0] : new Base[] {this.intent}; // Enumeration<TaskIntent>
4807        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration<RequestPriority>
4808        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
4809        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
4810        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : new Base[] {this.focus}; // Reference
4811        case 101577: /*for*/ return this.for_ == null ? new Base[0] : new Base[] {this.for_}; // Reference
4812        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
4813        case 1218624249: /*executionPeriod*/ return this.executionPeriod == null ? new Base[0] : new Base[] {this.executionPeriod}; // Period
4814        case -1500852503: /*authoredOn*/ return this.authoredOn == null ? new Base[0] : new Base[] {this.authoredOn}; // DateTimeType
4815        case 1959003007: /*lastModified*/ return this.lastModified == null ? new Base[0] : new Base[] {this.lastModified}; // DateTimeType
4816        case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference
4817        case -901444568: /*performerType*/ return this.performerType == null ? new Base[0] : this.performerType.toArray(new Base[this.performerType.size()]); // CodeableConcept
4818        case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference
4819        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
4820        case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : new Base[] {this.reasonCode}; // CodeableConcept
4821        case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : new Base[] {this.reasonReference}; // Reference
4822        case 73049818: /*insurance*/ return this.insurance == null ? new Base[0] : this.insurance.toArray(new Base[this.insurance.size()]); // Reference
4823        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
4824        case 1538891575: /*relevantHistory*/ return this.relevantHistory == null ? new Base[0] : this.relevantHistory.toArray(new Base[this.relevantHistory.size()]); // Reference
4825        case -1561062452: /*restriction*/ return this.restriction == null ? new Base[0] : new Base[] {this.restriction}; // TaskRestrictionComponent
4826        case 100358090: /*input*/ return this.input == null ? new Base[0] : this.input.toArray(new Base[this.input.size()]); // ParameterComponent
4827        case -1005512447: /*output*/ return this.output == null ? new Base[0] : this.output.toArray(new Base[this.output.size()]); // TaskOutputComponent
4828        default: return super.getProperty(hash, name, checkValid);
4829        }
4830
4831      }
4832
4833      @Override
4834      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4835        switch (hash) {
4836        case -1618432855: // identifier
4837          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
4838          return value;
4839        case 8911915: // instantiatesCanonical
4840          this.instantiatesCanonical = TypeConvertor.castToCanonical(value); // CanonicalType
4841          return value;
4842        case -1926393373: // instantiatesUri
4843          this.instantiatesUri = TypeConvertor.castToUri(value); // UriType
4844          return value;
4845        case -332612366: // basedOn
4846          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
4847          return value;
4848        case -445338488: // groupIdentifier
4849          this.groupIdentifier = TypeConvertor.castToIdentifier(value); // Identifier
4850          return value;
4851        case -995410646: // partOf
4852          this.getPartOf().add(TypeConvertor.castToReference(value)); // Reference
4853          return value;
4854        case -892481550: // status
4855          value = new TaskStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
4856          this.status = (Enumeration) value; // Enumeration<TaskStatus>
4857          return value;
4858        case 2051346646: // statusReason
4859          this.statusReason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4860          return value;
4861        case 2008591314: // businessStatus
4862          this.businessStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4863          return value;
4864        case -1183762788: // intent
4865          value = new TaskIntentEnumFactory().fromType(TypeConvertor.castToCode(value));
4866          this.intent = (Enumeration) value; // Enumeration<TaskIntent>
4867          return value;
4868        case -1165461084: // priority
4869          value = new RequestPriorityEnumFactory().fromType(TypeConvertor.castToCode(value));
4870          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
4871          return value;
4872        case 3059181: // code
4873          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4874          return value;
4875        case -1724546052: // description
4876          this.description = TypeConvertor.castToString(value); // StringType
4877          return value;
4878        case 97604824: // focus
4879          this.focus = TypeConvertor.castToReference(value); // Reference
4880          return value;
4881        case 101577: // for
4882          this.for_ = TypeConvertor.castToReference(value); // Reference
4883          return value;
4884        case 1524132147: // encounter
4885          this.encounter = TypeConvertor.castToReference(value); // Reference
4886          return value;
4887        case 1218624249: // executionPeriod
4888          this.executionPeriod = TypeConvertor.castToPeriod(value); // Period
4889          return value;
4890        case -1500852503: // authoredOn
4891          this.authoredOn = TypeConvertor.castToDateTime(value); // DateTimeType
4892          return value;
4893        case 1959003007: // lastModified
4894          this.lastModified = TypeConvertor.castToDateTime(value); // DateTimeType
4895          return value;
4896        case 693933948: // requester
4897          this.requester = TypeConvertor.castToReference(value); // Reference
4898          return value;
4899        case -901444568: // performerType
4900          this.getPerformerType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4901          return value;
4902        case 106164915: // owner
4903          this.owner = TypeConvertor.castToReference(value); // Reference
4904          return value;
4905        case 1901043637: // location
4906          this.location = TypeConvertor.castToReference(value); // Reference
4907          return value;
4908        case 722137681: // reasonCode
4909          this.reasonCode = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4910          return value;
4911        case -1146218137: // reasonReference
4912          this.reasonReference = TypeConvertor.castToReference(value); // Reference
4913          return value;
4914        case 73049818: // insurance
4915          this.getInsurance().add(TypeConvertor.castToReference(value)); // Reference
4916          return value;
4917        case 3387378: // note
4918          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
4919          return value;
4920        case 1538891575: // relevantHistory
4921          this.getRelevantHistory().add(TypeConvertor.castToReference(value)); // Reference
4922          return value;
4923        case -1561062452: // restriction
4924          this.restriction = (TaskRestrictionComponent) value; // TaskRestrictionComponent
4925          return value;
4926        case 100358090: // input
4927          this.getInput().add((ParameterComponent) value); // ParameterComponent
4928          return value;
4929        case -1005512447: // output
4930          this.getOutput().add((TaskOutputComponent) value); // TaskOutputComponent
4931          return value;
4932        default: return super.setProperty(hash, name, value);
4933        }
4934
4935      }
4936
4937      @Override
4938      public Base setProperty(String name, Base value) throws FHIRException {
4939        if (name.equals("identifier")) {
4940          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
4941        } else if (name.equals("instantiatesCanonical")) {
4942          this.instantiatesCanonical = TypeConvertor.castToCanonical(value); // CanonicalType
4943        } else if (name.equals("instantiatesUri")) {
4944          this.instantiatesUri = TypeConvertor.castToUri(value); // UriType
4945        } else if (name.equals("basedOn")) {
4946          this.getBasedOn().add(TypeConvertor.castToReference(value));
4947        } else if (name.equals("groupIdentifier")) {
4948          this.groupIdentifier = TypeConvertor.castToIdentifier(value); // Identifier
4949        } else if (name.equals("partOf")) {
4950          this.getPartOf().add(TypeConvertor.castToReference(value));
4951        } else if (name.equals("status")) {
4952          value = new TaskStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
4953          this.status = (Enumeration) value; // Enumeration<TaskStatus>
4954        } else if (name.equals("statusReason")) {
4955          this.statusReason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4956        } else if (name.equals("businessStatus")) {
4957          this.businessStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4958        } else if (name.equals("intent")) {
4959          value = new TaskIntentEnumFactory().fromType(TypeConvertor.castToCode(value));
4960          this.intent = (Enumeration) value; // Enumeration<TaskIntent>
4961        } else if (name.equals("priority")) {
4962          value = new RequestPriorityEnumFactory().fromType(TypeConvertor.castToCode(value));
4963          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
4964        } else if (name.equals("code")) {
4965          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4966        } else if (name.equals("description")) {
4967          this.description = TypeConvertor.castToString(value); // StringType
4968        } else if (name.equals("focus")) {
4969          this.focus = TypeConvertor.castToReference(value); // Reference
4970        } else if (name.equals("for")) {
4971          this.for_ = TypeConvertor.castToReference(value); // Reference
4972        } else if (name.equals("encounter")) {
4973          this.encounter = TypeConvertor.castToReference(value); // Reference
4974        } else if (name.equals("executionPeriod")) {
4975          this.executionPeriod = TypeConvertor.castToPeriod(value); // Period
4976        } else if (name.equals("authoredOn")) {
4977          this.authoredOn = TypeConvertor.castToDateTime(value); // DateTimeType
4978        } else if (name.equals("lastModified")) {
4979          this.lastModified = TypeConvertor.castToDateTime(value); // DateTimeType
4980        } else if (name.equals("requester")) {
4981          this.requester = TypeConvertor.castToReference(value); // Reference
4982        } else if (name.equals("performerType")) {
4983          this.getPerformerType().add(TypeConvertor.castToCodeableConcept(value));
4984        } else if (name.equals("owner")) {
4985          this.owner = TypeConvertor.castToReference(value); // Reference
4986        } else if (name.equals("location")) {
4987          this.location = TypeConvertor.castToReference(value); // Reference
4988        } else if (name.equals("reasonCode")) {
4989          this.reasonCode = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4990        } else if (name.equals("reasonReference")) {
4991          this.reasonReference = TypeConvertor.castToReference(value); // Reference
4992        } else if (name.equals("insurance")) {
4993          this.getInsurance().add(TypeConvertor.castToReference(value));
4994        } else if (name.equals("note")) {
4995          this.getNote().add(TypeConvertor.castToAnnotation(value));
4996        } else if (name.equals("relevantHistory")) {
4997          this.getRelevantHistory().add(TypeConvertor.castToReference(value));
4998        } else if (name.equals("restriction")) {
4999          this.restriction = (TaskRestrictionComponent) value; // TaskRestrictionComponent
5000        } else if (name.equals("input")) {
5001          this.getInput().add((ParameterComponent) value);
5002        } else if (name.equals("output")) {
5003          this.getOutput().add((TaskOutputComponent) value);
5004        } else
5005          return super.setProperty(name, value);
5006        return value;
5007      }
5008
5009      @Override
5010      public Base makeProperty(int hash, String name) throws FHIRException {
5011        switch (hash) {
5012        case -1618432855:  return addIdentifier(); 
5013        case 8911915:  return getInstantiatesCanonicalElement();
5014        case -1926393373:  return getInstantiatesUriElement();
5015        case -332612366:  return addBasedOn(); 
5016        case -445338488:  return getGroupIdentifier();
5017        case -995410646:  return addPartOf(); 
5018        case -892481550:  return getStatusElement();
5019        case 2051346646:  return getStatusReason();
5020        case 2008591314:  return getBusinessStatus();
5021        case -1183762788:  return getIntentElement();
5022        case -1165461084:  return getPriorityElement();
5023        case 3059181:  return getCode();
5024        case -1724546052:  return getDescriptionElement();
5025        case 97604824:  return getFocus();
5026        case 101577:  return getFor();
5027        case 1524132147:  return getEncounter();
5028        case 1218624249:  return getExecutionPeriod();
5029        case -1500852503:  return getAuthoredOnElement();
5030        case 1959003007:  return getLastModifiedElement();
5031        case 693933948:  return getRequester();
5032        case -901444568:  return addPerformerType(); 
5033        case 106164915:  return getOwner();
5034        case 1901043637:  return getLocation();
5035        case 722137681:  return getReasonCode();
5036        case -1146218137:  return getReasonReference();
5037        case 73049818:  return addInsurance(); 
5038        case 3387378:  return addNote(); 
5039        case 1538891575:  return addRelevantHistory(); 
5040        case -1561062452:  return getRestriction();
5041        case 100358090:  return addInput(); 
5042        case -1005512447:  return addOutput(); 
5043        default: return super.makeProperty(hash, name);
5044        }
5045
5046      }
5047
5048      @Override
5049      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5050        switch (hash) {
5051        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
5052        case 8911915: /*instantiatesCanonical*/ return new String[] {"canonical"};
5053        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
5054        case -332612366: /*basedOn*/ return new String[] {"Reference"};
5055        case -445338488: /*groupIdentifier*/ return new String[] {"Identifier"};
5056        case -995410646: /*partOf*/ return new String[] {"Reference"};
5057        case -892481550: /*status*/ return new String[] {"code"};
5058        case 2051346646: /*statusReason*/ return new String[] {"CodeableConcept"};
5059        case 2008591314: /*businessStatus*/ return new String[] {"CodeableConcept"};
5060        case -1183762788: /*intent*/ return new String[] {"code"};
5061        case -1165461084: /*priority*/ return new String[] {"code"};
5062        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
5063        case -1724546052: /*description*/ return new String[] {"string"};
5064        case 97604824: /*focus*/ return new String[] {"Reference"};
5065        case 101577: /*for*/ return new String[] {"Reference"};
5066        case 1524132147: /*encounter*/ return new String[] {"Reference"};
5067        case 1218624249: /*executionPeriod*/ return new String[] {"Period"};
5068        case -1500852503: /*authoredOn*/ return new String[] {"dateTime"};
5069        case 1959003007: /*lastModified*/ return new String[] {"dateTime"};
5070        case 693933948: /*requester*/ return new String[] {"Reference"};
5071        case -901444568: /*performerType*/ return new String[] {"CodeableConcept"};
5072        case 106164915: /*owner*/ return new String[] {"Reference"};
5073        case 1901043637: /*location*/ return new String[] {"Reference"};
5074        case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
5075        case -1146218137: /*reasonReference*/ return new String[] {"Reference"};
5076        case 73049818: /*insurance*/ return new String[] {"Reference"};
5077        case 3387378: /*note*/ return new String[] {"Annotation"};
5078        case 1538891575: /*relevantHistory*/ return new String[] {"Reference"};
5079        case -1561062452: /*restriction*/ return new String[] {};
5080        case 100358090: /*input*/ return new String[] {};
5081        case -1005512447: /*output*/ return new String[] {};
5082        default: return super.getTypesForProperty(hash, name);
5083        }
5084
5085      }
5086
5087      @Override
5088      public Base addChild(String name) throws FHIRException {
5089        if (name.equals("identifier")) {
5090          return addIdentifier();
5091        }
5092        else if (name.equals("instantiatesCanonical")) {
5093          throw new FHIRException("Cannot call addChild on a primitive type Task.instantiatesCanonical");
5094        }
5095        else if (name.equals("instantiatesUri")) {
5096          throw new FHIRException("Cannot call addChild on a primitive type Task.instantiatesUri");
5097        }
5098        else if (name.equals("basedOn")) {
5099          return addBasedOn();
5100        }
5101        else if (name.equals("groupIdentifier")) {
5102          this.groupIdentifier = new Identifier();
5103          return this.groupIdentifier;
5104        }
5105        else if (name.equals("partOf")) {
5106          return addPartOf();
5107        }
5108        else if (name.equals("status")) {
5109          throw new FHIRException("Cannot call addChild on a primitive type Task.status");
5110        }
5111        else if (name.equals("statusReason")) {
5112          this.statusReason = new CodeableConcept();
5113          return this.statusReason;
5114        }
5115        else if (name.equals("businessStatus")) {
5116          this.businessStatus = new CodeableConcept();
5117          return this.businessStatus;
5118        }
5119        else if (name.equals("intent")) {
5120          throw new FHIRException("Cannot call addChild on a primitive type Task.intent");
5121        }
5122        else if (name.equals("priority")) {
5123          throw new FHIRException("Cannot call addChild on a primitive type Task.priority");
5124        }
5125        else if (name.equals("code")) {
5126          this.code = new CodeableConcept();
5127          return this.code;
5128        }
5129        else if (name.equals("description")) {
5130          throw new FHIRException("Cannot call addChild on a primitive type Task.description");
5131        }
5132        else if (name.equals("focus")) {
5133          this.focus = new Reference();
5134          return this.focus;
5135        }
5136        else if (name.equals("for")) {
5137          this.for_ = new Reference();
5138          return this.for_;
5139        }
5140        else if (name.equals("encounter")) {
5141          this.encounter = new Reference();
5142          return this.encounter;
5143        }
5144        else if (name.equals("executionPeriod")) {
5145          this.executionPeriod = new Period();
5146          return this.executionPeriod;
5147        }
5148        else if (name.equals("authoredOn")) {
5149          throw new FHIRException("Cannot call addChild on a primitive type Task.authoredOn");
5150        }
5151        else if (name.equals("lastModified")) {
5152          throw new FHIRException("Cannot call addChild on a primitive type Task.lastModified");
5153        }
5154        else if (name.equals("requester")) {
5155          this.requester = new Reference();
5156          return this.requester;
5157        }
5158        else if (name.equals("performerType")) {
5159          return addPerformerType();
5160        }
5161        else if (name.equals("owner")) {
5162          this.owner = new Reference();
5163          return this.owner;
5164        }
5165        else if (name.equals("location")) {
5166          this.location = new Reference();
5167          return this.location;
5168        }
5169        else if (name.equals("reasonCode")) {
5170          this.reasonCode = new CodeableConcept();
5171          return this.reasonCode;
5172        }
5173        else if (name.equals("reasonReference")) {
5174          this.reasonReference = new Reference();
5175          return this.reasonReference;
5176        }
5177        else if (name.equals("insurance")) {
5178          return addInsurance();
5179        }
5180        else if (name.equals("note")) {
5181          return addNote();
5182        }
5183        else if (name.equals("relevantHistory")) {
5184          return addRelevantHistory();
5185        }
5186        else if (name.equals("restriction")) {
5187          this.restriction = new TaskRestrictionComponent();
5188          return this.restriction;
5189        }
5190        else if (name.equals("input")) {
5191          return addInput();
5192        }
5193        else if (name.equals("output")) {
5194          return addOutput();
5195        }
5196        else
5197          return super.addChild(name);
5198      }
5199
5200  public String fhirType() {
5201    return "Task";
5202
5203  }
5204
5205      public Task copy() {
5206        Task dst = new Task();
5207        copyValues(dst);
5208        return dst;
5209      }
5210
5211      public void copyValues(Task dst) {
5212        super.copyValues(dst);
5213        if (identifier != null) {
5214          dst.identifier = new ArrayList<Identifier>();
5215          for (Identifier i : identifier)
5216            dst.identifier.add(i.copy());
5217        };
5218        dst.instantiatesCanonical = instantiatesCanonical == null ? null : instantiatesCanonical.copy();
5219        dst.instantiatesUri = instantiatesUri == null ? null : instantiatesUri.copy();
5220        if (basedOn != null) {
5221          dst.basedOn = new ArrayList<Reference>();
5222          for (Reference i : basedOn)
5223            dst.basedOn.add(i.copy());
5224        };
5225        dst.groupIdentifier = groupIdentifier == null ? null : groupIdentifier.copy();
5226        if (partOf != null) {
5227          dst.partOf = new ArrayList<Reference>();
5228          for (Reference i : partOf)
5229            dst.partOf.add(i.copy());
5230        };
5231        dst.status = status == null ? null : status.copy();
5232        dst.statusReason = statusReason == null ? null : statusReason.copy();
5233        dst.businessStatus = businessStatus == null ? null : businessStatus.copy();
5234        dst.intent = intent == null ? null : intent.copy();
5235        dst.priority = priority == null ? null : priority.copy();
5236        dst.code = code == null ? null : code.copy();
5237        dst.description = description == null ? null : description.copy();
5238        dst.focus = focus == null ? null : focus.copy();
5239        dst.for_ = for_ == null ? null : for_.copy();
5240        dst.encounter = encounter == null ? null : encounter.copy();
5241        dst.executionPeriod = executionPeriod == null ? null : executionPeriod.copy();
5242        dst.authoredOn = authoredOn == null ? null : authoredOn.copy();
5243        dst.lastModified = lastModified == null ? null : lastModified.copy();
5244        dst.requester = requester == null ? null : requester.copy();
5245        if (performerType != null) {
5246          dst.performerType = new ArrayList<CodeableConcept>();
5247          for (CodeableConcept i : performerType)
5248            dst.performerType.add(i.copy());
5249        };
5250        dst.owner = owner == null ? null : owner.copy();
5251        dst.location = location == null ? null : location.copy();
5252        dst.reasonCode = reasonCode == null ? null : reasonCode.copy();
5253        dst.reasonReference = reasonReference == null ? null : reasonReference.copy();
5254        if (insurance != null) {
5255          dst.insurance = new ArrayList<Reference>();
5256          for (Reference i : insurance)
5257            dst.insurance.add(i.copy());
5258        };
5259        if (note != null) {
5260          dst.note = new ArrayList<Annotation>();
5261          for (Annotation i : note)
5262            dst.note.add(i.copy());
5263        };
5264        if (relevantHistory != null) {
5265          dst.relevantHistory = new ArrayList<Reference>();
5266          for (Reference i : relevantHistory)
5267            dst.relevantHistory.add(i.copy());
5268        };
5269        dst.restriction = restriction == null ? null : restriction.copy();
5270        if (input != null) {
5271          dst.input = new ArrayList<ParameterComponent>();
5272          for (ParameterComponent i : input)
5273            dst.input.add(i.copy());
5274        };
5275        if (output != null) {
5276          dst.output = new ArrayList<TaskOutputComponent>();
5277          for (TaskOutputComponent i : output)
5278            dst.output.add(i.copy());
5279        };
5280      }
5281
5282      protected Task typedCopy() {
5283        return copy();
5284      }
5285
5286      @Override
5287      public boolean equalsDeep(Base other_) {
5288        if (!super.equalsDeep(other_))
5289          return false;
5290        if (!(other_ instanceof Task))
5291          return false;
5292        Task o = (Task) other_;
5293        return compareDeep(identifier, o.identifier, true) && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
5294           && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(basedOn, o.basedOn, true)
5295           && compareDeep(groupIdentifier, o.groupIdentifier, true) && compareDeep(partOf, o.partOf, true)
5296           && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true) && compareDeep(businessStatus, o.businessStatus, true)
5297           && compareDeep(intent, o.intent, true) && compareDeep(priority, o.priority, true) && compareDeep(code, o.code, true)
5298           && compareDeep(description, o.description, true) && compareDeep(focus, o.focus, true) && compareDeep(for_, o.for_, true)
5299           && compareDeep(encounter, o.encounter, true) && compareDeep(executionPeriod, o.executionPeriod, true)
5300           && compareDeep(authoredOn, o.authoredOn, true) && compareDeep(lastModified, o.lastModified, true)
5301           && compareDeep(requester, o.requester, true) && compareDeep(performerType, o.performerType, true)
5302           && compareDeep(owner, o.owner, true) && compareDeep(location, o.location, true) && compareDeep(reasonCode, o.reasonCode, true)
5303           && compareDeep(reasonReference, o.reasonReference, true) && compareDeep(insurance, o.insurance, true)
5304           && compareDeep(note, o.note, true) && compareDeep(relevantHistory, o.relevantHistory, true) && compareDeep(restriction, o.restriction, true)
5305           && compareDeep(input, o.input, true) && compareDeep(output, o.output, true);
5306      }
5307
5308      @Override
5309      public boolean equalsShallow(Base other_) {
5310        if (!super.equalsShallow(other_))
5311          return false;
5312        if (!(other_ instanceof Task))
5313          return false;
5314        Task o = (Task) other_;
5315        return compareValues(instantiatesCanonical, o.instantiatesCanonical, true) && compareValues(instantiatesUri, o.instantiatesUri, true)
5316           && compareValues(status, o.status, true) && compareValues(intent, o.intent, true) && compareValues(priority, o.priority, true)
5317           && compareValues(description, o.description, true) && compareValues(authoredOn, o.authoredOn, true)
5318           && compareValues(lastModified, o.lastModified, true);
5319      }
5320
5321      public boolean isEmpty() {
5322        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, instantiatesCanonical
5323          , instantiatesUri, basedOn, groupIdentifier, partOf, status, statusReason, businessStatus
5324          , intent, priority, code, description, focus, for_, encounter, executionPeriod
5325          , authoredOn, lastModified, requester, performerType, owner, location, reasonCode
5326          , reasonReference, insurance, note, relevantHistory, restriction, input, output
5327          );
5328      }
5329
5330  @Override
5331  public ResourceType getResourceType() {
5332    return ResourceType.Task;
5333   }
5334
5335 /**
5336   * Search parameter: <b>authored-on</b>
5337   * <p>
5338   * Description: <b>Search by creation date</b><br>
5339   * Type: <b>date</b><br>
5340   * Path: <b>Task.authoredOn</b><br>
5341   * </p>
5342   */
5343  @SearchParamDefinition(name="authored-on", path="Task.authoredOn", description="Search by creation date", type="date" )
5344  public static final String SP_AUTHORED_ON = "authored-on";
5345 /**
5346   * <b>Fluent Client</b> search parameter constant for <b>authored-on</b>
5347   * <p>
5348   * Description: <b>Search by creation date</b><br>
5349   * Type: <b>date</b><br>
5350   * Path: <b>Task.authoredOn</b><br>
5351   * </p>
5352   */
5353  public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORED_ON = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORED_ON);
5354
5355 /**
5356   * Search parameter: <b>based-on</b>
5357   * <p>
5358   * Description: <b>Search by requests this task is based on</b><br>
5359   * Type: <b>reference</b><br>
5360   * Path: <b>Task.basedOn</b><br>
5361   * </p>
5362   */
5363  @SearchParamDefinition(name="based-on", path="Task.basedOn", description="Search by requests this task is based on", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, CatalogEntry.class, ChargeItem.class, ChargeItemDefinition.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseIssue.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceMetric.class, DeviceRequest.class, DeviceUseStatement.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, Topic.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
5364  public static final String SP_BASED_ON = "based-on";
5365 /**
5366   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
5367   * <p>
5368   * Description: <b>Search by requests this task is based on</b><br>
5369   * Type: <b>reference</b><br>
5370   * Path: <b>Task.basedOn</b><br>
5371   * </p>
5372   */
5373  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
5374
5375/**
5376   * Constant for fluent queries to be used to add include statements. Specifies
5377   * the path value of "<b>Task:based-on</b>".
5378   */
5379  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("Task:based-on").toLocked();
5380
5381 /**
5382   * Search parameter: <b>business-status</b>
5383   * <p>
5384   * Description: <b>Search by business status</b><br>
5385   * Type: <b>token</b><br>
5386   * Path: <b>Task.businessStatus</b><br>
5387   * </p>
5388   */
5389  @SearchParamDefinition(name="business-status", path="Task.businessStatus", description="Search by business status", type="token" )
5390  public static final String SP_BUSINESS_STATUS = "business-status";
5391 /**
5392   * <b>Fluent Client</b> search parameter constant for <b>business-status</b>
5393   * <p>
5394   * Description: <b>Search by business status</b><br>
5395   * Type: <b>token</b><br>
5396   * Path: <b>Task.businessStatus</b><br>
5397   * </p>
5398   */
5399  public static final ca.uhn.fhir.rest.gclient.TokenClientParam BUSINESS_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BUSINESS_STATUS);
5400
5401 /**
5402   * Search parameter: <b>code</b>
5403   * <p>
5404   * Description: <b>Search by task code</b><br>
5405   * Type: <b>token</b><br>
5406   * Path: <b>Task.code</b><br>
5407   * </p>
5408   */
5409  @SearchParamDefinition(name="code", path="Task.code", description="Search by task code", type="token" )
5410  public static final String SP_CODE = "code";
5411 /**
5412   * <b>Fluent Client</b> search parameter constant for <b>code</b>
5413   * <p>
5414   * Description: <b>Search by task code</b><br>
5415   * Type: <b>token</b><br>
5416   * Path: <b>Task.code</b><br>
5417   * </p>
5418   */
5419  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
5420
5421 /**
5422   * Search parameter: <b>encounter</b>
5423   * <p>
5424   * Description: <b>Search by encounter</b><br>
5425   * Type: <b>reference</b><br>
5426   * Path: <b>Task.encounter</b><br>
5427   * </p>
5428   */
5429  @SearchParamDefinition(name="encounter", path="Task.encounter", description="Search by encounter", type="reference", target={Encounter.class } )
5430  public static final String SP_ENCOUNTER = "encounter";
5431 /**
5432   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
5433   * <p>
5434   * Description: <b>Search by encounter</b><br>
5435   * Type: <b>reference</b><br>
5436   * Path: <b>Task.encounter</b><br>
5437   * </p>
5438   */
5439  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
5440
5441/**
5442   * Constant for fluent queries to be used to add include statements. Specifies
5443   * the path value of "<b>Task:encounter</b>".
5444   */
5445  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Task:encounter").toLocked();
5446
5447 /**
5448   * Search parameter: <b>focus</b>
5449   * <p>
5450   * Description: <b>Search by task focus</b><br>
5451   * Type: <b>reference</b><br>
5452   * Path: <b>Task.focus</b><br>
5453   * </p>
5454   */
5455  @SearchParamDefinition(name="focus", path="Task.focus", description="Search by task focus", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, CatalogEntry.class, ChargeItem.class, ChargeItemDefinition.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseIssue.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceMetric.class, DeviceRequest.class, DeviceUseStatement.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, Topic.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
5456  public static final String SP_FOCUS = "focus";
5457 /**
5458   * <b>Fluent Client</b> search parameter constant for <b>focus</b>
5459   * <p>
5460   * Description: <b>Search by task focus</b><br>
5461   * Type: <b>reference</b><br>
5462   * Path: <b>Task.focus</b><br>
5463   * </p>
5464   */
5465  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FOCUS = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FOCUS);
5466
5467/**
5468   * Constant for fluent queries to be used to add include statements. Specifies
5469   * the path value of "<b>Task:focus</b>".
5470   */
5471  public static final ca.uhn.fhir.model.api.Include INCLUDE_FOCUS = new ca.uhn.fhir.model.api.Include("Task:focus").toLocked();
5472
5473 /**
5474   * Search parameter: <b>group-identifier</b>
5475   * <p>
5476   * Description: <b>Search by group identifier</b><br>
5477   * Type: <b>token</b><br>
5478   * Path: <b>Task.groupIdentifier</b><br>
5479   * </p>
5480   */
5481  @SearchParamDefinition(name="group-identifier", path="Task.groupIdentifier", description="Search by group identifier", type="token" )
5482  public static final String SP_GROUP_IDENTIFIER = "group-identifier";
5483 /**
5484   * <b>Fluent Client</b> search parameter constant for <b>group-identifier</b>
5485   * <p>
5486   * Description: <b>Search by group identifier</b><br>
5487   * Type: <b>token</b><br>
5488   * Path: <b>Task.groupIdentifier</b><br>
5489   * </p>
5490   */
5491  public static final ca.uhn.fhir.rest.gclient.TokenClientParam GROUP_IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GROUP_IDENTIFIER);
5492
5493 /**
5494   * Search parameter: <b>identifier</b>
5495   * <p>
5496   * Description: <b>Search for a task instance by its business identifier</b><br>
5497   * Type: <b>token</b><br>
5498   * Path: <b>Task.identifier</b><br>
5499   * </p>
5500   */
5501  @SearchParamDefinition(name="identifier", path="Task.identifier", description="Search for a task instance by its business identifier", type="token" )
5502  public static final String SP_IDENTIFIER = "identifier";
5503 /**
5504   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
5505   * <p>
5506   * Description: <b>Search for a task instance by its business identifier</b><br>
5507   * Type: <b>token</b><br>
5508   * Path: <b>Task.identifier</b><br>
5509   * </p>
5510   */
5511  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
5512
5513 /**
5514   * Search parameter: <b>intent</b>
5515   * <p>
5516   * Description: <b>Search by task intent</b><br>
5517   * Type: <b>token</b><br>
5518   * Path: <b>Task.intent</b><br>
5519   * </p>
5520   */
5521  @SearchParamDefinition(name="intent", path="Task.intent", description="Search by task intent", type="token" )
5522  public static final String SP_INTENT = "intent";
5523 /**
5524   * <b>Fluent Client</b> search parameter constant for <b>intent</b>
5525   * <p>
5526   * Description: <b>Search by task intent</b><br>
5527   * Type: <b>token</b><br>
5528   * Path: <b>Task.intent</b><br>
5529   * </p>
5530   */
5531  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INTENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INTENT);
5532
5533 /**
5534   * Search parameter: <b>modified</b>
5535   * <p>
5536   * Description: <b>Search by last modification date</b><br>
5537   * Type: <b>date</b><br>
5538   * Path: <b>Task.lastModified</b><br>
5539   * </p>
5540   */
5541  @SearchParamDefinition(name="modified", path="Task.lastModified", description="Search by last modification date", type="date" )
5542  public static final String SP_MODIFIED = "modified";
5543 /**
5544   * <b>Fluent Client</b> search parameter constant for <b>modified</b>
5545   * <p>
5546   * Description: <b>Search by last modification date</b><br>
5547   * Type: <b>date</b><br>
5548   * Path: <b>Task.lastModified</b><br>
5549   * </p>
5550   */
5551  public static final ca.uhn.fhir.rest.gclient.DateClientParam MODIFIED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_MODIFIED);
5552
5553 /**
5554   * Search parameter: <b>owner</b>
5555   * <p>
5556   * Description: <b>Search by task owner</b><br>
5557   * Type: <b>reference</b><br>
5558   * Path: <b>Task.owner</b><br>
5559   * </p>
5560   */
5561  @SearchParamDefinition(name="owner", path="Task.owner", description="Search by task owner", type="reference", target={CareTeam.class, Device.class, HealthcareService.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
5562  public static final String SP_OWNER = "owner";
5563 /**
5564   * <b>Fluent Client</b> search parameter constant for <b>owner</b>
5565   * <p>
5566   * Description: <b>Search by task owner</b><br>
5567   * Type: <b>reference</b><br>
5568   * Path: <b>Task.owner</b><br>
5569   * </p>
5570   */
5571  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam OWNER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_OWNER);
5572
5573/**
5574   * Constant for fluent queries to be used to add include statements. Specifies
5575   * the path value of "<b>Task:owner</b>".
5576   */
5577  public static final ca.uhn.fhir.model.api.Include INCLUDE_OWNER = new ca.uhn.fhir.model.api.Include("Task:owner").toLocked();
5578
5579 /**
5580   * Search parameter: <b>part-of</b>
5581   * <p>
5582   * Description: <b>Search by task this task is part of</b><br>
5583   * Type: <b>reference</b><br>
5584   * Path: <b>Task.partOf</b><br>
5585   * </p>
5586   */
5587  @SearchParamDefinition(name="part-of", path="Task.partOf", description="Search by task this task is part of", type="reference", target={Task.class } )
5588  public static final String SP_PART_OF = "part-of";
5589 /**
5590   * <b>Fluent Client</b> search parameter constant for <b>part-of</b>
5591   * <p>
5592   * Description: <b>Search by task this task is part of</b><br>
5593   * Type: <b>reference</b><br>
5594   * Path: <b>Task.partOf</b><br>
5595   * </p>
5596   */
5597  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF);
5598
5599/**
5600   * Constant for fluent queries to be used to add include statements. Specifies
5601   * the path value of "<b>Task:part-of</b>".
5602   */
5603  public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("Task:part-of").toLocked();
5604
5605 /**
5606   * Search parameter: <b>patient</b>
5607   * <p>
5608   * Description: <b>Search by patient</b><br>
5609   * Type: <b>reference</b><br>
5610   * Path: <b>Task.for.where(resolve() is Patient)</b><br>
5611   * </p>
5612   */
5613  @SearchParamDefinition(name="patient", path="Task.for.where(resolve() is Patient)", description="Search by patient", type="reference", target={Patient.class } )
5614  public static final String SP_PATIENT = "patient";
5615 /**
5616   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
5617   * <p>
5618   * Description: <b>Search by patient</b><br>
5619   * Type: <b>reference</b><br>
5620   * Path: <b>Task.for.where(resolve() is Patient)</b><br>
5621   * </p>
5622   */
5623  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
5624
5625/**
5626   * Constant for fluent queries to be used to add include statements. Specifies
5627   * the path value of "<b>Task:patient</b>".
5628   */
5629  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Task:patient").toLocked();
5630
5631 /**
5632   * Search parameter: <b>performer</b>
5633   * <p>
5634   * Description: <b>Search by recommended type of performer (e.g., Requester, Performer, Scheduler).</b><br>
5635   * Type: <b>token</b><br>
5636   * Path: <b>Task.performerType</b><br>
5637   * </p>
5638   */
5639  @SearchParamDefinition(name="performer", path="Task.performerType", description="Search by recommended type of performer (e.g., Requester, Performer, Scheduler).", type="token" )
5640  public static final String SP_PERFORMER = "performer";
5641 /**
5642   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
5643   * <p>
5644   * Description: <b>Search by recommended type of performer (e.g., Requester, Performer, Scheduler).</b><br>
5645   * Type: <b>token</b><br>
5646   * Path: <b>Task.performerType</b><br>
5647   * </p>
5648   */
5649  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PERFORMER);
5650
5651 /**
5652   * Search parameter: <b>period</b>
5653   * <p>
5654   * Description: <b>Search by period Task is/was underway</b><br>
5655   * Type: <b>date</b><br>
5656   * Path: <b>Task.executionPeriod</b><br>
5657   * </p>
5658   */
5659  @SearchParamDefinition(name="period", path="Task.executionPeriod", description="Search by period Task is/was underway", type="date" )
5660  public static final String SP_PERIOD = "period";
5661 /**
5662   * <b>Fluent Client</b> search parameter constant for <b>period</b>
5663   * <p>
5664   * Description: <b>Search by period Task is/was underway</b><br>
5665   * Type: <b>date</b><br>
5666   * Path: <b>Task.executionPeriod</b><br>
5667   * </p>
5668   */
5669  public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD);
5670
5671 /**
5672   * Search parameter: <b>priority</b>
5673   * <p>
5674   * Description: <b>Search by task priority</b><br>
5675   * Type: <b>token</b><br>
5676   * Path: <b>Task.priority</b><br>
5677   * </p>
5678   */
5679  @SearchParamDefinition(name="priority", path="Task.priority", description="Search by task priority", type="token" )
5680  public static final String SP_PRIORITY = "priority";
5681 /**
5682   * <b>Fluent Client</b> search parameter constant for <b>priority</b>
5683   * <p>
5684   * Description: <b>Search by task priority</b><br>
5685   * Type: <b>token</b><br>
5686   * Path: <b>Task.priority</b><br>
5687   * </p>
5688   */
5689  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY);
5690
5691 /**
5692   * Search parameter: <b>requester</b>
5693   * <p>
5694   * Description: <b>Search by task requester</b><br>
5695   * Type: <b>reference</b><br>
5696   * Path: <b>Task.requester</b><br>
5697   * </p>
5698   */
5699  @SearchParamDefinition(name="requester", path="Task.requester", description="Search by task requester", type="reference", target={Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
5700  public static final String SP_REQUESTER = "requester";
5701 /**
5702   * <b>Fluent Client</b> search parameter constant for <b>requester</b>
5703   * <p>
5704   * Description: <b>Search by task requester</b><br>
5705   * Type: <b>reference</b><br>
5706   * Path: <b>Task.requester</b><br>
5707   * </p>
5708   */
5709  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER);
5710
5711/**
5712   * Constant for fluent queries to be used to add include statements. Specifies
5713   * the path value of "<b>Task:requester</b>".
5714   */
5715  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTER = new ca.uhn.fhir.model.api.Include("Task:requester").toLocked();
5716
5717 /**
5718   * Search parameter: <b>status</b>
5719   * <p>
5720   * Description: <b>Search by task status</b><br>
5721   * Type: <b>token</b><br>
5722   * Path: <b>Task.status</b><br>
5723   * </p>
5724   */
5725  @SearchParamDefinition(name="status", path="Task.status", description="Search by task status", type="token" )
5726  public static final String SP_STATUS = "status";
5727 /**
5728   * <b>Fluent Client</b> search parameter constant for <b>status</b>
5729   * <p>
5730   * Description: <b>Search by task status</b><br>
5731   * Type: <b>token</b><br>
5732   * Path: <b>Task.status</b><br>
5733   * </p>
5734   */
5735  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
5736
5737 /**
5738   * Search parameter: <b>subject</b>
5739   * <p>
5740   * Description: <b>Search by subject</b><br>
5741   * Type: <b>reference</b><br>
5742   * Path: <b>Task.for</b><br>
5743   * </p>
5744   */
5745  @SearchParamDefinition(name="subject", path="Task.for", description="Search by subject", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, CatalogEntry.class, ChargeItem.class, ChargeItemDefinition.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseIssue.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceMetric.class, DeviceRequest.class, DeviceUseStatement.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, Topic.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
5746  public static final String SP_SUBJECT = "subject";
5747 /**
5748   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
5749   * <p>
5750   * Description: <b>Search by subject</b><br>
5751   * Type: <b>reference</b><br>
5752   * Path: <b>Task.for</b><br>
5753   * </p>
5754   */
5755  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
5756
5757/**
5758   * Constant for fluent queries to be used to add include statements. Specifies
5759   * the path value of "<b>Task:subject</b>".
5760   */
5761  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Task:subject").toLocked();
5762
5763
5764}
5765