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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to view patients readmitted within 30 days?

Status
Not open for further replies.

beacon5

Programmer
Dec 29, 2008
74
0
0
US
Hi everybody,

[Crystal Reports 2008]

I'm attempting to write a report that will show patients that have readmitted within 30 days of their previous discharge date. I found a similar post that addresses the same question and is almost identical to my situation except for the fact that I have two additional requirements that seems to be messing up my report.

The first additional requirement is that {table.program} cannot be equal to "PREADMIT" or "OUTPATIENT" and it cannot affect the other records that display. I've added this to my record selection formula, but it doesn't appear to have any effect on records that are returned (i.e. a couple of records are displaying based on the dates for a "PREADMIT" discharge date and the subsequent admission date). For reference, some patients will be admitted to "PREADMIT" episodes for a single day, while others may be in the episode for months.

Here's my record selection formula (for reference - {@StartDate} = CurrentDate-30, {@EndDate} = CurrentDate):
Code:
{table.program} <> "PREADMIT"

And

(
    {table.dischargedate} In ({@StartDate}-30) To {@EndDate} 

    Or
    
    {table.admissiondate} In {@StartDate} To {@EndDate}
)

I have two patients within the date range that had a "PREADMIT" either before or after the record, and the calculation isn't adjusting properly.

Here's a sample of the data:
Code:
ID: 10
    Episode    AdmitDate    DischargeDate    Program
    2          11/12/2011   11/27/2011       BEHAVIORAL

ID: 20
    Episode    AdmitDate    DischargeDate    Program
    4          07/20/2011   10/26/2011       ACUTE

Patient ID# 10 in the sample only has two episodes, the one shown above and episode 1 (not shown, with an AdmitDate and DischargeDate of 11/12/2011), which has a program value of "PREADMIT". Since "PREADMIT" should have been eliminated by the record selection, I'm baffled why the record for this patient is still showing up.

Patient ID# 20 is similar in that it also has a "PREADMIT" episode, but the "PREADMIT" for this patient appears in episode 5 (AdmitDate is within the date range), after the episode shown in the sample.

The second additional requirement, which isn't truly necessary if it isn't possible but was asked for by the requestor, is that if a patient was readmitted within 30 days, the previous record (that doesn't have a "PREADMIT" or "OUTPATIENT" program value), needs to display with the record that shows the readmit to show the continuity from one episode to the next.

Just for additional reference, I'm using the following suppression formula for the group header, details, and group footer sections (I've tried multiple variations of this to get the "PREADMIT" to work correctly, but none have been successful):
Code:
(
    {@MPI} = Next({@MPI}) 

    And

    DateDiff("d", {table.dischargedate}, Next({table.admissiondate})) > 30
) 

Or

(
    {@MPI} = Previous({@MPI})

    And

    DateDiff("d", Previous({table.dischargedate}), {table.admissiondate}) > 30    
) 

Or

Count({@MPI}, {@MPI}) = 1

Sorry for the novel and thanks for the help,
beacon
 
not({table.program} in ["PREADMIT","OUTPATIENT"]) and //etc.

I don't see anything else incorrect, so I'm wondering what your entire selection formula looks like, if you are not showing the entire thing.

It might help to see what your data looks like before suppression, with several variations. Then show what you would expect to be displayed for that sample.

-LB
 
you have nothing just in case there is a null value in the field. I have found that if there are null values and you do not compensate that there is a null value you get no data.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top