Skip to content

hapi-fhir-cli for upload of custom terminology #1168

@ozhyrenkov

Description

@ozhyrenkov

Hello,
Recently I set up a new fresh installation of Snowowl and trying to upload few basic terminologies using popular hapi-fhir-cli tool:

hapi-fhir-cli upload-terminology  -b PROMPT -l -s 1GB -d Loinc_2.72.zip -v r4 -u http://loinc.org -t http://myserver:8080/snowowl/fhir 

However this gives me an error which makes me think fhir/CodeSystem/$upload-external-code-system is not implemented in SnowOwl or I might be doing something totally wrong.

Could anyone please advise me whether I am doing something wrong or what is the way to upload e.g. official Loinc terminology package?

Stacktrace:

hapi-fhir-cli upload-terminology  -b PROMPT -l -s 1GB -d Loinc_2.72.zip -v r4 -u http://loinc.org -t http://myserver:8080/snowowl/fhir
------------------------------------------------------------
🔥  HAPI FHIR 6.4.4 - Command Line Tool
------------------------------------------------------------
Max configured JVM memory (Xmx) : 4.0GB
Detected Java version           : 20.0.1
------------------------------------------------------------
2023-06-02 00:05:49.88 [main] INFO  c.u.f.c.LogbackUtil Logging configuration set from file /logback-cli-on.xml
Enter Basic Auth Credentials (format is "username:password"):
2023-06-02 00:05:57.95 [main] INFO  c.u.f.c.UploadTerminologyCommand Reading /Users/$me/Downloads/Loinc_2.72.zip
2023-06-02 00:05:57.95 [main] INFO  c.u.f.c.UploadTerminologyCommand Adding ZIP file: Loinc_2.72.zip
2023-06-02 00:05:59.33 [main] INFO  c.u.f.c.UploadTerminologyCommand Beginning upload - This may take a while...
2023-06-02 00:06:02.08 [main] ERROR ca.uhn.fhir.cli.App Error during execution:
ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: HAPI-1361: Failed to parse response from server when performing POST to URL http://myserver:8080/snowowl/fhir/CodeSystem/$upload-external-code-system - java.net.SocketException: Broken pipe
	at ca.uhn.fhir.rest.client.impl.BaseClient.invokeClient(BaseClient.java:419)
	at ca.uhn.fhir.rest.client.impl.GenericClient$BaseClientExecutable.invoke(GenericClient.java:541)
	at ca.uhn.fhir.rest.client.impl.GenericClient$OperationInternal.execute(GenericClient.java:1320)
	at ca.uhn.fhir.cli.UploadTerminologyCommand.invokeOperation(UploadTerminologyCommand.java:230)
	at ca.uhn.fhir.cli.UploadTerminologyCommand.run(UploadTerminologyCommand.java:134)
	at ca.uhn.fhir.cli.BaseApp.run(BaseApp.java:266)
	at ca.uhn.fhir.cli.App.main(App.java:43)
Caused by: java.net.SocketException: Broken pipe
	at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:413)
	at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:433)
	at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:812)
	at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1120)
	at org.apache.http.impl.io.SessionOutputBufferImpl.streamWrite(SessionOutputBufferImpl.java:124)
	at org.apache.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:160)
	at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:113)
	at org.apache.http.entity.ByteArrayEntity.writeTo(ByteArrayEntity.java:112)
	at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:156)
	at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:152)
	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:238)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
	at ca.uhn.fhir.rest.client.apache.ApacheHttpRequest.execute(ApacheHttpRequest.java:70)
	at ca.uhn.fhir.rest.client.impl.BaseClient.invokeClient(BaseClient.java:322)
	... 6 common frames omitted
2023-06-02 00:06:02.09 [Thread-0] INFO  ca.uhn.fhir.cli.App HAPI FHIR is shutting down...

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions