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