Automating record sync via TEFCA Individual Access Services — first for the mikeshealth.app prototype, then as the onboarding backbone for clients on foliohealth.app. Edit any section, record decisions, and capture answers from the HealthEx call as you get them.
Patient flow: identity proofing via CLEAR (NIST IAL2/AAL2-certified) → consent granted to a receiving organization through HealthEx "projects" (auditable, revocable any time) → queries across TEFCA QHINs (MedAllies + CommonWell confirmed; Epic patient-directed access partnership announced Sep 2025) → records flow to the consented org.
| Capability | Detail |
|---|---|
| Auth | JWT bearer; token scope = patients who consented to your org |
| Full record | GET /FHIR/R4/Person/{id}/$everything → FHIR R4 Bundle |
| Filtering | _type= any R4 resource; USCDIv3 / US Core recommended |
| Incremental sync | _since={timestamp} — only new/modified since last pull |
| Paging | _count / _offset + next/first/last links, streamed |
| Unified document | DocumentReference?type=60591-5 → full-record PDF (base64) |
| Consent signal | HTTP 403 = consent absent or revoked (our disconnect trigger) |
| Not documented | Webhooks (assume polling), rate limits, pricing |
Design consequence: HealthEx normalizes to FHIR R4 for us — no raw C-CDA parsing in v1. Folio's effort goes where it differentiates: provenance, conflict surfacing, and the AI layer.
{folio_user_id ↔ healthex_patient_id, consented_at, scope}.$everything).trigger (nightly cron + manual "Refresh records")
→ GET $everything?_since={last_sync} (paged)
→ RAW STORE bundle + unified PDF, content-hashed, immutable
→ NORMALIZE FHIR resources → folio_records (§4)
→ DEDUP within-org by id/version; cross-org by (code, date, value)
near-duplicates are LINKED, never deleted
→ CONFLICTS same concept, active, differing values → "Needs review"
→ AI ENRICH plain-language context, action-item re-rank, brief regen
→ STAGE REVIEW "new since last sync" — patient accepts into record
→ advance last_sync watermark
Layer 0 — Raw (immutable). Every bundle and PDF as received: {id, patient, source_org, retrieved_at, content_hash, payload}. Never edited; backs every "view source" drill-down.
Layer 1 — Normalized (folio_records). One row per clinical fact: {type, effective_date, source_org, source_doc → L0 ref, body, status}.
| FHIR resource | Folio section |
|---|---|
| Condition | Conditions / Meds → condition status |
| MedicationRequest / MedicationStatement | Medication list — per-source rows; dose conflicts become visible here |
| Observation (laboratory) | Results → Labs (+ trend series by LOINC) |
| Observation (vital-signs) | Health snapshot (merged with Apple Health) |
| DiagnosticReport / ImagingStudy | Results → Imaging |
| Immunization | Immunizations — "no record found" stays a first-class state |
| DocumentReference | Documents (incl. the unified PDF) |
| Encounter · Procedure · CarePlan | Timeline / care-plan inputs |
| AllergyIntolerance | Allergy chip + print packet |
Layer 2 — Derived (AI findings). Every AI output stored as its own record: {generated_at, model+version, input_record_refs[], guideline_refs[], body}. "Your findings stay yours," made structural: portable, vendor-labeled, never overwriting Layer 1. Conflict resolutions (patient-verified, provider-confirmed) live here with full history.
Where raw bundles, normalized records, and sync state live. The repo already carries Firebase config.
No webhooks documented — polling with _since is the mechanism either way.
Layer 0 is the audit substrate and enables reprocessing as the normalizer improves.
Where new clients live once foliohealth.app takes real users.
Needed the day the first real patient signs in on foliohealth.app.
Hinges on the pricing answer (Q1 below). Same integration shape across all three.
Pitch commitment: program during pilot, Type I after, Type II within a year of first client.
Phase 0 (this week): the HealthEx conversation — checklist in §7. Everything downstream depends on partner terms.
Phase 1 (~2–3 weeks after access): backend per D1 · you enroll through the real CLEAR flow (Folio's first IAL2-proofed patient — itself pitch material) · nightly _since sync + manual refresh · raw + normalized layers stored · records mapped into the UI shapes the Folio design pass already established · unified PDF into Documents.
Phase 2 (~2 weeks): dedup + conflict objects + staged "new since last sync" review · AI enrichment on new data (brief regeneration, action-item re-rank).
Phase 3: a month of real use. The prototype's job is to produce the honest list of what IAS returns messy — coverage gaps, duplicate labs, undated documents — before any client sees it.
Client-product deltas (foliohealth.app): separate deployment (D4) · real auth + MFA (D5) · consent registry + patient-visible audit log · self-service export/deletion (TEFCA duty) · SOC 2 program (D7) · DUA template ready for Cone-style partners.
This hardens the $35K IAS/data budget line — 40 patients × a decade × many orgs was the pitch's flagged unknown. Get it in writing.
Docs reference test patients; unclear what a pre-contract developer relationship looks like.
Nothing in the docs suggests webhooks; confirms D2.
Determines what your own prototype sync will actually retrieve.
For provenance display and future reprocessing; the unified PDF may be the only document form.
Shapes the Disconnected-state UX and the consent registry design.
Feeds the client-product legal stack and the Cone DUA conversation.
Sizing the nightly sync job and knowing who to call when a source stops responding.
| Risk | Mitigation |
|---|---|
| Coverage is uneven (pitch already conceded this) | Prototype measures retrieval success + source completeness on your own record first — same metrics as the Cone pilot |
| No webhooks → staleness | Nightly poll + manual refresh matches the product's mental model |
| Cross-org duplicates | Link, never delete; show both with provenance |
| Pricing surprises | Get the number before Phase 1 code; Health Gorilla / Flexpa are same-shaped fallbacks |
| Normalized FHIR hides source nuance | Store the unified PDF + push on Q5 so every number can still drill to a document |
Sources: docs.healthex.io/fhir-server · healthex.io policy playbook & TEFCA privacy notice · HIT Consultant (Aug 2025) · Healthcare IT News (HealthEx + Epic) · Fierce Healthcare (HealthEx + CLEAR) · open.epic TEFCA IAS.