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_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 includestruncated: true, showing, and nextOffset — pass nextOffset back as offset to get the next page.
Returns (summary example)
{ "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_flexpa_link
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 anauthorizationUrl for the user to open in their browser.
When to call
get_health_recordsreportsconnected: falseand the user wants to connect- The user asks to add, change, or reconnect their insurance or health records
start_onboarding covers accounts that haven’t finished setup; while that widget is open, let it drive the connection instead.
Parameters
Returns
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 withstart_flexpa_link. Call it every 10–15 seconds, or when the user says they’re done, until it returns something other than pending.