Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Quickstart

This page runs FerroPIX on your machine with the compose quickstart, feeds one synthetic patient as a hospital’s Patient Identity Source would, and asks for it through PIXm and PDQm. It takes a few minutes and needs Docker Compose 2.23.1 or newer (or Podman with a compose provider), curl, jq and openssl, and no checkout of the repository.

Note

Every command on this page is a step of scripts/quickstart/tour.sh, which CI runs over the repository’s compose.yaml, the file each release attaches, against the images each change builds, so the commands and the answers below are the ones the current code gives. Run the script to do every step at once; it switches the usage report off, since a tour is no installation.

Start the server

Every release attaches the quickstart as one file, compose.yaml, with the server’s configuration and the database role inlined in it. Download the latest release’s into an empty directory:

curl -fsSLO https://github.com/FerroHEALTH/FerroPIX/releases/latest/download/compose.yaml

The quickstart reads every secret from a file under ./secrets, never from the environment. Beside compose.yaml, make the five files:

mkdir -p secrets && umask 077
openssl rand -base64 32 > secrets/ferropix-data-key
openssl rand -hex 16 > secrets/postgres-password
openssl rand -hex 16 > secrets/ferropix-db-password
printf 'postgresql://ferropix:%s@postgres:5432/ferropix' \
  "$(cat secrets/ferropix-db-password)" > secrets/ferropix-db-url
openssl rand -hex 16 > secrets/console-oidc-client-secret

Then start the stack and ask for readiness:

docker compose up --wait
curl --fail-with-body -s http://localhost:8080/health/readiness

compose.yaml runs the published server image beside PostgreSQL 19 and a development OpenID Provider, with the configuration it inlines (a copy of app/ferropix-server/quickstart.toml): three identifier domains (a synthetic hospital, urn:oid:2.999.1.1, the BSN and the pseudonymised BSN), one Source client for all three, quickstart-source, and the operator API. Readiness answers {"state":"up",…} once the store, the audit spool and the outbox are up. Every port binds 127.0.0.1 (Deployment).

Warning

The development issuer signs a token for any client that asks and signs in any user name as a data steward. It is for synthetic data on your own machine. A deployment names its own https issuer (Configuration).

Get a token

A Source is a machine, so it asks the issuer for a client credentials token (RFC 6749 §4.4). This one carries the scope to feed (system/Patient.cud) and the scope to query (system/Patient.rs):

token="$(curl --fail-with-body -s http://localhost:8180/ferropix/token \
  -d grant_type=client_credentials -d client_id=quickstart-source \
  -d client_secret=any -d 'scope=system/Patient.cud system/Patient.rs' \
  | jq -er .access_token)"

Feed a patient (ITI-104)

The Source of the hospital domain adds patient H-100001, whose Patient also carries a BSN from the synthetic range no person holds. The conditional update names the identifier the record is fed under (PIXm 3.1.0 §2:3.104.4.1):

curl --fail-with-body -s -X PUT \
  'http://localhost:8080/fhir/Patient?identifier=urn:oid:2.999.1.1|H-100001' \
  -H "Authorization: Bearer $token" \
  -H 'Content-Type: application/fhir+json' \
  --data-binary @- <<'EOF' | jq -e '.issue[0].severity == "information"'
{
  "resourceType": "Patient",
  "identifier": [
    { "system": "urn:oid:2.999.1.1", "value": "H-100001" },
    { "system": "http://fhir.nl/fhir/NamingSystem/bsn", "value": "999990007" }
  ],
  "name": [{ "family": "Proefsma", "given": ["Ada"] }],
  "gender": "female",
  "birthDate": "1961-04-12"
}
EOF

The server answers 201 Created with a Location naming the new person and an OperationOutcome whose one information issue says the identifier was added. The BSN is in an authoritative domain, so a record of another hospital that carries the same BSN links to this person without a steward. Both identifiers are sealed at rest (The Dutch identifiers).

Ask for the patient’s other identifiers (ITI-83)

A PIXm Consumer that knows the hospital’s identifier asks which BSN the person holds. It posts the parameters in a Parameters body, so the identifier is in no URL:

curl --fail-with-body -s -X POST 'http://localhost:8080/fhir/Patient/$ihe-pix' \
  -H "Authorization: Bearer $token" \
  -H 'Content-Type: application/fhir+json' \
  --data-binary @- <<'EOF' | jq -e '.parameter[] | select(.name == "targetIdentifier") | .valueIdentifier'
{
  "resourceType": "Parameters",
  "parameter": [
    { "name": "sourceIdentifier", "valueString": "urn:oid:2.999.1.1|H-100001" },
    { "name": "targetSystem", "valueString": "http://fhir.nl/fhir/NamingSystem/bsn" }
  ]
}
EOF

The answer is a Parameters with one targetIdentifier per identifier in the domains asked for and a targetId naming Patient/{id} (PIXm 3.1.0 §2:3.83.4.2.2.1); the command prints the BSN:

{
  "system": "http://fhir.nl/fhir/NamingSystem/bsn",
  "value": "999990007"
}

Find the patient by demographics (ITI-78)

A PDQm Consumer that knows the family name and the birth date searches for the patient, posting the criteria as a form so they stay out of the URL (PDQm 3.2.0 §2:3.78.4.1.2):

curl --fail-with-body -s -X POST 'http://localhost:8080/fhir/Patient/_search' \
  -H "Authorization: Bearer $token" \
  -H 'Accept: application/fhir+json' \
  -d family=proefsma -d birthdate=1961-04-12 \
  | jq -e '.total == 1 and .entry[0].resource.name[0].family == "Proefsma"'

The answer is a searchset Bundle with a total of 1. proefsma finds Proefsma, because a string parameter matches the start of a name in any case. The PDQm Supplier lists every parameter, and $match (ITI-119) scores a patient you describe.

Open the console

The console profile adds the operator console on http://localhost:3000/:

docker compose --profile console up --wait

Sign in with any user name at the development issuer’s form. The dashboard counts what you fed, and Search finds the patient by its identifier or demographics (The operator console).

Stop it

docker compose --profile console down --volumes

--volumes removes the database and the server’s state with the containers.

Next