A capability statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.
Important: This site is under active development by NHS Digital and is intended to provide all the technical resources you need to successfully develop APIs. This project is being developed using an agile methodology so iterative updates to content will be added on a regular basis.
Warning: This site is provided for information only and is intended for those engaged with NHS Digital on the development of APIs. It is advised not to develop against these specifications until a formal announcement has been made.
0. References
NHS Digital Profile: - |
HL7 FHIR STU3 Resource: CapabilityStatement |
User Stories: - |
1. Capabilities
API to support getting the NRLS server capability statement.
1.1 Capabilities Request Headers
The Capabilities Interaction supports the following HTTP request headers:
Header | Value | Conformance |
---|---|---|
Accept |
The Accept header indicates the format of the response the client is able to understand, this will be one of the following application/fhir+json or application/fhir+xml . See the RESTful API Content types section. |
MAY |
Authorization |
The Authorization header will carry the base64url encoded JSON web token required for audit on the spine - see Access Tokens and Audit (JWT) for details. |
MUST |
fromASID |
Client System ASID | MUST |
toASID |
The Spine ASID | MUST |
1.2 Capabilities Interaction (Get the NRLS CapabilityStatement)
GET [baseUrl]/metadata
The /metadata
path on the root of the NRLS FHIR server will return the capability statement for the FHIR server.
For details of this interaction - see HL7 FHIR STU3 RESTful API.
1.3 Capabilities Response
Success:
- SHALL return a
200
OK HTTP status code on successful retrieval of the capability statement. - SHALL return a capability statement which conforms to the standard FHIR CapabilityStatement
Error Handling:
The NRLS Server is expected to always be able to return a valid capability statement.
2. Example
2.1 Capabilities Request Query
Retrieve the capability statement from the NRLS Server, the format of the response body will be xml.
2.1.1. cURL
curl -H 'Accept: application/fhir+xml' -H 'Authorization: BEARER [token]' -X GET '[baseUrl]/metadata'
2.2 Query Response
2.2.1 Http Headers
2.2.2 Response Body
An example NRLS CapabilityStatement of kind Requirements
is shown below:
2.3 C#
Tip: C# code snippets utilise Ewout Kramer’s fhir-net-api library which is the official .NET API for HL7® FHIR®.
var client = new FhirClient("http://[fhir_base]/");
client.PreferredFormat = ResourceFormat.Json;
var resource = client.CapabilityStatement();
FhirSerializer.SerializeResourceToXml(resource).Dump();