0. References
HL7 UK | Care Connect Profile: Condition |
HL7 FHIR Resource: Condition |
User Stories: User Stories |
1. Read
Return a single Condition
for the specified id.
All requests MUST contain a valid ‘Authorization’ header and SHOULD contain an ‘Accept’ header. 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
.
1.1. Response
A full set of response codes can be found here API Response Codes. FHIR Servers MUST support the following response codes:
200 | successful operation |
400 | invalid parameter |
401/4xx | unauthorized request |
403 | insufficient scope |
404 | resource not found |
410 | resource deleted |
2. Search
Search for all problems and health concerns for a patient. Fetches a bundle of all Condition
resources for the specified patient.
All requests MUST contain a valid ‘Authorization’ header and SHOULD contain an ‘Accept’ header. The `Accept` header indicates the format of the response the client is able to understand, this will be one of the following application/fhir+xml
or application/fhir+json
.
2.1. Search Parameters
The search parameters and combinations that are mandated as a minimum in the API for the Condition resource are detailed below.
Query parameters conformance will be categorised as:
MUST - these search parameters MUST be implemented for the specified resource type.
SHOULD - these search parameters are expected to be implemented, if the data to support the query is present in the host system.
Additional search parameters MAY be added to reflect local requirements.
To be conformant, provider systems are required to implement all of the MUST parameters.
The parameters can be used independently or in combination to help refine the search results returned.
Name | Type | Description | Conformance | Path |
---|---|---|---|---|
category |
token |
The category of the condition | SHOULD | Condition.category |
clinical-status |
token |
The clinical status of the condition | SHOULD | Condition.clinicalStatus |
code |
token |
Code for the condition | SHOULD | Condition.code |
patient |
reference |
Who has the condition? | MUST | Condition.patient (Patient) |
Search parameter combinations for the Condition resource are as follows:
Parameter Combinations | Type | Conformance |
---|---|---|
patient + clinical-status |
reference + token |
SHOULD |
patient + category |
reference + token |
SHOULD |
patient + code |
reference +token |
SHOULD |
This section outlines the search parameter syntax used, with some examples provided.
2.1.1. category
See token for details on this parameter.
To filter on category (
co-morbidity | encounter-diagnosis | issue | presenting-complaint | problem-list-item |
)
GET [baseUrl]/Condition?patient=1&category=problem-list-item
Return all Condition resources with a category of problem-list-item and Patient with a logical id of 1.
2.1.2. clinical-status
See token for details on this parameter.
To filter on clinical-status ( active | recurrence | inactive | remission | resolved
)
GET [baseUrl]/Condition?patient=1&clinical-status=active
Return all Condition resources with a clinical-status of active and Patient with a logical id of 1.
2.1.3. code
GET [baseUrl]/Condition?patient=[id]&code=[code]
See token for details on this parameter. ‘code’ can be used multiple times as a search parameter
system
is a uniform resource identifier which defines which CodeSystem the code belongs to. This is optional and if not present all matching codes will be returned regardles of CodeSystems.
To search for Conditions with Burn of ear
using SNOMED CT
GET [baseUrl]/Condition?patient=[id]&code=http://snomed.info/sct|39065001
Return all Condition resources with SNOMED CT code of 39065001 and Patient with a logical id of 1.
GET [baseUrl]/Condition?patient=1&code=39065001
Return all Condition resources with code of 39065001 from any CodeSystem and Patient with a logical id of 1.
2.1.4. patient
See reference for details on this parameter. The patient parameter can be used two ways:
This MUST be supported for all endpoint provider systems.
id
is the logical id of the patient on the server which can be obtained by a Patient resource query.
GET [baseUrl]/Condition?patient=42
Return all Condition resources for Patient with a logical id of 42
This SHOULD be supported for all endpoint provider systems.
system
is a uniform resource identifier which defines which CodeSystem the identifer belongs to. For NHS Number this would be https://fhir.nhs.uk/Id/nhs-number
and code
would be the NHS Number.
GET [baseUrl]/Condition?patient.identifier=https://fhir.nhs.uk/Id/nhs-number|9876543210
Return all Condition resources for Patients with a NHS Number of 9876543210
2.2. Search Response
If the search fails (cannot be executed, not that there is no matches), the return value is a status code 4xx or 5xx with an OperationOutcome.
If the search succeeds, the return content is a Bundle with type = searchset containing the results of the search as a list of resources in a defined order. The result list can be long, so servers MAY use paging. If they do, they MUST use this Paging method for breaking the list into pages if appropriate. The server MAY also return an OperationOutcome resource with additional information about the search.
A full set of response codes can be found here API Response Codes. FHIR Servers MUST support the following response codes:
200 | successful operation |
400 | invalid parameter |
401/4xx | unauthorized request |
403 | insufficient scope |
404 | resource not found |
410 | resource deleted |
3.1 cURL
Return all Condition resources for Patient with an id of 1, the format of the response body will be xml. Replace 'baseUrl' with the actual base Url of the FHIR Server.curl -X GET -H 'Accept: application/fhir+xml' -H 'Authorisation: BEARER [token]' -v 'https://data.developer.nhs.uk/ccri-fhir/STU3/Condition?patient=1'
3.2 Explore the Response
Explore the response in XML & JSON on the Reference Implementation below
Reference Implementation
XML Patient id search RI viewer
JSON Patient id search RI viewer