Data out

The ways data leaves Medblocks: SDK and API reads, exports, and webhook events.

After records land in Medblocks, you can send them to a destination, react to events, or inspect operational state through the API. The right path depends on whether another system needs the records, your backend needs to know that something changed, or your team needs to check integration state.

Exports

Exports are the shipped path for moving records into downstream systems. You configure a destination in the dashboard, Medblocks tests it, and export jobs deliver records after pulls settle.

Destination types include the following.

DestinationUse it when
FHIR serverAnother system should receive FHIR R4 resources.
Object storageA warehouse, lakehouse, or ingestion job reads NDJSON files from S3-compatible storage, GCS, or Azure Blob.

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

The export destinations list in the dashboard

Background Pull Comes First

A patient session can finish before every record is available. After a connection becomes active, Medblocks schedules retrieval jobs for the resources supported by that source. Those jobs can take time because real portals paginate slowly, return large histories, vary by resource support, and enforce different rate limits.

When the pull settles, enabled destinations can export the data. Treat the patient-facing return as “access was granted” and use Pull monitoring for record availability.

Export destinations and runs

An export destination stores where records should go and how Medblocks should authenticate to that destination.

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 time Medblocks exports records, it creates an export run. A run records what destination was used, why it started, how many patients and resources were processed, when it started and finished, and any errors that happened.

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.

Events

Events tell your backend that something happened. Webhooks are useful when you do not want to poll:

  • A patient session completed.
  • A background pull finished.
  • A background pull failed.
  • A connection lost access and needs the patient to reconnect.

Use Webhooks to register a receiver and verify signatures.

API And SDK Reads

The public API and TypeScript SDK already handle operational reads such as patients, patient sessions, connections, webhooks, errors, and pagination.

Direct patient FHIR reads are planned as a later API/SDK phase. The intended shape is FHIR-native: GET /patients/{id}/$everything returning the latest resources as a FHIR Bundle. Until that ships, use exports for record delivery.

Choosing A Path

NeedUse
Keep another system currentExports
Trigger work when records arriveWebhooks
Inspect integration stateAPI or SDK
Pull a patient bundle on demandDirect FHIR reads, once shipped

See also