LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2005, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 22 Feb 2005 15:21:22 -0600
Reply-To:     Duck-Hye Yang <dyang@CHAPINHALL.ORG>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Comments:     To: jkerman@JHMI.EDU
From:         Duck-Hye Yang <dyang@CHAPINHALL.ORG>
Subject:      Re: Is there a sas code that can clean up ICD-9 codes?
Comments: To: SAS-L@LISTSERV.VT.EDU
Content-Type: text/plain; charset=US-ASCII

Thank you for your code! I will check if it is helpful for me.

I posted my question because I was bothered the most by the following finding: Medicaid data has '3153','31530','31531','31532'.

The CMS label you mentioned below has only 2 lables as valid ones--the last two: '31531','31532'. These two belong to higher aggregation classification code , 74 other mental.

The first three are not valid ICD-9 codes. However, I think that they should not be classified 'missing'. I want to include them as 74 other mental.

Do you think that your code help me in fixing that type of errors?

Thanks again, Duckhye

>>> Jonathan Kerman <jkerman@JHMI.EDU> 02/22/05 2:20 PM >>> I have been doing a fair amount of work with ICD-9 codes. I could provide you with some of what I did. Basically, I checked a text string to make sure it has the format of a valid ICD-9 code, or reject it. I also built a dataset that maps ICD-9 codes to text descriptions.

I got my input files from the Centers for Medicare and Medicaid Services at URL: http://www.cms.hhs.gov/paymentsystems/icd9/ After I read these text files, one for diagnosis codes and one for procedure codes, into SAS datasets, this is the code I used to build a single lookup table. It places a decimal point at the proper place, and creates the mapping of codes to descriptions. (I found that there are still some codes that are not found in these CMS files.)

See if this helps...

------------------------------------------------------

libname comp "[location with SAS datasets]";

/* Build a lookup table with standardized, short descriptions of ICD-9 codes taken from CMS http://www.cms.hhs.gov/paymentsystems/icd9/ */ data comp.icd9lookup; length CODE tmp $ 6 DESCRIPTION $ 30; set comp.icd9diag (in=diag) comp.icd9proc (in=surg);

if diag then do; if substr(code, 1, 1) = 'E' then do; /* for 'E' code diagnoses, the format is different */ substr(tmp, 1, 4) = substr(code, 1, 4); if length(code) > 4 then do; substr(tmp, 5, 1) = '.'; substr(tmp, 6, 1) = substr(code, 5, 1); end; end; else do; /* for numeric ICD-9 diagnoses and for 'V' codes use this format */ substr(tmp, 1, 3) = substr(code, 1, 3); if length(code) > 3 then do; substr(tmp, 4, 1) = '.'; substr(tmp, 5, 2) = substr(code, 4, 2); end; end; end; else if surg then do; /* for procedure codes, use this format */ substr(tmp, 1, 2) = substr(code, 1, 2); if length(code) > 2 then do; substr(tmp, 3, 1) = '.'; substr(tmp, 4, 2) = substr(code, 3, 2); end; end;

code = tmp; drop tmp; run;


Back to: Top of message | Previous page | Main SAS-L page