hmmm... what if there are a varying number of subreports?
Basically, this report grabs hospital admissions for a given date range. Then for each patient, the subreport checks the past 180 days (from the beginning date of the report) for recent admissions.
You need to provide more information, if you would like help, e.g., your report structure, what groups you are using, where the subreports are located (what report section), what you are trying to summarize from each subreport, and where you want to show the summary.
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.
if {table.admissiondate} = maximum({table.admissiondate},{table.PatientID}) and
datediff("d",next({table.admissiondate}),{table.admissiondate}) <= 30 then
win30days := 1 else
win30days := win30days;
Place this in the detail section of the subreport. Be sure that the subreport is sorted in descending order by date (or change the formula to use previous() instead of next()).
You didn't say in what patientID group section the sub was located, so let's say it is in GH_b. Insert a GH_c (this section can be suppressed), and place the following formula in it:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.