Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: New to the forum :) Need help with a Crystal Post Reply Post New Topic
Author Message
RyanG
Newbie
Newbie


Joined: 26 Feb 2014
Location: United States
Online Status: Offline
Posts: 2
Quote RyanG Replybullet Topic: New to the forum :) Need help with a Crystal
     Posted: 27 Feb 2014 at 3:49am
Greetings,

First, thanks for this forum--already lurked and received prior help, great resource!

On to my report;

Report Goal:
I'm trying to build a report that will show me a list of patients on controlled medications from within our EH--but only show patients that have NOT had an office visit within a date range (parameter entered by user). So, ultimately I would like the user to choose a date range--then display all patients that received a controlled substance within that time period--that DID not have an office visit.

Right now, I have the report where it will prompt for a date range, then display all patients that had controlled substances prescribed within that time period. The rub (or where I'm stuck), is how to add another selection expert that will only display the patients that DID NOT have an office visit.

I have a couple of tables identified that will serve as that filter (a charges table, an encounter table)--however I'm not sure how to get that that filter in place in the report. If I just add that formula to the selection expert (for example--WHERE the OfficeDate.Encounter IS NOT within (DateRange.ParameterByuser)--then I get really funky results. It will show multiple instances of each patient, with every old prescription date (outside of my date range).

So basically, I want to add another date range filter that combines with the first--that shows all patients that DID have a medication prescribed within that time period but DID NOT have a specific charge (Office visit) within that time period.

Any ideas? Thanks again!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 27 Feb 2014 at 4:51am
what I would do is use the select that you have now, but add an outer join (or link...you can change the link type by right clicking on the link)for the office visit. Then for the condition it would be where the office visit is null...

this will give you people with prescriptions and not office visits.

HTH
IP IP Logged
RyanG
Newbie
Newbie


Joined: 26 Feb 2014
Location: United States
Online Status: Offline
Posts: 2
Quote RyanG Replybullet Posted: 27 Feb 2014 at 4:59am
Hi Lock, thanks for the reply!

I'm not sure if I can do a "If Null" statement--as the field is not there at all if it's not created. For example, if I'm looking at Create_Date of the OV--it won't exist at all (so no NULL value) if it's not within that time range.

I just want to check to see if that field exists at all within that time frame. Hope that makes sense!
IP IP Logged
hello
Groupie
Groupie
Avatar

Joined: 05 Feb 2014
Online Status: Offline
Posts: 85
Quote hello Replybullet Posted: 28 Feb 2014 at 4:35am
{med_date.patient_table} = {?date_range} AND
{ov_date.encounter_table} <> {?date_range}
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum