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

Group supression 1

Status
Not open for further replies.

Spenello

MIS
Jul 11, 2005
39
0
0
US
Using CR 8.5. We have patients, allergies, and allergy codes.
- Some patients have allergies. Some do not.
- Some allergies are coded. Some are uncoded (null codes).
How can patients with only uncoded allergies be displayed? Here's the catch. We want all those patient's allergies to display, coded and uncoded but only for patients who have an uncoded allergy.
Thanks
 
i would try this (and it should work if the fields are in separate tables, as i expect they will be):

insert a group on the patient

create a summary of the allergy codes field (use a Count)
create a sumamry of the allergies field (again, use a Count)

in the section expert, suppress the details and group sections if the two counts are equal.
it should look something like: Count ({Diag.ADescription}, {Patient.ID}) = Count ({Diag.ACode}, {Patient.ID})

 
Actually there are four. Patient Allergy, Patient Visit, Masterpatient, and Facility. Massterpatient and Facility are linked just to get extraneous info like names.
Patient Allergy and Patient Visit are left outer joined by masterpatientid and visitnumber. So all visits with an allergy display (code or no code). The problem is separating out patients with null allergy codes. Allergies can be entered without a code (which is bad). We want to separate out the patients with null allergy codes so that they can be fixed.
Examples:
PATIENT A
ALLERGY #1 CODE 123
ALLERGY #2 CODE 392
ALLERGY #3 CODE 456
Do not display

PATIENT B
NO ALLERGIES
Do not display

PATIENT C
ALLERGY #1 CODE 789
ALLERGY #2 CODE 654
ALLERGY #3 CODE (NULL)
Display in report

PATIENT D
ALLERGY #1 CODE (NULL)
Display in report
 
Add the PatientAllergy table twice, and using the same joins - the second instance will be given an alias of PatientAllergy_1 . Then, reference one of the instances of the tables in you Record Selection formula with code like this:

Code:
IsNull({PatientAllergy.Code})
, to identify all patients with a Null allergy code and use {PatientAllergy_1.Code} on the report to return all allergy records associated with each patient.

Hope this makes sense.

Cheers
Pete
 
Yes it does pmax9999. It's an alias table. I have used similar method in Oracle to find date differences. Don't know why I didn't think of it earlier.
I'll let you both know how it works out. Thanks.
 
Adding a Patient Allergy table alias did the trick!
Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top