cancel
Showing results for 
Search instead for 
Did you mean: 

Report to capture patients with certain lab tests

cothmer
Participant
0 Kudos

I am trying to write a report to capture only the patients that had certain lab tests done. So for example I need everyone that had test A and they also had tests B,C,D. If I just use the in function of in [A,B,C,D] then I get everyone that had one those tests not the patients that had A and B,C or D. What is the best way to write this in Crystal Reports ?

Accepted Solutions (0)

Answers (2)

Answers (2)

cothmer
Participant
0 Kudos

Brian - I put all of the exams in the report using an 'in' statement. Some patients only have one of the exams, etc....In your post it says to suppress the groups that don't have exam A,B,C,D, How do I suppress those ?

former_member292966
Active Contributor
0 Kudos

Hi Curt,

Using the In function is the same a using an OR comparison. If you use AND then you could potentially give you partial returns as well.

Have the report get all patients that have Exam A, B, C and D.

Create a group on patient.

Suppress the groups that don't contain Exam A, B, C, and D. Now it's a matter of how to determine if all 4 exams were done. One way to do this is to create a formula like:

If {table.EXAM} In ["A", "B", "C", "D"] Then 
    1 
Else 0; 
Drop this formula into the Detail section.

Now you can do a Sum on this formula and drop the summary into the Group Footer.

Create a Group Selection Formula where the formula >= 4.

So it should only list patients that have had all 4 exams.

Good luck,

Brian