用XML、CSV或数据库格式的ICD-9代码列表

时间:2022-04-02 18:05:55

I am looking for a complete list of ICD-9 Codes (Medical Codes) for Diseases and Procedures in a format that can be imported into a database and referenced programmatically. My question is basically exactly the same as Looking for resources for ICD-9 codes, but the original poster neglected to mention where exactly he "got ahold of" his complete list.

我正在寻找一个完整的关于疾病和程序的ICD-9代码(医疗代码)的列表,其格式可以导入数据库并以编程方式引用。我的问题基本上和寻找ICD-9代码的资源是一样的,但是原始的海报忽略了他的完整列表的确切位置。

Google is definitely not my friend here as I have spent many hours googling the problem and have found many rich text type lists (such as the CDC) or websites where I can drill down to the complete list interactively, but I cannot find where to get the list that would populate these websites and can be parsed into a Database. I believe the files here ftp://ftp.cdc.gov/pub/Health_Statistics/NCHS/Publications/ICD9-CM/2009/ have what I am looking for but the files are rich text format and contain a lot of garbage and formatting that would be difficult to remove accurately.

谷歌绝对不是我的朋友在这里我已经花了很多时间用Google搜索问题,发现许多富文本类型列表(如疾控中心)或网站,我可以下钻到交互式地完整列表,但我找不到哪里有填充这些网站的列表,可以解析到一个数据库中。我相信这里的文件ftp://ftp.cdc.gov/pub/Health_Statistics/NCHS/Publications/ICD9-CM/2009/具有我正在查找的内容,但是这些文件是丰富的文本格式,包含大量的垃圾和格式,很难准确地删除。

I know this has to have been done by others and I am trying to avoid duplicating other peoples effort but I just cannot find an xml/CSV/Excel list.

我知道这必须由其他人来完成,我正在努力避免重复别人的努力,但我只是找不到一个xml/CSV/Excel列表。

5 个解决方案

#1


22  

Centers for Medicaid & Medicare services provides excel files which contain just the codes and diagnosis, which can be imported directly into some SQL databases, sans conversion.

医疗补助和医疗保险服务中心提供的excel文件只包含代码和诊断,可以直接导入到一些SQL数据库中,无需转换。

Zipped Excel files, by version number

按版本号压缩Excel文件

(Update: New link based on comment below)

(更新:基于下面评论的新链接)

#2


11  

After removing the RTF it wasn't too hard to parse the file and turn it into a CSV. My resulting parsed files containing all 2009 ICD-9 codes for Diseases and Procedures are here: http://www.jacotay.com/files/Disease_and_ProcedureCodes_Parsed.zip My parser that I wrote is here: http://www.jacotay.com/files/RTFApp.zip Basically it is a two step process - take the files from the CDC FTP site, and remove the RTF from them, then select the RTF-free files and parse them into the CSV files. The code here is pretty rough because I only needed to get the results out once.

删除RTF后,解析文件并将其转换为CSV并不困难。我得到的解析文件包含所有2009 ICD-9编码疾病和程序:http://www.jacotay.com/files/Disease_and_ProcedureCodes_Parsed.zip我的解析器,我写在这里:http://www.jacotay.com/files/RTFApp.zip基本上这是一个两步的过程,把文件从CDC FTP站点,的RTF和删除它们,然后选择RTF-free文件和解析成CSV文件。这里的代码非常粗略,因为我只需要输出一次结果。

Here is the code for the parsing app in case the external links go down (back end to a form that lets you select a filename and click the buttons to make it go)

下面是解析应用程序的代码,以防外部链接下降(返回到表单,该表单允许您选择文件名并单击按钮使其继续)

Public Class Form1

Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click
    Dim p As New OpenFileDialog With {.CheckFileExists = True, .Multiselect = False}
    Dim pResult = p.ShowDialog()
    If pResult = Windows.Forms.DialogResult.Cancel OrElse pResult = Windows.Forms.DialogResult.Abort Then
        Exit Sub
    End If
    txtFileName.Text = p.FileName
End Sub

Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
    Dim pFile = New IO.FileInfo(txtFileName.Text)
    Dim FileText = IO.File.ReadAllText(pFile.FullName)
    FileText = RemoveRTF(FileText)
    IO.File.WriteAllText(Replace(pFile.FullName, pFile.Extension, "_fixed" & pFile.Extension), FileText)

End Sub


Function RemoveRTF(ByVal rtfText As String)
    Dim rtBox As System.Windows.Forms.RichTextBox = New System.Windows.Forms.RichTextBox

    '// Get the contents of the RTF file. Note that when it is
    '// stored in the string, it is encoded as UTF-16.
    rtBox.Rtf = rtfText
    Dim plainText = rtBox.Text

    Return plainText
