<StructureDefinition xmlns="http://hl7.org/fhir">
  <meta>
    <lastUpdated value="2016-12-09T11:11:57.872+00:00" />
  </meta>
  <text>
    <status value="generated" />
    <div xmlns="http://www.w3.org/1999/xhtml" />
  </text>
  <url value="https://www.livingitup.scot/FhirProfile/ActivityLog" />
  <version value="0.1" />
  <name value="ActivityLog" />
  <status value="draft" />
  <publisher value="NHS24" />
  <date value="2016-12-08T10:32:14+00:00" />
  <description value="Base StructureDefinition for an LiU ActivityLog" />
  <requirements value="ActivityLog is a type of Observation which records physical activity undertaken by a citizen" />
  <kind value="resource" />
  <constrainedType value="Observation" />
  <abstract value="false" />
  <base value="http://hl7.org/fhir/StructureDefinition/Observation" />
  <differential>
    <element>
      <path value="Observation" />
    </element>
    <element>
      <path value="Observation.identifier" />
      <max value="0" />
    </element>
    <element>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint">
        <valueString value="default: final" />
      </extension>
      <path value="Observation.status" />
      <fixedCode value="final" />
    </element>
    <element>
      <path value="Observation.category" />
      <definition value="Fixed entry from Liu coding scheme for liu-activitylog" />
      <min value="1" />
      <binding>
        <strength value="example" />
        <valueSetUri value="http://hl7.org/fhir/ValueSet/observation-category" />
      </binding>
    </element>
    <element>
      <path value="Observation.category.coding" />
      <definition value="Fixed entry from Liu coding scheme for liu-activitylog" />
      <min value="1" />
      <max value="1" />
    </element>
    <element>
      <path value="Observation.category.coding.system" />
      <fixedUri value="http://livingitup.scot/coding" />
    </element>
    <element>
      <path value="Observation.category.coding.version" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.category.coding.code" />
      <fixedCode value="liu-activitylog" />
    </element>
    <element>
      <path value="Observation.category.coding.display" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.category.coding.userSelected" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.category.text" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.code" />
      <comments value="From Liu coding scheme for the type of activity (eg liu-activity-walking)" />
    </element>
    <element>
      <path value="Observation.code.coding.system" />
      <definition value="Fixed entry for Liu coding " />
      <fixedUri value="http://livingitup.scot/coding" />
    </element>
    <element>
      <path value="Observation.code.coding.version" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.code.coding.code" />
      <short value="type of activity (eg liu-activity-walking)" />
      <definition value="From Liu coding scheme for the type of activity (eg liu-activity-walking)" />
      <min value="1" />
    </element>
    <element>
      <path value="Observation.code.coding.display" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.code.coding.userSelected" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.code.text" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.subject" />
      <definition value="The Patient resource which identifies the citizen" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
    </element>
    <element>
      <path value="Observation.encounter" />
      <type>
        <code value="Reference" />
        <profile value="https://www.livingitup.scot/FhirProfile/CommunityChallenge" />
        <aggregation value="contained" />
      </type>
    </element>
    <element>
      <path value="Observation.encounter.reference" />
      <short value="Internal reference to inline Encounter" />
      <definition value="Optional - only use if the entry is assigned to a Community Challenge.&#xD;&#xA;The Community Challenge is represented as an inline Encounter (That means the encounter data is written into the Observation record itself. The encounter has no independent existence on the server.)&#xD;&#xA;&#xD;&#xA;.identifier is used to hold the unique identifier code that the portal posts on its public API for Community Challenges and the code for liu-communitychallenge&#xD;&#xA;&#xD;&#xA;Internal fragment references (must start with '#') refer to contained resources." />
    </element>
    <element>
      <path value="Observation.encounter.display" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.effectiveDateTime" />
      <short value="DateTime that the user gave to the log entry" />
      <definition value="DateTime that the user gave to the log entry (This can be different from when the entry was stored in the PHF. The latter is reflected in .meta.lastUpdated. A user may enter log entries retrospectively. Some clients may also buffer observations before they are written to the log.)" />
      <type>
        <code value="dateTime" />
      </type>
    </element>
    <element>
      <path value="Observation.issued" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.performer" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.value[x]" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.dataAbsentReason" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.interpretation" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.comments" />
      <short value="Any free text that the user added to the entry" />
      <definition value="Any free text that the user added to the entry" />
    </element>
    <element>
      <path value="Observation.bodySite" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.method" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.specimen" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.device" />
      <definition value="The device that was used to make the observation (eg the iOS app)." />
    </element>
    <element>
      <path value="Observation.referenceRange" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.related" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.component" />
      <definition value="Up to three values that the user supplied for the log entry. An activity log entry can be a combination of Time, Distance and Steps. Only add a component if the user supplied it. &#xD;&#xA;.code is filled in from the Liu coding scheme to reflect the type of measurement (eg liu-activitycomponent-steps). &#xD;&#xA;For the measurement itself use .valueQuantity, fill in .value with the number, use fixed value for .unit as follows and depending on what the quantity represents:&#xD;&#xA;Time (a positive integer, .unit: ‘minutes’)&#xD;&#xA;Distance (a positive number with potential decimals, .unit: ‘miles’)&#xD;&#xA;Steps (a positive integer, .unit: ‘steps’)&#xD;&#xA;" />
      <max value="3" />
    </element>
    <element>
      <path value="Observation.component.code" />
      <definition value="&#xD;&#xA;" />
    </element>
    <element>
      <path value="Observation.component.code.coding" />
      <definition value=".code is filled in from the Liu coding scheme to reflect the type of measurement (eg liu-activitycomponent-steps). &#xD;&#xA;For the measurement itself use .valueQuantity, fill in .value with the number, use fixed value for .unit as follows and depending on what the quantity represents:&#xD;&#xA;Time (a positive integer, .unit: ‘minutes’)&#xD;&#xA;Distance (a positive number with potential decimals, .unit: ‘miles’)&#xD;&#xA;Steps (a positive integer, .unit: ‘steps’)" />
      <min value="1" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <valueSetUri value="Http://livingitup.scot/coding " />
      </binding>
    </element>
    <element>
      <path value="Observation.component.code.coding.version" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.component.code.coding.display" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.component.code.coding.userSelected" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.component.code.text" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.component.valueQuantity" />
      <comments value="Use fixed value for .unit as follows and depending on what the quantity represents:&#xD;&#xA;Time (a positive integer, .unit: ‘minutes’)&#xD;&#xA;Distance (a positive number with potential decimals, .unit: ‘miles’)&#xD;&#xA;Steps (a positive integer, .unit: ‘steps’)&#xD;&#xA;" />
      <type>
        <code value="Quantity" />
      </type>
      <binding>
        <strength value="required" />
        <valueSetUri value="http://livingitup.scot/coding " />
      </binding>
    </element>
    <element>
      <path value="Observation.component.dataAbsentReason" />
      <max value="0" />
    </element>
    <element>
      <path value="Observation.component.referenceRange" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>