Skip to main content

Overview

get_health_records is a read-only view over the patient’s connected insurance and health records, sourced from their insurer via Flexpa (flattened SQL-on-FHIR views). It never connects, refreshes, or mutates anything. Connecting is a separate pair of tools, because the Flexpa Link flow runs in the user’s browser: Records are optional — care works without them, so never block a consultation on connecting.
get_user_profile already carries a healthRecords block — connection + sync state and per-category record counts (no record contents) — so you can tell whether records exist, and whether reading them is worthwhile, without calling get_health_records.
Connected insurance also powers the care pricing tools — plan matching for search_care_prices and check_network_status resolves from the linked coverage automatically.

get_health_records

Parameters

Start with the summary

Call with no arguments first. section: "summary" returns the connection status, the insurance coverage header, basic demographics, and a count of records in each category — a cheap overview so you know what’s worth pulling before drilling in.

Sections

Labs and vitals are split deliberately: in FHIR both are Observation resources, and a patient can have thousands of vital-sign readings. The split keeps recent labs from being buried behind vitals.

Paging

Each underlying view returns at most 100 rows per call, sorted newest-first so the cap keeps the most recent records. When a view is truncated, the response includes truncated: true, showing, and nextOffset — pass nextOffset back as offset to get the next page.

Returns (summary example)

When no insurance is connected the response is { "connected": false, "message": ..., "howToConnect": ..., "nextStep": "start_flexpa_link" }. Each section returns one or more view blocks keyed by view name (for example coverage, problems, medication_request, allergies, immunizations, encounters, claims_header; labResults for labs and vitalSigns for vitals), all sharing the capped-view shape { count, truncated?, showing?, offset?, nextOffset?, rows[] }. count is the true total even when rows were capped.

Example flow


Start a records connection so triage and providers see the patient’s real coverage, conditions, medications, allergies, and labs instead of asking for them. Returns an authorizationUrl for the user to open in their browser.

When to call

  • get_health_records reports connected: false and the user wants to connect
  • The user asks to add, change, or reconnect their insurance or health records
This is the records-only path and works for already-onboarded users. start_onboarding covers accounts that haven’t finished setup; while that widget is open, let it drive the connection instead.

Parameters

Returns

Relay notice to the user in plain words before they open the link. It is the notice at collection for their records: what connecting imports, that it is only used to give their clinicians context, and where the Privacy Policy is. Don’t skip it.
The user can also connect from the Arlo patient portal. Hand over authorizationUrl when you want them to stay in the conversation.

complete_flexpa_import

Poll for the outcome of a connection started with start_flexpa_link. Call it every 10–15 seconds, or when the user says they’re done, until it returns something other than pending.

Parameters

Returns