R6 Ballot (2nd Draft)

Publish-box (todo)

12.22 Resource ActivityDefinition - Content

Clinical Decision Support icon Work GroupMaturity Level: 4 Trial UseSecurity Category: Anonymous Compartments: No defined compartments

This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.

This resource is a definition resource from a FHIR workflow perspective - see Workflow, specifically Definition.

An ActivityDefinition is a shareable, consumable description of some activity to be performed. It may be used to specify actions to be taken as part of a workflow, order set, or protocol, or it may be used independently as part of a catalog of activities such as orderables.

For more information on how activity definitions can be used to construct request resources, see the Applying an ActivityDefinition topic below.

In general, an activity definition is simply a conceptual description of some specific action that should be taken. An instance of an ActivityDefinition does not indicate that any action has been performed (as an event resource does), nor does it indicate the actual intent to carry out any particular action (as a request resource does). Instead, an activity definition provides a reusable template that can be used to construct specific request resources such as ServiceRequest and MedicationRequest.

Note that this is conceptually similar to the Task resource as well, with the distinction being that ActivityDefinition represents the description of a task in the abstract, while the Task resource is used to track a specific instance of a task as it moves through the steps of a workflow.

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. ActivityDefinition TU DomainResource The definition of a specific activity to be taken, independent of any particular patient or context
+ Warning: Name should be usable as an identifier for the module by machine processing applications such as code generation

Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension
Interfaces Implemented: MetadataResource
... url ΣC 0..1 uri Canonical identifier for this activity definition, represented as a URI (globally unique)
+ Warning: URL should not contain | or # - these characters make processing canonical references problematic
... identifier Σ 0..* Identifier Additional identifier for the activity definition

... version Σ 0..1 string Business version of the activity definition
... versionAlgorithm[x] Σ 0..1 How to compare versions
Binding: Version Algorithm (Extensible)
.... versionAlgorithmString string
.... versionAlgorithmCoding Coding
... name ΣC 0..1 string Name for this activity definition (computer friendly)
... title ΣT 0..1 string Name for this activity definition (human friendly)
... subtitle T 0..1 string Subordinate title of the activity definition
... status ?!Σ 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (Required)
... experimental Σ 0..1 boolean For testing purposes, not real usage
... subject[x] 0..1 Type of individual the activity definition is intended for
Binding: Participant Resource Types (Extensible)
.... subjectCodeableConcept CodeableConcept
.... subjectReference Reference(Group | MedicinalProductDefinition | SubstanceDefinition | AdministrableProductDefinition | ManufacturedItemDefinition | PackagedProductDefinition)
.... subjectCanonical canonical(EvidenceVariable)
... date Σ 0..1 dateTime Date last changed
... publisher ΣT 0..1 string Name of the publisher/steward (organization or individual)
... contact Σ 0..* ContactDetail Contact details for the publisher

... description ΣT 0..1 markdown Natural language description of the activity definition
... useContext Σ 0..* UsageContext The context that the content is intended to support

... jurisdiction ΣXD 0..* CodeableConcept Intended jurisdiction for activity definition (if applicable)
Binding: Jurisdiction ValueSet (Extensible)

... purpose T 0..1 markdown Why this activity definition is defined
... usage T 0..1 markdown Describes the clinical usage of the activity definition
... copyright T 0..1 markdown Use and/or publishing restrictions
... copyrightLabel T 0..1 string Copyright holder and year(s)
... approvalDate 0..1 date When the activity definition was approved by publisher
... lastReviewDate 0..1 date When the activity definition was last reviewed by the publisher
... effectivePeriod Σ 0..1 Period When the activity definition is expected to be used
... topic XD 0..* CodeableConcept E.g. Education, Treatment, Assessment, etc
Binding: Definition Topic (Example)

... author 0..* ContactDetail Who authored the content

... editor 0..* ContactDetail Who edited the content

... reviewer 0..* ContactDetail Who reviewed the content

... endorser 0..* ContactDetail Who endorsed the content

... relatedArtifact 0..* RelatedArtifact Additional documentation, citations, etc

... library 0..* canonical(Library) Logic used by the activity definition

... kind Σ 0..1 code Kind of resource
Binding: Request Resource Types (Required)
... profile 0..1 canonical(StructureDefinition) What profile the resource needs to conform to
... code Σ 0..1 CodeableConcept Detail type of activity
Binding: Procedure Codes (SNOMED CT) (Example)
... intent 0..1 code proposal | plan | directive | order | original-order | reflex-order | filler-order | instance-order | option
Binding: RequestIntent (Required)
... priority 0..1 code routine | urgent | asap | stat
Binding: RequestPriority (Required)
... doNotPerform ?!Σ 0..1 boolean True if the activity should not be performed
... timing[x] 0..1 When activity is to occur
.... timingTiming Timing
.... timingAge Age
.... timingRange Range
.... timingDuration Duration
... asNeeded[x] Σ 0..1 Preconditions for service
Binding: SNOMED CT Medication As Needed Reason Codes (Example)
.... asNeededBoolean boolean
.... asNeededCodeableConcept CodeableConcept
... location 0..1 CodeableReference(Location) Where it should happen
... participant 0..* BackboneElement Who should participate in the action

.... type 0..1 code careteam | device | group | healthcareservice | location | organization | patient | practitioner | practitionerrole | relatedperson
Binding: Action Participant Type (Required)
.... typeCanonical 0..1 canonical(CapabilityStatement) Who or what can participate
.... typeReference 0..1 Reference(CareTeam | Device | DeviceDefinition | Endpoint | Group | HealthcareService | Location | Organization | Patient | Practitioner | PractitionerRole | RelatedPerson) Who or what can participate
.... role 0..1 CodeableConcept E.g. Nurse, Surgeon, Parent, etc
Binding: Action Participant Role icon (Example)
.... function 0..1 CodeableConcept E.g. Author, Reviewer, Witness, etc
Binding: Action Participant Function (Example)
... product[x] 0..1 What's administered/supplied
Binding: SNOMED CT Medication Codes (Example)
.... productReference Reference(Medication | Ingredient | Substance | SubstanceDefinition)
.... productCodeableConcept CodeableConcept
... quantity 0..1 SimpleQuantity How much is administered/consumed/supplied
... dosage 0..* Dosage Detailed dosage instructions

... bodySite 0..* CodeableConcept What part of body to perform on
Binding: SNOMED CT Body Structures (Example)

... specimenRequirement 0..* canonical(SpecimenDefinition) What specimens are required to perform this action

... observationRequirement 0..* canonical(ObservationDefinition) What observations are required to perform this action

... observationResultRequirement 0..* canonical(ObservationDefinition) What observations must be produced by this action

... transform 0..1 canonical(StructureMap) Transform to apply the template
... dynamicValue 0..* BackboneElement Dynamic aspects of the definition

.... path 1..1 string The path to the element to be set dynamically
.... expression 1..1 Expression An expression that provides the dynamic value for the customization

doco Documentation for this format icon

See the Extensions for this resource

UML Diagram (Legend)

ActivityDefinition (DomainResource) +MetadataResourceAn absolute URI that is used to identify this activity definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which an authoritative instance of this activity definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the activity definition is stored on different serversurl : uri [0..1]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 instanceidentifier : Identifier [0..*]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 assetsversion : string [0..1]Indicates the mechanism used to compare versions to determine which is more currentversionAlgorithm[x] : DataType [0..1] « string|Coding; null (Strength=Extensible) VersionAlgorithm+ »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 generationname : string [0..1] « This element has or is affected by some invariantsC »A short, descriptive, user-friendly title for the activity definitiontitle : string [0..1]An explanatory or alternate title for the activity definition giving additional information about its contentsubtitle : string [0..1]The status of this activity definition. Enables tracking the life-cycle of the content (this element modifies the meaning of other elements)status : code [1..1] « null (Strength=Required)PublicationStatus! »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 usageexperimental : boolean [0..1]A code, group definition, or canonical reference that describes or identifies the intended subject of the activity being defined. Canonical references are allowed to support the definition of protocols for drug and substance quality specifications, and is allowed to reference a MedicinalProductDefinition, SubstanceDefinition, AdministrableProductDefinition, ManufacturedItemDefinition, or PackagedProductDefinition resourcesubject[x] : DataType [0..1] « CodeableConcept|Reference(Group| MedicinalProductDefinition|SubstanceDefinition| AdministrableProductDefinition|ManufacturedItemDefinition| PackagedProductDefinition)|canonical(EvidenceVariable); null (Strength=Extensible) ParticipantResourceTypes+ »The date (and optionally time) when the activity definition was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the activity definition changesdate : dateTime [0..1]The name of the organization or individual responsible for the release and ongoing maintenance of the activity definitionpublisher : string [0..1]Contact details to assist a user in finding and communicating with the publishercontact : ContactDetail [0..*]A free text natural language description of the activity definition from a consumer's perspectivedescription : markdown [0..1]The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate activity definition instancesuseContext : UsageContext [0..*]A legal or geographic region in which the activity definition is intended to be usedjurisdiction : CodeableConcept [0..*] « null (Strength=Extensible)JurisdictionValueSet+ »Explanation of why this activity definition is needed and why it has been designed as it haspurpose : markdown [0..1]A detailed description of how the activity definition is used from a clinical perspectiveusage : markdown [0..1]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 definitioncopyright : markdown [0..1]A short string (<50 characters), suitable for inclusion in a page footer that identifies the copyright holder, effective period, and optionally whether rights are resctricted. (e.g. 'All rights reserved', 'Some rights reserved')copyrightLabel : string [0..1]The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usageapprovalDate : date [0..1]The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval datelastReviewDate : date [0..1]The period during which the activity definition content was or is planned to be in active useeffectivePeriod : Period [0..1]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 searchingtopic : CodeableConcept [0..*] « null (Strength=Example)DefinitionTopic?? »An individiual or organization primarily involved in the creation and maintenance of the contentauthor : ContactDetail [0..*]An individual or organization primarily responsible for internal coherence of the contenteditor : ContactDetail [0..*]An individual or organization asserted by the publisher to be primarily responsible for review of some aspect of the contentreviewer : ContactDetail [0..*]An individual or organization asserted by the publisher to be responsible for officially endorsing the content for use in some settingendorser : ContactDetail [0..*]Related artifacts such as additional documentation, justification, or bibliographic referencesrelatedArtifact : RelatedArtifact [0..*]A reference to a Library resource containing any formal logic used by the activity definitionlibrary : canonical [0..*] « Library »A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequestkind : code [0..1] « null (Strength=Required)RequestResourceTypes! »A profile to which the target of the activity definition is expected to conformprofile : canonical [0..1] « StructureDefinition »Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encountercode : CodeableConcept [0..1] « null (Strength=Example)ProcedureCodesSNOMEDCT?? »Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chainintent : code [0..1] « null (Strength=Required)RequestIntent! »Indicates how quickly the activity should be addressed with respect to other requestspriority : code [0..1] « null (Strength=Required)RequestPriority! »Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action (this element modifies the meaning of other elements)doNotPerform : boolean [0..1]The timing or frequency upon which the described activity is to occurtiming[x] : DataType [0..1] « Timing|Age|Range|Duration »If a CodeableConcept is present, it indicates the pre-condition for performing the service. For example "pain", "on flare-up", etcasNeeded[x] : DataType [0..1] « boolean|CodeableConcept; null (Strength=Example) SNOMEDCTMedicationAsNeededRea...?? »Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etclocation : CodeableReference [0..1] « Location »Identifies the food, drug or other product being consumed or supplied in the activityproduct[x] : DataType [0..1] « Reference(Medication|Ingredient| Substance|SubstanceDefinition)|CodeableConcept; null (Strength=Example) SNOMEDCTMedicationCodes?? »Identifies the quantity expected to be consumed at once (per dose, per meal, etc.)quantity : Quantity(SimpleQuantity) [0..1]Provides detailed dosage instructions in the same way that they are described for MedicationRequest resourcesdosage : Dosage [0..*]Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites)bodySite : CodeableConcept [0..*] « null (Strength=Example)SNOMEDCTBodyStructures?? »Defines specimen requirements for the action to be performed, such as required specimens for a lab testspecimenRequirement : canonical [0..*] « SpecimenDefinition »Defines observation requirements for the action to be performed, such as body weight or surface areaobservationRequirement : canonical [0..*] « ObservationDefinition »Defines the observations that are expected to be produced by the actionobservationResultRequirement : canonical [0..*] « ObservationDefinition »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 inputtransform : canonical [0..1] « StructureMap »ParticipantThe type of participant in the actiontype : code [0..1] « null (Strength=Required)ActionParticipantType! »The type of participant in the actiontypeCanonical : canonical [0..1] « CapabilityStatement »The type of participant in the actiontypeReference : Reference [0..1] « CareTeam|Device|DeviceDefinition| Endpoint|Group|HealthcareService|Location|Organization|Patient| Practitioner|PractitionerRole|RelatedPerson »The role the participant should play in performing the described actionrole : CodeableConcept [0..1] « null (Strength=Example)ActionParticipantRole?? »Indicates how the actor will be involved in the action - author, reviewer, witness, etcfunction : CodeableConcept [0..1] « null (Strength=Example)ActionParticipantFunction?? »DynamicValueThe path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolvable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details)path : string [1..1]An expression specifying the value of the customized elementexpression : Expression [1..1]Indicates who should participate in performing the action describedparticipant[0..*]Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the request resource that would contain the resultdynamicValue[0..*]

