Cough is identified using ICD-9/10 codes from the claims databases. Whereas, there is no ICD-9/10
code available to define the chronic stage of cough. The objective of the problem is to identify
patients who have been diagnosed with chronic cough between 2007 and 2009. These patients will
be then assessed for their demographic characteristics. The following algorithm is deigned to
identify chronic cough patients:
A patient having at least three inpatient/outpatient claims for cough within the time window of 120
days anytime, between 2007 and 2009.
The following dataset has patients with service dates for cough from 2007 and 2009. Identify
patients diagnosed with chronic cough between 2007 and 2009.
Please post your data in usable form. Pictures can NOT be used in SAS. See my footnotes.
Assuming that your data already embodies much of the work that needs to be done:
All that remains is to identify patients that have 3 observations within a 120-day window. Here is an approach to do that:
data want;
id_counter=0;
chronic='N';
do until (last.enrolid);
set have;
by enrolid svcdate;
id_counter + 1;
if dif2(svcdate) <= 120 and id_counter >= 3 then chronic='Y';
end;
do until (last.enrolid);
set have;
by enrolid;
output;
end;
drop id_counter;
run;
The top loop processes observations for one ENROLID, setting CHRONIC to Y or N. The bottom loop processes the same observations, outputting them with the assigned value for CHRONIC.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.