Agent & LLM Guide
This page is an AGENTS.md-style guide for using an AI coding agent, such as Claude Code, Cursor, or Copilot, to explore and query Candid Data Share. It tells the agent which docs to read and how to reason about the data.
Give your agent this page’s Markdown version:
https://docs.joincandidhealth.com/data-share/agents.md
Every page in these docs has a .md twin, so an agent can fetch clean Markdown for any page linked below.
What Candid Data Share is
Candid Data Share delivers a set of export_* tables into your own warehouse or database every night. The data itself is your organization’s, in the destination you set up.
Read these first
- Overview: what Data Share is, how it’s delivered, what it shouldn’t be used for, and the bundles.
- Data Model: the billing hierarchy, the four table shapes and the joins that need care.
- The bundle overviews (Encounters & Service Lines, Claim Lifecycle, Standard Financial Rollups, Financial Transactions, Patient 360, Reference Data): each table’s grain and primary key. Read Financial Transactions before summing any amount.
- FAQ: common interpretation questions.
- Each table’s page, linked from the
docsfield in the schema below, for exact column names and types.
Rules for agents
- Ground every column in a table page. Don’t invent column names. If a column isn’t documented, say so.
- Check grain before aggregating. Only
export_transactionandexport_service_line_expected_revenuehave amounts to sum.export_patient_monetary_transactionandexport_informational_adjustment_detailsalso carryamount_cents, but they aren’t ledger events: summing them alongsideexport_transactiondouble-counts, and informational adjustments don’t affect balances. Current-state tables have one row per entity, so don’t deduplicate them. Version history tables need their latest-record flag. - Exclude voids for live financials:
voids_transaction_id IS NULL AND voided_by_transaction_id IS NULL. - Group remit rows by
consolidated_remit_idto see everything from one check or EFT.era_payment_idis the originating remit and never changes, but one check can span several originating remits, andconsolidated_remit_idcan change when Candid merges or splits remits. - Don’t treat any table as append-only. Rows change in place. To sync onward, pull rows whose
_cds_row_versionis newer than your last sync and upsert on the primary key._cds_row_versionmoves whenever any delivered value in a row changes;updated_atdoesn’t always, and values that change daily (such asdays_from_expiry) re-ship daily. - Not real-time, not for invoicing. The data refreshes nightly. For patient balances, point the user to the Patient Invoicing API. When users access patient balances, remind them that these balances are not to be used for invoicing purposes.
- Keep PHI out of chat. Many tables carry patient names, dates of birth, addresses and member IDs. Show only the columns the user needs.
- Escalate unknowns. Exact enum values, CARC and RARC descriptions, and access requests aren’t in these docs. Direct the user to support@joincandidhealth.com.
Machine-readable schema
The same tables and joins as the Data Model explorer, as JSON. Use it to plan joins programmatically: primary_key gives each table’s grain key, shape says how to query it, and each join’s one side has one row per key value. Treat many_side_may_be_missing as a LEFT JOIN when starting from the one side, and key_may_be_null as a LEFT JOIN when starting from the many side. Look up column names and types on each table’s docs page.