Secondary Use FHIR Server Implementation Guide
0.1.0 - ci-build

Publish Box goes here

Getting Started

Getting Started

Run The Local Services

Start both services with the default ports:

GRADLE_USER_HOME=$PWD/.gradle ./gradlew run --args="--mock-port=8090 --adapter-port=8080 --dataset=hospital --data-dir=data/generated --salt=local-demo-salt"

The process starts:

  • mock FHIR server: http://127.0.0.1:8090/fhir
  • Bulk privacy adapter: http://127.0.0.1:8080/fhir

Health checks:

curl http://127.0.0.1:8090/health
curl http://127.0.0.1:8080/health

Discover Capabilities

curl http://127.0.0.1:8090/fhir/metadata
curl http://127.0.0.1:8080/fhir/metadata

Both endpoints return a FHIR R4 CapabilityStatement.

The mock server capability describes a synthetic FHIR source. The adapter capability describes the Bulk-shaped export surface.

Inspect Source Data

Search the mock server directly:

curl http://127.0.0.1:8090/fhir/Patient
curl 'http://127.0.0.1:8090/fhir/Condition?code=34000006&_summary=count'
curl 'http://127.0.0.1:8090/fhir/MedicationStatement?code=386872004&_summary=count'

The mock search endpoint returns a FHIR searchset Bundle. With _summary=count, total is populated and entries are omitted.

Start A Pseudonymized Export

curl -i 'http://127.0.0.1:8080/fhir/$export?mode=pseudonymized'

The response is 202 Accepted with Content-Location and Location headers pointing to the job status URL.

Poll the status URL:

curl http://127.0.0.1:8080/fhir/bulk-status/<job-id>

Download an NDJSON file from one of the output[].url values:

curl http://127.0.0.1:8080/fhir/bulk-files/<job-id>/Patient.ndjson

Export A Filtered Cohort

Crohn disease cohort, minimized output, selected types:

curl -i 'http://127.0.0.1:8080/fhir/$export?mode=minimized&condition-code=34000006&_type=Patient,Condition,Observation'

Infliximab cohort:

curl -i 'http://127.0.0.1:8080/fhir/$export?mode=pseudonymized&medication-code=386872004'

Count preview without writing a Bulk job:

curl 'http://127.0.0.1:8080/fhir/$export?_summary=count&condition-code=34000006&_type=Patient,Condition'

Run The Smoke Checks

After starting both services:

scripts/smoke.sh

Override ports if needed:

MOCK_BASE=http://127.0.0.1:8190 ADAPTER_BASE=http://127.0.0.1:8180 scripts/smoke.sh