Hi CRXI Gurus,
My purpose is to find out after a client is discharged from an inpatient unit when and where are their next 3 outpatient services.
1. I have a report with a main report that shows inpatient discharges only. Then a subreport with next outpatient service in the group header.
2. I now need to find the next 3 outpatient services.
a. I tried a DO/While loop with a counter but I am getting a count of 2 every time. Here is my code:
StringVar Array ServiceCnt;
StringVar SVCNT;
NumberVar CNTR:= 1;
While CNTR < 3 Do
(
SVCNT:= if (previous ({billing_tx_history.date_of_service}) <> {billing_tx_history.date_of_service} and
previous ({billing_tx_history.SERVICE_CODE})<> {billing_tx_history.SERVICE_CODE}) then
{billing_tx_history.program_code}&" " &{billing_tx_history.program_value}&" " & {billing_tx_history.date_of_service}&" "& {billing_tx_history.SERVICE_CODE}&" " & {billing_tx_history.v_service_value}& CNTR;
CNTR:=CNTR+1;
);
SVCNT;
It seems an easy enough concept but I just don’t know the coding well enough.
Thank you for your help in advance
Kevin