XML Template

<ActivityDefinition xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <url value="[uri]"/><!-- 0..1 Canonical identifier for this activity definition, represented as a URI (globally unique) -->
 <identifier><!-- 0..* Identifier Additional identifier for the activity definition --></identifier>
 <version value="[string]"/><!-- 0..1 Business version of the activity definition -->
 <versionAlgorithm[x]><!-- 0..1 string|Coding How to compare versions --></versionAlgorithm[x]>
 <name value="[string]"/><!-- I 0..1 Name for this activity definition (computer friendly) -->
 <title value="[string]"/><!-- 0..1 Name for this activity definition (human friendly) -->
 <subtitle value="[string]"/><!-- 0..1 Subordinate title of the activity definition -->
 <status value="[code]"/><!-- 1..1 draft | active | retired | unknown -->
 <experimental value="[boolean]"/><!-- 0..1 For testing purposes, not real usage -->
 <subject[x]><!-- 0..1 CodeableConcept|Reference(AdministrableProductDefinition|
   Group|ManufacturedItemDefinition|MedicinalProductDefinition|
   PackagedProductDefinition|SubstanceDefinition)|canonical(EvidenceVariable) Type of individual the activity definition is intended for --></subject[x]>
 <date value="[dateTime]"/><!-- 0..1 Date last changed -->
 <publisher value="[string]"/><!-- 0..1 Name of the publisher/steward (organization or individual) -->
 <contact><!-- 0..* ContactDetail Contact details for the publisher --></contact>
 <description value="[markdown]"/><!-- 0..1 Natural language description of the activity definition -->
 <useContext><!-- 0..* UsageContext The context that the content is intended to support --></useContext>
 <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction for activity definition (if applicable) --></jurisdiction>
 <purpose value="[markdown]"/><!-- 0..1 Why this activity definition is defined -->
 <usage value="[markdown]"/><!-- 0..1 Describes the clinical usage of the activity definition -->
 <copyright value="[markdown]"/><!-- 0..1 Use and/or publishing restrictions -->
 <copyrightLabel value="[string]"/><!-- 0..1 Copyright holder and year(s) -->
 <approvalDate value="[date]"/><!-- 0..1 When the activity definition was approved by publisher -->
 <lastReviewDate value="[date]"/><!-- 0..1 When the activity definition was last reviewed by the publisher -->
 <effectivePeriod><!-- 0..1 Period When the activity definition is expected to be used --></effectivePeriod>
 <topic><!-- 0..* CodeableConcept E.g. Education, Treatment, Assessment, etc --></topic>
 <author><!-- 0..* ContactDetail Who authored the content --></author>
 <editor><!-- 0..* ContactDetail Who edited the content --></editor>
 <reviewer><!-- 0..* ContactDetail Who reviewed the content --></reviewer>
 <endorser><!-- 0..* ContactDetail Who endorsed the content --></endorser>
 <relatedArtifact><!-- 0..* RelatedArtifact Additional documentation, citations, etc --></relatedArtifact>
 <library><!-- 0..* canonical(Library) Logic used by the activity definition --></library>
 <kind value="[code]"/><!-- 0..1 Kind of resource -->
 <profile><!-- 0..1 canonical(StructureDefinition) What profile the resource needs to conform to --></profile>
 <code><!-- 0..1 CodeableConcept Detail type of activity --></code>
 <intent value="[code]"/><!-- 0..1 proposal | plan | directive | order | original-order | reflex-order | filler-order | instance-order | option -->
 <priority value="[code]"/><!-- 0..1 routine | urgent | asap | stat -->
 <doNotPerform value="[boolean]"/><!-- 0..1 True if the activity should not be performed -->
 <timing[x]><!-- 0..1 Timing|Age|Range|Duration When activity is to occur --></timing[x]>
 <asNeeded[x]><!-- 0..1 boolean|CodeableConcept Preconditions for service --></asNeeded[x]>
 <location><!-- 0..1 CodeableReference(Location) Where it should happen --></location>
 <participant>  <!-- 0..* Who should participate in the action -->
  <type value="[code]"/><!-- 0..1 careteam | device | group | healthcareservice | location | organization | patient | practitioner | practitionerrole | relatedperson -->
  <typeCanonical><!-- 0..1 canonical(CapabilityStatement) Who or what can participate --></typeCanonical>
  <typeReference><!-- 0..1 Reference(CareTeam|Device|DeviceDefinition|Endpoint|
    Group|HealthcareService|Location|Organization|Patient|Practitioner|
    PractitionerRole|RelatedPerson) Who or what can participate --></typeReference>
  <role><!-- 0..1 CodeableConcept E.g. Nurse, Surgeon, Parent, etc icon --></role>
  <function><!-- 0..1 CodeableConcept E.g. Author, Reviewer, Witness, etc --></function>
 </participant>
 <product[x]><!-- 0..1 Reference(Ingredient|Medication|Substance|
   SubstanceDefinition)|CodeableConcept What's administered/supplied --></product[x]>
 <quantity><!-- 0..1 Quantity(SimpleQuantity) How much is administered/consumed/supplied --></quantity>
 <dosage><!-- 0..* Dosage Detailed dosage instructions --></dosage>
 <bodySite><!-- 0..* CodeableConcept What part of body to perform on --></bodySite>
 <specimenRequirement><!-- 0..* canonical(SpecimenDefinition) What specimens are required to perform this action --></specimenRequirement>
 <observationRequirement><!-- 0..* canonical(ObservationDefinition) What observations are required to perform this action --></observationRequirement>
 <observationResultRequirement><!-- 0..* canonical(ObservationDefinition) What observations must be produced by this action --></observationResultRequirement>
 <transform><!-- 0..1 canonical(StructureMap) Transform to apply the template --></transform>
 <dynamicValue>  <!-- 0..* Dynamic aspects of the definition -->
  <path value="[string]"/><!-- 1..1 The path to the element to be set dynamically -->
  <expression><!-- 1..1 Expression An expression that provides the dynamic value for the customization --></expression>
 </dynamicValue>
</ActivityDefinition>

JSON Template

{doco
  "resourceType" : "ActivityDefinition",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "url" : "<uri>", // Canonical identifier for this activity definition, represented as a URI (globally unique)
  "identifier" : [{ Identifier }], // Additional identifier for the activity definition
  "version" : "<string>", // Business version of the activity definition
  // versionAlgorithm[x]: How to compare versions. One of these 2:
  "versionAlgorithmString" : "<string>",
  "versionAlgorithmCoding" : { Coding },
  "name" : "<string>", // I Name for this activity definition (computer friendly)
  "title" : "<string>", // Name for this activity definition (human friendly)
  "subtitle" : "<string>", // Subordinate title of the activity definition
  "status" : "<code>", // R!  draft | active | retired | unknown
  "experimental" : <boolean>, // For testing purposes, not real usage
  // subject[x]: Type of individual the activity definition is intended for. One of these 3:
  "subjectCodeableConcept" : { CodeableConcept },
  "subjectReference" : { Reference(AdministrableProductDefinition|Group|
   ManufacturedItemDefinition|MedicinalProductDefinition|
   PackagedProductDefinition|SubstanceDefinition) },
  "subjectCanonical" : "<canonical(EvidenceVariable)>",
  "date" : "<dateTime>", // Date last changed
  "publisher" : "<string>", // Name of the publisher/steward (organization or individual)
  "contact" : [{ ContactDetail }], // Contact details for the publisher
  "description" : "<markdown>", // Natural language description of the activity definition
  "useContext" : [{ UsageContext }], // The context that the content is intended to support
  "jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction for activity definition (if applicable)
  "purpose" : "<markdown>", // Why this activity definition is defined
  "usage" : "<markdown>", // Describes the clinical usage of the activity definition
  "copyright" : "<markdown>", // Use and/or publishing restrictions
  "copyrightLabel" : "<string>", // Copyright holder and year(s)
  "approvalDate" : "<date>", // When the activity definition was approved by publisher
  "lastReviewDate" : "<date>", // When the activity definition was last reviewed by the publisher
  "effectivePeriod" : { Period }, // When the activity definition is expected to be used
  "topic" : [{ CodeableConcept }], // E.g. Education, Treatment, Assessment, etc
  "author" : [{ ContactDetail }], // Who authored the content
  "editor" : [{ ContactDetail }], // Who edited the content
  "reviewer" : [{ ContactDetail }], // Who reviewed the content
  "endorser" : [{ ContactDetail }], // Who endorsed the content
  "relatedArtifact" : [{ RelatedArtifact }], // Additional documentation, citations, etc
  "library" : ["<canonical(Library)>"], // Logic used by the activity definition
  "kind" : "<code>", // Kind of resource
  "profile" : "<canonical(StructureDefinition)>", // What profile the resource needs to conform to
  "code" : { CodeableConcept }, // Detail type of activity
  "intent" : "<code>", // proposal | plan | directive | order | original-order | reflex-order | filler-order | instance-order | option
  "priority" : "<code>", // routine | urgent | asap | stat
  "doNotPerform" : <boolean>, // True if the activity should not be performed
  // timing[x]: When activity is to occur. One of these 4:
  "timingTiming" : { Timing },
  "timingAge" : { Age },
  "timingRange" : { Range },
  "timingDuration" : { Duration },
  // asNeeded[x]: Preconditions for service. One of these 2:
  "asNeededBoolean" : <boolean>,
  "asNeededCodeableConcept" : { CodeableConcept },
  "location" : { CodeableReference(Location) }, // Where it should happen
  "participant" : [{ // Who should participate in the action
    "type" : "<code>", // careteam | device | group | healthcareservice | location | organization | patient | practitioner | practitionerrole | relatedperson
    "typeCanonical" : "<canonical(CapabilityStatement)>", // Who or what can participate
    "typeReference" : { Reference(CareTeam|Device|DeviceDefinition|Endpoint|
    Group|HealthcareService|Location|Organization|Patient|Practitioner|
    PractitionerRole|RelatedPerson) }, // Who or what can participate
    "role" : { CodeableConcept }, // E.g. Nurse, Surgeon, Parent, etc icon
    "function" : { CodeableConcept } // E.g. Author, Reviewer, Witness, etc
  }],
  // product[x]: What's administered/supplied. One of these 2:
  "productReference" : { Reference(Ingredient|Medication|Substance|
   SubstanceDefinition) },
  "productCodeableConcept" : { CodeableConcept },
  "quantity" : { Quantity(SimpleQuantity) }, // How much is administered/consumed/supplied
  "dosage" : [{ Dosage }], // Detailed dosage instructions
  "bodySite" : [{ CodeableConcept }], // What part of body to perform on
  "specimenRequirement" : ["<canonical(SpecimenDefinition)>"], // What specimens are required to perform this action
  "observationRequirement" : ["<canonical(ObservationDefinition)>"], // What observations are required to perform this action
  "observationResultRequirement" : ["<canonical(ObservationDefinition)>"], // What observations must be produced by this action
  "transform" : "<canonical(StructureMap)>", // Transform to apply the template
  "dynamicValue" : [{ // Dynamic aspects of the definition
    "path" : "<string>", // R!  The path to the element to be set dynamically
    "expression" : { Expression } // R!  An expression that provides the dynamic value for the customization
  }]
}

Turtle Template

@prefix fhir: <http://hl7.org/fhir/> .doco


