0. References
HL7 UK | Care Connect Profile: Medication |
HL7 FHIR Resource: Medication |
User Stories: User Stories |
1. Read
Return a single Medication
for the specified id.
All requests SHALL contain a valid ‘Authorization’ header and SHALL 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/json+fhir
or application/xml+fhir
.
1.1. Response
A full set of response codes can be found here API Response Codes. FHIR Servers SHALL support the following response codes:
200 | successful operation |
404 | resource not found |
410 | resource deleted |
2. Search
Search Medication resources. Returns a bundle of all Medication
resources for the specified search criteria.
All requests SHALL contain a valid ‘Authorization’ header and SHALL 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/json+fhir
or application/xml+fhir
.
2.1. Search Parameters
This implementation guide outlines some suggested search parameters for the Medication resource in the table below. To be conformant, provider systems are required to implement all of the SHALL parameters. Provider systems may implement the full list of search parameters for the Medication resource (HL7 FHIR STU3 Medication).
Name | Type | Description | Conformance | Path |
---|---|---|---|---|
code |
token |
Codes that identify this medication | SHALL | Medication.code |
2.1.1. code
GET [baseUrl]/Medication?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 Medications with Insulin glulisine 100units/ml solution for injection 3ml pre-filled disposable devices
using SNOMED CT
GET [baseUrl]/Medication?code=http://snomed.info/sct|10097211000001102
Return all Medication resources with SNOMED CT code of 10097211000001102.
GET [baseUrl]/Medication?code=10097211000001102
Return all Medication resources with code of from any CodeSystem.
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 SHALL 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; if one is sent it SHALL NOT include any errors, and it shall be marked with an entry mode of include.
A full set of response codes can be found here API Response Codes. FHIR Servers SHALL support the following response codes:
200 | successful operation |
404 | resource not found |
410 | resource deleted |
3. Example
3.1 Request Query
3.1 cURL
Return all Medication resources with an SNOMED CT code of 320141001, the format of the response body will be xml. The Reference Implementation is hosted at ‘https://data.developer.nhs.uk/ccri/’.
curl -X GET -H 'Accept: application/xml+fhir' -H 'Authorisation: BEARER [token]' -v 'https://data.developer.nhs.uk/ccri/STU3/Medication?code=320141001'
3.2 Explore the Response
Explore the response in XML & JSON on the Reference Implementation below
Reference Implementation
XML Mediciation code search RI viewer
JSON Medication code search RI viewer