Export

How patient data leaves Medblocks: Background Pull, FHIR Server export, S3 object storage, retries, and monitoring.

Export is the delivery layer after data has entered Medblocks. Connect brings data in, background pull keeps it current, and Export sends the data to the systems where your team works.

There are two main destination types today:

  • FHIR Server: Medblocks writes FHIR R4 resources to a destination FHIR base URL.
  • Object storage: Medblocks writes NDJSON or zipped NDJSON to S3-compatible storage, GCS, or Azure Blob.

Export setup is managed from the dashboard today. It is not part of the public REST API.

Export destinations

Background Pull Comes First

When a patient completes a Connect Session, Medblocks creates an active connection and schedules FHIR retrieval jobs. Those jobs pull supported resources from the source using the stored token.

The pull runs in the background because real portals can return thousands of resources, slow paginated responses, or partial resource support. Your app should treat Session completion as access granted. The records continue landing after that.

Once a pull settles, Medblocks can trigger exports for enabled destinations in that organization.

Export Model

An export destination stores:

FieldPurpose
Destination nameHuman-readable label in the dashboard.
Destination typeFHIR Server or object storage.
CredentialsStored server-side and used only by export jobs.
Enabled stateDisabled destinations are skipped.
Last exported timeWatermark for delta exports.

Each export execution creates an export run. Runs track destination, status, trigger, patient counts, resource counts, start time, completion time, and error details.

Triggers

Exports can start from these events:

TriggerBehavior
Destination addedRuns a first backfill for that destination.
Pull completedSends new or changed data after patient data has landed.
Destination reactivatedCatches up from the previous watermark.
Manual retryReprocesses failed items from a failed or partial run.

Each destination runs independently. One destination can fail without blocking another.

FHIR Server Export

FHIR Server export is for teams that want Medblocks to push records into an R4 server they operate or use downstream.

The destination needs:

  • FHIR base URL.
  • Auth type: no auth, bearer token, or OAuth 2.0 client credentials.
  • Token endpoint, client ID, client secret, and optional scope when OAuth 2.0 is used.

Medblocks tests the destination before saving it. After save, it creates a backfill run. Later pulls send fresh data as deltas.

See the dashboard walkthrough: Export To FHIR Server.

Add FHIR Server export

Object Storage Export

Object storage export is for teams that want files in a bucket for ingestion into a warehouse or lakehouse.

The destination needs:

  • Cloud vendor.
  • Endpoint and region.
  • Bucket name.
  • Access key and secret.
  • File type: NDJSON or zipped NDJSON.

The export writes patient data as files and records each file as an export item. S3-compatible storage is supported through the same destination form.

See the dashboard walkthrough: Export To S3.

Add S3 export

Monitoring And Retries

The dashboard shows configured destinations, active progress, last successful run, failed runs, and retry actions.

Use the destination detail page when you need to answer:

  • Did the latest pull export?
  • Which destination failed?
  • How many patients or resources were delivered?
  • What error did the destination return?
  • Is a retry available?

If a run is partial, retry only the failed work. If a destination is disabled, Medblocks keeps its watermark so reactivation can catch up.

Export history