32

我正在寻找可以导入数据库并以编程方式引用的格式的疾病和程序 ICD-9 代码(医疗代码)的完整列表。我的问题基本上与寻找 ICD-9 代码的资源完全相同,但原始发帖人忽略了提及他“掌握”他的完整列表的确切位置。

谷歌绝对不是我的朋友,因为我花了很多时间在谷歌上搜索这个问题并找到了许多富文本类型列表(例如 CDC)或网站,我可以在其中以交互方式深入了解完整列表,但我找不到从哪里获得将填充这些网站并可以解析为数据库的列表。我相信这里的文件ftp://ftp.cdc.gov/pub/Health_Statistics/NCHS/Publications/ICD9-CM/2009/有我正在寻找的文件,但是这些文件是富文本格式并且包含很多垃圾和格式这将很难准确删除。

我知道这必须由其他人完成,我试图避免重复其他人的工作,但我就是找不到 xml/CSV/Excel 列表。

4

4 回答 4

22

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

压缩的 Excel 文件,按版本号

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

于 2011-07-14T20:15:00.630 回答
11

删除 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 文件并将它们解析为 CSV 文件。这里的代码很粗糙,因为我只需要得到一次结果。

这是解析应用程序的代码,以防外部链接断开(后端到允许您选择文件名并单击按钮使其运行的表单)

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

结束类

于 2010-09-21T14:39:57.013 回答
5

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

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

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

于 2014-11-06T22:03:30.607 回答
3

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

于 2011-04-06T19:28:59.723 回答