001package org.hl7.fhir.r4.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import org.hl7.fhir.utilities.Utilities;
040import org.hl7.fhir.r4.model.Enumerations.*;
041import ca.uhn.fhir.model.api.annotation.ResourceDef;
042import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
043import ca.uhn.fhir.model.api.annotation.Child;
044import ca.uhn.fhir.model.api.annotation.ChildOrder;
045import ca.uhn.fhir.model.api.annotation.Description;
046import ca.uhn.fhir.model.api.annotation.Block;
047import org.hl7.fhir.instance.model.api.*;
048import org.hl7.fhir.exceptions.FHIRException;
049/**
050 * This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.
051 */
052@ResourceDef(name="ActivityDefinition", profile="http://hl7.org/fhir/StructureDefinition/ActivityDefinition")
053@ChildOrder(names={"url", "identifier", "version", "name", "title", "subtitle", "status", "experimental", "subject[x]", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "usage", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "library", "kind", "profile", "code", "intent", "priority", "doNotPerform", "timing[x]", "location", "participant", "product[x]", "quantity", "dosage", "bodySite", "specimenRequirement", "observationRequirement", "observationResultRequirement", "transform", "dynamicValue"})
054public class ActivityDefinition extends MetadataResource {
055
056    public enum ActivityDefinitionKind {
057        /**
058         * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).
059         */
060        APPOINTMENT, 
061        /**
062         * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.
063         */
064        APPOINTMENTRESPONSE, 
065        /**
066         * Healthcare plan for patient or group.
067         */
068        CAREPLAN, 
069        /**
070         * Claim, Pre-determination or Pre-authorization.
071         */
072        CLAIM, 
073        /**
074         * A request for information to be sent to a receiver.
075         */
076        COMMUNICATIONREQUEST, 
077        /**
078         * Legal Agreement.
079         */
080        CONTRACT, 
081        /**
082         * Medical device request.
083         */
084        DEVICEREQUEST, 
085        /**
086         * Enrollment request.
087         */
088        ENROLLMENTREQUEST, 
089        /**
090         * Guidance or advice relating to an immunization.
091         */
092        IMMUNIZATIONRECOMMENDATION, 
093        /**
094         * Ordering of medication for patient or group.
095         */
096        MEDICATIONREQUEST, 
097        /**
098         * Diet, formula or nutritional supplement request.
099         */
100        NUTRITIONORDER, 
101        /**
102         * A record of a request for service such as diagnostic investigations, treatments, or operations to be performed.
103         */
104        SERVICEREQUEST, 
105        /**
106         * Request for a medication, substance or device.
107         */
108        SUPPLYREQUEST, 
109        /**
110         * A task to be performed.
111         */
112        TASK, 
113        /**
114         * Prescription for vision correction products for a patient.
115         */
116        VISIONPRESCRIPTION, 
117        /**
118         * added to help the parsers with the generic types
119         */
120        NULL;
121        public static ActivityDefinitionKind fromCode(String codeString) throws FHIRException {
122            if (codeString == null || "".equals(codeString))
123                return null;
124        if ("Appointment".equals(codeString))
125          return APPOINTMENT;
126        if ("AppointmentResponse".equals(codeString))
127          return APPOINTMENTRESPONSE;
128        if ("CarePlan".equals(codeString))
129          return CAREPLAN;
130        if ("Claim".equals(codeString))
131          return CLAIM;
132        if ("CommunicationRequest".equals(codeString))
133          return COMMUNICATIONREQUEST;
134        if ("Contract".equals(codeString))
135          return CONTRACT;
136        if ("DeviceRequest".equals(codeString))
137          return DEVICEREQUEST;
138        if ("EnrollmentRequest".equals(codeString))
139          return ENROLLMENTREQUEST;
140        if ("ImmunizationRecommendation".equals(codeString))
141          return IMMUNIZATIONRECOMMENDATION;
142        if ("MedicationRequest".equals(codeString))
143          return MEDICATIONREQUEST;
144        if ("NutritionOrder".equals(codeString))
145          return NUTRITIONORDER;
146        if ("ServiceRequest".equals(codeString))
147          return SERVICEREQUEST;
148        if ("SupplyRequest".equals(codeString))
149          return SUPPLYREQUEST;
150        if ("Task".equals(codeString))
151          return TASK;
152        if ("VisionPrescription".equals(codeString))
153          return VISIONPRESCRIPTION;
154        if (Configuration.isAcceptInvalidEnums())
155          return null;
156        else
157          throw new FHIRException("Unknown ActivityDefinitionKind code '"+codeString+"'");
158        }
159        public String toCode() {
160          switch (this) {
161            case APPOINTMENT: return "Appointment";
162            case APPOINTMENTRESPONSE: return "AppointmentResponse";
163            case CAREPLAN: return "CarePlan";
164            case CLAIM: return "Claim";
165            case COMMUNICATIONREQUEST: return "CommunicationRequest";
166            case CONTRACT: return "Contract";
167            case DEVICEREQUEST: return "DeviceRequest";
168            case ENROLLMENTREQUEST: return "EnrollmentRequest";
169            case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation";
170            case MEDICATIONREQUEST: return "MedicationRequest";
171            case NUTRITIONORDER: return "NutritionOrder";
172            case SERVICEREQUEST: return "ServiceRequest";
173            case SUPPLYREQUEST: return "SupplyRequest";
174            case TASK: return "Task";
175            case VISIONPRESCRIPTION: return "VisionPrescription";
176            case NULL: return null;
177            default: return "?";
178          }
179        }
180        public String getSystem() {
181          switch (this) {
182            case APPOINTMENT: return "http://hl7.org/fhir/request-resource-types";
183            case APPOINTMENTRESPONSE: return "http://hl7.org/fhir/request-resource-types";
184            case CAREPLAN: return "http://hl7.org/fhir/request-resource-types";
185            case CLAIM: return "http://hl7.org/fhir/request-resource-types";
186            case COMMUNICATIONREQUEST: return "http://hl7.org/fhir/request-resource-types";
187            case CONTRACT: return "http://hl7.org/fhir/request-resource-types";
188            case DEVICEREQUEST: return "http://hl7.org/fhir/request-resource-types";
189            case ENROLLMENTREQUEST: return "http://hl7.org/fhir/request-resource-types";
190            case IMMUNIZATIONRECOMMENDATION: return "http://hl7.org/fhir/request-resource-types";
191            case MEDICATIONREQUEST: return "http://hl7.org/fhir/request-resource-types";
192            case NUTRITIONORDER: return "http://hl7.org/fhir/request-resource-types";
193            case SERVICEREQUEST: return "http://hl7.org/fhir/request-resource-types";
194            case SUPPLYREQUEST: return "http://hl7.org/fhir/request-resource-types";
195            case TASK: return "http://hl7.org/fhir/request-resource-types";
196            case VISIONPRESCRIPTION: return "http://hl7.org/fhir/request-resource-types";
197            case NULL: return null;
198            default: return "?";
199          }
200        }
201        public String getDefinition() {
202          switch (this) {
203            case APPOINTMENT: return "A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).";
204            case APPOINTMENTRESPONSE: return "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.";
205            case CAREPLAN: return "Healthcare plan for patient or group.";
206            case CLAIM: return "Claim, Pre-determination or Pre-authorization.";
207            case COMMUNICATIONREQUEST: return "A request for information to be sent to a receiver.";
208            case CONTRACT: return "Legal Agreement.";
209            case DEVICEREQUEST: return "Medical device request.";
210            case ENROLLMENTREQUEST: return "Enrollment request.";
211            case IMMUNIZATIONRECOMMENDATION: return "Guidance or advice relating to an immunization.";
212            case MEDICATIONREQUEST: return "Ordering of medication for patient or group.";
213            case NUTRITIONORDER: return "Diet, formula or nutritional supplement request.";
214            case SERVICEREQUEST: return "A record of a request for service such as diagnostic investigations, treatments, or operations to be performed.";
215            case SUPPLYREQUEST: return "Request for a medication, substance or device.";
216            case TASK: return "A task to be performed.";
217            case VISIONPRESCRIPTION: return "Prescription for vision correction products for a patient.";
218            case NULL: return null;
219            default: return "?";
220          }
221        }
222        public String getDisplay() {
223          switch (this) {
224            case APPOINTMENT: return "Appointment";
225            case APPOINTMENTRESPONSE: return "AppointmentResponse";
226            case CAREPLAN: return "CarePlan";
227            case CLAIM: return "Claim";
228            case COMMUNICATIONREQUEST: return "CommunicationRequest";
229            case CONTRACT: return "Contract";
230            case DEVICEREQUEST: return "DeviceRequest";
231            case ENROLLMENTREQUEST: return "EnrollmentRequest";
232            case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation";
233            case MEDICATIONREQUEST: return "MedicationRequest";
234            case NUTRITIONORDER: return "NutritionOrder";
235            case SERVICEREQUEST: return "ServiceRequest";
236            case SUPPLYREQUEST: return "SupplyRequest";
237            case TASK: return "Task";
238            case VISIONPRESCRIPTION: return "VisionPrescription";
239            case NULL: return null;
240            default: return "?";
241          }
242        }
243    }
244
245  public static class ActivityDefinitionKindEnumFactory implements EnumFactory<ActivityDefinitionKind> {
246    public ActivityDefinitionKind fromCode(String codeString) throws IllegalArgumentException {
247      if (codeString == null || "".equals(codeString))
248            if (codeString == null || "".equals(codeString))
249                return null;
250        if ("Appointment".equals(codeString))
251          return ActivityDefinitionKind.APPOINTMENT;
252        if ("AppointmentResponse".equals(codeString))
253          return ActivityDefinitionKind.APPOINTMENTRESPONSE;
254        if ("CarePlan".equals(codeString))
255          return ActivityDefinitionKind.CAREPLAN;
256        if ("Claim".equals(codeString))
257          return ActivityDefinitionKind.CLAIM;
258        if ("CommunicationRequest".equals(codeString))
259          return ActivityDefinitionKind.COMMUNICATIONREQUEST;
260        if ("Contract".equals(codeString))
261          return ActivityDefinitionKind.CONTRACT;
262        if ("DeviceRequest".equals(codeString))
263          return ActivityDefinitionKind.DEVICEREQUEST;
264        if ("EnrollmentRequest".equals(codeString))
265          return ActivityDefinitionKind.ENROLLMENTREQUEST;
266        if ("ImmunizationRecommendation".equals(codeString))
267          return ActivityDefinitionKind.IMMUNIZATIONRECOMMENDATION;
268        if ("MedicationRequest".equals(codeString))
269          return ActivityDefinitionKind.MEDICATIONREQUEST;
270        if ("NutritionOrder".equals(codeString))
271          return ActivityDefinitionKind.NUTRITIONORDER;
272        if ("ServiceRequest".equals(codeString))
273          return ActivityDefinitionKind.SERVICEREQUEST;
274        if ("SupplyRequest".equals(codeString))
275          return ActivityDefinitionKind.SUPPLYREQUEST;
276        if ("Task".equals(codeString))
277          return ActivityDefinitionKind.TASK;
278        if ("VisionPrescription".equals(codeString))
279          return ActivityDefinitionKind.VISIONPRESCRIPTION;
280        throw new IllegalArgumentException("Unknown ActivityDefinitionKind code '"+codeString+"'");
281        }
282        public Enumeration<ActivityDefinitionKind> fromType(Base code) throws FHIRException {
283          if (code == null)
284            return null;
285          if (code.isEmpty())
286            return new Enumeration<ActivityDefinitionKind>(this);
287          String codeString = ((PrimitiveType) code).asStringValue();
288          if (codeString == null || "".equals(codeString))
289            return null;
290        if ("Appointment".equals(codeString))
291          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.APPOINTMENT);
292        if ("AppointmentResponse".equals(codeString))
293          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.APPOINTMENTRESPONSE);
294        if ("CarePlan".equals(codeString))
295          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.CAREPLAN);
296        if ("Claim".equals(codeString))
297          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.CLAIM);
298        if ("CommunicationRequest".equals(codeString))
299          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.COMMUNICATIONREQUEST);
300        if ("Contract".equals(codeString))
301          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.CONTRACT);
302        if ("DeviceRequest".equals(codeString))
303          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.DEVICEREQUEST);
304        if ("EnrollmentRequest".equals(codeString))
305          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.ENROLLMENTREQUEST);
306        if ("ImmunizationRecommendation".equals(codeString))
307          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.IMMUNIZATIONRECOMMENDATION);
308        if ("MedicationRequest".equals(codeString))
309          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.MEDICATIONREQUEST);
310        if ("NutritionOrder".equals(codeString))
311          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.NUTRITIONORDER);
312        if ("ServiceRequest".equals(codeString))
313          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.SERVICEREQUEST);
314        if ("SupplyRequest".equals(codeString))
315          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.SUPPLYREQUEST);
316        if ("Task".equals(codeString))
317          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.TASK);
318        if ("VisionPrescription".equals(codeString))
319          return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.VISIONPRESCRIPTION);
320        throw new FHIRException("Unknown ActivityDefinitionKind code '"+codeString+"'");
321        }
322    public String toCode(ActivityDefinitionKind code) {
323      if (code == ActivityDefinitionKind.APPOINTMENT)
324        return "Appointment";
325      if (code == ActivityDefinitionKind.APPOINTMENTRESPONSE)
326        return "AppointmentResponse";
327      if (code == ActivityDefinitionKind.CAREPLAN)
328        return "CarePlan";
329      if (code == ActivityDefinitionKind.CLAIM)
330        return "Claim";
331      if (code == ActivityDefinitionKind.COMMUNICATIONREQUEST)
332        return "CommunicationRequest";
333      if (code == ActivityDefinitionKind.CONTRACT)
334        return "Contract";
335      if (code == ActivityDefinitionKind.DEVICEREQUEST)
336        return "DeviceRequest";
337      if (code == ActivityDefinitionKind.ENROLLMENTREQUEST)
338        return "EnrollmentRequest";
339      if (code == ActivityDefinitionKind.IMMUNIZATIONRECOMMENDATION)
340        return "ImmunizationRecommendation";
341      if (code == ActivityDefinitionKind.MEDICATIONREQUEST)
342        return "MedicationRequest";
343      if (code == ActivityDefinitionKind.NUTRITIONORDER)
344        return "NutritionOrder";
345      if (code == ActivityDefinitionKind.SERVICEREQUEST)
346        return "ServiceRequest";
347      if (code == ActivityDefinitionKind.SUPPLYREQUEST)
348        return "SupplyRequest";
349      if (code == ActivityDefinitionKind.TASK)
350        return "Task";
351      if (code == ActivityDefinitionKind.VISIONPRESCRIPTION)
352        return "VisionPrescription";
353      return "?";
354      }
355    public String toSystem(ActivityDefinitionKind code) {
356      return code.getSystem();
357      }
358    }
359
360    public enum RequestIntent {
361        /**
362         * The request is a suggestion made by someone/something that does not have an intention to ensure it occurs and without providing an authorization to act.
363         */
364        PROPOSAL, 
365        /**
366         * The request represents an intention to ensure something occurs without providing an authorization for others to act.
367         */
368        PLAN, 
369        /**
370         * The request represents a legally binding instruction authored by a Patient or RelatedPerson.
371         */
372        DIRECTIVE, 
373        /**
374         * The request represents a request/demand and authorization for action by a Practitioner.
375         */
376        ORDER, 
377        /**
378         * The request represents an original authorization for action.
379         */
380        ORIGINALORDER, 
381        /**
382         * The request represents an automatically generated supplemental authorization for action based on a parent authorization together with initial results of the action taken against that parent authorization.
383         */
384        REFLEXORDER, 
385        /**
386         * The request represents the view of an authorization instantiated by a fulfilling system representing the details of the fulfiller's intention to act upon a submitted order.
387         */
388        FILLERORDER, 
389        /**
390         * An order created in fulfillment of a broader order that represents the authorization for a single activity occurrence.  E.g. The administration of a single dose of a drug.
391         */
392        INSTANCEORDER, 
393        /**
394         * The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests.  Refer to [[[RequestGroup]]] for additional information on how this status is used.
395         */
396        OPTION, 
397        /**
398         * added to help the parsers with the generic types
399         */
400        NULL;
401        public static RequestIntent fromCode(String codeString) throws FHIRException {
402            if (codeString == null || "".equals(codeString))
403                return null;
404        if ("proposal".equals(codeString))
405          return PROPOSAL;
406        if ("plan".equals(codeString))
407          return PLAN;
408        if ("directive".equals(codeString))
409          return DIRECTIVE;
410        if ("order".equals(codeString))
411          return ORDER;
412        if ("original-order".equals(codeString))
413          return ORIGINALORDER;
414        if ("reflex-order".equals(codeString))
415          return REFLEXORDER;
416        if ("filler-order".equals(codeString))
417          return FILLERORDER;
418        if ("instance-order".equals(codeString))
419          return INSTANCEORDER;
420        if ("option".equals(codeString))
421          return OPTION;
422        if (Configuration.isAcceptInvalidEnums())
423          return null;
424        else
425          throw new FHIRException("Unknown RequestIntent code '"+codeString+"'");
426        }
427        public String toCode() {
428          switch (this) {
429            case PROPOSAL: return "proposal";
430            case PLAN: return "plan";
431            case DIRECTIVE: return "directive";
432            case ORDER: return "order";
433            case ORIGINALORDER: return "original-order";
434            case REFLEXORDER: return "reflex-order";
435            case FILLERORDER: return "filler-order";
436            case INSTANCEORDER: return "instance-order";
437            case OPTION: return "option";
438            case NULL: return null;
439            default: return "?";
440          }
441        }
442        public String getSystem() {
443          switch (this) {
444            case PROPOSAL: return "http://hl7.org/fhir/request-intent";
445            case PLAN: return "http://hl7.org/fhir/request-intent";
446            case DIRECTIVE: return "http://hl7.org/fhir/request-intent";
447            case ORDER: return "http://hl7.org/fhir/request-intent";
448            case ORIGINALORDER: return "http://hl7.org/fhir/request-intent";
449            case REFLEXORDER: return "http://hl7.org/fhir/request-intent";
450            case FILLERORDER: return "http://hl7.org/fhir/request-intent";
451            case INSTANCEORDER: return "http://hl7.org/fhir/request-intent";
452            case OPTION: return "http://hl7.org/fhir/request-intent";
453            case NULL: return null;
454            default: return "?";
455          }
456        }
457        public String getDefinition() {
458          switch (this) {
459            case PROPOSAL: return "The request is a suggestion made by someone/something that does not have an intention to ensure it occurs and without providing an authorization to act.";
460            case PLAN: return "The request represents an intention to ensure something occurs without providing an authorization for others to act.";
461            case DIRECTIVE: return "The request represents a legally binding instruction authored by a Patient or RelatedPerson.";
462            case ORDER: return "The request represents a request/demand and authorization for action by a Practitioner.";
463            case ORIGINALORDER: return "The request represents an original authorization for action.";
464            case REFLEXORDER: return "The request represents an automatically generated supplemental authorization for action based on a parent authorization together with initial results of the action taken against that parent authorization.";
465            case FILLERORDER: return "The request represents the view of an authorization instantiated by a fulfilling system representing the details of the fulfiller's intention to act upon a submitted order.";
466            case INSTANCEORDER: return "An order created in fulfillment of a broader order that represents the authorization for a single activity occurrence.  E.g. The administration of a single dose of a drug.";
467            case OPTION: return "The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests.  Refer to [[[RequestGroup]]] for additional information on how this status is used.";
468            case NULL: return null;
469            default: return "?";
470          }
471        }
472        public String getDisplay() {
473          switch (this) {
474            case PROPOSAL: return "Proposal";
475            case PLAN: return "Plan";
476            case DIRECTIVE: return "Directive";
477            case ORDER: return "Order";
478            case ORIGINALORDER: return "Original Order";
479            case REFLEXORDER: return "Reflex Order";
480            case FILLERORDER: return "Filler Order";
481            case INSTANCEORDER: return "Instance Order";
482            case OPTION: return "Option";
483            case NULL: return null;
484            default: return "?";
485          }
486        }
487    }
488
489  public static class RequestIntentEnumFactory implements EnumFactory<RequestIntent> {
490    public RequestIntent fromCode(String codeString) throws IllegalArgumentException {
491      if (codeString == null || "".equals(codeString))
492            if (codeString == null || "".equals(codeString))
493                return null;
494        if ("proposal".equals(codeString))
495          return RequestIntent.PROPOSAL;
496        if ("plan".equals(codeString))
497          return RequestIntent.PLAN;
498        if ("directive".equals(codeString))
499          return RequestIntent.DIRECTIVE;
500        if ("order".equals(codeString))
501          return RequestIntent.ORDER;
502        if ("original-order".equals(codeString))
503          return RequestIntent.ORIGINALORDER;
504        if ("reflex-order".equals(codeString))
505          return RequestIntent.REFLEXORDER;
506        if ("filler-order".equals(codeString))
507          return RequestIntent.FILLERORDER;
508        if ("instance-order".equals(codeString))
509          return RequestIntent.INSTANCEORDER;
510        if ("option".equals(codeString))
511          return RequestIntent.OPTION;
512        throw new IllegalArgumentException("Unknown RequestIntent code '"+codeString+"'");
513        }
514        public Enumeration<RequestIntent> fromType(Base code) throws FHIRException {
515          if (code == null)
516            return null;
517          if (code.isEmpty())
518            return new Enumeration<RequestIntent>(this);
519          String codeString = ((PrimitiveType) code).asStringValue();
520          if (codeString == null || "".equals(codeString))
521            return null;
522        if ("proposal".equals(codeString))
523          return new Enumeration<RequestIntent>(this, RequestIntent.PROPOSAL);
524        if ("plan".equals(codeString))
525          return new Enumeration<RequestIntent>(this, RequestIntent.PLAN);
526        if ("directive".equals(codeString))
527          return new Enumeration<RequestIntent>(this, RequestIntent.DIRECTIVE);
528        if ("order".equals(codeString))
529          return new Enumeration<RequestIntent>(this, RequestIntent.ORDER);
530        if ("original-order".equals(codeString))
531          return new Enumeration<RequestIntent>(this, RequestIntent.ORIGINALORDER);
532        if ("reflex-order".equals(codeString))
533          return new Enumeration<RequestIntent>(this, RequestIntent.REFLEXORDER);
534        if ("filler-order".equals(codeString))
535          return new Enumeration<RequestIntent>(this, RequestIntent.FILLERORDER);
536        if ("instance-order".equals(codeString))
537          return new Enumeration<RequestIntent>(this, RequestIntent.INSTANCEORDER);
538        if ("option".equals(codeString))
539          return new Enumeration<RequestIntent>(this, RequestIntent.OPTION);
540        throw new FHIRException("Unknown RequestIntent code '"+codeString+"'");
541        }
542    public String toCode(RequestIntent code) {
543      if (code == RequestIntent.PROPOSAL)
544        return "proposal";
545      if (code == RequestIntent.PLAN)
546        return "plan";
547      if (code == RequestIntent.DIRECTIVE)
548        return "directive";
549      if (code == RequestIntent.ORDER)
550        return "order";
551      if (code == RequestIntent.ORIGINALORDER)
552        return "original-order";
553      if (code == RequestIntent.REFLEXORDER)
554        return "reflex-order";
555      if (code == RequestIntent.FILLERORDER)
556        return "filler-order";
557      if (code == RequestIntent.INSTANCEORDER)
558        return "instance-order";
559      if (code == RequestIntent.OPTION)
560        return "option";
561      return "?";
562      }
563    public String toSystem(RequestIntent code) {
564      return code.getSystem();
565      }
566    }
567
568    public enum RequestPriority {
569        /**
570         * The request has normal priority.
571         */
572        ROUTINE, 
573        /**
574         * The request should be actioned promptly - higher priority than routine.
575         */
576        URGENT, 
577        /**
578         * The request should be actioned as soon as possible - higher priority than urgent.
579         */
580        ASAP, 
581        /**
582         * The request should be actioned immediately - highest possible priority.  E.g. an emergency.
583         */
584        STAT, 
585        /**
586         * added to help the parsers with the generic types
587         */
588        NULL;
589        public static RequestPriority fromCode(String codeString) throws FHIRException {
590            if (codeString == null || "".equals(codeString))
591                return null;
592        if ("routine".equals(codeString))
593          return ROUTINE;
594        if ("urgent".equals(codeString))
595          return URGENT;
596        if ("asap".equals(codeString))
597          return ASAP;
598        if ("stat".equals(codeString))
599          return STAT;
600        if (Configuration.isAcceptInvalidEnums())
601          return null;
602        else
603          throw new FHIRException("Unknown RequestPriority code '"+codeString+"'");
604        }
605        public String toCode() {
606          switch (this) {
607            case ROUTINE: return "routine";
608            case URGENT: return "urgent";
609            case ASAP: return "asap";
610            case STAT: return "stat";
611            case NULL: return null;
612            default: return "?";
613          }
614        }
615        public String getSystem() {
616          switch (this) {
617            case ROUTINE: return "http://hl7.org/fhir/request-priority";
618            case URGENT: return "http://hl7.org/fhir/request-priority";
619            case ASAP: return "http://hl7.org/fhir/request-priority";
620            case STAT: return "http://hl7.org/fhir/request-priority";
621            case NULL: return null;
622            default: return "?";
623          }
624        }
625        public String getDefinition() {
626          switch (this) {
627            case ROUTINE: return "The request has normal priority.";
628            case URGENT: return "The request should be actioned promptly - higher priority than routine.";
629            case ASAP: return "The request should be actioned as soon as possible - higher priority than urgent.";
630            case STAT: return "The request should be actioned immediately - highest possible priority.  E.g. an emergency.";
631            case NULL: return null;
632            default: return "?";
633          }
634        }
635        public String getDisplay() {
636          switch (this) {
637            case ROUTINE: return "Routine";
638            case URGENT: return "Urgent";
639            case ASAP: return "ASAP";
640            case STAT: return "STAT";
641            case NULL: return null;
642            default: return "?";
643          }
644        }
645    }
646
647  public static class RequestPriorityEnumFactory implements EnumFactory<RequestPriority> {
648    public RequestPriority fromCode(String codeString) throws IllegalArgumentException {
649      if (codeString == null || "".equals(codeString))
650            if (codeString == null || "".equals(codeString))
651                return null;
652        if ("routine".equals(codeString))
653          return RequestPriority.ROUTINE;
654        if ("urgent".equals(codeString))
655          return RequestPriority.URGENT;
656        if ("asap".equals(codeString))
657          return RequestPriority.ASAP;
658        if ("stat".equals(codeString))
659          return RequestPriority.STAT;
660        throw new IllegalArgumentException("Unknown RequestPriority code '"+codeString+"'");
661        }
662        public Enumeration<RequestPriority> fromType(Base code) throws FHIRException {
663          if (code == null)
664            return null;
665          if (code.isEmpty())
666            return new Enumeration<RequestPriority>(this);
667          String codeString = ((PrimitiveType) code).asStringValue();
668          if (codeString == null || "".equals(codeString))
669            return null;
670        if ("routine".equals(codeString))
671          return new Enumeration<RequestPriority>(this, RequestPriority.ROUTINE);
672        if ("urgent".equals(codeString))
673          return new Enumeration<RequestPriority>(this, RequestPriority.URGENT);
674        if ("asap".equals(codeString))
675          return new Enumeration<RequestPriority>(this, RequestPriority.ASAP);
676        if ("stat".equals(codeString))
677          return new Enumeration<RequestPriority>(this, RequestPriority.STAT);
678        throw new FHIRException("Unknown RequestPriority code '"+codeString+"'");
679        }
680    public String toCode(RequestPriority code) {
681      if (code == RequestPriority.ROUTINE)
682        return "routine";
683      if (code == RequestPriority.URGENT)
684        return "urgent";
685      if (code == RequestPriority.ASAP)
686        return "asap";
687      if (code == RequestPriority.STAT)
688        return "stat";
689      return "?";
690      }
691    public String toSystem(RequestPriority code) {
692      return code.getSystem();
693      }
694    }
695
696    public enum ActivityParticipantType {
697        /**
698         * The participant is the patient under evaluation.
699         */
700        PATIENT, 
701        /**
702         * The participant is a practitioner involved in the patient's care.
703         */
704        PRACTITIONER, 
705        /**
706         * The participant is a person related to the patient.
707         */
708        RELATEDPERSON, 
709        /**
710         * The participant is a system or device used in the care of the patient.
711         */
712        DEVICE, 
713        /**
714         * added to help the parsers with the generic types
715         */
716        NULL;
717        public static ActivityParticipantType fromCode(String codeString) throws FHIRException {
718            if (codeString == null || "".equals(codeString))
719                return null;
720        if ("patient".equals(codeString))
721          return PATIENT;
722        if ("practitioner".equals(codeString))
723          return PRACTITIONER;
724        if ("related-person".equals(codeString))
725          return RELATEDPERSON;
726        if ("device".equals(codeString))
727          return DEVICE;
728        if (Configuration.isAcceptInvalidEnums())
729          return null;
730        else
731          throw new FHIRException("Unknown ActivityParticipantType code '"+codeString+"'");
732        }
733        public String toCode() {
734          switch (this) {
735            case PATIENT: return "patient";
736            case PRACTITIONER: return "practitioner";
737            case RELATEDPERSON: return "related-person";
738            case DEVICE: return "device";
739            case NULL: return null;
740            default: return "?";
741          }
742        }
743        public String getSystem() {
744          switch (this) {
745            case PATIENT: return "http://hl7.org/fhir/action-participant-type";
746            case PRACTITIONER: return "http://hl7.org/fhir/action-participant-type";
747            case RELATEDPERSON: return "http://hl7.org/fhir/action-participant-type";
748            case DEVICE: return "http://hl7.org/fhir/action-participant-type";
749            case NULL: return null;
750            default: return "?";
751          }
752        }
753        public String getDefinition() {
754          switch (this) {
755            case PATIENT: return "The participant is the patient under evaluation.";
756            case PRACTITIONER: return "The participant is a practitioner involved in the patient's care.";
757            case RELATEDPERSON: return "The participant is a person related to the patient.";
758            case DEVICE: return "The participant is a system or device used in the care of the patient.";
759            case NULL: return null;
760            default: return "?";
761          }
762        }
763        public String getDisplay() {
764          switch (this) {
765            case PATIENT: return "Patient";
766            case PRACTITIONER: return "Practitioner";
767            case RELATEDPERSON: return "Related Person";
768            case DEVICE: return "Device";
769            case NULL: return null;
770            default: return "?";
771          }
772        }
773    }
774
775  public static class ActivityParticipantTypeEnumFactory implements EnumFactory<ActivityParticipantType> {
776    public ActivityParticipantType fromCode(String codeString) throws IllegalArgumentException {
777      if (codeString == null || "".equals(codeString))
778            if (codeString == null || "".equals(codeString))
779                return null;
780        if ("patient".equals(codeString))
781          return ActivityParticipantType.PATIENT;
782        if ("practitioner".equals(codeString))
783          return ActivityParticipantType.PRACTITIONER;
784        if ("related-person".equals(codeString))
785          return ActivityParticipantType.RELATEDPERSON;
786        if ("device".equals(codeString))
787          return ActivityParticipantType.DEVICE;
788        throw new IllegalArgumentException("Unknown ActivityParticipantType code '"+codeString+"'");
789        }
790        public Enumeration<ActivityParticipantType> fromType(Base code) throws FHIRException {
791          if (code == null)
792            return null;
793          if (code.isEmpty())
794            return new Enumeration<ActivityParticipantType>(this);
795          String codeString = ((PrimitiveType) code).asStringValue();
796          if (codeString == null || "".equals(codeString))
797            return null;
798        if ("patient".equals(codeString))
799          return new Enumeration<ActivityParticipantType>(this, ActivityParticipantType.PATIENT);
800        if ("practitioner".equals(codeString))
801          return new Enumeration<ActivityParticipantType>(this, ActivityParticipantType.PRACTITIONER);
802        if ("related-person".equals(codeString))
803          return new Enumeration<ActivityParticipantType>(this, ActivityParticipantType.RELATEDPERSON);
804        if ("device".equals(codeString))
805          return new Enumeration<ActivityParticipantType>(this, ActivityParticipantType.DEVICE);
806        throw new FHIRException("Unknown ActivityParticipantType code '"+codeString+"'");
807        }
808    public String toCode(ActivityParticipantType code) {
809      if (code == ActivityParticipantType.PATIENT)
810        return "patient";
811      if (code == ActivityParticipantType.PRACTITIONER)
812        return "practitioner";
813      if (code == ActivityParticipantType.RELATEDPERSON)
814        return "related-person";
815      if (code == ActivityParticipantType.DEVICE)
816        return "device";
817      return "?";
818      }
819    public String toSystem(ActivityParticipantType code) {
820      return code.getSystem();
821      }
822    }
823
824    @Block()
825    public static class ActivityDefinitionParticipantComponent extends BackboneElement implements IBaseBackboneElement {
826        /**
827         * The type of participant in the action.
828         */
829        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
830        @Description(shortDefinition="patient | practitioner | related-person | device", formalDefinition="The type of participant in the action." )
831        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-participant-type")
832        protected Enumeration<ActivityParticipantType> type;
833
834        /**
835         * The role the participant should play in performing the described action.
836         */
837        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
838        @Description(shortDefinition="E.g. Nurse, Surgeon, Parent, etc.", formalDefinition="The role the participant should play in performing the described action." )
839        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-participant-role")
840        protected CodeableConcept role;
841
842        private static final long serialVersionUID = -1450932564L;
843
844    /**
845     * Constructor
846     */
847      public ActivityDefinitionParticipantComponent() {
848        super();
849      }
850
851    /**
852     * Constructor
853     */
854      public ActivityDefinitionParticipantComponent(Enumeration<ActivityParticipantType> type) {
855        super();
856        this.type = type;
857      }
858
859        /**
860         * @return {@link #type} (The type of participant in the action.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
861         */
862        public Enumeration<ActivityParticipantType> getTypeElement() { 
863          if (this.type == null)
864            if (Configuration.errorOnAutoCreate())
865              throw new Error("Attempt to auto-create ActivityDefinitionParticipantComponent.type");
866            else if (Configuration.doAutoCreate())
867              this.type = new Enumeration<ActivityParticipantType>(new ActivityParticipantTypeEnumFactory()); // bb
868          return this.type;
869        }
870
871        public boolean hasTypeElement() { 
872          return this.type != null && !this.type.isEmpty();
873        }
874
875        public boolean hasType() { 
876          return this.type != null && !this.type.isEmpty();
877        }
878
879        /**
880         * @param value {@link #type} (The type of participant in the action.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
881         */
882        public ActivityDefinitionParticipantComponent setTypeElement(Enumeration<ActivityParticipantType> value) { 
883          this.type = value;
884          return this;
885        }
886
887        /**
888         * @return The type of participant in the action.
889         */
890        public ActivityParticipantType getType() { 
891          return this.type == null ? null : this.type.getValue();
892        }
893
894        /**
895         * @param value The type of participant in the action.
896         */
897        public ActivityDefinitionParticipantComponent setType(ActivityParticipantType value) { 
898            if (this.type == null)
899              this.type = new Enumeration<ActivityParticipantType>(new ActivityParticipantTypeEnumFactory());
900            this.type.setValue(value);
901          return this;
902        }
903
904        /**
905         * @return {@link #role} (The role the participant should play in performing the described action.)
906         */
907        public CodeableConcept getRole() { 
908          if (this.role == null)
909            if (Configuration.errorOnAutoCreate())
910              throw new Error("Attempt to auto-create ActivityDefinitionParticipantComponent.role");
911            else if (Configuration.doAutoCreate())
912              this.role = new CodeableConcept(); // cc
913          return this.role;
914        }
915
916        public boolean hasRole() { 
917          return this.role != null && !this.role.isEmpty();
918        }
919
920        /**
921         * @param value {@link #role} (The role the participant should play in performing the described action.)
922         */
923        public ActivityDefinitionParticipantComponent setRole(CodeableConcept value) { 
924          this.role = value;
925          return this;
926        }
927
928        protected void listChildren(List<Property> children) {
929          super.listChildren(children);
930          children.add(new Property("type", "code", "The type of participant in the action.", 0, 1, type));
931          children.add(new Property("role", "CodeableConcept", "The role the participant should play in performing the described action.", 0, 1, role));
932        }
933
934        @Override
935        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
936          switch (_hash) {
937          case 3575610: /*type*/  return new Property("type", "code", "The type of participant in the action.", 0, 1, type);
938          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "The role the participant should play in performing the described action.", 0, 1, role);
939          default: return super.getNamedProperty(_hash, _name, _checkValid);
940          }
941
942        }
943
944      @Override
945      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
946        switch (hash) {
947        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<ActivityParticipantType>
948        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
949        default: return super.getProperty(hash, name, checkValid);
950        }
951
952      }
953
954      @Override
955      public Base setProperty(int hash, String name, Base value) throws FHIRException {
956        switch (hash) {
957        case 3575610: // type
958          value = new ActivityParticipantTypeEnumFactory().fromType(castToCode(value));
959          this.type = (Enumeration) value; // Enumeration<ActivityParticipantType>
960          return value;
961        case 3506294: // role
962          this.role = castToCodeableConcept(value); // CodeableConcept
963          return value;
964        default: return super.setProperty(hash, name, value);
965        }
966
967      }
968
969      @Override
970      public Base setProperty(String name, Base value) throws FHIRException {
971        if (name.equals("type")) {
972          value = new ActivityParticipantTypeEnumFactory().fromType(castToCode(value));
973          this.type = (Enumeration) value; // Enumeration<ActivityParticipantType>
974        } else if (name.equals("role")) {
975          this.role = castToCodeableConcept(value); // CodeableConcept
976        } else
977          return super.setProperty(name, value);
978        return value;
979      }
980
981      @Override
982      public Base makeProperty(int hash, String name) throws FHIRException {
983        switch (hash) {
984        case 3575610:  return getTypeElement();
985        case 3506294:  return getRole(); 
986        default: return super.makeProperty(hash, name);
987        }
988
989      }
990
991      @Override
992      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
993        switch (hash) {
994        case 3575610: /*type*/ return new String[] {"code"};
995        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
996        default: return super.getTypesForProperty(hash, name);
997        }
998
999      }
1000
1001      @Override
1002      public Base addChild(String name) throws FHIRException {
1003        if (name.equals("type")) {
1004          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.type");
1005        }
1006        else if (name.equals("role")) {
1007          this.role = new CodeableConcept();
1008          return this.role;
1009        }
1010        else
1011          return super.addChild(name);
1012      }
1013
1014      public ActivityDefinitionParticipantComponent copy() {
1015        ActivityDefinitionParticipantComponent dst = new ActivityDefinitionParticipantComponent();
1016        copyValues(dst);
1017        return dst;
1018      }
1019
1020      public void copyValues(ActivityDefinitionParticipantComponent dst) {
1021        super.copyValues(dst);
1022        dst.type = type == null ? null : type.copy();
1023        dst.role = role == null ? null : role.copy();
1024      }
1025
1026      @Override
1027      public boolean equalsDeep(Base other_) {
1028        if (!super.equalsDeep(other_))
1029          return false;
1030        if (!(other_ instanceof ActivityDefinitionParticipantComponent))
1031          return false;
1032        ActivityDefinitionParticipantComponent o = (ActivityDefinitionParticipantComponent) other_;
1033        return compareDeep(type, o.type, true) && compareDeep(role, o.role, true);
1034      }
1035
1036      @Override
1037      public boolean equalsShallow(Base other_) {
1038        if (!super.equalsShallow(other_))
1039          return false;
1040        if (!(other_ instanceof ActivityDefinitionParticipantComponent))
1041          return false;
1042        ActivityDefinitionParticipantComponent o = (ActivityDefinitionParticipantComponent) other_;
1043        return compareValues(type, o.type, true);
1044      }
1045
1046      public boolean isEmpty() {
1047        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, role);
1048      }
1049
1050  public String fhirType() {
1051    return "ActivityDefinition.participant";
1052
1053  }
1054
1055  }
1056
1057    @Block()
1058    public static class ActivityDefinitionDynamicValueComponent extends BackboneElement implements IBaseBackboneElement {
1059        /**
1060         * The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).
1061         */
1062        @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1063        @Description(shortDefinition="The path to the element to be set dynamically", formalDefinition="The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details)." )
1064        protected StringType path;
1065
1066        /**
1067         * An expression specifying the value of the customized element.
1068         */
1069        @Child(name = "expression", type = {Expression.class}, order=2, min=1, max=1, modifier=false, summary=false)
1070        @Description(shortDefinition="An expression that provides the dynamic value for the customization", formalDefinition="An expression specifying the value of the customized element." )
1071        protected Expression expression;
1072
1073        private static final long serialVersionUID = 1064529082L;
1074
1075    /**
1076     * Constructor
1077     */
1078      public ActivityDefinitionDynamicValueComponent() {
1079        super();
1080      }
1081
1082    /**
1083     * Constructor
1084     */
1085      public ActivityDefinitionDynamicValueComponent(StringType path, Expression expression) {
1086        super();
1087        this.path = path;
1088        this.expression = expression;
1089      }
1090
1091        /**
1092         * @return {@link #path} (The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
1093         */
1094        public StringType getPathElement() { 
1095          if (this.path == null)
1096            if (Configuration.errorOnAutoCreate())
1097              throw new Error("Attempt to auto-create ActivityDefinitionDynamicValueComponent.path");
1098            else if (Configuration.doAutoCreate())
1099              this.path = new StringType(); // bb
1100          return this.path;
1101        }
1102
1103        public boolean hasPathElement() { 
1104          return this.path != null && !this.path.isEmpty();
1105        }
1106
1107        public boolean hasPath() { 
1108          return this.path != null && !this.path.isEmpty();
1109        }
1110
1111        /**
1112         * @param value {@link #path} (The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
1113         */
1114        public ActivityDefinitionDynamicValueComponent setPathElement(StringType value) { 
1115          this.path = value;
1116          return this;
1117        }
1118
1119        /**
1120         * @return The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).
1121         */
1122        public String getPath() { 
1123          return this.path == null ? null : this.path.getValue();
1124        }
1125
1126        /**
1127         * @param value The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).
1128         */
1129        public ActivityDefinitionDynamicValueComponent setPath(String value) { 
1130            if (this.path == null)
1131              this.path = new StringType();
1132            this.path.setValue(value);
1133          return this;
1134        }
1135
1136        /**
1137         * @return {@link #expression} (An expression specifying the value of the customized element.)
1138         */
1139        public Expression getExpression() { 
1140          if (this.expression == null)
1141            if (Configuration.errorOnAutoCreate())
1142              throw new Error("Attempt to auto-create ActivityDefinitionDynamicValueComponent.expression");
1143            else if (Configuration.doAutoCreate())
1144              this.expression = new Expression(); // cc
1145          return this.expression;
1146        }
1147
1148        public boolean hasExpression() { 
1149          return this.expression != null && !this.expression.isEmpty();
1150        }
1151
1152        /**
1153         * @param value {@link #expression} (An expression specifying the value of the customized element.)
1154         */
1155        public ActivityDefinitionDynamicValueComponent setExpression(Expression value) { 
1156          this.expression = value;
1157          return this;
1158        }
1159
1160        protected void listChildren(List<Property> children) {
1161          super.listChildren(children);
1162          children.add(new Property("path", "string", "The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).", 0, 1, path));
1163          children.add(new Property("expression", "Expression", "An expression specifying the value of the customized element.", 0, 1, expression));
1164        }
1165
1166        @Override
1167        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1168          switch (_hash) {
1169          case 3433509: /*path*/  return new Property("path", "string", "The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).", 0, 1, path);
1170          case -1795452264: /*expression*/  return new Property("expression", "Expression", "An expression specifying the value of the customized element.", 0, 1, expression);
1171          default: return super.getNamedProperty(_hash, _name, _checkValid);
1172          }
1173
1174        }
1175
1176      @Override
1177      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1178        switch (hash) {
1179        case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
1180        case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // Expression
1181        default: return super.getProperty(hash, name, checkValid);
1182        }
1183
1184      }
1185
1186      @Override
1187      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1188        switch (hash) {
1189        case 3433509: // path
1190          this.path = castToString(value); // StringType
1191          return value;
1192        case -1795452264: // expression
1193          this.expression = castToExpression(value); // Expression
1194          return value;
1195        default: return super.setProperty(hash, name, value);
1196        }
1197
1198      }
1199
1200      @Override
1201      public Base setProperty(String name, Base value) throws FHIRException {
1202        if (name.equals("path")) {
1203          this.path = castToString(value); // StringType
1204        } else if (name.equals("expression")) {
1205          this.expression = castToExpression(value); // Expression
1206        } else
1207          return super.setProperty(name, value);
1208        return value;
1209      }
1210
1211      @Override
1212      public Base makeProperty(int hash, String name) throws FHIRException {
1213        switch (hash) {
1214        case 3433509:  return getPathElement();
1215        case -1795452264:  return getExpression(); 
1216        default: return super.makeProperty(hash, name);
1217        }
1218
1219      }
1220
1221      @Override
1222      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1223        switch (hash) {
1224        case 3433509: /*path*/ return new String[] {"string"};
1225        case -1795452264: /*expression*/ return new String[] {"Expression"};
1226        default: return super.getTypesForProperty(hash, name);
1227        }
1228
1229      }
1230
1231      @Override
1232      public Base addChild(String name) throws FHIRException {
1233        if (name.equals("path")) {
1234          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.path");
1235        }
1236        else if (name.equals("expression")) {
1237          this.expression = new Expression();
1238          return this.expression;
1239        }
1240        else
1241          return super.addChild(name);
1242      }
1243
1244      public ActivityDefinitionDynamicValueComponent copy() {
1245        ActivityDefinitionDynamicValueComponent dst = new ActivityDefinitionDynamicValueComponent();
1246        copyValues(dst);
1247        return dst;
1248      }
1249
1250      public void copyValues(ActivityDefinitionDynamicValueComponent dst) {
1251        super.copyValues(dst);
1252        dst.path = path == null ? null : path.copy();
1253        dst.expression = expression == null ? null : expression.copy();
1254      }
1255
1256      @Override
1257      public boolean equalsDeep(Base other_) {
1258        if (!super.equalsDeep(other_))
1259          return false;
1260        if (!(other_ instanceof ActivityDefinitionDynamicValueComponent))
1261          return false;
1262        ActivityDefinitionDynamicValueComponent o = (ActivityDefinitionDynamicValueComponent) other_;
1263        return compareDeep(path, o.path, true) && compareDeep(expression, o.expression, true);
1264      }
1265
1266      @Override
1267      public boolean equalsShallow(Base other_) {
1268        if (!super.equalsShallow(other_))
1269          return false;
1270        if (!(other_ instanceof ActivityDefinitionDynamicValueComponent))
1271          return false;
1272        ActivityDefinitionDynamicValueComponent o = (ActivityDefinitionDynamicValueComponent) other_;
1273        return compareValues(path, o.path, true);
1274      }
1275
1276      public boolean isEmpty() {
1277        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(path, expression);
1278      }
1279
1280  public String fhirType() {
1281    return "ActivityDefinition.dynamicValue";
1282
1283  }
1284
1285  }
1286
1287    /**
1288     * A formal identifier that is used to identify this activity definition when it is represented in other formats, or referenced in a specification, model, design or an instance.
1289     */
1290    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1291    @Description(shortDefinition="Additional identifier for the activity definition", formalDefinition="A formal identifier that is used to identify this activity definition when it is represented in other formats, or referenced in a specification, model, design or an instance." )
1292    protected List<Identifier> identifier;
1293
1294    /**
1295     * An explanatory or alternate title for the activity definition giving additional information about its content.
1296     */
1297    @Child(name = "subtitle", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1298    @Description(shortDefinition="Subordinate title of the activity definition", formalDefinition="An explanatory or alternate title for the activity definition giving additional information about its content." )
1299    protected StringType subtitle;
1300
1301    /**
1302     * A code or group definition that describes the intended subject of the activity being defined.
1303     */
1304    @Child(name = "subject", type = {CodeableConcept.class, Group.class}, order=2, min=0, max=1, modifier=false, summary=false)
1305    @Description(shortDefinition="Type of individual the activity definition is intended for", formalDefinition="A code or group definition that describes the intended subject of the activity being defined." )
1306    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/subject-type")
1307    protected Type subject;
1308
1309    /**
1310     * Explanation of why this activity definition is needed and why it has been designed as it has.
1311     */
1312    @Child(name = "purpose", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
1313    @Description(shortDefinition="Why this activity definition is defined", formalDefinition="Explanation of why this activity definition is needed and why it has been designed as it has." )
1314    protected MarkdownType purpose;
1315
1316    /**
1317     * A detailed description of how the activity definition is used from a clinical perspective.
1318     */
1319    @Child(name = "usage", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
1320    @Description(shortDefinition="Describes the clinical usage of the activity definition", formalDefinition="A detailed description of how the activity definition is used from a clinical perspective." )
1321    protected StringType usage;
1322
1323    /**
1324     * A copyright statement relating to the activity definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the activity definition.
1325     */
1326    @Child(name = "copyright", type = {MarkdownType.class}, order=5, min=0, max=1, modifier=false, summary=false)
1327    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the activity definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the activity definition." )
1328    protected MarkdownType copyright;
1329
1330    /**
1331     * The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
1332     */
1333    @Child(name = "approvalDate", type = {DateType.class}, order=6, min=0, max=1, modifier=false, summary=false)
1334    @Description(shortDefinition="When the activity definition was approved by publisher", formalDefinition="The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage." )
1335    protected DateType approvalDate;
1336
1337    /**
1338     * The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
1339     */
1340    @Child(name = "lastReviewDate", type = {DateType.class}, order=7, min=0, max=1, modifier=false, summary=false)
1341    @Description(shortDefinition="When the activity definition was last reviewed", formalDefinition="The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date." )
1342    protected DateType lastReviewDate;
1343
1344    /**
1345     * The period during which the activity definition content was or is planned to be in active use.
1346     */
1347    @Child(name = "effectivePeriod", type = {Period.class}, order=8, min=0, max=1, modifier=false, summary=true)
1348    @Description(shortDefinition="When the activity definition is expected to be used", formalDefinition="The period during which the activity definition content was or is planned to be in active use." )
1349    protected Period effectivePeriod;
1350
1351    /**
1352     * Descriptive topics related to the content of the activity. Topics provide a high-level categorization of the activity that can be useful for filtering and searching.
1353     */
1354    @Child(name = "topic", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1355    @Description(shortDefinition="E.g. Education, Treatment, Assessment, etc.", formalDefinition="Descriptive topics related to the content of the activity. Topics provide a high-level categorization of the activity that can be useful for filtering and searching." )
1356    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/definition-topic")
1357    protected List<CodeableConcept> topic;
1358
1359    /**
1360     * An individiual or organization primarily involved in the creation and maintenance of the content.
1361     */
1362    @Child(name = "author", type = {ContactDetail.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1363    @Description(shortDefinition="Who authored the content", formalDefinition="An individiual or organization primarily involved in the creation and maintenance of the content." )
1364    protected List<ContactDetail> author;
1365
1366    /**
1367     * An individual or organization primarily responsible for internal coherence of the content.
1368     */
1369    @Child(name = "editor", type = {ContactDetail.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1370    @Description(shortDefinition="Who edited the content", formalDefinition="An individual or organization primarily responsible for internal coherence of the content." )
1371    protected List<ContactDetail> editor;
1372
1373    /**
1374     * An individual or organization primarily responsible for review of some aspect of the content.
1375     */
1376    @Child(name = "reviewer", type = {ContactDetail.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1377    @Description(shortDefinition="Who reviewed the content", formalDefinition="An individual or organization primarily responsible for review of some aspect of the content." )
1378    protected List<ContactDetail> reviewer;
1379
1380    /**
1381     * An individual or organization responsible for officially endorsing the content for use in some setting.
1382     */
1383    @Child(name = "endorser", type = {ContactDetail.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1384    @Description(shortDefinition="Who endorsed the content", formalDefinition="An individual or organization responsible for officially endorsing the content for use in some setting." )
1385    protected List<ContactDetail> endorser;
1386
1387    /**
1388     * Related artifacts such as additional documentation, justification, or bibliographic references.
1389     */
1390    @Child(name = "relatedArtifact", type = {RelatedArtifact.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1391    @Description(shortDefinition="Additional documentation, citations, etc.", formalDefinition="Related artifacts such as additional documentation, justification, or bibliographic references." )
1392    protected List<RelatedArtifact> relatedArtifact;
1393
1394    /**
1395     * A reference to a Library resource containing any formal logic used by the activity definition.
1396     */
1397    @Child(name = "library", type = {CanonicalType.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1398    @Description(shortDefinition="Logic used by the activity definition", formalDefinition="A reference to a Library resource containing any formal logic used by the activity definition." )
1399    protected List<CanonicalType> library;
1400
1401    /**
1402     * A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. Typically, but not always, this is a Request resource.
1403     */
1404    @Child(name = "kind", type = {CodeType.class}, order=16, min=0, max=1, modifier=false, summary=true)
1405    @Description(shortDefinition="Kind of resource", formalDefinition="A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. Typically, but not always, this is a Request resource." )
1406    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-resource-types")
1407    protected Enumeration<ActivityDefinitionKind> kind;
1408
1409    /**
1410     * A profile to which the target of the activity definition is expected to conform.
1411     */
1412    @Child(name = "profile", type = {CanonicalType.class}, order=17, min=0, max=1, modifier=false, summary=false)
1413    @Description(shortDefinition="What profile the resource needs to conform to", formalDefinition="A profile to which the target of the activity definition is expected to conform." )
1414    protected CanonicalType profile;
1415
1416    /**
1417     * Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter.
1418     */
1419    @Child(name = "code", type = {CodeableConcept.class}, order=18, min=0, max=1, modifier=false, summary=true)
1420    @Description(shortDefinition="Detail type of activity", formalDefinition="Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter." )
1421    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/procedure-code")
1422    protected CodeableConcept code;
1423
1424    /**
1425     * Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chain.
1426     */
1427    @Child(name = "intent", type = {CodeType.class}, order=19, min=0, max=1, modifier=false, summary=false)
1428    @Description(shortDefinition="proposal | plan | directive | order | original-order | reflex-order | filler-order | instance-order | option", formalDefinition="Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chain." )
1429    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-intent")
1430    protected Enumeration<RequestIntent> intent;
1431
1432    /**
1433     * Indicates how quickly the activity  should be addressed with respect to other requests.
1434     */
1435    @Child(name = "priority", type = {CodeType.class}, order=20, min=0, max=1, modifier=false, summary=false)
1436    @Description(shortDefinition="routine | urgent | asap | stat", formalDefinition="Indicates how quickly the activity  should be addressed with respect to other requests." )
1437    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-priority")
1438    protected Enumeration<RequestPriority> priority;
1439
1440    /**
1441     * Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action.
1442     */
1443    @Child(name = "doNotPerform", type = {BooleanType.class}, order=21, min=0, max=1, modifier=true, summary=true)
1444    @Description(shortDefinition="True if the activity should not be performed", formalDefinition="Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action." )
1445    protected BooleanType doNotPerform;
1446
1447    /**
1448     * The period, timing or frequency upon which the described activity is to occur.
1449     */
1450    @Child(name = "timing", type = {Timing.class, DateTimeType.class, Age.class, Period.class, Range.class, Duration.class}, order=22, min=0, max=1, modifier=false, summary=false)
1451    @Description(shortDefinition="When activity is to occur", formalDefinition="The period, timing or frequency upon which the described activity is to occur." )
1452    protected Type timing;
1453
1454    /**
1455     * Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.
1456     */
1457    @Child(name = "location", type = {Location.class}, order=23, min=0, max=1, modifier=false, summary=false)
1458    @Description(shortDefinition="Where it should happen", formalDefinition="Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc." )
1459    protected Reference location;
1460
1461    /**
1462     * The actual object that is the target of the reference (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.)
1463     */
1464    protected Location locationTarget;
1465
1466    /**
1467     * Indicates who should participate in performing the action described.
1468     */
1469    @Child(name = "participant", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1470    @Description(shortDefinition="Who should participate in the action", formalDefinition="Indicates who should participate in performing the action described." )
1471    protected List<ActivityDefinitionParticipantComponent> participant;
1472
1473    /**
1474     * Identifies the food, drug or other product being consumed or supplied in the activity.
1475     */
1476    @Child(name = "product", type = {Medication.class, Substance.class, CodeableConcept.class}, order=25, min=0, max=1, modifier=false, summary=false)
1477    @Description(shortDefinition="What's administered/supplied", formalDefinition="Identifies the food, drug or other product being consumed or supplied in the activity." )
1478    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-codes")
1479    protected Type product;
1480
1481    /**
1482     * Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).
1483     */
1484    @Child(name = "quantity", type = {Quantity.class}, order=26, min=0, max=1, modifier=false, summary=false)
1485    @Description(shortDefinition="How much is administered/consumed/supplied", formalDefinition="Identifies the quantity expected to be consumed at once (per dose, per meal, etc.)." )
1486    protected Quantity quantity;
1487
1488    /**
1489     * Provides detailed dosage instructions in the same way that they are described for MedicationRequest resources.
1490     */
1491    @Child(name = "dosage", type = {Dosage.class}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1492    @Description(shortDefinition="Detailed dosage instructions", formalDefinition="Provides detailed dosage instructions in the same way that they are described for MedicationRequest resources." )
1493    protected List<Dosage> dosage;
1494
1495    /**
1496     * Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).
1497     */
1498    @Child(name = "bodySite", type = {CodeableConcept.class}, order=28, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1499    @Description(shortDefinition="What part of body to perform on", formalDefinition="Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites)." )
1500    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/body-site")
1501    protected List<CodeableConcept> bodySite;
1502
1503    /**
1504     * Defines specimen requirements for the action to be performed, such as required specimens for a lab test.
1505     */
1506    @Child(name = "specimenRequirement", type = {SpecimenDefinition.class}, order=29, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1507    @Description(shortDefinition="What specimens are required to perform this action", formalDefinition="Defines specimen requirements for the action to be performed, such as required specimens for a lab test." )
1508    protected List<Reference> specimenRequirement;
1509    /**
1510     * The actual objects that are the target of the reference (Defines specimen requirements for the action to be performed, such as required specimens for a lab test.)
1511     */
1512    protected List<SpecimenDefinition> specimenRequirementTarget;
1513
1514
1515    /**
1516     * Defines observation requirements for the action to be performed, such as body weight or surface area.
1517     */
1518    @Child(name = "observationRequirement", type = {ObservationDefinition.class}, order=30, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1519    @Description(shortDefinition="What observations are required to perform this action", formalDefinition="Defines observation requirements for the action to be performed, such as body weight or surface area." )
1520    protected List<Reference> observationRequirement;
1521    /**
1522     * The actual objects that are the target of the reference (Defines observation requirements for the action to be performed, such as body weight or surface area.)
1523     */
1524    protected List<ObservationDefinition> observationRequirementTarget;
1525
1526
1527    /**
1528     * Defines the observations that are expected to be produced by the action.
1529     */
1530    @Child(name = "observationResultRequirement", type = {ObservationDefinition.class}, order=31, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1531    @Description(shortDefinition="What observations must be produced by this action", formalDefinition="Defines the observations that are expected to be produced by the action." )
1532    protected List<Reference> observationResultRequirement;
1533    /**
1534     * The actual objects that are the target of the reference (Defines the observations that are expected to be produced by the action.)
1535     */
1536    protected List<ObservationDefinition> observationResultRequirementTarget;
1537
1538
1539    /**
1540     * A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.
1541     */
1542    @Child(name = "transform", type = {CanonicalType.class}, order=32, min=0, max=1, modifier=false, summary=false)
1543    @Description(shortDefinition="Transform to apply the template", formalDefinition="A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input." )
1544    protected CanonicalType transform;
1545
1546    /**
1547     * Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the request resource that would contain the result.
1548     */
1549    @Child(name = "dynamicValue", type = {}, order=33, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1550    @Description(shortDefinition="Dynamic aspects of the definition", formalDefinition="Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the request resource that would contain the result." )
1551    protected List<ActivityDefinitionDynamicValueComponent> dynamicValue;
1552
1553    private static final long serialVersionUID = 1488459022L;
1554
1555  /**
1556   * Constructor
1557   */
1558    public ActivityDefinition() {
1559      super();
1560    }
1561
1562  /**
1563   * Constructor
1564   */
1565    public ActivityDefinition(Enumeration<PublicationStatus> status) {
1566      super();
1567      this.status = status;
1568    }
1569
1570    /**
1571     * @return {@link #url} (An absolute URI that is used to identify this activity definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this activity definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the activity definition is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1572     */
1573    public UriType getUrlElement() { 
1574      if (this.url == null)
1575        if (Configuration.errorOnAutoCreate())
1576          throw new Error("Attempt to auto-create ActivityDefinition.url");
1577        else if (Configuration.doAutoCreate())
1578          this.url = new UriType(); // bb
1579      return this.url;
1580    }
1581
1582    public boolean hasUrlElement() { 
1583      return this.url != null && !this.url.isEmpty();
1584    }
1585
1586    public boolean hasUrl() { 
1587      return this.url != null && !this.url.isEmpty();
1588    }
1589
1590    /**
1591     * @param value {@link #url} (An absolute URI that is used to identify this activity definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this activity definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the activity definition is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1592     */
1593    public ActivityDefinition setUrlElement(UriType value) { 
1594      this.url = value;
1595      return this;
1596    }
1597
1598    /**
1599     * @return An absolute URI that is used to identify this activity definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this activity definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the activity definition is stored on different servers.
1600     */
1601    public String getUrl() { 
1602      return this.url == null ? null : this.url.getValue();
1603    }
1604
1605    /**
1606     * @param value An absolute URI that is used to identify this activity definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this activity definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the activity definition is stored on different servers.
1607     */
1608    public ActivityDefinition setUrl(String value) { 
1609      if (Utilities.noString(value))
1610        this.url = null;
1611      else {
1612        if (this.url == null)
1613          this.url = new UriType();
1614        this.url.setValue(value);
1615      }
1616      return this;
1617    }
1618
1619    /**
1620     * @return {@link #identifier} (A formal identifier that is used to identify this activity definition when it is represented in other formats, or referenced in a specification, model, design or an instance.)
1621     */
1622    public List<Identifier> getIdentifier() { 
1623      if (this.identifier == null)
1624        this.identifier = new ArrayList<Identifier>();
1625      return this.identifier;
1626    }
1627
1628    /**
1629     * @return Returns a reference to <code>this</code> for easy method chaining
1630     */
1631    public ActivityDefinition setIdentifier(List<Identifier> theIdentifier) { 
1632      this.identifier = theIdentifier;
1633      return this;
1634    }
1635
1636    public boolean hasIdentifier() { 
1637      if (this.identifier == null)
1638        return false;
1639      for (Identifier item : this.identifier)
1640        if (!item.isEmpty())
1641          return true;
1642      return false;
1643    }
1644
1645    public Identifier addIdentifier() { //3
1646      Identifier t = new Identifier();
1647      if (this.identifier == null)
1648        this.identifier = new ArrayList<Identifier>();
1649      this.identifier.add(t);
1650      return t;
1651    }
1652
1653    public ActivityDefinition addIdentifier(Identifier t) { //3
1654      if (t == null)
1655        return this;
1656      if (this.identifier == null)
1657        this.identifier = new ArrayList<Identifier>();
1658      this.identifier.add(t);
1659      return this;
1660    }
1661
1662    /**
1663     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1664     */
1665    public Identifier getIdentifierFirstRep() { 
1666      if (getIdentifier().isEmpty()) {
1667        addIdentifier();
1668      }
1669      return getIdentifier().get(0);
1670    }
1671
1672    /**
1673     * @return {@link #version} (The identifier that is used to identify this version of the activity definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the activity definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1674     */
1675    public StringType getVersionElement() { 
1676      if (this.version == null)
1677        if (Configuration.errorOnAutoCreate())
1678          throw new Error("Attempt to auto-create ActivityDefinition.version");
1679        else if (Configuration.doAutoCreate())
1680          this.version = new StringType(); // bb
1681      return this.version;
1682    }
1683
1684    public boolean hasVersionElement() { 
1685      return this.version != null && !this.version.isEmpty();
1686    }
1687
1688    public boolean hasVersion() { 
1689      return this.version != null && !this.version.isEmpty();
1690    }
1691
1692    /**
1693     * @param value {@link #version} (The identifier that is used to identify this version of the activity definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the activity definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1694     */
1695    public ActivityDefinition setVersionElement(StringType value) { 
1696      this.version = value;
1697      return this;
1698    }
1699
1700    /**
1701     * @return The identifier that is used to identify this version of the activity definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the activity definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets.
1702     */
1703    public String getVersion() { 
1704      return this.version == null ? null : this.version.getValue();
1705    }
1706
1707    /**
1708     * @param value The identifier that is used to identify this version of the activity definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the activity definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets.
1709     */
1710    public ActivityDefinition setVersion(String value) { 
1711      if (Utilities.noString(value))
1712        this.version = null;
1713      else {
1714        if (this.version == null)
1715          this.version = new StringType();
1716        this.version.setValue(value);
1717      }
1718      return this;
1719    }
1720
1721    /**
1722     * @return {@link #name} (A natural language name identifying the activity definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1723     */
1724    public StringType getNameElement() { 
1725      if (this.name == null)
1726        if (Configuration.errorOnAutoCreate())
1727          throw new Error("Attempt to auto-create ActivityDefinition.name");
1728        else if (Configuration.doAutoCreate())
1729          this.name = new StringType(); // bb
1730      return this.name;
1731    }
1732
1733    public boolean hasNameElement() { 
1734      return this.name != null && !this.name.isEmpty();
1735    }
1736
1737    public boolean hasName() { 
1738      return this.name != null && !this.name.isEmpty();
1739    }
1740
1741    /**
1742     * @param value {@link #name} (A natural language name identifying the activity definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1743     */
1744    public ActivityDefinition setNameElement(StringType value) { 
1745      this.name = value;
1746      return this;
1747    }
1748
1749    /**
1750     * @return A natural language name identifying the activity definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.
1751     */
1752    public String getName() { 
1753      return this.name == null ? null : this.name.getValue();
1754    }
1755
1756    /**
1757     * @param value A natural language name identifying the activity definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.
1758     */
1759    public ActivityDefinition setName(String value) { 
1760      if (Utilities.noString(value))
1761        this.name = null;
1762      else {
1763        if (this.name == null)
1764          this.name = new StringType();
1765        this.name.setValue(value);
1766      }
1767      return this;
1768    }
1769
1770    /**
1771     * @return {@link #title} (A short, descriptive, user-friendly title for the activity definition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1772     */
1773    public StringType getTitleElement() { 
1774      if (this.title == null)
1775        if (Configuration.errorOnAutoCreate())
1776          throw new Error("Attempt to auto-create ActivityDefinition.title");
1777        else if (Configuration.doAutoCreate())
1778          this.title = new StringType(); // bb
1779      return this.title;
1780    }
1781
1782    public boolean hasTitleElement() { 
1783      return this.title != null && !this.title.isEmpty();
1784    }
1785
1786    public boolean hasTitle() { 
1787      return this.title != null && !this.title.isEmpty();
1788    }
1789
1790    /**
1791     * @param value {@link #title} (A short, descriptive, user-friendly title for the activity definition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1792     */
1793    public ActivityDefinition setTitleElement(StringType value) { 
1794      this.title = value;
1795      return this;
1796    }
1797
1798    /**
1799     * @return A short, descriptive, user-friendly title for the activity definition.
1800     */
1801    public String getTitle() { 
1802      return this.title == null ? null : this.title.getValue();
1803    }
1804
1805    /**
1806     * @param value A short, descriptive, user-friendly title for the activity definition.
1807     */
1808    public ActivityDefinition setTitle(String value) { 
1809      if (Utilities.noString(value))
1810        this.title = null;
1811      else {
1812        if (this.title == null)
1813          this.title = new StringType();
1814        this.title.setValue(value);
1815      }
1816      return this;
1817    }
1818
1819    /**
1820     * @return {@link #subtitle} (An explanatory or alternate title for the activity definition giving additional information about its content.). This is the underlying object with id, value and extensions. The accessor "getSubtitle" gives direct access to the value
1821     */
1822    public StringType getSubtitleElement() { 
1823      if (this.subtitle == null)
1824        if (Configuration.errorOnAutoCreate())
1825          throw new Error("Attempt to auto-create ActivityDefinition.subtitle");
1826        else if (Configuration.doAutoCreate())
1827          this.subtitle = new StringType(); // bb
1828      return this.subtitle;
1829    }
1830
1831    public boolean hasSubtitleElement() { 
1832      return this.subtitle != null && !this.subtitle.isEmpty();
1833    }
1834
1835    public boolean hasSubtitle() { 
1836      return this.subtitle != null && !this.subtitle.isEmpty();
1837    }
1838
1839    /**
1840     * @param value {@link #subtitle} (An explanatory or alternate title for the activity definition giving additional information about its content.). This is the underlying object with id, value and extensions. The accessor "getSubtitle" gives direct access to the value
1841     */
1842    public ActivityDefinition setSubtitleElement(StringType value) { 
1843      this.subtitle = value;
1844      return this;
1845    }
1846
1847    /**
1848     * @return An explanatory or alternate title for the activity definition giving additional information about its content.
1849     */
1850    public String getSubtitle() { 
1851      return this.subtitle == null ? null : this.subtitle.getValue();
1852    }
1853
1854    /**
1855     * @param value An explanatory or alternate title for the activity definition giving additional information about its content.
1856     */
1857    public ActivityDefinition setSubtitle(String value) { 
1858      if (Utilities.noString(value))
1859        this.subtitle = null;
1860      else {
1861        if (this.subtitle == null)
1862          this.subtitle = new StringType();
1863        this.subtitle.setValue(value);
1864      }
1865      return this;
1866    }
1867
1868    /**
1869     * @return {@link #status} (The status of this activity definition. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1870     */
1871    public Enumeration<PublicationStatus> getStatusElement() { 
1872      if (this.status == null)
1873        if (Configuration.errorOnAutoCreate())
1874          throw new Error("Attempt to auto-create ActivityDefinition.status");
1875        else if (Configuration.doAutoCreate())
1876          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
1877      return this.status;
1878    }
1879
1880    public boolean hasStatusElement() { 
1881      return this.status != null && !this.status.isEmpty();
1882    }
1883
1884    public boolean hasStatus() { 
1885      return this.status != null && !this.status.isEmpty();
1886    }
1887
1888    /**
1889     * @param value {@link #status} (The status of this activity definition. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1890     */
1891    public ActivityDefinition setStatusElement(Enumeration<PublicationStatus> value) { 
1892      this.status = value;
1893      return this;
1894    }
1895
1896    /**
1897     * @return The status of this activity definition. Enables tracking the life-cycle of the content.
1898     */
1899    public PublicationStatus getStatus() { 
1900      return this.status == null ? null : this.status.getValue();
1901    }
1902
1903    /**
1904     * @param value The status of this activity definition. Enables tracking the life-cycle of the content.
1905     */
1906    public ActivityDefinition setStatus(PublicationStatus value) { 
1907        if (this.status == null)
1908          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
1909        this.status.setValue(value);
1910      return this;
1911    }
1912
1913    /**
1914     * @return {@link #experimental} (A Boolean value to indicate that this activity definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
1915     */
1916    public BooleanType getExperimentalElement() { 
1917      if (this.experimental == null)
1918        if (Configuration.errorOnAutoCreate())
1919          throw new Error("Attempt to auto-create ActivityDefinition.experimental");
1920        else if (Configuration.doAutoCreate())
1921          this.experimental = new BooleanType(); // bb
1922      return this.experimental;
1923    }
1924
1925    public boolean hasExperimentalElement() { 
1926      return this.experimental != null && !this.experimental.isEmpty();
1927    }
1928
1929    public boolean hasExperimental() { 
1930      return this.experimental != null && !this.experimental.isEmpty();
1931    }
1932
1933    /**
1934     * @param value {@link #experimental} (A Boolean value to indicate that this activity definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
1935     */
1936    public ActivityDefinition setExperimentalElement(BooleanType value) { 
1937      this.experimental = value;
1938      return this;
1939    }
1940
1941    /**
1942     * @return A Boolean value to indicate that this activity definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
1943     */
1944    public boolean getExperimental() { 
1945      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
1946    }
1947
1948    /**
1949     * @param value A Boolean value to indicate that this activity definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
1950     */
1951    public ActivityDefinition setExperimental(boolean value) { 
1952        if (this.experimental == null)
1953          this.experimental = new BooleanType();
1954        this.experimental.setValue(value);
1955      return this;
1956    }
1957
1958    /**
1959     * @return {@link #subject} (A code or group definition that describes the intended subject of the activity being defined.)
1960     */
1961    public Type getSubject() { 
1962      return this.subject;
1963    }
1964
1965    /**
1966     * @return {@link #subject} (A code or group definition that describes the intended subject of the activity being defined.)
1967     */
1968    public CodeableConcept getSubjectCodeableConcept() throws FHIRException { 
1969      if (this.subject == null)
1970        this.subject = new CodeableConcept();
1971      if (!(this.subject instanceof CodeableConcept))
1972        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.subject.getClass().getName()+" was encountered");
1973      return (CodeableConcept) this.subject;
1974    }
1975
1976    public boolean hasSubjectCodeableConcept() { 
1977      return this != null && this.subject instanceof CodeableConcept;
1978    }
1979
1980    /**
1981     * @return {@link #subject} (A code or group definition that describes the intended subject of the activity being defined.)
1982     */
1983    public Reference getSubjectReference() throws FHIRException { 
1984      if (this.subject == null)
1985        this.subject = new Reference();
1986      if (!(this.subject instanceof Reference))
1987        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.subject.getClass().getName()+" was encountered");
1988      return (Reference) this.subject;
1989    }
1990
1991    public boolean hasSubjectReference() { 
1992      return this != null && this.subject instanceof Reference;
1993    }
1994
1995    public boolean hasSubject() { 
1996      return this.subject != null && !this.subject.isEmpty();
1997    }
1998
1999    /**
2000     * @param value {@link #subject} (A code or group definition that describes the intended subject of the activity being defined.)
2001     */
2002    public ActivityDefinition setSubject(Type value) { 
2003      if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
2004        throw new Error("Not the right type for ActivityDefinition.subject[x]: "+value.fhirType());
2005      this.subject = value;
2006      return this;
2007    }
2008
2009    /**
2010     * @return {@link #date} (The date  (and optionally time) when the activity definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the activity definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2011     */
2012    public DateTimeType getDateElement() { 
2013      if (this.date == null)
2014        if (Configuration.errorOnAutoCreate())
2015          throw new Error("Attempt to auto-create ActivityDefinition.date");
2016        else if (Configuration.doAutoCreate())
2017          this.date = new DateTimeType(); // bb
2018      return this.date;
2019    }
2020
2021    public boolean hasDateElement() { 
2022      return this.date != null && !this.date.isEmpty();
2023    }
2024
2025    public boolean hasDate() { 
2026      return this.date != null && !this.date.isEmpty();
2027    }
2028
2029    /**
2030     * @param value {@link #date} (The date  (and optionally time) when the activity definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the activity definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2031     */
2032    public ActivityDefinition setDateElement(DateTimeType value) { 
2033      this.date = value;
2034      return this;
2035    }
2036
2037    /**
2038     * @return The date  (and optionally time) when the activity definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the activity definition changes.
2039     */
2040    public Date getDate() { 
2041      return this.date == null ? null : this.date.getValue();
2042    }
2043
2044    /**
2045     * @param value The date  (and optionally time) when the activity definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the activity definition changes.
2046     */
2047    public ActivityDefinition setDate(Date value) { 
2048      if (value == null)
2049        this.date = null;
2050      else {
2051        if (this.date == null)
2052          this.date = new DateTimeType();
2053        this.date.setValue(value);
2054      }
2055      return this;
2056    }
2057
2058    /**
2059     * @return {@link #publisher} (The name of the organization or individual that published the activity definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
2060     */
2061    public StringType getPublisherElement() { 
2062      if (this.publisher == null)
2063        if (Configuration.errorOnAutoCreate())
2064          throw new Error("Attempt to auto-create ActivityDefinition.publisher");
2065        else if (Configuration.doAutoCreate())
2066          this.publisher = new StringType(); // bb
2067      return this.publisher;
2068    }
2069
2070    public boolean hasPublisherElement() { 
2071      return this.publisher != null && !this.publisher.isEmpty();
2072    }
2073
2074    public boolean hasPublisher() { 
2075      return this.publisher != null && !this.publisher.isEmpty();
2076    }
2077
2078    /**
2079     * @param value {@link #publisher} (The name of the organization or individual that published the activity definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
2080     */
2081    public ActivityDefinition setPublisherElement(StringType value) { 
2082      this.publisher = value;
2083      return this;
2084    }
2085
2086    /**
2087     * @return The name of the organization or individual that published the activity definition.
2088     */
2089    public String getPublisher() { 
2090      return this.publisher == null ? null : this.publisher.getValue();
2091    }
2092
2093    /**
2094     * @param value The name of the organization or individual that published the activity definition.
2095     */
2096    public ActivityDefinition setPublisher(String value) { 
2097      if (Utilities.noString(value))
2098        this.publisher = null;
2099      else {
2100        if (this.publisher == null)
2101          this.publisher = new StringType();
2102        this.publisher.setValue(value);
2103      }
2104      return this;
2105    }
2106
2107    /**
2108     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
2109     */
2110    public List<ContactDetail> getContact() { 
2111      if (this.contact == null)
2112        this.contact = new ArrayList<ContactDetail>();
2113      return this.contact;
2114    }
2115
2116    /**
2117     * @return Returns a reference to <code>this</code> for easy method chaining
2118     */
2119    public ActivityDefinition setContact(List<ContactDetail> theContact) { 
2120      this.contact = theContact;
2121      return this;
2122    }
2123
2124    public boolean hasContact() { 
2125      if (this.contact == null)
2126        return false;
2127      for (ContactDetail item : this.contact)
2128        if (!item.isEmpty())
2129          return true;
2130      return false;
2131    }
2132
2133    public ContactDetail addContact() { //3
2134      ContactDetail t = new ContactDetail();
2135      if (this.contact == null)
2136        this.contact = new ArrayList<ContactDetail>();
2137      this.contact.add(t);
2138      return t;
2139    }
2140
2141    public ActivityDefinition addContact(ContactDetail t) { //3
2142      if (t == null)
2143        return this;
2144      if (this.contact == null)
2145        this.contact = new ArrayList<ContactDetail>();
2146      this.contact.add(t);
2147      return this;
2148    }
2149
2150    /**
2151     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
2152     */
2153    public ContactDetail getContactFirstRep() { 
2154      if (getContact().isEmpty()) {
2155        addContact();
2156      }
2157      return getContact().get(0);
2158    }
2159
2160    /**
2161     * @return {@link #description} (A free text natural language description of the activity definition from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2162     */
2163    public MarkdownType getDescriptionElement() { 
2164      if (this.description == null)
2165        if (Configuration.errorOnAutoCreate())
2166          throw new Error("Attempt to auto-create ActivityDefinition.description");
2167        else if (Configuration.doAutoCreate())
2168          this.description = new MarkdownType(); // bb
2169      return this.description;
2170    }
2171
2172    public boolean hasDescriptionElement() { 
2173      return this.description != null && !this.description.isEmpty();
2174    }
2175
2176    public boolean hasDescription() { 
2177      return this.description != null && !this.description.isEmpty();
2178    }
2179
2180    /**
2181     * @param value {@link #description} (A free text natural language description of the activity definition from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2182     */
2183    public ActivityDefinition setDescriptionElement(MarkdownType value) { 
2184      this.description = value;
2185      return this;
2186    }
2187
2188    /**
2189     * @return A free text natural language description of the activity definition from a consumer's perspective.
2190     */
2191    public String getDescription() { 
2192      return this.description == null ? null : this.description.getValue();
2193    }
2194
2195    /**
2196     * @param value A free text natural language description of the activity definition from a consumer's perspective.
2197     */
2198    public ActivityDefinition setDescription(String value) { 
2199      if (value == null)
2200        this.description = null;
2201      else {
2202        if (this.description == null)
2203          this.description = new MarkdownType();
2204        this.description.setValue(value);
2205      }
2206      return this;
2207    }
2208
2209    /**
2210     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate activity definition instances.)
2211     */
2212    public List<UsageContext> getUseContext() { 
2213      if (this.useContext == null)
2214        this.useContext = new ArrayList<UsageContext>();
2215      return this.useContext;
2216    }
2217
2218    /**
2219     * @return Returns a reference to <code>this</code> for easy method chaining
2220     */
2221    public ActivityDefinition setUseContext(List<UsageContext> theUseContext) { 
2222      this.useContext = theUseContext;
2223      return this;
2224    }
2225
2226    public boolean hasUseContext() { 
2227      if (this.useContext == null)
2228        return false;
2229      for (UsageContext item : this.useContext)
2230        if (!item.isEmpty())
2231          return true;
2232      return false;
2233    }
2234
2235    public UsageContext addUseContext() { //3
2236      UsageContext t = new UsageContext();
2237      if (this.useContext == null)
2238        this.useContext = new ArrayList<UsageContext>();
2239      this.useContext.add(t);
2240      return t;
2241    }
2242
2243    public ActivityDefinition addUseContext(UsageContext t) { //3
2244      if (t == null)
2245        return this;
2246      if (this.useContext == null)
2247        this.useContext = new ArrayList<UsageContext>();
2248      this.useContext.add(t);
2249      return this;
2250    }
2251
2252    /**
2253     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
2254     */
2255    public UsageContext getUseContextFirstRep() { 
2256      if (getUseContext().isEmpty()) {
2257        addUseContext();
2258      }
2259      return getUseContext().get(0);
2260    }
2261
2262    /**
2263     * @return {@link #jurisdiction} (A legal or geographic region in which the activity definition is intended to be used.)
2264     */
2265    public List<CodeableConcept> getJurisdiction() { 
2266      if (this.jurisdiction == null)
2267        this.jurisdiction = new ArrayList<CodeableConcept>();
2268      return this.jurisdiction;
2269    }
2270
2271    /**
2272     * @return Returns a reference to <code>this</code> for easy method chaining
2273     */
2274    public ActivityDefinition setJurisdiction(List<CodeableConcept> theJurisdiction) { 
2275      this.jurisdiction = theJurisdiction;
2276      return this;
2277    }
2278
2279    public boolean hasJurisdiction() { 
2280      if (this.jurisdiction == null)
2281        return false;
2282      for (CodeableConcept item : this.jurisdiction)
2283        if (!item.isEmpty())
2284          return true;
2285      return false;
2286    }
2287
2288    public CodeableConcept addJurisdiction() { //3
2289      CodeableConcept t = new CodeableConcept();
2290      if (this.jurisdiction == null)
2291        this.jurisdiction = new ArrayList<CodeableConcept>();
2292      this.jurisdiction.add(t);
2293      return t;
2294    }
2295
2296    public ActivityDefinition addJurisdiction(CodeableConcept t) { //3
2297      if (t == null)
2298        return this;
2299      if (this.jurisdiction == null)
2300        this.jurisdiction = new ArrayList<CodeableConcept>();
2301      this.jurisdiction.add(t);
2302      return this;
2303    }
2304
2305    /**
2306     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
2307     */
2308    public CodeableConcept getJurisdictionFirstRep() { 
2309      if (getJurisdiction().isEmpty()) {
2310        addJurisdiction();
2311      }
2312      return getJurisdiction().get(0);
2313    }
2314
2315    /**
2316     * @return {@link #purpose} (Explanation of why this activity definition is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
2317     */
2318    public MarkdownType getPurposeElement() { 
2319      if (this.purpose == null)
2320        if (Configuration.errorOnAutoCreate())
2321          throw new Error("Attempt to auto-create ActivityDefinition.purpose");
2322        else if (Configuration.doAutoCreate())
2323          this.purpose = new MarkdownType(); // bb
2324      return this.purpose;
2325    }
2326
2327    public boolean hasPurposeElement() { 
2328      return this.purpose != null && !this.purpose.isEmpty();
2329    }
2330
2331    public boolean hasPurpose() { 
2332      return this.purpose != null && !this.purpose.isEmpty();
2333    }
2334
2335    /**
2336     * @param value {@link #purpose} (Explanation of why this activity definition is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
2337     */
2338    public ActivityDefinition setPurposeElement(MarkdownType value) { 
2339      this.purpose = value;
2340      return this;
2341    }
2342
2343    /**
2344     * @return Explanation of why this activity definition is needed and why it has been designed as it has.
2345     */
2346    public String getPurpose() { 
2347      return this.purpose == null ? null : this.purpose.getValue();
2348    }
2349
2350    /**
2351     * @param value Explanation of why this activity definition is needed and why it has been designed as it has.
2352     */
2353    public ActivityDefinition setPurpose(String value) { 
2354      if (value == null)
2355        this.purpose = null;
2356      else {
2357        if (this.purpose == null)
2358          this.purpose = new MarkdownType();
2359        this.purpose.setValue(value);
2360      }
2361      return this;
2362    }
2363
2364    /**
2365     * @return {@link #usage} (A detailed description of how the activity definition is used from a clinical perspective.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value
2366     */
2367    public StringType getUsageElement() { 
2368      if (this.usage == null)
2369        if (Configuration.errorOnAutoCreate())
2370          throw new Error("Attempt to auto-create ActivityDefinition.usage");
2371        else if (Configuration.doAutoCreate())
2372          this.usage = new StringType(); // bb
2373      return this.usage;
2374    }
2375
2376    public boolean hasUsageElement() { 
2377      return this.usage != null && !this.usage.isEmpty();
2378    }
2379
2380    public boolean hasUsage() { 
2381      return this.usage != null && !this.usage.isEmpty();
2382    }
2383
2384    /**
2385     * @param value {@link #usage} (A detailed description of how the activity definition is used from a clinical perspective.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value
2386     */
2387    public ActivityDefinition setUsageElement(StringType value) { 
2388      this.usage = value;
2389      return this;
2390    }
2391
2392    /**
2393     * @return A detailed description of how the activity definition is used from a clinical perspective.
2394     */
2395    public String getUsage() { 
2396      return this.usage == null ? null : this.usage.getValue();
2397    }
2398
2399    /**
2400     * @param value A detailed description of how the activity definition is used from a clinical perspective.
2401     */
2402    public ActivityDefinition setUsage(String value) { 
2403      if (Utilities.noString(value))
2404        this.usage = null;
2405      else {
2406        if (this.usage == null)
2407          this.usage = new StringType();
2408        this.usage.setValue(value);
2409      }
2410      return this;
2411    }
2412
2413    /**
2414     * @return {@link #copyright} (A copyright statement relating to the activity definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the activity definition.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
2415     */
2416    public MarkdownType getCopyrightElement() { 
2417      if (this.copyright == null)
2418        if (Configuration.errorOnAutoCreate())
2419          throw new Error("Attempt to auto-create ActivityDefinition.copyright");
2420        else if (Configuration.doAutoCreate())
2421          this.copyright = new MarkdownType(); // bb
2422      return this.copyright;
2423    }
2424
2425    public boolean hasCopyrightElement() { 
2426      return this.copyright != null && !this.copyright.isEmpty();
2427    }
2428
2429    public boolean hasCopyright() { 
2430      return this.copyright != null && !this.copyright.isEmpty();
2431    }
2432
2433    /**
2434     * @param value {@link #copyright} (A copyright statement relating to the activity definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the activity definition.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
2435     */
2436    public ActivityDefinition setCopyrightElement(MarkdownType value) { 
2437      this.copyright = value;
2438      return this;
2439    }
2440
2441    /**
2442     * @return A copyright statement relating to the activity definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the activity definition.
2443     */
2444    public String getCopyright() { 
2445      return this.copyright == null ? null : this.copyright.getValue();
2446    }
2447
2448    /**
2449     * @param value A copyright statement relating to the activity definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the activity definition.
2450     */
2451    public ActivityDefinition setCopyright(String value) { 
2452      if (value == null)
2453        this.copyright = null;
2454      else {
2455        if (this.copyright == null)
2456          this.copyright = new MarkdownType();
2457        this.copyright.setValue(value);
2458      }
2459      return this;
2460    }
2461
2462    /**
2463     * @return {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
2464     */
2465    public DateType getApprovalDateElement() { 
2466      if (this.approvalDate == null)
2467        if (Configuration.errorOnAutoCreate())
2468          throw new Error("Attempt to auto-create ActivityDefinition.approvalDate");
2469        else if (Configuration.doAutoCreate())
2470          this.approvalDate = new DateType(); // bb
2471      return this.approvalDate;
2472    }
2473
2474    public boolean hasApprovalDateElement() { 
2475      return this.approvalDate != null && !this.approvalDate.isEmpty();
2476    }
2477
2478    public boolean hasApprovalDate() { 
2479      return this.approvalDate != null && !this.approvalDate.isEmpty();
2480    }
2481
2482    /**
2483     * @param value {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
2484     */
2485    public ActivityDefinition setApprovalDateElement(DateType value) { 
2486      this.approvalDate = value;
2487      return this;
2488    }
2489
2490    /**
2491     * @return The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
2492     */
2493    public Date getApprovalDate() { 
2494      return this.approvalDate == null ? null : this.approvalDate.getValue();
2495    }
2496
2497    /**
2498     * @param value The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
2499     */
2500    public ActivityDefinition setApprovalDate(Date value) { 
2501      if (value == null)
2502        this.approvalDate = null;
2503      else {
2504        if (this.approvalDate == null)
2505          this.approvalDate = new DateType();
2506        this.approvalDate.setValue(value);
2507      }
2508      return this;
2509    }
2510
2511    /**
2512     * @return {@link #lastReviewDate} (The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
2513     */
2514    public DateType getLastReviewDateElement() { 
2515      if (this.lastReviewDate == null)
2516        if (Configuration.errorOnAutoCreate())
2517          throw new Error("Attempt to auto-create ActivityDefinition.lastReviewDate");
2518        else if (Configuration.doAutoCreate())
2519          this.lastReviewDate = new DateType(); // bb
2520      return this.lastReviewDate;
2521    }
2522
2523    public boolean hasLastReviewDateElement() { 
2524      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
2525    }
2526
2527    public boolean hasLastReviewDate() { 
2528      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
2529    }
2530
2531    /**
2532     * @param value {@link #lastReviewDate} (The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
2533     */
2534    public ActivityDefinition setLastReviewDateElement(DateType value) { 
2535      this.lastReviewDate = value;
2536      return this;
2537    }
2538
2539    /**
2540     * @return The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
2541     */
2542    public Date getLastReviewDate() { 
2543      return this.lastReviewDate == null ? null : this.lastReviewDate.getValue();
2544    }
2545
2546    /**
2547     * @param value The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
2548     */
2549    public ActivityDefinition setLastReviewDate(Date value) { 
2550      if (value == null)
2551        this.lastReviewDate = null;
2552      else {
2553        if (this.lastReviewDate == null)
2554          this.lastReviewDate = new DateType();
2555        this.lastReviewDate.setValue(value);
2556      }
2557      return this;
2558    }
2559
2560    /**
2561     * @return {@link #effectivePeriod} (The period during which the activity definition content was or is planned to be in active use.)
2562     */
2563    public Period getEffectivePeriod() { 
2564      if (this.effectivePeriod == null)
2565        if (Configuration.errorOnAutoCreate())
2566          throw new Error("Attempt to auto-create ActivityDefinition.effectivePeriod");
2567        else if (Configuration.doAutoCreate())
2568          this.effectivePeriod = new Period(); // cc
2569      return this.effectivePeriod;
2570    }
2571
2572    public boolean hasEffectivePeriod() { 
2573      return this.effectivePeriod != null && !this.effectivePeriod.isEmpty();
2574    }
2575
2576    /**
2577     * @param value {@link #effectivePeriod} (The period during which the activity definition content was or is planned to be in active use.)
2578     */
2579    public ActivityDefinition setEffectivePeriod(Period value) { 
2580      this.effectivePeriod = value;
2581      return this;
2582    }
2583
2584    /**
2585     * @return {@link #topic} (Descriptive topics related to the content of the activity. Topics provide a high-level categorization of the activity that can be useful for filtering and searching.)
2586     */
2587    public List<CodeableConcept> getTopic() { 
2588      if (this.topic == null)
2589        this.topic = new ArrayList<CodeableConcept>();
2590      return this.topic;
2591    }
2592
2593    /**
2594     * @return Returns a reference to <code>this</code> for easy method chaining
2595     */
2596    public ActivityDefinition setTopic(List<CodeableConcept> theTopic) { 
2597      this.topic = theTopic;
2598      return this;
2599    }
2600
2601    public boolean hasTopic() { 
2602      if (this.topic == null)
2603        return false;
2604      for (CodeableConcept item : this.topic)
2605        if (!item.isEmpty())
2606          return true;
2607      return false;
2608    }
2609
2610    public CodeableConcept addTopic() { //3
2611      CodeableConcept t = new CodeableConcept();
2612      if (this.topic == null)
2613        this.topic = new ArrayList<CodeableConcept>();
2614      this.topic.add(t);
2615      return t;
2616    }
2617
2618    public ActivityDefinition addTopic(CodeableConcept t) { //3
2619      if (t == null)
2620        return this;
2621      if (this.topic == null)
2622        this.topic = new ArrayList<CodeableConcept>();
2623      this.topic.add(t);
2624      return this;
2625    }
2626
2627    /**
2628     * @return The first repetition of repeating field {@link #topic}, creating it if it does not already exist
2629     */
2630    public CodeableConcept getTopicFirstRep() { 
2631      if (getTopic().isEmpty()) {
2632        addTopic();
2633      }
2634      return getTopic().get(0);
2635    }
2636
2637    /**
2638     * @return {@link #author} (An individiual or organization primarily involved in the creation and maintenance of the content.)
2639     */
2640    public List<ContactDetail> getAuthor() { 
2641      if (this.author == null)
2642        this.author = new ArrayList<ContactDetail>();
2643      return this.author;
2644    }
2645
2646    /**
2647     * @return Returns a reference to <code>this</code> for easy method chaining
2648     */
2649    public ActivityDefinition setAuthor(List<ContactDetail> theAuthor) { 
2650      this.author = theAuthor;
2651      return this;
2652    }
2653
2654    public boolean hasAuthor() { 
2655      if (this.author == null)
2656        return false;
2657      for (ContactDetail item : this.author)
2658        if (!item.isEmpty())
2659          return true;
2660      return false;
2661    }
2662
2663    public ContactDetail addAuthor() { //3
2664      ContactDetail t = new ContactDetail();
2665      if (this.author == null)
2666        this.author = new ArrayList<ContactDetail>();
2667      this.author.add(t);
2668      return t;
2669    }
2670
2671    public ActivityDefinition addAuthor(ContactDetail t) { //3
2672      if (t == null)
2673        return this;
2674      if (this.author == null)
2675        this.author = new ArrayList<ContactDetail>();
2676      this.author.add(t);
2677      return this;
2678    }
2679
2680    /**
2681     * @return The first repetition of repeating field {@link #author}, creating it if it does not already exist
2682     */
2683    public ContactDetail getAuthorFirstRep() { 
2684      if (getAuthor().isEmpty()) {
2685        addAuthor();
2686      }
2687      return getAuthor().get(0);
2688    }
2689
2690    /**
2691     * @return {@link #editor} (An individual or organization primarily responsible for internal coherence of the content.)
2692     */
2693    public List<ContactDetail> getEditor() { 
2694      if (this.editor == null)
2695        this.editor = new ArrayList<ContactDetail>();
2696      return this.editor;
2697    }
2698
2699    /**
2700     * @return Returns a reference to <code>this</code> for easy method chaining
2701     */
2702    public ActivityDefinition setEditor(List<ContactDetail> theEditor) { 
2703      this.editor = theEditor;
2704      return this;
2705    }
2706
2707    public boolean hasEditor() { 
2708      if (this.editor == null)
2709        return false;
2710      for (ContactDetail item : this.editor)
2711        if (!item.isEmpty())
2712          return true;
2713      return false;
2714    }
2715
2716    public ContactDetail addEditor() { //3
2717      ContactDetail t = new ContactDetail();
2718      if (this.editor == null)
2719        this.editor = new ArrayList<ContactDetail>();
2720      this.editor.add(t);
2721      return t;
2722    }
2723
2724    public ActivityDefinition addEditor(ContactDetail t) { //3
2725      if (t == null)
2726        return this;
2727      if (this.editor == null)
2728        this.editor = new ArrayList<ContactDetail>();
2729      this.editor.add(t);
2730      return this;
2731    }
2732
2733    /**
2734     * @return The first repetition of repeating field {@link #editor}, creating it if it does not already exist
2735     */
2736    public ContactDetail getEditorFirstRep() { 
2737      if (getEditor().isEmpty()) {
2738        addEditor();
2739      }
2740      return getEditor().get(0);
2741    }
2742
2743    /**
2744     * @return {@link #reviewer} (An individual or organization primarily responsible for review of some aspect of the content.)
2745     */
2746    public List<ContactDetail> getReviewer() { 
2747      if (this.reviewer == null)
2748        this.reviewer = new ArrayList<ContactDetail>();
2749      return this.reviewer;
2750    }
2751
2752    /**
2753     * @return Returns a reference to <code>this</code> for easy method chaining
2754     */
2755    public ActivityDefinition setReviewer(List<ContactDetail> theReviewer) { 
2756      this.reviewer = theReviewer;
2757      return this;
2758    }
2759
2760    public boolean hasReviewer() { 
2761      if (this.reviewer == null)
2762        return false;
2763      for (ContactDetail item : this.reviewer)
2764        if (!item.isEmpty())
2765          return true;
2766      return false;
2767    }
2768
2769    public ContactDetail addReviewer() { //3
2770      ContactDetail t = new ContactDetail();
2771      if (this.reviewer == null)
2772        this.reviewer = new ArrayList<ContactDetail>();
2773      this.reviewer.add(t);
2774      return t;
2775    }
2776
2777    public ActivityDefinition addReviewer(ContactDetail t) { //3
2778      if (t == null)
2779        return this;
2780      if (this.reviewer == null)
2781        this.reviewer = new ArrayList<ContactDetail>();
2782      this.reviewer.add(t);
2783      return this;
2784    }
2785
2786    /**
2787     * @return The first repetition of repeating field {@link #reviewer}, creating it if it does not already exist
2788     */
2789    public ContactDetail getReviewerFirstRep() { 
2790      if (getReviewer().isEmpty()) {
2791        addReviewer();
2792      }
2793      return getReviewer().get(0);
2794    }
2795
2796    /**
2797     * @return {@link #endorser} (An individual or organization responsible for officially endorsing the content for use in some setting.)
2798     */
2799    public List<ContactDetail> getEndorser() { 
2800      if (this.endorser == null)
2801        this.endorser = new ArrayList<ContactDetail>();
2802      return this.endorser;
2803    }
2804
2805    /**
2806     * @return Returns a reference to <code>this</code> for easy method chaining
2807     */
2808    public ActivityDefinition setEndorser(List<ContactDetail> theEndorser) { 
2809      this.endorser = theEndorser;
2810      return this;
2811    }
2812
2813    public boolean hasEndorser() { 
2814      if (this.endorser == null)
2815        return false;
2816      for (ContactDetail item : this.endorser)
2817        if (!item.isEmpty())
2818          return true;
2819      return false;
2820    }
2821
2822    public ContactDetail addEndorser() { //3
2823      ContactDetail t = new ContactDetail();
2824      if (this.endorser == null)
2825        this.endorser = new ArrayList<ContactDetail>();
2826      this.endorser.add(t);
2827      return t;
2828    }
2829
2830    public ActivityDefinition addEndorser(ContactDetail t) { //3
2831      if (t == null)
2832        return this;
2833      if (this.endorser == null)
2834        this.endorser = new ArrayList<ContactDetail>();
2835      this.endorser.add(t);
2836      return this;
2837    }
2838
2839    /**
2840     * @return The first repetition of repeating field {@link #endorser}, creating it if it does not already exist
2841     */
2842    public ContactDetail getEndorserFirstRep() { 
2843      if (getEndorser().isEmpty()) {
2844        addEndorser();
2845      }
2846      return getEndorser().get(0);
2847    }
2848
2849    /**
2850     * @return {@link #relatedArtifact} (Related artifacts such as additional documentation, justification, or bibliographic references.)
2851     */
2852    public List<RelatedArtifact> getRelatedArtifact() { 
2853      if (this.relatedArtifact == null)
2854        this.relatedArtifact = new ArrayList<RelatedArtifact>();
2855      return this.relatedArtifact;
2856    }
2857
2858    /**
2859     * @return Returns a reference to <code>this</code> for easy method chaining
2860     */
2861    public ActivityDefinition setRelatedArtifact(List<RelatedArtifact> theRelatedArtifact) { 
2862      this.relatedArtifact = theRelatedArtifact;
2863      return this;
2864    }
2865
2866    public boolean hasRelatedArtifact() { 
2867      if (this.relatedArtifact == null)
2868        return false;
2869      for (RelatedArtifact item : this.relatedArtifact)
2870        if (!item.isEmpty())
2871          return true;
2872      return false;
2873    }
2874
2875    public RelatedArtifact addRelatedArtifact() { //3
2876      RelatedArtifact t = new RelatedArtifact();
2877      if (this.relatedArtifact == null)
2878        this.relatedArtifact = new ArrayList<RelatedArtifact>();
2879      this.relatedArtifact.add(t);
2880      return t;
2881    }
2882
2883    public ActivityDefinition addRelatedArtifact(RelatedArtifact t) { //3
2884      if (t == null)
2885        return this;
2886      if (this.relatedArtifact == null)
2887        this.relatedArtifact = new ArrayList<RelatedArtifact>();
2888      this.relatedArtifact.add(t);
2889      return this;
2890    }
2891
2892    /**
2893     * @return The first repetition of repeating field {@link #relatedArtifact}, creating it if it does not already exist
2894     */
2895    public RelatedArtifact getRelatedArtifactFirstRep() { 
2896      if (getRelatedArtifact().isEmpty()) {
2897        addRelatedArtifact();
2898      }
2899      return getRelatedArtifact().get(0);
2900    }
2901
2902    /**
2903     * @return {@link #library} (A reference to a Library resource containing any formal logic used by the activity definition.)
2904     */
2905    public List<CanonicalType> getLibrary() { 
2906      if (this.library == null)
2907        this.library = new ArrayList<CanonicalType>();
2908      return this.library;
2909    }
2910
2911    /**
2912     * @return Returns a reference to <code>this</code> for easy method chaining
2913     */
2914    public ActivityDefinition setLibrary(List<CanonicalType> theLibrary) { 
2915      this.library = theLibrary;
2916      return this;
2917    }
2918
2919    public boolean hasLibrary() { 
2920      if (this.library == null)
2921        return false;
2922      for (CanonicalType item : this.library)
2923        if (!item.isEmpty())
2924          return true;
2925      return false;
2926    }
2927
2928    /**
2929     * @return {@link #library} (A reference to a Library resource containing any formal logic used by the activity definition.)
2930     */
2931    public CanonicalType addLibraryElement() {//2 
2932      CanonicalType t = new CanonicalType();
2933      if (this.library == null)
2934        this.library = new ArrayList<CanonicalType>();
2935      this.library.add(t);
2936      return t;
2937    }
2938
2939    /**
2940     * @param value {@link #library} (A reference to a Library resource containing any formal logic used by the activity definition.)
2941     */
2942    public ActivityDefinition addLibrary(String value) { //1
2943      CanonicalType t = new CanonicalType();
2944      t.setValue(value);
2945      if (this.library == null)
2946        this.library = new ArrayList<CanonicalType>();
2947      this.library.add(t);
2948      return this;
2949    }
2950
2951    /**
2952     * @param value {@link #library} (A reference to a Library resource containing any formal logic used by the activity definition.)
2953     */
2954    public boolean hasLibrary(String value) { 
2955      if (this.library == null)
2956        return false;
2957      for (CanonicalType v : this.library)
2958        if (v.getValue().equals(value)) // canonical(Library)
2959          return true;
2960      return false;
2961    }
2962
2963    /**
2964     * @return {@link #kind} (A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. Typically, but not always, this is a Request resource.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
2965     */
2966    public Enumeration<ActivityDefinitionKind> getKindElement() { 
2967      if (this.kind == null)
2968        if (Configuration.errorOnAutoCreate())
2969          throw new Error("Attempt to auto-create ActivityDefinition.kind");
2970        else if (Configuration.doAutoCreate())
2971          this.kind = new Enumeration<ActivityDefinitionKind>(new ActivityDefinitionKindEnumFactory()); // bb
2972      return this.kind;
2973    }
2974
2975    public boolean hasKindElement() { 
2976      return this.kind != null && !this.kind.isEmpty();
2977    }
2978
2979    public boolean hasKind() { 
2980      return this.kind != null && !this.kind.isEmpty();
2981    }
2982
2983    /**
2984     * @param value {@link #kind} (A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. Typically, but not always, this is a Request resource.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
2985     */
2986    public ActivityDefinition setKindElement(Enumeration<ActivityDefinitionKind> value) { 
2987      this.kind = value;
2988      return this;
2989    }
2990
2991    /**
2992     * @return A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. Typically, but not always, this is a Request resource.
2993     */
2994    public ActivityDefinitionKind getKind() { 
2995      return this.kind == null ? null : this.kind.getValue();
2996    }
2997
2998    /**
2999     * @param value A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. Typically, but not always, this is a Request resource.
3000     */
3001    public ActivityDefinition setKind(ActivityDefinitionKind value) { 
3002      if (value == null)
3003        this.kind = null;
3004      else {
3005        if (this.kind == null)
3006          this.kind = new Enumeration<ActivityDefinitionKind>(new ActivityDefinitionKindEnumFactory());
3007        this.kind.setValue(value);
3008      }
3009      return this;
3010    }
3011
3012    /**
3013     * @return {@link #profile} (A profile to which the target of the activity definition is expected to conform.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value
3014     */
3015    public CanonicalType getProfileElement() { 
3016      if (this.profile == null)
3017        if (Configuration.errorOnAutoCreate())
3018          throw new Error("Attempt to auto-create ActivityDefinition.profile");
3019        else if (Configuration.doAutoCreate())
3020          this.profile = new CanonicalType(); // bb
3021      return this.profile;
3022    }
3023
3024    public boolean hasProfileElement() { 
3025      return this.profile != null && !this.profile.isEmpty();
3026    }
3027
3028    public boolean hasProfile() { 
3029      return this.profile != null && !this.profile.isEmpty();
3030    }
3031
3032    /**
3033     * @param value {@link #profile} (A profile to which the target of the activity definition is expected to conform.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value
3034     */
3035    public ActivityDefinition setProfileElement(CanonicalType value) { 
3036      this.profile = value;
3037      return this;
3038    }
3039
3040    /**
3041     * @return A profile to which the target of the activity definition is expected to conform.
3042     */
3043    public String getProfile() { 
3044      return this.profile == null ? null : this.profile.getValue();
3045    }
3046
3047    /**
3048     * @param value A profile to which the target of the activity definition is expected to conform.
3049     */
3050    public ActivityDefinition setProfile(String value) { 
3051      if (Utilities.noString(value))
3052        this.profile = null;
3053      else {
3054        if (this.profile == null)
3055          this.profile = new CanonicalType();
3056        this.profile.setValue(value);
3057      }
3058      return this;
3059    }
3060
3061    /**
3062     * @return {@link #code} (Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter.)
3063     */
3064    public CodeableConcept getCode() { 
3065      if (this.code == null)
3066        if (Configuration.errorOnAutoCreate())
3067          throw new Error("Attempt to auto-create ActivityDefinition.code");
3068        else if (Configuration.doAutoCreate())
3069          this.code = new CodeableConcept(); // cc
3070      return this.code;
3071    }
3072
3073    public boolean hasCode() { 
3074      return this.code != null && !this.code.isEmpty();
3075    }
3076
3077    /**
3078     * @param value {@link #code} (Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter.)
3079     */
3080    public ActivityDefinition setCode(CodeableConcept value) { 
3081      this.code = value;
3082      return this;
3083    }
3084
3085    /**
3086     * @return {@link #intent} (Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chain.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value
3087     */
3088    public Enumeration<RequestIntent> getIntentElement() { 
3089      if (this.intent == null)
3090        if (Configuration.errorOnAutoCreate())
3091          throw new Error("Attempt to auto-create ActivityDefinition.intent");
3092        else if (Configuration.doAutoCreate())
3093          this.intent = new Enumeration<RequestIntent>(new RequestIntentEnumFactory()); // bb
3094      return this.intent;
3095    }
3096
3097    public boolean hasIntentElement() { 
3098      return this.intent != null && !this.intent.isEmpty();
3099    }
3100
3101    public boolean hasIntent() { 
3102      return this.intent != null && !this.intent.isEmpty();
3103    }
3104
3105    /**
3106     * @param value {@link #intent} (Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chain.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value
3107     */
3108    public ActivityDefinition setIntentElement(Enumeration<RequestIntent> value) { 
3109      this.intent = value;
3110      return this;
3111    }
3112
3113    /**
3114     * @return Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chain.
3115     */
3116    public RequestIntent getIntent() { 
3117      return this.intent == null ? null : this.intent.getValue();
3118    }
3119
3120    /**
3121     * @param value Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chain.
3122     */
3123    public ActivityDefinition setIntent(RequestIntent value) { 
3124      if (value == null)
3125        this.intent = null;
3126      else {
3127        if (this.intent == null)
3128          this.intent = new Enumeration<RequestIntent>(new RequestIntentEnumFactory());
3129        this.intent.setValue(value);
3130      }
3131      return this;
3132    }
3133
3134    /**
3135     * @return {@link #priority} (Indicates how quickly the activity  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
3136     */
3137    public Enumeration<RequestPriority> getPriorityElement() { 
3138      if (this.priority == null)
3139        if (Configuration.errorOnAutoCreate())
3140          throw new Error("Attempt to auto-create ActivityDefinition.priority");
3141        else if (Configuration.doAutoCreate())
3142          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory()); // bb
3143      return this.priority;
3144    }
3145
3146    public boolean hasPriorityElement() { 
3147      return this.priority != null && !this.priority.isEmpty();
3148    }
3149
3150    public boolean hasPriority() { 
3151      return this.priority != null && !this.priority.isEmpty();
3152    }
3153
3154    /**
3155     * @param value {@link #priority} (Indicates how quickly the activity  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
3156     */
3157    public ActivityDefinition setPriorityElement(Enumeration<RequestPriority> value) { 
3158      this.priority = value;
3159      return this;
3160    }
3161
3162    /**
3163     * @return Indicates how quickly the activity  should be addressed with respect to other requests.
3164     */
3165    public RequestPriority getPriority() { 
3166      return this.priority == null ? null : this.priority.getValue();
3167    }
3168
3169    /**
3170     * @param value Indicates how quickly the activity  should be addressed with respect to other requests.
3171     */
3172    public ActivityDefinition setPriority(RequestPriority value) { 
3173      if (value == null)
3174        this.priority = null;
3175      else {
3176        if (this.priority == null)
3177          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory());
3178        this.priority.setValue(value);
3179      }
3180      return this;
3181    }
3182
3183    /**
3184     * @return {@link #doNotPerform} (Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action.). This is the underlying object with id, value and extensions. The accessor "getDoNotPerform" gives direct access to the value
3185     */
3186    public BooleanType getDoNotPerformElement() { 
3187      if (this.doNotPerform == null)
3188        if (Configuration.errorOnAutoCreate())
3189          throw new Error("Attempt to auto-create ActivityDefinition.doNotPerform");
3190        else if (Configuration.doAutoCreate())
3191          this.doNotPerform = new BooleanType(); // bb
3192      return this.doNotPerform;
3193    }
3194
3195    public boolean hasDoNotPerformElement() { 
3196      return this.doNotPerform != null && !this.doNotPerform.isEmpty();
3197    }
3198
3199    public boolean hasDoNotPerform() { 
3200      return this.doNotPerform != null && !this.doNotPerform.isEmpty();
3201    }
3202
3203    /**
3204     * @param value {@link #doNotPerform} (Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action.). This is the underlying object with id, value and extensions. The accessor "getDoNotPerform" gives direct access to the value
3205     */
3206    public ActivityDefinition setDoNotPerformElement(BooleanType value) { 
3207      this.doNotPerform = value;
3208      return this;
3209    }
3210
3211    /**
3212     * @return Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action.
3213     */
3214    public boolean getDoNotPerform() { 
3215      return this.doNotPerform == null || this.doNotPerform.isEmpty() ? false : this.doNotPerform.getValue();
3216    }
3217
3218    /**
3219     * @param value Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action.
3220     */
3221    public ActivityDefinition setDoNotPerform(boolean value) { 
3222        if (this.doNotPerform == null)
3223          this.doNotPerform = new BooleanType();
3224        this.doNotPerform.setValue(value);
3225      return this;
3226    }
3227
3228    /**
3229     * @return {@link #timing} (The period, timing or frequency upon which the described activity is to occur.)
3230     */
3231    public Type getTiming() { 
3232      return this.timing;
3233    }
3234
3235    /**
3236     * @return {@link #timing} (The period, timing or frequency upon which the described activity is to occur.)
3237     */
3238    public Timing getTimingTiming() throws FHIRException { 
3239      if (this.timing == null)
3240        this.timing = new Timing();
3241      if (!(this.timing instanceof Timing))
3242        throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered");
3243      return (Timing) this.timing;
3244    }
3245
3246    public boolean hasTimingTiming() { 
3247      return this != null && this.timing instanceof Timing;
3248    }
3249
3250    /**
3251     * @return {@link #timing} (The period, timing or frequency upon which the described activity is to occur.)
3252     */
3253    public DateTimeType getTimingDateTimeType() throws FHIRException { 
3254      if (this.timing == null)
3255        this.timing = new DateTimeType();
3256      if (!(this.timing instanceof DateTimeType))
3257        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered");
3258      return (DateTimeType) this.timing;
3259    }
3260
3261    public boolean hasTimingDateTimeType() { 
3262      return this != null && this.timing instanceof DateTimeType;
3263    }
3264
3265    /**
3266     * @return {@link #timing} (The period, timing or frequency upon which the described activity is to occur.)
3267     */
3268    public Age getTimingAge() throws FHIRException { 
3269      if (this.timing == null)
3270        this.timing = new Age();
3271      if (!(this.timing instanceof Age))
3272        throw new FHIRException("Type mismatch: the type Age was expected, but "+this.timing.getClass().getName()+" was encountered");
3273      return (Age) this.timing;
3274    }
3275
3276    public boolean hasTimingAge() { 
3277      return this != null && this.timing instanceof Age;
3278    }
3279
3280    /**
3281     * @return {@link #timing} (The period, timing or frequency upon which the described activity is to occur.)
3282     */
3283    public Period getTimingPeriod() throws FHIRException { 
3284      if (this.timing == null)
3285        this.timing = new Period();
3286      if (!(this.timing instanceof Period))
3287        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered");
3288      return (Period) this.timing;
3289    }
3290
3291    public boolean hasTimingPeriod() { 
3292      return this != null && this.timing instanceof Period;
3293    }
3294
3295    /**
3296     * @return {@link #timing} (The period, timing or frequency upon which the described activity is to occur.)
3297     */
3298    public Range getTimingRange() throws FHIRException { 
3299      if (this.timing == null)
3300        this.timing = new Range();
3301      if (!(this.timing instanceof Range))
3302        throw new FHIRException("Type mismatch: the type Range was expected, but "+this.timing.getClass().getName()+" was encountered");
3303      return (Range) this.timing;
3304    }
3305
3306    public boolean hasTimingRange() { 
3307      return this != null && this.timing instanceof Range;
3308    }
3309
3310    /**
3311     * @return {@link #timing} (The period, timing or frequency upon which the described activity is to occur.)
3312     */
3313    public Duration getTimingDuration() throws FHIRException { 
3314      if (this.timing == null)
3315        this.timing = new Duration();
3316      if (!(this.timing instanceof Duration))
3317        throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.timing.getClass().getName()+" was encountered");
3318      return (Duration) this.timing;
3319    }
3320
3321    public boolean hasTimingDuration() { 
3322      return this != null && this.timing instanceof Duration;
3323    }
3324
3325    public boolean hasTiming() { 
3326      return this.timing != null && !this.timing.isEmpty();
3327    }
3328
3329    /**
3330     * @param value {@link #timing} (The period, timing or frequency upon which the described activity is to occur.)
3331     */
3332    public ActivityDefinition setTiming(Type value) { 
3333      if (value != null && !(value instanceof Timing || value instanceof DateTimeType || value instanceof Age || value instanceof Period || value instanceof Range || value instanceof Duration))
3334        throw new Error("Not the right type for ActivityDefinition.timing[x]: "+value.fhirType());
3335      this.timing = value;
3336      return this;
3337    }
3338
3339    /**
3340     * @return {@link #location} (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.)
3341     */
3342    public Reference getLocation() { 
3343      if (this.location == null)
3344        if (Configuration.errorOnAutoCreate())
3345          throw new Error("Attempt to auto-create ActivityDefinition.location");
3346        else if (Configuration.doAutoCreate())
3347          this.location = new Reference(); // cc
3348      return this.location;
3349    }
3350
3351    public boolean hasLocation() { 
3352      return this.location != null && !this.location.isEmpty();
3353    }
3354
3355    /**
3356     * @param value {@link #location} (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.)
3357     */
3358    public ActivityDefinition setLocation(Reference value) { 
3359      this.location = value;
3360      return this;
3361    }
3362
3363    /**
3364     * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.)
3365     */
3366    public Location getLocationTarget() { 
3367      if (this.locationTarget == null)
3368        if (Configuration.errorOnAutoCreate())
3369          throw new Error("Attempt to auto-create ActivityDefinition.location");
3370        else if (Configuration.doAutoCreate())
3371          this.locationTarget = new Location(); // aa
3372      return this.locationTarget;
3373    }
3374
3375    /**
3376     * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.)
3377     */
3378    public ActivityDefinition setLocationTarget(Location value) { 
3379      this.locationTarget = value;
3380      return this;
3381    }
3382
3383    /**
3384     * @return {@link #participant} (Indicates who should participate in performing the action described.)
3385     */
3386    public List<ActivityDefinitionParticipantComponent> getParticipant() { 
3387      if (this.participant == null)
3388        this.participant = new ArrayList<ActivityDefinitionParticipantComponent>();
3389      return this.participant;
3390    }
3391
3392    /**
3393     * @return Returns a reference to <code>this</code> for easy method chaining
3394     */
3395    public ActivityDefinition setParticipant(List<ActivityDefinitionParticipantComponent> theParticipant) { 
3396      this.participant = theParticipant;
3397      return this;
3398    }
3399
3400    public boolean hasParticipant() { 
3401      if (this.participant == null)
3402        return false;
3403      for (ActivityDefinitionParticipantComponent item : this.participant)
3404        if (!item.isEmpty())
3405          return true;
3406      return false;
3407    }
3408
3409    public ActivityDefinitionParticipantComponent addParticipant() { //3
3410      ActivityDefinitionParticipantComponent t = new ActivityDefinitionParticipantComponent();
3411      if (this.participant == null)
3412        this.participant = new ArrayList<ActivityDefinitionParticipantComponent>();
3413      this.participant.add(t);
3414      return t;
3415    }
3416
3417    public ActivityDefinition addParticipant(ActivityDefinitionParticipantComponent t) { //3
3418      if (t == null)
3419        return this;
3420      if (this.participant == null)
3421        this.participant = new ArrayList<ActivityDefinitionParticipantComponent>();
3422      this.participant.add(t);
3423      return this;
3424    }
3425
3426    /**
3427     * @return The first repetition of repeating field {@link #participant}, creating it if it does not already exist
3428     */
3429    public ActivityDefinitionParticipantComponent getParticipantFirstRep() { 
3430      if (getParticipant().isEmpty()) {
3431        addParticipant();
3432      }
3433      return getParticipant().get(0);
3434    }
3435
3436    /**
3437     * @return {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.)
3438     */
3439    public Type getProduct() { 
3440      return this.product;
3441    }
3442
3443    /**
3444     * @return {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.)
3445     */
3446    public Reference getProductReference() throws FHIRException { 
3447      if (this.product == null)
3448        this.product = new Reference();
3449      if (!(this.product instanceof Reference))
3450        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.product.getClass().getName()+" was encountered");
3451      return (Reference) this.product;
3452    }
3453
3454    public boolean hasProductReference() { 
3455      return this != null && this.product instanceof Reference;
3456    }
3457
3458    /**
3459     * @return {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.)
3460     */
3461    public CodeableConcept getProductCodeableConcept() throws FHIRException { 
3462      if (this.product == null)
3463        this.product = new CodeableConcept();
3464      if (!(this.product instanceof CodeableConcept))
3465        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.product.getClass().getName()+" was encountered");
3466      return (CodeableConcept) this.product;
3467    }
3468
3469    public boolean hasProductCodeableConcept() { 
3470      return this != null && this.product instanceof CodeableConcept;
3471    }
3472
3473    public boolean hasProduct() { 
3474      return this.product != null && !this.product.isEmpty();
3475    }
3476
3477    /**
3478     * @param value {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.)
3479     */
3480    public ActivityDefinition setProduct(Type value) { 
3481      if (value != null && !(value instanceof Reference || value instanceof CodeableConcept))
3482        throw new Error("Not the right type for ActivityDefinition.product[x]: "+value.fhirType());
3483      this.product = value;
3484      return this;
3485    }
3486
3487    /**
3488     * @return {@link #quantity} (Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).)
3489     */
3490    public Quantity getQuantity() { 
3491      if (this.quantity == null)
3492        if (Configuration.errorOnAutoCreate())
3493          throw new Error("Attempt to auto-create ActivityDefinition.quantity");
3494        else if (Configuration.doAutoCreate())
3495          this.quantity = new Quantity(); // cc
3496      return this.quantity;
3497    }
3498
3499    public boolean hasQuantity() { 
3500      return this.quantity != null && !this.quantity.isEmpty();
3501    }
3502
3503    /**
3504     * @param value {@link #quantity} (Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).)
3505     */
3506    public ActivityDefinition setQuantity(Quantity value) { 
3507      this.quantity = value;
3508      return this;
3509    }
3510
3511    /**
3512     * @return {@link #dosage} (Provides detailed dosage instructions in the same way that they are described for MedicationRequest resources.)
3513     */
3514    public List<Dosage> getDosage() { 
3515      if (this.dosage == null)
3516        this.dosage = new ArrayList<Dosage>();
3517      return this.dosage;
3518    }
3519
3520    /**
3521     * @return Returns a reference to <code>this</code> for easy method chaining
3522     */
3523    public ActivityDefinition setDosage(List<Dosage> theDosage) { 
3524      this.dosage = theDosage;
3525      return this;
3526    }
3527
3528    public boolean hasDosage() { 
3529      if (this.dosage == null)
3530        return false;
3531      for (Dosage item : this.dosage)
3532        if (!item.isEmpty())
3533          return true;
3534      return false;
3535    }
3536
3537    public Dosage addDosage() { //3
3538      Dosage t = new Dosage();
3539      if (this.dosage == null)
3540        this.dosage = new ArrayList<Dosage>();
3541      this.dosage.add(t);
3542      return t;
3543    }
3544
3545    public ActivityDefinition addDosage(Dosage t) { //3
3546      if (t == null)
3547        return this;
3548      if (this.dosage == null)
3549        this.dosage = new ArrayList<Dosage>();
3550      this.dosage.add(t);
3551      return this;
3552    }
3553
3554    /**
3555     * @return The first repetition of repeating field {@link #dosage}, creating it if it does not already exist
3556     */
3557    public Dosage getDosageFirstRep() { 
3558      if (getDosage().isEmpty()) {
3559        addDosage();
3560      }
3561      return getDosage().get(0);
3562    }
3563
3564    /**
3565     * @return {@link #bodySite} (Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).)
3566     */
3567    public List<CodeableConcept> getBodySite() { 
3568      if (this.bodySite == null)
3569        this.bodySite = new ArrayList<CodeableConcept>();
3570      return this.bodySite;
3571    }
3572
3573    /**
3574     * @return Returns a reference to <code>this</code> for easy method chaining
3575     */
3576    public ActivityDefinition setBodySite(List<CodeableConcept> theBodySite) { 
3577      this.bodySite = theBodySite;
3578      return this;
3579    }
3580
3581    public boolean hasBodySite() { 
3582      if (this.bodySite == null)
3583        return false;
3584      for (CodeableConcept item : this.bodySite)
3585        if (!item.isEmpty())
3586          return true;
3587      return false;
3588    }
3589
3590    public CodeableConcept addBodySite() { //3
3591      CodeableConcept t = new CodeableConcept();
3592      if (this.bodySite == null)
3593        this.bodySite = new ArrayList<CodeableConcept>();
3594      this.bodySite.add(t);
3595      return t;
3596    }
3597
3598    public ActivityDefinition addBodySite(CodeableConcept t) { //3
3599      if (t == null)
3600        return this;
3601      if (this.bodySite == null)
3602        this.bodySite = new ArrayList<CodeableConcept>();
3603      this.bodySite.add(t);
3604      return this;
3605    }
3606
3607    /**
3608     * @return The first repetition of repeating field {@link #bodySite}, creating it if it does not already exist
3609     */
3610    public CodeableConcept getBodySiteFirstRep() { 
3611      if (getBodySite().isEmpty()) {
3612        addBodySite();
3613      }
3614      return getBodySite().get(0);
3615    }
3616
3617    /**
3618     * @return {@link #specimenRequirement} (Defines specimen requirements for the action to be performed, such as required specimens for a lab test.)
3619     */
3620    public List<Reference> getSpecimenRequirement() { 
3621      if (this.specimenRequirement == null)
3622        this.specimenRequirement = new ArrayList<Reference>();
3623      return this.specimenRequirement;
3624    }
3625
3626    /**
3627     * @return Returns a reference to <code>this</code> for easy method chaining
3628     */
3629    public ActivityDefinition setSpecimenRequirement(List<Reference> theSpecimenRequirement) { 
3630      this.specimenRequirement = theSpecimenRequirement;
3631      return this;
3632    }
3633
3634    public boolean hasSpecimenRequirement() { 
3635      if (this.specimenRequirement == null)
3636        return false;
3637      for (Reference item : this.specimenRequirement)
3638        if (!item.isEmpty())
3639          return true;
3640      return false;
3641    }
3642
3643    public Reference addSpecimenRequirement() { //3
3644      Reference t = new Reference();
3645      if (this.specimenRequirement == null)
3646        this.specimenRequirement = new ArrayList<Reference>();
3647      this.specimenRequirement.add(t);
3648      return t;
3649    }
3650
3651    public ActivityDefinition addSpecimenRequirement(Reference t) { //3
3652      if (t == null)
3653        return this;
3654      if (this.specimenRequirement == null)
3655        this.specimenRequirement = new ArrayList<Reference>();
3656      this.specimenRequirement.add(t);
3657      return this;
3658    }
3659
3660    /**
3661     * @return The first repetition of repeating field {@link #specimenRequirement}, creating it if it does not already exist
3662     */
3663    public Reference getSpecimenRequirementFirstRep() { 
3664      if (getSpecimenRequirement().isEmpty()) {
3665        addSpecimenRequirement();
3666      }
3667      return getSpecimenRequirement().get(0);
3668    }
3669
3670    /**
3671     * @deprecated Use Reference#setResource(IBaseResource) instead
3672     */
3673    @Deprecated
3674    public List<SpecimenDefinition> getSpecimenRequirementTarget() { 
3675      if (this.specimenRequirementTarget == null)
3676        this.specimenRequirementTarget = new ArrayList<SpecimenDefinition>();
3677      return this.specimenRequirementTarget;
3678    }
3679
3680    /**
3681     * @deprecated Use Reference#setResource(IBaseResource) instead
3682     */
3683    @Deprecated
3684    public SpecimenDefinition addSpecimenRequirementTarget() { 
3685      SpecimenDefinition r = new SpecimenDefinition();
3686      if (this.specimenRequirementTarget == null)
3687        this.specimenRequirementTarget = new ArrayList<SpecimenDefinition>();
3688      this.specimenRequirementTarget.add(r);
3689      return r;
3690    }
3691
3692    /**
3693     * @return {@link #observationRequirement} (Defines observation requirements for the action to be performed, such as body weight or surface area.)
3694     */
3695    public List<Reference> getObservationRequirement() { 
3696      if (this.observationRequirement == null)
3697        this.observationRequirement = new ArrayList<Reference>();
3698      return this.observationRequirement;
3699    }
3700
3701    /**
3702     * @return Returns a reference to <code>this</code> for easy method chaining
3703     */
3704    public ActivityDefinition setObservationRequirement(List<Reference> theObservationRequirement) { 
3705      this.observationRequirement = theObservationRequirement;
3706      return this;
3707    }
3708
3709    public boolean hasObservationRequirement() { 
3710      if (this.observationRequirement == null)
3711        return false;
3712      for (Reference item : this.observationRequirement)
3713        if (!item.isEmpty())
3714          return true;
3715      return false;
3716    }
3717
3718    public Reference addObservationRequirement() { //3
3719      Reference t = new Reference();
3720      if (this.observationRequirement == null)
3721        this.observationRequirement = new ArrayList<Reference>();
3722      this.observationRequirement.add(t);
3723      return t;
3724    }
3725
3726    public ActivityDefinition addObservationRequirement(Reference t) { //3
3727      if (t == null)
3728        return this;
3729      if (this.observationRequirement == null)
3730        this.observationRequirement = new ArrayList<Reference>();
3731      this.observationRequirement.add(t);
3732      return this;
3733    }
3734
3735    /**
3736     * @return The first repetition of repeating field {@link #observationRequirement}, creating it if it does not already exist
3737     */
3738    public Reference getObservationRequirementFirstRep() { 
3739      if (getObservationRequirement().isEmpty()) {
3740        addObservationRequirement();
3741      }
3742      return getObservationRequirement().get(0);
3743    }
3744
3745    /**
3746     * @deprecated Use Reference#setResource(IBaseResource) instead
3747     */
3748    @Deprecated
3749    public List<ObservationDefinition> getObservationRequirementTarget() { 
3750      if (this.observationRequirementTarget == null)
3751        this.observationRequirementTarget = new ArrayList<ObservationDefinition>();
3752      return this.observationRequirementTarget;
3753    }
3754
3755    /**
3756     * @deprecated Use Reference#setResource(IBaseResource) instead
3757     */
3758    @Deprecated
3759    public ObservationDefinition addObservationRequirementTarget() { 
3760      ObservationDefinition r = new ObservationDefinition();
3761      if (this.observationRequirementTarget == null)
3762        this.observationRequirementTarget = new ArrayList<ObservationDefinition>();
3763      this.observationRequirementTarget.add(r);
3764      return r;
3765    }
3766
3767    /**
3768     * @return {@link #observationResultRequirement} (Defines the observations that are expected to be produced by the action.)
3769     */
3770    public List<Reference> getObservationResultRequirement() { 
3771      if (this.observationResultRequirement == null)
3772        this.observationResultRequirement = new ArrayList<Reference>();
3773      return this.observationResultRequirement;
3774    }
3775
3776    /**
3777     * @return Returns a reference to <code>this</code> for easy method chaining
3778     */
3779    public ActivityDefinition setObservationResultRequirement(List<Reference> theObservationResultRequirement) { 
3780      this.observationResultRequirement = theObservationResultRequirement;
3781      return this;
3782    }
3783
3784    public boolean hasObservationResultRequirement() { 
3785      if (this.observationResultRequirement == null)
3786        return false;
3787      for (Reference item : this.observationResultRequirement)
3788        if (!item.isEmpty())
3789          return true;
3790      return false;
3791    }
3792
3793    public Reference addObservationResultRequirement() { //3
3794      Reference t = new Reference();
3795      if (this.observationResultRequirement == null)
3796        this.observationResultRequirement = new ArrayList<Reference>();
3797      this.observationResultRequirement.add(t);
3798      return t;
3799    }
3800
3801    public ActivityDefinition addObservationResultRequirement(Reference t) { //3
3802      if (t == null)
3803        return this;
3804      if (this.observationResultRequirement == null)
3805        this.observationResultRequirement = new ArrayList<Reference>();
3806      this.observationResultRequirement.add(t);
3807      return this;
3808    }
3809
3810    /**
3811     * @return The first repetition of repeating field {@link #observationResultRequirement}, creating it if it does not already exist
3812     */
3813    public Reference getObservationResultRequirementFirstRep() { 
3814      if (getObservationResultRequirement().isEmpty()) {
3815        addObservationResultRequirement();
3816      }
3817      return getObservationResultRequirement().get(0);
3818    }
3819
3820    /**
3821     * @deprecated Use Reference#setResource(IBaseResource) instead
3822     */
3823    @Deprecated
3824    public List<ObservationDefinition> getObservationResultRequirementTarget() { 
3825      if (this.observationResultRequirementTarget == null)
3826        this.observationResultRequirementTarget = new ArrayList<ObservationDefinition>();
3827      return this.observationResultRequirementTarget;
3828    }
3829
3830    /**
3831     * @deprecated Use Reference#setResource(IBaseResource) instead
3832     */
3833    @Deprecated
3834    public ObservationDefinition addObservationResultRequirementTarget() { 
3835      ObservationDefinition r = new ObservationDefinition();
3836      if (this.observationResultRequirementTarget == null)
3837        this.observationResultRequirementTarget = new ArrayList<ObservationDefinition>();
3838      this.observationResultRequirementTarget.add(r);
3839      return r;
3840    }
3841
3842    /**
3843     * @return {@link #transform} (A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.). This is the underlying object with id, value and extensions. The accessor "getTransform" gives direct access to the value
3844     */
3845    public CanonicalType getTransformElement() { 
3846      if (this.transform == null)
3847        if (Configuration.errorOnAutoCreate())
3848          throw new Error("Attempt to auto-create ActivityDefinition.transform");
3849        else if (Configuration.doAutoCreate())
3850          this.transform = new CanonicalType(); // bb
3851      return this.transform;
3852    }
3853
3854    public boolean hasTransformElement() { 
3855      return this.transform != null && !this.transform.isEmpty();
3856    }
3857
3858    public boolean hasTransform() { 
3859      return this.transform != null && !this.transform.isEmpty();
3860    }
3861
3862    /**
3863     * @param value {@link #transform} (A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.). This is the underlying object with id, value and extensions. The accessor "getTransform" gives direct access to the value
3864     */
3865    public ActivityDefinition setTransformElement(CanonicalType value) { 
3866      this.transform = value;
3867      return this;
3868    }
3869
3870    /**
3871     * @return A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.
3872     */
3873    public String getTransform() { 
3874      return this.transform == null ? null : this.transform.getValue();
3875    }
3876
3877    /**
3878     * @param value A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.
3879     */
3880    public ActivityDefinition setTransform(String value) { 
3881      if (Utilities.noString(value))
3882        this.transform = null;
3883      else {
3884        if (this.transform == null)
3885          this.transform = new CanonicalType();
3886        this.transform.setValue(value);
3887      }
3888      return this;
3889    }
3890
3891    /**
3892     * @return {@link #dynamicValue} (Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the request resource that would contain the result.)
3893     */
3894    public List<ActivityDefinitionDynamicValueComponent> getDynamicValue() { 
3895      if (this.dynamicValue == null)
3896        this.dynamicValue = new ArrayList<ActivityDefinitionDynamicValueComponent>();
3897      return this.dynamicValue;
3898    }
3899
3900    /**
3901     * @return Returns a reference to <code>this</code> for easy method chaining
3902     */
3903    public ActivityDefinition setDynamicValue(List<ActivityDefinitionDynamicValueComponent> theDynamicValue) { 
3904      this.dynamicValue = theDynamicValue;
3905      return this;
3906    }
3907
3908    public boolean hasDynamicValue() { 
3909      if (this.dynamicValue == null)
3910        return false;
3911      for (ActivityDefinitionDynamicValueComponent item : this.dynamicValue)
3912        if (!item.isEmpty())
3913          return true;
3914      return false;
3915    }
3916
3917    public ActivityDefinitionDynamicValueComponent addDynamicValue() { //3
3918      ActivityDefinitionDynamicValueComponent t = new ActivityDefinitionDynamicValueComponent();
3919      if (this.dynamicValue == null)
3920        this.dynamicValue = new ArrayList<ActivityDefinitionDynamicValueComponent>();
3921      this.dynamicValue.add(t);
3922      return t;
3923    }
3924
3925    public ActivityDefinition addDynamicValue(ActivityDefinitionDynamicValueComponent t) { //3
3926      if (t == null)
3927        return this;
3928      if (this.dynamicValue == null)
3929        this.dynamicValue = new ArrayList<ActivityDefinitionDynamicValueComponent>();
3930      this.dynamicValue.add(t);
3931      return this;
3932    }
3933
3934    /**
3935     * @return The first repetition of repeating field {@link #dynamicValue}, creating it if it does not already exist
3936     */
3937    public ActivityDefinitionDynamicValueComponent getDynamicValueFirstRep() { 
3938      if (getDynamicValue().isEmpty()) {
3939        addDynamicValue();
3940      }
3941      return getDynamicValue().get(0);
3942    }
3943
3944      protected void listChildren(List<Property> children) {
3945        super.listChildren(children);
3946        children.add(new Property("url", "uri", "An absolute URI that is used to identify this activity definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this activity definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the activity definition is stored on different servers.", 0, 1, url));
3947        children.add(new Property("identifier", "Identifier", "A formal identifier that is used to identify this activity definition when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier));
3948        children.add(new Property("version", "string", "The identifier that is used to identify this version of the activity definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the activity definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets.", 0, 1, version));
3949        children.add(new Property("name", "string", "A natural language name identifying the activity definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
3950        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the activity definition.", 0, 1, title));
3951        children.add(new Property("subtitle", "string", "An explanatory or alternate title for the activity definition giving additional information about its content.", 0, 1, subtitle));
3952        children.add(new Property("status", "code", "The status of this activity definition. Enables tracking the life-cycle of the content.", 0, 1, status));
3953        children.add(new Property("experimental", "boolean", "A Boolean value to indicate that this activity definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.", 0, 1, experimental));
3954        children.add(new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the activity being defined.", 0, 1, subject));
3955        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the activity definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the activity definition changes.", 0, 1, date));
3956        children.add(new Property("publisher", "string", "The name of the organization or individual that published the activity definition.", 0, 1, publisher));
3957        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
3958        children.add(new Property("description", "markdown", "A free text natural language description of the activity definition from a consumer's perspective.", 0, 1, description));
3959        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate activity definition instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
3960        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the activity definition is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
3961        children.add(new Property("purpose", "markdown", "Explanation of why this activity definition is needed and why it has been designed as it has.", 0, 1, purpose));
3962        children.add(new Property("usage", "string", "A detailed description of how the activity definition is used from a clinical perspective.", 0, 1, usage));
3963        children.add(new Property("copyright", "markdown", "A copyright statement relating to the activity definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the activity definition.", 0, 1, copyright));
3964        children.add(new Property("approvalDate", "date", "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.", 0, 1, approvalDate));
3965        children.add(new Property("lastReviewDate", "date", "The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.", 0, 1, lastReviewDate));
3966        children.add(new Property("effectivePeriod", "Period", "The period during which the activity definition content was or is planned to be in active use.", 0, 1, effectivePeriod));
3967        children.add(new Property("topic", "CodeableConcept", "Descriptive topics related to the content of the activity. Topics provide a high-level categorization of the activity that can be useful for filtering and searching.", 0, java.lang.Integer.MAX_VALUE, topic));
3968        children.add(new Property("author", "ContactDetail", "An individiual or organization primarily involved in the creation and maintenance of the content.", 0, java.lang.Integer.MAX_VALUE, author));
3969        children.add(new Property("editor", "ContactDetail", "An individual or organization primarily responsible for internal coherence of the content.", 0, java.lang.Integer.MAX_VALUE, editor));
3970        children.add(new Property("reviewer", "ContactDetail", "An individual or organization primarily responsible for review of some aspect of the content.", 0, java.lang.Integer.MAX_VALUE, reviewer));
3971        children.add(new Property("endorser", "ContactDetail", "An individual or organization responsible for officially endorsing the content for use in some setting.", 0, java.lang.Integer.MAX_VALUE, endorser));
3972        children.add(new Property("relatedArtifact", "RelatedArtifact", "Related artifacts such as additional documentation, justification, or bibliographic references.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact));
3973        children.add(new Property("library", "canonical(Library)", "A reference to a Library resource containing any formal logic used by the activity definition.", 0, java.lang.Integer.MAX_VALUE, library));
3974        children.add(new Property("kind", "code", "A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. Typically, but not always, this is a Request resource.", 0, 1, kind));
3975        children.add(new Property("profile", "canonical(StructureDefinition)", "A profile to which the target of the activity definition is expected to conform.", 0, 1, profile));
3976        children.add(new Property("code", "CodeableConcept", "Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter.", 0, 1, code));
3977        children.add(new Property("intent", "code", "Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chain.", 0, 1, intent));
3978        children.add(new Property("priority", "code", "Indicates how quickly the activity  should be addressed with respect to other requests.", 0, 1, priority));
3979        children.add(new Property("doNotPerform", "boolean", "Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action.", 0, 1, doNotPerform));
3980        children.add(new Property("timing[x]", "Timing|dateTime|Age|Period|Range|Duration", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, timing));
3981        children.add(new Property("location", "Reference(Location)", "Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.", 0, 1, location));
3982        children.add(new Property("participant", "", "Indicates who should participate in performing the action described.", 0, java.lang.Integer.MAX_VALUE, participant));
3983        children.add(new Property("product[x]", "Reference(Medication|Substance)|CodeableConcept", "Identifies the food, drug or other product being consumed or supplied in the activity.", 0, 1, product));
3984        children.add(new Property("quantity", "SimpleQuantity", "Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).", 0, 1, quantity));
3985        children.add(new Property("dosage", "Dosage", "Provides detailed dosage instructions in the same way that they are described for MedicationRequest resources.", 0, java.lang.Integer.MAX_VALUE, dosage));
3986        children.add(new Property("bodySite", "CodeableConcept", "Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).", 0, java.lang.Integer.MAX_VALUE, bodySite));
3987        children.add(new Property("specimenRequirement", "Reference(SpecimenDefinition)", "Defines specimen requirements for the action to be performed, such as required specimens for a lab test.", 0, java.lang.Integer.MAX_VALUE, specimenRequirement));
3988        children.add(new Property("observationRequirement", "Reference(ObservationDefinition)", "Defines observation requirements for the action to be performed, such as body weight or surface area.", 0, java.lang.Integer.MAX_VALUE, observationRequirement));
3989        children.add(new Property("observationResultRequirement", "Reference(ObservationDefinition)", "Defines the observations that are expected to be produced by the action.", 0, java.lang.Integer.MAX_VALUE, observationResultRequirement));
3990        children.add(new Property("transform", "canonical(StructureMap)", "A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.", 0, 1, transform));
3991        children.add(new Property("dynamicValue", "", "Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the request resource that would contain the result.", 0, java.lang.Integer.MAX_VALUE, dynamicValue));
3992      }
3993
3994      @Override
3995      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3996        switch (_hash) {
3997        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this activity definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this activity definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the activity definition is stored on different servers.", 0, 1, url);
3998        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A formal identifier that is used to identify this activity definition when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier);
3999        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the activity definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the activity definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets.", 0, 1, version);
4000        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the activity definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
4001        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the activity definition.", 0, 1, title);
4002        case -2060497896: /*subtitle*/  return new Property("subtitle", "string", "An explanatory or alternate title for the activity definition giving additional information about its content.", 0, 1, subtitle);
4003        case -892481550: /*status*/  return new Property("status", "code", "The status of this activity definition. Enables tracking the life-cycle of the content.", 0, 1, status);
4004        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A Boolean value to indicate that this activity definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.", 0, 1, experimental);
4005        case -573640748: /*subject[x]*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the activity being defined.", 0, 1, subject);
4006        case -1867885268: /*subject*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the activity being defined.", 0, 1, subject);
4007        case -1257122603: /*subjectCodeableConcept*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the activity being defined.", 0, 1, subject);
4008        case 772938623: /*subjectReference*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the activity being defined.", 0, 1, subject);
4009        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the activity definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the activity definition changes.", 0, 1, date);
4010        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the organization or individual that published the activity definition.", 0, 1, publisher);
4011        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
4012        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the activity definition from a consumer's perspective.", 0, 1, description);
4013        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate activity definition instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
4014        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the activity definition is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
4015        case -220463842: /*purpose*/  return new Property("purpose", "markdown", "Explanation of why this activity definition is needed and why it has been designed as it has.", 0, 1, purpose);
4016        case 111574433: /*usage*/  return new Property("usage", "string", "A detailed description of how the activity definition is used from a clinical perspective.", 0, 1, usage);
4017        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to the activity definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the activity definition.", 0, 1, copyright);
4018        case 223539345: /*approvalDate*/  return new Property("approvalDate", "date", "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.", 0, 1, approvalDate);
4019        case -1687512484: /*lastReviewDate*/  return new Property("lastReviewDate", "date", "The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.", 0, 1, lastReviewDate);
4020        case -403934648: /*effectivePeriod*/  return new Property("effectivePeriod", "Period", "The period during which the activity definition content was or is planned to be in active use.", 0, 1, effectivePeriod);
4021        case 110546223: /*topic*/  return new Property("topic", "CodeableConcept", "Descriptive topics related to the content of the activity. Topics provide a high-level categorization of the activity that can be useful for filtering and searching.", 0, java.lang.Integer.MAX_VALUE, topic);
4022        case -1406328437: /*author*/  return new Property("author", "ContactDetail", "An individiual or organization primarily involved in the creation and maintenance of the content.", 0, java.lang.Integer.MAX_VALUE, author);
4023        case -1307827859: /*editor*/  return new Property("editor", "ContactDetail", "An individual or organization primarily responsible for internal coherence of the content.", 0, java.lang.Integer.MAX_VALUE, editor);
4024        case -261190139: /*reviewer*/  return new Property("reviewer", "ContactDetail", "An individual or organization primarily responsible for review of some aspect of the content.", 0, java.lang.Integer.MAX_VALUE, reviewer);
4025        case 1740277666: /*endorser*/  return new Property("endorser", "ContactDetail", "An individual or organization responsible for officially endorsing the content for use in some setting.", 0, java.lang.Integer.MAX_VALUE, endorser);
4026        case 666807069: /*relatedArtifact*/  return new Property("relatedArtifact", "RelatedArtifact", "Related artifacts such as additional documentation, justification, or bibliographic references.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact);
4027        case 166208699: /*library*/  return new Property("library", "canonical(Library)", "A reference to a Library resource containing any formal logic used by the activity definition.", 0, java.lang.Integer.MAX_VALUE, library);
4028        case 3292052: /*kind*/  return new Property("kind", "code", "A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. Typically, but not always, this is a Request resource.", 0, 1, kind);
4029        case -309425751: /*profile*/  return new Property("profile", "canonical(StructureDefinition)", "A profile to which the target of the activity definition is expected to conform.", 0, 1, profile);
4030        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter.", 0, 1, code);
4031        case -1183762788: /*intent*/  return new Property("intent", "code", "Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chain.", 0, 1, intent);
4032        case -1165461084: /*priority*/  return new Property("priority", "code", "Indicates how quickly the activity  should be addressed with respect to other requests.", 0, 1, priority);
4033        case -1788508167: /*doNotPerform*/  return new Property("doNotPerform", "boolean", "Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action.", 0, 1, doNotPerform);
4034        case 164632566: /*timing[x]*/  return new Property("timing[x]", "Timing|dateTime|Age|Period|Range|Duration", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, timing);
4035        case -873664438: /*timing*/  return new Property("timing[x]", "Timing|dateTime|Age|Period|Range|Duration", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, timing);
4036        case -497554124: /*timingTiming*/  return new Property("timing[x]", "Timing|dateTime|Age|Period|Range|Duration", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, timing);
4037        case -1837458939: /*timingDateTime*/  return new Property("timing[x]", "Timing|dateTime|Age|Period|Range|Duration", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, timing);
4038        case 164607061: /*timingAge*/  return new Property("timing[x]", "Timing|dateTime|Age|Period|Range|Duration", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, timing);
4039        case -615615829: /*timingPeriod*/  return new Property("timing[x]", "Timing|dateTime|Age|Period|Range|Duration", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, timing);
4040        case -710871277: /*timingRange*/  return new Property("timing[x]", "Timing|dateTime|Age|Period|Range|Duration", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, timing);
4041        case -1327253506: /*timingDuration*/  return new Property("timing[x]", "Timing|dateTime|Age|Period|Range|Duration", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, timing);
4042        case 1901043637: /*location*/  return new Property("location", "Reference(Location)", "Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.", 0, 1, location);
4043        case 767422259: /*participant*/  return new Property("participant", "", "Indicates who should participate in performing the action described.", 0, java.lang.Integer.MAX_VALUE, participant);
4044        case 1753005361: /*product[x]*/  return new Property("product[x]", "Reference(Medication|Substance)|CodeableConcept", "Identifies the food, drug or other product being consumed or supplied in the activity.", 0, 1, product);
4045        case -309474065: /*product*/  return new Property("product[x]", "Reference(Medication|Substance)|CodeableConcept", "Identifies the food, drug or other product being consumed or supplied in the activity.", 0, 1, product);
4046        case -669667556: /*productReference*/  return new Property("product[x]", "Reference(Medication|Substance)|CodeableConcept", "Identifies the food, drug or other product being consumed or supplied in the activity.", 0, 1, product);
4047        case 906854066: /*productCodeableConcept*/  return new Property("product[x]", "Reference(Medication|Substance)|CodeableConcept", "Identifies the food, drug or other product being consumed or supplied in the activity.", 0, 1, product);
4048        case -1285004149: /*quantity*/  return new Property("quantity", "SimpleQuantity", "Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).", 0, 1, quantity);
4049        case -1326018889: /*dosage*/  return new Property("dosage", "Dosage", "Provides detailed dosage instructions in the same way that they are described for MedicationRequest resources.", 0, java.lang.Integer.MAX_VALUE, dosage);
4050        case 1702620169: /*bodySite*/  return new Property("bodySite", "CodeableConcept", "Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).", 0, java.lang.Integer.MAX_VALUE, bodySite);
4051        case 1498467355: /*specimenRequirement*/  return new Property("specimenRequirement", "Reference(SpecimenDefinition)", "Defines specimen requirements for the action to be performed, such as required specimens for a lab test.", 0, java.lang.Integer.MAX_VALUE, specimenRequirement);
4052        case 362354807: /*observationRequirement*/  return new Property("observationRequirement", "Reference(ObservationDefinition)", "Defines observation requirements for the action to be performed, such as body weight or surface area.", 0, java.lang.Integer.MAX_VALUE, observationRequirement);
4053        case 395230490: /*observationResultRequirement*/  return new Property("observationResultRequirement", "Reference(ObservationDefinition)", "Defines the observations that are expected to be produced by the action.", 0, java.lang.Integer.MAX_VALUE, observationResultRequirement);
4054        case 1052666732: /*transform*/  return new Property("transform", "canonical(StructureMap)", "A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.", 0, 1, transform);
4055        case 572625010: /*dynamicValue*/  return new Property("dynamicValue", "", "Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the request resource that would contain the result.", 0, java.lang.Integer.MAX_VALUE, dynamicValue);
4056        default: return super.getNamedProperty(_hash, _name, _checkValid);
4057        }
4058
4059      }
4060
4061      @Override
4062      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4063        switch (hash) {
4064        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
4065        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
4066        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
4067        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
4068        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
4069        case -2060497896: /*subtitle*/ return this.subtitle == null ? new Base[0] : new Base[] {this.subtitle}; // StringType
4070        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
4071        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
4072        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Type
4073        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
4074        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
4075        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
4076        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
4077        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
4078        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
4079        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
4080        case 111574433: /*usage*/ return this.usage == null ? new Base[0] : new Base[] {this.usage}; // StringType
4081        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
4082        case 223539345: /*approvalDate*/ return this.approvalDate == null ? new Base[0] : new Base[] {this.approvalDate}; // DateType
4083        case -1687512484: /*lastReviewDate*/ return this.lastReviewDate == null ? new Base[0] : new Base[] {this.lastReviewDate}; // DateType
4084        case -403934648: /*effectivePeriod*/ return this.effectivePeriod == null ? new Base[0] : new Base[] {this.effectivePeriod}; // Period
4085        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : this.topic.toArray(new Base[this.topic.size()]); // CodeableConcept
4086        case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // ContactDetail
4087        case -1307827859: /*editor*/ return this.editor == null ? new Base[0] : this.editor.toArray(new Base[this.editor.size()]); // ContactDetail
4088        case -261190139: /*reviewer*/ return this.reviewer == null ? new Base[0] : this.reviewer.toArray(new Base[this.reviewer.size()]); // ContactDetail
4089        case 1740277666: /*endorser*/ return this.endorser == null ? new Base[0] : this.endorser.toArray(new Base[this.endorser.size()]); // ContactDetail
4090        case 666807069: /*relatedArtifact*/ return this.relatedArtifact == null ? new Base[0] : this.relatedArtifact.toArray(new Base[this.relatedArtifact.size()]); // RelatedArtifact
4091        case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // CanonicalType
4092        case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration<ActivityDefinitionKind>
4093        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // CanonicalType
4094        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
4095        case -1183762788: /*intent*/ return this.intent == null ? new Base[0] : new Base[] {this.intent}; // Enumeration<RequestIntent>
4096        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration<RequestPriority>
4097        case -1788508167: /*doNotPerform*/ return this.doNotPerform == null ? new Base[0] : new Base[] {this.doNotPerform}; // BooleanType
4098        case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Type
4099        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
4100        case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // ActivityDefinitionParticipantComponent
4101        case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // Type
4102        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
4103        case -1326018889: /*dosage*/ return this.dosage == null ? new Base[0] : this.dosage.toArray(new Base[this.dosage.size()]); // Dosage
4104        case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : this.bodySite.toArray(new Base[this.bodySite.size()]); // CodeableConcept
4105        case 1498467355: /*specimenRequirement*/ return this.specimenRequirement == null ? new Base[0] : this.specimenRequirement.toArray(new Base[this.specimenRequirement.size()]); // Reference
4106        case 362354807: /*observationRequirement*/ return this.observationRequirement == null ? new Base[0] : this.observationRequirement.toArray(new Base[this.observationRequirement.size()]); // Reference
4107        case 395230490: /*observationResultRequirement*/ return this.observationResultRequirement == null ? new Base[0] : this.observationResultRequirement.toArray(new Base[this.observationResultRequirement.size()]); // Reference
4108        case 1052666732: /*transform*/ return this.transform == null ? new Base[0] : new Base[] {this.transform}; // CanonicalType
4109        case 572625010: /*dynamicValue*/ return this.dynamicValue == null ? new Base[0] : this.dynamicValue.toArray(new Base[this.dynamicValue.size()]); // ActivityDefinitionDynamicValueComponent
4110        default: return super.getProperty(hash, name, checkValid);
4111        }
4112
4113      }
4114
4115      @Override
4116      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4117        switch (hash) {
4118        case 116079: // url
4119          this.url = castToUri(value); // UriType
4120          return value;
4121        case -1618432855: // identifier
4122          this.getIdentifier().add(castToIdentifier(value)); // Identifier
4123          return value;
4124        case 351608024: // version
4125          this.version = castToString(value); // StringType
4126          return value;
4127        case 3373707: // name
4128          this.name = castToString(value); // StringType
4129          return value;
4130        case 110371416: // title
4131          this.title = castToString(value); // StringType
4132          return value;
4133        case -2060497896: // subtitle
4134          this.subtitle = castToString(value); // StringType
4135          return value;
4136        case -892481550: // status
4137          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
4138          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
4139          return value;
4140        case -404562712: // experimental
4141          this.experimental = castToBoolean(value); // BooleanType
4142          return value;
4143        case -1867885268: // subject
4144          this.subject = castToType(value); // Type
4145          return value;
4146        case 3076014: // date
4147          this.date = castToDateTime(value); // DateTimeType
4148          return value;
4149        case 1447404028: // publisher
4150          this.publisher = castToString(value); // StringType
4151          return value;
4152        case 951526432: // contact
4153          this.getContact().add(castToContactDetail(value)); // ContactDetail
4154          return value;
4155        case -1724546052: // description
4156          this.description = castToMarkdown(value); // MarkdownType
4157          return value;
4158        case -669707736: // useContext
4159          this.getUseContext().add(castToUsageContext(value)); // UsageContext
4160          return value;
4161        case -507075711: // jurisdiction
4162          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
4163          return value;
4164        case -220463842: // purpose
4165          this.purpose = castToMarkdown(value); // MarkdownType
4166          return value;
4167        case 111574433: // usage
4168          this.usage = castToString(value); // StringType
4169          return value;
4170        case 1522889671: // copyright
4171          this.copyright = castToMarkdown(value); // MarkdownType
4172          return value;
4173        case 223539345: // approvalDate
4174          this.approvalDate = castToDate(value); // DateType
4175          return value;
4176        case -1687512484: // lastReviewDate
4177          this.lastReviewDate = castToDate(value); // DateType
4178          return value;
4179        case -403934648: // effectivePeriod
4180          this.effectivePeriod = castToPeriod(value); // Period
4181          return value;
4182        case 110546223: // topic
4183          this.getTopic().add(castToCodeableConcept(value)); // CodeableConcept
4184          return value;
4185        case -1406328437: // author
4186          this.getAuthor().add(castToContactDetail(value)); // ContactDetail
4187          return value;
4188        case -1307827859: // editor
4189          this.getEditor().add(castToContactDetail(value)); // ContactDetail
4190          return value;
4191        case -261190139: // reviewer
4192          this.getReviewer().add(castToContactDetail(value)); // ContactDetail
4193          return value;
4194        case 1740277666: // endorser
4195          this.getEndorser().add(castToContactDetail(value)); // ContactDetail
4196          return value;
4197        case 666807069: // relatedArtifact
4198          this.getRelatedArtifact().add(castToRelatedArtifact(value)); // RelatedArtifact
4199          return value;
4200        case 166208699: // library
4201          this.getLibrary().add(castToCanonical(value)); // CanonicalType
4202          return value;
4203        case 3292052: // kind
4204          value = new ActivityDefinitionKindEnumFactory().fromType(castToCode(value));
4205          this.kind = (Enumeration) value; // Enumeration<ActivityDefinitionKind>
4206          return value;
4207        case -309425751: // profile
4208          this.profile = castToCanonical(value); // CanonicalType
4209          return value;
4210        case 3059181: // code
4211          this.code = castToCodeableConcept(value); // CodeableConcept
4212          return value;
4213        case -1183762788: // intent
4214          value = new RequestIntentEnumFactory().fromType(castToCode(value));
4215          this.intent = (Enumeration) value; // Enumeration<RequestIntent>
4216          return value;
4217        case -1165461084: // priority
4218          value = new RequestPriorityEnumFactory().fromType(castToCode(value));
4219          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
4220          return value;
4221        case -1788508167: // doNotPerform
4222          this.doNotPerform = castToBoolean(value); // BooleanType
4223          return value;
4224        case -873664438: // timing
4225          this.timing = castToType(value); // Type
4226          return value;
4227        case 1901043637: // location
4228          this.location = castToReference(value); // Reference
4229          return value;
4230        case 767422259: // participant
4231          this.getParticipant().add((ActivityDefinitionParticipantComponent) value); // ActivityDefinitionParticipantComponent
4232          return value;
4233        case -309474065: // product
4234          this.product = castToType(value); // Type
4235          return value;
4236        case -1285004149: // quantity
4237          this.quantity = castToQuantity(value); // Quantity
4238          return value;
4239        case -1326018889: // dosage
4240          this.getDosage().add(castToDosage(value)); // Dosage
4241          return value;
4242        case 1702620169: // bodySite
4243          this.getBodySite().add(castToCodeableConcept(value)); // CodeableConcept
4244          return value;
4245        case 1498467355: // specimenRequirement
4246          this.getSpecimenRequirement().add(castToReference(value)); // Reference
4247          return value;
4248        case 362354807: // observationRequirement
4249          this.getObservationRequirement().add(castToReference(value)); // Reference
4250          return value;
4251        case 395230490: // observationResultRequirement
4252          this.getObservationResultRequirement().add(castToReference(value)); // Reference
4253          return value;
4254        case 1052666732: // transform
4255          this.transform = castToCanonical(value); // CanonicalType
4256          return value;
4257        case 572625010: // dynamicValue
4258          this.getDynamicValue().add((ActivityDefinitionDynamicValueComponent) value); // ActivityDefinitionDynamicValueComponent
4259          return value;
4260        default: return super.setProperty(hash, name, value);
4261        }
4262
4263      }
4264
4265      @Override
4266      public Base setProperty(String name, Base value) throws FHIRException {
4267        if (name.equals("url")) {
4268          this.url = castToUri(value); // UriType
4269        } else if (name.equals("identifier")) {
4270          this.getIdentifier().add(castToIdentifier(value));
4271        } else if (name.equals("version")) {
4272          this.version = castToString(value); // StringType
4273        } else if (name.equals("name")) {
4274          this.name = castToString(value); // StringType
4275        } else if (name.equals("title")) {
4276          this.title = castToString(value); // StringType
4277        } else if (name.equals("subtitle")) {
4278          this.subtitle = castToString(value); // StringType
4279        } else if (name.equals("status")) {
4280          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
4281          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
4282        } else if (name.equals("experimental")) {
4283          this.experimental = castToBoolean(value); // BooleanType
4284        } else if (name.equals("subject[x]")) {
4285          this.subject = castToType(value); // Type
4286        } else if (name.equals("date")) {
4287          this.date = castToDateTime(value); // DateTimeType
4288        } else if (name.equals("publisher")) {
4289          this.publisher = castToString(value); // StringType
4290        } else if (name.equals("contact")) {
4291          this.getContact().add(castToContactDetail(value));
4292        } else if (name.equals("description")) {
4293          this.description = castToMarkdown(value); // MarkdownType
4294        } else if (name.equals("useContext")) {
4295          this.getUseContext().add(castToUsageContext(value));
4296        } else if (name.equals("jurisdiction")) {
4297          this.getJurisdiction().add(castToCodeableConcept(value));
4298        } else if (name.equals("purpose")) {
4299          this.purpose = castToMarkdown(value); // MarkdownType
4300        } else if (name.equals("usage")) {
4301          this.usage = castToString(value); // StringType
4302        } else if (name.equals("copyright")) {
4303          this.copyright = castToMarkdown(value); // MarkdownType
4304        } else if (name.equals("approvalDate")) {
4305          this.approvalDate = castToDate(value); // DateType
4306        } else if (name.equals("lastReviewDate")) {
4307          this.lastReviewDate = castToDate(value); // DateType
4308        } else if (name.equals("effectivePeriod")) {
4309          this.effectivePeriod = castToPeriod(value); // Period
4310        } else if (name.equals("topic")) {
4311          this.getTopic().add(castToCodeableConcept(value));
4312        } else if (name.equals("author")) {
4313          this.getAuthor().add(castToContactDetail(value));
4314        } else if (name.equals("editor")) {
4315          this.getEditor().add(castToContactDetail(value));
4316        } else if (name.equals("reviewer")) {
4317          this.getReviewer().add(castToContactDetail(value));
4318        } else if (name.equals("endorser")) {
4319          this.getEndorser().add(castToContactDetail(value));
4320        } else if (name.equals("relatedArtifact")) {
4321          this.getRelatedArtifact().add(castToRelatedArtifact(value));
4322        } else if (name.equals("library")) {
4323          this.getLibrary().add(castToCanonical(value));
4324        } else if (name.equals("kind")) {
4325          value = new ActivityDefinitionKindEnumFactory().fromType(castToCode(value));
4326          this.kind = (Enumeration) value; // Enumeration<ActivityDefinitionKind>
4327        } else if (name.equals("profile")) {
4328          this.profile = castToCanonical(value); // CanonicalType
4329        } else if (name.equals("code")) {
4330          this.code = castToCodeableConcept(value); // CodeableConcept
4331        } else if (name.equals("intent")) {
4332          value = new RequestIntentEnumFactory().fromType(castToCode(value));
4333          this.intent = (Enumeration) value; // Enumeration<RequestIntent>
4334        } else if (name.equals("priority")) {
4335          value = new RequestPriorityEnumFactory().fromType(castToCode(value));
4336          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
4337        } else if (name.equals("doNotPerform")) {
4338          this.doNotPerform = castToBoolean(value); // BooleanType
4339        } else if (name.equals("timing[x]")) {
4340          this.timing = castToType(value); // Type
4341        } else if (name.equals("location")) {
4342          this.location = castToReference(value); // Reference
4343        } else if (name.equals("participant")) {
4344          this.getParticipant().add((ActivityDefinitionParticipantComponent) value);
4345        } else if (name.equals("product[x]")) {
4346          this.product = castToType(value); // Type
4347        } else if (name.equals("quantity")) {
4348          this.quantity = castToQuantity(value); // Quantity
4349        } else if (name.equals("dosage")) {
4350          this.getDosage().add(castToDosage(value));
4351        } else if (name.equals("bodySite")) {
4352          this.getBodySite().add(castToCodeableConcept(value));
4353        } else if (name.equals("specimenRequirement")) {
4354          this.getSpecimenRequirement().add(castToReference(value));
4355        } else if (name.equals("observationRequirement")) {
4356          this.getObservationRequirement().add(castToReference(value));
4357        } else if (name.equals("observationResultRequirement")) {
4358          this.getObservationResultRequirement().add(castToReference(value));
4359        } else if (name.equals("transform")) {
4360          this.transform = castToCanonical(value); // CanonicalType
4361        } else if (name.equals("dynamicValue")) {
4362          this.getDynamicValue().add((ActivityDefinitionDynamicValueComponent) value);
4363        } else
4364          return super.setProperty(name, value);
4365        return value;
4366      }
4367
4368      @Override
4369      public Base makeProperty(int hash, String name) throws FHIRException {
4370        switch (hash) {
4371        case 116079:  return getUrlElement();
4372        case -1618432855:  return addIdentifier(); 
4373        case 351608024:  return getVersionElement();
4374        case 3373707:  return getNameElement();
4375        case 110371416:  return getTitleElement();
4376        case -2060497896:  return getSubtitleElement();
4377        case -892481550:  return getStatusElement();
4378        case -404562712:  return getExperimentalElement();
4379        case -573640748:  return getSubject(); 
4380        case -1867885268:  return getSubject(); 
4381        case 3076014:  return getDateElement();
4382        case 1447404028:  return getPublisherElement();
4383        case 951526432:  return addContact(); 
4384        case -1724546052:  return getDescriptionElement();
4385        case -669707736:  return addUseContext(); 
4386        case -507075711:  return addJurisdiction(); 
4387        case -220463842:  return getPurposeElement();
4388        case 111574433:  return getUsageElement();
4389        case 1522889671:  return getCopyrightElement();
4390        case 223539345:  return getApprovalDateElement();
4391        case -1687512484:  return getLastReviewDateElement();
4392        case -403934648:  return getEffectivePeriod(); 
4393        case 110546223:  return addTopic(); 
4394        case -1406328437:  return addAuthor(); 
4395        case -1307827859:  return addEditor(); 
4396        case -261190139:  return addReviewer(); 
4397        case 1740277666:  return addEndorser(); 
4398        case 666807069:  return addRelatedArtifact(); 
4399        case 166208699:  return addLibraryElement();
4400        case 3292052:  return getKindElement();
4401        case -309425751:  return getProfileElement();
4402        case 3059181:  return getCode(); 
4403        case -1183762788:  return getIntentElement();
4404        case -1165461084:  return getPriorityElement();
4405        case -1788508167:  return getDoNotPerformElement();
4406        case 164632566:  return getTiming(); 
4407        case -873664438:  return getTiming(); 
4408        case 1901043637:  return getLocation(); 
4409        case 767422259:  return addParticipant(); 
4410        case 1753005361:  return getProduct(); 
4411        case -309474065:  return getProduct(); 
4412        case -1285004149:  return getQuantity(); 
4413        case -1326018889:  return addDosage(); 
4414        case 1702620169:  return addBodySite(); 
4415        case 1498467355:  return addSpecimenRequirement(); 
4416        case 362354807:  return addObservationRequirement(); 
4417        case 395230490:  return addObservationResultRequirement(); 
4418        case 1052666732:  return getTransformElement();
4419        case 572625010:  return addDynamicValue(); 
4420        default: return super.makeProperty(hash, name);
4421        }
4422
4423      }
4424
4425      @Override
4426      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4427        switch (hash) {
4428        case 116079: /*url*/ return new String[] {"uri"};
4429        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
4430        case 351608024: /*version*/ return new String[] {"string"};
4431        case 3373707: /*name*/ return new String[] {"string"};
4432        case 110371416: /*title*/ return new String[] {"string"};
4433        case -2060497896: /*subtitle*/ return new String[] {"string"};
4434        case -892481550: /*status*/ return new String[] {"code"};
4435        case -404562712: /*experimental*/ return new String[] {"boolean"};
4436        case -1867885268: /*subject*/ return new String[] {"CodeableConcept", "Reference"};
4437        case 3076014: /*date*/ return new String[] {"dateTime"};
4438        case 1447404028: /*publisher*/ return new String[] {"string"};
4439        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
4440        case -1724546052: /*description*/ return new String[] {"markdown"};
4441        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
4442        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
4443        case -220463842: /*purpose*/ return new String[] {"markdown"};
4444        case 111574433: /*usage*/ return new String[] {"string"};
4445        case 1522889671: /*copyright*/ return new String[] {"markdown"};
4446        case 223539345: /*approvalDate*/ return new String[] {"date"};
4447        case -1687512484: /*lastReviewDate*/ return new String[] {"date"};
4448        case -403934648: /*effectivePeriod*/ return new String[] {"Period"};
4449        case 110546223: /*topic*/ return new String[] {"CodeableConcept"};
4450        case -1406328437: /*author*/ return new String[] {"ContactDetail"};
4451        case -1307827859: /*editor*/ return new String[] {"ContactDetail"};
4452        case -261190139: /*reviewer*/ return new String[] {"ContactDetail"};
4453        case 1740277666: /*endorser*/ return new String[] {"ContactDetail"};
4454        case 666807069: /*relatedArtifact*/ return new String[] {"RelatedArtifact"};
4455        case 166208699: /*library*/ return new String[] {"canonical"};
4456        case 3292052: /*kind*/ return new String[] {"code"};
4457        case -309425751: /*profile*/ return new String[] {"canonical"};
4458        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
4459        case -1183762788: /*intent*/ return new String[] {"code"};
4460        case -1165461084: /*priority*/ return new String[] {"code"};
4461        case -1788508167: /*doNotPerform*/ return new String[] {"boolean"};
4462        case -873664438: /*timing*/ return new String[] {"Timing", "dateTime", "Age", "Period", "Range", "Duration"};
4463        case 1901043637: /*location*/ return new String[] {"Reference"};
4464        case 767422259: /*participant*/ return new String[] {};
4465        case -309474065: /*product*/ return new String[] {"Reference", "CodeableConcept"};
4466        case -1285004149: /*quantity*/ return new String[] {"SimpleQuantity"};
4467        case -1326018889: /*dosage*/ return new String[] {"Dosage"};
4468        case 1702620169: /*bodySite*/ return new String[] {"CodeableConcept"};
4469        case 1498467355: /*specimenRequirement*/ return new String[] {"Reference"};
4470        case 362354807: /*observationRequirement*/ return new String[] {"Reference"};
4471        case 395230490: /*observationResultRequirement*/ return new String[] {"Reference"};
4472        case 1052666732: /*transform*/ return new String[] {"canonical"};
4473        case 572625010: /*dynamicValue*/ return new String[] {};
4474        default: return super.getTypesForProperty(hash, name);
4475        }
4476
4477      }
4478
4479      @Override
4480      public Base addChild(String name) throws FHIRException {
4481        if (name.equals("url")) {
4482          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.url");
4483        }
4484        else if (name.equals("identifier")) {
4485          return addIdentifier();
4486        }
4487        else if (name.equals("version")) {
4488          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.version");
4489        }
4490        else if (name.equals("name")) {
4491          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.name");
4492        }
4493        else if (name.equals("title")) {
4494          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.title");
4495        }
4496        else if (name.equals("subtitle")) {
4497          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.subtitle");
4498        }
4499        else if (name.equals("status")) {
4500          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.status");
4501        }
4502        else if (name.equals("experimental")) {
4503          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.experimental");
4504        }
4505        else if (name.equals("subjectCodeableConcept")) {
4506          this.subject = new CodeableConcept();
4507          return this.subject;
4508        }
4509        else if (name.equals("subjectReference")) {
4510          this.subject = new Reference();
4511          return this.subject;
4512        }
4513        else if (name.equals("date")) {
4514          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.date");
4515        }
4516        else if (name.equals("publisher")) {
4517          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.publisher");
4518        }
4519        else if (name.equals("contact")) {
4520          return addContact();
4521        }
4522        else if (name.equals("description")) {
4523          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.description");
4524        }
4525        else if (name.equals("useContext")) {
4526          return addUseContext();
4527        }
4528        else if (name.equals("jurisdiction")) {
4529          return addJurisdiction();
4530        }
4531        else if (name.equals("purpose")) {
4532          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.purpose");
4533        }
4534        else if (name.equals("usage")) {
4535          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.usage");
4536        }
4537        else if (name.equals("copyright")) {
4538          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.copyright");
4539        }
4540        else if (name.equals("approvalDate")) {
4541          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.approvalDate");
4542        }
4543        else if (name.equals("lastReviewDate")) {
4544          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.lastReviewDate");
4545        }
4546        else if (name.equals("effectivePeriod")) {
4547          this.effectivePeriod = new Period();
4548          return this.effectivePeriod;
4549        }
4550        else if (name.equals("topic")) {
4551          return addTopic();
4552        }
4553        else if (name.equals("author")) {
4554          return addAuthor();
4555        }
4556        else if (name.equals("editor")) {
4557          return addEditor();
4558        }
4559        else if (name.equals("reviewer")) {
4560          return addReviewer();
4561        }
4562        else if (name.equals("endorser")) {
4563          return addEndorser();
4564        }
4565        else if (name.equals("relatedArtifact")) {
4566          return addRelatedArtifact();
4567        }
4568        else if (name.equals("library")) {
4569          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.library");
4570        }
4571        else if (name.equals("kind")) {
4572          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.kind");
4573        }
4574        else if (name.equals("profile")) {
4575          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.profile");
4576        }
4577        else if (name.equals("code")) {
4578          this.code = new CodeableConcept();
4579          return this.code;
4580        }
4581        else if (name.equals("intent")) {
4582          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.intent");
4583        }
4584        else if (name.equals("priority")) {
4585          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.priority");
4586        }
4587        else if (name.equals("doNotPerform")) {
4588          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.doNotPerform");
4589        }
4590        else if (name.equals("timingTiming")) {
4591          this.timing = new Timing();
4592          return this.timing;
4593        }
4594        else if (name.equals("timingDateTime")) {
4595          this.timing = new DateTimeType();
4596          return this.timing;
4597        }
4598        else if (name.equals("timingAge")) {
4599          this.timing = new Age();
4600          return this.timing;
4601        }
4602        else if (name.equals("timingPeriod")) {
4603          this.timing = new Period();
4604          return this.timing;
4605        }
4606        else if (name.equals("timingRange")) {
4607          this.timing = new Range();
4608          return this.timing;
4609        }
4610        else if (name.equals("timingDuration")) {
4611          this.timing = new Duration();
4612          return this.timing;
4613        }
4614        else if (name.equals("location")) {
4615          this.location = new Reference();
4616          return this.location;
4617        }
4618        else if (name.equals("participant")) {
4619          return addParticipant();
4620        }
4621        else if (name.equals("productReference")) {
4622          this.product = new Reference();
4623          return this.product;
4624        }
4625        else if (name.equals("productCodeableConcept")) {
4626          this.product = new CodeableConcept();
4627          return this.product;
4628        }
4629        else if (name.equals("quantity")) {
4630          this.quantity = new Quantity();
4631          return this.quantity;
4632        }
4633        else if (name.equals("dosage")) {
4634          return addDosage();
4635        }
4636        else if (name.equals("bodySite")) {
4637          return addBodySite();
4638        }
4639        else if (name.equals("specimenRequirement")) {
4640          return addSpecimenRequirement();
4641        }
4642        else if (name.equals("observationRequirement")) {
4643          return addObservationRequirement();
4644        }
4645        else if (name.equals("observationResultRequirement")) {
4646          return addObservationResultRequirement();
4647        }
4648        else if (name.equals("transform")) {
4649          throw new FHIRException("Cannot call addChild on a primitive type ActivityDefinition.transform");
4650        }
4651        else if (name.equals("dynamicValue")) {
4652          return addDynamicValue();
4653        }
4654        else
4655          return super.addChild(name);
4656      }
4657
4658  public String fhirType() {
4659    return "ActivityDefinition";
4660
4661  }
4662
4663      public ActivityDefinition copy() {
4664        ActivityDefinition dst = new ActivityDefinition();
4665        copyValues(dst);
4666        return dst;
4667      }
4668
4669      public void copyValues(ActivityDefinition dst) {
4670        super.copyValues(dst);
4671        dst.url = url == null ? null : url.copy();
4672        if (identifier != null) {
4673          dst.identifier = new ArrayList<Identifier>();
4674          for (Identifier i : identifier)
4675            dst.identifier.add(i.copy());
4676        };
4677        dst.version = version == null ? null : version.copy();
4678        dst.name = name == null ? null : name.copy();
4679        dst.title = title == null ? null : title.copy();
4680        dst.subtitle = subtitle == null ? null : subtitle.copy();
4681        dst.status = status == null ? null : status.copy();
4682        dst.experimental = experimental == null ? null : experimental.copy();
4683        dst.subject = subject == null ? null : subject.copy();
4684        dst.date = date == null ? null : date.copy();
4685        dst.publisher = publisher == null ? null : publisher.copy();
4686        if (contact != null) {
4687          dst.contact = new ArrayList<ContactDetail>();
4688          for (ContactDetail i : contact)
4689            dst.contact.add(i.copy());
4690        };
4691        dst.description = description == null ? null : description.copy();
4692        if (useContext != null) {
4693          dst.useContext = new ArrayList<UsageContext>();
4694          for (UsageContext i : useContext)
4695            dst.useContext.add(i.copy());
4696        };
4697        if (jurisdiction != null) {
4698          dst.jurisdiction = new ArrayList<CodeableConcept>();
4699          for (CodeableConcept i : jurisdiction)
4700            dst.jurisdiction.add(i.copy());
4701        };
4702        dst.purpose = purpose == null ? null : purpose.copy();
4703        dst.usage = usage == null ? null : usage.copy();
4704        dst.copyright = copyright == null ? null : copyright.copy();
4705        dst.approvalDate = approvalDate == null ? null : approvalDate.copy();
4706        dst.lastReviewDate = lastReviewDate == null ? null : lastReviewDate.copy();
4707        dst.effectivePeriod = effectivePeriod == null ? null : effectivePeriod.copy();
4708        if (topic != null) {
4709          dst.topic = new ArrayList<CodeableConcept>();
4710          for (CodeableConcept i : topic)
4711            dst.topic.add(i.copy());
4712        };
4713        if (author != null) {
4714          dst.author = new ArrayList<ContactDetail>();
4715          for (ContactDetail i : author)
4716            dst.author.add(i.copy());
4717        };
4718        if (editor != null) {
4719          dst.editor = new ArrayList<ContactDetail>();
4720          for (ContactDetail i : editor)
4721            dst.editor.add(i.copy());
4722        };
4723        if (reviewer != null) {
4724          dst.reviewer = new ArrayList<ContactDetail>();
4725          for (ContactDetail i : reviewer)
4726            dst.reviewer.add(i.copy());
4727        };
4728        if (endorser != null) {
4729          dst.endorser = new ArrayList<ContactDetail>();
4730          for (ContactDetail i : endorser)
4731            dst.endorser.add(i.copy());
4732        };
4733        if (relatedArtifact != null) {
4734          dst.relatedArtifact = new ArrayList<RelatedArtifact>();
4735          for (RelatedArtifact i : relatedArtifact)
4736            dst.relatedArtifact.add(i.copy());
4737        };
4738        if (library != null) {
4739          dst.library = new ArrayList<CanonicalType>();
4740          for (CanonicalType i : library)
4741            dst.library.add(i.copy());
4742        };
4743        dst.kind = kind == null ? null : kind.copy();
4744        dst.profile = profile == null ? null : profile.copy();
4745        dst.code = code == null ? null : code.copy();
4746        dst.intent = intent == null ? null : intent.copy();
4747        dst.priority = priority == null ? null : priority.copy();
4748        dst.doNotPerform = doNotPerform == null ? null : doNotPerform.copy();
4749        dst.timing = timing == null ? null : timing.copy();
4750        dst.location = location == null ? null : location.copy();
4751        if (participant != null) {
4752          dst.participant = new ArrayList<ActivityDefinitionParticipantComponent>();
4753          for (ActivityDefinitionParticipantComponent i : participant)
4754            dst.participant.add(i.copy());
4755        };
4756        dst.product = product == null ? null : product.copy();
4757        dst.quantity = quantity == null ? null : quantity.copy();
4758        if (dosage != null) {
4759          dst.dosage = new ArrayList<Dosage>();
4760          for (Dosage i : dosage)
4761            dst.dosage.add(i.copy());
4762        };
4763        if (bodySite != null) {
4764          dst.bodySite = new ArrayList<CodeableConcept>();
4765          for (CodeableConcept i : bodySite)
4766            dst.bodySite.add(i.copy());
4767        };
4768        if (specimenRequirement != null) {
4769          dst.specimenRequirement = new ArrayList<Reference>();
4770          for (Reference i : specimenRequirement)
4771            dst.specimenRequirement.add(i.copy());
4772        };
4773        if (observationRequirement != null) {
4774          dst.observationRequirement = new ArrayList<Reference>();
4775          for (Reference i : observationRequirement)
4776            dst.observationRequirement.add(i.copy());
4777        };
4778        if (observationResultRequirement != null) {
4779          dst.observationResultRequirement = new ArrayList<Reference>();
4780          for (Reference i : observationResultRequirement)
4781            dst.observationResultRequirement.add(i.copy());
4782        };
4783        dst.transform = transform == null ? null : transform.copy();
4784        if (dynamicValue != null) {
4785          dst.dynamicValue = new ArrayList<ActivityDefinitionDynamicValueComponent>();
4786          for (ActivityDefinitionDynamicValueComponent i : dynamicValue)
4787            dst.dynamicValue.add(i.copy());
4788        };
4789      }
4790
4791      protected ActivityDefinition typedCopy() {
4792        return copy();
4793      }
4794
4795      @Override
4796      public boolean equalsDeep(Base other_) {
4797        if (!super.equalsDeep(other_))
4798          return false;
4799        if (!(other_ instanceof ActivityDefinition))
4800          return false;
4801        ActivityDefinition o = (ActivityDefinition) other_;
4802        return compareDeep(identifier, o.identifier, true) && compareDeep(subtitle, o.subtitle, true) && compareDeep(subject, o.subject, true)
4803           && compareDeep(purpose, o.purpose, true) && compareDeep(usage, o.usage, true) && compareDeep(copyright, o.copyright, true)
4804           && compareDeep(approvalDate, o.approvalDate, true) && compareDeep(lastReviewDate, o.lastReviewDate, true)
4805           && compareDeep(effectivePeriod, o.effectivePeriod, true) && compareDeep(topic, o.topic, true) && compareDeep(author, o.author, true)
4806           && compareDeep(editor, o.editor, true) && compareDeep(reviewer, o.reviewer, true) && compareDeep(endorser, o.endorser, true)
4807           && compareDeep(relatedArtifact, o.relatedArtifact, true) && compareDeep(library, o.library, true)
4808           && compareDeep(kind, o.kind, true) && compareDeep(profile, o.profile, true) && compareDeep(code, o.code, true)
4809           && compareDeep(intent, o.intent, true) && compareDeep(priority, o.priority, true) && compareDeep(doNotPerform, o.doNotPerform, true)
4810           && compareDeep(timing, o.timing, true) && compareDeep(location, o.location, true) && compareDeep(participant, o.participant, true)
4811           && compareDeep(product, o.product, true) && compareDeep(quantity, o.quantity, true) && compareDeep(dosage, o.dosage, true)
4812           && compareDeep(bodySite, o.bodySite, true) && compareDeep(specimenRequirement, o.specimenRequirement, true)
4813           && compareDeep(observationRequirement, o.observationRequirement, true) && compareDeep(observationResultRequirement, o.observationResultRequirement, true)
4814           && compareDeep(transform, o.transform, true) && compareDeep(dynamicValue, o.dynamicValue, true)
4815          ;
4816      }
4817
4818      @Override
4819      public boolean equalsShallow(Base other_) {
4820        if (!super.equalsShallow(other_))
4821          return false;
4822        if (!(other_ instanceof ActivityDefinition))
4823          return false;
4824        ActivityDefinition o = (ActivityDefinition) other_;
4825        return compareValues(subtitle, o.subtitle, true) && compareValues(purpose, o.purpose, true) && compareValues(usage, o.usage, true)
4826           && compareValues(copyright, o.copyright, true) && compareValues(approvalDate, o.approvalDate, true)
4827           && compareValues(lastReviewDate, o.lastReviewDate, true) && compareValues(kind, o.kind, true) && compareValues(intent, o.intent, true)
4828           && compareValues(priority, o.priority, true) && compareValues(doNotPerform, o.doNotPerform, true);
4829      }
4830
4831      public boolean isEmpty() {
4832        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, subtitle, subject
4833          , purpose, usage, copyright, approvalDate, lastReviewDate, effectivePeriod, topic
4834          , author, editor, reviewer, endorser, relatedArtifact, library, kind, profile
4835          , code, intent, priority, doNotPerform, timing, location, participant, product
4836          , quantity, dosage, bodySite, specimenRequirement, observationRequirement, observationResultRequirement
4837          , transform, dynamicValue);
4838      }
4839
4840  @Override
4841  public ResourceType getResourceType() {
4842    return ResourceType.ActivityDefinition;
4843   }
4844
4845 /**
4846   * Search parameter: <b>date</b>
4847   * <p>
4848   * Description: <b>The activity definition publication date</b><br>
4849   * Type: <b>date</b><br>
4850   * Path: <b>ActivityDefinition.date</b><br>
4851   * </p>
4852   */
4853  @SearchParamDefinition(name="date", path="ActivityDefinition.date", description="The activity definition publication date", type="date" )
4854  public static final String SP_DATE = "date";
4855 /**
4856   * <b>Fluent Client</b> search parameter constant for <b>date</b>
4857   * <p>
4858   * Description: <b>The activity definition publication date</b><br>
4859   * Type: <b>date</b><br>
4860   * Path: <b>ActivityDefinition.date</b><br>
4861   * </p>
4862   */
4863  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
4864
4865 /**
4866   * Search parameter: <b>identifier</b>
4867   * <p>
4868   * Description: <b>External identifier for the activity definition</b><br>
4869   * Type: <b>token</b><br>
4870   * Path: <b>ActivityDefinition.identifier</b><br>
4871   * </p>
4872   */
4873  @SearchParamDefinition(name="identifier", path="ActivityDefinition.identifier", description="External identifier for the activity definition", type="token" )
4874  public static final String SP_IDENTIFIER = "identifier";
4875 /**
4876   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4877   * <p>
4878   * Description: <b>External identifier for the activity definition</b><br>
4879   * Type: <b>token</b><br>
4880   * Path: <b>ActivityDefinition.identifier</b><br>
4881   * </p>
4882   */
4883  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4884
4885 /**
4886   * Search parameter: <b>successor</b>
4887   * <p>
4888   * Description: <b>What resource is being referenced</b><br>
4889   * Type: <b>reference</b><br>
4890   * Path: <b>ActivityDefinition.relatedArtifact.resource</b><br>
4891   * </p>
4892   */
4893  @SearchParamDefinition(name="successor", path="ActivityDefinition.relatedArtifact.where(type='successor').resource", description="What resource is being referenced", type="reference" )
4894  public static final String SP_SUCCESSOR = "successor";
4895 /**
4896   * <b>Fluent Client</b> search parameter constant for <b>successor</b>
4897   * <p>
4898   * Description: <b>What resource is being referenced</b><br>
4899   * Type: <b>reference</b><br>
4900   * Path: <b>ActivityDefinition.relatedArtifact.resource</b><br>
4901   * </p>
4902   */
4903  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUCCESSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUCCESSOR);
4904
4905/**
4906   * Constant for fluent queries to be used to add include statements. Specifies
4907   * the path value of "<b>ActivityDefinition:successor</b>".
4908   */
4909  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUCCESSOR = new ca.uhn.fhir.model.api.Include("ActivityDefinition:successor").toLocked();
4910
4911 /**
4912   * Search parameter: <b>context-type-value</b>
4913   * <p>
4914   * Description: <b>A use context type and value assigned to the activity definition</b><br>
4915   * Type: <b>composite</b><br>
4916   * Path: <b></b><br>
4917   * </p>
4918   */
4919  @SearchParamDefinition(name="context-type-value", path="ActivityDefinition.useContext", description="A use context type and value assigned to the activity definition", type="composite", compositeOf={"context-type", "context"} )
4920  public static final String SP_CONTEXT_TYPE_VALUE = "context-type-value";
4921 /**
4922   * <b>Fluent Client</b> search parameter constant for <b>context-type-value</b>
4923   * <p>
4924   * Description: <b>A use context type and value assigned to the activity definition</b><br>
4925   * Type: <b>composite</b><br>
4926   * Path: <b></b><br>
4927   * </p>
4928   */
4929  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> CONTEXT_TYPE_VALUE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(SP_CONTEXT_TYPE_VALUE);
4930
4931 /**
4932   * Search parameter: <b>jurisdiction</b>
4933   * <p>
4934   * Description: <b>Intended jurisdiction for the activity definition</b><br>
4935   * Type: <b>token</b><br>
4936   * Path: <b>ActivityDefinition.jurisdiction</b><br>
4937   * </p>
4938   */
4939  @SearchParamDefinition(name="jurisdiction", path="ActivityDefinition.jurisdiction", description="Intended jurisdiction for the activity definition", type="token" )
4940  public static final String SP_JURISDICTION = "jurisdiction";
4941 /**
4942   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
4943   * <p>
4944   * Description: <b>Intended jurisdiction for the activity definition</b><br>
4945   * Type: <b>token</b><br>
4946   * Path: <b>ActivityDefinition.jurisdiction</b><br>
4947   * </p>
4948   */
4949  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
4950
4951 /**
4952   * Search parameter: <b>description</b>
4953   * <p>
4954   * Description: <b>The description of the activity definition</b><br>
4955   * Type: <b>string</b><br>
4956   * Path: <b>ActivityDefinition.description</b><br>
4957   * </p>
4958   */
4959  @SearchParamDefinition(name="description", path="ActivityDefinition.description", description="The description of the activity definition", type="string" )
4960  public static final String SP_DESCRIPTION = "description";
4961 /**
4962   * <b>Fluent Client</b> search parameter constant for <b>description</b>
4963   * <p>
4964   * Description: <b>The description of the activity definition</b><br>
4965   * Type: <b>string</b><br>
4966   * Path: <b>ActivityDefinition.description</b><br>
4967   * </p>
4968   */
4969  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
4970
4971 /**
4972   * Search parameter: <b>derived-from</b>
4973   * <p>
4974   * Description: <b>What resource is being referenced</b><br>
4975   * Type: <b>reference</b><br>
4976   * Path: <b>ActivityDefinition.relatedArtifact.resource</b><br>
4977   * </p>
4978   */
4979  @SearchParamDefinition(name="derived-from", path="ActivityDefinition.relatedArtifact.where(type='derived-from').resource", description="What resource is being referenced", type="reference" )
4980  public static final String SP_DERIVED_FROM = "derived-from";
4981 /**
4982   * <b>Fluent Client</b> search parameter constant for <b>derived-from</b>
4983   * <p>
4984   * Description: <b>What resource is being referenced</b><br>
4985   * Type: <b>reference</b><br>
4986   * Path: <b>ActivityDefinition.relatedArtifact.resource</b><br>
4987   * </p>
4988   */
4989  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DERIVED_FROM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DERIVED_FROM);
4990
4991/**
4992   * Constant for fluent queries to be used to add include statements. Specifies
4993   * the path value of "<b>ActivityDefinition:derived-from</b>".
4994   */
4995  public static final ca.uhn.fhir.model.api.Include INCLUDE_DERIVED_FROM = new ca.uhn.fhir.model.api.Include("ActivityDefinition:derived-from").toLocked();
4996
4997 /**
4998   * Search parameter: <b>context-type</b>
4999   * <p>
5000   * Description: <b>A type of use context assigned to the activity definition</b><br>
5001   * Type: <b>token</b><br>
5002   * Path: <b>ActivityDefinition.useContext.code</b><br>
5003   * </p>
5004   */
5005  @SearchParamDefinition(name="context-type", path="ActivityDefinition.useContext.code", description="A type of use context assigned to the activity definition", type="token" )
5006  public static final String SP_CONTEXT_TYPE = "context-type";
5007 /**
5008   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
5009   * <p>
5010   * Description: <b>A type of use context assigned to the activity definition</b><br>
5011   * Type: <b>token</b><br>
5012   * Path: <b>ActivityDefinition.useContext.code</b><br>
5013   * </p>
5014   */
5015  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT_TYPE);
5016
5017 /**
5018   * Search parameter: <b>predecessor</b>
5019   * <p>
5020   * Description: <b>What resource is being referenced</b><br>
5021   * Type: <b>reference</b><br>
5022   * Path: <b>ActivityDefinition.relatedArtifact.resource</b><br>
5023   * </p>
5024   */
5025  @SearchParamDefinition(name="predecessor", path="ActivityDefinition.relatedArtifact.where(type='predecessor').resource", description="What resource is being referenced", type="reference" )
5026  public static final String SP_PREDECESSOR = "predecessor";
5027 /**
5028   * <b>Fluent Client</b> search parameter constant for <b>predecessor</b>
5029   * <p>
5030   * Description: <b>What resource is being referenced</b><br>
5031   * Type: <b>reference</b><br>
5032   * Path: <b>ActivityDefinition.relatedArtifact.resource</b><br>
5033   * </p>
5034   */
5035  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PREDECESSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PREDECESSOR);
5036
5037/**
5038   * Constant for fluent queries to be used to add include statements. Specifies
5039   * the path value of "<b>ActivityDefinition:predecessor</b>".
5040   */
5041  public static final ca.uhn.fhir.model.api.Include INCLUDE_PREDECESSOR = new ca.uhn.fhir.model.api.Include("ActivityDefinition:predecessor").toLocked();
5042
5043 /**
5044   * Search parameter: <b>title</b>
5045   * <p>
5046   * Description: <b>The human-friendly name of the activity definition</b><br>
5047   * Type: <b>string</b><br>
5048   * Path: <b>ActivityDefinition.title</b><br>
5049   * </p>
5050   */
5051  @SearchParamDefinition(name="title", path="ActivityDefinition.title", description="The human-friendly name of the activity definition", type="string" )
5052  public static final String SP_TITLE = "title";
5053 /**
5054   * <b>Fluent Client</b> search parameter constant for <b>title</b>
5055   * <p>
5056   * Description: <b>The human-friendly name of the activity definition</b><br>
5057   * Type: <b>string</b><br>
5058   * Path: <b>ActivityDefinition.title</b><br>
5059   * </p>
5060   */
5061  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
5062
5063 /**
5064   * Search parameter: <b>composed-of</b>
5065   * <p>
5066   * Description: <b>What resource is being referenced</b><br>
5067   * Type: <b>reference</b><br>
5068   * Path: <b>ActivityDefinition.relatedArtifact.resource</b><br>
5069   * </p>
5070   */
5071  @SearchParamDefinition(name="composed-of", path="ActivityDefinition.relatedArtifact.where(type='composed-of').resource", description="What resource is being referenced", type="reference" )
5072  public static final String SP_COMPOSED_OF = "composed-of";
5073 /**
5074   * <b>Fluent Client</b> search parameter constant for <b>composed-of</b>
5075   * <p>
5076   * Description: <b>What resource is being referenced</b><br>
5077   * Type: <b>reference</b><br>
5078   * Path: <b>ActivityDefinition.relatedArtifact.resource</b><br>
5079   * </p>
5080   */
5081  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COMPOSED_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_COMPOSED_OF);
5082
5083/**
5084   * Constant for fluent queries to be used to add include statements. Specifies
5085   * the path value of "<b>ActivityDefinition:composed-of</b>".
5086   */
5087  public static final ca.uhn.fhir.model.api.Include INCLUDE_COMPOSED_OF = new ca.uhn.fhir.model.api.Include("ActivityDefinition:composed-of").toLocked();
5088
5089 /**
5090   * Search parameter: <b>version</b>
5091   * <p>
5092   * Description: <b>The business version of the activity definition</b><br>
5093   * Type: <b>token</b><br>
5094   * Path: <b>ActivityDefinition.version</b><br>
5095   * </p>
5096   */
5097  @SearchParamDefinition(name="version", path="ActivityDefinition.version", description="The business version of the activity definition", type="token" )
5098  public static final String SP_VERSION = "version";
5099 /**
5100   * <b>Fluent Client</b> search parameter constant for <b>version</b>
5101   * <p>
5102   * Description: <b>The business version of the activity definition</b><br>
5103   * Type: <b>token</b><br>
5104   * Path: <b>ActivityDefinition.version</b><br>
5105   * </p>
5106   */
5107  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
5108
5109 /**
5110   * Search parameter: <b>url</b>
5111   * <p>
5112   * Description: <b>The uri that identifies the activity definition</b><br>
5113   * Type: <b>uri</b><br>
5114   * Path: <b>ActivityDefinition.url</b><br>
5115   * </p>
5116   */
5117  @SearchParamDefinition(name="url", path="ActivityDefinition.url", description="The uri that identifies the activity definition", type="uri" )
5118  public static final String SP_URL = "url";
5119 /**
5120   * <b>Fluent Client</b> search parameter constant for <b>url</b>
5121   * <p>
5122   * Description: <b>The uri that identifies the activity definition</b><br>
5123   * Type: <b>uri</b><br>
5124   * Path: <b>ActivityDefinition.url</b><br>
5125   * </p>
5126   */
5127  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
5128
5129 /**
5130   * Search parameter: <b>context-quantity</b>
5131   * <p>
5132   * Description: <b>A quantity- or range-valued use context assigned to the activity definition</b><br>
5133   * Type: <b>quantity</b><br>
5134   * Path: <b>ActivityDefinition.useContext.valueQuantity, ActivityDefinition.useContext.valueRange</b><br>
5135   * </p>
5136   */
5137  @SearchParamDefinition(name="context-quantity", path="(ActivityDefinition.useContext.value as Quantity) | (ActivityDefinition.useContext.value as Range)", description="A quantity- or range-valued use context assigned to the activity definition", type="quantity" )
5138  public static final String SP_CONTEXT_QUANTITY = "context-quantity";
5139 /**
5140   * <b>Fluent Client</b> search parameter constant for <b>context-quantity</b>
5141   * <p>
5142   * Description: <b>A quantity- or range-valued use context assigned to the activity definition</b><br>
5143   * Type: <b>quantity</b><br>
5144   * Path: <b>ActivityDefinition.useContext.valueQuantity, ActivityDefinition.useContext.valueRange</b><br>
5145   * </p>
5146   */
5147  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam CONTEXT_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_CONTEXT_QUANTITY);
5148
5149 /**
5150   * Search parameter: <b>effective</b>
5151   * <p>
5152   * Description: <b>The time during which the activity definition is intended to be in use</b><br>
5153   * Type: <b>date</b><br>
5154   * Path: <b>ActivityDefinition.effectivePeriod</b><br>
5155   * </p>
5156   */
5157  @SearchParamDefinition(name="effective", path="ActivityDefinition.effectivePeriod", description="The time during which the activity definition is intended to be in use", type="date" )
5158  public static final String SP_EFFECTIVE = "effective";
5159 /**
5160   * <b>Fluent Client</b> search parameter constant for <b>effective</b>
5161   * <p>
5162   * Description: <b>The time during which the activity definition is intended to be in use</b><br>
5163   * Type: <b>date</b><br>
5164   * Path: <b>ActivityDefinition.effectivePeriod</b><br>
5165   * </p>
5166   */
5167  public static final ca.uhn.fhir.rest.gclient.DateClientParam EFFECTIVE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EFFECTIVE);
5168
5169 /**
5170   * Search parameter: <b>depends-on</b>
5171   * <p>
5172   * Description: <b>What resource is being referenced</b><br>
5173   * Type: <b>reference</b><br>
5174   * Path: <b>ActivityDefinition.relatedArtifact.resource, ActivityDefinition.library</b><br>
5175   * </p>
5176   */
5177  @SearchParamDefinition(name="depends-on", path="ActivityDefinition.relatedArtifact.where(type='depends-on').resource | ActivityDefinition.library", description="What resource is being referenced", type="reference" )
5178  public static final String SP_DEPENDS_ON = "depends-on";
5179 /**
5180   * <b>Fluent Client</b> search parameter constant for <b>depends-on</b>
5181   * <p>
5182   * Description: <b>What resource is being referenced</b><br>
5183   * Type: <b>reference</b><br>
5184   * Path: <b>ActivityDefinition.relatedArtifact.resource, ActivityDefinition.library</b><br>
5185   * </p>
5186   */
5187  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEPENDS_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEPENDS_ON);
5188
5189/**
5190   * Constant for fluent queries to be used to add include statements. Specifies
5191   * the path value of "<b>ActivityDefinition:depends-on</b>".
5192   */
5193  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEPENDS_ON = new ca.uhn.fhir.model.api.Include("ActivityDefinition:depends-on").toLocked();
5194
5195 /**
5196   * Search parameter: <b>name</b>
5197   * <p>
5198   * Description: <b>Computationally friendly name of the activity definition</b><br>
5199   * Type: <b>string</b><br>
5200   * Path: <b>ActivityDefinition.name</b><br>
5201   * </p>
5202   */
5203  @SearchParamDefinition(name="name", path="ActivityDefinition.name", description="Computationally friendly name of the activity definition", type="string" )
5204  public static final String SP_NAME = "name";
5205 /**
5206   * <b>Fluent Client</b> search parameter constant for <b>name</b>
5207   * <p>
5208   * Description: <b>Computationally friendly name of the activity definition</b><br>
5209   * Type: <b>string</b><br>
5210   * Path: <b>ActivityDefinition.name</b><br>
5211   * </p>
5212   */
5213  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
5214
5215 /**
5216   * Search parameter: <b>context</b>
5217   * <p>
5218   * Description: <b>A use context assigned to the activity definition</b><br>
5219   * Type: <b>token</b><br>
5220   * Path: <b>ActivityDefinition.useContext.valueCodeableConcept</b><br>
5221   * </p>
5222   */
5223  @SearchParamDefinition(name="context", path="(ActivityDefinition.useContext.value as CodeableConcept)", description="A use context assigned to the activity definition", type="token" )
5224  public static final String SP_CONTEXT = "context";
5225 /**
5226   * <b>Fluent Client</b> search parameter constant for <b>context</b>
5227   * <p>
5228   * Description: <b>A use context assigned to the activity definition</b><br>
5229   * Type: <b>token</b><br>
5230   * Path: <b>ActivityDefinition.useContext.valueCodeableConcept</b><br>
5231   * </p>
5232   */
5233  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT);
5234
5235 /**
5236   * Search parameter: <b>publisher</b>
5237   * <p>
5238   * Description: <b>Name of the publisher of the activity definition</b><br>
5239   * Type: <b>string</b><br>
5240   * Path: <b>ActivityDefinition.publisher</b><br>
5241   * </p>
5242   */
5243  @SearchParamDefinition(name="publisher", path="ActivityDefinition.publisher", description="Name of the publisher of the activity definition", type="string" )
5244  public static final String SP_PUBLISHER = "publisher";
5245 /**
5246   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
5247   * <p>
5248   * Description: <b>Name of the publisher of the activity definition</b><br>
5249   * Type: <b>string</b><br>
5250   * Path: <b>ActivityDefinition.publisher</b><br>
5251   * </p>
5252   */
5253  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
5254
5255 /**
5256   * Search parameter: <b>topic</b>
5257   * <p>
5258   * Description: <b>Topics associated with the module</b><br>
5259   * Type: <b>token</b><br>
5260   * Path: <b>ActivityDefinition.topic</b><br>
5261   * </p>
5262   */
5263  @SearchParamDefinition(name="topic", path="ActivityDefinition.topic", description="Topics associated with the module", type="token" )
5264  public static final String SP_TOPIC = "topic";
5265 /**
5266   * <b>Fluent Client</b> search parameter constant for <b>topic</b>
5267   * <p>
5268   * Description: <b>Topics associated with the module</b><br>
5269   * Type: <b>token</b><br>
5270   * Path: <b>ActivityDefinition.topic</b><br>
5271   * </p>
5272   */
5273  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC);
5274
5275 /**
5276   * Search parameter: <b>context-type-quantity</b>
5277   * <p>
5278   * Description: <b>A use context type and quantity- or range-based value assigned to the activity definition</b><br>
5279   * Type: <b>composite</b><br>
5280   * Path: <b></b><br>
5281   * </p>
5282   */
5283  @SearchParamDefinition(name="context-type-quantity", path="ActivityDefinition.useContext", description="A use context type and quantity- or range-based value assigned to the activity definition", type="composite", compositeOf={"context-type", "context-quantity"} )
5284  public static final String SP_CONTEXT_TYPE_QUANTITY = "context-type-quantity";
5285 /**
5286   * <b>Fluent Client</b> search parameter constant for <b>context-type-quantity</b>
5287   * <p>
5288   * Description: <b>A use context type and quantity- or range-based value assigned to the activity definition</b><br>
5289   * Type: <b>composite</b><br>
5290   * Path: <b></b><br>
5291   * </p>
5292   */
5293  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam> CONTEXT_TYPE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam>(SP_CONTEXT_TYPE_QUANTITY);
5294
5295 /**
5296   * Search parameter: <b>status</b>
5297   * <p>
5298   * Description: <b>The current status of the activity definition</b><br>
5299   * Type: <b>token</b><br>
5300   * Path: <b>ActivityDefinition.status</b><br>
5301   * </p>
5302   */
5303  @SearchParamDefinition(name="status", path="ActivityDefinition.status", description="The current status of the activity definition", type="token" )
5304  public static final String SP_STATUS = "status";
5305 /**
5306   * <b>Fluent Client</b> search parameter constant for <b>status</b>
5307   * <p>
5308   * Description: <b>The current status of the activity definition</b><br>
5309   * Type: <b>token</b><br>
5310   * Path: <b>ActivityDefinition.status</b><br>
5311   * </p>
5312   */
5313  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
5314
5315
5316}