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