<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="fiphr-sd-bloodglucose-stu3" />
  <meta>
    <versionId value="1" />
    <lastUpdated value="2019-01-23T09:22:17.491+00:00" />
  </meta>
  <url value="http://phr.kanta.fi/StructureDefinition/fiphr-bloodglucose-stu3-201909" />
  <version value="0.3" />
  <name value="fiphr-sd-bloodglucose-stu3" />
  <title value="Finnish PHR Blood Glucose profile" />
  <status value="draft" />
  <date value="2019-09-05" />
  <publisher value="Kela" />
  <description value="Finnish PHR profile for blood glucose measurement." />
  <purpose value="Finnish PHR profile for Observation used in blood glucose measurements. The profile is based on the Finnish PHR observation profile." />
  <fhirVersion value="3.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Observation" />
  <baseDefinition value="fiphr-vitalsigns-stu3-201909" />
  <derivation value="constraint" />
  <differential>
    <element id="Observation">
      <path value="Observation" />
      <short value="Finnish PHR Blood Glucose profile" />
      <definition value="Finnish PHR profile for Observation used in blood glucose measurements. The profile is based on the Finnish PHR observation profile." />
    </element>
    <element id="Observation.meta.profile">
      <path value="Observation.meta.profile" />
      <fixedUri value="http://phr.kanta.fi/StructureDefinition/fiphr-bloodglucose-stu3" />
    </element>
    <element id="Observation.extension">
      <path value="Observation.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Observation.extension:hoursAfterMeal">
      <path value="Observation.extension" />
      <sliceName value="hoursAfterMeal" />
      <label value="hoursAfterMeal" />
      <short value="Meal context" />
      <definition value="Meal context, how many hours after meal measurement is done." />
      <requirements value="Meal context needed for result interpretation." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://phr.kanta.fi/StructureDefinition/fiphr-unsignedint" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.code.coding">
      <path value="Observation.code.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="code" />
        </discriminator>
        <rules value="closed" />
      </slicing>
    </element>
    <element id="Observation.code.coding.code">
      <path value="Observation.code.coding.code" />
      <short value="Code of body Blood Glucose in Loinc" />
      <comment value="." />
    </element>
    <element id="Observation.code.coding:GlucoseInBlood">
      <path value="Observation.code.coding" />
      <sliceName value="GlucoseInBlood" />
      <short value="Code to be used with home glucometer readings" />
      <definition value="This code SHALL be used with home glucometer readings." />
      <comment value="This code SHALL be used with home glucometer readings. Ordering of codings is undefined and SHALL NOT be used to infer meaning." />
      <max value="1" />
    </element>
    <element id="Observation.code.coding:GlucoseInBlood.code">
      <path value="Observation.code.coding.code" />
      <fixedCode value="15074-8" />
    </element>
    <element id="Observation.code.coding:GlucoseInCapillaryBloodByGlucometer">
      <path value="Observation.code.coding" />
      <sliceName value="GlucoseInCapillaryBloodByGlucometer" />
      <short value="Code to be used with home glucometer readings" />
      <definition value="This code SHALL be used with home glucometer readings." />
      <comment value="This code SHALL be used with home glucometer readings. Ordering of codings is undefined and SHALL NOT be used to infer meaning." />
      <max value="1" />
    </element>
    <element id="Observation.code.coding:GlucoseInCapillaryBloodByGlucometer.code">
      <path value="Observation.code.coding.code" />
      <fixedCode value="14743-9" />
    </element>
    <element id="Observation.code.coding:GlucoseInBodyFluid">
      <path value="Observation.code.coding" />
      <sliceName value="GlucoseInBodyFluid" />
      <short value="Code to be used with CGM readings" />
      <definition value="This code SHALL be used with CGM readings." />
      <comment value="This code SHALL be used with CGM readings. Ordering of codings is undefined and SHALL NOT be used to infer meaning." />
      <max value="1" />
    </element>
    <element id="Observation.code.coding:GlucoseInBodyFluid.code">
      <path value="Observation.code.coding.code" />
      <fixedCode value="14745-4" />
    </element>
    <element id="Observation.context">
      <path value="Observation.context" />
      <definition value="The healthcare event  (e.g. a patient and healthcare provider interaction) during which this observation is made ." />
    </element>
    <element id="Observation.value[x]:valueQuantity">
      <path value="Observation.valueQuantity" />
      <sliceName value="valueQuantity" />
      <short value="FinnishPHR: Glucose in blood" />
      <definition value="FinnishPHR: Glucose in blood" />
      <comment value="." />
      <requirements value="." />
      <type>
        <code value="Quantity" />
      </type>
    </element>
    <element id="Observation.value[x]:valueQuantity.extension">
      <path value="Observation.valueQuantity.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Observation.value[x]:valueQuantity.extension:alternativeQuantity">
      <path value="Observation.valueQuantity.extension" />
      <sliceName value="alternativeQuantity" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://phr.kanta.fi/StructureDefinition/fiphr-ext-pq-translation" />
      </type>
    </element>
    <element id="Observation.value[x]:valueQuantity.extension:alternativeQuantity.valueQuantity:valueQuantity.unit">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="Observation.valueQuantity.extension.valueQuantity.unit" />
      <fixedString value="mg/dl" />
    </element>
    <element id="Observation.value[x]:valueQuantity.extension:alternativeQuantity.valueQuantity:valueQuantity.system">
      <path value="Observation.valueQuantity.extension.valueQuantity.system" />
      <fixedUri value="http://unitsofmeasure.org" />
    </element>
    <element id="Observation.value[x]:valueQuantity.extension:alternativeQuantity.valueQuantity:valueQuantity.code">
      <path value="Observation.valueQuantity.extension.valueQuantity.code" />
      <fixedCode value="mg/dL" />
    </element>
    <element id="Observation.value[x]:valueQuantity.value">
      <path value="Observation.valueQuantity.value" />
      <min value="1" />
    </element>
    <element id="Observation.value[x]:valueQuantity.unit">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="Observation.valueQuantity.unit" />
      <short value="Finnish PHR: The unit presentation of the measured glucose in blood" />
      <definition value="Finnish PHR: A human-readable form of the unit.presentation of the measured  glucose in blood." />
      <comment value="Note that FHIR strings may not exceed 1MB in size." />
      <requirements value="Unit is mandatory in FinnishPHR vital-signs Observations" />
      <min value="1" />
      <fixedString value="mmol/l" />
    </element>
    <element id="Observation.value[x]:valueQuantity.system">
      <path value="Observation.valueQuantity.system" />
      <min value="1" />
      <fixedUri value="http://unitsofmeasure.org" />
    </element>
    <element id="Observation.value[x]:valueQuantity.code">
      <path value="Observation.valueQuantity.code" />
      <min value="1" />
      <fixedCode value="mmol/L" />
    </element>
    <element id="Observation.dataAbsentReason">
      <path value="Observation.dataAbsentReason" />
      <definition value="Provides a reason why the expected value in the element Observation.value[x] is missing. &#xD;&#xA;Finnish PHR: Codes 'astext' and 'error' are allowed, no other codes." />
      <comment value="Finnish PHR: Code 'error' SHALL be used when a device has been actively trying to measure the blood glucose but has failed for some reason. Code 'astext' SHALL be used when the measured value cannot be stored using the valueQuantity structure (with the comparator). In this case, the value SHALL be presented in the resource narrative. No other codes are allowed." />
    </element>
    <element id="Observation.dataAbsentReason.coding">
      <path value="Observation.dataAbsentReason.coding" />
      <min value="1" />
    </element>
    <element id="Observation.dataAbsentReason.coding.code">
      <path value="Observation.dataAbsentReason.coding.code" />
      <comment value="Note that FHIR strings may not exceed 1MB in size. &#xD;&#xA;Finnish PHR: Code 'error' SHALL be used when a device has been actively trying to measure the blood glucose but has failed for some reason. Code 'astext' SHALL be used when the measured value cannot be stored using the valueQuantity structure (with the comparator). In this case, the value SHALL be presented in the resource narrative. No other codes are allowed." />
    </element>
    <element id="Observation.dataAbsentReason.text">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="Observation.dataAbsentReason.text" />
      <max value="0" />
    </element>
    <element id="Observation.component">
      <path value="Observation.component" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>