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:
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
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