BookmarkSubscribeRSS Feed
cgray
Fluorite | Level 6

Currently writing a program to extract suicide attempts from a 2016 outpatient hospital discharge file.  In years past, with ICD-9, an e-code of E950-E959 indicated suicide attempts; easy to extract.

 

Now with ICD-10, there are ~300 codes that could indicate intentional self-harm/suicide.  I have an array written to look for these codes over all of the diagnosis fields; however, I am curious to see if there is a way to consolidate the program without writing out all of these codes.  The major problem is that the intentional self harm designation is embedded within a range.

 

For example:  The code for Poisoning by heroin, intentional self-harm is T401X2A.  But, there are also codes for accidental (T401X1A), assault (T401X3A) and undetermined (T401X4A) poisonings that I don't need, prohibiting any use of if dx in : ('T401X'), which would extract the three codes I don't need.

 

Multiply this by 300 or so codes, and that becomes a long program.  Especially when the previous one was if ecode in : ('E95') 🙂

 

Any work around would be appreciated!

 

 

1 REPLY 1
ballardw
Super User

If you have a data set (or even just a list) with the codes then create a custom format that will mark those as "Suicide" and every thing else as "Non-suicide" or whatever term you want.

 

Proc format library=work;

value $suicide

'T401X2A' = 'Suicide'

other = 'Non-Suicide'

;

run;

A data set can work to make a cntlin data set with the formatname values for start, label and a little extra code to add the "other".

 

In a data step you could use thing such as

If (put(code,$suicide.) = 'Suicide' then ...

 

You may search the internet for SAS format ICD-10 as I have heard of number of projects working on bits of this but whether they have your specific need ...

 

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 749 views
  • 1 like
  • 2 in conversation