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