Below you will find the code used to run the report, this is the report that came with CPS, unless you have another one that i can see that code on, this is the concept that report is working with. So it looks like you might need to create a form with the OBS Terms in them for it to trigger that action on the report.
HDID's:
22297 - ROI REASON
22291 - ROI DTE RCVD
62091 - ROI METHOD
22292 - ROI DTE SENT
43789 - ROI MH SD DT
43790 - ROI DA SD DT
43791 - ROI HA SD DT
43792 - ROI GT SD DT
43793 - ROI DD SD DT
43794 - ROI EN SD DT
43795 - ROI LR SD DT
43796 - ROI XR SD DT
43797 - ROI OR SD DT
43798 - ROI CR SD DT
43799 - ROI ER SD DT
43800 - ROI RR SD DT
43801 - ROI PL SD DT
43802 - ROI ML SD DT
43803 - ROI AL SD DT
43804 - ROI IR SD DT
43805 - ROI OT SD DT
if(({RPTOBS.HDID} = 22291.00) and
(Date({RPTOBS.OBSVALUE}) >= {?startdate})
) then
(
local NumberVar recvdDayOfWeek := Dayofweek(cdate({RPTOBS.OBSVALUE}));
if(Date({RPTOBS.OBSVALUE}) + 6 <= ({?enddate})) then
(
bRecvd := true;
)
else if ((recvdDayOfWeek = 1) OR
(recvdDayOfWeek = 2)) AND
(Date({RPTOBS.OBSVALUE}) + 4 <= ({?enddate}+1)) then
(
bRecvd := true;
)
else if (recvdDayOfWeek = 7) And
(Date({RPTOBS.OBSVALUE}) + 5 <= ({?enddate}+1)) then
(
bRecvd := true;
);
if
( (instr(SentDatesList, ToText(Date({RPTOBS.OBSVALUE})) + "^") > 0) OR
(instr(SentDatesList, ToText(Date({RPTOBS.OBSVALUE}) + 1) + "^") > 0) OR
(instr(SentDatesList, ToText(Date({RPTOBS.OBSVALUE}) + 2) + "^") > 0) OR
(instr(SentDatesList, ToText(Date({RPTOBS.OBSVALUE}) + 3) + "^") > 0)
) then
(
bSent := true;
)
else if(
( recvdDayOfWeek = 4) OR
( recvdDayOfWeek = 5) OR
( recvdDayOfWeek = 6)
) AND ( (instr(SentDatesList, ToText(Date({RPTOBS.OBSVALUE}) + 4) + "^") > 0) OR
(instr(SentDatesList, ToText(Date({RPTOBS.OBSVALUE}) + 5) + "^") > 0) )
then
(
bSent := true;
)
else if ( recvdDayOfWeek = 7) AND (instr(SentDatesList, ToText(Date({RPTOBS.OBSVALUE}) + 4) + "^") > 0)
then
(
bSent := true;
)
);
if( (bMethod = false) and
({RPTOBS.HDID} = 62091.00) and
(lowercase({RPTOBS.OBSVALUE}) = "electronic")
) then
(
bMethod := true;
);
// Added the below condition for the 3rd obsterm ROI reason for the request made
if( (bReason = false) and
({RPTOBS.HDID} = 22297.00) and
(lowercase({RPTOBS.OBSVALUE}) = "copy for patient")
) then
(
bReason := true;
);
if(
({RPTOBS.HDID} in [22292.00, 43789.00, 43790.00, 43791.00, 43792.00, 43793.00,
43794.00, 43795.00, 43796.00, 43797.00, 43798.00, 43799.00,
43800.00, 43801.00, 43802.00, 43803.00, 43804.00, 43805.00])
) then
(
if (instr(SentDatesList, {RPTOBS.OBSVALUE} + "^") = 0) then
SentDatesList := SentDatesList + ToText(Date({RPTOBS.OBSVALUE})) + "^";
);
Posted : January 14, 2014 12:27 am