[ a fhir:ActivityDefinition;
  fhir:nodeRole fhir:treeRoot; # if this is the parser root

  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:url [ uri ] ; # 0..1 Canonical identifier for this activity definition, represented as a URI (globally unique)
  fhir:identifier  ( [ Identifier ] ... ) ; # 0..* Additional identifier for the activity definition
  fhir:version [ string ] ; # 0..1 Business version of the activity definition
  # versionAlgorithm[x] : 0..1 How to compare versions. One of these 2
    fhir:versionAlgorithm [  a fhir:string ; string ]
    fhir:versionAlgorithm [  a fhir:Coding ; Coding ]
  fhir:name [ string ] ; # 0..1 I Name for this activity definition (computer friendly)
  fhir:title [ string ] ; # 0..1 Name for this activity definition (human friendly)
  fhir:subtitle [ string ] ; # 0..1 Subordinate title of the activity definition
  fhir:status [ code ] ; # 1..1 draft | active | retired | unknown
  fhir:experimental [ boolean ] ; # 0..1 For testing purposes, not real usage
  # subject[x] : 0..1 Type of individual the activity definition is intended for. One of these 3
    fhir:subject [  a fhir:CodeableConcept ; CodeableConcept ]
    fhir:subject [  a fhir:Reference ; Reference(AdministrableProductDefinition|Group|ManufacturedItemDefinition|
  MedicinalProductDefinition|PackagedProductDefinition|SubstanceDefinition) ]
    fhir:subject [  a fhir:canonical ; canonical(EvidenceVariable) ]
  fhir:date [ dateTime ] ; # 0..1 Date last changed
  fhir:publisher [ string ] ; # 0..1 Name of the publisher/steward (organization or individual)
  fhir:contact  ( [ ContactDetail ] ... ) ; # 0..* Contact details for the publisher
  fhir:description [ markdown ] ; # 0..1 Natural language description of the activity definition
  fhir:useContext  ( [ UsageContext ] ... ) ; # 0..* The context that the content is intended to support
  fhir:jurisdiction  ( [ CodeableConcept ] ... ) ; # 0..* Intended jurisdiction for activity definition (if applicable)
  fhir:purpose [ markdown ] ; # 0..1 Why this activity definition is defined
  fhir:usage [ markdown ] ; # 0..1 Describes the clinical usage of the activity definition
  fhir:copyright [ markdown ] ; # 0..1 Use and/or publishing restrictions
  fhir:copyrightLabel [ string ] ; # 0..1 Copyright holder and year(s)
  fhir:approvalDate [ date ] ; # 0..1 When the activity definition was approved by publisher
  fhir:lastReviewDate [ date ] ; # 0..1 When the activity definition was last reviewed by the publisher
  fhir:effectivePeriod [ Period ] ; # 0..1 When the activity definition is expected to be used
  fhir:topic  ( [ CodeableConcept ] ... ) ; # 0..* E.g. Education, Treatment, Assessment, etc
  fhir:author  ( [ ContactDetail ] ... ) ; # 0..* Who authored the content
  fhir:editor  ( [ ContactDetail ] ... ) ; # 0..* Who edited the content
  fhir:reviewer  ( [ ContactDetail ] ... ) ; # 0..* Who reviewed the content
  fhir:endorser  ( [ ContactDetail ] ... ) ; # 0..* Who endorsed the content
  fhir:relatedArtifact  ( [ RelatedArtifact ] ... ) ; # 0..* Additional documentation, citations, etc
  fhir:library  ( [ canonical(Library) ] ... ) ; # 0..* Logic used by the activity definition
  fhir:kind [ code ] ; # 0..1 Kind of resource
  fhir:profile [ canonical(StructureDefinition) ] ; # 0..1 What profile the resource needs to conform to
  fhir:code [ CodeableConcept ] ; # 0..1 Detail type of activity
  fhir:intent [ code ] ; # 0..1 proposal | plan | directive | order | original-order | reflex-order | filler-order | instance-order | option
  fhir:priority [ code ] ; # 0..1 routine | urgent | asap | stat
  fhir:doNotPerform [ boolean ] ; # 0..1 True if the activity should not be performed
  # timing[x] : 0..1 When activity is to occur. One of these 4
    fhir:timing [  a fhir:Timing ; Timing ]
    fhir:timing [  a fhir:Age ; Age ]
    fhir:timing [  a fhir:Range ; Range ]
    fhir:timing [  a fhir:Duration ; Duration ]
  # asNeeded[x] : 0..1 Preconditions for service. One of these 2
    fhir:asNeeded [  a fhir:boolean ; boolean ]
    fhir:asNeeded [  a fhir:CodeableConcept ; CodeableConcept ]
  fhir:location [ CodeableReference(Location) ] ; # 0..1 Where it should happen
  fhir:participant ( [ # 0..* Who should participate in the action
    fhir:type [ code ] ; # 0..1 careteam | device | group | healthcareservice | location | organization | patient | practitioner | practitionerrole | relatedperson
    fhir:typeCanonical [ canonical(CapabilityStatement) ] ; # 0..1 Who or what can participate
    fhir:typeReference [ Reference(CareTeam|Device|DeviceDefinition|Endpoint|Group|HealthcareService|Location|
  Organization|Patient|Practitioner|PractitionerRole|RelatedPerson) ] ; # 0..1 Who or what can participate
    fhir:role [ CodeableConcept ] ; # 0..1 E.g. Nurse, Surgeon, Parent, etc
    fhir:function [ CodeableConcept ] ; # 0..1 E.g. Author, Reviewer, Witness, etc
  ] ... ) ;
  # product[x] : 0..1 What's administered/supplied. One of these 2
    fhir:product [  a fhir:Reference ; Reference(Ingredient|Medication|Substance|SubstanceDefinition) ]
    fhir:product [  a fhir:CodeableConcept ; CodeableConcept ]
  fhir:quantity [ Quantity(SimpleQuantity) ] ; # 0..1 How much is administered/consumed/supplied
  fhir:dosage  ( [ Dosage ] ... ) ; # 0..* Detailed dosage instructions
  fhir:bodySite  ( [ CodeableConcept ] ... ) ; # 0..* What part of body to perform on
  fhir:specimenRequirement  ( [ canonical(SpecimenDefinition) ] ... ) ; # 0..* What specimens are required to perform this action
  fhir:observationRequirement  ( [ canonical(ObservationDefinition) ] ... ) ; # 0..* What observations are required to perform this action
  fhir:observationResultRequirement  ( [ canonical(ObservationDefinition) ] ... ) ; # 0..* What observations must be produced by this action
  fhir:transform [ canonical(StructureMap) ] ; # 0..1 Transform to apply the template
  fhir:dynamicValue ( [ # 0..* Dynamic aspects of the definition
    fhir:path [ string ] ; # 1..1 The path to the element to be set dynamically
    fhir:expression [ Expression ] ; # 1..1 An expression that provides the dynamic value for the customization
  ] ... ) ;
]

Changes from both R4 and R4B

ActivityDefinition
ActivityDefinition.versionAlgorithm[x]
  • Added Element
ActivityDefinition.subject[x]
  • Add Type canonical(EvidenceVariable)
  • Change value set from http://hl7.org/fhir/ValueSet/subject-type to Participant Resource Types
  • Change code system for extensibly bound codes from "http://hl7.org/fhir/resource-types" to "http://hl7.org/fhir/fhir-types"
ActivityDefinition.usage
  • Type changed from string to markdown
ActivityDefinition.copyrightLabel
  • Added Element
ActivityDefinition.kind
  • Remove codes AppointmentResponse, Contract
  • Add codes CoverageEligibilityRequest, RequestOrchestration, Transport
ActivityDefinition.timing[x]
  • Remove Types dateTime, Period
ActivityDefinition.asNeeded[x]
  • Added Element
ActivityDefinition.location
  • Type changed from Reference(Location) to CodeableReference
ActivityDefinition.participant.type
  • Min Cardinality changed from 1 to 0
  • Remove code related-person
  • Add codes careteam, group, healthcareservice, location, organization, practitionerrole, relatedperson
ActivityDefinition.participant.typeCanonical
  • Added Element
ActivityDefinition.participant.typeReference
  • Added Element
ActivityDefinition.participant.function
  • Added Element
ActivityDefinition.specimenRequirement
  • Type changed from Reference(SpecimenDefinition) to canonical(SpecimenDefinition)
ActivityDefinition.observationRequirement
  • Type changed from Reference(ObservationDefinition) to canonical(ObservationDefinition)
ActivityDefinition.observationResultRequirement
  • Type changed from Reference(ObservationDefinition) to canonical(ObservationDefinition)

See the Full Difference for further information

This analysis is available for R4 as XML or JSON and for R4B as XML or JSON.

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. ActivityDefinition TU DomainResource The definition of a specific activity to be taken, independent of any particular patient or context
+ Warning: Name should be usable as an identifier for the module by machine processing applications such as code generation

Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension
Interfaces Implemented: MetadataResource
... url ΣC 0..1 uri Canonical identifier for this activity definition, represented as a URI (globally unique)
+ Warning: URL should not contain | or # - these characters make processing canonical references problematic
... identifier Σ 0..* Identifier Additional identifier for the activity definition

... version Σ 0..1 string Business version of the activity definition
... versionAlgorithm[x] Σ 0..1 How to compare versions
Binding: Version Algorithm (Extensible)
.... versionAlgorithmString string
.... versionAlgorithmCoding Coding
... name ΣC 0..1 string Name for this activity definition (computer friendly)
... title ΣT 0..1 string Name for this activity definition (human friendly)
... subtitle T 0..1 string Subordinate title of the activity definition
... status ?!Σ 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (Required)
... experimental Σ 0..1 boolean For testing purposes, not real usage
... subject[x] 0..1 Type of individual the activity definition is intended for
Binding: Participant Resource Types (Extensible)
.... subjectCodeableConcept CodeableConcept
.... subjectReference Reference(Group | MedicinalProductDefinition | SubstanceDefinition | AdministrableProductDefinition | ManufacturedItemDefinition | PackagedProductDefinition)
.... subjectCanonical canonical(EvidenceVariable)
... date Σ 0..1 dateTime Date last changed
... publisher ΣT 0..1 string Name of the publisher/steward (organization or individual)
... contact Σ 0..* ContactDetail Contact details for the publisher

... description ΣT 0..1 markdown Natural language description of the activity definition
... useContext Σ 0..* UsageContext The context that the content is intended to support

... jurisdiction ΣXD 0..* CodeableConcept Intended jurisdiction for activity definition (if applicable)
Binding: Jurisdiction ValueSet (Extensible)

... purpose T 0..1 markdown Why this activity definition is defined
... usage T 0..1 markdown Describes the clinical usage of the activity definition
... copyright T 0..1 markdown Use and/or publishing restrictions
... copyrightLabel T 0..1 string Copyright holder and year(s)
... approvalDate 0..1 date When the activity definition was approved by publisher
... lastReviewDate 0..1 date When the activity definition was last reviewed by the publisher
... effectivePeriod Σ 0..1 Period When the activity definition is expected to be used
... topic XD 0..* CodeableConcept E.g. Education, Treatment, Assessment, etc
Binding: Definition Topic (Example)

... author 0..* ContactDetail Who authored the content

... editor 0..* ContactDetail Who edited the content

... reviewer 0..* ContactDetail Who reviewed the content

... endorser 0..* ContactDetail Who endorsed the content

... relatedArtifact 0..* RelatedArtifact Additional documentation, citations, etc

... library 0..* canonical(Library) Logic used by the activity definition

... kind Σ 0..1 code Kind of resource
Binding: Request Resource Types (Required)
... profile 0..1 canonical(StructureDefinition) What profile the resource needs to conform to
... code Σ 0..1 CodeableConcept Detail type of activity
Binding: Procedure Codes (SNOMED CT) (Example)
... intent 0..1 code proposal | plan | directive | order | original-order | reflex-order | filler-order | instance-order | option
Binding: RequestIntent (Required)
... priority 0..1 code routine | urgent | asap | stat
Binding: RequestPriority (Required)
... doNotPerform ?!Σ 0..1 boolean True if the activity should not be performed
... timing[x] 0..1 When activity is to occur
.... timingTiming Timing
.... timingAge Age
.... timingRange Range
.... timingDuration Duration
... asNeeded[x] Σ 0..1 Preconditions for service
Binding: SNOMED CT Medication As Needed Reason Codes (Example)
.... asNeededBoolean boolean
.... asNeededCodeableConcept CodeableConcept
... location 0..1 CodeableReference(Location) Where it should happen
... participant 0..* BackboneElement Who should participate in the action

.... type 0..1 code careteam | device | group | healthcareservice | location | organization | patient | practitioner | practitionerrole | relatedperson
Binding: Action Participant Type (Required)
.... typeCanonical 0..1 canonical(CapabilityStatement) Who or what can participate
.... typeReference 0..1 Reference(CareTeam | Device | DeviceDefinition | Endpoint | Group | HealthcareService | Location | Organization | Patient | Practitioner | PractitionerRole | RelatedPerson) Who or what can participate
.... role 0..1 CodeableConcept E.g. Nurse, Surgeon, Parent, etc
Binding: Action Participant Role icon (Example)
.... function 0..1 CodeableConcept E.g. Author, Reviewer, Witness, etc
Binding: Action Participant Function (Example)
... product[x] 0..1 What's administered/supplied
Binding: SNOMED CT Medication Codes (Example)
.... productReference Reference(Medication | Ingredient | Substance | SubstanceDefinition)
.... productCodeableConcept CodeableConcept
... quantity 0..1 SimpleQuantity How much is administered/consumed/supplied
... dosage 0..* Dosage Detailed dosage instructions

... bodySite 0..* CodeableConcept What part of body to perform on
Binding: SNOMED CT Body Structures (Example)

... specimenRequirement 0..* canonical(SpecimenDefinition) What specimens are required to perform this action

... observationRequirement 0..* canonical(ObservationDefinition) What observations are required to perform this action

... observationResultRequirement 0..* canonical(ObservationDefinition) What observations must be produced by this action

... transform 0..1 canonical(StructureMap) Transform to apply the template
... dynamicValue 0..* BackboneElement Dynamic aspects of the definition

.... path 1..1 string The path to the element to be set dynamically
.... expression 1..1 Expression An expression that provides the dynamic value for the customization

