This
page
is
part
of
the
FHIR
Specification
(v3.0.2:
(v4.0.1:
R4
-
Mixed
Normative
and
STU
3).
)
in
it's
permanent
home
(it
will
always
be
available
at
this
URL).
The
current
version
which
supercedes
this
version
is
5.0.0
.
For
a
full
list
of
available
versions,
see
the
Directory
of
published
versions
.
Page
versions:
R5
R4B
R4
R3
R4
R3
For
more
information
about
operations,
including
how
they
are
invoked,
see
Operations
.
12.18.10.1
Apply
The
apply
operation
realizes
a
definition
in
a
specific
context
The
official
URL
for
this
operation
definition
is
http://hl7.org/fhir/OperationDefinition/ActivityDefinition-apply
Formal
Definition
(as
a
OperationDefinition
).
URL:
[base]/ActivityDefinition/[id]/$apply
This
is
not
an
idempotent
operation
In
Parameters:
Name
Cardinality
Type
Binding
Profile
Documentation
patient
1..1
Reference
(
Patient
)
The
patient
that
is
the
target
of
the
activity
to
be
applied
encounter
0..1
Reference
(
Encounter
)
The
encounter
in
context,
if
any
practitioner
0..1
Reference
(
Practitioner
)
The
practitioner
in
context
organization
0..1
Reference
(
Organization
)
The
organization
in
context
userType
0..1
CodeableConcept
The
type
of
user
initiating
the
request,
e.g.
patient,
healthcare
provider,
or
specific
type
of
healthcare
provider
(physician,
nurse,
etc.)
userLanguage
0..1
CodeableConcept
Preferred
language
of
the
person
using
the
system
userTaskContext
0..1
CodeableConcept
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
setting
0..1
CodeableConcept
The
current
setting
of
the
request
(inpatient,
outpatient,
etc)
settingContext
0..1
CodeableConcept
Additional
detail
about
the
setting
of
the
request,
if
any
Out
Parameters:
Name
Cardinality
Type
Binding
Profile
Documentation
return
1..1
Any
The
resource
that
is
the
result
of
applying
the
definition
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
and
the
resulting
value
used
for
the
values
of
the
appropriate
elements
of
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
12.18.10.1.1
Examples
Apply
a
citalopram
prescription
activity
definition
to
a
patient
(Request):
GET [base]/ActivityDefinition/citalopramPrescription/$apply?patient=124
Returned
on
successful
application
(Response):
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<MedicationRequest xmlns="http://hl7.org/fhir">
<!-- This example demonstrates the result of an $apply operation for the citalopramPrescription activity definition. -->
<id value="apply-operation-response"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
Generated...
</div>
</text>
<contained>
<Medication>
<id value="citalopramMedication"/>
<code>
<coding>
<system value="http://www.nlm.nih.gov/research/umls/rxnorm"/>
<code value="200371"/>
</coding>
<text value="citalopram"/>
</code>
<form>
<coding>
<system value="http://snomed.info/sct"/>
<code value="385055001"/>
<display value="Tablet dose form"/>
</coding>
<text value="Tablet dose form"/>
</form>
<ingredient>
<itemReference>
<reference value="#citalopramSubstance"/>
</itemReference>
<amount>
<numerator>
<value value="20"/>
<unit value="mg"/>
</numerator>
<denominator>
<value value="1"/>
<unit value="{tbl}"/>
</denominator>
</amount>
</ingredient>
</Medication>
</contained>
<contained>
<Substance>
<id value="citalopramSubstance"/>
<code>
<coding>
<system value="http://www.nlm.nih.gov/research/umls/rxnorm"/>
<code value="2556"/>
</coding>
<text value="citalopram"/>
</code>
</Substance>
</contained>
<definition>
<reference value="ActivityDefinition/citalopramPrescription"/>
</definition>
<status value="draft"/>
<intent value="proposal"/>
<medicationReference>
<reference value="#citalopramMedication"/>
</medicationReference>
<subject>
<reference value="Patient/124"/>
</subject>
<dosageInstruction>
<text value="1 tablet oral 1 time daily"/>
<timing>
<repeat>
<frequency value="1"/>
<period value="1"/>
<periodUnit value="d"/>
</repeat>
</timing>
<route>
<coding>
<code value="26643006"/>
<display value="Oral route (qualifier value)"/>
</coding>
<text value="Oral route (qualifier value)"/>
</route>
<doseQuantity>
<value value="1"/>
<unit value="{tbl}"/>
</doseQuantity>
</dosageInstruction>
<dispenseRequest>
<numberOfRepeatsAllowed value="3"/>
<quantity>
<value value="30"/>
<unit value="{tbl}"/>
</quantity>
</dispenseRequest>
</MedicationRequest>
12.18.10.2
Data
Requirements
The
data-requirements
operation
aggregates
and
returns
the
parameters
and
data
requirements
for
the
activity
definition
and
all
its
dependencies
as
a
single
module
definition
library
The
official
URL
for
this
operation
definition
is
http://hl7.org/fhir/OperationDefinition/ActivityDefinition-data-requirements
Formal
Definition
(as
a
OperationDefinition
).
URL:
[base]/ActivityDefinition/[id]/$data-requirements
This
is
not
an
idempotent
operation
Out
Parameters:
Name
Cardinality
Type
Binding
Profile
Documentation
return
1..1
Library
The
result
of
the
requirements
gathering
represented
as
a
module-definition
Library
that
describes
the
aggregate
parameters,
data
requirements,
and
dependencies
of
the
activity
definition
Note:
as
this
the
only
out
parameter,
it
is
a
resource,
and
it
has
the
name
'return',
the
result
of
this
operation
is
returned
directly
as
a
resource
The
effect
of
invoking
this
operation
is
to
determine
the
aggregate
set
of
data
requirements
and
dependencies
for
the
activity
definition.
The
result
is
a
Library
resource
with
a
type
of
module-definition
that
contains
all
the
parameter
definitions
and
data
requirements
of
the
activity
definition
and
any
libraries
referenced
by
it.
Implementations
SHOULD
aggregate
data
requirements
intelligently
(i.e.
by
collapsing
overlapping
data
requirements)
12.18.10.2.1
Examples
Request
data
requirements
for
the
administer
zika
virus
exposure
assessment
activity
definition
(Request):
GET [base]/ActivityDefinition/administer-zika-virus-exposure-assessment/$data-requirements
Returned
on
successful
evaluation
(Response):
HTTP/1.1 200 OK
{
"resourceType": "Library",
"type": {
"coding": [
{
"code": "module-definition"
}
]
},
"relatedArtifact": [
{
"type": "depends-on",
"display": "Zika Affected Areas",
"resource": {
"reference": "ValueSet/zika-affected-areas"
}
},
{
"type": "depends-on",
"display": "Pregnancy",
"resource": {
"identifier": "urn:oid:X.Y.Z",
"display": "Pregnancy value set"
}
},
{
"type": "depends-on",
"display": "Zika Exposure Assessment",
"resource": {
"identifier": "urn:oid:X.Y.Z",
"display": "Zika Virus Exposure Assessment value set"
}
},
{
"type": "depends-on",
"display": "Zika Virus Signs and Symptoms",
"url": "https://phinvads.cdc.gov/vads/ViewValueSet.action?oid=2.16.840.1.114222.4.11.7459",
"resource": {
"identifier": "urn:oid:2.16.840.1.114222.4.11.7459",
"display": "Zika Virus Signs and Symptoms value set"
}
},
]
"dataRequirement": [
{
"type": "Condition",
"codeFilter": [
{
"path": "code",
"valueSetString": "Pregnancy"
}
]
},
{
"type": "Patient"
},
{
"type": "Observation",
"codeFilter": [
{
"path": "code",
"valueSetString": [
"Zika Exposure Assessment"
]
},
{
"path": "status",
"valueCode": [
"final"
]
}
]
},
{
"type": "Condition",
"codeFilter": [
{
"path": "category",
"valueCode": [
"diagnosis"
]
},
{
"path": "clinicalStatus",
"valueCode": [
"confirmed"
]
},
{
"path": "code",
"valueSetString": "Zika Virus Signs and Symptoms"
}
]
}
]
}