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

Evaluating data w/ two different criteria

Status
Not open for further replies.

LMcK07

Technical User
Nov 6, 2007
3
US
I'm querying an electronic health record to determine the % of patients in which blood pressure is controlled. The threshold for "control" for diabetics is a systolic BP of 130; for non-diabetics, it's 140 - so I need to classify the patient as diabetic or not before evaluating the BP value. The near-term result I'm after is a cross-tab with "controlled"/"uncontrolled" as column headings, "diabetic"/"non-diabetic" as row headings, and unduplicated patient count (distinct count) as the summarized field.

I'm stuck trying to categorize patients as diabetic or non-diabetic. The diagnoses are in the Diagnosis table by ICD-9 code ({diagosis.ICD9}), which also contains the Patient ID, date of assessment, etc. Multiple ICD9 values are allowed, and nearly all patients have multiple diagnoses.

So of course I can use a plain IF-THEN to identify the patients with a diabetes diagnosis, which is 250.xx:
Code:
   IF {diagnosis.ICD9}="250.**"
   THEN "Diabetic" 
   ELSE "Non-diabetic"

But these diabetic patients show up as both "diabetic" and "non-diabetic" in the cross-tab detail because their diagnosis.ICD9 includes 250.xx codes AND several other codes.

Short of running two separate reports, what can I do to put each patient excusively in one bucket OR the other?

Thanks so much -
LMcK
 
With crosstabs and many other posts, it is critical to know the version of CR you are using. Assuming you are using a recent version, you could create a formula {@diabetic} like this:

if {diagnosis.ICD9} startwith "250." then 1

Then create a second formula to use as your row field:

if maximum({@diabetic},{table.patient}) = 1 then
"Diabetic" else
"Non-Diabetic"

For the column, use:

if
(
{@diabetic} = "Diabetic" and
{table.sysbp} >= 130
) or
(
{@diabetic} = "Non-Diabetic" and
{table.sysbp} >= 140
) then "Uncontrolled" else
"Controlled"

Then use a distinctcount of patient for your summary field. You might have to use a group selection formula (report->selection formula->GROUP) to eliminate records that don't meet the conditional criteria:

{@diabetic} = maximum({@diabetic},{table.patient})

This also assumes you have a group on {table.patient} in the report.

-LB
 
Thanks so much. I've been working on this again since Friday morning and still kept getting a handful of duplicate patients, but just this minute I realized that some patients get multiple BP readings in one visit. So I queried just for "right arm sitting" BP and it's perfect.

Thanks again
LMcK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top