doco Documentation for this format icon

See the Extensions for this resource

UML Diagram (Legend)

ActivityDefinition (DomainResource) +MetadataResourceAn absolute URI that is used to identify this activity definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which an authoritative instance of this activity definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the activity definition is stored on different serversurl : uri [0..1]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 instanceidentifier : Identifier [0..*]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 assetsversion : string [0..1]Indicates the mechanism used to compare versions to determine which is more currentversionAlgorithm[x] : DataType [0..1] « string|Coding; null (Strength=Extensible) VersionAlgorithm+ »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 generationname : string [0..1] « This element has or is affected by some invariantsC »A short, descriptive, user-friendly title for the activity definitiontitle : string [0..1]An explanatory or alternate title for the activity definition giving additional information about its contentsubtitle : string [0..1]The status of this activity definition. Enables tracking the life-cycle of the content (this element modifies the meaning of other elements)status : code [1..1] « null (Strength=Required)PublicationStatus! »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 usageexperimental : boolean [0..1]A code, group definition, or canonical reference that describes or identifies the intended subject of the activity being defined. Canonical references are allowed to support the definition of protocols for drug and substance quality specifications, and is allowed to reference a MedicinalProductDefinition, SubstanceDefinition, AdministrableProductDefinition, ManufacturedItemDefinition, or PackagedProductDefinition resourcesubject[x] : DataType [0..1] « CodeableConcept|Reference(Group| MedicinalProductDefinition|SubstanceDefinition| AdministrableProductDefinition|ManufacturedItemDefinition| PackagedProductDefinition)|canonical(EvidenceVariable); null (Strength=Extensible) ParticipantResourceTypes+ »The date (and optionally time) when the activity definition was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the activity definition changesdate : dateTime [0..1]The name of the organization or individual responsible for the release and ongoing maintenance of the activity definitionpublisher : string [0..1]Contact details to assist a user in finding and communicating with the publishercontact : ContactDetail [0..*]A free text natural language description of the activity definition from a consumer's perspectivedescription : markdown [0..1]The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate activity definition instancesuseContext : UsageContext [0..*]A legal or geographic region in which the activity definition is intended to be usedjurisdiction : CodeableConcept [0..*] « null (Strength=Extensible)JurisdictionValueSet+ »Explanation of why this activity definition is needed and why it has been designed as it haspurpose : markdown [0..1]A detailed description of how the activity definition is used from a clinical perspectiveusage : markdown [0..1]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 definitioncopyright : markdown [0..1]A short string (<50 characters), suitable for inclusion in a page footer that identifies the copyright holder, effective period, and optionally whether rights are resctricted. (e.g. 'All rights reserved', 'Some rights reserved')copyrightLabel : string [0..1]The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usageapprovalDate : date [0..1]The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval datelastReviewDate : date [0..1]The period during which the activity definition content was or is planned to be in active useeffectivePeriod : Period [0..1]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 searchingtopic : CodeableConcept [0..*] « null (Strength=Example)DefinitionTopic?? »An individiual or organization primarily involved in the creation and maintenance of the contentauthor : ContactDetail [0..*]An individual or organization primarily responsible for internal coherence of the contenteditor : ContactDetail [0..*]An individual or organization asserted by the publisher to be primarily responsible for review of some aspect of the contentreviewer : ContactDetail [0..*]An individual or organization asserted by the publisher to be responsible for officially endorsing the content for use in some settingendorser : ContactDetail [0..*]Related artifacts such as additional documentation, justification, or bibliographic referencesrelatedArtifact : RelatedArtifact [0..*]A reference to a Library resource containing any formal logic used by the activity definitionlibrary : canonical [0..*] « Library »A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequestkind : code [0..1] « null (Strength=Required)RequestResourceTypes! »A profile to which the target of the activity definition is expected to conformprofile : canonical [0..1] « StructureDefinition »Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encountercode : CodeableConcept [0..1] « null (Strength=Example)ProcedureCodesSNOMEDCT?? »Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chainintent : code [0..1] « null (Strength=Required)RequestIntent! »Indicates how quickly the activity should be addressed with respect to other requestspriority : code [0..1] « null (Strength=Required)RequestPriority! »Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action (this element modifies the meaning of other elements)doNotPerform : boolean [0..1]The timing or frequency upon which the described activity is to occurtiming[x] : DataType [0..1] « Timing|Age|Range|Duration »If a CodeableConcept is present, it indicates the pre-condition for performing the service. For example "pain", "on flare-up", etcasNeeded[x] : DataType [0..1] « boolean|CodeableConcept; null (Strength=Example) SNOMEDCTMedicationAsNeededRea...?? »Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etclocation : CodeableReference [0..1] « Location »Identifies the food, drug or other product being consumed or supplied in the activityproduct[x] : DataType [0..1] « Reference(Medication|Ingredient| Substance|SubstanceDefinition)|CodeableConcept; null (Strength=Example) SNOMEDCTMedicationCodes?? »Identifies the quantity expected to be consumed at once (per dose, per meal, etc.)quantity : Quantity(SimpleQuantity) [0..1]Provides detailed dosage instructions in the same way that they are described for MedicationRequest resourcesdosage : Dosage [0..*]Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites)bodySite : CodeableConcept [0..*] « null (Strength=Example)SNOMEDCTBodyStructures?? »Defines specimen requirements for the action to be performed, such as required specimens for a lab testspecimenRequirement : canonical [0..*] « SpecimenDefinition »Defines observation requirements for the action to be performed, such as body weight or surface areaobservationRequirement : canonical [0..*] « ObservationDefinition »Defines the observations that are expected to be produced by the actionobservationResultRequirement : canonical [0..*] « ObservationDefinition »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 inputtransform : canonical [0..1] « StructureMap »ParticipantThe type of participant in the actiontype : code [0..1] « null (Strength=Required)ActionParticipantType! »The type of participant in the actiontypeCanonical : canonical [0..1] « CapabilityStatement »The type of participant in the actiontypeReference : Reference [0..1] « CareTeam|Device|DeviceDefinition| Endpoint|Group|HealthcareService|Location|Organization|Patient| Practitioner|PractitionerRole|RelatedPerson »The role the participant should play in performing the described actionrole : CodeableConcept [0..1] « null (Strength=Example)ActionParticipantRole?? »Indicates how the actor will be involved in the action - author, reviewer, witness, etcfunction : CodeableConcept [0..1] « null (Strength=Example)ActionParticipantFunction?? »DynamicValueThe path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolvable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details)path : string [1..1]An expression specifying the value of the customized elementexpression : Expression [1..1]Indicates who should participate in performing the action describedparticipant[0..*]Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the request resource that would contain the resultdynamicValue[0..*]

XML Template

<ActivityDefinition xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <url value="[uri]"/><!-- 0..1 Canonical identifier for this activity definition, represented as a URI (globally unique) -->
 <identifier><!-- 0..* Identifier Additional identifier for the activity definition --></identifier>
 <version value="[string]"/><!-- 0..1 Business version of the activity definition -->
 <versionAlgorithm[x]><!-- 0..1 string|Coding How to compare versions --></versionAlgorithm[x]>
 <name value="[string]"/><!-- I 0..1 Name for this activity definition (computer friendly) -->
 <title value="[string]"/><!-- 0..1 Name for this activity definition (human friendly) -->
 <subtitle value="[string]"/><!-- 0..1 Subordinate title of the activity definition -->
 <status value="[code]"/><!-- 1..1 draft | active | retired | unknown -->
 <experimental value="[boolean]"/><!-- 0..1 For testing purposes, not real usage -->
 <subject[x]><!-- 0..1 CodeableConcept|Reference(AdministrableProductDefinition|
   Group|ManufacturedItemDefinition|MedicinalProductDefinition|
   PackagedProductDefinition|SubstanceDefinition)|canonical(EvidenceVariable) Type of individual the activity definition is intended for --></subject[x]>
 <date value="[dateTime]"/><!-- 0..1 Date last changed -->
 <publisher value="[string]"/><!-- 0..1 Name of the publisher/steward (organization or individual) -->
 <contact><!-- 0..* ContactDetail Contact details for the publisher --></contact>
 <description value="[markdown]"/><!-- 0..1 Natural language description of the activity definition -->
 <useContext><!-- 0..* UsageContext The context that the content is intended to support --></useContext>
 <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction for activity definition (if applicable) --></jurisdiction>
 <purpose value="[markdown]"/><!-- 0..1 Why this activity definition is defined -->
 <usage value="[markdown]"/><!-- 0..1 Describes the clinical usage of the activity definition -->
 <copyright value="[markdown]"/><!-- 0..1 Use and/or publishing restrictions -->
 <copyrightLabel value="[string]"/><!-- 0..1 Copyright holder and year(s) -->
 <approvalDate value="[date]"/><!-- 0..1 When the activity definition was approved by publisher -->
 <lastReviewDate value="[date]"/><!-- 0..1 When the activity definition was last reviewed by the publisher -->
 <effectivePeriod><!-- 0..1 Period When the activity definition is expected to be used --></effectivePeriod>
 <topic><!-- 0..* CodeableConcept E.g. Education, Treatment, Assessment, etc --></topic>
 <author><!-- 0..* ContactDetail Who authored the content --></author>
 <editor><!-- 0..* ContactDetail Who edited the content --></editor>
 <reviewer><!-- 0..* ContactDetail Who reviewed the content --></reviewer>
 <endorser><!-- 0..* ContactDetail Who endorsed the content --></endorser>
 <relatedArtifact><!-- 0..* RelatedArtifact Additional documentation, citations, etc --></relatedArtifact>
 <library><!-- 0..* canonical(Library) Logic used by the activity definition --></library>
 <kind value="[code]"/><!-- 0..1 Kind of resource -->
 <profile><!-- 0..1 canonical(StructureDefinition) What profile the resource needs to conform to --></profile>
 <code><!-- 0..1 CodeableConcept Detail type of activity --></code>
 <intent value="[code]"/><!-- 0..1 proposal | plan | directive | order | original-order | reflex-order | filler-order | instance-order | option -->
 <priority value="[code]"/><!-- 0..1 routine | urgent | asap | stat -->
 <doNotPerform value="[boolean]"/><!-- 0..1 True if the activity should not be performed -->
 <timing[x]><!-- 0..1 Timing|Age|Range|Duration When activity is to occur --></timing[x]>
 <asNeeded[x]><!-- 0..1 boolean|CodeableConcept Preconditions for service --></asNeeded[x]>
 <location><!-- 0..1 CodeableReference(Location) Where it should happen --></location>
 <participant>  <!-- 0..* Who should participate in the action -->
  <type value="[code]"/><!-- 0..1 careteam | device | group | healthcareservice | location | organization | patient | practitioner | practitionerrole | relatedperson -->
  <typeCanonical><!-- 0..1 canonical(CapabilityStatement) Who or what can participate --></typeCanonical>
  <typeReference><!-- 0..1 Reference(CareTeam|Device|DeviceDefinition|Endpoint|
    Group|HealthcareService|Location|Organization|Patient|Practitioner|
    PractitionerRole|RelatedPerson) Who or what can participate --></typeReference>
  <role><!-- 0..1 CodeableConcept E.g. Nurse, Surgeon, Parent, etc icon --></role>
  <function><!-- 0..1 CodeableConcept E.g. Author, Reviewer, Witness, etc --></function>
 </participant>
 <product[x]><!-- 0..1 Reference(Ingredient|Medication|Substance|
   SubstanceDefinition)|CodeableConcept What's administered/supplied --></product[x]>
 <quantity><!-- 0..1 Quantity(SimpleQuantity) How much is administered/consumed/supplied --></quantity>
 <dosage><!-- 0..* Dosage Detailed dosage instructions --></dosage>
 <bodySite><!-- 0..* CodeableConcept What part of body to perform on --></bodySite>
 <specimenRequirement><!-- 0..* canonical(SpecimenDefinition) What specimens are required to perform this action --></specimenRequirement>
 <observationRequirement><!-- 0..* canonical(ObservationDefinition) What observations are required to perform this action --></observationRequirement>
 <observationResultRequirement><!-- 0..* canonical(ObservationDefinition) What observations must be produced by this action --></observationResultRequirement>
 <transform><!-- 0..1 canonical(StructureMap) Transform to apply the template --></transform>
 <dynamicValue>  <!-- 0..* Dynamic aspects of the definition -->
  <path value="[string]"/><!-- 1..1 The path to the element to be set dynamically -->
  <expression><!-- 1..1 Expression An expression that provides the dynamic value for the customization --></expression>
 </dynamicValue>
</ActivityDefinition>

JSON Template

