Search Observation (BG & Carbs) by parameters
A client can search for Blood Glucose (BG) and Carbohydrate intake Observations by using the GET method on the
server's Observation endpoint with the following query parameters.
The Continuous Glucose Monitoring (CGM) search is documented separately because CGM readings are aggregated into compound Observations using SampledData. CGM searches MUST NOT be combined with BG or Carbohydrate searches. For CGM guidance see: CGM Observation Search.
Supported codes
The search supports the following LOINC codes:
32016-8Glucose [Mass/volume] in Capillary blood9059-7Carbohydrate intake Estimated
Query Parameters
| Parameter | Description | Required |
|---|---|---|
| subject | External Patient id | true |
| code | One of the supported codes listed above | true |
| date | Effective date/time range (Observation.effective[x]) (see validation below) | either date or _lastUpdated |
| _lastUpdated | Last updated timestamp range (Resource.meta.lastUpdated) (see validation below) | either date or _lastUpdated |
| page | Opaque page identifier for retrieving subsequent result pages | false |
| _sort | Sort by effective date: date (ascending) or -date (descending, default) |
false |
subject parameter
The subject parameter MUST be provided with the external Patient id of the patient whose Observations are being queried. The patient id must follow the FHIR specified format for id
Date / _lastUpdated validation
The following rules apply independently to each supplied time-range parameter (date and _lastUpdated):
- 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. - The start instant must be earlier than the end instant.
- Maximum supported search duration is 90 days.
Either date or _lastUpdated MUST be present; both MAY be present.
_sort parameter
Accepted values: date (ascending) or -date (descending). Default is descending by effective date.
Examples
Search BG Observations
curl -sS "https://${server}/${basePath}/Observation?subject=${patient_id}&code=32016-8&date=ge2024-09-01T00%3A00%3A00Z&date=le2024-09-14T00%3A00%3A00Z&_sort=-date" \
-H "client_id: ${client_id}" \
-H "client_secret: ${client_secret}" \
-H "org_id: ${org_id}" \
-H "certificate: ${certificate}" | jq
Parameters Explanation
This request searches for BG Observations (code 32016-8) for the patient with the ID patient_id whose effective date time is greater than 2024-09-01T00:00:00 and less than 2024-09-14T00:00:00. The Response observations are sorted in ascending order of date.
Below is a response of BG Observation search result for a given external patient ID. The search result contains 2 BG Observation collected between time period 18/09/2025 02:00:00 and 29/10/2025 02:15:00.
Search Carbohydrate Observations
curl -sS "https://${server}/${basePath}/Observation?subject=${patient_id}&code=9059-7&_lastUpdated=ge2025-09-01T00%3A00%3A00Z&_lastUpdated=le2025-09-02T00%3A00%3A00Z&_sort=date" \
-H "client_id: ${client_id}" \
-H "client_secret: ${client_secret}" \
-H "org_id: ${org_id}" \
-H "certificate: ${certificate}" | jq
This request searches for BG Observations (code 9059-7) for the patient with the ID patient_id whose last updated time is greater than 2025-09-01T00:00:00 and less than 2025-09-02T00:00:00.
The Response observations are sorted in ascending order of date.
Below is a response of Carbohydrate Observation search result for a given external patient ID. The search result contains 1 Carbohydrate observation collected between time period 18/09/2025 02:00:00 and 29/10/2025 02:15:00.
Response
The server responds with a FHIR Bundle of type searchset containing matching Observation resources. Each BG or
Carbohydrate Observation represents a single measurement (no aggregation). Pagination is indicated through Bundle.link
entries with relation next when additional pages exist.
