Service and IAL2 Reader
Patient matching service
Source of truth: the README of cms-hte-patient-matching-service and itsdocs/TECH_DESIGN.md. Where this page differs from the repository, the repository is correct.
A FastAPI service that wraps the patient matching library as a FHIR $match endpoint.
Endpoints
| Endpoint | Behavior |
|---|---|
POST /Patient/$match | FHIR $match. Requires a bearer JWT. The query Patient comes from a Parameters resource in the request body, or from a CMS Blue Button cms_smart identity in the auth token (verified and converted by the IAL2 reader, with no request body needed). The response is a searchset Bundle of matched candidates, each with the match outcome and matched rule ID as extensions. |
GET /health | Unauthenticated liveness and readiness probe. |
Behaviors to know before deploying
- Authentication fails closed. If
AUTH_JWK_URLSis not set, every request to/Patient/$matchreturns 401. - No candidates without a FHIR source. If
FHIR_BASE_URLis not set, the service starts but its cache is empty and every request returnsno_match. - The default public build does not include the matching engine.
POST /Patient/$matchreturns 503 unless the service is built withINSTALL_MATCHING_ENGINE=true. - IAL2 support is off by default. It requires
IAL2_ALLOWED_JWKS_URLSandIAL2_AUDIENCE. Without them, a request carrying acms_smartidentity is rejected with 400. - The testing UI has no authentication of its own. The README says never to enable
ENABLE_TESTING_UIin a production or externally reachable deployment.
API description
The service is built with FastAPI using its defaults, so a running instance serves an OpenAPI description at /openapi.json and interactive documentation at /docs unless a deployment disables or blocks them. This site does not republish that description.
IAL2 reader
The cms-hte-ial2-reader package reads a signed IAL2 token from a Credential Service Provider, verifies it, and returns a FHIR R4 Patient resource. It is published on PyPI; its source repository is not public.
The specification's requirements for IAL2 token validation (signature, issuer, audience, expiry, and replay checks) are in IAL2 Claims Tokens. Those requirements apply whichever implementation you use.