# CMS Aligned Networks

Source: https://www.flexpa.com/docs/network/cms
Description: Flexpa is a CMS Aligned Networks early adopter. What Flexpa pledged to build and how it helps patients access their records.

Flexpa was selected as a [CMS Aligned Network Early Adopter](https://www.flexpa.com/kill-the-clipboard) in July 2025. As part of this initiative, we pledged to build capabilities that empower patients to retrieve their health records and share them with providers — eliminating clipboards, portal logins, and repetitive paperwork.

This page documents the two core capabilities Flexpa is delivering under the pledge, their current status, and the timeline for availability.

**Note:**
Contact [partnerships@flexpa.com](mailto:partnerships@flexpa.com) to enable CMS Aligned Network capabilities for your application.

## Capability 1: SMART Health Cards and Links

> Generate in-app SMART Health Cards and Links (QR codes for health records)

### What it is

Patients retrieve their health records through Flexpa and receive a [SMART Health Link](https://www.flexpa.com/docs/smart-health-links) — a secure, encrypted URL rendered as a QR code. At a provider's office, the patient presents the QR code. The provider scans it, decrypts the payload, and imports it directly into their EHR. No faxes, no clipboard forms, no manual data entry.

The SHL payload contains a FHIR Bundle with the patient's clinical data as discrete FHIR resources, plus a [DocumentReference](https://www.flexpa.com/docs/fhir/document-reference) containing a rendered PDF of the patient summary for display in systems that do not support FHIR. The PDF is generated automatically by the [`$summary`](https://www.flexpa.com/docs/records#patient-summary) operation and included as a base64-encoded attachment in the Bundle.

Flexpa's implementation follows the [Patient-Shared Health Document via SMART Health Links](https://hackmd.io/@Jyncr3iQS1iJA09xcuh7QA/rkGeS5cIZe) specification (draft v0.4.0), as developed by the CMS Kill the Clipboard Working Group. Note that working group alignment on this specification is still in progress.

### Status and timeline

Flexpa's [SMART Health Links API](https://www.flexpa.com/docs/smart-health-links) is **live in production** with full STU1 specification compliance. Applications can create, list, and revoke SMART Health Links today.

The API supports all three content types defined in the spec:

- `application/fhir+json` — FHIR Bundles, DocumentReferences, or any FHIR resource
- `application/smart-health-card` — Signed JWS Health Cards for tamper-proof credentials
- `application/smart-api-access` — SMART Access Token responses for follow-on API calls

To satisfy the requirements of the pledge, Flexpa added support for the [International Patient Summary (IPS)](https://hl7.org/fhir/uv/ips/) and extended the [`$summary`](https://www.flexpa.com/docs/records#patient-summary) operation to support section filtering so patients can select the data they need.

| Date | Milestone | Environment | Status |
|------|-----------|-------------|--------|
| ~~September 2025~~ | SMART Health Links API (STU1) | Live mode | Available |
| ~~February 16~~ | `$summary` operation (IPS) | Test mode (static fixture) | Available |
| ~~February 18~~ | `_section` filter support for `$summary` | Test mode (static fixture) | Available |
| ~~February 24~~ | DocumentReference PDF packaged with IPS | Test mode (static fixture) | Available |
| ~~March 3~~ | `$summary` without fixture | Test mode | Available |
| ~~March 10~~ | `$summary` from live data | Live mode | Available |

### How to use it

Create a SMART Health Link from any FHIR data retrieved through the Flexpa API. The API returns a `shlink:/` URL that can be rendered as a QR code for the patient.

A typical workflow:
1. Patient authorizes via Flexpa Consent
2. Your application retrieves FHIR data via the Flexpa API — use the [Patient $summary](https://www.flexpa.com/docs/fhir/patient#summary) operation to generate a structured IPS document. The `_section` parameter lets patients choose which categories of data to share (e.g., allergies and medications only)
3. POST the data to the [SMART Health Links API](https://www.flexpa.com/docs/smart-health-links#create-shl) to generate an encrypted link
4. Render the link as a QR code for the patient to store or share

```bash
curl -X POST https://api.flexpa.com/smart/health-links \
  -H "Authorization: Bearer sk_test_your-secret-key" \
  -H "Content-Type: application/json" \
  -d '{
    "files": [{
      "contentType": "application/fhir+json",
      "content": {
        "resourceType": "Bundle",
        "type": "collection",
        "entry": [
          {"resource": {"resourceType": "Patient", "id": "123"}},
          {"resource": {"resourceType": "Condition", "id": "456"}}
        ]
      }
    }],
    "user": {"externalId": "patient-123"},
    "label": "Medical Records"
  }'
```

```json
{
  "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "shl": "shlink:/eyJhbGciOiJFUzI1NiI...",
  "viewerUrl": "https://shc.flexpa.com/#shlink:/eyJhbGciOiJFUzI1NiI...",
  "manifestUrl": "https://api.flexpa.com/smart/health-links/manifests/...",
  "expiresAt": null
}
```

### International Patient Summary (IPS)

The [International Patient Summary](https://hl7.org/fhir/uv/ips/) (IPS) is an HL7 FHIR Implementation Guide that defines a minimal, standardized clinical document for cross-border and cross-organization patient data exchange. An IPS document is a FHIR `Bundle` of type `document` containing a `Composition` resource that organizes a patient's clinical data into sections: allergies, medications, problems, immunizations, procedures, results, and more.

Flexpa generates IPS documents locally from data retrieved through the Flexpa API using the [Patient `$summary`](https://www.flexpa.com/docs/fhir/patient#summary) operation. The generated document conforms to the IPS Composition profile, including:

- **14 standardized sections** defined by LOINC codes (allergies, medications, problems, immunizations, procedures, results, vital signs, social history, devices, plan of treatment, functional status, past illness, pregnancy history, advance directives)
- **Status-based filtering** — only clinically relevant resources are included (e.g., active medications, completed immunizations)
- **Section narratives** — each section includes a human-readable XHTML narrative for display
- **Empty section handling** — sections with no data include an `emptyReason` of `unavailable`; sections excluded by the patient include an `emptyReason` of `withheld`
- **Confidentiality tagging** — the Bundle carries a `meta.security` high water mark reflecting the most restrictive confidentiality code across included resources

#### Patient-selected sections

The `_section` query parameter on `$summary` lets patients choose which categories of data to include. This is the mechanism for patient-directed consent: the application presents section choices to the patient, then passes their selections to the API.

When `_section` is provided, excluded sections still appear in the Composition (preserving the IPS structure) but contain no entries and are marked with `emptyReason` of `withheld`. Only resources referenced by included sections are present in the Bundle.

A typical IPS-to-SHL workflow:

1. Patient authorizes via Flexpa Consent
2. Your application presents section choices (allergies, medications, problems, etc.)
3. Call [`$summary`](https://www.flexpa.com/docs/records#patient-summary) with the patient's selected `_section` values
4. POST the IPS document Bundle to the [SMART Health Links API](https://www.flexpa.com/docs/smart-health-links#create-shl)
5. Render the resulting `shlink:/` URL as a QR code for the patient

The receiving provider scans the QR code and receives the IPS document — a structured, standardized summary of exactly the data the patient chose to share.

*1. Generate IPS*

```bash
ACCESS_TOKEN=patient-access-token

# Patient selected: allergies, medications, problems
curl 'https://api.flexpa.com/fhir/Patient/$PATIENT_ID/$summary?_section=allergies&_section=medications&_section=problems' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

*2. Create SHL*

```bash
# Pass the IPS document Bundle directly to the SHL API
curl -X POST https://api.flexpa.com/smart/health-links \
  -H "Authorization: Bearer sk_test_your-secret-key" \
  -H "Content-Type: application/json" \
  -d '{
    "files": [{
      "contentType": "application/fhir+json",
      "content": { "... IPS Bundle from step 1 ..." }
    }],
    "user": {"externalId": "patient-123"},
    "label": "Patient Summary"
  }'
```

#### Test mode

In test mode, `$summary` currently returns an IPS document built from a **static fixture** rather than the patient's actual `$everything` data.
The fixture is a [Synthea](https://github.com/synthetichealth/synthea)-generated bundle and does not correspond to the data returned by other FHIR queries for the same patient authorization.
A future release (see [timeline above](#status-and-timeline)) will build the IPS from live test mode data, matching the behavior of live mode.

You can view the test mode `$summary` output here: [test-mode-summary.json](https://www.flexpa.com/docs/resources/examples/patient-summary/test-mode-summary.json).

### Returning visit records

**Note:**
Working group consensus on this process has not yet been achieved. The specification and workflow described below may change.

As part of the Kill the Clipboard pledge, we are also developing support for **returning post-visit summaries to patients** as SMART Health Links. After an appointment, providers generate an SHL containing the visit summary (sourced from a C-CDA document) that the patient can open in any SHL-aware app. See our [technical proposal](https://www.flexpa.com/blog/smart-health-links-returning-visit-records) for implementation details.

## Capability 2: IAL2 digital identity for record access

> Demonstrate IAL2 OIDC token use (no portal logins)

### What it is

Instead of requiring patients to remember login credentials for every hospital and insurer portal, Flexpa uses [Identity Assurance Level 2 (IAL2)](https://pages.nist.gov/800-63-3/sp800-63a.html#sec4) digital identity verification. A patient verifies their identity once through CLEAR, ID.me, or Persona, and Flexpa discovers and retrieves their records from across the [TEFCA network](https://www.flexpa.com/docs/network#nationwide-exchanges) — 88,000+ facilities nationwide — without any additional logins.

This is the CMS vision: *"If a patient uses a digital identity credential (through a CMS-approved IAL2 provider), all nodes must return full records without requiring knowledge of specific providers, portal accounts, or additional interactions."*

### How it works

1. Patient initiates a connection through Flexpa Consent with TEFCA enabled
2. Patient verifies their identity via CLEAR, ID.me, or Persona (one-time process, typically under a minute for existing users)
3. Flexpa queries the TEFCA network using verified demographics to discover patient records across participating facilities
4. Clinical documents are retrieved from matching facilities. Eligible C-CDA documents are [transformed into structured FHIR resources](#c-cda-to-fhir-transforms) when possible and returned alongside the source [DocumentReference](https://www.flexpa.com/docs/fhir/document-reference)

For returning users with existing CLEAR, ID.me, or Persona credentials, the entire flow takes under a minute. First-time identity verification takes 3-7 minutes.

### Status and timeline

| Date | Milestone | Environment | Status |
|------|-----------|-------------|--------|
| ~~February 17~~ | TEFCA IAS with C-CDA documents | Test mode | Available |
| ~~March 3~~ | TEFCA IAS with C-CDA documents | Live mode | Available |
| ~~March 3~~ | C-CDA to FHIR resource transforms | Test mode | Available |
| ~~March 10~~ | C-CDA to FHIR resource transforms | Live mode | Available |

**C-CDA documents** are returned as [FHIR DocumentReference](https://www.flexpa.com/docs/fhir/document-reference) resources containing the full clinical document (Continuity of Care Documents, discharge summaries, clinical notes). **C-CDA to FHIR transforms** convert these documents into structured FHIR resources (Condition, MedicationRequest, Observation, etc.) for easier programmatic use.

### C-CDA to FHIR transforms

Facilities connected via TEFCA typically return clinical data as C-CDA (Consolidated Clinical Document Architecture) documents: XML-based clinical documents such as Continuity of Care Documents (CCDs) and discharge summaries.
While these documents contain rich clinical data, they require parsing and transformation to be useful in FHIR-based workflows.

Flexpa automatically transforms C-CDA documents into structured FHIR resources. When a C-CDA document is retrieved from a facility, Flexpa extracts the clinical data and creates discrete FHIR resources (Condition, MedicationRequest, Observation, Procedure, AllergyIntolerance, Immunization, and more) that can be queried individually through the Flexpa API.

Some responders return FHIR rather than C-CDA. When a document's attachment is a FHIR Bundle, there is nothing to convert: Flexpa inlines the Bundle's entries as individual resources, assigns them stable Flexpa ids, and tags the document `fhir-inlined`.

#### DocumentReference tagging

Each [DocumentReference](https://www.flexpa.com/docs/fhir/document-reference) resource includes a tag indicating its transformation status. Use this tag to determine whether structured FHIR resources have been extracted from the document.

| Tag code | Meaning |
|----------|---------|
| `transformed` | Successfully converted to FHIR resources |
| fhir-inlined | Already a FHIR Bundle, so its resources were inlined as-is with no conversion |
| `not-ccda` | Not a C-CDA document (PDF, HTML, or plain text) — no transformation attempted |
| not-transformed | C-CDA document but conversion was unsuccessful — the document may be malformed, missing required elements, or empty |

The tag uses the system `https://fhir.flexpa.com/identifiers/CcdaToFhir`:

```json
{
  "meta": {
    "tag": [{
      "system": "https://fhir.flexpa.com/identifiers/CcdaToFhir",
      "code": "transformed",
      "display": "C-CDA 2.1 transformed to FHIR resources"
    }]
  }
}
```

#### Provenance tracking

For each successfully transformed document, Flexpa creates a [Provenance](https://www.flexpa.com/docs/fhir/provenance) resource that links the derived FHIR resources back to the source DocumentReference. This allows your application to trace any resource to the document it was extracted from.

```json
{
  "resourceType": "Provenance",
  "target": [
    { "reference": "Condition/uuid-1" },
    { "reference": "MedicationRequest/uuid-2" },
    { "reference": "Observation/uuid-3" }
  ],
  "recorded": "2026-03-03T14:30:00Z",
  "activity": {
    "coding": [{
      "system": "http://hl7.org/fhir/w3c-provenance-activity-type",
      "code": "Derivation",
      "display": "wasDerivedFrom"
    }]
  },
  "agent": [{
    "type": {
      "coding": [{
        "system": "http://terminology.hl7.org/CodeSystem/provenance-participant-type",
        "code": "assembler"
      }]
    },
    "who": {
      "display": "Flexpa CCDA-to-FHIR"
    }
  }],
  "entity": [{
    "role": "source",
    "what": { "reference": "DocumentReference/the-source-doc-id" }
  }]
}
```

Query Provenance resources via `$everything` or search directly to find all resources derived from a specific document:

```bash
curl 'https://api.flexpa.com/fhir/Provenance?entity=DocumentReference/<doc-id>' \
  -H "Authorization: Bearer <access_token>"
```

### How to use it

Enable TEFCA by passing `flow: { type: 'ial2' }` to `buildAuthorizationUrl` (or `flexpa_ial2_mode=true` directly on the authorization endpoint). The patient experience and developer integration follow the same patterns as other Flexpa data sources — FHIR resources are returned via the standard Flexpa API.

#### Configuring identity providers

By default, patients can verify their identity using CLEAR, ID.me, or Persona. You can restrict which identity providers are available to patients on the [Application UI/UX](https://portal.flexpa.com/application-ui-ux) page in the portal, under **Identity providers**. Flexpa Consent dynamically adjusts the identity verification screen to show only the allowed identity providers.

```typescript
import { FlexpaClient } from '@flexpa/node-sdk';

const authUrl = FlexpaClient.buildAuthorizationUrl({
  publishableKey: 'pk_test_...',
  redirectUri: 'https://example.com/callback',
  codeChallenge,
  externalId: 'user-123',
  scope: ['launch/patient', 'offline_access'],
  state: 'random-state',
  flow: { type: 'ial2' },
});
```

#### Test credentials

Use the [IAL2 test credentials](https://www.flexpa.com/docs/test-mode#nationwide-exchange) for ID.me or CLEAR to complete identity verification in test mode. Both are IAL2-compliant identity providers.

#### End-to-end flow

Here is what happens when a patient completes a TEFCA consent:

1. **Authorization** — Your application redirects the patient to the Flexpa authorization URL with `flow: { type: 'ial2' }` (which sets `flexpa_ial2_mode=true`).
2. **Consent** — The patient completes the Flexpa Consent flow: IAL2 identity verification, patient discovery (XCPD), document retrieval (XCA), and facility sign-in if applicable. In test mode, Flexpa also injects [fixture documents](https://www.flexpa.com/docs/test-mode#test-documents) to ensure consistent test data.
3. **Callback** — Flexpa redirects to your `redirect_uri` with an authorization `code`.
4. **Token exchange** — Your server exchanges the code for an access token via `POST /oauth/token` (standard [OAuth PKCE flow](https://www.flexpa.com/docs/consent#token-endpoint)).
5. **FHIR queries** — Use the access token to query FHIR resources.

#### Querying FHIR resources

Once the consent is complete and you have an access token, use it to query the Flexpa API.

Flexpa does not block the token exchange while data syncs.
Your application receives the access token immediately, and data becomes available as the sync progresses in the background.
Until the sync completes, FHIR queries return `429` responses.
There are two ways to handle this:

- **Polling** — Retry FHIR requests until you receive a `200`. The [Node SDK](https://www.flexpa.com/docs/records/node-sdk) handles this automatically.
- **Webhooks** — Subscribe to sync completion events via [webhooks](https://www.flexpa.com/docs/records/webhooks) and query FHIR resources only after you receive a notification.

A single consent can include multiple patient authorizations. Some facilities discovered through TEFCA respond via direct FHIR API access instead of XCA (e.g., Epic Nexus participants), which creates an additional patient authorization requiring sign-in. Each authorization has its own [Patient](https://www.flexpa.com/docs/fhir/patient) resource, so start by searching for all patients associated with the consent:

```bash
curl https://api.flexpa.com/fhir/Patient \
  -H "Authorization: Bearer <access_token>"
```

Then, for each patient, use `$everything` to retrieve all resources associated with that patient:

```bash
curl https://api.flexpa.com/fhir/Patient/<patient-id>/\$everything \
  -H "Authorization: Bearer <access_token>"
```

The resource types returned by `$everything` depend on how the facility was connected. Facilities connected via XCA document exchange return C-CDA clinical documents as [DocumentReference](https://www.flexpa.com/docs/fhir/document-reference) resources. Facilities connected via direct FHIR API access return structured FHIR resources directly. Eligible C-CDA documents are automatically [converted into structured FHIR resources](#c-cda-to-fhir-transforms). Check the DocumentReference [tag](#documentreference-tagging) to determine the transformation status of each document.

## Capability 3: Consent 2.1 (search flow)

> Patient-directed search flow for discovering and selecting healthcare providers

### What it is

Consent 2.1 introduces an improved search experience within Flexpa Consent that enables patients to discover and select their healthcare providers more intuitively. Instead of navigating complex provider directories, patients can search by provider name, facility, or health plan and select from matched results.

This capability builds on the TEFCA foundation to streamline the patient experience when connecting their health records.

### Status and timeline

| Date | Milestone | Environment | Status |
|------|-----------|-------------|--------|
| ~~April 14~~ | Preview (live walkthrough for feedback) | — | Complete |
| ~~April 28~~ | Search flow available | Test mode | Available |
| ~~May 5~~ | General availability | Live mode | Available |

## Related

- [Patient $summary](https://www.flexpa.com/docs/fhir/patient#summary) — API reference for generating IPS documents with section filtering
- [SMART Health Links API](https://www.flexpa.com/docs/smart-health-links) — Full API reference for creating and managing SHLs
- [International Patient Summary (IPS)](https://hl7.org/fhir/uv/ips/) — HL7 FHIR Implementation Guide
- [Network overview](https://www.flexpa.com/docs/network) — Flexpa's three network types including TEFCA
- [Kill the Clipboard pledge](https://www.flexpa.com/kill-the-clipboard) — Flexpa's full CMS Aligned Networks pledge
