寻找ICD-9代码的资源。

时间:2022-09-16 18:03:44

We have been asked by a client to incorporate ICD-9 codes into a system.

客户要求我们将ICD-9代码合并到系统中。

I'm looking for a good resource to get a complete listing of codes and descriptions that will end up in a SQL database.

我正在寻找一个好的资源来获得一个完整的代码和描述清单,这些代码和描述最终将在一个SQL数据库中完成。

Unfortunately a web service is out of the question as a fair amount of the time folks will be off line using the application.

不幸的是,web服务是不可能的,因为大量的时间人们会使用应用程序离线。

I've found http://icd9cm.chrisendres.com/ and http://www.icd9data.com/ but neither offer downloads/exports of the data that I could find.

我找到了http://icd9cm.chrisendres.com/和http://www.icd9data.com/,但都没有提供我能找到的数据的下载/导出。

I also found http://www.cms.hhs.gov/MinimumDataSets20/07_RAVENSoftware.asp which has a database of the ICD-9 codes but they are not in the correct format and I'm not 100% sure how to properly convert (It shows the code 5566 which is really 556.6 but I can't find a rule as to how/when to convert the code to include a decimal)

我还发现http://www.cms.hhs.gov/MinimumDataSets20/07_RAVENSoftware.asp数据库的ICD-9码但是他们不正确的格式,我不是100%确定如何正确转换(它显示了代码5566是556.6但是我找不到一个规则是如何/何时将代码转换为包括小数)

I'm tagging this with medical and data since I'm not 100% sure where it should really be tagged...any help there would also be appreciated.

我用医学和数据来标记它,因为我不能百分之百确定它应该被标记在什么地方……如果有任何帮助,我们将不胜感激。

6 个解决方案

#1


9  

I ran into this same issue a while back and ended up building my own solution from scratch. Recently, I put up an open API for the codes for others to use: http://aqua.io/codes/icd9/documentation

我以前遇到过同样的问题,最终从头开始构建我自己的解决方案。最近,我为其他人使用的代码提供了一个开放的API: http://aqua.io/codes/icd9文档

