hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
2.05k stars 1.33k forks source link

Terminology Upload - SnomedCT - relationships lost without EN version #6492

Open gdrouet opened 5 days ago

gdrouet commented 5 days ago

NOTE: Before filing a ticket, please see the following URL: https://github.com/hapifhir/hapi-fhir/wiki/Getting-Help

Describe the bug The hapi-fhir-cli does no import relationships when loading the SnomedCT in a different language than English.

To Reproduce Steps to reproduce the behavior:

  1. Download the french edition of SnomedCT here: https://smt.esante.gouv.fr/catalogue-des-terminologies/
  2. Import the ZIP file: hapi-fhir-cli upload-terminology -d ./SnomedCT_ManagedServiceFR_PRODUCTION_FR1000315_20240621T120000Z.zip -v r5 -t http://localhost:9090/server/DEFAULT -u 'http://snomed.info/sct'
  3. The table TRM_CONCEPT_PC_LINK is not populated with the links between SnomedCT concepts

Expected behavior All the relationships must be imported.

Environment (please complete the following information): HAPI FHIR: 7.2.2 OS: Windows

Additional context In the SctHandlerRelationship class, we can find this condition that fails when the SCT is not in english:

if (typeConcept.getDisplay().equals("Is a (attribute)"))

I don't know why a string comparison is performed here since simply cheking the typeId should work the same way and be valid for other languages.

jamesagnew commented 5 days ago

Interesting.

FWIW if someone wanted to take a crack at fixing this, the test class TerminologyLoaderSvcSnomedCtTest has a test method testLoadSnomedCt() which currently runs the english loader against a manually created small subset of the english files. A PR which addresses this issue and adds a test using a similar french equivalent test file set would be gladly accepted.