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 NRL 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 application/fhir+json or application/fhir+xml . See the RESTful API Content types section. |
OPTIONAL |
Authorization |
The Authorization header will carry the base64url encoded JSON web token required for audit on the spine - see Access Tokens (JWT) for details. |
REQUIRED |
fromASID |
Client System ASID | REQUIRED |
toASID |
The Spine ASID | REQUIRED |
1.2 Capabilities Interaction (Get the NRL CapabilityStatement)
GET [baseUrl]/metadata
The /metadata
path on the root of the NRL 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:
- MUST return a
200
OK HTTP status code on successful retrieval of the capability statement. - MUST return a capability statement which conforms to the standard FHIR CapabilityStatement
Error Handling:
The NRL 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 NRL 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 NRL 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();