FHIR Chat · hapi_fhir_cli 2.0 not loading example data · hapi

Stream: hapi

Topic: hapi_fhir_cli 2.0 not loading example data


view this post on Zulip Günter Zöchbauer (Sep 27 2016 at 12:51):

I run hapi-fhir-cli upload-examples -t http://localhost:8080/baseDstu2 -c and all messages indicate it succeeded, but querying for any resource type always returns 0 results.

This are the last lines of the output

11:30:54 INFO  ca.uhn.fhir.cli.ExampleDataUploader - Discarding unknown reference: ValueSet/v2-0371
11:30:54 INFO  ca.uhn.fhir.cli.ExampleDataUploader - Discarding unknown reference: ValueSet/v3-PurposeOfUse
11:30:54 INFO  ca.uhn.fhir.cli.ExampleDataUploader - Discarding unknown reference: ValueSet/v3-ActCode
11:30:54 INFO  ca.uhn.fhir.cli.ExampleDataUploader - 2326 good references
11:30:54 INFO  ca.uhn.fhir.cli.ExampleDataUploader - Final bundle: 1162 entries
11:30:54 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 362 remaining
11:30:55 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 351 remaining
11:30:55 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 340 remaining
11:30:55 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 329 remaining
11:30:56 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 318 remaining
11:30:56 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 307 remaining
11:30:56 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 296 remaining
11:30:56 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 285 remaining
11:30:57 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 274 remaining
11:30:57 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 263 remaining
11:30:57 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 252 remaining
11:30:57 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 241 remaining
11:30:57 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 230 remaining
11:30:57 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 219 remaining
11:30:57 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 208 remaining
11:30:57 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 197 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 186 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 175 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 164 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 153 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 142 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 131 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 120 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 109 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 98 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 87 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 76 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 65 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 54 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 43 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 32 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 21 remaining
11:30:58 INFO  ca.uhn.fhir.cli.ExampleDataUploader - About to upload 11 examples in a transaction, 10 remaining

Does this look correct?
About to upload 11 examples looks a bit weird to me.

hapi-fhir-cli upload-definitions -t http://localhost:8080/baseDstu2
produces about 30 warnings like
11:47:33 WARN c.u.fhir.cli.ValidationDataUploader - Failed to upload StructureDefinition/VisionPrescription - HTTP 400 Bad Request: Resource contains external reference to URL "http://hl7.org/fhir/ValueSet/vision-product" but this server is not configured to allow external referenc
but gets 1067 ValueSets and 35 StructureDefinitions loaded.

I also tried with 1.6 with the same results.

Any hint?

view this post on Zulip Günter Zöchbauer (Sep 27 2016 at 14:01):

I got a hint about a possible bug in the implementers stream where I first posted this question https://chat.fhir.org/#narrow/stream/implementers/topic/FHIR.20test.20server.20on.20Linux

view this post on Zulip Grahame Grieve (Sep 27 2016 at 15:01):

@James Agnew for your attention

view this post on Zulip Günter Zöchbauer (Sep 27 2016 at 15:16):

also https://fhirtest.uhn.ca/ isn't working since a few hours (at least for me)

Warning!
Failed to load conformance statement, ...

view this post on Zulip David Hay (Sep 27 2016 at 19:01):

The server was down - it's up now...

view this post on Zulip James Agnew (Sep 27 2016 at 21:47):

Hi @Günter Zöchbauer ,

Try starting the CLI server with the following argument: --allow-external-refs

By default the CLI server blocks external references, but you can turn this off via command line argument (and the examples use lots of external refs so you need to do that if you want to upload them)

view this post on Zulip David Hay (Sep 27 2016 at 23:16):

Hi James - is there a list of these switches?

view this post on Zulip Günter Zöchbauer (Sep 28 2016 at 06:05):

@James Agnew thanks for your support!
I now get 1067 ValueSets and 160 StructureDefinitions from upload-definitions but upload-examples still doesn't result in any records being shown in the browser view

pasted image

view this post on Zulip Günter Zöchbauer (Sep 28 2016 at 06:09):

