Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pull 30 day readmission data in Crystal Reports

Status
Not open for further replies.

39291

Technical User
Oct 25, 2011
1
US
Hi,

I am newbie in Crystal Reports and I am having some trouble pulling data for patients who were readmitted within 30 days.
It seems like I have complicated database to pull data from.

First of all i have narrowed down to Inpatient by putting the Inpatient code in Select Expert section. I also have inputted my starting date and ending date which works as my parameter.

The next step was to create a new formula fields called {between 1and31}. the formula i have created says DateDiff('d',{@DateAdmitted},{@DateDischarged}). However, this only calculates Length of Stay.

Therefore, i tried changing this formula to DateDiff('d',{@DateAdmitted},Previous{@DateDischarged}). But i have two major problems with this formula. First of all, for some reason Crystal Reports don't let me use {between1and31} formula fields in select expert. It says 'This formula cannot be used because it must be evaluated later'.

Second problem i have with this formula is that it seems like it doesn't include previous dates when calculating readmission days. Example: patient1 admitted 2/1/2011 discharged 2/18/2011 and patient1 admitted 3/1/2011 discharged 3/5/2011. If i set my parameter 3/1/2011 to 3/31/2011, readmission come out to be 0 but it suppose to be 3/1/2011 - 2/18/2011. but it seems like it is excluding 2/18/2011 because i set my date parameter as 3/1/2011 to 3/31/2011.

I want to capture patients who were readmitted within 30days and calculating with the dates that is out of date parameter.
Can someone please help me solve this problem? Thank you guys!!
 
Use a selection formula like this:

(
{@DateDischarged} in minimum({?DateRange})-30 to maximum({@DateRange}) or
{@DateAdmitted} in {?DateRange}
)

Then go to the section expert->details->suppress->x+2 and enter
(assuming a group on {table.patient}):

(
{table.patient} = next({table.patient}) and
datediff("d",{@DateDischarged},next({DateAdmitted}))>30
) or
(
{table.patient} = previous({table.patient}) and
datediff("d",previous({@DateDischarged}),{DateAdmitted})>30
) or
count({table.patient},{table.patient}) = 1

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top