Overview
Fasten Connect orchestrates a two-stage flow that begins when a patient authorizes access with Fasten Stitch and concludes when your systems retrieve their clinical data. Aligning your product and engineering teams around these stages keeps the experience compliant, transparent, and technically reliable.- Patient Consent — Patient-facing flows built with Fasten Stitch capture identity, grant authorization, and return the identifiers your backend needs to act on the consent.
- Data Collection — Server-side jobs use the identifiers to request exports, monitor webhooks, and deliver the records to downstream systems while respecting retention policies.
Stage 1: Patient Consent
Your Role
- Introduce Fasten Stitch in your application where patients expect to manage their health data.
- Explain the benefits of sharing EHI and how their data will be used.
- Introduce Fasten as a trusted intermediary that simplifies access to multiple health systems.
- Confirm that the patient authenticated successfully with their health system.
- Persist the
org_connection_idand related metadata emitted by Webhook or Stitch events for later API calls.
Implementation steps
- Embed Stitch — Add the
fasten-stitch-elementto your application, supplying a public key that matches the deployment environment. - Listen for events — Parse the
widget.completeevent from the Stitch event bus and hand off the event payload to your backend over a secure channel.- (Optional) Register a webhook endpoint so you can receive
patient.connection_successevent notifications as a backup or for auditing.
- (Optional) Register a webhook endpoint so you can receive
- Store consent artifacts — Persist the
org_connection_id,brand_id, and other metadata alongside your patient record to build an auditable consent log.
Keep a short-lived cache of the most recent Stitch events to support patient support inquiries and replay protection.
Success indicators
- Stitch reports
connection_status: authorizedfor the selected health system. - Your backend acknowledges receipt of the
org_connection_idand ties it to the patient in your system of record. - Consent timestamps and environment (test vs live) are recorded for audits.
Stage 2: Data Collection
Once consent is recorded, shift to backend workflows that gather the authorized data and deliver it to the right destination.Kick off exports
- Use the
/bridge/fhir/ehi-exportendpoint with the storedorg_connection_id. - This API call must be made from a secure backend environment using your private key.
- Asynchronously handle the response, capturing the
task_idfor tracking.
Monitor completion
- You will be automatically subscribed to
patient.ehi_export_successand related events at your registered webhook URL. - Validate the
task_idin incoming events against the job you launched and record progress updates for support visibility. - Tasks will automatically time out after a reasonable period (Fasten will send a
patient.ehi_export_failed; implement retry logic for transient failures or delays.
Retrieve records
- Retrieve the download link(s) from the webhook payload and stream the file(s) to your storage tier before the URLs expire
- Links are valid for 24 hours from the time of the webhook event.
- Import, convert or fan out the FHIR JSONL export into downstream formats (clinical data repository, data warehouse, analytics pipelines, or patient-facing portals).
- Ensure your systems can handle large files and variable resource counts. (eg. 30MB with 500 resources vs 3GB with 5,000 resources + Binary data).
- Use a Clinical Data Repository (CDR) that natively supports FHIR to simplify ingestion and querying.
- Open Source - Medplum, HAPI)
- Azure Health Data Services
- AWS HealthLake
- GCP Healthcare API
- Apply retention policies: exports expire in Fasten storage after 24 hours, so plan long-term retention in your own infrastructure.
Putting it together
- Orchestrate both stages with a job tracker that links consent events, export requests, webhook updates, and downloads.
- Inform patients with status updates or notifications when collection finishes, reinforcing trust in the consent they granted.
- Iterate by reviewing failure logs from both stages to tune patient messaging, retry logic, and webhook reliability testing.