------------------------------------------------------------
? HAPI FHIR 2.0 - Command Line Tool
------------------------------------------------------------
Max configured JVM memory (Xmx): 3.5GB
Detected Java version: 1.8.0_102
------------------------------------------------------------
08:08:12 INFO  ca.uhn.fhir.cli.RunServerCommand - Server is configured to allow external references
08:08:12 INFO  ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU2]
08:08:12 INFO  ca.uhn.fhir.cli.RunServerCommand - Preparing HAPI FHIR JPA server on port 8080
08:08:12 INFO  ca.uhn.fhir.cli.RunServerCommand - Starting HAPI FHIR JPA server in DSTU2 mode
08:08:19 INFO  ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU2]
08:08:20 INFO  ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU1]
08:08:20 INFO  ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU2_HL7ORG]
08:08:20 INFO  ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU3]
08:08:23 WARN  o.h.e.jdbc.spi.SqlExceptionHelper - SQL Warning Code: 10000, SQLState: 01J01
08:08:23 WARN  o.h.e.jdbc.spi.SqlExceptionHelper - SQL Warning Code: 10000, SQLState: 01J01
08:08:23 WARN  o.h.e.jdbc.spi.SqlExceptionHelper - SQL Warning Code: 10000, SQLState: 01J01
08:08:23 WARN  o.h.e.jdbc.spi.SqlExceptionHelper - Database 'directory:target/jpaserver_derby_files' not created, connection made to existing database instead.
08:08:23 WARN  o.h.e.jdbc.spi.SqlExceptionHelper - Database 'directory:target/jpaserver_derby_files' not created, connection made to existing database instead.
08:08:23 WARN  o.h.e.jdbc.spi.SqlExceptionHelper - Database 'directory:target/jpaserver_derby_files' not created, connection made to existing database instead.
08:08:23 WARN  o.h.e.jdbc.spi.SqlExceptionHelper - SQL Warning Code: 10000, SQLState: 01J01
08:08:23 WARN  o.h.e.jdbc.spi.SqlExceptionHelper - Database 'directory:target/jpaserver_derby_files' not created, connection made to existing database instead.
08:08:23 WARN  o.h.e.jdbc.spi.SqlExceptionHelper - SQL Warning Code: 10000, SQLState: 01J01
08:08:23 WARN  o.h.e.jdbc.spi.SqlExceptionHelper - Database 'directory:target/jpaserver_derby_files' not created, connection made to existing database instead.
08:08:23 INFO  ca.uhn.fhir.cli.RunServerCommand - Server started on port 8080
08:08:23 INFO  ca.uhn.fhir.cli.RunServerCommand - Web Testing UI : http://localhost:8080/
08:08:23 INFO  ca.uhn.fhir.cli.RunServerCommand - Server Base URL: http://localhost:8080/baseDstu2/

view this post on Zulip Günter Zöchbauer (Sep 28 2016 at 07:32):

@DavidHay I was wondering as well

view this post on Zulip Günter Zöchbauer (Sep 28 2016 at 18:58):

@James Agnew I can normally use the server and storing resources using the REST API but upload-examples doesn't actually load any examples.

view this post on Zulip James Agnew (Sep 28 2016 at 21:17):

Hi @Günter Zöchbauer- It seems like there may be a bug in the 2.0 CLI :(

Do you mind to try using a 2.1 snapshot build and see if it works for you there? You can download a copy here: https://fileportal.uhn.ca/download.aspx?ID=582f20b8-baa5-4bb6-ae1d-b35ed130b7b2

view this post on Zulip Günter Zöchbauer (Sep 29 2016 at 08:58):

@James Agnew with 2.1 I get
- 25 Observation
- 23 Medication
- 22 ConceptMap
- ...

I don't know if this are the expected numbers but there is now at least one record
except for Bundle, DataElement, OperationDefinition, OperationOutcome, SearchParameter, Subscription, SupportingDocumentation, Test and User

view this post on Zulip Günter Zöchbauer (Sep 29 2016 at 09:02):

Is there a way to way to specify a port for
hapi-fhir-cli run-server
I run it in a Docker container and mapped to port 8080 to a different outside port but that breaks the WebUI

pasted image

view this post on Zulip James Agnew (Sep 29 2016 at 13:47):

Re. the upload- Yup that sounds about right. The types you mentioned that you don't see (Bundle, DataElement, etc) don't get uploaded because I found that the samples all failed some rule within HAPI that prevented them from being uploaded so the uploader skips them.

For example HAPI's server has a rule that Subscription needs to use the websocket transport (because that's all it supports), SearchParameter needs to map to an existing parameter, etc.

Re. the docker thing that is weird! The WebUI makes its FHIR requests via a normal HTTP FHIR call, but the call originates on the server (i.e. not from the browser- it's server-to-server). Based on the UI presumably you've got it running on port 5555, which means that the server is trying to talk to itself on port 5555. I don't see any obvious reason why this shouldn't work, as it's all happening within the container. Then again, I'm not a docker export by any means...

view this post on Zulip James Agnew (Sep 29 2016 at 13:49):

I guess I'm also confused by your actual question :) Yes, it is possible to set the port for the server, e.g.:
./hapi-fhir-cli run-server -p 5555

But presumably you're already doing that, if the Web UI is trying to hit that port?

view this post on Zulip Günter Zöchbauer (Sep 29 2016 at 14:35):

@James Agnew Thanks a lot!
I wasn't worried about the types that didn't get examples loaded, but just hoped for the confirmation that this is normal behavior.

The server runs on 8080 inside Docker (because I didn't know the -p parameter) and Docker binds to 5555 on the outside and maps requests to the internal port (8080).
I can run it with -p 5555 inside Docker and it should be fine.
A disadvantage is that the Docker images needs to be updated every time someone wants to use it with a different port (no big deal though but unexpected).

Is there a way to get all supported options from hapi-fhir-cli?

view this post on Zulip James Agnew (Sep 29 2016 at 14:52):

Yup: ./hapi-fhir-cli help run-server

(Admittedly not very intuitive syntax... we need something better imo)

view this post on Zulip Günter Zöchbauer (Sep 29 2016 at 15:14):

nice
Actually I don't think it's not intuitive, but the default help doesn't list the help command

view this post on Zulip Günter Zöchbauer (Sep 29 2016 at 15:17):

oh, it is there but not as highlighted as the other options and therefore I missed it


Last updated: Apr 12 2022 at 19:14 UTC