{doco
  "resourceType" : "ActivityDefinition",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "url" : "<uri>", // Canonical identifier for this activity definition, represented as a URI (globally unique)
  "identifier" : [{ Identifier }], // Additional identifier for the activity definition
  "version" : "<string>", // Business version of the activity definition
  // versionAlgorithm[x]: How to compare versions. One of these 2:
  "versionAlgorithmString" : "<string>",
  "versionAlgorithmCoding" : { Coding },
  "name" : "<string>", // I Name for this activity definition (computer friendly)
  "title" : "<string>", // Name for this activity definition (human friendly)
  "subtitle" : "<string>", // Subordinate title of the activity definition
  "status" : "<code>", // R!  draft | active | retired | unknown
  "experimental" : <boolean>, // For testing purposes, not real usage
  // subject[x]: Type of individual the activity definition is intended for. One of these 3:
  "subjectCodeableConcept" : { CodeableConcept },
  "subjectReference" : { Reference(AdministrableProductDefinition|Group|
   ManufacturedItemDefinition|MedicinalProductDefinition|
   PackagedProductDefinition|SubstanceDefinition) },
  "subjectCanonical" : "<canonical(EvidenceVariable)>",
  "date" : "<dateTime>", // Date last changed
  "publisher" : "<string>", // Name of the publisher/steward (organization or individual)
  "contact" : [{ ContactDetail }], // Contact details for the publisher
  "description" : "<markdown>", // Natural language description of the activity definition
  "useContext" : [{ UsageContext }], // The context that the content is intended to support
  "jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction for activity definition (if applicable)
  "purpose" : "<markdown>", // Why this activity definition is defined
  "usage" : "<markdown>", // Describes the clinical usage of the activity definition
  "copyright" : "<markdown>", // Use and/or publishing restrictions
  "copyrightLabel" : "<string>", // Copyright holder and year(s)
  "approvalDate" : "<date>", // When the activity definition was approved by publisher
  "lastReviewDate" : "<date>", // When the activity definition was last reviewed by the publisher
  "effectivePeriod" : { Period }, // When the activity definition is expected to be used
  "topic" : [{ CodeableConcept }], // E.g. Education, Treatment, Assessment, etc
  "author" : [{ ContactDetail }], // Who authored the content
  "editor" : [{ ContactDetail }], // Who edited the content
  "reviewer" : [{ ContactDetail }], // Who reviewed the content
  "endorser" : [{ ContactDetail }], // Who endorsed the content
  "relatedArtifact" : [{ RelatedArtifact }], // Additional documentation, citations, etc
  "library" : ["<canonical(Library)>"], // Logic used by the activity definition
  "kind" : "<code>", // Kind of resource
  "profile" : "<canonical(StructureDefinition)>", // What profile the resource needs to conform to
  "code" : { CodeableConcept }, // Detail type of activity
  "intent" : "<code>", // proposal | plan | directive | order | original-order | reflex-order | filler-order | instance-order | option
  "priority" : "<code>", // routine | urgent | asap | stat
  "doNotPerform" : <boolean>, // True if the activity should not be performed
  // timing[x]: When activity is to occur. One of these 4:
  "timingTiming" : { Timing },
  "timingAge" : { Age },
  "timingRange" : { Range },
  "timingDuration" : { Duration },
  // asNeeded[x]: Preconditions for service. One of these 2:
  "asNeededBoolean" : <boolean>,
  "asNeededCodeableConcept" : { CodeableConcept },
  "location" : { CodeableReference(Location) }, // Where it should happen
  "participant" : [{ // Who should participate in the action
    "type" : "<code>", // careteam | device | group | healthcareservice | location | organization | patient | practitioner | practitionerrole | relatedperson
    "typeCanonical" : "<canonical(CapabilityStatement)>", // Who or what can participate
    "typeReference" : { Reference(CareTeam|Device|DeviceDefinition|Endpoint|
    Group|HealthcareService|Location|Organization|Patient|Practitioner|
    PractitionerRole|RelatedPerson) }, // Who or what can participate
    "role" : { CodeableConcept }, // E.g. Nurse, Surgeon, Parent, etc icon
    "function" : { CodeableConcept } // E.g. Author, Reviewer, Witness, etc
  }],
  // product[x]: What's administered/supplied. One of these 2:
  "productReference" : { Reference(Ingredient|Medication|Substance|
   SubstanceDefinition) },
  "productCodeableConcept" : { CodeableConcept },
  "quantity" : { Quantity(SimpleQuantity) }, // How much is administered/consumed/supplied
  "dosage" : [{ Dosage }], // Detailed dosage instructions
  "bodySite" : [{ CodeableConcept }], // What part of body to perform on
  "specimenRequirement" : ["<canonical(SpecimenDefinition)>"], // What specimens are required to perform this action
  "observationRequirement" : ["<canonical(ObservationDefinition)>"], // What observations are required to perform this action
  "observationResultRequirement" : ["<canonical(ObservationDefinition)>"], // What observations must be produced by this action
  "transform" : "<canonical(StructureMap)>", // Transform to apply the template
  "dynamicValue" : [{ // Dynamic aspects of the definition
    "path" : "<string>", // R!  The path to the element to be set dynamically
    "expression" : { Expression } // R!  An expression that provides the dynamic value for the customization
  }]
}

Turtle Template

@prefix fhir: <http://hl7.org/fhir/> .doco


[ a fhir:ActivityDefinition;
  fhir:nodeRole fhir:treeRoot; # if this is the parser root

  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:url [ uri ] ; # 0..1 Canonical identifier for this activity definition, represented as a URI (globally unique)
  fhir:identifier  ( [ Identifier ] ... ) ; # 0..* Additional identifier for the activity definition
  fhir:version [ string ] ; # 0..1 Business version of the activity definition
  # versionAlgorithm[x] : 0..1 How to compare versions. One of these 2
    fhir:versionAlgorithm [  a fhir:string ; string ]
    fhir:versionAlgorithm [  a fhir:Coding ; Coding ]
  fhir:name [ string ] ; # 0..1 I Name for this activity definition (computer friendly)
  fhir:title [ string ] ; # 0..1 Name for this activity definition (human friendly)
  fhir:subtitle [ string ] ; # 0..1 Subordinate title of the activity definition
  fhir:status [ code ] ; # 1..1 draft | active | retired | unknown
  fhir:experimental [ boolean ] ; # 0..1 For testing purposes, not real usage
  # subject[x] : 0..1 Type of individual the activity definition is intended for. One of these 3
    fhir:subject [  a fhir:CodeableConcept ; CodeableConcept ]
    fhir:subject [  a fhir:Reference ; Reference(AdministrableProductDefinition|Group|ManufacturedItemDefinition|
  MedicinalProductDefinition|PackagedProductDefinition|SubstanceDefinition) ]
    fhir:subject [  a fhir:canonical ; canonical(EvidenceVariable) ]
  fhir:date [ dateTime ] ; # 0..1 Date last changed
  fhir:publisher [ string ] ; # 0..1 Name of the publisher/steward (organization or individual)
  fhir:contact  ( [ ContactDetail ] ... ) ; # 0..* Contact details for the publisher
  fhir:description [ markdown ] ; # 0..1 Natural language description of the activity definition
  fhir:useContext  ( [ UsageContext ] ... ) ; # 0..* The context that the content is intended to support
  fhir:jurisdiction  ( [ CodeableConcept ] ... ) ; # 0..* Intended jurisdiction for activity definition (if applicable)
  fhir:purpose [ markdown ] ; # 0..1 Why this activity definition is defined
  fhir:usage [ markdown ] ; # 0..1 Describes the clinical usage of the activity definition
  fhir:copyright [ markdown ] ; # 0..1 Use and/or publishing restrictions
  fhir:copyrightLabel [ string ] ; # 0..1 Copyright holder and year(s)
  fhir:approvalDate [ date ] ; # 0..1 When the activity definition was approved by publisher
  fhir:lastReviewDate [ date ] ; # 0..1 When the activity definition was last reviewed by the publisher
  fhir:effectivePeriod [ Period ] ; # 0..1 When the activity definition is expected to be used
  fhir:topic  ( [ CodeableConcept ] ... ) ; # 0..* E.g. Education, Treatment, Assessment, etc
  fhir:author  ( [ ContactDetail ] ... ) ; # 0..* Who authored the content
  fhir:editor  ( [ ContactDetail ] ... ) ; # 0..* Who edited the content
  fhir:reviewer  ( [ ContactDetail ] ... ) ; # 0..* Who reviewed the content
  fhir:endorser  ( [ ContactDetail ] ... ) ; # 0..* Who endorsed the content
  fhir:relatedArtifact  ( [ RelatedArtifact ] ... ) ; # 0..* Additional documentation, citations, etc
  fhir:library  ( [ canonical(Library) ] ... ) ; # 0..* Logic used by the activity definition
  fhir:kind [ code ] ; # 0..1 Kind of resource
  fhir:profile [ canonical(StructureDefinition) ] ; # 0..1 What profile the resource needs to conform to
  fhir:code [ CodeableConcept ] ; # 0..1 Detail type of activity
  fhir:intent [ code ] ; # 0..1 proposal | plan | directive | order | original-order | reflex-order | filler-order | instance-order | option
  fhir:priority [ code ] ; # 0..1 routine | urgent | asap | stat
  fhir:doNotPerform [ boolean ] ; # 0..1 True if the activity should not be performed
  # timing[x] : 0..1 When activity is to occur. One of these 4
    fhir:timing [  a fhir:Timing ; Timing ]
    fhir:timing [  a fhir:Age ; Age ]
    fhir:timing [  a fhir:Range ; Range ]
    fhir:timing [  a fhir:Duration ; Duration ]
  # asNeeded[x] : 0..1 Preconditions for service. One of these 2
    fhir:asNeeded [  a fhir:boolean ; boolean ]
    fhir:asNeeded [  a fhir:CodeableConcept ; CodeableConcept ]
  fhir:location [ CodeableReference(Location) ] ; # 0..1 Where it should happen
  fhir:participant ( [ # 0..* Who should participate in the action
    fhir:type [ code ] ; # 0..1 careteam | device | group | healthcareservice | location | organization | patient | practitioner | practitionerrole | relatedperson
    fhir:typeCanonical [ canonical(CapabilityStatement) ] ; # 0..1 Who or what can participate
    fhir:typeReference [ Reference(CareTeam|Device|DeviceDefinition|Endpoint|Group|HealthcareService|Location|
  Organization|Patient|Practitioner|PractitionerRole|RelatedPerson) ] ; # 0..1 Who or what can participate
    fhir:role [ CodeableConcept ] ; # 0..1 E.g. Nurse, Surgeon, Parent, etc
    fhir:function [ CodeableConcept ] ; # 0..1 E.g. Author, Reviewer, Witness, etc
  ] ... ) ;
  # product[x] : 0..1 What's administered/supplied. One of these 2
    fhir:product [  a fhir:Reference ; Reference(Ingredient|Medication|Substance|SubstanceDefinition) ]
    fhir:product [  a fhir:CodeableConcept ; CodeableConcept ]
  fhir:quantity [ Quantity(SimpleQuantity) ] ; # 0..1 How much is administered/consumed/supplied
  fhir:dosage  ( [ Dosage ] ... ) ; # 0..* Detailed dosage instructions
  fhir:bodySite  ( [ CodeableConcept ] ... ) ; # 0..* What part of body to perform on
  fhir:specimenRequirement  ( [ canonical(SpecimenDefinition) ] ... ) ; # 0..* What specimens are required to perform this action
  fhir:observationRequirement  ( [ canonical(ObservationDefinition) ] ... ) ; # 0..* What observations are required to perform this action
  fhir:observationResultRequirement  ( [ canonical(ObservationDefinition) ] ... ) ; # 0..* What observations must be produced by this action
  fhir:transform [ canonical(StructureMap) ] ; # 0..1 Transform to apply the template
  fhir:dynamicValue ( [ # 0..* Dynamic aspects of the definition
    fhir:path [ string ] ; # 1..1 The path to the element to be set dynamically
    fhir:expression [ Expression ] ; # 1..1 An expression that provides the dynamic value for the customization
  ] ... ) ;
]

Changes from both R4 and R4B

ActivityDefinition
ActivityDefinition.versionAlgorithm[x]
  • Added Element
ActivityDefinition.subject[x]
  • Add Type canonical(EvidenceVariable)
  • Change value set from http://hl7.org/fhir/ValueSet/subject-type to Participant Resource Types
  • Change code system for extensibly bound codes from "http://hl7.org/fhir/resource-types" to "http://hl7.org/fhir/fhir-types"
ActivityDefinition.usage
  • Type changed from string to markdown
ActivityDefinition.copyrightLabel
  • Added Element
ActivityDefinition.kind
  • Remove codes AppointmentResponse, Contract
  • Add codes CoverageEligibilityRequest, RequestOrchestration, Transport
ActivityDefinition.timing[x]
  • Remove Types dateTime, Period
ActivityDefinition.asNeeded[x]
  • Added Element
ActivityDefinition.location
  • Type changed from Reference(Location) to CodeableReference
ActivityDefinition.participant.type
  • Min Cardinality changed from 1 to 0
  • Remove code related-person
  • Add codes careteam, group, healthcareservice, location, organization, practitionerrole, relatedperson
ActivityDefinition.participant.typeCanonical
  • Added Element
ActivityDefinition.participant.typeReference
  • Added Element
