RDC Interoperability Guide
1.2.2

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-8 Glucose [Mass/volume] in Capillary blood
  • 9059-7 Carbohydrate 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):

  1. Provide exactly two repeated parameters: first with ge, second with le (e.g. date=ge...&date=le...).
  2. Format: [ge|le]yyyy-MM-ddTHH:MM:SS[+|-]HH:MM.
  3. The start instant must be earlier than the end instant.
  4. 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.

{
"resourceType": "Bundle",
"id": "rdc-Bundle-R5-Bg-Observation-Search-Result",
"type": "searchset",
"link": [
{
"relation": "self",
"url": "/fhir/r5/api/Observation?date=ge2025-09-18T10:11:00Z&date=le2025-10-29T11:11:00Z&subject=12345&code=32016-8&_sort=-date"
}
],
"entry": [
{
"fullUrl": "urn:uuid:a643d4e8-bf31-4695-b0ec-1d9a2e3816f6",
"resourceType": "Observation",
"id": "cf.bg.b.4bf3b65b85f84149a4dc6370685d557e",
"meta": {
"versionId": "1761332365614",
"lastUpdated": "2025-10-24T18:59:25.614+00:00",
"profile": [
"https://roche.com/fhir/iop/StructureDefinition/rdc-Observation-BG"
]
},
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "32016-8",
"display": "Glucose [Mass/volume] in Capillary blood"
}
]
},
"subject": {
"reference": "Patient/12345"
},
"event": [
"2025-10-24T18:59:13+00:00"
]
},
"value": 360.4,
"unit": "mg/dL",
"system": "http://unitsofmeasure.org",
"code": "mg/dL"
},
"device": {
"reference": "Device/cf.globaldc.yFmDaoMIAODOjdXLvAg0VQ4oZ6KVEel"
}
},
"search": {
"mode": "match"
}
},
{
"fullUrl": "urn:uuid:5c4c9fe3-aecf-4c19-8eac-3ea71e1ee4ad",
"resourceType": "Observation",
"id": "cf.bg.b.3b1565863f4a4f2d9a35851937c1f2bf",
"meta": {
"versionId": "1761232433649",
"lastUpdated": "2025-10-23T15:13:53.649+00:00",
"profile": [
"https://roche.com/fhir/iop/StructureDefinition/rdc-Observation-BG"
]
},
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "32016-8",
"display": "Glucose [Mass/volume] in Capillary blood"
}
]
},
"subject": {
"reference": "Patient/12345"
},
"event": [
"2025-10-23T15:13:06+00:00"
]
},
"value": 180.2,
"unit": "mg/dL",
"system": "http://unitsofmeasure.org",
"code": "mg/dL"
},
"device": {
"reference": "Device/cf.globaldc.yFmDaoMIAODOjdXLvAg0VQ4oZ6KVEel"
}
},
"search": {
"mode": "match"
}
}
]
}

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.

{
"resourceType": "Bundle",
"id": "rdc-Bundle-R5-Carbs-Observation-Search-Result",
"type": "searchset",
"link": [
{
"relation": "self",
"url": "/fhir/r5/api/Observation?date=ge2025-09-18T10:11:00Z&date=le2025-10-29T11:11:00Z&subject=12345&code=9059-7&_sort=-date"
}
],
"entry": [
{
"fullUrl": "urn:uuid:62d3ddce-afb7-48f3-8841-9be7c247942d",
"resourceType": "Observation",
"id": "0dc008ad-922a-424d-9d4e-fc0ae1e0f0a3",
"meta": {
"versionId": "1759720641827",
"lastUpdated": "2025-10-06T03:17:21.827+00:00",
"profile": [
"https://roche.com/fhir/iop/StructureDefinition/rdc-Observation"
]
},
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "9059-7",
"display": "Carbohydrate intake Estimated"
}
]
},
"subject": {
"reference": "Patient/12345"
},
"effectiveDateTime": "2025-09-21T08:11:37+00:00",
"value": 66,
"unit": "g",
"system": "http://unitsofmeasure.org",
"code": "g"
},
"device": {
"reference": "Device/bgip-device-1"
}
},
"search": {
"mode": "match"
}
}
]
}

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.