ok... here goes:
The report is grouped by patient name, then by PATID. For each ID, the subreport is launched. Parameters relayed are {PATID}, {?StartDate}, and {?EndDate}.
The selection criteria for the subreport is:
{SSVIEW_PATIENT_DATA.PATID} = {?Pm-SSVIEW_PATIENT_DATA.PATID} and
{SSVIEW_PATIENT_DATA.DATE_OF_ADMISSION} in ({?Pm-?Start Date} - 180) to {?Pm-?End Date} and
{SSVIEW_PATIENT_DATA.CURRENT_PROGRAM_VALUE} <> "PREADMIT"
Basically, for each patid it grabs the start date of the parent report and subtracts 180 days. The query then pulls all records within 180 days prior to the start date through the end date parameter.
From there, they're sorted by {SSVIEW_PATIENT_DATA.DATE_OF_ADMISSION}, in descending order.
What is being tracked from here is previous admissions within 30 days. I'm using a CrRed for inside of 30 days and CrBlue for 31-180 days prior to the most recent date of admission. Thats probably irrelevant though.
Now, I do need to count how many subreports have previous admissions within 30 days of the current admission date. However, there will be a subreport for every patient admitted within the date range parameters, and this number will vary.
Am I talking in circles here? I'm trying to fix old reports that someone else wrote back in the dark ages and plan a BOEXI rollout, so sometimes the ADD kicks in and I start thinking I'm a jedi or something.
