@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<http://hl7.org/fhir/OperationDefinition/ActivityDefinition-apply> a fhir:OperationDefinition ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "ActivityDefinition-apply"] ; # 
  fhir:text [
     fhir:status [ fhir:v "generated" ] ;
     fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: OperationDefinition ActivityDefinition-apply</b></p><a name=\"ActivityDefinition-apply\"> </a><a name=\"hcActivityDefinition-apply\"> </a><p>URL: [base]/ActivityDefinition/$apply</p><p>URL: [base]/ActivityDefinition/[id]/$apply</p><h3>Parameters</h3><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>activityDefinition</td><td>type</td><td>0..1</td><td><a href=\"activitydefinition.html\">ActivityDefinition</a></td><td/><td><div><p>The activity definition to apply. If the operation is invoked on an instance, this parameter is not allowed. If the operation is invoked at the type level, this parameter is required</p>\n</div></td></tr><tr><td>IN</td><td>subject</td><td/><td>1..*</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The subject(s) that is/are the target of the activity definition to be applied. The subject may be a Patient, Practitioner, Organization, Location, Device, or Group. Subjects provided in this parameter will be resolved as the subject of the PlanDefinition based on the type of the subject. If multiple subjects of the same type are provided, the behavior is implementation-defined</p>\n</div></td></tr><tr><td>IN</td><td>encounter</td><td/><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The encounter in context, if any</p>\n</div></td></tr><tr><td>IN</td><td>practitioner</td><td/><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The practitioner in context</p>\n</div></td></tr><tr><td>IN</td><td>organization</td><td/><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The organization in context</p>\n</div></td></tr><tr><td>IN</td><td>userType</td><td/><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.)</p>\n</div></td></tr><tr><td>IN</td><td>userLanguage</td><td/><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>Preferred language of the person using the system</p>\n</div></td></tr><tr><td>IN</td><td>userTaskContext</td><td/><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources</p>\n</div></td></tr><tr><td>IN</td><td>setting</td><td/><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>The current setting of the request (inpatient, outpatient, etc.)</p>\n</div></td></tr><tr><td>IN</td><td>settingContext</td><td/><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>Additional detail about the setting of the request, if any</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>1..1</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>The resource that is the result of applying the definition</p>\n</div></td></tr></table><div><p>The result of invoking this operation is a resource of the type specified by the activity definition, with all the definitions resolved as appropriate for the type of resource. Any dynamicValue elements will be evaluated (in the order in which they appear in the resource) and the results applied to the returned resource.  If the ActivityDefinition includes library references, those libraries will be available to the evaluated expressions. If those libraries have parameters, those parameters will be bound by name to the parameters given to the operation. In addition, parameters to the $apply operation are available within dynamicValue expressions as context variables, accessible by the name of the parameter, prefixed with a percent (%) symbol. For a more detailed description, refer to the ActivityDefinition resource. 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.</p>\n</div></div>"^^rdf:XMLLiteral ]
  ] ; # 
  fhir:extension ( [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm>
     ] ;
     fhir:value [
       a fhir:Integer ;
       fhir:v 3
     ]
  ] [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status>
     ] ;
     fhir:value [
       a fhir:Code ;
       fhir:v "normative"
     ]
  ] [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/structuredefinition-wg>
     ] ;
     fhir:value [
       a fhir:Code ;
       fhir:v "cds"
     ]
  ] ) ; # 
  fhir:url [
     fhir:v "http://hl7.org/fhir/OperationDefinition/ActivityDefinition-apply"^^xsd:anyURI ;
     fhir:l <http://hl7.org/fhir/OperationDefinition/ActivityDefinition-apply>
  ] ; # 
  fhir:version [ fhir:v "6.0.0-ballot4"] ; # 
  fhir:name [ fhir:v "Apply"] ; # 
  fhir:title [ fhir:v "Apply"] ; # 
  fhir:status [ fhir:v "active"] ; # 
  fhir:kind [ fhir:v "operation"] ; # 
  fhir:experimental [ fhir:v false] ; # 
  fhir:date [ fhir:v "2026-06-25T05:29:09+00:00"^^xsd:dateTime] ; # 
  fhir:publisher [ fhir:v "HL7 International / Clinical Decision Support"] ; # 
  fhir:contact ( [
     fhir:telecom ( [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "http://hl7.org/fhir" ]
     ] [
       fhir:system [ fhir:v "email" ] ;
       fhir:value [ fhir:v "fhir@lists.hl7.org" ]
     ] )
  ] [
     fhir:telecom ( [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "http://www.hl7.org/Special/committees/dss" ]
     ] )
  ] ) ; # 
  fhir:description [ fhir:v "The apply operation applies a definition in a specific context"] ; # 
  fhir:jurisdiction ( [
     fhir:coding ( [
       fhir:system [
         fhir:v "http://unstats.un.org/unsd/methods/m49/m49.htm"^^xsd:anyURI ;
         fhir:l <http://unstats.un.org/unsd/methods/m49/m49.htm>
       ] ;
       fhir:code [ fhir:v "001" ] ;
       fhir:display [ fhir:v "World" ]
     ] )
  ] ) ; # 
  fhir:affectsState [ fhir:v false] ; # 
  fhir:code [ fhir:v "apply"] ; # 
  fhir:comment [ fhir:v "The result of invoking this operation is a resource of the type specified by the activity definition, with all the definitions resolved as appropriate for the type of resource. Any dynamicValue elements will be evaluated (in the order in which they appear in the resource) and the results applied to the returned resource.  If the ActivityDefinition includes library references, those libraries will be available to the evaluated expressions. If those libraries have parameters, those parameters will be bound by name to the parameters given to the operation. In addition, parameters to the $apply operation are available within dynamicValue expressions as context variables, accessible by the name of the parameter, prefixed with a percent (%) symbol. For a more detailed description, refer to the ActivityDefinition resource. 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."] ; # 
  fhir:resource ( [
     fhir:v "ActivityDefinition"^^xsd:anyURI ;
     fhir:l fhir:ActivityDefinition
  ] ) ; # 
  fhir:system [ fhir:v false] ; # 
  fhir:type [ fhir:v true] ; # 
  fhir:instance [ fhir:v true] ; # 
  fhir:parameter ( [
     fhir:name [ fhir:v "activityDefinition" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:scope ( [ fhir:v "type" ] ) ;
     fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "The activity definition to apply. If the operation is invoked on an instance, this parameter is not allowed. If the operation is invoked at the type level, this parameter is required" ] ;
     fhir:type [
       fhir:v "ActivityDefinition"^^xsd:anyURI ;
       fhir:l fhir:ActivityDefinition
     ]
  ] [
     fhir:name [ fhir:v "subject" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v "1"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "*" ] ;
     fhir:documentation [ fhir:v "The subject(s) that is/are the target of the activity definition to be applied. The subject may be a Patient, Practitioner, Organization, Location, Device, or Group. Subjects provided in this parameter will be resolved as the subject of the PlanDefinition based on the type of the subject. If multiple subjects of the same type are provided, the behavior is implementation-defined" ] ;
     fhir:type [
       fhir:v "string"^^xsd:anyURI ;
       fhir:l fhir:string
     ] ;
     fhir:searchType [ fhir:v "reference" ]
  ] [
     fhir:name [ fhir:v "encounter" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "The encounter in context, if any" ] ;
     fhir:type [
       fhir:v "string"^^xsd:anyURI ;
       fhir:l fhir:string
     ] ;
     fhir:searchType [ fhir:v "reference" ]
  ] [
     fhir:name [ fhir:v "practitioner" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "The practitioner in context" ] ;
     fhir:type [
       fhir:v "string"^^xsd:anyURI ;
       fhir:l fhir:string
     ] ;
     fhir:searchType [ fhir:v "reference" ]
  ] [
     fhir:name [ fhir:v "organization" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "The organization in context" ] ;
     fhir:type [
       fhir:v "string"^^xsd:anyURI ;
       fhir:l fhir:string
     ] ;
     fhir:searchType [ fhir:v "reference" ]
  ] [
     fhir:name [ fhir:v "userType" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.)" ] ;
     fhir:type [
       fhir:v "CodeableConcept"^^xsd:anyURI ;
       fhir:l fhir:CodeableConcept
     ]
  ] [
     fhir:name [ fhir:v "userLanguage" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "Preferred language of the person using the system" ] ;
     fhir:type [
       fhir:v "CodeableConcept"^^xsd:anyURI ;
       fhir:l fhir:CodeableConcept
     ]
  ] [
     fhir:name [ fhir:v "userTaskContext" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources" ] ;
     fhir:type [
       fhir:v "CodeableConcept"^^xsd:anyURI ;
       fhir:l fhir:CodeableConcept
     ]
  ] [
     fhir:name [ fhir:v "setting" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "The current setting of the request (inpatient, outpatient, etc.)" ] ;
     fhir:type [
       fhir:v "CodeableConcept"^^xsd:anyURI ;
       fhir:l fhir:CodeableConcept
     ]
  ] [
     fhir:name [ fhir:v "settingContext" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v "0"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "Additional detail about the setting of the request, if any" ] ;
     fhir:type [
       fhir:v "CodeableConcept"^^xsd:anyURI ;
       fhir:l fhir:CodeableConcept
     ]
  ] [
     fhir:name [ fhir:v "return" ] ;
     fhir:use [ fhir:v "out" ] ;
     fhir:min [ fhir:v "1"^^xsd:nonNegativeInteger ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "The resource that is the result of applying the definition" ] ;
     fhir:type [
       fhir:v "Resource"^^xsd:anyURI ;
       fhir:l fhir:Resource
     ]
  ] ) . # 

# -------------------------------------------------------------------------------------

