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