{
  "resourceType": "OperationDefinition",
  "id": "hddt-cgm-summary-operation",
  "url": "https://gematik.de/fhir/hddt/OperationDefinition/hddt-cgm-summary-operation",
  "title": "Search Operation for summary data measurement",
  "description": "The `$hddt-cgm-summary` operation is defined on the *Observation* resource type.  \nIt allows clients to request CGM summary data filtered by effective period, and optionally include related device context (Device, DeviceMetric).  \n\n**Use cases supported by this operation include:**  \n- Retrieving CGM summary statistics (mean glucose, time-in-range, GMI, etc.) for a patient over a specified interval  \n\n**Input Parameters:**  \n- `effectivePeriodStart` *(dateTime, optional)*: Lower bound of the observation effective period.  \n- `effectivePeriodEnd` *(dateTime, optional)*: Upper bound of the observation effective period.  \n- `related` *(boolean, optional)*: If true, the response bundle also contains related Device and DeviceMetric resources.  \n\n**Output Parameter:**  \n- `result` *(Reference, required)*: A Bundle conforming to profile `HddtCgmSummary` profile containing all matching CGM Observations and, if requested, their related devices.  \n\n**Error handling (OperationOutcome):**  \n- `MSG_PARAM_UNKNOWN`: Returned when an unsupported input parameter is used.  \n- `MSG_PARAM_INVALID`: Returned when a parameter value is invalid (e.g., bad date format).  \n- `MSG_NO_MATCH`: Returned when no matching observations are found. \n- `MSG_BAD_SYNTAX`: Returned when the request is malformed.  ",
  "name": "HddtCgmSummaryOperation",
  "status": "active",
  "version": "1.0.1",
  "experimental": false,
  "kind": "operation",
  "publisher": "gematik GmbH",
  "date": "2026-04-29",
  "affectsState": false,
  "code": "hddt-cgm-summary",
  "system": false,
  "type": true,
  "instance": false,
  "parameter": [
    {
      "name": "effectivePeriodStart",
      "use": "in",
      "min": 0,
      "max": "1",
      "documentation": "Start of effective period",
      "type": "dateTime"
    },
    {
      "name": "effectivePeriodEnd",
      "use": "in",
      "min": 0,
      "max": "1",
      "documentation": "End of effective period",
      "type": "dateTime"
    },
    {
      "name": "related",
      "use": "in",
      "min": 0,
      "max": "1",
      "documentation": "If true, include related Device and DeviceMetric in the result bundle",
      "type": "boolean"
    },
    {
      "name": "result",
      "use": "out",
      "min": 1,
      "max": "1",
      "documentation": "Result bundle (HTTP 200 OK) containing summary data of measurements and optionally related resources",
      "type": "Reference",
      "targetProfile": [
        "https://gematik.de/fhir/hddt/StructureDefinition/hddt-cgm-summary"
      ]
    }
  ]
}
