hapifhir / hapi-fhir

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

Loinc 2.74 support #4715

Open rajayeswanth opened 1 year ago

rajayeswanth commented 1 year ago

Describe the issue I'm currently using HAPI FHIR CLI for loading loinc codesytem into snowstorm server but I'm unable to load the latest version of loinc due to the following error:-


C:\Users\DELL\Desktop\hapi-fhir-6.4.4-cli>hapi-fhir-cli upload-terminology -d C:\Users\DELL\Desktop\loinc.zip -v r4 -t http://localhost:8080/fhir -u http://loinc.org

? HAPI FHIR 6.4.4 - Command Line Tool

Process ID : 17988@DESKTOP-CLPO9IU Max configured JVM memory (Xmx) : 4.0GB Detected Java version : 11.0.18

2023-04-04 12:16:34.45 [main] INFO c.u.f.c.LogbackUtil Logging configuration set from file /logback-cli-on.xml 2023-04-04 12:16:36.43 [main] INFO c.u.f.c.UploadTerminologyCommand Reading C:\Users\DELL\Desktop\loinc.zip 2023-04-04 12:16:36.43 [main] INFO c.u.f.c.UploadTerminologyCommand Adding ZIP file: C:\Users\DELL\Desktop\loinc.zip 2023-04-04 12:16:36.77 [main] INFO c.u.f.c.UploadTerminologyCommand File size is greater than 10 MB - Going to use a local file reference instead of a direct HTTP transfer. Note that this will only work when executing this command on the same server as the FHIR server itself. 2023-04-04 12:16:37.09 [main] INFO c.u.f.c.UploadTerminologyCommand Beginning upload - This may take a while... 2023-04-04 12:16:46.19 [main] ERROR c.u.f.c.UploadTerminologyCommand Received the following response: { "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "processing", "diagnostics": "Could not find the following mandatory files in input: [AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv]" } ] }


and I have noticed that loinc.org recently changed the file "MultiAxialHierarchy" to Component Hierarchy By System and "MultiAxialHierarchy.csv" to "ComponentHierarchyBySystem.csv" (not sure about the internal changes in csv files)

Environment (please complete the following information):

timharsch commented 1 year ago

FWIW, I have also ran into this issue and after a bit of search found that the issue is discussed in depth at the LOINC forum here

The workaround seems to be to update the loincupload.properties file.

timharsch commented 1 year ago

This seems to be quite the blocker if you are running into it in docker (via hapi-fhir-jpaserver-starter). The issue is that the property file is buried in the war which is buried in a jar file that is pulled from the released jar in maven central.

% git clone git@github.com:hapifhir/hapi-fhir-jpaserver-starter.git
% mvn clean install
% unzip -p target/ROOT.war WEB-INF/lib/hapi-fhir-jpaserver-base-6.4.4.jar > hapi-fhir-jpaserver-base-6.4.4.jar 
% unzip -p hapi-fhir-jpaserver-base-6.4.4.jar ca/uhn/fhir/jpa/term/loinc/loincupload.properties | head -26 | tail -7
# LOINC hierarchy
# For LOINC v2.72 and earlier, use
# loinc.hierarchy.file=AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv
# For LOINC 2.73, use
# loinc.hierarchy.file=AccessoryFiles/ComponentHierarchyBySystem/ComponentHierarchyBySystem.csv
## File must be present
loinc.hierarchy.file=AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv

As you can see the comments do acknowledge already the need to change the hierarchy file for the latest version, but for some reason the switch was not made. Especially troubling since I also can't find prior versions of the Loinc file on the web site.

ozhyrenkov commented 1 year ago

Hey all! Any updates on it?

farmaan-e commented 6 months ago

Fix