Definition
The MedicationStatement resource represents a medication recorded on a patient’s EMIS Web record. Each MedicationStatement corresponds to an EMIS Web drug record (a current or past medication), rather than to an individual issue of that medication. Drug records that are hidden in EMIS Web are not returned.
Medication statements are retrieved for a patient identified by their ERN,
either ern:emis:patient:uuid:{EMIS patient GUID} or
ern:nhs:patient:number:{NHS number}. The resource id is the EMIS drug record
GUID in upper case, and can be used to read a single statement. The medication
is coded with its dm+d concept where the EMIS Web code can be matched; otherwise
only the term recorded in EMIS Web is returned as text. The status is derived
from the drug record’s status, its issue counts and any cancellation: active,
completed, stopped or unknown. The EMIS Web prescription type is returned
as a course of therapy extension, and the expected supply duration, where
recorded, as a supply duration extension. Where an issue is linked to a
consultation, context references the consultation linked to the earliest such
issue as an Encounter.
The search returns a searchset Bundle, newest record first, with up to 50
entries per page. When more results are available the Bundle contains a next
link carrying a cursor query parameter that can be used to fetch the following
page. Every request is recorded in the EMIS Web access audit.
Profile
Section titled “Profile”Every MedicationStatement returned by the FHIR Platform declares the
https://fhir.partner.emis-x.uk/StructureDefinition/emis-x-medication-statement-1
profile in meta.profile.
Endpoints
Section titled “Endpoints”Paths are relative to the FHIR Platform base URL. Every request needs a bearer
token with the listed scope. Responses are application/fhir+json by default,
or application/fhir+xml when requested in the Accept header. Errors are
returned as an OperationOutcome.
Search
Section titled “Search”GET /R4/1/Patient/ern:{Vendor}:patient:{Type}:{Identifier}/MedicationStatementReturns all medication statements recorded for the given patient.
- Scope:
fpx-medstm.read - Returns: Bundle of MedicationStatement
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
Vendor |
path | string | Yes | The vendor for the patient identifier. Validation accepts emis, nhs, jhs and gha, but only emis (with Type uuid) and nhs (with Type number) currently resolve a patient; other combinations return 404 Not Found. |
Type |
path | string | Yes | The identifier type for the patient identifier. Must be a valid combination with Vendor: emis with uuid; nhs with number, chi, hospital or hcn; jhs with ssn; gha with number. Only emis:uuid and nhs:number currently resolve a patient. |
Identifier |
path | string | Yes | The patient identifier. For Type uuid this must be a non-empty GUID (the EMIS patient GUID); for Type number this must be a valid 10-digit NHS number. |
_elements |
query | string | No | Comma-separated list of top-level MedicationStatement elements to return. id and meta are always returned, and filtered resources are tagged as SUBSETTED. |
cursor |
query | string | No | Opaque pagination cursor. Use the value from the Bundle’s next or previous link to fetch another page. A maximum of 50 entries are returned per page. |
GET /R4/1/Patient/ern:{Vendor}:patient:{Type}:{Identifier}/MedicationStatement/{DrugRecordId}Returns a single medication statement for the given patient and drug record.
- Scope:
fpx-medstm.read - Returns: MedicationStatement
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
Vendor |
path | string | Yes | The vendor for the patient identifier. Validation accepts emis, nhs, jhs and gha, but only emis (with Type uuid) and nhs (with Type number) currently resolve a patient; other combinations return 404 Not Found. |
Type |
path | string | Yes | The identifier type for the patient identifier. Must be a valid combination with Vendor: emis with uuid; nhs with number, chi, hospital or hcn; jhs with ssn; gha with number. Only emis:uuid and nhs:number currently resolve a patient. |
Identifier |
path | string | Yes | The patient identifier. For Type uuid this must be a non-empty GUID (the EMIS patient GUID); for Type number this must be a valid 10-digit NHS number. |
DrugRecordId |
path | uuid | Yes | The EMIS drug record GUID (the MedicationStatement id). Returns 404 Not Found if no visible drug record with this GUID exists for the patient. |
_elements |
query | string | No | Comma-separated list of top-level MedicationStatement elements to return. id and meta are always returned, and a filtered resource is tagged as SUBSETTED. |
Example response
Section titled “Example response”{ "resourceType": "MedicationStatement", "id": "9A153F47-5C08-4AA3-844F-B43CAE0BFD84", "meta": { "profile": [ "https://fhir.partner.emis-x.uk/StructureDefinition/emis-x-medication-statement-1" ] }, "language": "en", "extension": [ { "url": "https://fhir.partner.emis-x.uk/StructureDefinition/emis-x-course-of-therapy-type", "valueCodeableConcept": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", "code": "continuous", "display": "Continuous long term therapy" } ], "text": "Repeat" } }, { "url": "https://fhir.partner.emis-x.uk/StructureDefinition/emis-x-supply-duration", "valueDuration": { "value": 28, "unit": "day", "system": "http://unitsofmeasure.org", "code": "d" } } ], "status": "stopped", "medicationCodeableConcept": { "coding": [ { "system": "https://dmd.nhs.uk", "code": "996641000033112", "display": "Nystatin 100,000units/ml oral suspension" } ] }, "subject": { "reference": "650fa751-87d9-4543-9adb-7b0878dd0117", "type": "Patient" }, "context": { "reference": "c0a80001-0000-4000-8000-000000000001", "type": "Encounter" }, "dosage": [ { "sequence": 1, "text": "Take one tablet by mouth twice daily", "patientInstruction": "Take with food", "asNeededBoolean": false } ]}