Identify the ATR Group resource ID for the attributed patient population; confirm member count and validity period via GET /Group/{id}
Authenticate with a system-level SMART Backend Services token scoped for the Group and required resource types
GET /Group/{id}/$export?_type=Patient,Condition,Observation,MedicationRequest,Procedure&_since={last-export-date} with Prefer: respond-async; capture the 202 Content-Location URL
Poll Content-Location with exponential backoff; when 200 received, parse the output manifest to identify NDJSON file URLs per resource type
Download each NDJSON file, parse line-by-line, and load into an analytics datastore; link resources to patients via subject or patient reference elements
Reconcile the exported patient count against the ATR Group.quantity field to detect if any attributed members were excluded from the export due to access control or data availability issues
Known gotchas
Group-level $export only exports data for patients who are active members of the Group at export time; patients who were removed from the ATR list before the export kicks off will not be included even if they were attributed during the reporting period
The _type parameter in a group-level $export must list resource types that are patient-compartment resources; requesting resource types outside the patient compartment (e.g., Organization) may be ignored or cause a 400 error
Large attributed populations (tens of thousands of members) will produce extremely large NDJSON files; implement streaming download and line-by-line processing rather than loading entire files into memory
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp