DESCRIPTION |
This is a generalized function for returning the difference between
Note that if the second date is after the first date, the difference
will be negative. If the optional last argument of "A" is present, then the
absolute value of the difference will be returned.
Some examples:
DTIME_DIFF(1,2,"DATE",8,3,"ADMISSION DATE/TIME","H","A")<24
This will be true if the date specified by finding 1 occurrence 2,
two dates. The arguments to the function are:
CSUB "DATE", and the date specified by finding 8 occurrence 3 CSUB
"ADMISSION DATE/TIME" are less than 24 hours apart.
DTIME_DIFF(1,1,"STOP DATE",8,2,"DATE","D")<-6
This will be true if the date specified by finding 8 occurrence 2
CSUB "DATE" is more than 6 days after the date specified by finding
1 occurrence 1, CSUB "STOP DATE".
Immunization findings can have associated contraindications and refusals.
To use them in the DTIME_DIFF function, precede the finding numbers with
a 'C' or 'R'. For example, if finding 2 is an immunization and we need to
determine if there have been 2 refusals within a 30-day period the
function string is:
DTIME_DIFF(R2,2,"DATE",R2,1,"DATE","D")<31
DTIME_DIFF(F1,O1,C1,F2,O2,C2,"U","A")
where F is the finding number, O is the occurrence, and C is the CSUB.
U specifies the units in which to return the difference. The possible
values for the units are "S" (seconds), "M" (minutes), "H" (hours),
and "D" (days).
|