Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loinc Codes Not found After uploading FHIR Terminology package #609

Open
someshwarMirge opened this issue Jul 19, 2024 · 5 comments
Open
Assignees

Comments

@someshwarMirge
Copy link

Hello @kaicode ,
We are using Snowstorm 10.2.1 as a FHIR terminology server.After uploading FHIR CodeSystem & ValueSet Bundle , We get Loinc Code Not found Error which were working before FHIR Bundle upload.
We have been facing this issue from snowstorm 9 as reported earlier here .

Components Used:

  • Java version : 17
  • Elastic search 8.11.1
  • Snowstorm Version 10.2.1
  • Loinc 2.77
  • HL7 Terminoogy version 3.1.0
  • HAPI FHIR CLI tool :

Steps To recreate issue :

  1. Installed elastic search
  2. Disabled security features of elastic search as recommended by official docs here
  3. Set index.mapping.total_fields.limit to 2000 (as default 1000 giving error when uploading Loinc) (link)
  4. Uploaded Code system files in following sequence with help of Docs page (link):
  • SnomedCT International edition RF2
  • Snomed CT India Extensions RF2
  • ICD 10 2019 package
  • LOINC 2.77
  • FHIR CodeSystem & ValueSet Bundle
  • ABDM FHIR Bundle
  1. Tested APIs
    {{server}}/fhir/CodeSystem/$lookup?system=http://loinc.org&code=21176-3
  2. Loinc API respond with following error
    "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "not-found", "diagnostics": "Code '21176-3' not found for system 'http://loinc.org'." } ] }

This example is given for Lookup API but along with lookup , all other APIs return same NOT FOUND status when it comes to LOINC.
Please, guide us to resolve this issue.
Thanks & Regards!

@kaicode kaicode self-assigned this Jul 29, 2024
@kaicode
Copy link
Member

kaicode commented Jul 31, 2024

I'm not aware of a way to upload bundles to Snowstorm. It is possible to upload FHIR Packages, is this what you mean?

@someshwarMirge
Copy link
Author

someshwarMirge commented Jul 31, 2024

@kaicode Thanks for response!
Yes, i am uploading FHIR packages. Following are the files used :

  1. Loinc : Loinc_2.77.zip
  2. HL7 : hl7.terminology.r4-3.1.0.tgz

@kaicode
Copy link
Member

kaicode commented Jul 31, 2024

I've reproduced this issue. The HL7 package contains an empty version of the LOINC codesystem with the correct URL and version "3.0.0". The original LOINC version, loaded from the loinc package, also exists within Snowstorm but no version is set because the loinc package data does not contain the version number.

Both codesystems listed here: http://localhost:8080/fhir/CodeSystem?name=LOINC

All codes are tied to a specific version of the code system. Snowstorm doesn't know which version of LOINC to use. It seems to be automatically selecting the empty "3.0.0" version of LOINC when attempting to complete the lookup and other operations.

It's not possible to delete codesystems via the Snowstorm FHIR API.
Possible workarounds:

  • Remove the package/CodeSystem-v3-loinc.json entry from the HL7 package before upload to prevent the empty version 3.0.0 codesystem being created.
  • Or, delete the empty version 3.0.0 codesystem from Elasticsearch directly using this curl request: curl -X POST "localhost:9200/fhir-codesystem-version/_delete_by_query?pretty" -H 'Content-Type: application/json' -d '{"query": {"match": {"_id": "v3-loinc"}}}'

I have tested the second solution and that fixes lookups.

@someshwarMirge
Copy link
Author

@kaicode, thank you for the swift resolution! I've tested the second workaround, and it's functioning well for other APIs with LOINC as well. This addresses the issue for now. I'm curious to know if there are any definitive solutions anticipated in upcoming Snowstorm releases to manage multiple versions of the same CodeSystem and to delete an uploaded CodeSystem.

@kaicode
Copy link
Member

kaicode commented Aug 1, 2024

I think it would be sensible for Snowstorm to ignore CodeSystem that don't contain codes if a CodeSystem with the same URL already exists. This way importing the HL7 terminology package would not hide the real LOINC import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants