001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import ca.uhn.fhir.model.api.annotation.ResourceDef;
038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
039import ca.uhn.fhir.model.api.annotation.Child;
040import ca.uhn.fhir.model.api.annotation.ChildOrder;
041import ca.uhn.fhir.model.api.annotation.Description;
042import ca.uhn.fhir.model.api.annotation.Block;
043import org.hl7.fhir.instance.model.api.*;
044import org.hl7.fhir.exceptions.FHIRException;
045/**
046 * A task to be performed.
047 */
048@ResourceDef(name="Task", profile="http://hl7.org/fhir/Profile/Task")
049public class Task extends DomainResource {
050
051    public enum TaskStatus {
052        /**
053         * The task is not yet ready to be acted upon.
054         */
055        DRAFT, 
056        /**
057         * The task is ready to be acted upon and action is sought.
058         */
059        REQUESTED, 
060        /**
061         * A potential performer has claimed ownership of the task and is evaluating whether to perform it.
062         */
063        RECEIVED, 
064        /**
065         * The potential performer has agreed to execute the task but has not yet started work.
066         */
067        ACCEPTED, 
068        /**
069         * The potential performer who claimed ownership of the task has decided not to execute it prior to performing any action.
070         */
071        REJECTED, 
072        /**
073         * 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.
074         */
075        READY, 
076        /**
077         * The task was not completed.
078         */
079        CANCELLED, 
080        /**
081         * The task has been started but is not yet complete.
082         */
083        INPROGRESS, 
084        /**
085         * The task has been started but work has been paused.
086         */
087        ONHOLD, 
088        /**
089         * The task was attempted but could not be completed due to some error.
090         */
091        FAILED, 
092        /**
093         * The task has been completed.
094         */
095        COMPLETED, 
096        /**
097         * The task should never have existed and is retained only because of the possibility it may have used.
098         */
099        ENTEREDINERROR, 
100        /**
101         * added to help the parsers with the generic types
102         */
103        NULL;
104        public static TaskStatus fromCode(String codeString) throws FHIRException {
105            if (codeString == null || "".equals(codeString))
106                return null;
107        if ("draft".equals(codeString))
108          return DRAFT;
109        if ("requested".equals(codeString))
110          return REQUESTED;
111        if ("received".equals(codeString))
112          return RECEIVED;
113        if ("accepted".equals(codeString))
114          return ACCEPTED;
115        if ("rejected".equals(codeString))
116          return REJECTED;
117        if ("ready".equals(codeString))
118          return READY;
119        if ("cancelled".equals(codeString))
120          return CANCELLED;
121        if ("in-progress".equals(codeString))
122          return INPROGRESS;
123        if ("on-hold".equals(codeString))
124          return ONHOLD;
125        if ("failed".equals(codeString))
126          return FAILED;
127        if ("completed".equals(codeString))
128          return COMPLETED;
129        if ("entered-in-error".equals(codeString))
130          return ENTEREDINERROR;
131        if (Configuration.isAcceptInvalidEnums())
132          return null;
133        else
134          throw new FHIRException("Unknown TaskStatus code '"+codeString+"'");
135        }
136        public String toCode() {
137          switch (this) {
138            case DRAFT: return "draft";
139            case REQUESTED: return "requested";
140            case RECEIVED: return "received";
141            case ACCEPTED: return "accepted";
142            case REJECTED: return "rejected";
143            case READY: return "ready";
144            case CANCELLED: return "cancelled";
145            case INPROGRESS: return "in-progress";
146            case ONHOLD: return "on-hold";
147            case FAILED: return "failed";
148            case COMPLETED: return "completed";
149            case ENTEREDINERROR: return "entered-in-error";
150            default: return "?";
151          }
152        }
153        public String getSystem() {
154          switch (this) {
155            case DRAFT: return "http://hl7.org/fhir/task-status";
156            case REQUESTED: return "http://hl7.org/fhir/task-status";
157            case RECEIVED: return "http://hl7.org/fhir/task-status";
158            case ACCEPTED: return "http://hl7.org/fhir/task-status";
159            case REJECTED: return "http://hl7.org/fhir/task-status";
160            case READY: return "http://hl7.org/fhir/task-status";
161            case CANCELLED: return "http://hl7.org/fhir/task-status";
162            case INPROGRESS: return "http://hl7.org/fhir/task-status";
163            case ONHOLD: return "http://hl7.org/fhir/task-status";
164            case FAILED: return "http://hl7.org/fhir/task-status";
165            case COMPLETED: return "http://hl7.org/fhir/task-status";
166            case ENTEREDINERROR: return "http://hl7.org/fhir/task-status";
167            default: return "?";
168          }
169        }
170        public String getDefinition() {
171          switch (this) {
172            case DRAFT: return "The task is not yet ready to be acted upon.";
173            case REQUESTED: return "The task is ready to be acted upon and action is sought.";
174            case RECEIVED: return "A potential performer has claimed ownership of the task and is evaluating whether to perform it.";
175            case ACCEPTED: return "The potential performer has agreed to execute the task but has not yet started work.";
176            case REJECTED: return "The potential performer who claimed ownership of the task has decided not to execute it prior to performing any action.";
177            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.";
178            case CANCELLED: return "The task was not completed.";
179            case INPROGRESS: return "The task has been started but is not yet complete.";
180            case ONHOLD: return "The task has been started but work has been paused.";
181            case FAILED: return "The task was attempted but could not be completed due to some error.";
182            case COMPLETED: return "The task has been completed.";
183            case ENTEREDINERROR: return "The task should never have existed and is retained only because of the possibility it may have used.";
184            default: return "?";
185          }
186        }
187        public String getDisplay() {
188          switch (this) {
189            case DRAFT: return "Draft";
190            case REQUESTED: return "Requested";
191            case RECEIVED: return "Received";
192            case ACCEPTED: return "Accepted";
193            case REJECTED: return "Rejected";
194            case READY: return "Ready";
195            case CANCELLED: return "Cancelled";
196            case INPROGRESS: return "In Progress";
197            case ONHOLD: return "On Hold";
198            case FAILED: return "Failed";
199            case COMPLETED: return "Completed";
200            case ENTEREDINERROR: return "Entered in Error";
201            default: return "?";
202          }
203        }
204    }
205
206  public static class TaskStatusEnumFactory implements EnumFactory<TaskStatus> {
207    public TaskStatus fromCode(String codeString) throws IllegalArgumentException {
208      if (codeString == null || "".equals(codeString))
209            if (codeString == null || "".equals(codeString))
210                return null;
211        if ("draft".equals(codeString))
212          return TaskStatus.DRAFT;
213        if ("requested".equals(codeString))
214          return TaskStatus.REQUESTED;
215        if ("received".equals(codeString))
216          return TaskStatus.RECEIVED;
217        if ("accepted".equals(codeString))
218          return TaskStatus.ACCEPTED;
219        if ("rejected".equals(codeString))
220          return TaskStatus.REJECTED;
221        if ("ready".equals(codeString))
222          return TaskStatus.READY;
223        if ("cancelled".equals(codeString))
224          return TaskStatus.CANCELLED;
225        if ("in-progress".equals(codeString))
226          return TaskStatus.INPROGRESS;
227        if ("on-hold".equals(codeString))
228          return TaskStatus.ONHOLD;
229        if ("failed".equals(codeString))
230          return TaskStatus.FAILED;
231        if ("completed".equals(codeString))
232          return TaskStatus.COMPLETED;
233        if ("entered-in-error".equals(codeString))
234          return TaskStatus.ENTEREDINERROR;
235        throw new IllegalArgumentException("Unknown TaskStatus code '"+codeString+"'");
236        }
237        public Enumeration<TaskStatus> fromType(Base code) throws FHIRException {
238          if (code == null)
239            return null;
240          if (code.isEmpty())
241            return new Enumeration<TaskStatus>(this);
242          String codeString = ((PrimitiveType) code).asStringValue();
243          if (codeString == null || "".equals(codeString))
244            return null;
245        if ("draft".equals(codeString))
246          return new Enumeration<TaskStatus>(this, TaskStatus.DRAFT);
247        if ("requested".equals(codeString))
248          return new Enumeration<TaskStatus>(this, TaskStatus.REQUESTED);
249        if ("received".equals(codeString))
250          return new Enumeration<TaskStatus>(this, TaskStatus.RECEIVED);
251        if ("accepted".equals(codeString))
252          return new Enumeration<TaskStatus>(this, TaskStatus.ACCEPTED);
253        if ("rejected".equals(codeString))
254          return new Enumeration<TaskStatus>(this, TaskStatus.REJECTED);
255        if ("ready".equals(codeString))
256          return new Enumeration<TaskStatus>(this, TaskStatus.READY);
257        if ("cancelled".equals(codeString))
258          return new Enumeration<TaskStatus>(this, TaskStatus.CANCELLED);
259        if ("in-progress".equals(codeString))
260          return new Enumeration<TaskStatus>(this, TaskStatus.INPROGRESS);
261        if ("on-hold".equals(codeString))
262          return new Enumeration<TaskStatus>(this, TaskStatus.ONHOLD);
263        if ("failed".equals(codeString))
264          return new Enumeration<TaskStatus>(this, TaskStatus.FAILED);
265        if ("completed".equals(codeString))
266          return new Enumeration<TaskStatus>(this, TaskStatus.COMPLETED);
267        if ("entered-in-error".equals(codeString))
268          return new Enumeration<TaskStatus>(this, TaskStatus.ENTEREDINERROR);
269        throw new FHIRException("Unknown TaskStatus code '"+codeString+"'");
270        }
271    public String toCode(TaskStatus code) {
272      if (code == TaskStatus.DRAFT)
273        return "draft";
274      if (code == TaskStatus.REQUESTED)
275        return "requested";
276      if (code == TaskStatus.RECEIVED)
277        return "received";
278      if (code == TaskStatus.ACCEPTED)
279        return "accepted";
280      if (code == TaskStatus.REJECTED)
281        return "rejected";
282      if (code == TaskStatus.READY)
283        return "ready";
284      if (code == TaskStatus.CANCELLED)
285        return "cancelled";
286      if (code == TaskStatus.INPROGRESS)
287        return "in-progress";
288      if (code == TaskStatus.ONHOLD)
289        return "on-hold";
290      if (code == TaskStatus.FAILED)
291        return "failed";
292      if (code == TaskStatus.COMPLETED)
293        return "completed";
294      if (code == TaskStatus.ENTEREDINERROR)
295        return "entered-in-error";
296      return "?";
297      }
298    public String toSystem(TaskStatus code) {
299      return code.getSystem();
300      }
301    }
302
303    public enum TaskIntent {
304        /**
305         * 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
306         */
307        PROPOSAL, 
308        /**
309         * The request represents an intention to ensure something occurs without providing an authorization for others to act
310         */
311        PLAN, 
312        /**
313         * The request represents a request/demand and authorization for action
314         */
315        ORDER, 
316        /**
317         * The request represents an original authorization for action
318         */
319        ORIGINALORDER, 
320        /**
321         * 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
322         */
323        REFLEXORDER, 
324        /**
325         * 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
326         */
327        FILLERORDER, 
328        /**
329         * 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.
330         */
331        INSTANCEORDER, 
332        /**
333         * 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
334         */
335        OPTION, 
336        /**
337         * added to help the parsers with the generic types
338         */
339        NULL;
340        public static TaskIntent fromCode(String codeString) throws FHIRException {
341            if (codeString == null || "".equals(codeString))
342                return null;
343        if ("proposal".equals(codeString))
344          return PROPOSAL;
345        if ("plan".equals(codeString))
346          return PLAN;
347        if ("order".equals(codeString))
348          return ORDER;
349        if ("original-order".equals(codeString))
350          return ORIGINALORDER;
351        if ("reflex-order".equals(codeString))
352          return REFLEXORDER;
353        if ("filler-order".equals(codeString))
354          return FILLERORDER;
355        if ("instance-order".equals(codeString))
356          return INSTANCEORDER;
357        if ("option".equals(codeString))
358          return OPTION;
359        if (Configuration.isAcceptInvalidEnums())
360          return null;
361        else
362          throw new FHIRException("Unknown TaskIntent code '"+codeString+"'");
363        }
364        public String toCode() {
365          switch (this) {
366            case PROPOSAL: return "proposal";
367            case PLAN: return "plan";
368            case ORDER: return "order";
369            case ORIGINALORDER: return "original-order";
370            case REFLEXORDER: return "reflex-order";
371            case FILLERORDER: return "filler-order";
372            case INSTANCEORDER: return "instance-order";
373            case OPTION: return "option";
374            default: return "?";
375          }
376        }
377        public String getSystem() {
378          switch (this) {
379            case PROPOSAL: return "http://hl7.org/fhir/request-intent";
380            case PLAN: return "http://hl7.org/fhir/request-intent";
381            case ORDER: return "http://hl7.org/fhir/request-intent";
382            case ORIGINALORDER: return "http://hl7.org/fhir/request-intent";
383            case REFLEXORDER: return "http://hl7.org/fhir/request-intent";
384            case FILLERORDER: return "http://hl7.org/fhir/request-intent";
385            case INSTANCEORDER: return "http://hl7.org/fhir/request-intent";
386            case OPTION: return "http://hl7.org/fhir/request-intent";
387            default: return "?";
388          }
389        }
390        public String getDefinition() {
391          switch (this) {
392            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";
393            case PLAN: return "The request represents an intention to ensure something occurs without providing an authorization for others to act";
394            case ORDER: return "The request represents a request/demand and authorization for action";
395            case ORIGINALORDER: return "The request represents an original authorization for action";
396            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";
397            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";
398            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.";
399            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";
400            default: return "?";
401          }
402        }
403        public String getDisplay() {
404          switch (this) {
405            case PROPOSAL: return "Proposal";
406            case PLAN: return "Plan";
407            case ORDER: return "Order";
408            case ORIGINALORDER: return "Original Order";
409            case REFLEXORDER: return "Reflex Order";
410            case FILLERORDER: return "Filler Order";
411            case INSTANCEORDER: return "Instance Order";
412            case OPTION: return "Option";
413            default: return "?";
414          }
415        }
416    }
417
418  public static class TaskIntentEnumFactory implements EnumFactory<TaskIntent> {
419    public TaskIntent fromCode(String codeString) throws IllegalArgumentException {
420      if (codeString == null || "".equals(codeString))
421            if (codeString == null || "".equals(codeString))
422                return null;
423        if ("proposal".equals(codeString))
424          return TaskIntent.PROPOSAL;
425        if ("plan".equals(codeString))
426          return TaskIntent.PLAN;
427        if ("order".equals(codeString))
428          return TaskIntent.ORDER;
429        if ("original-order".equals(codeString))
430          return TaskIntent.ORIGINALORDER;
431        if ("reflex-order".equals(codeString))
432          return TaskIntent.REFLEXORDER;
433        if ("filler-order".equals(codeString))
434          return TaskIntent.FILLERORDER;
435        if ("instance-order".equals(codeString))
436          return TaskIntent.INSTANCEORDER;
437        if ("option".equals(codeString))
438          return TaskIntent.OPTION;
439        throw new IllegalArgumentException("Unknown TaskIntent code '"+codeString+"'");
440        }
441        public Enumeration<TaskIntent> fromType(Base code) throws FHIRException {
442          if (code == null)
443            return null;
444          if (code.isEmpty())
445            return new Enumeration<TaskIntent>(this);
446          String codeString = ((PrimitiveType) code).asStringValue();
447          if (codeString == null || "".equals(codeString))
448            return null;
449        if ("proposal".equals(codeString))
450          return new Enumeration<TaskIntent>(this, TaskIntent.PROPOSAL);
451        if ("plan".equals(codeString))
452          return new Enumeration<TaskIntent>(this, TaskIntent.PLAN);
453        if ("order".equals(codeString))
454          return new Enumeration<TaskIntent>(this, TaskIntent.ORDER);
455        if ("original-order".equals(codeString))
456          return new Enumeration<TaskIntent>(this, TaskIntent.ORIGINALORDER);
457        if ("reflex-order".equals(codeString))
458          return new Enumeration<TaskIntent>(this, TaskIntent.REFLEXORDER);
459        if ("filler-order".equals(codeString))
460          return new Enumeration<TaskIntent>(this, TaskIntent.FILLERORDER);
461        if ("instance-order".equals(codeString))
462          return new Enumeration<TaskIntent>(this, TaskIntent.INSTANCEORDER);
463        if ("option".equals(codeString))
464          return new Enumeration<TaskIntent>(this, TaskIntent.OPTION);
465        throw new FHIRException("Unknown TaskIntent code '"+codeString+"'");
466        }
467    public String toCode(TaskIntent code) {
468      if (code == TaskIntent.PROPOSAL)
469        return "proposal";
470      if (code == TaskIntent.PLAN)
471        return "plan";
472      if (code == TaskIntent.ORDER)
473        return "order";
474      if (code == TaskIntent.ORIGINALORDER)
475        return "original-order";
476      if (code == TaskIntent.REFLEXORDER)
477        return "reflex-order";
478      if (code == TaskIntent.FILLERORDER)
479        return "filler-order";
480      if (code == TaskIntent.INSTANCEORDER)
481        return "instance-order";
482      if (code == TaskIntent.OPTION)
483        return "option";
484      return "?";
485      }
486    public String toSystem(TaskIntent code) {
487      return code.getSystem();
488      }
489    }
490
491    public enum TaskPriority {
492        /**
493         * The request has normal priority
494         */
495        ROUTINE, 
496        /**
497         * The request should be actioned promptly - higher priority than routine
498         */
499        URGENT, 
500        /**
501         * The request should be actioned as soon as possible - higher priority than urgent
502         */
503        ASAP, 
504        /**
505         * The request should be actioned immediately - highest possible priority.  E.g. an emergency
506         */
507        STAT, 
508        /**
509         * added to help the parsers with the generic types
510         */
511        NULL;
512        public static TaskPriority fromCode(String codeString) throws FHIRException {
513            if (codeString == null || "".equals(codeString))
514                return null;
515        if ("routine".equals(codeString))
516          return ROUTINE;
517        if ("urgent".equals(codeString))
518          return URGENT;
519        if ("asap".equals(codeString))
520          return ASAP;
521        if ("stat".equals(codeString))
522          return STAT;
523        if (Configuration.isAcceptInvalidEnums())
524          return null;
525        else
526          throw new FHIRException("Unknown TaskPriority code '"+codeString+"'");
527        }
528        public String toCode() {
529          switch (this) {
530            case ROUTINE: return "routine";
531            case URGENT: return "urgent";
532            case ASAP: return "asap";
533            case STAT: return "stat";
534            default: return "?";
535          }
536        }
537        public String getSystem() {
538          switch (this) {
539            case ROUTINE: return "http://hl7.org/fhir/request-priority";
540            case URGENT: return "http://hl7.org/fhir/request-priority";
541            case ASAP: return "http://hl7.org/fhir/request-priority";
542            case STAT: return "http://hl7.org/fhir/request-priority";
543            default: return "?";
544          }
545        }
546        public String getDefinition() {
547          switch (this) {
548            case ROUTINE: return "The request has normal priority";
549            case URGENT: return "The request should be actioned promptly - higher priority than routine";
550            case ASAP: return "The request should be actioned as soon as possible - higher priority than urgent";
551            case STAT: return "The request should be actioned immediately - highest possible priority.  E.g. an emergency";
552            default: return "?";
553          }
554        }
555        public String getDisplay() {
556          switch (this) {
557            case ROUTINE: return "Routine";
558            case URGENT: return "Urgent";
559            case ASAP: return "ASAP";
560            case STAT: return "STAT";
561            default: return "?";
562          }
563        }
564    }
565
566  public static class TaskPriorityEnumFactory implements EnumFactory<TaskPriority> {
567    public TaskPriority fromCode(String codeString) throws IllegalArgumentException {
568      if (codeString == null || "".equals(codeString))
569            if (codeString == null || "".equals(codeString))
570                return null;
571        if ("routine".equals(codeString))
572          return TaskPriority.ROUTINE;
573        if ("urgent".equals(codeString))
574          return TaskPriority.URGENT;
575        if ("asap".equals(codeString))
576          return TaskPriority.ASAP;
577        if ("stat".equals(codeString))
578          return TaskPriority.STAT;
579        throw new IllegalArgumentException("Unknown TaskPriority code '"+codeString+"'");
580        }
581        public Enumeration<TaskPriority> fromType(Base code) throws FHIRException {
582          if (code == null)
583            return null;
584          if (code.isEmpty())
585            return new Enumeration<TaskPriority>(this);
586          String codeString = ((PrimitiveType) code).asStringValue();
587          if (codeString == null || "".equals(codeString))
588            return null;
589        if ("routine".equals(codeString))
590          return new Enumeration<TaskPriority>(this, TaskPriority.ROUTINE);
591        if ("urgent".equals(codeString))
592          return new Enumeration<TaskPriority>(this, TaskPriority.URGENT);
593        if ("asap".equals(codeString))
594          return new Enumeration<TaskPriority>(this, TaskPriority.ASAP);
595        if ("stat".equals(codeString))
596          return new Enumeration<TaskPriority>(this, TaskPriority.STAT);
597        throw new FHIRException("Unknown TaskPriority code '"+codeString+"'");
598        }
599    public String toCode(TaskPriority code) {
600      if (code == TaskPriority.ROUTINE)
601        return "routine";
602      if (code == TaskPriority.URGENT)
603        return "urgent";
604      if (code == TaskPriority.ASAP)
605        return "asap";
606      if (code == TaskPriority.STAT)
607        return "stat";
608      return "?";
609      }
610    public String toSystem(TaskPriority code) {
611      return code.getSystem();
612      }
613    }
614
615    @Block()
616    public static class TaskRestrictionComponent extends BackboneElement implements IBaseBackboneElement {
617        /**
618         * Indicates the number of times the requested action should occur.
619         */
620        @Child(name = "repetitions", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=false)
621        @Description(shortDefinition="How many times to repeat", formalDefinition="Indicates the number of times the requested action should occur." )
622        protected PositiveIntType repetitions;
623
624        /**
625         * Over what time-period is fulfillment sought.
626         */
627        @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false)
628        @Description(shortDefinition="When fulfillment sought", formalDefinition="Over what time-period is fulfillment sought." )
629        protected Period period;
630
631        /**
632         * For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?
633         */
634        @Child(name = "recipient", type = {Patient.class, Practitioner.class, RelatedPerson.class, Group.class, Organization.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
635        @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?" )
636        protected List<Reference> recipient;
637        /**
638         * The actual objects that are the target of the reference (For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?)
639         */
640        protected List<Resource> recipientTarget;
641
642
643        private static final long serialVersionUID = 1503908360L;
644
645    /**
646     * Constructor
647     */
648      public TaskRestrictionComponent() {
649        super();
650      }
651
652        /**
653         * @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
654         */
655        public PositiveIntType getRepetitionsElement() { 
656          if (this.repetitions == null)
657            if (Configuration.errorOnAutoCreate())
658              throw new Error("Attempt to auto-create TaskRestrictionComponent.repetitions");
659            else if (Configuration.doAutoCreate())
660              this.repetitions = new PositiveIntType(); // bb
661          return this.repetitions;
662        }
663
664        public boolean hasRepetitionsElement() { 
665          return this.repetitions != null && !this.repetitions.isEmpty();
666        }
667
668        public boolean hasRepetitions() { 
669          return this.repetitions != null && !this.repetitions.isEmpty();
670        }
671
672        /**
673         * @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
674         */
675        public TaskRestrictionComponent setRepetitionsElement(PositiveIntType value) { 
676          this.repetitions = value;
677          return this;
678        }
679
680        /**
681         * @return Indicates the number of times the requested action should occur.
682         */
683        public int getRepetitions() { 
684          return this.repetitions == null || this.repetitions.isEmpty() ? 0 : this.repetitions.getValue();
685        }
686
687        /**
688         * @param value Indicates the number of times the requested action should occur.
689         */
690        public TaskRestrictionComponent setRepetitions(int value) { 
691            if (this.repetitions == null)
692              this.repetitions = new PositiveIntType();
693            this.repetitions.setValue(value);
694          return this;
695        }
696
697        /**
698         * @return {@link #period} (Over what time-period is fulfillment sought.)
699         */
700        public Period getPeriod() { 
701          if (this.period == null)
702            if (Configuration.errorOnAutoCreate())
703              throw new Error("Attempt to auto-create TaskRestrictionComponent.period");
704            else if (Configuration.doAutoCreate())
705              this.period = new Period(); // cc
706          return this.period;
707        }
708
709        public boolean hasPeriod() { 
710          return this.period != null && !this.period.isEmpty();
711        }
712
713        /**
714         * @param value {@link #period} (Over what time-period is fulfillment sought.)
715         */
716        public TaskRestrictionComponent setPeriod(Period value) { 
717          this.period = value;
718          return this;
719        }
720
721        /**
722         * @return {@link #recipient} (For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?)
723         */
724        public List<Reference> getRecipient() { 
725          if (this.recipient == null)
726            this.recipient = new ArrayList<Reference>();
727          return this.recipient;
728        }
729
730        /**
731         * @return Returns a reference to <code>this</code> for easy method chaining
732         */
733        public TaskRestrictionComponent setRecipient(List<Reference> theRecipient) { 
734          this.recipient = theRecipient;
735          return this;
736        }
737
738        public boolean hasRecipient() { 
739          if (this.recipient == null)
740            return false;
741          for (Reference item : this.recipient)
742            if (!item.isEmpty())
743              return true;
744          return false;
745        }
746
747        public Reference addRecipient() { //3
748          Reference t = new Reference();
749          if (this.recipient == null)
750            this.recipient = new ArrayList<Reference>();
751          this.recipient.add(t);
752          return t;
753        }
754
755        public TaskRestrictionComponent addRecipient(Reference t) { //3
756          if (t == null)
757            return this;
758          if (this.recipient == null)
759            this.recipient = new ArrayList<Reference>();
760          this.recipient.add(t);
761          return this;
762        }
763
764        /**
765         * @return The first repetition of repeating field {@link #recipient}, creating it if it does not already exist
766         */
767        public Reference getRecipientFirstRep() { 
768          if (getRecipient().isEmpty()) {
769            addRecipient();
770          }
771          return getRecipient().get(0);
772        }
773
774        /**
775         * @deprecated Use Reference#setResource(IBaseResource) instead
776         */
777        @Deprecated
778        public List<Resource> getRecipientTarget() { 
779          if (this.recipientTarget == null)
780            this.recipientTarget = new ArrayList<Resource>();
781          return this.recipientTarget;
782        }
783
784        protected void listChildren(List<Property> children) {
785          super.listChildren(children);
786          children.add(new Property("repetitions", "positiveInt", "Indicates the number of times the requested action should occur.", 0, 1, repetitions));
787          children.add(new Property("period", "Period", "Over what time-period is fulfillment sought.", 0, 1, period));
788          children.add(new Property("recipient", "Reference(Patient|Practitioner|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));
789        }
790
791        @Override
792        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
793          switch (_hash) {
794          case 984367650: /*repetitions*/  return new Property("repetitions", "positiveInt", "Indicates the number of times the requested action should occur.", 0, 1, repetitions);
795          case -991726143: /*period*/  return new Property("period", "Period", "Over what time-period is fulfillment sought.", 0, 1, period);
796          case 820081177: /*recipient*/  return new Property("recipient", "Reference(Patient|Practitioner|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);
797          default: return super.getNamedProperty(_hash, _name, _checkValid);
798          }
799
800        }
801
802      @Override
803      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
804        switch (hash) {
805        case 984367650: /*repetitions*/ return this.repetitions == null ? new Base[0] : new Base[] {this.repetitions}; // PositiveIntType
806        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
807        case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference
808        default: return super.getProperty(hash, name, checkValid);
809        }
810
811      }
812
813      @Override
814      public Base setProperty(int hash, String name, Base value) throws FHIRException {
815        switch (hash) {
816        case 984367650: // repetitions
817          this.repetitions = castToPositiveInt(value); // PositiveIntType
818          return value;
819        case -991726143: // period
820          this.period = castToPeriod(value); // Period
821          return value;
822        case 820081177: // recipient
823          this.getRecipient().add(castToReference(value)); // Reference
824          return value;
825        default: return super.setProperty(hash, name, value);
826        }
827
828      }
829
830      @Override
831      public Base setProperty(String name, Base value) throws FHIRException {
832        if (name.equals("repetitions")) {
833          this.repetitions = castToPositiveInt(value); // PositiveIntType
834        } else if (name.equals("period")) {
835          this.period = castToPeriod(value); // Period
836        } else if (name.equals("recipient")) {
837          this.getRecipient().add(castToReference(value));
838        } else
839          return super.setProperty(name, value);
840        return value;
841      }
842
843      @Override
844      public Base makeProperty(int hash, String name) throws FHIRException {
845        switch (hash) {
846        case 984367650:  return getRepetitionsElement();
847        case -991726143:  return getPeriod(); 
848        case 820081177:  return addRecipient(); 
849        default: return super.makeProperty(hash, name);
850        }
851
852      }
853
854      @Override
855      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
856        switch (hash) {
857        case 984367650: /*repetitions*/ return new String[] {"positiveInt"};
858        case -991726143: /*period*/ return new String[] {"Period"};
859        case 820081177: /*recipient*/ return new String[] {"Reference"};
860        default: return super.getTypesForProperty(hash, name);
861        }
862
863      }
864
865      @Override
866      public Base addChild(String name) throws FHIRException {
867        if (name.equals("repetitions")) {
868          throw new FHIRException("Cannot call addChild on a primitive type Task.repetitions");
869        }
870        else if (name.equals("period")) {
871          this.period = new Period();
872          return this.period;
873        }
874        else if (name.equals("recipient")) {
875          return addRecipient();
876        }
877        else
878          return super.addChild(name);
879      }
880
881      public TaskRestrictionComponent copy() {
882        TaskRestrictionComponent dst = new TaskRestrictionComponent();
883        copyValues(dst);
884        dst.repetitions = repetitions == null ? null : repetitions.copy();
885        dst.period = period == null ? null : period.copy();
886        if (recipient != null) {
887          dst.recipient = new ArrayList<Reference>();
888          for (Reference i : recipient)
889            dst.recipient.add(i.copy());
890        };
891        return dst;
892      }
893
894      @Override
895      public boolean equalsDeep(Base other_) {
896        if (!super.equalsDeep(other_))
897          return false;
898        if (!(other_ instanceof TaskRestrictionComponent))
899          return false;
900        TaskRestrictionComponent o = (TaskRestrictionComponent) other_;
901        return compareDeep(repetitions, o.repetitions, true) && compareDeep(period, o.period, true) && compareDeep(recipient, o.recipient, true)
902          ;
903      }
904
905      @Override
906      public boolean equalsShallow(Base other_) {
907        if (!super.equalsShallow(other_))
908          return false;
909        if (!(other_ instanceof TaskRestrictionComponent))
910          return false;
911        TaskRestrictionComponent o = (TaskRestrictionComponent) other_;
912        return compareValues(repetitions, o.repetitions, true);
913      }
914
915      public boolean isEmpty() {
916        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(repetitions, period, recipient
917          );
918      }
919
920  public String fhirType() {
921    return "Task.restriction";
922
923  }
924
925  }
926
927    @Block()
928    public static class ParameterComponent extends BackboneElement implements IBaseBackboneElement {
929        /**
930         * A code or description indicating how the input is intended to be used as part of the task execution.
931         */
932        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
933        @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." )
934        protected CodeableConcept type;
935
936        /**
937         * The value of the input parameter as a basic type.
938         */
939        @Child(name = "value", type = {}, order=2, min=1, max=1, modifier=false, summary=false)
940        @Description(shortDefinition="Content to use in performing the task", formalDefinition="The value of the input parameter as a basic type." )
941        protected org.hl7.fhir.r4.model.Type value;
942
943        private static final long serialVersionUID = -850267045L;
944
945    /**
946     * Constructor
947     */
948      public ParameterComponent() {
949        super();
950      }
951
952    /**
953     * Constructor
954     */
955      public ParameterComponent(CodeableConcept type, org.hl7.fhir.r4.model.Type value) {
956        super();
957        this.type = type;
958        this.value = value;
959      }
960
961        /**
962         * @return {@link #type} (A code or description indicating how the input is intended to be used as part of the task execution.)
963         */
964        public CodeableConcept getType() { 
965          if (this.type == null)
966            if (Configuration.errorOnAutoCreate())
967              throw new Error("Attempt to auto-create ParameterComponent.type");
968            else if (Configuration.doAutoCreate())
969              this.type = new CodeableConcept(); // cc
970          return this.type;
971        }
972
973        public boolean hasType() { 
974          return this.type != null && !this.type.isEmpty();
975        }
976
977        /**
978         * @param value {@link #type} (A code or description indicating how the input is intended to be used as part of the task execution.)
979         */
980        public ParameterComponent setType(CodeableConcept value) { 
981          this.type = value;
982          return this;
983        }
984
985        /**
986         * @return {@link #value} (The value of the input parameter as a basic type.)
987         */
988        public org.hl7.fhir.r4.model.Type getValue() { 
989          return this.value;
990        }
991
992        public boolean hasValue() { 
993          return this.value != null && !this.value.isEmpty();
994        }
995
996        /**
997         * @param value {@link #value} (The value of the input parameter as a basic type.)
998         */
999        public ParameterComponent setValue(org.hl7.fhir.r4.model.Type value) { 
1000          this.value = value;
1001          return this;
1002        }
1003
1004        protected void listChildren(List<Property> children) {
1005          super.listChildren(children);
1006          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));
1007          children.add(new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value));
1008        }
1009
1010        @Override
1011        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1012          switch (_hash) {
1013          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);
1014          case -1410166417: /*value[x]*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1015          case 111972721: /*value*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1016          case -1535024575: /*valueBase64Binary*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1017          case 733421943: /*valueBoolean*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1018          case -786218365: /*valueCanonical*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1019          case -766209282: /*valueCode*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1020          case -766192449: /*valueDate*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1021          case 1047929900: /*valueDateTime*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1022          case -2083993440: /*valueDecimal*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1023          case 231604844: /*valueId*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1024          case -1668687056: /*valueInstant*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1025          case -1668204915: /*valueInteger*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1026          case -497880704: /*valueMarkdown*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1027          case -1410178407: /*valueOid*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1028          case -1249932027: /*valuePositiveInt*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1029          case -1424603934: /*valueString*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1030          case -765708322: /*valueTime*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1031          case 26529417: /*valueUnsignedInt*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1032          case -1410172357: /*valueUri*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1033          case -1410172354: /*valueUrl*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1034          case -765667124: /*valueUuid*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1035          case -478981821: /*valueAddress*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1036          case -67108992: /*valueAnnotation*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1037          case -475566732: /*valueAttachment*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1038          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1039          case -1887705029: /*valueCoding*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1040          case 944904545: /*valueContactPoint*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1041          case -2026205465: /*valueHumanName*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1042          case -130498310: /*valueIdentifier*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1043          case -1524344174: /*valuePeriod*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1044          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1045          case 2030761548: /*valueRange*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1046          case 2030767386: /*valueRatio*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1047          case 1755241690: /*valueReference*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1048          case -962229101: /*valueSampledData*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1049          case -540985785: /*valueSignature*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1050          case -1406282469: /*valueTiming*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1051          case -1858636920: /*valueDosage*/  return new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, 1, value);
1052          default: return super.getNamedProperty(_hash, _name, _checkValid);
1053          }
1054
1055        }
1056
1057      @Override
1058      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1059        switch (hash) {
1060        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1061        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.r4.model.Type
1062        default: return super.getProperty(hash, name, checkValid);
1063        }
1064
1065      }
1066
1067      @Override
1068      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1069        switch (hash) {
1070        case 3575610: // type
1071          this.type = castToCodeableConcept(value); // CodeableConcept
1072          return value;
1073        case 111972721: // value
1074          this.value = castToType(value); // org.hl7.fhir.r4.model.Type
1075          return value;
1076        default: return super.setProperty(hash, name, value);
1077        }
1078
1079      }
1080
1081      @Override
1082      public Base setProperty(String name, Base value) throws FHIRException {
1083        if (name.equals("type")) {
1084          this.type = castToCodeableConcept(value); // CodeableConcept
1085        } else if (name.equals("value[x]")) {
1086          this.value = castToType(value); // org.hl7.fhir.r4.model.Type
1087        } else
1088          return super.setProperty(name, value);
1089        return value;
1090      }
1091
1092      @Override
1093      public Base makeProperty(int hash, String name) throws FHIRException {
1094        switch (hash) {
1095        case 3575610:  return getType(); 
1096        case -1410166417:  return getValue(); 
1097        case 111972721:  return getValue(); 
1098        default: return super.makeProperty(hash, name);
1099        }
1100
1101      }
1102
1103      @Override
1104      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1105        switch (hash) {
1106        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1107        case 111972721: /*value*/ return new String[] {"*"};
1108        default: return super.getTypesForProperty(hash, name);
1109        }
1110
1111      }
1112
1113      @Override
1114      public Base addChild(String name) throws FHIRException {
1115        if (name.equals("type")) {
1116          this.type = new CodeableConcept();
1117          return this.type;
1118        }
1119        else if (name.equals("valueBase64Binary")) {
1120          this.value = new Base64BinaryType();
1121          return this.value;
1122        }
1123        else if (name.equals("valueBoolean")) {
1124          this.value = new BooleanType();
1125          return this.value;
1126        }
1127        else if (name.equals("valueCanonical")) {
1128          this.value = new CanonicalType();
1129          return this.value;
1130        }
1131        else if (name.equals("valueCode")) {
1132          this.value = new CodeType();
1133          return this.value;
1134        }
1135        else if (name.equals("valueDate")) {
1136          this.value = new DateType();
1137          return this.value;
1138        }
1139        else if (name.equals("valueDateTime")) {
1140          this.value = new DateTimeType();
1141          return this.value;
1142        }
1143        else if (name.equals("valueDecimal")) {
1144          this.value = new DecimalType();
1145          return this.value;
1146        }
1147        else if (name.equals("valueId")) {
1148          this.value = new IdType();
1149          return this.value;
1150        }
1151        else if (name.equals("valueInstant")) {
1152          this.value = new InstantType();
1153          return this.value;
1154        }
1155        else if (name.equals("valueInteger")) {
1156          this.value = new IntegerType();
1157          return this.value;
1158        }
1159        else if (name.equals("valueMarkdown")) {
1160          this.value = new MarkdownType();
1161          return this.value;
1162        }
1163        else if (name.equals("valueOid")) {
1164          this.value = new OidType();
1165          return this.value;
1166        }
1167        else if (name.equals("valuePositiveInt")) {
1168          this.value = new PositiveIntType();
1169          return this.value;
1170        }
1171        else if (name.equals("valueString")) {
1172          this.value = new StringType();
1173          return this.value;
1174        }
1175        else if (name.equals("valueTime")) {
1176          this.value = new TimeType();
1177          return this.value;
1178        }
1179        else if (name.equals("valueUnsignedInt")) {
1180          this.value = new UnsignedIntType();
1181          return this.value;
1182        }
1183        else if (name.equals("valueUri")) {
1184          this.value = new UriType();
1185          return this.value;
1186        }
1187        else if (name.equals("valueUrl")) {
1188          this.value = new UrlType();
1189          return this.value;
1190        }
1191        else if (name.equals("valueUuid")) {
1192          this.value = new UuidType();
1193          return this.value;
1194        }
1195        else if (name.equals("valueAddress")) {
1196          this.value = new Address();
1197          return this.value;
1198        }
1199        else if (name.equals("valueAge")) {
1200          this.value = new Age();
1201          return this.value;
1202        }
1203        else if (name.equals("valueAnnotation")) {
1204          this.value = new Annotation();
1205          return this.value;
1206        }
1207        else if (name.equals("valueAttachment")) {
1208          this.value = new Attachment();
1209          return this.value;
1210        }
1211        else if (name.equals("valueCodeableConcept")) {
1212          this.value = new CodeableConcept();
1213          return this.value;
1214        }
1215        else if (name.equals("valueCoding")) {
1216          this.value = new Coding();
1217          return this.value;
1218        }
1219        else if (name.equals("valueContactPoint")) {
1220          this.value = new ContactPoint();
1221          return this.value;
1222        }
1223        else if (name.equals("valueCount")) {
1224          this.value = new Count();
1225          return this.value;
1226        }
1227        else if (name.equals("valueDistance")) {
1228          this.value = new Distance();
1229          return this.value;
1230        }
1231        else if (name.equals("valueDuration")) {
1232          this.value = new Duration();
1233          return this.value;
1234        }
1235        else if (name.equals("valueHumanName")) {
1236          this.value = new HumanName();
1237          return this.value;
1238        }
1239        else if (name.equals("valueIdentifier")) {
1240          this.value = new Identifier();
1241          return this.value;
1242        }
1243        else if (name.equals("valueMoney")) {
1244          this.value = new Money();
1245          return this.value;
1246        }
1247        else if (name.equals("valuePeriod")) {
1248          this.value = new Period();
1249          return this.value;
1250        }
1251        else if (name.equals("valueQuantity")) {
1252          this.value = new Quantity();
1253          return this.value;
1254        }
1255        else if (name.equals("valueRange")) {
1256          this.value = new Range();
1257          return this.value;
1258        }
1259        else if (name.equals("valueRatio")) {
1260          this.value = new Ratio();
1261          return this.value;
1262        }
1263        else if (name.equals("valueReference")) {
1264          this.value = new Reference();
1265          return this.value;
1266        }
1267        else if (name.equals("valueSampledData")) {
1268          this.value = new SampledData();
1269          return this.value;
1270        }
1271        else if (name.equals("valueSignature")) {
1272          this.value = new Signature();
1273          return this.value;
1274        }
1275        else if (name.equals("valueTiming")) {
1276          this.value = new Timing();
1277          return this.value;
1278        }
1279        else if (name.equals("valueParameterDefinition")) {
1280          this.value = new ParameterDefinition();
1281          return this.value;
1282        }
1283        else if (name.equals("valueDataRequirement")) {
1284          this.value = new DataRequirement();
1285          return this.value;
1286        }
1287        else if (name.equals("valueRelatedArtifact")) {
1288          this.value = new RelatedArtifact();
1289          return this.value;
1290        }
1291        else if (name.equals("valueContactDetail")) {
1292          this.value = new ContactDetail();
1293          return this.value;
1294        }
1295        else if (name.equals("valueContributor")) {
1296          this.value = new Contributor();
1297          return this.value;
1298        }
1299        else if (name.equals("valueTriggerDefinition")) {
1300          this.value = new TriggerDefinition();
1301          return this.value;
1302        }
1303        else if (name.equals("valueUsageContext")) {
1304          this.value = new UsageContext();
1305          return this.value;
1306        }
1307        else if (name.equals("valueDosage")) {
1308          this.value = new Dosage();
1309          return this.value;
1310        }
1311        else
1312          return super.addChild(name);
1313      }
1314
1315      public ParameterComponent copy() {
1316        ParameterComponent dst = new ParameterComponent();
1317        copyValues(dst);
1318        dst.type = type == null ? null : type.copy();
1319        dst.value = value == null ? null : value.copy();
1320        return dst;
1321      }
1322
1323      @Override
1324      public boolean equalsDeep(Base other_) {
1325        if (!super.equalsDeep(other_))
1326          return false;
1327        if (!(other_ instanceof ParameterComponent))
1328          return false;
1329        ParameterComponent o = (ParameterComponent) other_;
1330        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true);
1331      }
1332
1333      @Override
1334      public boolean equalsShallow(Base other_) {
1335        if (!super.equalsShallow(other_))
1336          return false;
1337        if (!(other_ instanceof ParameterComponent))
1338          return false;
1339        ParameterComponent o = (ParameterComponent) other_;
1340        return true;
1341      }
1342
1343      public boolean isEmpty() {
1344        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value);
1345      }
1346
1347  public String fhirType() {
1348    return "Task.input";
1349
1350  }
1351
1352  }
1353
1354    @Block()
1355    public static class TaskOutputComponent extends BackboneElement implements IBaseBackboneElement {
1356        /**
1357         * The name of the Output parameter.
1358         */
1359        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1360        @Description(shortDefinition="Label for output", formalDefinition="The name of the Output parameter." )
1361        protected CodeableConcept type;
1362
1363        /**
1364         * The value of the Output parameter as a basic type.
1365         */
1366        @Child(name = "value", type = {}, order=2, min=1, max=1, modifier=false, summary=false)
1367        @Description(shortDefinition="Result of output", formalDefinition="The value of the Output parameter as a basic type." )
1368        protected org.hl7.fhir.r4.model.Type value;
1369
1370        private static final long serialVersionUID = -850267045L;
1371
1372    /**
1373     * Constructor
1374     */
1375      public TaskOutputComponent() {
1376        super();
1377      }
1378
1379    /**
1380     * Constructor
1381     */
1382      public TaskOutputComponent(CodeableConcept type, org.hl7.fhir.r4.model.Type value) {
1383        super();
1384        this.type = type;
1385        this.value = value;
1386      }
1387
1388        /**
1389         * @return {@link #type} (The name of the Output parameter.)
1390         */
1391        public CodeableConcept getType() { 
1392          if (this.type == null)
1393            if (Configuration.errorOnAutoCreate())
1394              throw new Error("Attempt to auto-create TaskOutputComponent.type");
1395            else if (Configuration.doAutoCreate())
1396              this.type = new CodeableConcept(); // cc
1397          return this.type;
1398        }
1399
1400        public boolean hasType() { 
1401          return this.type != null && !this.type.isEmpty();
1402        }
1403
1404        /**
1405         * @param value {@link #type} (The name of the Output parameter.)
1406         */
1407        public TaskOutputComponent setType(CodeableConcept value) { 
1408          this.type = value;
1409          return this;
1410        }
1411
1412        /**
1413         * @return {@link #value} (The value of the Output parameter as a basic type.)
1414         */
1415        public org.hl7.fhir.r4.model.Type getValue() { 
1416          return this.value;
1417        }
1418
1419        public boolean hasValue() { 
1420          return this.value != null && !this.value.isEmpty();
1421        }
1422
1423        /**
1424         * @param value {@link #value} (The value of the Output parameter as a basic type.)
1425         */
1426        public TaskOutputComponent setValue(org.hl7.fhir.r4.model.Type value) { 
1427          this.value = value;
1428          return this;
1429        }
1430
1431        protected void listChildren(List<Property> children) {
1432          super.listChildren(children);
1433          children.add(new Property("type", "CodeableConcept", "The name of the Output parameter.", 0, 1, type));
1434          children.add(new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value));
1435        }
1436
1437        @Override
1438        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1439          switch (_hash) {
1440          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The name of the Output parameter.", 0, 1, type);
1441          case -1410166417: /*value[x]*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1442          case 111972721: /*value*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1443          case -1535024575: /*valueBase64Binary*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1444          case 733421943: /*valueBoolean*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1445          case -786218365: /*valueCanonical*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1446          case -766209282: /*valueCode*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1447          case -766192449: /*valueDate*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1448          case 1047929900: /*valueDateTime*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1449          case -2083993440: /*valueDecimal*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1450          case 231604844: /*valueId*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1451          case -1668687056: /*valueInstant*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1452          case -1668204915: /*valueInteger*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1453          case -497880704: /*valueMarkdown*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1454          case -1410178407: /*valueOid*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1455          case -1249932027: /*valuePositiveInt*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1456          case -1424603934: /*valueString*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1457          case -765708322: /*valueTime*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1458          case 26529417: /*valueUnsignedInt*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1459          case -1410172357: /*valueUri*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1460          case -1410172354: /*valueUrl*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1461          case -765667124: /*valueUuid*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1462          case -478981821: /*valueAddress*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1463          case -67108992: /*valueAnnotation*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1464          case -475566732: /*valueAttachment*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1465          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1466          case -1887705029: /*valueCoding*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1467          case 944904545: /*valueContactPoint*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1468          case -2026205465: /*valueHumanName*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1469          case -130498310: /*valueIdentifier*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1470          case -1524344174: /*valuePeriod*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1471          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1472          case 2030761548: /*valueRange*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1473          case 2030767386: /*valueRatio*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1474          case 1755241690: /*valueReference*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1475          case -962229101: /*valueSampledData*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1476          case -540985785: /*valueSignature*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1477          case -1406282469: /*valueTiming*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1478          case -1858636920: /*valueDosage*/  return new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, 1, value);
1479          default: return super.getNamedProperty(_hash, _name, _checkValid);
1480          }
1481
1482        }
1483
1484      @Override
1485      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1486        switch (hash) {
1487        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1488        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.r4.model.Type
1489        default: return super.getProperty(hash, name, checkValid);
1490        }
1491
1492      }
1493
1494      @Override
1495      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1496        switch (hash) {
1497        case 3575610: // type
1498          this.type = castToCodeableConcept(value); // CodeableConcept
1499          return value;
1500        case 111972721: // value
1501          this.value = castToType(value); // org.hl7.fhir.r4.model.Type
1502          return value;
1503        default: return super.setProperty(hash, name, value);
1504        }
1505
1506      }
1507
1508      @Override
1509      public Base setProperty(String name, Base value) throws FHIRException {
1510        if (name.equals("type")) {
1511          this.type = castToCodeableConcept(value); // CodeableConcept
1512        } else if (name.equals("value[x]")) {
1513          this.value = castToType(value); // org.hl7.fhir.r4.model.Type
1514        } else
1515          return super.setProperty(name, value);
1516        return value;
1517      }
1518
1519      @Override
1520      public Base makeProperty(int hash, String name) throws FHIRException {
1521        switch (hash) {
1522        case 3575610:  return getType(); 
1523        case -1410166417:  return getValue(); 
1524        case 111972721:  return getValue(); 
1525        default: return super.makeProperty(hash, name);
1526        }
1527
1528      }
1529
1530      @Override
1531      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1532        switch (hash) {
1533        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1534        case 111972721: /*value*/ return new String[] {"*"};
1535        default: return super.getTypesForProperty(hash, name);
1536        }
1537
1538      }
1539
1540      @Override
1541      public Base addChild(String name) throws FHIRException {
1542        if (name.equals("type")) {
1543          this.type = new CodeableConcept();
1544          return this.type;
1545        }
1546        else if (name.equals("valueBase64Binary")) {
1547          this.value = new Base64BinaryType();
1548          return this.value;
1549        }
1550        else if (name.equals("valueBoolean")) {
1551          this.value = new BooleanType();
1552          return this.value;
1553        }
1554        else if (name.equals("valueCanonical")) {
1555          this.value = new CanonicalType();
1556          return this.value;
1557        }
1558        else if (name.equals("valueCode")) {
1559          this.value = new CodeType();
1560          return this.value;
1561        }
1562        else if (name.equals("valueDate")) {
1563          this.value = new DateType();
1564          return this.value;
1565        }
1566        else if (name.equals("valueDateTime")) {
1567          this.value = new DateTimeType();
1568          return this.value;
1569        }
1570        else if (name.equals("valueDecimal")) {
1571          this.value = new DecimalType();
1572          return this.value;
1573        }
1574        else if (name.equals("valueId")) {
1575          this.value = new IdType();
1576          return this.value;
1577        }
1578        else if (name.equals("valueInstant")) {
1579          this.value = new InstantType();
1580          return this.value;
1581        }
1582        else if (name.equals("valueInteger")) {
1583          this.value = new IntegerType();
1584          return this.value;
1585        }
1586        else if (name.equals("valueMarkdown")) {
1587          this.value = new MarkdownType();
1588          return this.value;
1589        }
1590        else if (name.equals("valueOid")) {
1591          this.value = new OidType();
1592          return this.value;
1593        }
1594        else if (name.equals("valuePositiveInt")) {
1595          this.value = new PositiveIntType();
1596          return this.value;
1597        }
1598        else if (name.equals("valueString")) {
1599          this.value = new StringType();
1600          return this.value;
1601        }
1602        else if (name.equals("valueTime")) {
1603          this.value = new TimeType();
1604          return this.value;
1605        }
1606        else if (name.equals("valueUnsignedInt")) {
1607          this.value = new UnsignedIntType();
1608          return this.value;
1609        }
1610        else if (name.equals("valueUri")) {
1611          this.value = new UriType();
1612          return this.value;
1613        }
1614        else if (name.equals("valueUrl")) {
1615          this.value = new UrlType();
1616          return this.value;
1617        }
1618        else if (name.equals("valueUuid")) {
1619          this.value = new UuidType();
1620          return this.value;
1621        }
1622        else if (name.equals("valueAddress")) {
1623          this.value = new Address();
1624          return this.value;
1625        }
1626        else if (name.equals("valueAge")) {
1627          this.value = new Age();
1628          return this.value;
1629        }
1630        else if (name.equals("valueAnnotation")) {
1631          this.value = new Annotation();
1632          return this.value;
1633        }
1634        else if (name.equals("valueAttachment")) {
1635          this.value = new Attachment();
1636          return this.value;
1637        }
1638        else if (name.equals("valueCodeableConcept")) {
1639          this.value = new CodeableConcept();
1640          return this.value;
1641        }
1642        else if (name.equals("valueCoding")) {
1643          this.value = new Coding();
1644          return this.value;
1645        }
1646        else if (name.equals("valueContactPoint")) {
1647          this.value = new ContactPoint();
1648          return this.value;
1649        }
1650        else if (name.equals("valueCount")) {
1651          this.value = new Count();
1652          return this.value;
1653        }
1654        else if (name.equals("valueDistance")) {
1655          this.value = new Distance();
1656          return this.value;
1657        }
1658        else if (name.equals("valueDuration")) {
1659          this.value = new Duration();
1660          return this.value;
1661        }
1662        else if (name.equals("valueHumanName")) {
1663          this.value = new HumanName();
1664          return this.value;
1665        }
1666        else if (name.equals("valueIdentifier")) {
1667          this.value = new Identifier();
1668          return this.value;
1669        }
1670        else if (name.equals("valueMoney")) {
1671          this.value = new Money();
1672          return this.value;
1673        }
1674        else if (name.equals("valuePeriod")) {
1675          this.value = new Period();
1676          return this.value;
1677        }
1678        else if (name.equals("valueQuantity")) {
1679          this.value = new Quantity();
1680          return this.value;
1681        }
1682        else if (name.equals("valueRange")) {
1683          this.value = new Range();
1684          return this.value;
1685        }
1686        else if (name.equals("valueRatio")) {
1687          this.value = new Ratio();
1688          return this.value;
1689        }
1690        else if (name.equals("valueReference")) {
1691          this.value = new Reference();
1692          return this.value;
1693        }
1694        else if (name.equals("valueSampledData")) {
1695          this.value = new SampledData();
1696          return this.value;
1697        }
1698        else if (name.equals("valueSignature")) {
1699          this.value = new Signature();
1700          return this.value;
1701        }
1702        else if (name.equals("valueTiming")) {
1703          this.value = new Timing();
1704          return this.value;
1705        }
1706        else if (name.equals("valueParameterDefinition")) {
1707          this.value = new ParameterDefinition();
1708          return this.value;
1709        }
1710        else if (name.equals("valueDataRequirement")) {
1711          this.value = new DataRequirement();
1712          return this.value;
1713        }
1714        else if (name.equals("valueRelatedArtifact")) {
1715          this.value = new RelatedArtifact();
1716          return this.value;
1717        }
1718        else if (name.equals("valueContactDetail")) {
1719          this.value = new ContactDetail();
1720          return this.value;
1721        }
1722        else if (name.equals("valueContributor")) {
1723          this.value = new Contributor();
1724          return this.value;
1725        }
1726        else if (name.equals("valueTriggerDefinition")) {
1727          this.value = new TriggerDefinition();
1728          return this.value;
1729        }
1730        else if (name.equals("valueUsageContext")) {
1731          this.value = new UsageContext();
1732          return this.value;
1733        }
1734        else if (name.equals("valueDosage")) {
1735          this.value = new Dosage();
1736          return this.value;
1737        }
1738        else
1739          return super.addChild(name);
1740      }
1741
1742      public TaskOutputComponent copy() {
1743        TaskOutputComponent dst = new TaskOutputComponent();
1744        copyValues(dst);
1745        dst.type = type == null ? null : type.copy();
1746        dst.value = value == null ? null : value.copy();
1747        return dst;
1748      }
1749
1750      @Override
1751      public boolean equalsDeep(Base other_) {
1752        if (!super.equalsDeep(other_))
1753          return false;
1754        if (!(other_ instanceof TaskOutputComponent))
1755          return false;
1756        TaskOutputComponent o = (TaskOutputComponent) other_;
1757        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true);
1758      }
1759
1760      @Override
1761      public boolean equalsShallow(Base other_) {
1762        if (!super.equalsShallow(other_))
1763          return false;
1764        if (!(other_ instanceof TaskOutputComponent))
1765          return false;
1766        TaskOutputComponent o = (TaskOutputComponent) other_;
1767        return true;
1768      }
1769
1770      public boolean isEmpty() {
1771        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value);
1772      }
1773
1774  public String fhirType() {
1775    return "Task.output";
1776
1777  }
1778
1779  }
1780
1781    /**
1782     * The business identifier for this task.
1783     */
1784    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1785    @Description(shortDefinition="Task Instance Identifier", formalDefinition="The business identifier for this task." )
1786    protected List<Identifier> identifier;
1787
1788    /**
1789     * A reference to a formal or informal definition of the task.  For example, a protocol, a step within a defined workflow definition, etc.
1790     */
1791    @Child(name = "instantiates", type = {UriType.class, ActivityDefinition.class}, order=1, min=0, max=1, modifier=false, summary=true)
1792    @Description(shortDefinition="Formal definition of task", formalDefinition="A reference to a formal or informal definition of the task.  For example, a protocol, a step within a defined workflow definition, etc." )
1793    protected Type instantiates;
1794
1795    /**
1796     * 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.
1797     */
1798    @Child(name = "basedOn", type = {Reference.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1799    @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." )
1800    protected List<Reference> basedOn;
1801    /**
1802     * The actual objects that are the target of the reference (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.)
1803     */
1804    protected List<Resource> basedOnTarget;
1805
1806
1807    /**
1808     * An identifier that links together multiple tasks and other requests that were created in the same context.
1809     */
1810    @Child(name = "groupIdentifier", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true)
1811    @Description(shortDefinition="Requisition or grouper id", formalDefinition="An identifier that links together multiple tasks and other requests that were created in the same context." )
1812    protected Identifier groupIdentifier;
1813
1814    /**
1815     * Task that this particular task is part of.
1816     */
1817    @Child(name = "partOf", type = {Task.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1818    @Description(shortDefinition="Composite task", formalDefinition="Task that this particular task is part of." )
1819    protected List<Reference> partOf;
1820    /**
1821     * The actual objects that are the target of the reference (Task that this particular task is part of.)
1822     */
1823    protected List<Task> partOfTarget;
1824
1825
1826    /**
1827     * The current status of the task.
1828     */
1829    @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true)
1830    @Description(shortDefinition="draft | requested | received | accepted | +", formalDefinition="The current status of the task." )
1831    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/task-status")
1832    protected Enumeration<TaskStatus> status;
1833
1834    /**
1835     * An explanation as to why this task is held, failed, was refused, etc.
1836     */
1837    @Child(name = "statusReason", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true)
1838    @Description(shortDefinition="Reason for current status", formalDefinition="An explanation as to why this task is held, failed, was refused, etc." )
1839    protected CodeableConcept statusReason;
1840
1841    /**
1842     * Contains business-specific nuances of the business state.
1843     */
1844    @Child(name = "businessStatus", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true)
1845    @Description(shortDefinition="E.g. \"Specimen collected\", \"IV prepped\"", formalDefinition="Contains business-specific nuances of the business state." )
1846    protected CodeableConcept businessStatus;
1847
1848    /**
1849     * 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.
1850     */
1851    @Child(name = "intent", type = {CodeType.class}, order=8, min=1, max=1, modifier=false, summary=true)
1852    @Description(shortDefinition="proposal | plan | order +", 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." )
1853    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-intent")
1854    protected Enumeration<TaskIntent> intent;
1855
1856    /**
1857     * Indicates how quickly the Task should be addressed with respect to other requests.
1858     */
1859    @Child(name = "priority", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=false)
1860    @Description(shortDefinition="normal | urgent | asap | stat", formalDefinition="Indicates how quickly the Task should be addressed with respect to other requests." )
1861    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-priority")
1862    protected Enumeration<TaskPriority> priority;
1863
1864    /**
1865     * A name or code (or both) briefly describing what the task involves.
1866     */
1867    @Child(name = "code", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true)
1868    @Description(shortDefinition="Task Type", formalDefinition="A name or code (or both) briefly describing what the task involves." )
1869    protected CodeableConcept code;
1870
1871    /**
1872     * A free-text description of what is to be performed.
1873     */
1874    @Child(name = "description", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=true)
1875    @Description(shortDefinition="Human-readable explanation of task", formalDefinition="A free-text description of what is to be performed." )
1876    protected StringType description;
1877
1878    /**
1879     * The request being actioned or the resource being manipulated by this task.
1880     */
1881    @Child(name = "focus", type = {Reference.class}, order=12, min=0, max=1, modifier=false, summary=true)
1882    @Description(shortDefinition="What task is acting on", formalDefinition="The request being actioned or the resource being manipulated by this task." )
1883    protected Reference focus;
1884
1885    /**
1886     * The actual object that is the target of the reference (The request being actioned or the resource being manipulated by this task.)
1887     */
1888    protected Resource focusTarget;
1889
1890    /**
1891     * The entity who benefits from the performance of the service specified in the task (e.g., the patient).
1892     */
1893    @Child(name = "for", type = {Reference.class}, order=13, min=0, max=1, modifier=false, summary=true)
1894    @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)." )
1895    protected Reference for_;
1896
1897    /**
1898     * The actual object that is the target of the reference (The entity who benefits from the performance of the service specified in the task (e.g., the patient).)
1899     */
1900    protected Resource for_Target;
1901
1902    /**
1903     * The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.
1904     */
1905    @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=14, min=0, max=1, modifier=false, summary=true)
1906    @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." )
1907    protected Reference context;
1908
1909    /**
1910     * The actual object that is the target of the reference (The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.)
1911     */
1912    protected Resource contextTarget;
1913
1914    /**
1915     * 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).
1916     */
1917    @Child(name = "executionPeriod", type = {Period.class}, order=15, min=0, max=1, modifier=false, summary=true)
1918    @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)." )
1919    protected Period executionPeriod;
1920
1921    /**
1922     * The date and time this task was created.
1923     */
1924    @Child(name = "authoredOn", type = {DateTimeType.class}, order=16, min=0, max=1, modifier=false, summary=false)
1925    @Description(shortDefinition="Task Creation Date", formalDefinition="The date and time this task was created." )
1926    protected DateTimeType authoredOn;
1927
1928    /**
1929     * The date and time of last modification to this task.
1930     */
1931    @Child(name = "lastModified", type = {DateTimeType.class}, order=17, min=0, max=1, modifier=false, summary=true)
1932    @Description(shortDefinition="Task Last Modified Date", formalDefinition="The date and time of last modification to this task." )
1933    protected DateTimeType lastModified;
1934
1935    /**
1936     * The creator of the task.
1937     */
1938    @Child(name = "requester", type = {Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class}, order=18, min=0, max=1, modifier=false, summary=true)
1939    @Description(shortDefinition="Who is asking for task to be done", formalDefinition="The creator of the task." )
1940    protected Reference requester;
1941
1942    /**
1943     * The actual object that is the target of the reference (The creator of the task.)
1944     */
1945    protected Resource requesterTarget;
1946
1947    /**
1948     * The type of participant that can execute the task.
1949     */
1950    @Child(name = "performerType", type = {CodeableConcept.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1951    @Description(shortDefinition="requester | dispatcher | scheduler | performer | monitor | manager | acquirer | reviewer", formalDefinition="The type of participant that can execute the task." )
1952    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/task-performer-type")
1953    protected List<CodeableConcept> performerType;
1954
1955    /**
1956     * Individual organization or Device currently responsible for task execution.
1957     */
1958    @Child(name = "owner", type = {Practitioner.class, PractitionerRole.class, Organization.class, CareTeam.class, HealthcareService.class, Patient.class, Device.class, RelatedPerson.class}, order=20, min=0, max=1, modifier=false, summary=true)
1959    @Description(shortDefinition="Responsible individual", formalDefinition="Individual organization or Device currently responsible for task execution." )
1960    protected Reference owner;
1961
1962    /**
1963     * The actual object that is the target of the reference (Individual organization or Device currently responsible for task execution.)
1964     */
1965    protected Resource ownerTarget;
1966
1967    /**
1968     * A description or code indicating why this task needs to be performed.
1969     */
1970    @Child(name = "reasonCode", type = {CodeableConcept.class}, order=21, min=0, max=1, modifier=false, summary=false)
1971    @Description(shortDefinition="Why task is needed", formalDefinition="A description or code indicating why this task needs to be performed." )
1972    protected CodeableConcept reasonCode;
1973
1974    /**
1975     * A resource reference indicating why this task needs to be performed.
1976     */
1977    @Child(name = "reasonReference", type = {Reference.class}, order=22, min=0, max=1, modifier=false, summary=false)
1978    @Description(shortDefinition="Why task is needed", formalDefinition="A resource reference indicating why this task needs to be performed." )
1979    protected Reference reasonReference;
1980
1981    /**
1982     * The actual object that is the target of the reference (A resource reference indicating why this task needs to be performed.)
1983     */
1984    protected Resource reasonReferenceTarget;
1985
1986    /**
1987     * Free-text information captured about the task as it progresses.
1988     */
1989    @Child(name = "note", type = {Annotation.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1990    @Description(shortDefinition="Comments made about the task", formalDefinition="Free-text information captured about the task as it progresses." )
1991    protected List<Annotation> note;
1992
1993    /**
1994     * 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.
1995     */
1996    @Child(name = "relevantHistory", type = {Provenance.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1997    @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." )
1998    protected List<Reference> relevantHistory;
1999    /**
2000     * The actual objects that are the target of the reference (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.)
2001     */
2002    protected List<Provenance> relevantHistoryTarget;
2003
2004
2005    /**
2006     * 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.
2007     */
2008    @Child(name = "restriction", type = {}, order=25, min=0, max=1, modifier=false, summary=false)
2009    @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." )
2010    protected TaskRestrictionComponent restriction;
2011
2012    /**
2013     * Additional information that may be needed in the execution of the task.
2014     */
2015    @Child(name = "input", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2016    @Description(shortDefinition="Information used to perform task", formalDefinition="Additional information that may be needed in the execution of the task." )
2017    protected List<ParameterComponent> input;
2018
2019    /**
2020     * Outputs produced by the Task.
2021     */
2022    @Child(name = "output", type = {}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2023    @Description(shortDefinition="Information produced as part of task", formalDefinition="Outputs produced by the Task." )
2024    protected List<TaskOutputComponent> output;
2025
2026    private static final long serialVersionUID = -124529191L;
2027
2028  /**
2029   * Constructor
2030   */
2031    public Task() {
2032      super();
2033    }
2034
2035  /**
2036   * Constructor
2037   */
2038    public Task(Enumeration<TaskStatus> status, Enumeration<TaskIntent> intent) {
2039      super();
2040      this.status = status;
2041      this.intent = intent;
2042    }
2043
2044    /**
2045     * @return {@link #identifier} (The business identifier for this task.)
2046     */
2047    public List<Identifier> getIdentifier() { 
2048      if (this.identifier == null)
2049        this.identifier = new ArrayList<Identifier>();
2050      return this.identifier;
2051    }
2052
2053    /**
2054     * @return Returns a reference to <code>this</code> for easy method chaining
2055     */
2056    public Task setIdentifier(List<Identifier> theIdentifier) { 
2057      this.identifier = theIdentifier;
2058      return this;
2059    }
2060
2061    public boolean hasIdentifier() { 
2062      if (this.identifier == null)
2063        return false;
2064      for (Identifier item : this.identifier)
2065        if (!item.isEmpty())
2066          return true;
2067      return false;
2068    }
2069
2070    public Identifier addIdentifier() { //3
2071      Identifier t = new Identifier();
2072      if (this.identifier == null)
2073        this.identifier = new ArrayList<Identifier>();
2074      this.identifier.add(t);
2075      return t;
2076    }
2077
2078    public Task addIdentifier(Identifier t) { //3
2079      if (t == null)
2080        return this;
2081      if (this.identifier == null)
2082        this.identifier = new ArrayList<Identifier>();
2083      this.identifier.add(t);
2084      return this;
2085    }
2086
2087    /**
2088     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
2089     */
2090    public Identifier getIdentifierFirstRep() { 
2091      if (getIdentifier().isEmpty()) {
2092        addIdentifier();
2093      }
2094      return getIdentifier().get(0);
2095    }
2096
2097    /**
2098     * @return {@link #instantiates} (A reference to a formal or informal definition of the task.  For example, a protocol, a step within a defined workflow definition, etc.)
2099     */
2100    public Type getInstantiates() { 
2101      return this.instantiates;
2102    }
2103
2104    /**
2105     * @return {@link #instantiates} (A reference to a formal or informal definition of the task.  For example, a protocol, a step within a defined workflow definition, etc.)
2106     */
2107    public UriType getInstantiatesUriType() throws FHIRException { 
2108      if (this.instantiates == null)
2109        return null;
2110      if (!(this.instantiates instanceof UriType))
2111        throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.instantiates.getClass().getName()+" was encountered");
2112      return (UriType) this.instantiates;
2113    }
2114
2115    public boolean hasInstantiatesUriType() { 
2116      return this != null && this.instantiates instanceof UriType;
2117    }
2118
2119    /**
2120     * @return {@link #instantiates} (A reference to a formal or informal definition of the task.  For example, a protocol, a step within a defined workflow definition, etc.)
2121     */
2122    public Reference getInstantiatesReference() throws FHIRException { 
2123      if (this.instantiates == null)
2124        return null;
2125      if (!(this.instantiates instanceof Reference))
2126        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.instantiates.getClass().getName()+" was encountered");
2127      return (Reference) this.instantiates;
2128    }
2129
2130    public boolean hasInstantiatesReference() { 
2131      return this != null && this.instantiates instanceof Reference;
2132    }
2133
2134    public boolean hasInstantiates() { 
2135      return this.instantiates != null && !this.instantiates.isEmpty();
2136    }
2137
2138    /**
2139     * @param value {@link #instantiates} (A reference to a formal or informal definition of the task.  For example, a protocol, a step within a defined workflow definition, etc.)
2140     */
2141    public Task setInstantiates(Type value) { 
2142      if (value != null && !(value instanceof UriType || value instanceof Reference))
2143        throw new Error("Not the right type for Task.instantiates[x]: "+value.fhirType());
2144      this.instantiates = value;
2145      return this;
2146    }
2147
2148    /**
2149     * @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.)
2150     */
2151    public List<Reference> getBasedOn() { 
2152      if (this.basedOn == null)
2153        this.basedOn = new ArrayList<Reference>();
2154      return this.basedOn;
2155    }
2156
2157    /**
2158     * @return Returns a reference to <code>this</code> for easy method chaining
2159     */
2160    public Task setBasedOn(List<Reference> theBasedOn) { 
2161      this.basedOn = theBasedOn;
2162      return this;
2163    }
2164
2165    public boolean hasBasedOn() { 
2166      if (this.basedOn == null)
2167        return false;
2168      for (Reference item : this.basedOn)
2169        if (!item.isEmpty())
2170          return true;
2171      return false;
2172    }
2173
2174    public Reference addBasedOn() { //3
2175      Reference t = new Reference();
2176      if (this.basedOn == null)
2177        this.basedOn = new ArrayList<Reference>();
2178      this.basedOn.add(t);
2179      return t;
2180    }
2181
2182    public Task addBasedOn(Reference t) { //3
2183      if (t == null)
2184        return this;
2185      if (this.basedOn == null)
2186        this.basedOn = new ArrayList<Reference>();
2187      this.basedOn.add(t);
2188      return this;
2189    }
2190
2191    /**
2192     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist
2193     */
2194    public Reference getBasedOnFirstRep() { 
2195      if (getBasedOn().isEmpty()) {
2196        addBasedOn();
2197      }
2198      return getBasedOn().get(0);
2199    }
2200
2201    /**
2202     * @deprecated Use Reference#setResource(IBaseResource) instead
2203     */
2204    @Deprecated
2205    public List<Resource> getBasedOnTarget() { 
2206      if (this.basedOnTarget == null)
2207        this.basedOnTarget = new ArrayList<Resource>();
2208      return this.basedOnTarget;
2209    }
2210
2211    /**
2212     * @return {@link #groupIdentifier} (An identifier that links together multiple tasks and other requests that were created in the same context.)
2213     */
2214    public Identifier getGroupIdentifier() { 
2215      if (this.groupIdentifier == null)
2216        if (Configuration.errorOnAutoCreate())
2217          throw new Error("Attempt to auto-create Task.groupIdentifier");
2218        else if (Configuration.doAutoCreate())
2219          this.groupIdentifier = new Identifier(); // cc
2220      return this.groupIdentifier;
2221    }
2222
2223    public boolean hasGroupIdentifier() { 
2224      return this.groupIdentifier != null && !this.groupIdentifier.isEmpty();
2225    }
2226
2227    /**
2228     * @param value {@link #groupIdentifier} (An identifier that links together multiple tasks and other requests that were created in the same context.)
2229     */
2230    public Task setGroupIdentifier(Identifier value) { 
2231      this.groupIdentifier = value;
2232      return this;
2233    }
2234
2235    /**
2236     * @return {@link #partOf} (Task that this particular task is part of.)
2237     */
2238    public List<Reference> getPartOf() { 
2239      if (this.partOf == null)
2240        this.partOf = new ArrayList<Reference>();
2241      return this.partOf;
2242    }
2243
2244    /**
2245     * @return Returns a reference to <code>this</code> for easy method chaining
2246     */
2247    public Task setPartOf(List<Reference> thePartOf) { 
2248      this.partOf = thePartOf;
2249      return this;
2250    }
2251
2252    public boolean hasPartOf() { 
2253      if (this.partOf == null)
2254        return false;
2255      for (Reference item : this.partOf)
2256        if (!item.isEmpty())
2257          return true;
2258      return false;
2259    }
2260
2261    public Reference addPartOf() { //3
2262      Reference t = new Reference();
2263      if (this.partOf == null)
2264        this.partOf = new ArrayList<Reference>();
2265      this.partOf.add(t);
2266      return t;
2267    }
2268
2269    public Task addPartOf(Reference t) { //3
2270      if (t == null)
2271        return this;
2272      if (this.partOf == null)
2273        this.partOf = new ArrayList<Reference>();
2274      this.partOf.add(t);
2275      return this;
2276    }
2277
2278    /**
2279     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist
2280     */
2281    public Reference getPartOfFirstRep() { 
2282      if (getPartOf().isEmpty()) {
2283        addPartOf();
2284      }
2285      return getPartOf().get(0);
2286    }
2287
2288    /**
2289     * @deprecated Use Reference#setResource(IBaseResource) instead
2290     */
2291    @Deprecated
2292    public List<Task> getPartOfTarget() { 
2293      if (this.partOfTarget == null)
2294        this.partOfTarget = new ArrayList<Task>();
2295      return this.partOfTarget;
2296    }
2297
2298    /**
2299     * @deprecated Use Reference#setResource(IBaseResource) instead
2300     */
2301    @Deprecated
2302    public Task addPartOfTarget() { 
2303      Task r = new Task();
2304      if (this.partOfTarget == null)
2305        this.partOfTarget = new ArrayList<Task>();
2306      this.partOfTarget.add(r);
2307      return r;
2308    }
2309
2310    /**
2311     * @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
2312     */
2313    public Enumeration<TaskStatus> getStatusElement() { 
2314      if (this.status == null)
2315        if (Configuration.errorOnAutoCreate())
2316          throw new Error("Attempt to auto-create Task.status");
2317        else if (Configuration.doAutoCreate())
2318          this.status = new Enumeration<TaskStatus>(new TaskStatusEnumFactory()); // bb
2319      return this.status;
2320    }
2321
2322    public boolean hasStatusElement() { 
2323      return this.status != null && !this.status.isEmpty();
2324    }
2325
2326    public boolean hasStatus() { 
2327      return this.status != null && !this.status.isEmpty();
2328    }
2329
2330    /**
2331     * @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
2332     */
2333    public Task setStatusElement(Enumeration<TaskStatus> value) { 
2334      this.status = value;
2335      return this;
2336    }
2337
2338    /**
2339     * @return The current status of the task.
2340     */
2341    public TaskStatus getStatus() { 
2342      return this.status == null ? null : this.status.getValue();
2343    }
2344
2345    /**
2346     * @param value The current status of the task.
2347     */
2348    public Task setStatus(TaskStatus value) { 
2349        if (this.status == null)
2350          this.status = new Enumeration<TaskStatus>(new TaskStatusEnumFactory());
2351        this.status.setValue(value);
2352      return this;
2353    }
2354
2355    /**
2356     * @return {@link #statusReason} (An explanation as to why this task is held, failed, was refused, etc.)
2357     */
2358    public CodeableConcept getStatusReason() { 
2359      if (this.statusReason == null)
2360        if (Configuration.errorOnAutoCreate())
2361          throw new Error("Attempt to auto-create Task.statusReason");
2362        else if (Configuration.doAutoCreate())
2363          this.statusReason = new CodeableConcept(); // cc
2364      return this.statusReason;
2365    }
2366
2367    public boolean hasStatusReason() { 
2368      return this.statusReason != null && !this.statusReason.isEmpty();
2369    }
2370
2371    /**
2372     * @param value {@link #statusReason} (An explanation as to why this task is held, failed, was refused, etc.)
2373     */
2374    public Task setStatusReason(CodeableConcept value) { 
2375      this.statusReason = value;
2376      return this;
2377    }
2378
2379    /**
2380     * @return {@link #businessStatus} (Contains business-specific nuances of the business state.)
2381     */
2382    public CodeableConcept getBusinessStatus() { 
2383      if (this.businessStatus == null)
2384        if (Configuration.errorOnAutoCreate())
2385          throw new Error("Attempt to auto-create Task.businessStatus");
2386        else if (Configuration.doAutoCreate())
2387          this.businessStatus = new CodeableConcept(); // cc
2388      return this.businessStatus;
2389    }
2390
2391    public boolean hasBusinessStatus() { 
2392      return this.businessStatus != null && !this.businessStatus.isEmpty();
2393    }
2394
2395    /**
2396     * @param value {@link #businessStatus} (Contains business-specific nuances of the business state.)
2397     */
2398    public Task setBusinessStatus(CodeableConcept value) { 
2399      this.businessStatus = value;
2400      return this;
2401    }
2402
2403    /**
2404     * @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
2405     */
2406    public Enumeration<TaskIntent> getIntentElement() { 
2407      if (this.intent == null)
2408        if (Configuration.errorOnAutoCreate())
2409          throw new Error("Attempt to auto-create Task.intent");
2410        else if (Configuration.doAutoCreate())
2411          this.intent = new Enumeration<TaskIntent>(new TaskIntentEnumFactory()); // bb
2412      return this.intent;
2413    }
2414
2415    public boolean hasIntentElement() { 
2416      return this.intent != null && !this.intent.isEmpty();
2417    }
2418
2419    public boolean hasIntent() { 
2420      return this.intent != null && !this.intent.isEmpty();
2421    }
2422
2423    /**
2424     * @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
2425     */
2426    public Task setIntentElement(Enumeration<TaskIntent> value) { 
2427      this.intent = value;
2428      return this;
2429    }
2430
2431    /**
2432     * @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.
2433     */
2434    public TaskIntent getIntent() { 
2435      return this.intent == null ? null : this.intent.getValue();
2436    }
2437
2438    /**
2439     * @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.
2440     */
2441    public Task setIntent(TaskIntent value) { 
2442        if (this.intent == null)
2443          this.intent = new Enumeration<TaskIntent>(new TaskIntentEnumFactory());
2444        this.intent.setValue(value);
2445      return this;
2446    }
2447
2448    /**
2449     * @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
2450     */
2451    public Enumeration<TaskPriority> getPriorityElement() { 
2452      if (this.priority == null)
2453        if (Configuration.errorOnAutoCreate())
2454          throw new Error("Attempt to auto-create Task.priority");
2455        else if (Configuration.doAutoCreate())
2456          this.priority = new Enumeration<TaskPriority>(new TaskPriorityEnumFactory()); // bb
2457      return this.priority;
2458    }
2459
2460    public boolean hasPriorityElement() { 
2461      return this.priority != null && !this.priority.isEmpty();
2462    }
2463
2464    public boolean hasPriority() { 
2465      return this.priority != null && !this.priority.isEmpty();
2466    }
2467
2468    /**
2469     * @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
2470     */
2471    public Task setPriorityElement(Enumeration<TaskPriority> value) { 
2472      this.priority = value;
2473      return this;
2474    }
2475
2476    /**
2477     * @return Indicates how quickly the Task should be addressed with respect to other requests.
2478     */
2479    public TaskPriority getPriority() { 
2480      return this.priority == null ? null : this.priority.getValue();
2481    }
2482
2483    /**
2484     * @param value Indicates how quickly the Task should be addressed with respect to other requests.
2485     */
2486    public Task setPriority(TaskPriority value) { 
2487      if (value == null)
2488        this.priority = null;
2489      else {
2490        if (this.priority == null)
2491          this.priority = new Enumeration<TaskPriority>(new TaskPriorityEnumFactory());
2492        this.priority.setValue(value);
2493      }
2494      return this;
2495    }
2496
2497    /**
2498     * @return {@link #code} (A name or code (or both) briefly describing what the task involves.)
2499     */
2500    public CodeableConcept getCode() { 
2501      if (this.code == null)
2502        if (Configuration.errorOnAutoCreate())
2503          throw new Error("Attempt to auto-create Task.code");
2504        else if (Configuration.doAutoCreate())
2505          this.code = new CodeableConcept(); // cc
2506      return this.code;
2507    }
2508
2509    public boolean hasCode() { 
2510      return this.code != null && !this.code.isEmpty();
2511    }
2512
2513    /**
2514     * @param value {@link #code} (A name or code (or both) briefly describing what the task involves.)
2515     */
2516    public Task setCode(CodeableConcept value) { 
2517      this.code = value;
2518      return this;
2519    }
2520
2521    /**
2522     * @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
2523     */
2524    public StringType getDescriptionElement() { 
2525      if (this.description == null)
2526        if (Configuration.errorOnAutoCreate())
2527          throw new Error("Attempt to auto-create Task.description");
2528        else if (Configuration.doAutoCreate())
2529          this.description = new StringType(); // bb
2530      return this.description;
2531    }
2532
2533    public boolean hasDescriptionElement() { 
2534      return this.description != null && !this.description.isEmpty();
2535    }
2536
2537    public boolean hasDescription() { 
2538      return this.description != null && !this.description.isEmpty();
2539    }
2540
2541    /**
2542     * @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
2543     */
2544    public Task setDescriptionElement(StringType value) { 
2545      this.description = value;
2546      return this;
2547    }
2548
2549    /**
2550     * @return A free-text description of what is to be performed.
2551     */
2552    public String getDescription() { 
2553      return this.description == null ? null : this.description.getValue();
2554    }
2555
2556    /**
2557     * @param value A free-text description of what is to be performed.
2558     */
2559    public Task setDescription(String value) { 
2560      if (Utilities.noString(value))
2561        this.description = null;
2562      else {
2563        if (this.description == null)
2564          this.description = new StringType();
2565        this.description.setValue(value);
2566      }
2567      return this;
2568    }
2569
2570    /**
2571     * @return {@link #focus} (The request being actioned or the resource being manipulated by this task.)
2572     */
2573    public Reference getFocus() { 
2574      if (this.focus == null)
2575        if (Configuration.errorOnAutoCreate())
2576          throw new Error("Attempt to auto-create Task.focus");
2577        else if (Configuration.doAutoCreate())
2578          this.focus = new Reference(); // cc
2579      return this.focus;
2580    }
2581
2582    public boolean hasFocus() { 
2583      return this.focus != null && !this.focus.isEmpty();
2584    }
2585
2586    /**
2587     * @param value {@link #focus} (The request being actioned or the resource being manipulated by this task.)
2588     */
2589    public Task setFocus(Reference value) { 
2590      this.focus = value;
2591      return this;
2592    }
2593
2594    /**
2595     * @return {@link #focus} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The request being actioned or the resource being manipulated by this task.)
2596     */
2597    public Resource getFocusTarget() { 
2598      return this.focusTarget;
2599    }
2600
2601    /**
2602     * @param value {@link #focus} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The request being actioned or the resource being manipulated by this task.)
2603     */
2604    public Task setFocusTarget(Resource value) { 
2605      this.focusTarget = value;
2606      return this;
2607    }
2608
2609    /**
2610     * @return {@link #for_} (The entity who benefits from the performance of the service specified in the task (e.g., the patient).)
2611     */
2612    public Reference getFor() { 
2613      if (this.for_ == null)
2614        if (Configuration.errorOnAutoCreate())
2615          throw new Error("Attempt to auto-create Task.for_");
2616        else if (Configuration.doAutoCreate())
2617          this.for_ = new Reference(); // cc
2618      return this.for_;
2619    }
2620
2621    public boolean hasFor() { 
2622      return this.for_ != null && !this.for_.isEmpty();
2623    }
2624
2625    /**
2626     * @param value {@link #for_} (The entity who benefits from the performance of the service specified in the task (e.g., the patient).)
2627     */
2628    public Task setFor(Reference value) { 
2629      this.for_ = value;
2630      return this;
2631    }
2632
2633    /**
2634     * @return {@link #for_} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity who benefits from the performance of the service specified in the task (e.g., the patient).)
2635     */
2636    public Resource getForTarget() { 
2637      return this.for_Target;
2638    }
2639
2640    /**
2641     * @param value {@link #for_} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity who benefits from the performance of the service specified in the task (e.g., the patient).)
2642     */
2643    public Task setForTarget(Resource value) { 
2644      this.for_Target = value;
2645      return this;
2646    }
2647
2648    /**
2649     * @return {@link #context} (The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.)
2650     */
2651    public Reference getContext() { 
2652      if (this.context == null)
2653        if (Configuration.errorOnAutoCreate())
2654          throw new Error("Attempt to auto-create Task.context");
2655        else if (Configuration.doAutoCreate())
2656          this.context = new Reference(); // cc
2657      return this.context;
2658    }
2659
2660    public boolean hasContext() { 
2661      return this.context != null && !this.context.isEmpty();
2662    }
2663
2664    /**
2665     * @param value {@link #context} (The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.)
2666     */
2667    public Task setContext(Reference value) { 
2668      this.context = value;
2669      return this;
2670    }
2671
2672    /**
2673     * @return {@link #context} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.)
2674     */
2675    public Resource getContextTarget() { 
2676      return this.contextTarget;
2677    }
2678
2679    /**
2680     * @param value {@link #context} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.)
2681     */
2682    public Task setContextTarget(Resource value) { 
2683      this.contextTarget = value;
2684      return this;
2685    }
2686
2687    /**
2688     * @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).)
2689     */
2690    public Period getExecutionPeriod() { 
2691      if (this.executionPeriod == null)
2692        if (Configuration.errorOnAutoCreate())
2693          throw new Error("Attempt to auto-create Task.executionPeriod");
2694        else if (Configuration.doAutoCreate())
2695          this.executionPeriod = new Period(); // cc
2696      return this.executionPeriod;
2697    }
2698
2699    public boolean hasExecutionPeriod() { 
2700      return this.executionPeriod != null && !this.executionPeriod.isEmpty();
2701    }
2702
2703    /**
2704     * @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).)
2705     */
2706    public Task setExecutionPeriod(Period value) { 
2707      this.executionPeriod = value;
2708      return this;
2709    }
2710
2711    /**
2712     * @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
2713     */
2714    public DateTimeType getAuthoredOnElement() { 
2715      if (this.authoredOn == null)
2716        if (Configuration.errorOnAutoCreate())
2717          throw new Error("Attempt to auto-create Task.authoredOn");
2718        else if (Configuration.doAutoCreate())
2719          this.authoredOn = new DateTimeType(); // bb
2720      return this.authoredOn;
2721    }
2722
2723    public boolean hasAuthoredOnElement() { 
2724      return this.authoredOn != null && !this.authoredOn.isEmpty();
2725    }
2726
2727    public boolean hasAuthoredOn() { 
2728      return this.authoredOn != null && !this.authoredOn.isEmpty();
2729    }
2730
2731    /**
2732     * @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
2733     */
2734    public Task setAuthoredOnElement(DateTimeType value) { 
2735      this.authoredOn = value;
2736      return this;
2737    }
2738
2739    /**
2740     * @return The date and time this task was created.
2741     */
2742    public Date getAuthoredOn() { 
2743      return this.authoredOn == null ? null : this.authoredOn.getValue();
2744    }
2745
2746    /**
2747     * @param value The date and time this task was created.
2748     */
2749    public Task setAuthoredOn(Date value) { 
2750      if (value == null)
2751        this.authoredOn = null;
2752      else {
2753        if (this.authoredOn == null)
2754          this.authoredOn = new DateTimeType();
2755        this.authoredOn.setValue(value);
2756      }
2757      return this;
2758    }
2759
2760    /**
2761     * @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
2762     */
2763    public DateTimeType getLastModifiedElement() { 
2764      if (this.lastModified == null)
2765        if (Configuration.errorOnAutoCreate())
2766          throw new Error("Attempt to auto-create Task.lastModified");
2767        else if (Configuration.doAutoCreate())
2768          this.lastModified = new DateTimeType(); // bb
2769      return this.lastModified;
2770    }
2771
2772    public boolean hasLastModifiedElement() { 
2773      return this.lastModified != null && !this.lastModified.isEmpty();
2774    }
2775
2776    public boolean hasLastModified() { 
2777      return this.lastModified != null && !this.lastModified.isEmpty();
2778    }
2779
2780    /**
2781     * @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
2782     */
2783    public Task setLastModifiedElement(DateTimeType value) { 
2784      this.lastModified = value;
2785      return this;
2786    }
2787
2788    /**
2789     * @return The date and time of last modification to this task.
2790     */
2791    public Date getLastModified() { 
2792      return this.lastModified == null ? null : this.lastModified.getValue();
2793    }
2794
2795    /**
2796     * @param value The date and time of last modification to this task.
2797     */
2798    public Task setLastModified(Date value) { 
2799      if (value == null)
2800        this.lastModified = null;
2801      else {
2802        if (this.lastModified == null)
2803          this.lastModified = new DateTimeType();
2804        this.lastModified.setValue(value);
2805      }
2806      return this;
2807    }
2808
2809    /**
2810     * @return {@link #requester} (The creator of the task.)
2811     */
2812    public Reference getRequester() { 
2813      if (this.requester == null)
2814        if (Configuration.errorOnAutoCreate())
2815          throw new Error("Attempt to auto-create Task.requester");
2816        else if (Configuration.doAutoCreate())
2817          this.requester = new Reference(); // cc
2818      return this.requester;
2819    }
2820
2821    public boolean hasRequester() { 
2822      return this.requester != null && !this.requester.isEmpty();
2823    }
2824
2825    /**
2826     * @param value {@link #requester} (The creator of the task.)
2827     */
2828    public Task setRequester(Reference value) { 
2829      this.requester = value;
2830      return this;
2831    }
2832
2833    /**
2834     * @return {@link #requester} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The creator of the task.)
2835     */
2836    public Resource getRequesterTarget() { 
2837      return this.requesterTarget;
2838    }
2839
2840    /**
2841     * @param value {@link #requester} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The creator of the task.)
2842     */
2843    public Task setRequesterTarget(Resource value) { 
2844      this.requesterTarget = value;
2845      return this;
2846    }
2847
2848    /**
2849     * @return {@link #performerType} (The type of participant that can execute the task.)
2850     */
2851    public List<CodeableConcept> getPerformerType() { 
2852      if (this.performerType == null)
2853        this.performerType = new ArrayList<CodeableConcept>();
2854      return this.performerType;
2855    }
2856
2857    /**
2858     * @return Returns a reference to <code>this</code> for easy method chaining
2859     */
2860    public Task setPerformerType(List<CodeableConcept> thePerformerType) { 
2861      this.performerType = thePerformerType;
2862      return this;
2863    }
2864
2865    public boolean hasPerformerType() { 
2866      if (this.performerType == null)
2867        return false;
2868      for (CodeableConcept item : this.performerType)
2869        if (!item.isEmpty())
2870          return true;
2871      return false;
2872    }
2873
2874    public CodeableConcept addPerformerType() { //3
2875      CodeableConcept t = new CodeableConcept();
2876      if (this.performerType == null)
2877        this.performerType = new ArrayList<CodeableConcept>();
2878      this.performerType.add(t);
2879      return t;
2880    }
2881
2882    public Task addPerformerType(CodeableConcept t) { //3
2883      if (t == null)
2884        return this;
2885      if (this.performerType == null)
2886        this.performerType = new ArrayList<CodeableConcept>();
2887      this.performerType.add(t);
2888      return this;
2889    }
2890
2891    /**
2892     * @return The first repetition of repeating field {@link #performerType}, creating it if it does not already exist
2893     */
2894    public CodeableConcept getPerformerTypeFirstRep() { 
2895      if (getPerformerType().isEmpty()) {
2896        addPerformerType();
2897      }
2898      return getPerformerType().get(0);
2899    }
2900
2901    /**
2902     * @return {@link #owner} (Individual organization or Device currently responsible for task execution.)
2903     */
2904    public Reference getOwner() { 
2905      if (this.owner == null)
2906        if (Configuration.errorOnAutoCreate())
2907          throw new Error("Attempt to auto-create Task.owner");
2908        else if (Configuration.doAutoCreate())
2909          this.owner = new Reference(); // cc
2910      return this.owner;
2911    }
2912
2913    public boolean hasOwner() { 
2914      return this.owner != null && !this.owner.isEmpty();
2915    }
2916
2917    /**
2918     * @param value {@link #owner} (Individual organization or Device currently responsible for task execution.)
2919     */
2920    public Task setOwner(Reference value) { 
2921      this.owner = value;
2922      return this;
2923    }
2924
2925    /**
2926     * @return {@link #owner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Individual organization or Device currently responsible for task execution.)
2927     */
2928    public Resource getOwnerTarget() { 
2929      return this.ownerTarget;
2930    }
2931
2932    /**
2933     * @param value {@link #owner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Individual organization or Device currently responsible for task execution.)
2934     */
2935    public Task setOwnerTarget(Resource value) { 
2936      this.ownerTarget = value;
2937      return this;
2938    }
2939
2940    /**
2941     * @return {@link #reasonCode} (A description or code indicating why this task needs to be performed.)
2942     */
2943    public CodeableConcept getReasonCode() { 
2944      if (this.reasonCode == null)
2945        if (Configuration.errorOnAutoCreate())
2946          throw new Error("Attempt to auto-create Task.reasonCode");
2947        else if (Configuration.doAutoCreate())
2948          this.reasonCode = new CodeableConcept(); // cc
2949      return this.reasonCode;
2950    }
2951
2952    public boolean hasReasonCode() { 
2953      return this.reasonCode != null && !this.reasonCode.isEmpty();
2954    }
2955
2956    /**
2957     * @param value {@link #reasonCode} (A description or code indicating why this task needs to be performed.)
2958     */
2959    public Task setReasonCode(CodeableConcept value) { 
2960      this.reasonCode = value;
2961      return this;
2962    }
2963
2964    /**
2965     * @return {@link #reasonReference} (A resource reference indicating why this task needs to be performed.)
2966     */
2967    public Reference getReasonReference() { 
2968      if (this.reasonReference == null)
2969        if (Configuration.errorOnAutoCreate())
2970          throw new Error("Attempt to auto-create Task.reasonReference");
2971        else if (Configuration.doAutoCreate())
2972          this.reasonReference = new Reference(); // cc
2973      return this.reasonReference;
2974    }
2975
2976    public boolean hasReasonReference() { 
2977      return this.reasonReference != null && !this.reasonReference.isEmpty();
2978    }
2979
2980    /**
2981     * @param value {@link #reasonReference} (A resource reference indicating why this task needs to be performed.)
2982     */
2983    public Task setReasonReference(Reference value) { 
2984      this.reasonReference = value;
2985      return this;
2986    }
2987
2988    /**
2989     * @return {@link #reasonReference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A resource reference indicating why this task needs to be performed.)
2990     */
2991    public Resource getReasonReferenceTarget() { 
2992      return this.reasonReferenceTarget;
2993    }
2994
2995    /**
2996     * @param value {@link #reasonReference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A resource reference indicating why this task needs to be performed.)
2997     */
2998    public Task setReasonReferenceTarget(Resource value) { 
2999      this.reasonReferenceTarget = value;
3000      return this;
3001    }
3002
3003    /**
3004     * @return {@link #note} (Free-text information captured about the task as it progresses.)
3005     */
3006    public List<Annotation> getNote() { 
3007      if (this.note == null)
3008        this.note = new ArrayList<Annotation>();
3009      return this.note;
3010    }
3011
3012    /**
3013     * @return Returns a reference to <code>this</code> for easy method chaining
3014     */
3015    public Task setNote(List<Annotation> theNote) { 
3016      this.note = theNote;
3017      return this;
3018    }
3019
3020    public boolean hasNote() { 
3021      if (this.note == null)
3022        return false;
3023      for (Annotation item : this.note)
3024        if (!item.isEmpty())
3025          return true;
3026      return false;
3027    }
3028
3029    public Annotation addNote() { //3
3030      Annotation t = new Annotation();
3031      if (this.note == null)
3032        this.note = new ArrayList<Annotation>();
3033      this.note.add(t);
3034      return t;
3035    }
3036
3037    public Task addNote(Annotation t) { //3
3038      if (t == null)
3039        return this;
3040      if (this.note == null)
3041        this.note = new ArrayList<Annotation>();
3042      this.note.add(t);
3043      return this;
3044    }
3045
3046    /**
3047     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
3048     */
3049    public Annotation getNoteFirstRep() { 
3050      if (getNote().isEmpty()) {
3051        addNote();
3052      }
3053      return getNote().get(0);
3054    }
3055
3056    /**
3057     * @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.)
3058     */
3059    public List<Reference> getRelevantHistory() { 
3060      if (this.relevantHistory == null)
3061        this.relevantHistory = new ArrayList<Reference>();
3062      return this.relevantHistory;
3063    }
3064
3065    /**
3066     * @return Returns a reference to <code>this</code> for easy method chaining
3067     */
3068    public Task setRelevantHistory(List<Reference> theRelevantHistory) { 
3069      this.relevantHistory = theRelevantHistory;
3070      return this;
3071    }
3072
3073    public boolean hasRelevantHistory() { 
3074      if (this.relevantHistory == null)
3075        return false;
3076      for (Reference item : this.relevantHistory)
3077        if (!item.isEmpty())
3078          return true;
3079      return false;
3080    }
3081
3082    public Reference addRelevantHistory() { //3
3083      Reference t = new Reference();
3084      if (this.relevantHistory == null)
3085        this.relevantHistory = new ArrayList<Reference>();
3086      this.relevantHistory.add(t);
3087      return t;
3088    }
3089
3090    public Task addRelevantHistory(Reference t) { //3
3091      if (t == null)
3092        return this;
3093      if (this.relevantHistory == null)
3094        this.relevantHistory = new ArrayList<Reference>();
3095      this.relevantHistory.add(t);
3096      return this;
3097    }
3098
3099    /**
3100     * @return The first repetition of repeating field {@link #relevantHistory}, creating it if it does not already exist
3101     */
3102    public Reference getRelevantHistoryFirstRep() { 
3103      if (getRelevantHistory().isEmpty()) {
3104        addRelevantHistory();
3105      }
3106      return getRelevantHistory().get(0);
3107    }
3108
3109    /**
3110     * @deprecated Use Reference#setResource(IBaseResource) instead
3111     */
3112    @Deprecated
3113    public List<Provenance> getRelevantHistoryTarget() { 
3114      if (this.relevantHistoryTarget == null)
3115        this.relevantHistoryTarget = new ArrayList<Provenance>();
3116      return this.relevantHistoryTarget;
3117    }
3118
3119    /**
3120     * @deprecated Use Reference#setResource(IBaseResource) instead
3121     */
3122    @Deprecated
3123    public Provenance addRelevantHistoryTarget() { 
3124      Provenance r = new Provenance();
3125      if (this.relevantHistoryTarget == null)
3126        this.relevantHistoryTarget = new ArrayList<Provenance>();
3127      this.relevantHistoryTarget.add(r);
3128      return r;
3129    }
3130
3131    /**
3132     * @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.)
3133     */
3134    public TaskRestrictionComponent getRestriction() { 
3135      if (this.restriction == null)
3136        if (Configuration.errorOnAutoCreate())
3137          throw new Error("Attempt to auto-create Task.restriction");
3138        else if (Configuration.doAutoCreate())
3139          this.restriction = new TaskRestrictionComponent(); // cc
3140      return this.restriction;
3141    }
3142
3143    public boolean hasRestriction() { 
3144      return this.restriction != null && !this.restriction.isEmpty();
3145    }
3146
3147    /**
3148     * @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.)
3149     */
3150    public Task setRestriction(TaskRestrictionComponent value) { 
3151      this.restriction = value;
3152      return this;
3153    }
3154
3155    /**
3156     * @return {@link #input} (Additional information that may be needed in the execution of the task.)
3157     */
3158    public List<ParameterComponent> getInput() { 
3159      if (this.input == null)
3160        this.input = new ArrayList<ParameterComponent>();
3161      return this.input;
3162    }
3163
3164    /**
3165     * @return Returns a reference to <code>this</code> for easy method chaining
3166     */
3167    public Task setInput(List<ParameterComponent> theInput) { 
3168      this.input = theInput;
3169      return this;
3170    }
3171
3172    public boolean hasInput() { 
3173      if (this.input == null)
3174        return false;
3175      for (ParameterComponent item : this.input)
3176        if (!item.isEmpty())
3177          return true;
3178      return false;
3179    }
3180
3181    public ParameterComponent addInput() { //3
3182      ParameterComponent t = new ParameterComponent();
3183      if (this.input == null)
3184        this.input = new ArrayList<ParameterComponent>();
3185      this.input.add(t);
3186      return t;
3187    }
3188
3189    public Task addInput(ParameterComponent t) { //3
3190      if (t == null)
3191        return this;
3192      if (this.input == null)
3193        this.input = new ArrayList<ParameterComponent>();
3194      this.input.add(t);
3195      return this;
3196    }
3197
3198    /**
3199     * @return The first repetition of repeating field {@link #input}, creating it if it does not already exist
3200     */
3201    public ParameterComponent getInputFirstRep() { 
3202      if (getInput().isEmpty()) {
3203        addInput();
3204      }
3205      return getInput().get(0);
3206    }
3207
3208    /**
3209     * @return {@link #output} (Outputs produced by the Task.)
3210     */
3211    public List<TaskOutputComponent> getOutput() { 
3212      if (this.output == null)
3213        this.output = new ArrayList<TaskOutputComponent>();
3214      return this.output;
3215    }
3216
3217    /**
3218     * @return Returns a reference to <code>this</code> for easy method chaining
3219     */
3220    public Task setOutput(List<TaskOutputComponent> theOutput) { 
3221      this.output = theOutput;
3222      return this;
3223    }
3224
3225    public boolean hasOutput() { 
3226      if (this.output == null)
3227        return false;
3228      for (TaskOutputComponent item : this.output)
3229        if (!item.isEmpty())
3230          return true;
3231      return false;
3232    }
3233
3234    public TaskOutputComponent addOutput() { //3
3235      TaskOutputComponent t = new TaskOutputComponent();
3236      if (this.output == null)
3237        this.output = new ArrayList<TaskOutputComponent>();
3238      this.output.add(t);
3239      return t;
3240    }
3241
3242    public Task addOutput(TaskOutputComponent t) { //3
3243      if (t == null)
3244        return this;
3245      if (this.output == null)
3246        this.output = new ArrayList<TaskOutputComponent>();
3247      this.output.add(t);
3248      return this;
3249    }
3250
3251    /**
3252     * @return The first repetition of repeating field {@link #output}, creating it if it does not already exist
3253     */
3254    public TaskOutputComponent getOutputFirstRep() { 
3255      if (getOutput().isEmpty()) {
3256        addOutput();
3257      }
3258      return getOutput().get(0);
3259    }
3260
3261      protected void listChildren(List<Property> children) {
3262        super.listChildren(children);
3263        children.add(new Property("identifier", "Identifier", "The business identifier for this task.", 0, java.lang.Integer.MAX_VALUE, identifier));
3264        children.add(new Property("instantiates[x]", "uri|Reference(ActivityDefinition)", "A reference to a formal or informal definition of the task.  For example, a protocol, a step within a defined workflow definition, etc.", 0, 1, instantiates));
3265        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));
3266        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));
3267        children.add(new Property("partOf", "Reference(Task)", "Task that this particular task is part of.", 0, java.lang.Integer.MAX_VALUE, partOf));
3268        children.add(new Property("status", "code", "The current status of the task.", 0, 1, status));
3269        children.add(new Property("statusReason", "CodeableConcept", "An explanation as to why this task is held, failed, was refused, etc.", 0, 1, statusReason));
3270        children.add(new Property("businessStatus", "CodeableConcept", "Contains business-specific nuances of the business state.", 0, 1, businessStatus));
3271        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));
3272        children.add(new Property("priority", "code", "Indicates how quickly the Task should be addressed with respect to other requests.", 0, 1, priority));
3273        children.add(new Property("code", "CodeableConcept", "A name or code (or both) briefly describing what the task involves.", 0, 1, code));
3274        children.add(new Property("description", "string", "A free-text description of what is to be performed.", 0, 1, description));
3275        children.add(new Property("focus", "Reference(Any)", "The request being actioned or the resource being manipulated by this task.", 0, 1, focus));
3276        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_));
3277        children.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.", 0, 1, context));
3278        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));
3279        children.add(new Property("authoredOn", "dateTime", "The date and time this task was created.", 0, 1, authoredOn));
3280        children.add(new Property("lastModified", "dateTime", "The date and time of last modification to this task.", 0, 1, lastModified));
3281        children.add(new Property("requester", "Reference(Device|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "The creator of the task.", 0, 1, requester));
3282        children.add(new Property("performerType", "CodeableConcept", "The type of participant that can execute the task.", 0, java.lang.Integer.MAX_VALUE, performerType));
3283        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));
3284        children.add(new Property("reasonCode", "CodeableConcept", "A description or code indicating why this task needs to be performed.", 0, 1, reasonCode));
3285        children.add(new Property("reasonReference", "Reference(Any)", "A resource reference indicating why this task needs to be performed.", 0, 1, reasonReference));
3286        children.add(new Property("note", "Annotation", "Free-text information captured about the task as it progresses.", 0, java.lang.Integer.MAX_VALUE, note));
3287        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));
3288        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));
3289        children.add(new Property("input", "", "Additional information that may be needed in the execution of the task.", 0, java.lang.Integer.MAX_VALUE, input));
3290        children.add(new Property("output", "", "Outputs produced by the Task.", 0, java.lang.Integer.MAX_VALUE, output));
3291      }
3292
3293      @Override
3294      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3295        switch (_hash) {
3296        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "The business identifier for this task.", 0, java.lang.Integer.MAX_VALUE, identifier);
3297        case -1926387433: /*instantiates[x]*/  return new Property("instantiates[x]", "uri|Reference(ActivityDefinition)", "A reference to a formal or informal definition of the task.  For example, a protocol, a step within a defined workflow definition, etc.", 0, 1, instantiates);
3298        case -246883639: /*instantiates*/  return new Property("instantiates[x]", "uri|Reference(ActivityDefinition)", "A reference to a formal or informal definition of the task.  For example, a protocol, a step within a defined workflow definition, etc.", 0, 1, instantiates);
3299        case -1926393373: /*instantiatesUri*/  return new Property("instantiates[x]", "uri|Reference(ActivityDefinition)", "A reference to a formal or informal definition of the task.  For example, a protocol, a step within a defined workflow definition, etc.", 0, 1, instantiates);
3300        case -1744595326: /*instantiatesReference*/  return new Property("instantiates[x]", "uri|Reference(ActivityDefinition)", "A reference to a formal or informal definition of the task.  For example, a protocol, a step within a defined workflow definition, etc.", 0, 1, instantiates);
3301        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);
3302        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);
3303        case -995410646: /*partOf*/  return new Property("partOf", "Reference(Task)", "Task that this particular task is part of.", 0, java.lang.Integer.MAX_VALUE, partOf);
3304        case -892481550: /*status*/  return new Property("status", "code", "The current status of the task.", 0, 1, status);
3305        case 2051346646: /*statusReason*/  return new Property("statusReason", "CodeableConcept", "An explanation as to why this task is held, failed, was refused, etc.", 0, 1, statusReason);
3306        case 2008591314: /*businessStatus*/  return new Property("businessStatus", "CodeableConcept", "Contains business-specific nuances of the business state.", 0, 1, businessStatus);
3307        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);
3308        case -1165461084: /*priority*/  return new Property("priority", "code", "Indicates how quickly the Task should be addressed with respect to other requests.", 0, 1, priority);
3309        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A name or code (or both) briefly describing what the task involves.", 0, 1, code);
3310        case -1724546052: /*description*/  return new Property("description", "string", "A free-text description of what is to be performed.", 0, 1, description);
3311        case 97604824: /*focus*/  return new Property("focus", "Reference(Any)", "The request being actioned or the resource being manipulated by this task.", 0, 1, focus);
3312        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_);
3313        case 951530927: /*context*/  return new Property("context", "Reference(Encounter|EpisodeOfCare)", "The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.", 0, 1, context);
3314        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);
3315        case -1500852503: /*authoredOn*/  return new Property("authoredOn", "dateTime", "The date and time this task was created.", 0, 1, authoredOn);
3316        case 1959003007: /*lastModified*/  return new Property("lastModified", "dateTime", "The date and time of last modification to this task.", 0, 1, lastModified);
3317        case 693933948: /*requester*/  return new Property("requester", "Reference(Device|Organization|Patient|Practitioner|PractitionerRole|RelatedPerson)", "The creator of the task.", 0, 1, requester);
3318        case -901444568: /*performerType*/  return new Property("performerType", "CodeableConcept", "The type of participant that can execute the task.", 0, java.lang.Integer.MAX_VALUE, performerType);
3319        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);
3320        case 722137681: /*reasonCode*/  return new Property("reasonCode", "CodeableConcept", "A description or code indicating why this task needs to be performed.", 0, 1, reasonCode);
3321        case -1146218137: /*reasonReference*/  return new Property("reasonReference", "Reference(Any)", "A resource reference indicating why this task needs to be performed.", 0, 1, reasonReference);
3322        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);
3323        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);
3324        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);
3325        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);
3326        case -1005512447: /*output*/  return new Property("output", "", "Outputs produced by the Task.", 0, java.lang.Integer.MAX_VALUE, output);
3327        default: return super.getNamedProperty(_hash, _name, _checkValid);
3328        }
3329
3330      }
3331
3332      @Override
3333      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3334        switch (hash) {
3335        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3336        case -246883639: /*instantiates*/ return this.instantiates == null ? new Base[0] : new Base[] {this.instantiates}; // Type
3337        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
3338        case -445338488: /*groupIdentifier*/ return this.groupIdentifier == null ? new Base[0] : new Base[] {this.groupIdentifier}; // Identifier
3339        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
3340        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<TaskStatus>
3341        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // CodeableConcept
3342        case 2008591314: /*businessStatus*/ return this.businessStatus == null ? new Base[0] : new Base[] {this.businessStatus}; // CodeableConcept
3343        case -1183762788: /*intent*/ return this.intent == null ? new Base[0] : new Base[] {this.intent}; // Enumeration<TaskIntent>
3344        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration<TaskPriority>
3345        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
3346        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
3347        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : new Base[] {this.focus}; // Reference
3348        case 101577: /*for*/ return this.for_ == null ? new Base[0] : new Base[] {this.for_}; // Reference
3349        case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference
3350        case 1218624249: /*executionPeriod*/ return this.executionPeriod == null ? new Base[0] : new Base[] {this.executionPeriod}; // Period
3351        case -1500852503: /*authoredOn*/ return this.authoredOn == null ? new Base[0] : new Base[] {this.authoredOn}; // DateTimeType
3352        case 1959003007: /*lastModified*/ return this.lastModified == null ? new Base[0] : new Base[] {this.lastModified}; // DateTimeType
3353        case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference
3354        case -901444568: /*performerType*/ return this.performerType == null ? new Base[0] : this.performerType.toArray(new Base[this.performerType.size()]); // CodeableConcept
3355        case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference
3356        case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : new Base[] {this.reasonCode}; // CodeableConcept
3357        case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : new Base[] {this.reasonReference}; // Reference
3358        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
3359        case 1538891575: /*relevantHistory*/ return this.relevantHistory == null ? new Base[0] : this.relevantHistory.toArray(new Base[this.relevantHistory.size()]); // Reference
3360        case -1561062452: /*restriction*/ return this.restriction == null ? new Base[0] : new Base[] {this.restriction}; // TaskRestrictionComponent
3361        case 100358090: /*input*/ return this.input == null ? new Base[0] : this.input.toArray(new Base[this.input.size()]); // ParameterComponent
3362        case -1005512447: /*output*/ return this.output == null ? new Base[0] : this.output.toArray(new Base[this.output.size()]); // TaskOutputComponent
3363        default: return super.getProperty(hash, name, checkValid);
3364        }
3365
3366      }
3367
3368      @Override
3369      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3370        switch (hash) {
3371        case -1618432855: // identifier
3372          this.getIdentifier().add(castToIdentifier(value)); // Identifier
3373          return value;
3374        case -246883639: // instantiates
3375          this.instantiates = castToType(value); // Type
3376          return value;
3377        case -332612366: // basedOn
3378          this.getBasedOn().add(castToReference(value)); // Reference
3379          return value;
3380        case -445338488: // groupIdentifier
3381          this.groupIdentifier = castToIdentifier(value); // Identifier
3382          return value;
3383        case -995410646: // partOf
3384          this.getPartOf().add(castToReference(value)); // Reference
3385          return value;
3386        case -892481550: // status
3387          value = new TaskStatusEnumFactory().fromType(castToCode(value));
3388          this.status = (Enumeration) value; // Enumeration<TaskStatus>
3389          return value;
3390        case 2051346646: // statusReason
3391          this.statusReason = castToCodeableConcept(value); // CodeableConcept
3392          return value;
3393        case 2008591314: // businessStatus
3394          this.businessStatus = castToCodeableConcept(value); // CodeableConcept
3395          return value;
3396        case -1183762788: // intent
3397          value = new TaskIntentEnumFactory().fromType(castToCode(value));
3398          this.intent = (Enumeration) value; // Enumeration<TaskIntent>
3399          return value;
3400        case -1165461084: // priority
3401          value = new TaskPriorityEnumFactory().fromType(castToCode(value));
3402          this.priority = (Enumeration) value; // Enumeration<TaskPriority>
3403          return value;
3404        case 3059181: // code
3405          this.code = castToCodeableConcept(value); // CodeableConcept
3406          return value;
3407        case -1724546052: // description
3408          this.description = castToString(value); // StringType
3409          return value;
3410        case 97604824: // focus
3411          this.focus = castToReference(value); // Reference
3412          return value;
3413        case 101577: // for
3414          this.for_ = castToReference(value); // Reference
3415          return value;
3416        case 951530927: // context
3417          this.context = castToReference(value); // Reference
3418          return value;
3419        case 1218624249: // executionPeriod
3420          this.executionPeriod = castToPeriod(value); // Period
3421          return value;
3422        case -1500852503: // authoredOn
3423          this.authoredOn = castToDateTime(value); // DateTimeType
3424          return value;
3425        case 1959003007: // lastModified
3426          this.lastModified = castToDateTime(value); // DateTimeType
3427          return value;
3428        case 693933948: // requester
3429          this.requester = castToReference(value); // Reference
3430          return value;
3431        case -901444568: // performerType
3432          this.getPerformerType().add(castToCodeableConcept(value)); // CodeableConcept
3433          return value;
3434        case 106164915: // owner
3435          this.owner = castToReference(value); // Reference
3436          return value;
3437        case 722137681: // reasonCode
3438          this.reasonCode = castToCodeableConcept(value); // CodeableConcept
3439          return value;
3440        case -1146218137: // reasonReference
3441          this.reasonReference = castToReference(value); // Reference
3442          return value;
3443        case 3387378: // note
3444          this.getNote().add(castToAnnotation(value)); // Annotation
3445          return value;
3446        case 1538891575: // relevantHistory
3447          this.getRelevantHistory().add(castToReference(value)); // Reference
3448          return value;
3449        case -1561062452: // restriction
3450          this.restriction = (TaskRestrictionComponent) value; // TaskRestrictionComponent
3451          return value;
3452        case 100358090: // input
3453          this.getInput().add((ParameterComponent) value); // ParameterComponent
3454          return value;
3455        case -1005512447: // output
3456          this.getOutput().add((TaskOutputComponent) value); // TaskOutputComponent
3457          return value;
3458        default: return super.setProperty(hash, name, value);
3459        }
3460
3461      }
3462
3463      @Override
3464      public Base setProperty(String name, Base value) throws FHIRException {
3465        if (name.equals("identifier")) {
3466          this.getIdentifier().add(castToIdentifier(value));
3467        } else if (name.equals("instantiates[x]")) {
3468          this.instantiates = castToType(value); // Type
3469        } else if (name.equals("basedOn")) {
3470          this.getBasedOn().add(castToReference(value));
3471        } else if (name.equals("groupIdentifier")) {
3472          this.groupIdentifier = castToIdentifier(value); // Identifier
3473        } else if (name.equals("partOf")) {
3474          this.getPartOf().add(castToReference(value));
3475        } else if (name.equals("status")) {
3476          value = new TaskStatusEnumFactory().fromType(castToCode(value));
3477          this.status = (Enumeration) value; // Enumeration<TaskStatus>
3478        } else if (name.equals("statusReason")) {
3479          this.statusReason = castToCodeableConcept(value); // CodeableConcept
3480        } else if (name.equals("businessStatus")) {
3481          this.businessStatus = castToCodeableConcept(value); // CodeableConcept
3482        } else if (name.equals("intent")) {
3483          value = new TaskIntentEnumFactory().fromType(castToCode(value));
3484          this.intent = (Enumeration) value; // Enumeration<TaskIntent>
3485        } else if (name.equals("priority")) {
3486          value = new TaskPriorityEnumFactory().fromType(castToCode(value));
3487          this.priority = (Enumeration) value; // Enumeration<TaskPriority>
3488        } else if (name.equals("code")) {
3489          this.code = castToCodeableConcept(value); // CodeableConcept
3490        } else if (name.equals("description")) {
3491          this.description = castToString(value); // StringType
3492        } else if (name.equals("focus")) {
3493          this.focus = castToReference(value); // Reference
3494        } else if (name.equals("for")) {
3495          this.for_ = castToReference(value); // Reference
3496        } else if (name.equals("context")) {
3497          this.context = castToReference(value); // Reference
3498        } else if (name.equals("executionPeriod")) {
3499          this.executionPeriod = castToPeriod(value); // Period
3500        } else if (name.equals("authoredOn")) {
3501          this.authoredOn = castToDateTime(value); // DateTimeType
3502        } else if (name.equals("lastModified")) {
3503          this.lastModified = castToDateTime(value); // DateTimeType
3504        } else if (name.equals("requester")) {
3505          this.requester = castToReference(value); // Reference
3506        } else if (name.equals("performerType")) {
3507          this.getPerformerType().add(castToCodeableConcept(value));
3508        } else if (name.equals("owner")) {
3509          this.owner = castToReference(value); // Reference
3510        } else if (name.equals("reasonCode")) {
3511          this.reasonCode = castToCodeableConcept(value); // CodeableConcept
3512        } else if (name.equals("reasonReference")) {
3513          this.reasonReference = castToReference(value); // Reference
3514        } else if (name.equals("note")) {
3515          this.getNote().add(castToAnnotation(value));
3516        } else if (name.equals("relevantHistory")) {
3517          this.getRelevantHistory().add(castToReference(value));
3518        } else if (name.equals("restriction")) {
3519          this.restriction = (TaskRestrictionComponent) value; // TaskRestrictionComponent
3520        } else if (name.equals("input")) {
3521          this.getInput().add((ParameterComponent) value);
3522        } else if (name.equals("output")) {
3523          this.getOutput().add((TaskOutputComponent) value);
3524        } else
3525          return super.setProperty(name, value);
3526        return value;
3527      }
3528
3529      @Override
3530      public Base makeProperty(int hash, String name) throws FHIRException {
3531        switch (hash) {
3532        case -1618432855:  return addIdentifier(); 
3533        case -1926387433:  return getInstantiates(); 
3534        case -246883639:  return getInstantiates(); 
3535        case -332612366:  return addBasedOn(); 
3536        case -445338488:  return getGroupIdentifier(); 
3537        case -995410646:  return addPartOf(); 
3538        case -892481550:  return getStatusElement();
3539        case 2051346646:  return getStatusReason(); 
3540        case 2008591314:  return getBusinessStatus(); 
3541        case -1183762788:  return getIntentElement();
3542        case -1165461084:  return getPriorityElement();
3543        case 3059181:  return getCode(); 
3544        case -1724546052:  return getDescriptionElement();
3545        case 97604824:  return getFocus(); 
3546        case 101577:  return getFor(); 
3547        case 951530927:  return getContext(); 
3548        case 1218624249:  return getExecutionPeriod(); 
3549        case -1500852503:  return getAuthoredOnElement();
3550        case 1959003007:  return getLastModifiedElement();
3551        case 693933948:  return getRequester(); 
3552        case -901444568:  return addPerformerType(); 
3553        case 106164915:  return getOwner(); 
3554        case 722137681:  return getReasonCode(); 
3555        case -1146218137:  return getReasonReference(); 
3556        case 3387378:  return addNote(); 
3557        case 1538891575:  return addRelevantHistory(); 
3558        case -1561062452:  return getRestriction(); 
3559        case 100358090:  return addInput(); 
3560        case -1005512447:  return addOutput(); 
3561        default: return super.makeProperty(hash, name);
3562        }
3563
3564      }
3565
3566      @Override
3567      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3568        switch (hash) {
3569        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3570        case -246883639: /*instantiates*/ return new String[] {"uri", "Reference"};
3571        case -332612366: /*basedOn*/ return new String[] {"Reference"};
3572        case -445338488: /*groupIdentifier*/ return new String[] {"Identifier"};
3573        case -995410646: /*partOf*/ return new String[] {"Reference"};
3574        case -892481550: /*status*/ return new String[] {"code"};
3575        case 2051346646: /*statusReason*/ return new String[] {"CodeableConcept"};
3576        case 2008591314: /*businessStatus*/ return new String[] {"CodeableConcept"};
3577        case -1183762788: /*intent*/ return new String[] {"code"};
3578        case -1165461084: /*priority*/ return new String[] {"code"};
3579        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
3580        case -1724546052: /*description*/ return new String[] {"string"};
3581        case 97604824: /*focus*/ return new String[] {"Reference"};
3582        case 101577: /*for*/ return new String[] {"Reference"};
3583        case 951530927: /*context*/ return new String[] {"Reference"};
3584        case 1218624249: /*executionPeriod*/ return new String[] {"Period"};
3585        case -1500852503: /*authoredOn*/ return new String[] {"dateTime"};
3586        case 1959003007: /*lastModified*/ return new String[] {"dateTime"};
3587        case 693933948: /*requester*/ return new String[] {"Reference"};
3588        case -901444568: /*performerType*/ return new String[] {"CodeableConcept"};
3589        case 106164915: /*owner*/ return new String[] {"Reference"};
3590        case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
3591        case -1146218137: /*reasonReference*/ return new String[] {"Reference"};
3592        case 3387378: /*note*/ return new String[] {"Annotation"};
3593        case 1538891575: /*relevantHistory*/ return new String[] {"Reference"};
3594        case -1561062452: /*restriction*/ return new String[] {};
3595        case 100358090: /*input*/ return new String[] {};
3596        case -1005512447: /*output*/ return new String[] {};
3597        default: return super.getTypesForProperty(hash, name);
3598        }
3599
3600      }
3601
3602      @Override
3603      public Base addChild(String name) throws FHIRException {
3604        if (name.equals("identifier")) {
3605          return addIdentifier();
3606        }
3607        else if (name.equals("instantiatesUri")) {
3608          this.instantiates = new UriType();
3609          return this.instantiates;
3610        }
3611        else if (name.equals("instantiatesReference")) {
3612          this.instantiates = new Reference();
3613          return this.instantiates;
3614        }
3615        else if (name.equals("basedOn")) {
3616          return addBasedOn();
3617        }
3618        else if (name.equals("groupIdentifier")) {
3619          this.groupIdentifier = new Identifier();
3620          return this.groupIdentifier;
3621        }
3622        else if (name.equals("partOf")) {
3623          return addPartOf();
3624        }
3625        else if (name.equals("status")) {
3626          throw new FHIRException("Cannot call addChild on a primitive type Task.status");
3627        }
3628        else if (name.equals("statusReason")) {
3629          this.statusReason = new CodeableConcept();
3630          return this.statusReason;
3631        }
3632        else if (name.equals("businessStatus")) {
3633          this.businessStatus = new CodeableConcept();
3634          return this.businessStatus;
3635        }
3636        else if (name.equals("intent")) {
3637          throw new FHIRException("Cannot call addChild on a primitive type Task.intent");
3638        }
3639        else if (name.equals("priority")) {
3640          throw new FHIRException("Cannot call addChild on a primitive type Task.priority");
3641        }
3642        else if (name.equals("code")) {
3643          this.code = new CodeableConcept();
3644          return this.code;
3645        }
3646        else if (name.equals("description")) {
3647          throw new FHIRException("Cannot call addChild on a primitive type Task.description");
3648        }
3649        else if (name.equals("focus")) {
3650          this.focus = new Reference();
3651          return this.focus;
3652        }
3653        else if (name.equals("for")) {
3654          this.for_ = new Reference();
3655          return this.for_;
3656        }
3657        else if (name.equals("context")) {
3658          this.context = new Reference();
3659          return this.context;
3660        }
3661        else if (name.equals("executionPeriod")) {
3662          this.executionPeriod = new Period();
3663          return this.executionPeriod;
3664        }
3665        else if (name.equals("authoredOn")) {
3666          throw new FHIRException("Cannot call addChild on a primitive type Task.authoredOn");
3667        }
3668        else if (name.equals("lastModified")) {
3669          throw new FHIRException("Cannot call addChild on a primitive type Task.lastModified");
3670        }
3671        else if (name.equals("requester")) {
3672          this.requester = new Reference();
3673          return this.requester;
3674        }
3675        else if (name.equals("performerType")) {
3676          return addPerformerType();
3677        }
3678        else if (name.equals("owner")) {
3679          this.owner = new Reference();
3680          return this.owner;
3681        }
3682        else if (name.equals("reasonCode")) {
3683          this.reasonCode = new CodeableConcept();
3684          return this.reasonCode;
3685        }
3686        else if (name.equals("reasonReference")) {
3687          this.reasonReference = new Reference();
3688          return this.reasonReference;
3689        }
3690        else if (name.equals("note")) {
3691          return addNote();
3692        }
3693        else if (name.equals("relevantHistory")) {
3694          return addRelevantHistory();
3695        }
3696        else if (name.equals("restriction")) {
3697          this.restriction = new TaskRestrictionComponent();
3698          return this.restriction;
3699        }
3700        else if (name.equals("input")) {
3701          return addInput();
3702        }
3703        else if (name.equals("output")) {
3704          return addOutput();
3705        }
3706        else
3707          return super.addChild(name);
3708      }
3709
3710  public String fhirType() {
3711    return "Task";
3712
3713  }
3714
3715      public Task copy() {
3716        Task dst = new Task();
3717        copyValues(dst);
3718        if (identifier != null) {
3719          dst.identifier = new ArrayList<Identifier>();
3720          for (Identifier i : identifier)
3721            dst.identifier.add(i.copy());
3722        };
3723        dst.instantiates = instantiates == null ? null : instantiates.copy();
3724        if (basedOn != null) {
3725          dst.basedOn = new ArrayList<Reference>();
3726          for (Reference i : basedOn)
3727            dst.basedOn.add(i.copy());
3728        };
3729        dst.groupIdentifier = groupIdentifier == null ? null : groupIdentifier.copy();
3730        if (partOf != null) {
3731          dst.partOf = new ArrayList<Reference>();
3732          for (Reference i : partOf)
3733            dst.partOf.add(i.copy());
3734        };
3735        dst.status = status == null ? null : status.copy();
3736        dst.statusReason = statusReason == null ? null : statusReason.copy();
3737        dst.businessStatus = businessStatus == null ? null : businessStatus.copy();
3738        dst.intent = intent == null ? null : intent.copy();
3739        dst.priority = priority == null ? null : priority.copy();
3740        dst.code = code == null ? null : code.copy();
3741        dst.description = description == null ? null : description.copy();
3742        dst.focus = focus == null ? null : focus.copy();
3743        dst.for_ = for_ == null ? null : for_.copy();
3744        dst.context = context == null ? null : context.copy();
3745        dst.executionPeriod = executionPeriod == null ? null : executionPeriod.copy();
3746        dst.authoredOn = authoredOn == null ? null : authoredOn.copy();
3747        dst.lastModified = lastModified == null ? null : lastModified.copy();
3748        dst.requester = requester == null ? null : requester.copy();
3749        if (performerType != null) {
3750          dst.performerType = new ArrayList<CodeableConcept>();
3751          for (CodeableConcept i : performerType)
3752            dst.performerType.add(i.copy());
3753        };
3754        dst.owner = owner == null ? null : owner.copy();
3755        dst.reasonCode = reasonCode == null ? null : reasonCode.copy();
3756        dst.reasonReference = reasonReference == null ? null : reasonReference.copy();
3757        if (note != null) {
3758          dst.note = new ArrayList<Annotation>();
3759          for (Annotation i : note)
3760            dst.note.add(i.copy());
3761        };
3762        if (relevantHistory != null) {
3763          dst.relevantHistory = new ArrayList<Reference>();
3764          for (Reference i : relevantHistory)
3765            dst.relevantHistory.add(i.copy());
3766        };
3767        dst.restriction = restriction == null ? null : restriction.copy();
3768        if (input != null) {
3769          dst.input = new ArrayList<ParameterComponent>();
3770          for (ParameterComponent i : input)
3771            dst.input.add(i.copy());
3772        };
3773        if (output != null) {
3774          dst.output = new ArrayList<TaskOutputComponent>();
3775          for (TaskOutputComponent i : output)
3776            dst.output.add(i.copy());
3777        };
3778        return dst;
3779      }
3780
3781      protected Task typedCopy() {
3782        return copy();
3783      }
3784
3785      @Override
3786      public boolean equalsDeep(Base other_) {
3787        if (!super.equalsDeep(other_))
3788          return false;
3789        if (!(other_ instanceof Task))
3790          return false;
3791        Task o = (Task) other_;
3792        return compareDeep(identifier, o.identifier, true) && compareDeep(instantiates, o.instantiates, true)
3793           && compareDeep(basedOn, o.basedOn, true) && compareDeep(groupIdentifier, o.groupIdentifier, true)
3794           && compareDeep(partOf, o.partOf, true) && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true)
3795           && compareDeep(businessStatus, o.businessStatus, true) && compareDeep(intent, o.intent, true) && compareDeep(priority, o.priority, true)
3796           && compareDeep(code, o.code, true) && compareDeep(description, o.description, true) && compareDeep(focus, o.focus, true)
3797           && compareDeep(for_, o.for_, true) && compareDeep(context, o.context, true) && compareDeep(executionPeriod, o.executionPeriod, true)
3798           && compareDeep(authoredOn, o.authoredOn, true) && compareDeep(lastModified, o.lastModified, true)
3799           && compareDeep(requester, o.requester, true) && compareDeep(performerType, o.performerType, true)
3800           && compareDeep(owner, o.owner, true) && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true)
3801           && compareDeep(note, o.note, true) && compareDeep(relevantHistory, o.relevantHistory, true) && compareDeep(restriction, o.restriction, true)
3802           && compareDeep(input, o.input, true) && compareDeep(output, o.output, true);
3803      }
3804
3805      @Override
3806      public boolean equalsShallow(Base other_) {
3807        if (!super.equalsShallow(other_))
3808          return false;
3809        if (!(other_ instanceof Task))
3810          return false;
3811        Task o = (Task) other_;
3812        return compareValues(status, o.status, true) && compareValues(intent, o.intent, true) && compareValues(priority, o.priority, true)
3813           && compareValues(description, o.description, true) && compareValues(authoredOn, o.authoredOn, true)
3814           && compareValues(lastModified, o.lastModified, true);
3815      }
3816
3817      public boolean isEmpty() {
3818        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, instantiates, basedOn
3819          , groupIdentifier, partOf, status, statusReason, businessStatus, intent, priority
3820          , code, description, focus, for_, context, executionPeriod, authoredOn, lastModified
3821          , requester, performerType, owner, reasonCode, reasonReference, note, relevantHistory
3822          , restriction, input, output);
3823      }
3824
3825  @Override
3826  public ResourceType getResourceType() {
3827    return ResourceType.Task;
3828   }
3829
3830 /**
3831   * Search parameter: <b>owner</b>
3832   * <p>
3833   * Description: <b>Search by task owner</b><br>
3834   * Type: <b>reference</b><br>
3835   * Path: <b>Task.owner</b><br>
3836   * </p>
3837   */
3838  @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 } )
3839  public static final String SP_OWNER = "owner";
3840 /**
3841   * <b>Fluent Client</b> search parameter constant for <b>owner</b>
3842   * <p>
3843   * Description: <b>Search by task owner</b><br>
3844   * Type: <b>reference</b><br>
3845   * Path: <b>Task.owner</b><br>
3846   * </p>
3847   */
3848  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam OWNER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_OWNER);
3849
3850/**
3851   * Constant for fluent queries to be used to add include statements. Specifies
3852   * the path value of "<b>Task:owner</b>".
3853   */
3854  public static final ca.uhn.fhir.model.api.Include INCLUDE_OWNER = new ca.uhn.fhir.model.api.Include("Task:owner").toLocked();
3855
3856 /**
3857   * Search parameter: <b>requester</b>
3858   * <p>
3859   * Description: <b>Search by task requester</b><br>
3860   * Type: <b>reference</b><br>
3861   * Path: <b>Task.requester</b><br>
3862   * </p>
3863   */
3864  @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 } )
3865  public static final String SP_REQUESTER = "requester";
3866 /**
3867   * <b>Fluent Client</b> search parameter constant for <b>requester</b>
3868   * <p>
3869   * Description: <b>Search by task requester</b><br>
3870   * Type: <b>reference</b><br>
3871   * Path: <b>Task.requester</b><br>
3872   * </p>
3873   */
3874  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER);
3875
3876/**
3877   * Constant for fluent queries to be used to add include statements. Specifies
3878   * the path value of "<b>Task:requester</b>".
3879   */
3880  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTER = new ca.uhn.fhir.model.api.Include("Task:requester").toLocked();
3881
3882 /**
3883   * Search parameter: <b>identifier</b>
3884   * <p>
3885   * Description: <b>Search for a task instance by its business identifier</b><br>
3886   * Type: <b>token</b><br>
3887   * Path: <b>Task.identifier</b><br>
3888   * </p>
3889   */
3890  @SearchParamDefinition(name="identifier", path="Task.identifier", description="Search for a task instance by its business identifier", type="token" )
3891  public static final String SP_IDENTIFIER = "identifier";
3892 /**
3893   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3894   * <p>
3895   * Description: <b>Search for a task instance by its business identifier</b><br>
3896   * Type: <b>token</b><br>
3897   * Path: <b>Task.identifier</b><br>
3898   * </p>
3899   */
3900  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3901
3902 /**
3903   * Search parameter: <b>business-status</b>
3904   * <p>
3905   * Description: <b>Search by business status</b><br>
3906   * Type: <b>token</b><br>
3907   * Path: <b>Task.businessStatus</b><br>
3908   * </p>
3909   */
3910  @SearchParamDefinition(name="business-status", path="Task.businessStatus", description="Search by business status", type="token" )
3911  public static final String SP_BUSINESS_STATUS = "business-status";
3912 /**
3913   * <b>Fluent Client</b> search parameter constant for <b>business-status</b>
3914   * <p>
3915   * Description: <b>Search by business status</b><br>
3916   * Type: <b>token</b><br>
3917   * Path: <b>Task.businessStatus</b><br>
3918   * </p>
3919   */
3920  public static final ca.uhn.fhir.rest.gclient.TokenClientParam BUSINESS_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BUSINESS_STATUS);
3921
3922 /**
3923   * Search parameter: <b>period</b>
3924   * <p>
3925   * Description: <b>Search by period Task is/was underway</b><br>
3926   * Type: <b>date</b><br>
3927   * Path: <b>Task.executionPeriod</b><br>
3928   * </p>
3929   */
3930  @SearchParamDefinition(name="period", path="Task.executionPeriod", description="Search by period Task is/was underway", type="date" )
3931  public static final String SP_PERIOD = "period";
3932 /**
3933   * <b>Fluent Client</b> search parameter constant for <b>period</b>
3934   * <p>
3935   * Description: <b>Search by period Task is/was underway</b><br>
3936   * Type: <b>date</b><br>
3937   * Path: <b>Task.executionPeriod</b><br>
3938   * </p>
3939   */
3940  public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD);
3941
3942 /**
3943   * Search parameter: <b>code</b>
3944   * <p>
3945   * Description: <b>Search by task code</b><br>
3946   * Type: <b>token</b><br>
3947   * Path: <b>Task.code</b><br>
3948   * </p>
3949   */
3950  @SearchParamDefinition(name="code", path="Task.code", description="Search by task code", type="token" )
3951  public static final String SP_CODE = "code";
3952 /**
3953   * <b>Fluent Client</b> search parameter constant for <b>code</b>
3954   * <p>
3955   * Description: <b>Search by task code</b><br>
3956   * Type: <b>token</b><br>
3957   * Path: <b>Task.code</b><br>
3958   * </p>
3959   */
3960  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
3961
3962 /**
3963   * Search parameter: <b>performer</b>
3964   * <p>
3965   * Description: <b>Search by recommended type of performer (e.g., Requester, Performer, Scheduler).</b><br>
3966   * Type: <b>token</b><br>
3967   * Path: <b>Task.performerType</b><br>
3968   * </p>
3969   */
3970  @SearchParamDefinition(name="performer", path="Task.performerType", description="Search by recommended type of performer (e.g., Requester, Performer, Scheduler).", type="token" )
3971  public static final String SP_PERFORMER = "performer";
3972 /**
3973   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
3974   * <p>
3975   * Description: <b>Search by recommended type of performer (e.g., Requester, Performer, Scheduler).</b><br>
3976   * Type: <b>token</b><br>
3977   * Path: <b>Task.performerType</b><br>
3978   * </p>
3979   */
3980  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PERFORMER);
3981
3982 /**
3983   * Search parameter: <b>subject</b>
3984   * <p>
3985   * Description: <b>Search by subject</b><br>
3986   * Type: <b>reference</b><br>
3987   * Path: <b>Task.for</b><br>
3988   * </p>
3989   */
3990  @SearchParamDefinition(name="subject", path="Task.for", description="Search by subject", type="reference" )
3991  public static final String SP_SUBJECT = "subject";
3992 /**
3993   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
3994   * <p>
3995   * Description: <b>Search by subject</b><br>
3996   * Type: <b>reference</b><br>
3997   * Path: <b>Task.for</b><br>
3998   * </p>
3999   */
4000  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
4001
4002/**
4003   * Constant for fluent queries to be used to add include statements. Specifies
4004   * the path value of "<b>Task:subject</b>".
4005   */
4006  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Task:subject").toLocked();
4007
4008 /**
4009   * Search parameter: <b>focus</b>
4010   * <p>
4011   * Description: <b>Search by task focus</b><br>
4012   * Type: <b>reference</b><br>
4013   * Path: <b>Task.focus</b><br>
4014   * </p>
4015   */
4016  @SearchParamDefinition(name="focus", path="Task.focus", description="Search by task focus", type="reference" )
4017  public static final String SP_FOCUS = "focus";
4018 /**
4019   * <b>Fluent Client</b> search parameter constant for <b>focus</b>
4020   * <p>
4021   * Description: <b>Search by task focus</b><br>
4022   * Type: <b>reference</b><br>
4023   * Path: <b>Task.focus</b><br>
4024   * </p>
4025   */
4026  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FOCUS = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FOCUS);
4027
4028/**
4029   * Constant for fluent queries to be used to add include statements. Specifies
4030   * the path value of "<b>Task:focus</b>".
4031   */
4032  public static final ca.uhn.fhir.model.api.Include INCLUDE_FOCUS = new ca.uhn.fhir.model.api.Include("Task:focus").toLocked();
4033
4034 /**
4035   * Search parameter: <b>part-of</b>
4036   * <p>
4037   * Description: <b>Search by task this task is part of</b><br>
4038   * Type: <b>reference</b><br>
4039   * Path: <b>Task.partOf</b><br>
4040   * </p>
4041   */
4042  @SearchParamDefinition(name="part-of", path="Task.partOf", description="Search by task this task is part of", type="reference", target={Task.class } )
4043  public static final String SP_PART_OF = "part-of";
4044 /**
4045   * <b>Fluent Client</b> search parameter constant for <b>part-of</b>
4046   * <p>
4047   * Description: <b>Search by task this task is part of</b><br>
4048   * Type: <b>reference</b><br>
4049   * Path: <b>Task.partOf</b><br>
4050   * </p>
4051   */
4052  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF);
4053
4054/**
4055   * Constant for fluent queries to be used to add include statements. Specifies
4056   * the path value of "<b>Task:part-of</b>".
4057   */
4058  public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("Task:part-of").toLocked();
4059
4060 /**
4061   * Search parameter: <b>priority</b>
4062   * <p>
4063   * Description: <b>Search by task priority</b><br>
4064   * Type: <b>token</b><br>
4065   * Path: <b>Task.priority</b><br>
4066   * </p>
4067   */
4068  @SearchParamDefinition(name="priority", path="Task.priority", description="Search by task priority", type="token" )
4069  public static final String SP_PRIORITY = "priority";
4070 /**
4071   * <b>Fluent Client</b> search parameter constant for <b>priority</b>
4072   * <p>
4073   * Description: <b>Search by task priority</b><br>
4074   * Type: <b>token</b><br>
4075   * Path: <b>Task.priority</b><br>
4076   * </p>
4077   */
4078  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY);
4079
4080 /**
4081   * Search parameter: <b>authored-on</b>
4082   * <p>
4083   * Description: <b>Search by creation date</b><br>
4084   * Type: <b>date</b><br>
4085   * Path: <b>Task.authoredOn</b><br>
4086   * </p>
4087   */
4088  @SearchParamDefinition(name="authored-on", path="Task.authoredOn", description="Search by creation date", type="date" )
4089  public static final String SP_AUTHORED_ON = "authored-on";
4090 /**
4091   * <b>Fluent Client</b> search parameter constant for <b>authored-on</b>
4092   * <p>
4093   * Description: <b>Search by creation date</b><br>
4094   * Type: <b>date</b><br>
4095   * Path: <b>Task.authoredOn</b><br>
4096   * </p>
4097   */
4098  public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORED_ON = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORED_ON);
4099
4100 /**
4101   * Search parameter: <b>intent</b>
4102   * <p>
4103   * Description: <b>Search by task intent</b><br>
4104   * Type: <b>token</b><br>
4105   * Path: <b>Task.intent</b><br>
4106   * </p>
4107   */
4108  @SearchParamDefinition(name="intent", path="Task.intent", description="Search by task intent", type="token" )
4109  public static final String SP_INTENT = "intent";
4110 /**
4111   * <b>Fluent Client</b> search parameter constant for <b>intent</b>
4112   * <p>
4113   * Description: <b>Search by task intent</b><br>
4114   * Type: <b>token</b><br>
4115   * Path: <b>Task.intent</b><br>
4116   * </p>
4117   */
4118  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INTENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INTENT);
4119
4120 /**
4121   * Search parameter: <b>group-identifier</b>
4122   * <p>
4123   * Description: <b>Search by group identifier</b><br>
4124   * Type: <b>token</b><br>
4125   * Path: <b>Task.groupIdentifier</b><br>
4126   * </p>
4127   */
4128  @SearchParamDefinition(name="group-identifier", path="Task.groupIdentifier", description="Search by group identifier", type="token" )
4129  public static final String SP_GROUP_IDENTIFIER = "group-identifier";
4130 /**
4131   * <b>Fluent Client</b> search parameter constant for <b>group-identifier</b>
4132   * <p>
4133   * Description: <b>Search by group identifier</b><br>
4134   * Type: <b>token</b><br>
4135   * Path: <b>Task.groupIdentifier</b><br>
4136   * </p>
4137   */
4138  public static final ca.uhn.fhir.rest.gclient.TokenClientParam GROUP_IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GROUP_IDENTIFIER);
4139
4140 /**
4141   * Search parameter: <b>based-on</b>
4142   * <p>
4143   * Description: <b>Search by requests this task is based on</b><br>
4144   * Type: <b>reference</b><br>
4145   * Path: <b>Task.basedOn</b><br>
4146   * </p>
4147   */
4148  @SearchParamDefinition(name="based-on", path="Task.basedOn", description="Search by requests this task is based on", type="reference" )
4149  public static final String SP_BASED_ON = "based-on";
4150 /**
4151   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
4152   * <p>
4153   * Description: <b>Search by requests this task is based on</b><br>
4154   * Type: <b>reference</b><br>
4155   * Path: <b>Task.basedOn</b><br>
4156   * </p>
4157   */
4158  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
4159
4160/**
4161   * Constant for fluent queries to be used to add include statements. Specifies
4162   * the path value of "<b>Task:based-on</b>".
4163   */
4164  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("Task:based-on").toLocked();
4165
4166 /**
4167   * Search parameter: <b>patient</b>
4168   * <p>
4169   * Description: <b>Search by patient</b><br>
4170   * Type: <b>reference</b><br>
4171   * Path: <b>Task.for</b><br>
4172   * </p>
4173   */
4174  @SearchParamDefinition(name="patient", path="Task.for", description="Search by patient", type="reference", target={Patient.class } )
4175  public static final String SP_PATIENT = "patient";
4176 /**
4177   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
4178   * <p>
4179   * Description: <b>Search by patient</b><br>
4180   * Type: <b>reference</b><br>
4181   * Path: <b>Task.for</b><br>
4182   * </p>
4183   */
4184  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
4185
4186/**
4187   * Constant for fluent queries to be used to add include statements. Specifies
4188   * the path value of "<b>Task:patient</b>".
4189   */
4190  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Task:patient").toLocked();
4191
4192 /**
4193   * Search parameter: <b>context</b>
4194   * <p>
4195   * Description: <b>Search by encounter or episode</b><br>
4196   * Type: <b>reference</b><br>
4197   * Path: <b>Task.context</b><br>
4198   * </p>
4199   */
4200  @SearchParamDefinition(name="context", path="Task.context", description="Search by encounter or episode", type="reference", target={Encounter.class, EpisodeOfCare.class } )
4201  public static final String SP_CONTEXT = "context";
4202 /**
4203   * <b>Fluent Client</b> search parameter constant for <b>context</b>
4204   * <p>
4205   * Description: <b>Search by encounter or episode</b><br>
4206   * Type: <b>reference</b><br>
4207   * Path: <b>Task.context</b><br>
4208   * </p>
4209   */
4210  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTEXT);
4211
4212/**
4213   * Constant for fluent queries to be used to add include statements. Specifies
4214   * the path value of "<b>Task:context</b>".
4215   */
4216  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTEXT = new ca.uhn.fhir.model.api.Include("Task:context").toLocked();
4217
4218 /**
4219   * Search parameter: <b>modified</b>
4220   * <p>
4221   * Description: <b>Search by last modification date</b><br>
4222   * Type: <b>date</b><br>
4223   * Path: <b>Task.lastModified</b><br>
4224   * </p>
4225   */
4226  @SearchParamDefinition(name="modified", path="Task.lastModified", description="Search by last modification date", type="date" )
4227  public static final String SP_MODIFIED = "modified";
4228 /**
4229   * <b>Fluent Client</b> search parameter constant for <b>modified</b>
4230   * <p>
4231   * Description: <b>Search by last modification date</b><br>
4232   * Type: <b>date</b><br>
4233   * Path: <b>Task.lastModified</b><br>
4234   * </p>
4235   */
4236  public static final ca.uhn.fhir.rest.gclient.DateClientParam MODIFIED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_MODIFIED);
4237
4238 /**
4239   * Search parameter: <b>status</b>
4240   * <p>
4241   * Description: <b>Search by task status</b><br>
4242   * Type: <b>token</b><br>
4243   * Path: <b>Task.status</b><br>
4244   * </p>
4245   */
4246  @SearchParamDefinition(name="status", path="Task.status", description="Search by task status", type="token" )
4247  public static final String SP_STATUS = "status";
4248 /**
4249   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4250   * <p>
4251   * Description: <b>Search by task status</b><br>
4252   * Type: <b>token</b><br>
4253   * Path: <b>Task.status</b><br>
4254   * </p>
4255   */
4256  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4257
4258
4259}
4260