ActivityDefinition.participant.function
  • Added Element
ActivityDefinition.specimenRequirement
  • Type changed from Reference(SpecimenDefinition) to canonical(SpecimenDefinition)
ActivityDefinition.observationRequirement
  • Type changed from Reference(ObservationDefinition) to canonical(ObservationDefinition)
ActivityDefinition.observationResultRequirement
  • Type changed from Reference(ObservationDefinition) to canonical(ObservationDefinition)

See the Full Difference for further information

This analysis is available for R4 as XML or JSON and for R4B as XML or JSON.

 

Additional definitions: Master Definition XML + JSON, XML Schema/Schematron + JSON Schema, ShEx (for Turtle) , the spreadsheet version & the dependency analysis

Path ValueSet Type Documentation
ActivityDefinition.versionAlgorithm[x] VersionAlgorithm Extensible

Indicates the mechanism used to compare versions to determine which is more current.

ActivityDefinition.status PublicationStatus Required

The lifecycle status of an artifact.

ActivityDefinition.subject[x] ParticipantResourceTypes Extensible

All Resource Types that represent participant resources

ActivityDefinition.jurisdiction JurisdictionValueSet Extensible

This value set defines a base set of codes for country, country subdivision and region for indicating where a resource is intended to be used.

Note: The codes for countries and country subdivisions are taken from ISO 3166 icon while the codes for "supra-national" regions are from UN Standard country or area codes for statistical use (M49) icon.

ActivityDefinition.topic DefinitionTopic Example

High-level categorization of the definition, used for searching, sorting, and filtering.

ActivityDefinition.kind RequestResourceTypes Required

All Resource Types that represent request resources

ActivityDefinition.code ProcedureCodesSNOMEDCT Example

Procedure Code: All SNOMED CT procedure codes.

ActivityDefinition.intent RequestIntent Required

Codes indicating the degree of authority/intentionality associated with a request.

ActivityDefinition.priority RequestPriority Required

Identifies the level of importance to be assigned to actioning the request.

ActivityDefinition.asNeeded[x] SNOMEDCTMedicationAsNeededReasonCodes Example

This value set includes all clinical findings from SNOMED CT - provided as an exemplar value set.

ActivityDefinition.participant.type ActionParticipantType Required

The type of participant for the action.

ActivityDefinition.participant.role ActionParticipantRole icon Example

Either a practitioner role or a relationship type. Note from UTG import - may have been a temporary entry that subsequently disappeared from the FHIR source; unable to locate. Version set to 0.1.0

ActivityDefinition.participant.function ActionParticipantFunction Example

The function performed by the participant for the action.

ActivityDefinition.product[x] SNOMEDCTMedicationCodes Example

This value set includes all drug or medicament substance codes and all pharmaceutical/biologic products from SNOMED CT - provided as an exemplar value set.

ActivityDefinition.bodySite SNOMEDCTBodyStructures Example

This value set includes all codes from SNOMED CT icon where concept is-a 442083009 (Anatomical or acquired body site (body structure)).

UniqueKeyLevelLocationDescriptionExpression
img cnl-0Warning (base)Name should be usable as an identifier for the module by machine processing applications such as code generationname.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
img cnl-1Warning ActivityDefinition.urlURL should not contain | or # - these characters make processing canonical references problematicexists() implies matches('^[^|# ]+$')

An ActivityDefinition resource provides a description, or template, of an action to performed. These actions can be purely text-based descriptions of the action to be performed, only interpretable by a human user, or they can be structured definitions with enough information to construct a resource to represent the request or activity directly. This process of converting the ActivityDefinition into a specific resource in a particular context is performed with the $apply operation.

In the simplest case, the process maps the elements specified in the ActivityDefinition to the corresponding elements on a resource of the appropriate type, using the kind element of the definition to determine the type of resource to be created.

More dynamic scenarios can be achieved in one of two ways, either by providing dynamicValue expressions, or by specifying a StructureMap that transforms the definition into the appropriate request resource.

Note that systems will likely vary widely in the degree of support they provide for the $apply operation. In particular, the fact that a system supports applying definitions of one category, does not imply that it supports applying definitions for all categories. For example, a service focused on medication order sets may have sophisticated support for MedicationRequest activities, but no support at all for the ServiceRequest activities.

The following diagram illustrates the relationship between the PlanDefinition and ActivityDefinition resources, as well as a typical application to CarePlan, RequestOrchestration, and Request resources:

relationship-between-action-and-activity-definition

To accommodate the variability in systems and use cases, this specification is not prescriptive about exactly how an ActivityDefinition is applied to produce target request resources. However, the approach depicted above provides a general framework for the process, and the following steps provide more detail on the potential approach:

  1. Create the target resource of the type specified by the kind element and focused on the Patient in context
  2. Set the status of the target resource to draft
  3. Set the intent of the target resource to option
  4. Apply the structural elements of the ActivityDefinition to the target resource such as code, timing, doNotPerform, product, quantity, dosage, and so on
  5. Resolve the participant element based on the user in context
  6. Resolve the location element based on the location in context
  7. If the transform element is specified, apply the transform to the resource. Note that the referenced StructureMap may actually construct the resource, rather than taking an instance. See the StructureMap for more information
  8. Apply any dynamicValue elements (in the order in which they appear in the ActivityDefinition resource) by evaluating the expression and setting the value of the appropriate element of the target resource (as specified by the dynamicValue.path element)

Note that the parameters to the $apply operation are available within dynamicValue CQL and FHIRPath expressions as context variables, accessible by the name of the parameter prefixed with a percent (%) symbol. For example, to access the subject given to the apply, use the expression %subject.

Note that result of this operation is transient (i.e. none of the resources created by the operation are persisted in the server, they are all returned as contained resources in the result). The result effectively represents a proposed set of activities, and it is up to the caller to determine whether and how those activities are actually carried out.

The kind element may only specify Request resource types to facilitate considering user input as part of processing the result of any automated clinical reasoning processes. To support creation of event resources, such as Observations, RiskAssessments, and DetectedIssues, use a Task resource with the focus of the task set to the event resource to be created.

Because the ActivityDefinition resource can be used to describe many different types of request resources, profiles of the resource will be useful in communicating additional constraints and expectations about how the resource should be used in a particular context. For example, a profile of ActivityDefinition may specify that it is intended to describe medication orders within an order set. Such a profile would indicate that the quantity element should not be used, but the dosage element must be.

The following sections provide FHIR Mapping Language snippets for mapping ActivityDefinition instances to each kind of Request resource that can be created.

map "http://research.philips.com/fhir/r4/mapping/AdToAppointment" =
    "R3 Parameters of Activitydefinition.$apply to Appointment"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/Appointment" as target

group main
    input src: Parameters as source
    input tgt: ReferralRequest as target

    "subject" : for src.parameter as p where name='subject' then {
        do: for p.value as sbj make tgt.participant as participant then {
            doActor: for sbj as sbj make participant.actor=sbj
            doStatus: for sbj as sbj make participant.status ="needs-action"
        }
    }

//    "practitioner" : for src.parameter as p where name='practitioner' then{
//                do: for p.value as prac make tgt.requester = prac
//    }

    "organization" : for src as src where
            parameter.where( name='practitioner').exists().not() and parameter.where( name='organization').exists()
        then{
            do: for src.parameter as p where name='organization' then{
                do: for p.value as org make tgt.requester = org
            }
        }


//    "encounter" : for src.parameter as p where name='encounter' then {
//        do: for p.value as enc make tgt.encounter = enc
//    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: ServiceRequest as target

//    "refAd"        : for src.url      as vvv make tgt.basedOn = vvv
//    "ad.code"      : for src.code     as vvv make tgt.code = vvv          // could be serviceCategory or specialty --> unclear
    //    "intent"       : for src                 make tgt.intent = "proposal"
    "ad.priority"  : for src  where priority='routine' then {
            prio: for src make tgt.priority = 9
    }
    "ad.priority"  : for src.priority  as priority where priority='urgent' then {
            prio: for priority make tgt.priority = 7
    }
    "ad.priority"  : for src.priority  as priority where priority='asap' then {
            prio: for priority make tgt.priority = 4
    }
    "ad.priority"  : for src.priority  as priority where priority='stat' then {
            prio: for priority make tgt.priority = 1
    }
//    "ad.doNotPerform"  : for src.doNotPerform as doNotPerform make tgt.priority as priority
    "ad.timingP1"   : for src.timing :Period   as period   make tgt.start = period.start
    "ad.timingP2"   : for src.timing :Period   as period   make tgt.end = period.end
    "ad.timingD"    : for src.timing :Duration as duration make tgt.minutesDuration = duration
    "ad.timingDT"   : for src.timing :dateTime as dt       make tgt.start = dt

    "ad.location"  : for src.location as location make tgt.participant as participant then {
            doActor:  for location make participant.actor = location
            doStatus: for location make participant.status = "needs-action"
    }
//    "ad.product"   : for src          as vvv check product.empty()
//    "ad.quantity"  : for src          as vvv check quantity.empty()
//    "ad.bodysite"  : for src.bodySite as vvv make tgt.bodySite = vvv
//    "ad.dosage"    : for src          as vvv check dosage.empty()

//    "intent"       : for src                 make tgt.intent = "proposal"
    "status"       : for src                 make tgt.status = "proposed"
    "created"      : for src                 make tgt.created = evaluate( src, now() )
endgroup
map "http://research.philips.com/fhir/r4/mapping/AdToAppointmentResponse" =
    "R3 Parameters of Activitydefinition.$apply to AppointmentResponse"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/AppointmentResponse" as target

group main
    input src: Parameters as source
    input tgt: ReferralRequest as target

//    "subject" : for src.parameter as p where name='subject' then {
//        do: for p.value as sbj make tgt.subject = sbj
//    }
//
//    "practitioner" : for src.parameter as p where name='practitioner' then{
//            do: for p.value as prac make tgt.requester = prac
//        }
//
//    "organization" : for src as src where
//            parameter.where( name='practitioner').exists().not() and parameter.where( name='organization').exists()
//        then{
//            do: for src.parameter as p where name='organization' then{
//                do: for p.value as org make tgt.requester = org
//            }
//        }
//
//    "encounter" : for src.parameter as p where name='encounter' then {
//        do: for p.value as enc make tgt.encounter = enc
//    }

    // unsure who the actor is. No default makes sense - leave empty.

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: ServiceRequest as target

//    "refAd"        : for src.url      as vvv make tgt.instantiatesCanonical = vvv
    "status"       : for src                 make tgt.participantStatus = "needs-action"
//    "intent"       : for src                 make tgt.intent = "proposal"
//    "ad.code"      : for src.code     as vvv make tgt.code = vvv
//    "ad.timing"    : for src.timing   as timing make tgt.start = timing   // unsure how to map on start/end
//    "ad.location"  : for src.location as vvv make tgt.locationReference = vvv
//    "ad.product"   : for src          as vvv check product.empty()
//    "ad.quantity"  : for src          as vvv check quantity.empty()
//    "ad.bodysite"  : for src.bodySite as vvv make tgt.bodySite = vvv
//    "ad.dosage"    : for src          as vvv check dosage.empty()
endgroup
map "http://research.philips.com/fhir/r4/mapping/AdToCarePlan" =
    "R3 Parameters of Activitydefinition.$apply to CarePlan"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/CarePlan" as target

