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

error importing LOINC terminology with hapi-fhir-cli #1629

Open sandrozbinden opened 4 years ago

sandrozbinden commented 4 years ago

Describe the bug We tried to import LOINC terminologies to our hapi-fhir server using the hapi-fhir-cli but unfortunately received a HTTP 400 Bad Request.

To Reproduce

  1. Download hapi-fhir-cli 4.1.0 from https://github.com/jamesagnew/hapi-fhir/releases
  2. Execute the following command: hapi-fhir-cli upload-terminology -d Downloads/Loinc_2.66.zip -v r4 -t http://localhost:8081/hapi-fhir-jpaserver/fhir/ -u http://loinc.org
  3. We receive the following error on cli: ca.uhn.fhir.rest.server.exceptions.InvalidRequestException: HTTP 400 Bad Request: Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[CodeSystem/$upload-external-code-system] with parameters [[]]

Expected behavior The LOINC terminology should be imported.

Environment:

JSON Response:

{
  "resourceType": "OperationOutcome",
  "text": {
    "status": "generated",
    "div": "...Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[CodeSystem/$upload-external-code-system] with parameters [[]]..."
  },
  "issue": [
    {
      "severity": "error",
      "code": "processing",
      "diagnostics": "Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[CodeSystem/$upload-external-code-system] with parameters [[]]"
    }
  ]
}
jamesagnew commented 4 years ago

A fix has just been committed that should also address this issue.

Can you please try building HAPI FHIR locally and confirming whether you still see this issue?

sandrozbinden commented 4 years ago

Hi James

We used the newest HAPI FHIR Server and also updated the CLI but still got the same issue. What we did was running the jpa-server-starter locally with on the newest master branch. Did you mean something elese with building the HAPI FHIR Server?

jamesagnew commented 4 years ago

Ah sorry, for the server you'll want to build from the following branch: rel_4_2_0

On Fri, Dec 20, 2019 at 7:36 AM Sandro Zbinden notifications@github.com wrote:

Hi James

We used the newest HAPI FHIR Server and also updated the CLI but still got the same issue.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jamesagnew/hapi-fhir/issues/1629?email_source=notifications&email_token=AA2N7HP3XP7UMKYCB6JKBY3QZS33HA5CNFSM4J2AWKTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHM2BQI#issuecomment-567910593, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2N7HIIZI3I2P35SNYKJM3QZS33HANCNFSM4J2AWKTA .

HananAwwad commented 4 years ago

i have pulled branch rel_4_2_0 from https://github.com/hapifhir/hapi-fhir-jpaserver-starter and run the server but sill i have the same error

HananAwwad commented 4 years ago

FYI, this is not a problem in any hapi fhir jpa starter; just you need to enable register TerminologyUploaderProvider

djvreeman commented 4 years ago

Unfortunately I'm having the same issues with the following setup:

HAPI FHIR Server - 4.2.0 HAPI FHIR 4.3.0-SNAPSHOT - Command Line Tool Loinc_2.67.zip

Command: sudo java -Xmx2G -jar hapi-fhir-cli.jar upload-terminology -d loinc/Loinc_2.67.zip -v r4 -t http://localhost:8080/hapi-fhir-jpaserver/fhir/ -v r4 -u http://loinc.org

I'm using the CLI to update the terminology resources on the local server (which is deployed with the recent 4.2.0 release). Since the release notes mention support for LOINC v2.67, I was expecting this to work.

Instead I get the same error as @sandrozbinden :

{
  "resourceType": "OperationOutcome",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[CodeSystem/$upload-external-code-system] with parameters [[]]</pre></td>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
  },
  "issue": [
    {
      "severity": "error",
      "code": "processing",
      "diagnostics": "Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[CodeSystem/$upload-external-code-system] with parameters [[]]"
    }
  ]
}
HananAwwad commented 4 years ago

Hello djvreeman,

This error come up when the TerminologyUploaderProvider is not registered in the server it self; its disabled by default; you need to enable registering it at the startup

Its working with me; feel free to call me at skype "hanan.s.awwad" if you need any help;

Supratentorial commented 4 years ago

This still comes up high in Google search results. @HananAwwad is correct, the configuration line can be found in BaseJparestfulServer.java:

if (false) { // <-- DISABLED RIGHT NOW registerProvider(appCtx.getBean(TerminologyUploaderProvider.class)); }

Then use the hapi-fhir-cli tool to upload the terminology of choice. Can close the issue now but consider improving the documentation.