Search MedicationAdministration (Insulin) by parameters
A client can search for insulin MedicationAdministration resources by using the GET
method on the server's MedicationAdministration
endpoint with the query parameters below.
Supported codes
67866001_short_acting
(short-acting insulin)67866001_long_acting
(long-acting insulin)
Codes are provided in medication.concept.coding.code
using the system https://roche.com/fhir/iop/cs
(see examples below).
Query Parameters
Parameter | Description | Required |
---|---|---|
subject | Patient Record ID (FHIR Patient logical id) | true |
code | Code to search for (see list above) | true |
date | Administration occurrence date/time range (applies to occurenceDateTime) (see validation below) | either date or _lastUpdated |
_lastUpdated | Last updated timestamp range (Resource.meta.lastUpdated) (see validation below) | either date or _lastUpdated |
Date / _lastUpdated validation
Rules (applied independently to each provided time-range parameter):
- Provide exactly two repeated parameters: first with
ge
, second withle
(e.g.date=ge...&date=le...
). - Format:
[ge|le]yyyy-MM-ddTHH:MM:SS[+|-]HH:MM
. - Start instant must be earlier than end instant.
- Maximum supported span is 90 days.
Either date
or _lastUpdated
MUST be present; both MAY be present.
Examples
Search short-acting insulin administrations
curl -sS "https://${server}/fhir/r5/api/MedicationAdministration?subject=${patient_id}&code=67866001_short_acting&date=ge2024-09-01T00%3A00%3A00Z&date=le2024-09-14T00%3A00%3A00Z" \
-H "client_id: ${client_id}" \
-H "client_secret: ${client_secret}" \
-H "org_id: ${org_id}" \
-H "certificate: ${certificate}" | jq
Search long-acting insulin administrations using lastUpdated
curl -sS "https://${server}/fhir/r5/api/MedicationAdministration?subject=${patient_id}&code=67866001_long_acting&_lastUpdated=ge2025-09-01T00%3A00%3A00Z&_lastUpdated=le2025-09-02T00%3A00%3A00Z" \
-H "client_id: ${client_id}" \
-H "client_secret: ${client_secret}" \
-H "org_id: ${org_id}" \
-H "certificate: ${certificate}" | jq
Response
The server responds with a FHIR Bundle
of type searchset
containing matching MedicationAdministration
resources. Each resource represents a single insulin administration event.
Error Handling
On error, an OperationOutcome
is returned describing the issue (e.g., invalid date format, unsupported code, missing required parameter).