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