A FHIR CapabilityStatement is where an EHR publishes its API capabilities: the mode, the resources, the interactions and the search parameters it claims. Clients fail in production when they are written against a vendor brochure instead of that document. Reading it first does not prove the site, but it stops you coding a call the server never advertised.
Digital health founders and hospital CTOs commissioning an EHR client will find how to fetch and read the statement, which fields decide each call, what to test at the customer site, and how to catch a silent upgrade.
How do you read a FHIR CapabilityStatement to check EHR API capabilities?
Read a FHIR CapabilityStatement by fetching [base]/metadata from the site you will call, then checking rest.mode, each resource's interactions, its search parameters and its operations. The statement is the EHR's own claim about its API capabilities. Agnotic Technologies reads it before writing a client, then tests every call on the live site.
Writing the client after the statement?
Our FHIR integration work turns a confirmed CapabilityStatement into a client, tests and a job record.
The R4 CapabilityStatement resource is the contract you can fetch, store and diff. Treat an instance statement for the base URL you will call as the one that matters. A requirements statement or a vendor marketing page is context. The instance statement is the claim about this deployment.
ONC criterion 170.315(g)(10) requires certified health IT to offer a standardized FHIR API for patient and population services. Certification tells you an API exists. The CapabilityStatement tells you what this site advertises. US Core may be named as a guide the server claims. The resource interactions in the statement are still the list your client is allowed to assume.
Where do you fetch the statement?
Fetch it with the capabilities interaction: HTTP GET [base]/metadata. Store the body with the base URL and the time. The client under construction is reviewed against that copy, not against a memory of a sandbox from last quarter.
The FHIR R4 REST API defines that GET as the way a client retrieves what the server supports. Call the same URL the production token will use. A metadata document from a public sandbox can differ from the customer's site in resources, search parameters and operations.
- Save the raw CapabilityStatement. Diffs later need the bytes.
- Record fhirVersion and the formats the statement lists.
- Record kind. Prefer an instance statement for the deployed server.
- Note the implementation URL so you can see which host you actually asked.
- Hash the document and put the hash on every client release that claims to support the site.
What do rest.mode and resource interactions tell you?
Read rest entries whose mode is server. For each resource, read the interaction codes. Those codes are the verbs the server claims: read, search, create, update and the others it lists. A client call needs a matching code.
The R4 statement puts interactions on rest.resource. The code set includes read, vread, update, patch, delete, history-instance, history-type, create and search-type. System interactions, such as transaction or batch, sit on rest.interaction, not on a single resource. Look in the right list before you code a batch.
| Field | What you take from it | What you still test |
|---|---|---|
| rest.mode | Use the server entries for calls you will make. | A client-mode entry is not your API. |
| resource.interaction | The verbs claimed for that resource. | A listed verb can still fail authorization or validation. |
| resource.searchParam | Name and type of claimed searches. | A listed parameter can error or be ignored. |
| operation | Named operations such as $export, if present. | Absence means you do not call it. |
If Patient lists read and search-type and does not list create, the client does not POST Patient. If the interaction appears only in a sample you saw on another site, it is not this site's statement. Add the call only after this document lists it and a test passes.
How do you read search parameters?
For each resource the client will search, read searchParam entries: the name, the type and the documentation string. Send only names that appear there. A parameter you know from the base FHIR spec is not available until this server lists it.
- Name: the query parameter, such as family or patient, exactly as listed.
- Type: how the value is shaped, such as string, token, date or reference.
- Documentation: the server's note on behaviour, which can be narrower than the base spec.
- Includes and revincludes, if listed, before you build a query that asks for related resources.
- No chained parameter and no modifier unless the statement or a passed test shows it works.
US Core profiles a set of searches for USCDI data. A server may declare US Core and still omit a search on a resource you need. The declaration of the guide is a clue. The searchParam list on the resource is the check. When they disagree, test, and do not ship the search the resource omits.
Which operations should you notice before coding?
Read rest.operation and each resource's operation list. An operation such as $export is callable when it appears there. If it does not appear, the client does not call it on the strength of the Bulk Data guide alone.
Note the operation name and the resource it hangs on. Group/$export is not the same claim as a system-level export. Write the client against the operation the statement names, then confirm parameters with a test call. Parameter support, including _since on a bulk export, is a test even when the operation itself is listed.
Security belongs in the same pass. rest.security describes how the server expects you to authenticate. Read it, then confirm the token you were issued can perform the interactions you selected. A listed create can still return a scope error.
What must you still test at the site?
Test every call the client will make. The statement is a claim. Servers advertise searches they reject, ignore parameters they list, and differ by tenant from the vendor's public example.
- Each interaction you will call, on the resource you will call, with a token of the scope you will ship.
- Each search parameter you will send, including a value that should match and a value that should not.
- A listed parameter that returns an error, recorded as unsupported for this site.
- A search that returns results while ignoring the parameter, which is worse than an error.
- Create and update on synthetic data if you will write, including a version conflict if you will send If-Match.
- The operation you will invoke, with the parameters you will send.
- The customer site, not only the vendor sandbox.
A conformance test kit can run a broad suite against an implementation guide. That suite is useful. The site checks above are narrower: the calls your client actually makes, checked against the statement you stored.
Why can the vendor statement and the site statement differ?
Vendors publish a CapabilityStatement for a reference endpoint. A customer enables a subset, runs a different version, or fronts the API with a gateway that drops operations. The client ships against the site you fetched.
Store both documents when you have them, and diff resource by resource. A resource present on the vendor host and absent on the customer host is a scope change, not a bug in your parser. Raise it before the release, with the two hashes.
Certified health IT still varies inside the certification criteria. Population export, write interactions and optional searches move. The criterion tells you the API family. The site statement plus your tests tell you the methods you can call on Monday.
How do you keep the client honest after an upgrade?
Re-fetch [base]/metadata when the vendor upgrades or on a schedule you keep, hash it, and fail the job when the hash changes until someone reviews the diff. A silent upgrade that removes a search will otherwise fail in a clinic.
- Pin the reviewed hash in the client configuration for that site.
- Diff interaction codes and search parameter names, not only the narrative text.
- Block release when a call in the client is no longer in the statement.
- Re-run the site tests for any parameter the diff touched.
- Keep the previous statement so you can explain what changed.
The review is a short human step. The fetch and the diff are automatic. Agnotic wires that check into the client release so a CapabilityStatement drift is a stopped deploy, not a Monday incident.
What are the common mistakes when reading a CapabilityStatement?
The common mistakes treat the statement as either more or less than it is: a claim about one deployment, to be checked by tests.
- Coding from a public sandbox statement and shipping against a customer site that enables less.
- Treating a declared implementation guide as proof that every search on a resource exists.
- Looking for batch or transaction on a resource instead of on rest.interaction.
- Assuming a listed search parameter filters results, without a test that should not match.
- Never re-fetching the statement, so a vendor upgrade removes a call nobody notices until a clinic reports it.
A worked example: checking an Observation search before coding it
- Step 1, fetch [base]/metadata on the customer site and store the hash.
- Step 2, find Observation under the server rest entry and confirm search-type is listed.
- Step 3, confirm the patient and category search parameters are listed with the types the client expects.
- Step 4, run one search that should match and one that should not, using the token you will ship.
- Step 5, record both results with the statement hash, then write the call.
How should the client be configured from the statement?
Keep a per-site list of the interactions and search parameters the client may use, built from the reviewed statement and the passing tests. Code paths check that list, so a site that lacks a search returns a clear unsupported result instead of a failing call.
What should you record when the statement and a test disagree?
Record the resource, the interaction or parameter, what the statement claims, what the test returned, and the hash. Send that note to the site's API owner, and mark the call unsupported for that site until a retest passes.
Who reviews a CapabilityStatement diff?
The engineer who owns the client for that site, joined by the product owner when a removed call affects a screen. The review ends with each changed call marked kept, removed or retested.
How does Agnotic use a CapabilityStatement?
Agnotic reads the instance statement from the site you will call, maps each client call to an interaction or operation it lists, and tests those calls on that site. We do not code from a vendor slide, and we do not treat a named implementation guide as a substitute for the resource list.
You keep the site access and the clinical scope of the app. We keep the stored statement, the hash gate and the tests. A search that is not in the statement does not ship.
Read the statement, then write the client
We fetch the CapabilityStatement, map your calls to it, and test the site.
Related reading on Agnotic
FHIR tests, profiles, scopes and backend access.


