Secondary Use FHIR Server Implementation Guide
0.1.0 - ci-build
Publish Box goes here
The runtime implements a compact Bulk Data-style flow:
GET /fhir/$export202 AcceptedContent-Location: {base}/bulk-status/{jobId}GET /fhir/bulk-status/{jobId}output[].url NDJSON filesDELETE /fhir/bulk-status/{jobId} after the caller no longer needs the jobThe status response is not a FHIR resource. It follows the Bulk Data status body shape:
{
"transactionTime": "2026-06-10T12:00:00Z",
"request": "http://127.0.0.1:8080/fhir/$export",
"requiresAccessToken": false,
"output": [
{
"type": "Patient",
"count": 53,
"url": "http://127.0.0.1:8080/fhir/bulk-files/abc/Patient.ndjson",
"storageLocation": "bulk://abc/Patient.ndjson"
}
],
"error": []
}
Each NDJSON file contains one FHIR JSON resource per line.
The export accepts _outputFormat=application/fhir+ndjson or _outputFormat=ndjson. Unsupported values return a FHIR OperationOutcome with HTTP 400.
The mock server exports the generated source dataset as-is:
curl -i http://127.0.0.1:8090/fhir/'$export'
This is useful when the caller wants to inspect the full synthetic source record set, including direct patient identifiers and source references.
The adapter export resolves a cohort, fetches resources from the mock server, applies privacy transforms, and then writes Bulk output:
curl -i 'http://127.0.0.1:8080/fhir/$export?mode=minimized&condition-code=34000006'
Supported adapter parameters:
| Parameter | Meaning |
|---|---|
mode |
pseudonymized or minimized, default pseudonymized |
_type |
comma-separated output resource types |
_outputFormat |
optional application/fhir+ndjson or ndjson |
notification-url |
optional callback URL that receives a completion notification |
condition-code |
condition code cohort filter |
medication-code |
medication cohort filter over MedicationStatement and MedicationRequest |
procedure-code |
procedure code cohort filter |
observation-code |
observation code cohort filter |
gender |
Patient.gender filter |
birthdate, birthdate-ge, birthdate-le |
Patient.birthDate exact/range filters |
date, date-ge, date-le |
clinical date exact/range filters |
The adapter also accepts camelCase aliases for code filters: conditionCode, medicationCode, procedureCode, and observationCode.
When notification-url is present, the adapter posts a compact JSON notification after the export is ready:
{
"jobId": "abc",
"status": "completed",
"statusUrl": "http://127.0.0.1:8080/fhir/bulk-status/abc",
"output": [
{
"type": "Patient",
"count": 53,
"downloadUrl": "http://127.0.0.1:8080/fhir/bulk-files/abc/Patient.ndjson",
"storageLocation": "bulk://abc/Patient.ndjson"
}
]
}
This is the prototype contract for "data is available at location X". Failed callback delivery is currently best-effort and does not fail the export.
When _type is omitted, the adapter exports:
PatientConditionAllergyIntoleranceMedicationRequestMedicationStatementObservationProcedureProvenanceEncounter is supported by the privacy transformer and date search helper, but it is not part of the current default generated fixture/export set.
_summary=count on the adapter export returns a FHIR Parameters resource instead of starting a job:
curl 'http://127.0.0.1:8080/fhir/$export?_summary=count&condition-code=34000006&_type=Patient,Condition'
The response contains:
cohort-patients: number of patients after cohort resolutionresource-count parts with type and countThis count response is a local prototype extension. It is not a standard Bulk Data response.