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