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