I am trying to produce a list of diabetic patients with the date of the most recent office visit and last HGBA1C result or a notation that HGBA1C was not done. I can produce a list of patients with the date of the most recent office visit and the most recent HGBA1C. However, I have been unable to include patients who have an office visit but no HGBA1C recorded. Can anyone help me with a formula to include those who do not have an HGBA1C recorded?
Doing this in Crystal is complicated. I would typically create a view from RPTOBS including only the obsterm in question, connect the view with a left outer join Person to the view. This should list all patients, and then the obs values if there is one.
I have connected Patient Profile PID to RPTOBS PID with a left outer join, not enforced and equal. My report displays only only those patients with a recorded HGBA1C.
I am also connecting PatientProfile.PrimaryCareDoctorId --> DoctorFacility.DoctorFacilityId with a left outer join and that seems to be working correctly. I get a list of Patients and the primary care doctor if one is entered.
Do I need a formula or do I need to change some settings on my Crystal Reports? Or maybe I should just give up in frustration.
if you put criteria in your select for the obsterm, the right outer join acts like an inner join and you'll only get patients with that specific criteria.
AHA!!!!!!! Thank you for the information. Do you have any suggestions for other ways to accomplish the task?
left outer join, select all patients matching other criteria, suppress those that you don't want.
Something I have done...
select for OBS in ["BP SYSTOLIC","HGBA1C"]
do this, so you don't have to read thru everything
I use the in logic since I often (you too) may be checking for more than one OBS
then use a local defined variable called pt_A1C
with a formula like
if OBS in ["HGBA1C"] then obsdate
place the pt_A1C in your report
you can add conditional formatting to only print detail rows where pt_A1C < #01/01/2001# for instance
I assume that everyone will have a BP taken during a visit, and thus your link/join logic will be ok.
Make sense?
Makes perfect sense. I just tried changing a report this morning using a similar idea and it worked wonderfully. Thanks for the verification.