You can just download all codes in JSON (http://api.aqua.io/codes/beta/icd9.json) or pull an individual code (http://api.aqua.io/codes/beta/icd9/250-1.json). Pulling a single code not only gives you the ICD-10 "crosswalk" (equivalents), but also some extra goodies, like relevant Wikipedia links.

您可以下载JSON格式的所有代码(http://api.aqua.io/codes/beta/icd9.json)或提取单个代码(http://api.aqua.io/codes/beta/icd9/250-1.json)。拉出一段代码不仅可以得到ICD-10“crosswalk”(等效代码),还可以得到一些额外的好处,比如相关的*链接。

#2


11  

Just wanted to chime in on how to correct the code decimal places. First, there are four broad points to consider:

我只是想谈谈如何更正小数点后的数字。首先,有四个要点需要考虑:

  1. Standard codes have Decimal place XXX.XX
  2. 标准代码有十进制位XXX.XX
  3. Some Codes Do not have trailing decimal places
  4. 有些代码没有末尾的小数点
  5. V Codes also follow the XXX.XX format --> V54.31
  6. V代码也遵循XXX。- - > V54.31 XX格式
  7. E Codes follow XXXX.X --> E850.9
  8. E编码遵循XXXX。X - - > E850.9

Thus the general logic of how to fix the errors is

因此,如何修正错误的一般逻辑是

If first character = E:
    If 5th character = '':
        Ignore
    Else replace XXXXX with XXXX.X                
Else If 4th-5th Char is not '':                      (XXXX or XXXXX)
    replace XXXXX with XXX + . + remainder           (XXX.XX or XXX.X)
(All remaining are XXX)

I implemented this with two SQL Update statements:
Number 1, for Non E-codes:

我用两个SQL Update语句实现了这个:第1个,非电子代码:

USE MainDb;
UPDATE "dbo"."icd9cm_diagnosis_codes" 
    SET "DIAGNOSIS CODE" = SUBSTRING("DIAGNOSIS CODE",1,3)+'.'+SUBSTRING("DIAGNOSIS CODE",4,5)
FROM "dbo"."icd9cm_diagnosis_codes"
WHERE 
    SUBSTRING("DIAGNOSIS CODE",4,5) != ''
    AND
    LEFT("DIAGNOSIS CODE",1) != 'E'

Number 2 - For E Codes:

第2 -电子编码:

UPDATE "dbo"."icd9cm_diagnosis_codes" 
    SET "DIAGNOSIS CODE" = SUBSTRING("DIAGNOSIS CODE",1,4)+'.'+SUBSTRING("DIAGNOSIS CODE",5,5)
FROM "dbo"."icd9_Diagnosis_table"
WHERE
    LEFT("DIAGNOSIS CODE",1) = 'E'
    AND
    SUBSTRING("DIAGNOSIS CODE",5,5) != ''

Seemed to do the trick for me (Using SQL Server 2008).

似乎对我来说很有用(使用SQL Server 2008)。

#3


4  

I finally found the following:

我终于发现了以下几点:

"The field for the ICD-9-CM Principal and Other Diagnosis Codes is six characters in length, with the decimal point implied between the third and fourth digit for all diagnosis codes other than the V codes. The decimal is implied for V codes between the second and third digit."

“ICD-9-CM主体和其他诊断代码的字段长度为6个字符,对于V代码以外的所有诊断代码,小数点隐含在第三和第四位数之间。”对于V在第二和第三位之间的编码,小数点是隐含的。

So I was able to get a hold of a complete ICD-9 list and reformat as required.

因此,我得到了完整的ICD-9列表,并根据需要重新格式化。

#4


3  

You might find that the ICD-9 codes follow the following format:

您可能会发现,ICD-9代码遵循以下格式:

  • All codes are 6 characters long
  • 所有代码都是6个字符长
  • The decimal point comes between the 3rd and 4th characters
  • 小数点在第3和第4个字符之间
  • If the code starts with a V character the decimal point comes between the 2nd and 3rd characters
  • 如果代码以V字符开头,小数点在第二个和第三个字符之间

Check this out: http://en.wikipedia.org/wiki/List_of_ICD-9_codes

看看这个:http://en.wikipedia.org/wiki/List_of_ICD-9_codes

#5


3  

I struggled with this issue myself for a long time as well. The best resource I have been able to find for these are the zip files here:

我自己也在这个问题上挣扎了很长一段时间。我能找到的最好的资源是这里的zip文件:

https://www.cms.gov/ICD9ProviderDiagnosticCodes/06_codes.asp

https://www.cms.gov/ICD9ProviderDiagnosticCodes/06_codes.asp

It's unfortunate because they (oddly) are missing the decimal places, but as several other posters have pointed out, adding them is fairly easy since the rules are known. I was able to use a regular expression based "find and replace" in my text editor to add them. One thing to watch out for if you go that route is that you can end up with codes that have a trailing "." but no zero after it. That's not valid, so you might need to go through and do another find/replace to clean those up.

不幸的是,他们(奇怪的是)漏掉了小数点的位置,但正如其他一些海报所指出的那样,由于规则是已知的,添加这些数字相当容易。我可以在文本编辑器中使用基于“查找和替换”的正则表达式来添加它们。如果你走这条路,有一件事需要注意,那就是你最终会得到一个末尾为“”的代码。这是无效的,所以您可能需要进行另一个查找/替换来清理它们。

The annoying thing about the data files in the link above is that there is no relationship to categories. Which you might need depending on your application. I ended up taking one of the RTF-based category files I found online and re-formatting it to get the ranges of each category. That was still doable in a text editor with some creative regular expressions.

上面链接中的数据文件令人讨厌的地方是,它与类别没有关系。这取决于您的应用程序。我最后取了一个基于rf的类别文件,我在网上找到,并重新格式化它,以获得每个类别的范围。这在文本编辑器中仍然是可行的,它具有一些创造性的正则表达式。

#6


1  

I was able to use the helpful answers here an create a groovy script to decimalize the code and combine long and short descriptions into a tab separated list. In case this helps anyone, I'm including my code here:

我能够在这里使用有用的答案创建一个groovy脚本,将代码进行十进制化,并将长描述和短描述合并到一个选项卡分隔的列表中。如果这对任何人都有帮助,我把我的代码写在这里:

import org.apache.log4j.BasicConfigurator
import org.apache.log4j.Level
import org.apache.log4j.Logger

import java.util.regex.Matcher
import java.util.regex.Pattern

Logger log = Logger.getRootLogger()
BasicConfigurator.configure();
Logger.getRootLogger().setLevel(Level.INFO);

Map shortDescMap = [:]
new File('CMS31_DESC_SHORT_DX.txt').eachLine {String l ->
    int split = l.indexOf(' ')
    String code = l[0..split].trim()
    String desc = l[split+1..-1].trim()
    shortDescMap.put(code, desc)
}
int shortLenCheck = 40      // arbitrary lengths, but provide some sanity checking...
int longLenCheck = 300
File longDescFile = new File('CMS31_DESC_LONG_DX.txt')
Map cmsRows = [:]
Pattern p = Pattern.compile(/^(\w*)\s+(.*)$/)
new File('parsedICD9.csv').withWriter { out ->
    out.write('ICD9 Code\tShort Description\tLong Description\n')
    longDescFile.eachLine {String row ->
        Matcher m = row =~ p
        if (m.matches()) {
            String code = m.group(1)
            String shortDescription = shortDescMap.get(code)
            String longDescription = m.group(2)
            if(shortDescription.size() > shortLenCheck){
                log.info("Not short? $shortDescription")
            }
            if(longDescription.size() > longLenCheck){
                log.info("${longDescription.size()} == Too long? $longDescription")
            }
            log.debug("Match 1:${code} -- 2:${longDescription} -- orig:$row")

            if (code.startsWith('V')) {
                if (code.size() > 3) {
                    code = code[0..2] + '.' + code[3..-1]
                }
                log.info("Code: $code")

            } else if (code.startsWith('E')) {
                if (code.size() > 4) {
                    code = code[0..3] + '.' + code[4..-1]
                }
                log.info("Code: $code")
            } else if (code.size() > 3) {
                code = code[0..2] + '.' + code[3..-1]
            }
            if (code) {
                cmsRows.put(code, ['longDesc': longDescription])
            }
            out.write("$code\t$shortDescription\t$longDescription\n")
        } else {
            log.warn "No match for row: $row"
        }
    }
}

I hope this helps someone.

我希望这能帮助某人。

Sean

肖恩

#1


9  

I ran into this same issue a while back and ended up building my own solution from scratch. Recently, I put up an open API for the codes for others to use: http://aqua.io/codes/icd9/documentation

我以前遇到过同样的问题,最终从头开始构建我自己的解决方案。最近,我为其他人使用的代码提供了一个开放的API: http://aqua.io/codes/icd9文档

You can just download all codes in JSON (http://api.aqua.io/codes/beta/icd9.json) or pull an individual code (http://api.aqua.io/codes/beta/icd9/250-1.json). Pulling a single code not only gives you the ICD-10 "crosswalk" (equivalents), but also some extra goodies, like relevant Wikipedia links.

您可以下载JSON格式的所有代码(http://api.aqua.io/codes/beta/icd9.json)或提取单个代码(http://api.aqua.io/codes/beta/icd9/250-1.json)。拉出一段代码不仅可以得到ICD-10“crosswalk”(等效代码),还可以得到一些额外的好处,比如相关的*链接。

#2


11  

Just wanted to chime in on how to correct the code decimal places. First, there are four broad points to consider:

我只是想谈谈如何更正小数点后的数字。首先,有四个要点需要考虑:

  1. Standard codes have Decimal place XXX.XX
  2. 标准代码有十进制位XXX.XX
  3. Some Codes Do not have trailing decimal places
  4. 有些代码没有末尾的小数点
  5. V Codes also follow the XXX.XX format --> V54.31
  6. V代码也遵循XXX。- - > V54.31 XX格式
  7. E Codes follow XXXX.X --> E850.9
  8. E编码遵循XXXX。X - - > E850.9

Thus the general logic of how to fix the errors is

因此,如何修正错误的一般逻辑是

If first character = E:
    If 5th character = '':
        Ignore
    Else replace XXXXX with XXXX.X                
Else If 4th-5th Char is not '':                      (XXXX or XXXXX)
    replace XXXXX with XXX + . + remainder           (XXX.XX or XXX.X)
(All remaining are XXX)

I implemented this with two SQL Update statements:
Number 1, for Non E-codes:

我用两个SQL Update语句实现了这个:第1个,非电子代码:

USE MainDb;
UPDATE "dbo"."icd9cm_diagnosis_codes" 
    SET "DIAGNOSIS CODE" = SUBSTRING("DIAGNOSIS CODE",1,3)+'.'+SUBSTRING("DIAGNOSIS CODE",4,5)
FROM "dbo"."icd9cm_diagnosis_codes"
WHERE 
    SUBSTRING("DIAGNOSIS CODE",4,5) != ''
    AND
    LEFT("DIAGNOSIS CODE",1) != 'E'

Number 2 - For E Codes:

第2 -电子编码:

UPDATE "dbo"."icd9cm_diagnosis_codes" 
    SET "DIAGNOSIS CODE" = SUBSTRING("DIAGNOSIS CODE",1,4)+'.'+SUBSTRING("DIAGNOSIS CODE",5,5)
FROM "dbo"."icd9_Diagnosis_table"
WHERE
    LEFT("DIAGNOSIS CODE",1) = 'E'
    AND
    SUBSTRING("DIAGNOSIS CODE",5,5) != ''

Seemed to do the trick for me (Using SQL Server 2008).

似乎对我来说很有用(使用SQL Server 2008)。

#3


4  

I finally found the following:

我终于发现了以下几点:

"The field for the ICD-9-CM Principal and Other Diagnosis Codes is six characters in length, with the decimal point implied between the third and fourth digit for all diagnosis codes other than the V codes. The decimal is implied for V codes between the second and third digit."

“ICD-9-CM主体和其他诊断代码的字段长度为6个字符,对于V代码以外的所有诊断代码,小数点隐含在第三和第四位数之间。”对于V在第二和第三位之间的编码,小数点是隐含的。

So I was able to get a hold of a complete ICD-9 list and reformat as required.

因此,我得到了完整的ICD-9列表,并根据需要重新格式化。

#4


3  

You might find that the ICD-9 codes follow the following format:

您可能会发现,ICD-9代码遵循以下格式:

  • All codes are 6 characters long
  • 所有代码都是6个字符长
  • The decimal point comes between the 3rd and 4th characters
  • 小数点在第3和第4个字符之间
  • If the code starts with a V character the decimal point comes between the 2nd and 3rd characters
  • 如果代码以V字符开头,小数点在第二个和第三个字符之间

Check this out: http://en.wikipedia.org/wiki/List_of_ICD-9_codes

看看这个:http://en.wikipedia.org/wiki/List_of_ICD-9_codes

#5


3  

I struggled with this issue myself for a long time as well. The best resource I have been able to find for these are the zip files here:

我自己也在这个问题上挣扎了很长一段时间。我能找到的最好的资源是这里的zip文件:

https://www.cms.gov/ICD9ProviderDiagnosticCodes/06_codes.asp

https://www.cms.gov/ICD9ProviderDiagnosticCodes/06_codes.asp

It's unfortunate because they (oddly) are missing the decimal places, but as several other posters have pointed out, adding them is fairly easy since the rules are known. I was able to use a regular expression based "find and replace" in my text editor to add them. One thing to watch out for if you go that route is that you can end up with codes that have a trailing "." but no zero after it. That's not valid, so you might need to go through and do another find/replace to clean those up.

不幸的是,他们(奇怪的是)漏掉了小数点的位置,但正如其他一些海报所指出的那样,由于规则是已知的,添加这些数字相当容易。我可以在文本编辑器中使用基于“查找和替换”的正则表达式来添加它们。如果你走这条路,有一件事需要注意,那就是你最终会得到一个末尾为“”的代码。这是无效的,所以您可能需要进行另一个查找/替换来清理它们。

The annoying thing about the data files in the link above is that there is no relationship to categories. Which you might need depending on your application. I ended up taking one of the RTF-based category files I found online and re-formatting it to get the ranges of each category. That was still doable in a text editor with some creative regular expressions.

上面链接中的数据文件令人讨厌的地方是,它与类别没有关系。这取决于您的应用程序。我最后取了一个基于rf的类别文件,我在网上找到,并重新格式化它,以获得每个类别的范围。这在文本编辑器中仍然是可行的,它具有一些创造性的正则表达式。

#6


1  

I was able to use the helpful answers here an create a groovy script to decimalize the code and combine long and short descriptions into a tab separated list. In case this helps anyone, I'm including my code here:

我能够在这里使用有用的答案创建一个groovy脚本,将代码进行十进制化,并将长描述和短描述合并到一个选项卡分隔的列表中。如果这对任何人都有帮助,我把我的代码写在这里:

import org.apache.log4j.BasicConfigurator
import org.apache.log4j.Level
import org.apache.log4j.Logger

import java.util.regex.Matcher
import java.util.regex.Pattern

Logger log = Logger.getRootLogger()
BasicConfigurator.configure();
Logger.getRootLogger().setLevel(Level.INFO);

Map shortDescMap = [:]
new File('CMS31_DESC_SHORT_DX.txt').eachLine {String l ->
    int split = l.indexOf(' ')
    String code = l[0..split].trim()
    String desc = l[split+1..-1].trim()
    shortDescMap.put(code, desc)
}
int shortLenCheck = 40      // arbitrary lengths, but provide some sanity checking...
int longLenCheck = 300
File longDescFile = new File('CMS31_DESC_LONG_DX.txt')
Map cmsRows = [:]
Pattern p = Pattern.compile(/^(\w*)\s+(.*)$/)
new File('parsedICD9.csv').withWriter { out ->
    out.write('ICD9 Code\tShort Description\tLong Description\n')
    longDescFile.eachLine {String row ->
        Matcher m = row =~ p
        if (m.matches()) {
            String code = m.group(1)
            String shortDescription = shortDescMap.get(code)
            String longDescription = m.group(2)
            if(shortDescription.size() > shortLenCheck){
                log.info("Not short? $shortDescription")
            }
            if(longDescription.size() > longLenCheck){
                log.info("${longDescription.size()} == Too long? $longDescription")
            }
            log.debug("Match 1:${code} -- 2:${longDescription} -- orig:$row")

            if (code.startsWith('V')) {
                if (code.size() > 3) {
                    code = code[0..2] + '.' + code[3..-1]
                }
                log.info("Code: $code")

            } else if (code.startsWith('E')) {
                if (code.size() > 4) {
                    code = code[0..3] + '.' + code[4..-1]
                }
                log.info("Code: $code")
            } else if (code.size() > 3) {
                code = code[0..2] + '.' + code[3..-1]
            }
            if (code) {
                cmsRows.put(code, ['longDesc': longDescription])
            }
            out.write("$code\t$shortDescription\t$longDescription\n")
        } else {
            log.warn "No match for row: $row"
        }
    }
}

I hope this helps someone.

我希望这能帮助某人。

Sean

肖恩