End Function


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim pFile = New IO.FileInfo(txtFileName.Text)
    Dim FileText = IO.File.ReadAllText(pFile.FullName)
    Dim DestFileLine As String = ""
    Dim DestFileText As New System.Text.StringBuilder

    'Need to parse at lines with numbers, lines with all caps are thrown away until next number
    FileText = Strings.Replace(FileText, vbCr, "")
    Dim pFileLines = FileText.Split(vbLf)
    Dim CurCode As String = ""
    For Each pLine In pFileLines
        If pLine.Length = 0 Then
            Continue For
        End If
        pLine = pLine.Replace(ChrW(9), " ")
        pLine = pLine.Trim

        Dim NonCodeLine As Boolean = False
        If IsNumeric(pLine.Substring(0, 1)) OrElse (pLine.Length > 3 AndAlso (pLine.Substring(0, 1) = "E" OrElse pLine.Substring(0, 1) = "V") AndAlso IsNumeric(pLine.Substring(1, 1))) Then
            Dim SpacePos As Int32
            SpacePos = InStr(pLine, " ")
            Dim NewCode As String
            NewCode = ""
            If SpacePos >= 3 Then
                NewCode = Strings.Left(pLine, SpacePos - 1)
            End If

            If SpacePos < 3 OrElse Strings.Mid(pLine, SpacePos - 1, 1) = "." OrElse InStr(NewCode, "-") > 0 Then
                NonCodeLine = True
            Else
                If CurCode <> "" Then
                    DestFileLine = Strings.Replace(DestFileLine, ",", "&#44;")
                    DestFileLine = Strings.Replace(DestFileLine, """", "&quot;").Trim
                    DestFileText.AppendLine(CurCode & ",""" & DestFileLine & """")
                    CurCode = ""
                    DestFileLine = ""
                End If

                CurCode = NewCode
                DestFileLine = Strings.Mid(pLine, SpacePos + 1)
            End If
        Else
            NonCodeLine = True
        End If


        If NonCodeLine = True AndAlso CurCode <> "" Then 'If we are not on a code keep going, otherwise check it
            Dim pReg As New System.Text.RegularExpressions.Regex("[a-z]")
            Dim pRegCaps As New System.Text.RegularExpressions.Regex("[A-Z]")
            If pReg.IsMatch(pLine) OrElse pLine.Length <= 5 OrElse pRegCaps.IsMatch(pLine) = False OrElse (Strings.Left(pLine, 3) = "NOS" OrElse Strings.Left(pLine, 2) = "IQ") Then
                DestFileLine &= " " & pLine
            Else 'Is all caps word
                DestFileLine = Strings.Replace(DestFileLine, ",", "&#44;")
                DestFileLine = Strings.Replace(DestFileLine, """", "&quot;").Trim
                DestFileText.AppendLine(CurCode & ",""" & DestFileLine & """")
                CurCode = ""
                DestFileLine = ""
            End If
        End If
    Next

    If CurCode <> "" Then
        DestFileLine = Strings.Replace(DestFileLine, ",", "&#44;")
        DestFileLine = Strings.Replace(DestFileLine, """", "&quot;").Trim
        DestFileText.AppendLine(CurCode & ",""" & DestFileLine & """")
        CurCode = ""
        DestFileLine = ""
    End If

    IO.File.WriteAllText(Replace(pFile.FullName, pFile.Extension, "_parsed" & pFile.Extension), DestFileText.ToString)
End Sub

End Class

结束课

#3


4  

Clearly, a very old thread but I recently undertook this task and wrote it up here with links to source data -

显然,这是一个非常古老的线程,但我最近承担了这个任务,并在这里用到源数据的链接编写它

http://colinwhite.net/dropplets/ICD

http://colinwhite.net/dropplets/ICD

I was trying to get both ICD-9 and ICD-10 into a SQLite database.

我试图把ICD-9和ICD-10都放到一个SQLite数据库中。

Seems to have worked well.

看起来效果不错。

#4


4  

Center for Medicare Services (CMS) is actually charged with ICD, so I think the CDC versions you guys reference may just be copies or reprocessed copies. Here is the (~hard to find) medicare page which i think contains the original raw data ("source of truth").

医疗保险服务中心(CMS)实际上负责ICD,所以我认为你们提到的CDC版本可能只是拷贝或重处理过的拷贝。这是(很难找到)医疗保险页面,我认为它包含原始数据(“真相的来源”)。

http://www.cms.gov/Medicare/Coding/ICD9ProviderDiagnosticCodes/codes.html

http://www.cms.gov/Medicare/Coding/ICD9ProviderDiagnosticCodes/codes.html

It looks like as of this post the latest version is v32. The zip you download will contain 4 plain-text files which map code-to-description (one file for every combination of DIAG|PROC and SHORT|LONG). It also contains two excel files (one each for DIAG_PROC) which have three columns so map code to both descriptions (long and short).

在这篇文章中,看起来最新的版本是v32。您下载的zip文件将包含4个明文文件,它们映射代码到描述(DIAG|PROC和|LONG的每个组合对应一个文件)。它还包含两个excel文件(一个用于DIAG_PROC),其中有三列,因此可以将代码映射到两个描述(长和短)。

#5


3  

You can get the orginal RTF code files from here http://ftp.cdc.gov/pub/Health_Statistics/NCHS/Publications/ICD9-CM/2009/

您可以从这里获得原始RTF代码文件http://ftp.cdc.gov/pub/Health_Statistics/NCHS/Publications/ICD9-CM/2009/

#1


22  

Centers for Medicaid & Medicare services provides excel files which contain just the codes and diagnosis, which can be imported directly into some SQL databases, sans conversion.

医疗补助和医疗保险服务中心提供的excel文件只包含代码和诊断,可以直接导入到一些SQL数据库中,无需转换。

Zipped Excel files, by version number

按版本号压缩Excel文件

(Update: New link based on comment below)

(更新:基于下面评论的新链接)

#2


11  

After removing the RTF it wasn't too hard to parse the file and turn it into a CSV. My resulting parsed files containing all 2009 ICD-9 codes for Diseases and Procedures are here: http://www.jacotay.com/files/Disease_and_ProcedureCodes_Parsed.zip My parser that I wrote is here: http://www.jacotay.com/files/RTFApp.zip Basically it is a two step process - take the files from the CDC FTP site, and remove the RTF from them, then select the RTF-free files and parse them into the CSV files. The code here is pretty rough because I only needed to get the results out once.

删除RTF后,解析文件并将其转换为CSV并不困难。我得到的解析文件包含所有2009 ICD-9编码疾病和程序:http://www.jacotay.com/files/Disease_and_ProcedureCodes_Parsed.zip我的解析器,我写在这里:http://www.jacotay.com/files/RTFApp.zip基本上这是一个两步的过程,把文件从CDC FTP站点,的RTF和删除它们,然后选择RTF-free文件和解析成CSV文件。这里的代码非常粗略,因为我只需要输出一次结果。

Here is the code for the parsing app in case the external links go down (back end to a form that lets you select a filename and click the buttons to make it go)

下面是解析应用程序的代码,以防外部链接下降(返回到表单,该表单允许您选择文件名并单击按钮使其继续)

Public Class Form1

Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click
    Dim p As New OpenFileDialog With {.CheckFileExists = True, .Multiselect = False}
    Dim pResult = p.ShowDialog()
    If pResult = Windows.Forms.DialogResult.Cancel OrElse pResult = Windows.Forms.DialogResult.Abort Then
        Exit Sub
    End If
    txtFileName.Text = p.FileName
End Sub

Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
    Dim pFile = New IO.FileInfo(txtFileName.Text)
    Dim FileText = IO.File.ReadAllText(pFile.FullName)
    FileText = RemoveRTF(FileText)
    IO.File.WriteAllText(Replace(pFile.FullName, pFile.Extension, "_fixed" & pFile.Extension), FileText)

End Sub


Function RemoveRTF(ByVal rtfText As String)
    Dim rtBox As System.Windows.Forms.RichTextBox = New System.Windows.Forms.RichTextBox

    '// Get the contents of the RTF file. Note that when it is
    '// stored in the string, it is encoded as UTF-16.
    rtBox.Rtf = rtfText
    Dim plainText = rtBox.Text

    Return plainText
End Function


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim pFile = New IO.FileInfo(txtFileName.Text)
    Dim FileText = IO.File.ReadAllText(pFile.FullName)
    Dim DestFileLine As String = ""
    Dim DestFileText As New System.Text.StringBuilder

    'Need to parse at lines with numbers, lines with all caps are thrown away until next number
    FileText = Strings.Replace(FileText, vbCr, "")
    Dim pFileLines = FileText.Split(vbLf)
    Dim CurCode As String = ""
    For Each pLine In pFileLines
        If pLine.Length = 0 Then
            Continue For
        End If
        pLine = pLine.Replace(ChrW(9), " ")
        pLine = pLine.Trim

        Dim NonCodeLine As Boolean = False
        If IsNumeric(pLine.Substring(0, 1)) OrElse (pLine.Length > 3 AndAlso (pLine.Substring(0, 1) = "E" OrElse pLine.Substring(0, 1) = "V") AndAlso IsNumeric(pLine.Substring(1, 1))) Then
            Dim SpacePos As Int32
            SpacePos = InStr(pLine, " ")
            Dim NewCode As String
            NewCode = ""
            If SpacePos >= 3 Then
                NewCode = Strings.Left(pLine, SpacePos - 1)
            End If

            If SpacePos < 3 OrElse Strings.Mid(pLine, SpacePos - 1, 1) = "." OrElse InStr(NewCode, "-") > 0 Then
                NonCodeLine = True
            Else
                If CurCode <> "" Then
                    DestFileLine = Strings.Replace(DestFileLine, ",", "&#44;")
                    DestFileLine = Strings.Replace(DestFileLine, """", "&quot;").Trim
                    DestFileText.AppendLine(CurCode & ",""" & DestFileLine & """")
                    CurCode = ""
                    DestFileLine = ""
                End If

                CurCode = NewCode
                DestFileLine = Strings.Mid(pLine, SpacePos + 1)
            End If
        Else
            NonCodeLine = True
        End If


        If NonCodeLine = True AndAlso CurCode <> "" Then 'If we are not on a code keep going, otherwise check it
            Dim pReg As New System.Text.RegularExpressions.Regex("[a-z]")
            Dim pRegCaps As New System.Text.RegularExpressions.Regex("[A-Z]")
            If pReg.IsMatch(pLine) OrElse pLine.Length <= 5 OrElse pRegCaps.IsMatch(pLine) = False OrElse (Strings.Left(pLine, 3) = "NOS" OrElse Strings.Left(pLine, 2) = "IQ") Then
                DestFileLine &= " " & pLine
            Else 'Is all caps word
                DestFileLine = Strings.Replace(DestFileLine, ",", "&#44;")
                DestFileLine = Strings.Replace(DestFileLine, """", "&quot;").Trim
                DestFileText.AppendLine(CurCode & ",""" & DestFileLine & """")
                CurCode = ""
                DestFileLine = ""
            End If
        End If
    Next

    If CurCode <> "" Then
        DestFileLine = Strings.Replace(DestFileLine, ",", "&#44;")
        DestFileLine = Strings.Replace(DestFileLine, """", "&quot;").Trim
        DestFileText.AppendLine(CurCode & ",""" & DestFileLine & """")
        CurCode = ""
        DestFileLine = ""
    End If

    IO.File.WriteAllText(Replace(pFile.FullName, pFile.Extension, "_parsed" & pFile.Extension), DestFileText.ToString)
End Sub

End Class

结束课

#3


4  

Clearly, a very old thread but I recently undertook this task and wrote it up here with links to source data -

显然,这是一个非常古老的线程,但我最近承担了这个任务,并在这里用到源数据的链接编写它

http://colinwhite.net/dropplets/ICD

http://colinwhite.net/dropplets/ICD

I was trying to get both ICD-9 and ICD-10 into a SQLite database.

我试图把ICD-9和ICD-10都放到一个SQLite数据库中。

Seems to have worked well.

看起来效果不错。

#4


4  

Center for Medicare Services (CMS) is actually charged with ICD, so I think the CDC versions you guys reference may just be copies or reprocessed copies. Here is the (~hard to find) medicare page which i think contains the original raw data ("source of truth").

医疗保险服务中心(CMS)实际上负责ICD,所以我认为你们提到的CDC版本可能只是拷贝或重处理过的拷贝。这是(很难找到)医疗保险页面,我认为它包含原始数据(“真相的来源”)。

http://www.cms.gov/Medicare/Coding/ICD9ProviderDiagnosticCodes/codes.html

http://www.cms.gov/Medicare/Coding/ICD9ProviderDiagnosticCodes/codes.html

It looks like as of this post the latest version is v32. The zip you download will contain 4 plain-text files which map code-to-description (one file for every combination of DIAG|PROC and SHORT|LONG). It also contains two excel files (one each for DIAG_PROC) which have three columns so map code to both descriptions (long and short).

在这篇文章中,看起来最新的版本是v32。您下载的zip文件将包含4个明文文件,它们映射代码到描述(DIAG|PROC和|LONG的每个组合对应一个文件)。它还包含两个excel文件(一个用于DIAG_PROC),其中有三列,因此可以将代码映射到两个描述(长和短)。

#5


3  

You can get the orginal RTF code files from here http://ftp.cdc.gov/pub/Health_Statistics/NCHS/Publications/ICD9-CM/2009/

您可以从这里获得原始RTF代码文件http://ftp.cdc.gov/pub/Health_Statistics/NCHS/Publications/ICD9-CM/2009/