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