<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="hddt-cgm-summary" />
  <url value="https://gematik.de/fhir/hddt/StructureDefinition/hddt-cgm-summary" />
  <version value="1.0.1" />
  <name value="HddtCgmSummary" />
  <title value="Bundle – HDDT CGM Summary Report" />
  <status value="active" />
  <date value="2026-04-29" />
  <publisher value="gematik GmbH" />
  <description value="This profile defines the exchange of aggregated measurement data for the Mandatory Interoperable Value (MIV) \&quot;Continuous &#xA;Glucose Measurement\&quot;. By this it provides a patient's glucose profile for a defined period. The MIV \&quot;Continuous &#xA;Glucose Measurement\&quot; is e.g. implemented by real-time Continuous Glocose Monitoring devices (rtCGM) and Automated Insulin Delivery systems (AID) that control &#xA;an insulin pump from rtCGM data. Future non-invasive measuring methods will expectedly be linked with this MIV and therefore use this profile for sharing aggregated glucose profile data with DiGA, too.&#xA;&#xA;This profile constrains the FHIR Bundle resource for use as the result container of the `$hddt-cgm-summary` operation.  &#xA;The operation requests a patient's glucose profile. The glucose profile is calculated form continuous glucose measurement data&#xA;and consists of the machine-readable parts of the [_HL7 CGM summary profile_](https://hl7.org/fhir/uv/cgm/). &#xA;&#xA;The Bundle is of type *collection* and MUST contain only resources of the following types:  &#xA;- Observations conforming to [HL7 CGM profiles](https://hl7.org/fhir/uv/cgm/): &#xA;    - [CGM Summary Observation](https://hl7.org/fhir/uv/cgm/StructureDefinition-cgm-summary.html)&#xA;    - [Mean Glucose (Mass)](https://hl7.org/fhir/uv/cgm/StructureDefinition-cgm-summary-mean-glucose-mass-per-volume.html)&#xA;    - [Mean Glucose (Moles)](https://hl7.org/fhir/uv/cgm/StructureDefinition-cgm-summary-mean-glucose-moles-per-volume.html)&#xA;    - [Times in Ranges](https://hl7.org/fhir/uv/cgm/StructureDefinition-cgm-summary-times-in-ranges.html)&#xA;    - [Glycemic Variability Index (GMI)](https://hl7.org/fhir/uv/cgm/StructureDefinition-cgm-summary-gmi.html)&#xA;    - [Coefficient of Variation](https://hl7.org/fhir/uv/cgm/StructureDefinition-cgm-summary-coefficient-of-variation.html)&#xA;    - [Days of Wear](https://hl7.org/fhir/uv/cgm/StructureDefinition-cgm-summary-days-of-wear.html)&#xA;    - [Sensor Active Percentage](https://hl7.org/fhir/uv/cgm/StructureDefinition-cgm-summary-sensor-active-percentage.html)&#xA;&#xA;- Device resources conforming to `HddtPersonalHealthDevice` to provide context about the actual Personal Health Device device used.  &#xA;&#xA;The purpose of this Bundle profile is to provide a consistent structure for server responses when clients query for CGM data with aggregation logic.  &#xA;It ensures interoperability across different implementations by defining a predictable response format.  &#xA;This supports use cases such as:  &#xA;- Retrieval of CGM summary metrics over a given time interval in support for the upcoming digital disease management program (dDMP) on Diabetes, e.g. for &#xA;    - continuous therapy monitoring and adjustment&#xA;    - forwarding key data to treating physicians, e.g. for clinical decision support&#xA;    - supporting asynchonous telemonitoring by ad hoc provisioning of condensed status information&#xA;- Combining aggregated measurement data and device metadata for downstream applications such as visualization or compliance monitoring&#xA;&#xA;**Constraints applied:**  &#xA;- `Bundle.type` is fixed to `collection`.  &#xA;- `Bundle.entry.resource` is restricted to CGM Observation profiles and `HddtPersonalHealthDevice`. No other resource types are allowed in the Bundle.  &#xA;- `Bundle.entry` is set as mandatory. A requests for a CGM summary that would result in an empty bundle, MUST give an _OperationOutcome_ with an error or warning message as its response. Therefore there is no scenario where an empty bundle would be shared with a DiGA." />
  <copyright value="Copyright (c) 2026 gematik GmbH" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Bundle" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Bundle" />
  <derivation value="constraint" />
  <differential>
    <element id="Bundle.type">
      <path value="Bundle.type" />
      <short value="The bundle is always a collection of CGM summary Observations and optionally related Device and DeviceMetric resources returned by the $hddt-cgm-summary operation." />
      <fixedCode value="collection" />
    </element>
    <element id="Bundle.entry">
      <path value="Bundle.entry" />
      <min value="1" />
    </element>
    <element id="Bundle.entry.resource">
      <path value="Bundle.entry.resource" />
      <short value="Observations with their related Device and DeviceMetric information" />
      <type>
        <code value="Observation" />
        <profile value="http://hl7.org/fhir/uv/cgm/StructureDefinition/cgm-summary" />
        <profile value="http://hl7.org/fhir/uv/cgm/StructureDefinition/cgm-summary-mean-glucose-mass-per-volume" />
        <profile value="http://hl7.org/fhir/uv/cgm/StructureDefinition/cgm-summary-mean-glucose-moles-per-volume" />
        <profile value="http://hl7.org/fhir/uv/cgm/StructureDefinition/cgm-summary-times-in-ranges" />
        <profile value="http://hl7.org/fhir/uv/cgm/StructureDefinition/cgm-summary-gmi" />
        <profile value="http://hl7.org/fhir/uv/cgm/StructureDefinition/cgm-summary-coefficient-of-variation" />
        <profile value="http://hl7.org/fhir/uv/cgm/StructureDefinition/cgm-summary-days-of-wear" />
        <profile value="http://hl7.org/fhir/uv/cgm/StructureDefinition/cgm-summary-sensor-active-percentage" />
      </type>
      <type>
        <code value="Device" />
        <profile value="https://gematik.de/fhir/hddt/StructureDefinition/hddt-personal-health-device" />
      </type>
    </element>
  </differential>
</StructureDefinition>