IHTSDO/snowstorm

Not able to fetch ICD-10-CM codes using API

Closed this issue · 4 comments

Hi
after uploading ICD-10-CM csv from
https://github.com/Bobrovskiy/ICD-10-CSV/blob/master/2019/diagnosis.csv

we could see the code system updated as below after ./hapi-fhir-cli upload-terminology -d diagnosis.csv -v r4 -t http://localhost:8080/fhir -u http://hl7.org/fhir/sid/icd-10-cm

"entry": [
{
"fullUrl": "http://144.76.65.203:8080/fhir/CodeSystem/hl7.org-fhir-sid-icd-10-cm",
"resource": {
"resourceType": "CodeSystem",
"id": "hl7.org-fhir-sid-icd-10-cm",
"url": "http://hl7.org/fhir/sid/icd-10-cm",
"name": "ICD-10-CM",
"status": "active",
"hierarchyMeaning": "is-a",
"compositional": false,
"content": "complete"
}
},

but when i do API call to lookup a code..

http://144.76.65.203:8080/fhir/CodeSystem/$lookup?system=http://hl7.org/fhir/sid/icd-10-cm&code=A00

below is the response of "code": "not-found"
{
"resourceType": "OperationOutcome",
"issue": [ {
"severity": "error",
"code": "not-found",
"diagnostics": "Code 'A00' not found for system 'http://hl7.org/fhir/sid/icd-10-cm'."
} ]
}

Kindly help on is there any issue in above approach..

I'm not sure why Snowstorm accepted the TSV file. This is not a format it knows how to import.
The import formats Snowstorm has been tested with are listed here: https://github.com/IHTSDO/snowstorm/blob/master/docs/using-the-fhir-api.md

Please download the official ICD-10-CM package in tabular xml format distributed as a zip file.
The file is currently available here: https://www.cms.gov/medicare/coding-billing/icd-10-codes/2019-icd-10-cm
Screenshot 2024-08-16 at 10 22 19

Then upload like this:

hapi-fhir-cli upload-terminology -d icd10cm_tabular_2019.zip -v r4 -t http://localhost:8080/fhir -u http://hl7.org/fhir/sid/icd-10-cm

I've just tested this and can confirm that 53,536 codes are imported.

The response to the lookup you mentioned will look like this:

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "system",
      "valueString": "http://hl7.org/fhir/sid/icd-10-cm"
    },
    {
      "name": "version",
      "valueString": "2019"
    },
    {
      "name": "display",
      "valueString": "Cholera"
    },
    {
      "name": "property",
      "part": [
        {
          "name": "code",
          "valueCode": "child"
        },
        {
          "name": "value",
          "valueCoding": {
            "system": "http://hl7.org/fhir/sid/icd-10-cm",
            "code": "A00.0",
            "display": "Cholera due to Vibrio cholerae 01, biovar cholerae"
          }
        }
      ]
    },
    {
      "name": "property",
      "part": [
        {
          "name": "code",
          "valueCode": "child"
        },
        {
          "name": "value",
          "valueCoding": {
            "system": "http://hl7.org/fhir/sid/icd-10-cm",
            "code": "A00.1",
            "display": "Cholera due to Vibrio cholerae 01, biovar eltor"
          }
        }
      ]
    },
    {
      "name": "property",
      "part": [
        {
          "name": "code",
          "valueCode": "child"
        },
        {
          "name": "value",
          "valueCoding": {
            "system": "http://hl7.org/fhir/sid/icd-10-cm",
            "code": "A00.9",
            "display": "Cholera, unspecified"
          }
        }
      ]
    }
  ]
}

thanks..did the same like above..but still not getting returning anything in lookup api, below are the steps..

  1. hapi-fhir-cli upload-terminology -d icd10cm_tabular_2019.zip -v r4 -t http://localhost:8080/fhir -u http://hl7.org/fhir/sid/icd-10-cm

  2. http://144.76.65.203:8080/fhir/CodeSystem

     "entry": [
     {
     	"fullUrl": "http://144.76.65.203:8080/fhir/CodeSystem/hl7.org-fhir-sid-icd-10",
     	"resource": {
     		"resourceType": "CodeSystem",
     		"id": "hl7.org-fhir-sid-icd-10",
     		"url": "http://hl7.org/fhir/sid/icd-10",
     		"status": "active",
     		"hierarchyMeaning": "is-a",
     		"compositional": false,
     		"content": "complete"
     	}
     },
    
  3. http://144.76.65.203:8080/fhir/CodeSystem/$lookup?system=http://hl7.org/fhir/sid/icd-10&code=A00

    {
    "resourceType": "OperationOutcome",
    "issue": [ {
    "severity": "error",
    "code": "not-found",
    "diagnostics": "Code 'A00' not found for system 'http://hl7.org/fhir/sid/icd-10'."
    } ]
    }

could you guide where i am doing wrong..

The correct system uri for this codesystem is http://hl7.org/fhir/sid/icd-10-cm. That was used during the upload and should be used during the lookup.

http://localhost:8080/fhir/CodeSystem/$lookup?system=http://hl7.org/fhir/sid/icd-10-cm&code=A00

If you need to use a different system URI please use that when uploading.

got it thank you