Sequential functions
Nic Dobbins edited this page Jul 25, 2022
·
9 revisions
seq()
is a wrapper function which should be used for any case where one criterion depends temporally on another.
Arguments -
- The "anchor" function representing the first event.
- A
before()
,during()
, orafter()
function represents the next event in the sequence.
Example -
'INC'
'- Present to Stanford Emergency Department as a trauma with a major operative
lower extremity injury'
'- enc() to loc(hosp("Stanford Emergency Department")) as a obs("trauma") with a
mod("major operative lower extremity") obs("injury")'
seq(
enc()
.loc(hosp("Stanford Emergency Department")),
during(
obs("trauma")
),
during(
obs("injury")
.mod("major operative lower extremity")
)
)
after()
represents an event which follows its preceding argument inside a seq()
function.
Arguments -
- A function.
Example -
'EXC'
'patients referred to other hospital within 30 days after admission'
'patients enc(REFERRAL) to other hosp("hospital")
eq(op(LTEQ), temporal_unit(DAY), val("30") after enc(INPATIENT)'
seq(
enc(INPATIENT),
after(
enc(REFERRAL)
.loc(hosp("hospital")),
eq(op(LTEQ), temporal_unit(DAY), val("30"))
)
)
before()
represents an event which occurs before the previous argument inside a seq()
function.
Arguments -
- A function.
Example -
'EXC'
'- pre - operative opioid usage within the last six months'
'- pre - proc("operative") drug("opioid") usage
eq(op(LTEQ), temporal_per(PAST), val("six"), temporal_unit(MONTH))'
seq(
drug("opioid")
.temporality(
eq(op(LTEQ), temporal_per(PAST), val("six"), temporal_unit(MONTH))
),
before(
proc("operative")
)
)
during()
represents an event which occurs at the same time or in the same encounter as the previous argument inside a seq()
function.
Arguments -
- A function.
Example -
'EXC'
'- history of medication for PE treatment at the time of first admission'
'- eq(temporal_per(PAST)) of drug() for cond("PE") treatment at the time
of eq(temporal_rec(FIRST_TIME)) enc(INPATIENT)'
seq(
drug()
.temporality(
eq(temporal_per(PAST))
)
.for(
cond("PE")
),
during(
enc(INPATIENT)
.temporality(
eq(temporal_rec(FIRST_TIME))
)
)
)