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 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 Medication resources. Returns a bundle of all Medication
resources for the specified search criteria.
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
There is NO required search criteria in the API for the Medication resource.
Search parameters MAY be added to reflect local requirements.
MedicationStatement and MedicationRequest resources can represent a medication, using an external reference to a Medication resource.
If an external Medication Resource is used in a MedicationStatement or a MedicationRequest, then the READ and SEARCH Criteria SHOULD be supported.
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 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/fhir+xml' -H 'Authorisation: BEARER [token]' -v 'https://data.developer.nhs.uk/ccri-fhir/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