group main
    input src: Parameters as source
    input tgt: ReferralRequest as target

    "subject" : for src.parameter as p where name='subject' then {
        do: for p.value as sbj make tgt.subject = sbj
    }

    "practitioner" : for src.parameter as p where name='practitioner' then{
            do: for p.value as prac make tgt.author = prac
        }

    "organization" : for src as src where
            parameter.where( name='practitioner').exists().not() and parameter.where( name='organization').exists()
        then{
            do: for src.parameter as p where name='organization' then{
                do: for p.value as org make tgt.author = org
            }
        }

    "encounter" : for src.parameter as p where name='encounter' then {
        do: for p.value as enc make tgt.encounter = enc
    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: ServiceRequest as target

    "ad.code"      : for src.code     as vvv  make tgt.category = vvv
//    "ad.priority"  : for src.priority as prio make tgt.priority = vvv
//    "ad.doNotPerform"  : for src.doNotPerform as doNotPerform make tgt.priority as priority
    "ad.timing"    : for src.timing   as timing make tgt.period = timing
//    "ad.location"  : for src.location as location make tgt.location=location
//    "ad.product"   : for src          as vvv check product.empty()
//    "ad.quantity"  : for src          as vvv check quantity.empty()
//    "ad.bodysite"  : for src.bodySite as vvv make tgt.bodySite = vvv
//    "ad.dosage"    : for src          as vvv check dosage.empty()

    "refAd"        : for src.url      as vvv make tgt.instantiatesCanonical = vvv
    "status"       : for src                 make tgt.status = "draft"
    "intent"       : for src                 make tgt.intent = "proposal"
    "created"      : for src                 make tgt.created = evaluate( src, now() )
endgroup
map "http://research.philips.com/fhir/r4/mapping/AdToClaim" =
    "R3 Parameters of Activitydefinition.$apply to Claim"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/Claim" as target

group main
    input src: Parameters as source
    input tgt: ReferralRequest as target

    "subject" : for src.parameter as p where name='subject' then {
        do: for p.value as sbj make tgt.patient = sbj
    }

    "practitioner1" : for src.parameter as p where name='practitioner' then{
            do: for p.value as prac make tgt.enterer = prac
        }

     "organization" : for src.parameter as p where name='organization' then{
                do: for p.value as org make tgt.provider = org
    }


//    "encounter" : for src.parameter as p where name='encounter' then {
//        do: for p.value as enc make tgt.encounter = enc
//    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: Claim as target

    "ad.code"      : for src.code     as vvv  make tgt.type = vvv
    "ad.priority1"  : for src where priority.exists() then {
        do: for src.priority as priority make tgt.priority as tgtprioCc then {
            doCoding: for priority make tgtprioCc.coding as tgtCoding then {
                system:  for priority make tgtCoding.system = "http://hl7.org/fhir/ValueSet/request-priority"
                code:    for priority make tgtCoding.code   = priority
            }
        }
    }
    "ad.priority2"  : for src where priority.exists().not() then {
        do: for src make tgt.priority as tgtprioCc then {
            doCoding: for src make tgtprioCc.coding as tgtCoding then {
                system:  for src make tgtCoding.system = "http://hl7.org/fhir/ValueSet/request-priority"
                code:    for src make tgtCoding.code   = "normal"
            }
        }
    }
//    "ad.timing"    : for src.timing   as timing make tgt.period = timing
//    "ad.doNotPerform"  : for src.doNotPerform as doNotPerform make tgt.priority as priority
    "ad.location"  : for src.location as location make tgt.facility = location
//    "ad.product"   : for src          as vvv check product.empty()
//    "ad.quantity"  : for src          as quantity make tgt.quantity = quantity
//    "ad.bodysite"  : for src.bodySite as bodysite make tgt.bodySite = bodysite
//    "ad.dosage"    : for src          as vvv check dosage.empty()

//    "refAd"        : for src.url      as vvv make tgt.instantiatesCanonical = vvv
    "status"       : for src                 make tgt.status = "draft"
    "use"          : for src                 make tgt.use = "claim"
    "created"      : for src                 make tgt.created = evaluate( src, now() )
endgroup
map "http://research.philips.com/fhir/r4/mapping/AdToCommunicationRequest" =
    "R3 Parameters of Activitydefinition.$apply to CommunicationRequest"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/CommunicationRequest" as target

group main
    input src: Parameters as source
    input tgt: ProcedureRequest as target

    "subject" : for src.parameter as p where name='subject' then {
        do: for p.value as sbj make tgt.subject = sbj
    }

    "practitioner" : for src.parameter as p where name='practitioner' then{
        do: for p.value as prac make tgt.requester = prac
    }

    "organization" : for src.parameter as p where
         parameter.where( name='practitioner').exists().not() and parameter.where( name='organization').exists()
    then  {
            do: for src.parameter as p where name='organization' then{
                do: for p.value as org make tgt.requester = org
            }
    }

    "encounter" : for src.parameter as p where name='encounter' then {
        do: for p.value as enc make tgt.encounter = enc
    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: ProcedureRequest as target

    "basedOn"      : for src                 make  tgt.basedOn = reference( src )
    "status"       : for src                 make  tgt.status = "draft"
    "authoredOn"   : for src                 make  tgt.authoredOn = evaluate( src, now() )
    "ad.code"      : for src.code     as vvv make  tgt.reasonCode = vvv
//    "ad.doNotPerform"  : for src.doNotPerform as doNotPerform make tgt.priority as priority
    "ad.timing"    : for src.timing   as vvv make  tgt.occurrence = vvv
//    "ad.location"  : for src          as vvv check location.empty()
//    "ad.product"   : for src          as vvv check product.empty()
//    "ad.quantity"  : for src          as vvv check quantity.empty()
//    "ad.bodysite"  : for src          as vvv check bodysite.empty()
//    "ad.dosage"    : for src          as vvv check dosage.empty()
endgroup
map "http://research.philips.com/fhir/r4/mapping/AdToContract" =
    "R3 Parameters of Activitydefinition.$apply to Contract"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/Contract" as target

group main
    input src: Parameters as source
    input tgt: ReferralRequest as target

    "subject" : for src.parameter as p where name='subject' then {
        do: for p.value as sbj make tgt.subject = sbj
    }

    "practitioner" : for src.parameter as p where name='practitioner' then{
            do: for p.value as prac make tgt.author = prac
        }

     "organization" : for src.parameter as p where name='organization' then{
                do: for p.value as org make tgt.authority = org
    }

//    "encounter" : for src.parameter as p where name='encounter' then {
//        do: for p.value as enc make tgt.context = enc
//    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: Contract as target

    "ad.code"      : for src.code     as code  make tgt.scope = code
//    "ad.priority"  : for src as priority make tgt.priority as tgtprioCc
//    "ad.doNotPerform"  : for src.doNotPerform as doNotPerform make tgt.priority as priority
    "ad.timing"    : for src.timing   as timing make tgt.applies = timing
    "ad.location"  : for src.location as location make tgt.site = location
//    "ad.product"   : for src          as vvv check product.empty()
//    "ad.quantity"  : for src          as quantity make tgt.quantity = quantity
//    "ad.bodysite"  : for src.bodySite as bodysite make tgt.bodySite = bodysite
//    "ad.dosage"    : for src          as vvv check dosage.empty()

//    "refAd"        : for src.url      as vvv make tgt.instantiatesCanonical = vvv
//    "status"       : for src                 make tgt.status = "draft"
//    "use"          : for src                 make tgt.use = "claim"
//    "created"      : for src                 make tgt.created = evaluate( src, now() )
endgroup
map "http://research.philips.com/fhir/r4/mapping/AdToDeviceRequest" =
    "R3 Parameters of Activitydefinition.$apply to DeviceRequest"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/DeviceRequest" as target

group main
    input src: Parameters as source
    input tgt: ReferralRequest as target

    "subject" : for src.parameter as p where name='subject' then {
            do: for p.value as sbj make tgt.subject = sbj
    }

    "practitioner" : for src.parameter as p where name='practitioner' then{
            do: for p.value as prac make tgt.requester = prac
        }

    "organization" : for src as src where
            parameter.where( name='practitioner').exists().not() and parameter.where( name='organization').exists()
        then{
            do: for src.parameter as p where name='organization' then{
                do: for p.value as org make tgt.requester = org
            }
        }

    "encounter" : for src.parameter as p where name='encounter' then {
        do: for p.value as enc make tgt.encounter = enc
    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: DeviceRequest as target

    "ad.code"      : for src.code     as code     make tgt.code = code
    "ad.priority"  : for src.priority as vvv      make tgt.priority = vvv
//    "ad.doNotPerform"  : for src.doNotPerform as doNotPerform make tgt.priority as priority
    "ad.timing"    : for src.timing   as timing   make tgt.occurrence = timing
//    "ad.location"  : for src.location as location make tgt.site = location
//    "ad.product"   : for src          as vvv check product.empty()
//    "ad.quantity"  : for src          as quantity make tgt.quantity = quantity
//    "ad.bodysite"  : for src.bodySite as bodysite make tgt.bodySite = bodysite
//    "ad.dosage"    : for src          as vvv check dosage.empty()

    "refAd"        : for src.url      as vvv make tgt.instantiatesCanonical = vvv
    "intent"       : for src                 make tgt.intent = "proposal"
//    "use"          : for src                 make tgt.use = "claim"
//    "created"      : for src                 make tgt.created = evaluate( src, now() )
endgroup
map "http://research.philips.com/fhir/r4/mapping/AdToEnrollmentRequest" =
    "R3 Parameters of Activitydefinition.$apply to EnrollmentRequest"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/EnrollmentRequest" as target

group main
    input src: Parameters as source
    input tgt: ReferralRequest as target

    "subject" : for src.parameter as p where name='subject' then {
            do: for p.value as sbj make tgt.candidate = sbj
    }

    "practitioner" : for src.parameter as p where name='practitioner' then{
            do: for p.value as prac make tgt.provider = prac
        }

//    "organization" : for src as src where
//            parameter.where( name='practitioner').exists().not() and parameter.where( name='organization').exists()
//        then{
//            do: for src.parameter as p where name='organization' then{
//                do: for p.value as org make tgt.requester = org
//            }
//        }

//    "encounter" : for src.parameter as p where name='encounter' then {
//        do: for p.value as enc make tgt.encounter = enc
//    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: EnrollmentRequest as target

//    "ad.code"      : for src.code     as code     make tgt.code = code
//    "ad.priority"  : for src.priority as priority make tgt.priority as priority
//    "ad.doNotPerform"  : for src.doNotPerform as doNotPerform make tgt.priority as priority
//    "ad.timing"    : for src.timing   as timing   make tgt.occurrence = timing
//    "ad.location"  : for src.location as location make tgt.site = location
//    "ad.product"   : for src          as vvv check product.empty()
//    "ad.quantity"  : for src          as quantity make tgt.quantity = quantity
//    "ad.bodysite"  : for src.bodySite as bodysite make tgt.bodySite = bodysite
//    "ad.dosage"    : for src          as vvv check dosage.empty()

//    "refAd"        : for src.url      as vvv make tgt.instantiatesCanonical = vvv
//    "intent"       : for src                 make tgt.intent = "proposal"
//    "use"          : for src                 make tgt.use = "claim"
    "created"      : for src                 make tgt.created = evaluate( src, now() )
endgroup
map "http://research.philips.com/fhir/r4/mapping/AdToImmunizationRecommendation" =
    "R3 Parameters of Activitydefinition.$apply to ImmunizationRecommendation"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation" as target

group main
    input src: Parameters as source
    input tgt: ReferralRequest as target

    "subject" : for src.parameter as p where name='subject' then {
            do: for p.value as sbj make tgt.patient = sbj
    }

//    "practitioner" : for src.parameter as p where name='practitioner' then{
//            do: for p.value as prac make tgt.provider = prac
//        }

    "organization" : for src as src where name='organization' then{
        do: for p.value as organization make tgt.authority = organization
    }

//    "encounter" : for src.parameter as p where name='encounter' then {
//        do: for p.value as enc make tgt.encounter = enc
//    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: ImmunizationRecommendation as target

//    "ad.code"      : for src.code     as code     make tgt.code = code
//    "ad.priority"  : for src.priority as priority make tgt.priority as priority
//    "ad.doNotPerform"  : for src.doNotPerform as doNotPerform make tgt.priority as priority
//    "ad.timing"    : for src.timing   as timing   make tgt.occurrence = timing
//    "ad.location"  : for src.location as location make tgt.site = location
//    "ad.product"   : for src          as vvv check product.empty()
//    "ad.quantity"  : for src          as quantity make tgt.quantity = quantity
//    "ad.bodysite"  : for src.bodySite as bodysite make tgt.bodySite = bodysite
//    "ad.dosage"    : for src          as vvv check dosage.empty()

//    "refAd"        : for src.url      as vvv make tgt.instantiatesCanonical = vvv
//    "intent"       : for src                 make tgt.intent = "proposal"
//    "use"          : for src                 make tgt.use = "claim"
    "created"      : for src                 make tgt.date = evaluate( src, now() )
endgroup
map "http://research.philips.com/fhir/r4/mapping/AdToMedicationRequest" =
    "R3 Parameters of Activitydefinition.$apply to MedicationRequest"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/MedicationRequest" as target

group main
    input src: Parameters as source
    input tgt: ReferralRequest as target

    "subject" : for src.parameter as p where name='subject' then {
            do: for p.value as sbj make tgt.subject = sbj
    }

    "practitioner" : for src.parameter as p where name='practitioner' then{
            doReq: for p.value as prac make tgt.requester = prac
            doRec: for p.value as prac make tgt.recorder = prac
        }

    "organization" : for src as src where
            parameter.where( name='practitioner').exists().not() and parameter.where( name='organization').exists()
        then{
            do: for src.parameter as p where name='organization' then{
                do: for p.value as org make tgt.requester = org
            }
        }

    "encounter" : for src.parameter as p where name='encounter' then {
        do: for p.value as enc make tgt.encounter = enc
    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: MedicationRequest as target

    "ad.code"      : for src.code     as code     make tgt.reasonCode = code
    "ad.priority"  : for src.priority as priority make tgt.priority = priority
    "ad.doNotPerform"  : for src.doNotPerform as doNotPerform make tgt.doNotPerform as doNotPerform
//    "ad.timing"    : for src.timing   as timing   make tgt.occurrence = timing
//    "ad.location"  : for src.location as location make tgt.site = location
    "ad.product"   : for src.product  as product  make tgt.medication = product
//    "ad.quantity"  : for src.quantity as quantity make tgt.quantity as tgt
//    "ad.bodysite"  : for src.bodySite as bodysite make tgt.bodySite = bodysite
    "ad.dosage"    : for src.dosage   as dosage   make tgt.dosageInstruction = dosage

    dispenseRequest: for src make tgt.dispenseRequest as dispenseRequest then {
        dr.q:   for src.quantity as quantity make dispenseRequest.quantity = quantity
        dr.di:  for src.timing : Duration as timing make dispenseRequest.dispenseInterval = timing
        dr.di:  for src.timing : Period   as timing make dispenseRequest.validityPeriod   = timing
    }

    "refAd"        : for src.url      as vvv make tgt.instantiatesCanonical = vvv
    "intent"       : for src                 make tgt.intent = "proposal"
    "status"       : for src                 make tgt.status = "active"
    "created"      : for src                 make tgt.authoredOn = evaluate( src, now() )
endgroup
map "http://research.philips.com/fhir/r4/mapping/AdToNutritionOrder" =
    "R3 Parameters of Activitydefinition.$apply to NutritionOrder"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/NutritionOrder" as target

group main
    input src: Parameters as source
    input tgt: ReferralRequest as target

    "subject" : for src.parameter as p where name='subject' then {
        do: for p.value as sbj make tgt.patient = sbj
    }

    "practitioner" : for src.parameter as p where name='practitioner' then{
            do: for p.value as prac make tgt.orderer = prac
        }

//    "organization" : for src as src where
//            parameter.where( name='practitioner').exists().not() and parameter.where( name='organization').exists()
//        then{
//            do: for src.parameter as p where name='organization' then{
//                do: for p.value as org make tgt.requester = org
//            }
//        }

    "encounter" : for src.parameter as p where name='encounter' then {
        do: for p.value as enc make tgt.encounter = enc
    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: NutritionOrder as target

    "ad.code1"          : for src where doNotPerform then {
            prMod: for src.code as code make tgt.foodPreferenceModifier = code
        }
    "ad.code2"          : for src where doNotPerform.not() then {
        prMod: for src.code as code make tgt.excludeFoodModifier = code
    }

//    "ad.priority"      : for src.priority     as priority     make tgt.priority as priority
//    "ad.doNotPerform"  : for src.doNotPerform as doNotPerform make tgt.priority as priority
//    "ad.timing"    : for src.timing   as timing   make tgt.occurrence = timing
//    "ad.location"  : for src.location as location make tgt.site = location
//    "ad.product"   : for src          as vvv check product.empty()
//    "ad.quantity"  : for src          as quantity make tgt.quantity = quantity
//    "ad.bodysite"  : for src.bodySite as bodysite make tgt.bodySite = bodysite
//    "ad.dosage"    : for src          as vvv check dosage.empty()

    "refAd"        : for src.url      as vvv make tgt.instantiatesCanonical = vvv
    "intent"       : for src                 make tgt.intent = "proposal"
    "status"       : for src                 make tgt.status = "active"
    "created"      : for src                 make tgt.dateTime = evaluate( src, now() )

endgroup
map "http://research.philips.com/fhir/r4/mapping/AdToServiceRequest" =
    "R3 Parameters of Activitydefinition.$apply to ServiceRequest"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/ServiceRequest" as target

group main
    input src: Parameters as source
    input tgt: ReferralRequest as target

    "subject" : for src.parameter as p where name='subject' then {
        do: for p.value as sbj make tgt.subject = sbj
    }

    "practitioner" : for src.parameter as p where name='practitioner' then{
            do: for p.value as prac make tgt.requester = prac
        }

    "organization" : for src as src where
            parameter.where( name='practitioner').exists().not() and parameter.where( name='organization').exists()
        then{
            do: for src.parameter as p where name='organization' then{
                do: for p.value as org make tgt.requester = org
            }
        }

    "encounter" : for src.parameter as p where name='encounter' then {
        do: for p.value as enc make tgt.encounter = enc
    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: ServiceRequest as target

    "refAd"        : for src.url      as vvv make tgt.instantiatesCanonical = vvv
    "status"       : for src                 make tgt.status = "draft"
    "intent"       : for src                 make tgt.intent = "proposal"
    "ad.code"      : for src.code     as vvv make tgt.code = vvv
    "ad.timing"    : for src.timing   as vvv make tgt.occurrence = vvv
    "ad.location"  : for src.location as vvv make tgt.locationReference = vvv
//    "ad.product"   : for src          as vvv check product.empty()
//    "ad.quantity"  : for src          as vvv check quantity.empty()
    "ad.bodysite"  : for src.bodySite as vvv make tgt.bodySite = vvv
//    "ad.dosage"    : for src          as vvv check dosage.empty()
endgroup
map "http://research.philips.com/fhir/r4/mapping/AdToSupplyRequest" =
    "R3 Parameters of Activitydefinition.$apply to SupplyRequest"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/SupplyRequest" as target

group main
    input src: Parameters as source
    input tgt: SupplyRequest as target

//    "subject" : for src.parameter as p where name='subject' then {
//        do: for p.value as sbj make tgt.subject = sbj
//    }

    "practitioner" : for src.parameter as p where name='practitioner' then{
        do: for p.value as prac make tgt.requester = prac
    }

    "organization" : for src.parameter as p where name='organization' then{
        do: for p.value as org make tgt.requester =org
    }

//    "encounter" : for src.parameter as p where name='encounter' then {
//        do: for p.value as enc make tgt.context = enc
//    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: SupplyRequest as target

    "ad.code"          : for src.code      as code         make tgt.item = code
    "ad.priority"      : for src.priority  as priority     make tgt.priority = priority
//    "ad.doNotPerform"  : for src.doNotPerform as doNotPerform make tgt.priority as priority
    "ad.timing"    : for src.timing   as timing   make tgt.occurrence = timing
//    "ad.location"  : for src.location as location make tgt.site = location
//    "ad.product"   : for src          as vvv check product.empty()
    "ad.quantity"      : for src.quantity  as quantity     make tgt.quantity = quantity
//    "ad.bodysite"  : for src.bodySite as bodysite make tgt.bodySite = bodysite
//    "ad.dosage"    : for src          as vvv check dosage.empty()

//    "refAd"        : for src.url      as vvv make tgt.instantiatesCanonical = vvv
    "status"       : for src                 make tgt.status = "draft"
    "authoredOn"   : for src                 make tgt.authoredOn = evaluate( src, now() )

endgroup
map "http://research.philips.com/fhir/r4/mapping/Task" =
    "R3 Parameters of Activitydefinition.$apply to Task"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/Task" as target

group main
    input src: Parameters as source
    input tgt: Task as target

    "for" : for src.parameter as p where name='subject' then {
        do: for p.value as sbj make tgt.for = sbj
    }

    "practitioner" : for src.parameter as p where name='practitioner' then{
            do: for p.value as prac make tgt.requester as requester then{
               do: for prac make requester.agent = prac
            }
        }

    "organization" : for src.parameter as p where name='organization' then {
            do: for p.value as org make tgt.requester as requester then {
                    do: for org make requester.onBehalfOf = org
                }
        }

    "encounter" : for src.parameter as p where name='encounter' then {
        do: for p.value as enc make tgt.encounter = enc
    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: ProcedureRequest as target

//    "basedOn"      : for src                 make tgt.basedOn = reference( src )
    refAd          : for src.url as can   make tgt.instantiatesCanonical = can
    "status"       : for src              make tgt.status = "draft"
    "ad.code"      : for src.code  as vvv make tgt.code = vvv
//    "ad.timing"    : for src          as vvv check timing.empty()  ==>restriction.period
//    "ad.location"  : for src          as vvv check location.empty()
//    "ad.product"   : for src          as vvv check product.empty()
//    "ad.quantity"  : for src          as vvv check quantity.empty()
//    "ad.bodysite"  : for src          as vvv check bodysite.empty()
//    "ad.dosage"    : for src          as vvv check dosage.empty()
//    "ad.relatedart": for src.relatedArtifact as relatedArtifact make tgt.payload as payload then {
//        do: for relatedArtifact as relatedArtifact make payload.content as content then {
//            "content": for relatedArtifact as vvv make content = vvv
//            "display" : for relatedArtifact.display as vvv make content
//            "citation": for relatedArtifact as vvv make content = vvv
//            "url"     : for relatedArtifact as vvv make content = vvv
//            "document": for relatedArtifact as vvv make content = vvv
//            "resource": for relatedArtifact as vvv make content = vvv
//        }
//    }
endgroup
map "http://research.philips.com/fhir/r4/mapping/AdToVisionPrescription" =
    "R3 Parameters of Activitydefinition.$apply to VisionPrescription"

uses "http://hl7.org/fhir/StructureDefinition/Parameters"       as source
uses "http://hl7.org/fhir/StructureDefinition/VisionPrescription" as target

group main
    input src: Parameters as source
    input tgt: VisionPrescription as target

    "subject" : for src.parameter as p where name='subject' then {
        do: for p.value as sbj make tgt.patient = sbj
    }

    "practitioner" : for src.parameter as p where name='practitioner' then{
        do: for p.value as prac make tgt.prescriber = prac
    }

//    "organization" : for src.parameter as p where name='organization' then{
//        do: for p.value as org make tgt.requester =org
//    }

    "encounter" : for src.parameter as p where name='encounter' then {
        do: for p.value as enc make tgt.encounter = enc
    }

    actded: for src.parameter as p where name='source' then {
        do: for p.resource as ad then createActDef( ad, tgt )
    }
    
endgroup

group createActDef
    input src: ActivityDefinition as source
    input tgt: VisionPrescription as target

//    "ad.code"          : for src.code      as code         make tgt.item = code
//    "ad.priority"      : for src.priority  as priority     make tgt.priority = priority
//    "ad.doNotPerform"  : for src.doNotPerform as doNotPerform make tgt.priority as priority
//    "ad.timing"    : for src.timing   as timing   make tgt.occurrence = timing
//    "ad.location"  : for src.location as location make tgt.site = location
//    "ad.product"   : for src          as vvv check product.empty()
//    "ad.quantity"      : for src.quantity  as quantity     make tgt.quantity = quantity
//    "ad.bodysite"  : for src.bodySite as bodysite make tgt.bodySite = bodysite
//    "ad.dosage"    : for src          as vvv check dosage.empty()

//    "refAd"        : for src.url      as vvv make tgt.instantiatesCanonical = vvv
    "status"       : for src              make tgt.status = "draft"
    "created"   : for src                 make tgt.created = evaluate( src, now() )

endgroup

Search parameters for this resource. See also the full list of search parameters for this resource, and check the Extensions registry for search parameters on extensions related to this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.

Name Type Description Expression In Common
composed-of reference What resource is being referenced ActivityDefinition.relatedArtifact.where(type='composed-of').resource
(Any)
6 Resources
context token A use context assigned to the activity definition (ActivityDefinition.useContext.value.ofType(CodeableConcept)) 30 Resources
context-quantity quantity A quantity- or range-valued use context assigned to the activity definition (ActivityDefinition.useContext.value.ofType(Quantity)) | (ActivityDefinition.useContext.value.ofType(Range)) 30 Resources
context-type token A type of use context assigned to the activity definition ActivityDefinition.useContext.code 30 Resources
context-type-quantity composite A use context type and quantity- or range-based value assigned to the activity definition On ActivityDefinition.useContext:
  context-type: code
  context-quantity: value.ofType(Quantity) | value.ofType(Range)
30 Resources
context-type-value composite A use context type and value assigned to the activity definition On ActivityDefinition.useContext:
  context-type: code
  context: value.ofType(CodeableConcept)
30 Resources
date date The activity definition publication date ActivityDefinition.date 30 Resources
depends-on reference What resource is being referenced ActivityDefinition.relatedArtifact.where(type='depends-on').resource | ActivityDefinition.library
(Library, Any)
6 Resources
derived-from reference What resource is being referenced ActivityDefinition.relatedArtifact.where(type='derived-from').resource
(Any)
10 Resources
description string The description of the activity definition ActivityDefinition.description 28 Resources
effective date The time during which the activity definition is intended to be in use ActivityDefinition.effectivePeriod 12 Resources
identifier token External identifier for the activity definition ActivityDefinition.identifier 36 Resources
jurisdiction token Intended jurisdiction for the activity definition ActivityDefinition.jurisdiction 26 Resources
kind token The kind of activity definition ActivityDefinition.kind
name string Computationally friendly name of the activity definition ActivityDefinition.name 27 Resources
predecessor reference What resource is being referenced ActivityDefinition.relatedArtifact.where(type='predecessor').resource
(Any)
10 Resources
publisher string Name of the publisher of the activity definition ActivityDefinition.publisher 30 Resources
status token The current status of the activity definition ActivityDefinition.status 36 Resources
successor reference What resource is being referenced ActivityDefinition.relatedArtifact.where(type='successor').resource
(Any)
6 Resources
title string The human-friendly name of the activity definition ActivityDefinition.title 27 Resources
topic token Topics associated with the module ActivityDefinition.topic 10 Resources
url uri The uri that identifies the activity definition ActivityDefinition.url 35 Resources
version token The business version of the activity definition ActivityDefinition.version 31 Resources