{
  "resourceType": "StructureDefinition",
  "id": "dexcom-egvs",
  "url": "http://nictiz.nl/fhir/StructureDefinition/vitalsign-bloodglucose",
  "version": "1.0",
  "name": "EGVS",
  "title": "EGVS",
  "status": "active",
  "publisher": "Nictiz",
  "contact": [
    {
      "name": "Anay",
      "telecom": [
        {
          "system": "email",
          "value": "info@nictiz.nl",
          "use": "work"
        }
      ]
    }
  ],
  "description": "This profile represents a single blood glucose self measurement based on the seven-point scale (SMBG).",
  "copyright": "CC0",
  "fhirVersion": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://nictiz.nl/fhir/StructureDefinition/zib-LaboratoryTestResult-Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation",
        "path": "Observation"
      },
      {
        "id": "Observation.extension",
        "path": "Observation.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "constraint": [
          {
            "key": "bg-1",
            "severity": "error",
            "human": "Observation.code SHALL have at least one coding based on LOINC",
            "expression": "coding.where(system = 'http://loinc.org').exists()",
            "xpath": "f:coding[f:system/@value = 'http://loinc.org']"
          }
        ]
      },
      {
        "id": "Observation.code.coding",
        "path": "Observation.code.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "code"
            },
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Observation.component:egvs",
        "path": "Observation.component",
        "sliceName": "egvs",
        "definition": "array of egv values"
      },
      {
        "id": "Observation.component.egvs.trend:trend",
        "path": "Observation.component.egvs",
        "sliceName": "trend",
        "definition": "Shows the trend of glucose values",
        "max": "1",
        "type": [
          {
            "code": "BackboneElement"
          }
        ]
      },
      {
        "id": "Observation.component.egvs.component:systemTime",
        "path": "Observation.component.egvs",
        "sliceName": "systemTime",
        "definition": "Shows the system time and date",
        "max": "1",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Observation.component.egvs.component:displayTime",
        "path": "Observation.component.egvs",
        "sliceName": "displayTime",
        "definition": "Shows list of egvs",
        "max": "1",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Observation.component.egvs.component:realtimeVlaue",
        "path": "Observation.component.egvs",
        "sliceName": "realtimeVlaue",
        "definition": "Shows the system time and date",
        "max": "1",
        "type": [
          {
            "code": "Quantity"
          }
        ]
      },
      {
        "id": "Observation.component.egvs.status:status",
        "path": "Observation.component.egvs",
        "sliceName": "readingstatus",
        "definition": "status of the current reading",
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ]
      },
      {
        "id": "Observation.component.egvs.component:smoothedValue",
        "path": "Observation.component.egvs",
        "sliceName": "smoothedValue",
        "definition": "Estimated glucose value presented retrospectively on receiving device after smoothing; G6 devices only",
        "max": "1",
        "type": [
          {
            "code": "Quantity"
          }
        ]
      },
      {
        "id": "Observation.component.egvs.component:trendRate",
        "path": "Observation.component.egvs",
        "sliceName": "trendRate",
        "definition": "Rate at which glucose value is moving up or down",
        "max": "1",
        "type": [
          {
            "code": "Quantity"
          }
        ]
      }
    ]
  }
}