{
  "resourceType": "StructureDefinition",
  "id": "hddt-blood-glucose-measurement",
  "url": "https://gematik.de/fhir/hddt/StructureDefinition/hddt-blood-glucose-measurement",
  "version": "1.0.1",
  "name": "HddtBloodGlucoseMeasurement",
  "title": "Observation – Blood Glucose Measurement",
  "status": "active",
  "date": "2026-04-29",
  "publisher": "gematik GmbH",
  "description": "Profile for capturing blood glucose measurements as FHIR Observation resources.\n\nThis profile defines the exchange of a single measurement data for the Mandatory Interoperable Value (MIV) \\\"Blood Glucose Measurement\\\" which is technically defined \nby the ValueSet _hddt-miv-blood-glucose-measurement_. This MIV is e.g. implemented by blood glucose meter (glucometer) that can connect to \na Personal Health Gateway (e.g. a mobile app for keeping diabetes diary) through wireless or wired communication.\n\n**Obligations and Conventions:**\n\nEach Blood Glucose Measurement MUST either hold a reference to a _Sensor Type And Calibration Status_ [DeviceMetric](https://hl7.org/fhir/R4/devicemetric.html) resource or to a \n_Personal Health Device_ [Device](https://hl7.org/fhir/R4/device.html) resource (eXclusive OR). A reference to _Sensor Type And Calibration Status_ MUST be provided \nfrom the Observation resource if the sensor for measuring blood glucose needs to be calibrated (either automatically or by the user) \nor if the sensor may change its calibration status over time. \n\n**Constraints applied:**  \n- `code` is constrained to the ValueSet that represents the MIV _Blood Glucose Measurement_\n- `effective[x]` is restricted to `effectiveDateTime` and constrained as mandatory.\n- `value[x]` is restricted to `valueQuantity`. The elements `valueQuantity.value`, `valueQuantity.system`, and `valueQuantity.code` are constrained in a way that a value MUST be provided and that UCUM MUST be used for encoding the unit of measurement. `Observation.valueQuantity` MAY only be omitted in case of an error that accured with the measurement. In this case, `Observation.dataAbsentReason` MUST be provided.\n- `device` is set to be mandatory in order to provide the DiGA with information about the sensor's calibration status and with information about the static and dynamic attributes of the Personal Health Device.",
  "copyright": "Copyright (c) 2026 gematik GmbH",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "short": "Measurement type of blood glucose",
        "binding": {
          "strength": "required",
          "valueSet": "https://gematik.de/fhir/hddt/ValueSet/hddt-miv-blood-glucose-measurement",
          "description": "Specifies the type of measurement using codes from the ValueSet for blood glucose measurements."
        }
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "short": "Time of measurement",
        "definition": "The time or period when the blood glucose measurement was taken.",
        "min": 1,
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Observation.value[x]",
        "path": "Observation.value[x]",
        "short": "Measured blood glucose value",
        "definition": "The quantitative blood glucose value, measured either in mass/volume (mg/dL) or moles/volume (mmol/L), represented as a UCUM Quantity.",
        "type": [
          {
            "code": "Quantity"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.value[x].value",
        "path": "Observation.value[x].value",
        "min": 1
      },
      {
        "id": "Observation.value[x].system",
        "path": "Observation.value[x].system",
        "min": 1,
        "fixedUri": "http://unitsofmeasure.org"
      },
      {
        "id": "Observation.value[x].code",
        "path": "Observation.value[x].code",
        "definition": "The UCUM code representing the unit of the blood glucose measurement. The UCUM code MUST be compliant with the example unit that is linked with the LOINC code given as `Observation.code`.",
        "min": 1,
        "binding": {
          "strength": "required",
          "valueSet": "http://hl7.org/fhir/ValueSet/ucum-units",
          "description": "Defines the unit of measurement using codes from the UCUM units ValueSet. The UCUM code MUST be compliant with the unit that is linked with the LOINC code given as `Observation.code`."
        }
      },
      {
        "id": "Observation.device",
        "path": "Observation.device",
        "short": "Reference to personal health device or its sensor type and calibration status",
        "definition": "References a DeviceMetric resource that describes the sensor type and calibration status of the personal health device or reference to the Device resource that describes the personal health device itself.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://gematik.de/fhir/hddt/StructureDefinition/hddt-personal-health-device",
              "https://gematik.de/fhir/hddt/StructureDefinition/hddt-sensor-type-and-calibration-status"
            ]
          }
        ]
      }
    ]
  }
}