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!

Stinking linking?

Status
Not open for further replies.
Jul 13, 2002
36
US
I am trying to print electronic prescriptions from our patient database. The Board of Pharmacy now requires that the patient's allergy list show up on each prescription. So this is my scenario:

I have a patient with many allergies...a one-to-many relationship. Presently one prescription is printing PER Allergy. In other words the entire list of allergies is not printing on each allergy, rather the prescription is repeating with a different allergy each time. I've tried outer joins and seem to be missing how to do this. I'm in version 8.5 of Crystal.

Technonurse-Spokane
 
Tables used: 1. Patient and all his/her demographic data
2. Allergy table with descriptions of all allergies the patient has.
3. Medication table containing patient's specific prescriptions

Expected outcome: Report prints with patient data once, and for every medication prescribed, all of the allergies show up at the bottom

Ex:
Mary B. Smith DOB: 4/04/1978

RX: Depakote 500 mg
Take two capsules/day
Disp: 60, 2 Refills

___________________________________
Allergies:

Penicillin
Iodine
Red Dye

The way it prints right now with above example, I get back three prescriptions for her Depakote with one allergy listed on each one.


Technonurse-Spokane
 
Not knowing the table layouts, I won't be able to give specifics, nor very good advice, but you should be able to join the Prescriptions to the patient using a left outer, ad then the allergies to the Patient to the allergies using a left join.

If not, drop the allergies from the main report, and create a subreport with just the allergies, and link the main report to the allergies report base on the patient ID.

-k
 
Hi SV: What I ended up doing was creating a group for my allergies and placed the group in the details section and suppressed duplication. Everything else which constituted a one-to-one relationship I put up in the report header. The allergies come in as a list now.

Technonurse-Spokane
 
The problem may not be with the SELECT statement. It may be the way the report is designed, so let's start there.

The patient information should be in the report header or a group header and the alergy data should go in the detail band.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top