:~$ ./hapi-fhir-cli upload-terminology -d Loinc_2.73.zip -d loincupload.properties -v r4 -t "http://localhost:8080" -u "http://loinc.org"
------------------------------------------------------------
🔥 HAPI FHIR 6.6.2 - Command Line Tool
------------------------------------------------------------
Process IDÂ Â Â Â Â Â Â Â Â Â Â : 1082399@zeus
Max configured JVM memory (Xmx) : 7.8GB
Detected Java version      : 17.0.7
------------------------------------------------------------
2023-07-31 04:49:22.29 [main] INFOÂ c.u.f.c.LogbackUtil Logging configuration set from file /logback-cli-on.xml
2023-07-31 04:49:23.50 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Reading /data/home/rob/Loinc_2.73.zip
2023-07-31 04:49:23.50 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Adding ZIP file: Loinc_2.73.zip
2023-07-31 04:49:23.87 [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-07-31 04:49:24.27 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Reading /data/home/rob/loincupload.properties
2023-07-31 04:49:24.27 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Compressing and adding file: loincupload.properties
2023-07-31 04:49:24.27 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Finished compressing loincupload.properties
2023-07-31 04:49:24.27 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Compressed 176 Bytes bytes in 1 file(s) into 267 Bytes bytes
2023-07-31 04:49:24.28 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Beginning upload - This may take a while...
2023-07-31 04:49:24.36 [main] ERROR ca.uhn.fhir.cli.App Error during execution:Â
ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException: HTTP 404Â
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.newInstance(BaseServerResponseException.java:309)
at ca.uhn.fhir.rest.client.impl.BaseClient.invokeClient(BaseClient.java:369)
at ca.uhn.fhir.rest.client.impl.GenericClient$BaseClientExecutable.invoke(GenericClient.java:538)
at ca.uhn.fhir.rest.client.impl.GenericClient$FetchConformanceInternal.execute(GenericClient.java:830)
at ca.uhn.fhir.rest.client.impl.RestfulClientFactory.validateServerBase(RestfulClientFactory.java:320)
at ca.uhn.fhir.rest.client.impl.RestfulClientFactory.validateServerBaseIfConfiguredToDoSo(RestfulClientFactory.java:283)
at ca.uhn.fhir.rest.client.impl.BaseClient.invokeClient(BaseClient.java:245)
at ca.uhn.fhir.rest.client.impl.GenericClient$BaseClientExecutable.invoke(GenericClient.java:538)
at ca.uhn.fhir.rest.client.impl.GenericClient$OperationInternal.execute(GenericClient.java:1317)
at ca.uhn.fhir.cli.UploadTerminologyCommand.invokeOperation(UploadTerminologyCommand.java:229)
at ca.uhn.fhir.cli.UploadTerminologyCommand.run(UploadTerminologyCommand.java:133)
at ca.uhn.fhir.cli.BaseApp.run(BaseApp.java:264)
at ca.uhn.fhir.cli.App.main(App.java:42)
2023-07-31 04:49:24.37 [Thread-0] INFOÂ ca.uhn.fhir.cli.App HAPI FHIR is shutting down...
With the $upload-external-code-system operation I'm using this POST command (I've tried that so far only with LOINC 2.74, not 2.73) and Parameters resource:
curl -T hapi_terminology_parameters_loinc_2.74.json -H "Content-Type: application/json" -X POST http://localhost:8080/fhir/CodeSystem/$upload-external-code-system
{
  "resourceType":"Parameters",
  "parameter":[
   {
     "name":"system",
     "valueUri":"http://loinc.org"
   },
   {
     "name":"file",
     "valueAttachment": {
      "contentType":"application/zip",
      "data":"...base64-encoded-data...",
      "url":"Loinc_2.74.zip"
     }
   }
  ]
}
And the error that I'm consistently getting is:
:~$ curl -T hapi_terminology_parameters_loinc_2.74.json -H "Content-Type: application/json" -X POST http://localhost:8080/fhir/CodeSystem/$upload-external-code-system
{
 "resourceType": "OperationOutcome",
 "issue": [ {
  "severity": "error",
  "code": "processing",
  "diagnostics": "HAPI-0450: Failed to parse request body as JSON resource. Error was: HAPI-1814: Incorrect resource type found, expected \"CodeSystem\" but found \"Parameters\""
 } ]
I haven't found a way to get the operation to expect a Parameters resource instance for the operation parameters, rather than an actual CodeSystem resource instance. I have validated the payload as a valid Parameters resource instance, including the base64 encoded file data in the Attachment data type.
Any help with figuring this out and solving the issue(s) will be much appreciated!
Rob
--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/e0c1debc-381f-47eb-ba8e-03ba2a6cb6c7n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/088bd704-5778-4ab0-a96c-578931bba480n%40googlegroups.com.
Hi,Can you try the other version? Check it here:Â https://loinc.org/downloads/archive/ Maybe 2.72 one?
Yes, thanks. That's exactly what I did, as I tried to describe in my post. The hapi-fhir-cli client is what is giving the 'ResourceNotFoundException' error. I tried the direct API call as an alternative to that, because the client was consistently erroring out, for no obvious reason related to anything that I have been doing as far as I could see (of course, I may be missing something).Rob
On Monday, July 31, 2023 at 4:34:32 AM UTC-5 haiphon...@gmail.com wrote:
Hi,Did you try CLI tool here: https://hapifhir.io/hapi-fhir/docs/tools/hapi_fhir_cli.htmlÂAs per my understanding, u shouldnt use HTTP Request since the file size is too large (more than 10Mb).Â
I'm trying to load both of these terminologies on a newly deployed HAPI 6.6.0 server instance. I've tried both with the client (6.6.0 and 6.6.2) 'upload-terminology' command and directly with the CodeSystem/$upload-external-code-system operation (using cUrl on localhost), and both methods are giving me (different) errors. This is what I'm consistently getting with the client (both versions), with both SNOMED CT and LOINC (it's the same error):Â
[...]
--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/8f97bad9-b2ad-4fb1-9fc6-72b2b753d103n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/d6b56736-fcf1-4b11-86f0-e3cf3094f3e5n%40googlegroups.com.
rob@zeus:~$ ./hapi-fhir-cli upload-terminology -d SnomedCT_InternationalRF2_PRODUCTION_20230731T120000Z.zip -v r4 -t "http://localhost:8080/fhir" -u "http://snomed.info/sct"
------------------------------------------------------------
🔥 HAPI FHIR 6.6.0 - Command Line Tool
------------------------------------------------------------
Process IDÂ Â Â Â Â Â Â Â Â Â Â : 2124752@zeus
Max configured JVM memory (Xmx) : 7.8GB
Detected Java version      : 17.0.7
------------------------------------------------------------
2023-08-10 13:15:26.67 [main] INFOÂ c.u.f.c.LogbackUtil Logging configuration set from file /logback-cli-on.xml
2023-08-10 13:15:28.80 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Reading /data/home/rob/SnomedCT_InternationalRF2_PRODUCTION_20230731T120000Z.zip
2023-08-10 13:15:28.80 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Adding ZIP file: SnomedCT_InternationalRF2_PRODUCTION_20230731T120000Z.zip
2023-08-10 13:15:32.63 [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-08-10 13:15:36.55 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Beginning upload - This may take a while...
2023-08-10 13:15:37.40 [main] ERROR c.u.f.c.UploadTerminologyCommand Received the following response:
{
 "resourceType": "OperationOutcome",
 "issue": [ {
  "severity": "error",
  "code": "processing",
  "diagnostics": "HAPI-1141: Unknown file: hapi-fhir-cli16020114123940321072.zip"
 } ]
}
2023-08-10 13:15:37.41 [main] ERROR ca.uhn.fhir.cli.App Error during execution:Â
ca.uhn.fhir.rest.server.exceptions.InvalidRequestException: HTTP 400 : HAPI-1141: Unknown file: hapi-fhir-cli16020114123940321072.zip
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.newInstance(BaseServerResponseException.java:309)
at ca.uhn.fhir.rest.client.impl.BaseClient.invokeClient(BaseClient.java:369)
at ca.uhn.fhir.rest.client.impl.GenericClient$BaseClientExecutable.invoke(GenericClient.java:538)
at ca.uhn.fhir.rest.client.impl.GenericClient$OperationInternal.execute(GenericClient.java:1317)
at ca.uhn.fhir.cli.UploadTerminologyCommand.invokeOperation(UploadTerminologyCommand.java:229)
at ca.uhn.fhir.cli.UploadTerminologyCommand.run(UploadTerminologyCommand.java:133)
at ca.uhn.fhir.cli.BaseApp.run(BaseApp.java:264)
at ca.uhn.fhir.cli.App.main(App.java:42)
2023-08-10 13:15:37.42 [Thread-0] INFOÂ ca.uhn.fhir.cli.App HAPI FHIR is shutting down...
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/CAKowd8k4gG%2B-ZS-DO3rQXcs3xegr3dVFNAHL5ptb_zxEQbNhUQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/CA%2BKThc_eoe0AwdP_Y_eyqGgquEvzEbJ5tpbC-ECz0VfDAMTBFw%40mail.gmail.com.
|
hapi-fhir-cli upload-terminology -d /Users/satv/Downloads/SnomedCT_ManagedServiceUS_PRODUCTION_US1000124_20240301T120000Z.zip -v r4 -t http://localhost:8080/fhir -u http://snomed.info/sct -s 12GBÂ
------------------------------------------------------------
🔥 HAPI FHIR 8.0.0 - Command Line Tool
------------------------------------------------------------
Process IDÂ Â Â Â Â Â Â Â Â Â Â : 31...@MacBook-Pro.local
Max configured JVM memory (Xmx) : 8.0GB
Detected Java version      : 23.0.2
------------------------------------------------------------
2025-04-11 22:03:49.25 [main] INFOÂ c.u.f.c.LogbackUtil Logging configuration set from file /logback-cli-on.xml
Standard Commons Logging discovery in action with spring-jcl: please remove commons-logging.jar from classpath in order to avoid potential conflicts
2025-04-11 22:03:49.73 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Reading /Users/satv/Downloads/SnomedCT_ManagedServiceUS_PRODUCTION_US1000124_20240301T120000Z.zip
2025-04-11 22:03:49.73 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Adding ZIP file: /Users/satv/Downloads/SnomedCT_ManagedServiceUS_PRODUCTION_US1000124_20240301T120000Z.zip
2025-04-11 22:03:55.02 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Beginning upload - This may take a while...
2025-04-11 22:04:14.02 [main] ERROR c.u.f.c.UploadTerminologyCommand Received the following response:
{
 "resourceType": "OperationOutcome",
 "issue": [ {
  "severity": "error",
  "code": "processing",
  "diagnostics": "Java heap space"
 } ]
}
2025-04-11 22:04:14.02 [main] ERROR ca.uhn.fhir.cli.App Error during execution:Â
ca.uhn.fhir.rest.server.exceptions.InternalErrorException: HTTP 500 : Java heap space
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:501)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:485)
at ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.newInstance(BaseServerResponseException.java:317)
at ca.uhn.fhir.rest.client.impl.BaseClient.invokeClient(BaseClient.java:415)
at ca.uhn.fhir.rest.client.impl.GenericClient$BaseClientExecutable.invoke(GenericClient.java:585)
at ca.uhn.fhir.rest.client.impl.GenericClient$OperationInternal.execute(GenericClient.java:1441)
at ca.uhn.fhir.cli.UploadTerminologyCommand.invokeOperation(UploadTerminologyCommand.java:255)
at ca.uhn.fhir.cli.UploadTerminologyCommand.run(UploadTerminologyCommand.java:151)
at ca.uhn.fhir.cli.BaseApp.run(BaseApp.java:272)
at ca.uhn.fhir.cli.App.main(App.java:42)
2025-04-11 22:04:14.03 [Thread-0] INFOÂ ca.uhn.fhir.cli.App HAPI FHIR is shutting down...
hapi-fhir-cli upload-terminology -d /Users/satv/Downloads/SnomedCT_ManagedServiceUS_PRODUCTION_US1000124_20240301T120000Z.zip -v r4 -t http://localhost:8080/fhir -u http://snomed.info/sct -s 12GBÂ
------------------------------------------------------------
🔥 HAPI FHIR 8.0.0 - Command Line Tool
------------------------------------------------------------
Process IDÂ Â Â Â Â Â Â Â Â Â Â : 31287
Max configured JVM memory (Xmx) : 8.0GB
Detected Java version      : 23.0.2
------------------------------------------------------------
2025-04-11 22:03:49.25 [main] INFOÂ c.u.f.c.LogbackUtil Logging configuration set from file /logback-cli-on.xml
Standard Commons Logging discovery in action with spring-jcl: please remove commons-logging.jar from classpath in order to avoid potential conflicts
2025-04-11 22:03:49.73 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Reading /Users/satv/Downloads/SnomedCT_ManagedServiceUS_PRODUCTION_US1000124_20240301T120000Z.zip
2025-04-11 22:03:49.73 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Adding ZIP file: /Users/satv/Downloads/SnomedCT_ManagedServiceUS_PRODUCTION_US1000124_20240301T120000Z.zip
2025-04-11 22:03:55.02 [main] INFOÂ c.u.f.c.UploadTerminologyCommand Beginning upload - This may take a while...
2025-04-11 22:04:14.02 [main] ERROR c.u.f.c.UploadTerminologyCommand Received the following response:
{
 "resourceType": "OperationOutcome",
 "issue": [ {
  "severity": "error",
  "code": "processing",
  "diagnostics": "Java heap space"
 } ]
}
2025-04-11 22:04:14.02 [main] ERROR ca.uhn.fhir.cli.App Error during execution:Â
ca.uhn.fhir.rest.server.exceptions.InternalErrorException: HTTP 500 : Java heap space
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:501)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:485)
at ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.newInstance(BaseServerResponseException.java:317)
at ca.uhn.fhir.rest.client.impl.BaseClient.invokeClient(BaseClient.java:415)
at ca.uhn.fhir.rest.client.impl.GenericClient$BaseClientExecutable.invoke(GenericClient.java:585)
at ca.uhn.fhir.rest.client.impl.GenericClient$OperationInternal.execute(GenericClient.java:1441)
at ca.uhn.fhir.cli.UploadTerminologyCommand.invokeOperation(UploadTerminologyCommand.java:255)
at ca.uhn.fhir.cli.UploadTerminologyCommand.run(UploadTerminologyCommand.java:151)
at ca.uhn.fhir.cli.BaseApp.run(BaseApp.java:272)
at ca.uhn.fhir.cli.App.main(App.java:42)
2025-04-11 22:04:14.03 [Thread-0] INFOÂ ca.uhn.fhir.cli.App HAPI FHIR is shutting down...