{
  "resourceType": "StructureDefinition",
  "meta": {
    "lastUpdated": "2016-12-09T11:11:57.872+00:00"
  },
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\" />"
  },
  "url": "https://www.livingitup.scot/FhirProfile/ActivityLog",
  "version": "0.1",
  "name": "ActivityLog",
  "status": "draft",
  "date": "2016-12-08T10:32:14+00:00",
  "publisher": "NHS24",
  "description": "Base StructureDefinition for an LiU ActivityLog",
  "kind": "resource",
  "abstract": false,
  "differential": {
    "element": [
      {
        "path": "Observation"
      },
      {
        "path": "Observation.identifier",
        "max": "0"
      },
      {
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint",
            "valueString": "default: final"
          }
        ],
        "path": "Observation.status",
        "fixedCode": "final"
      },
      {
        "path": "Observation.category",
        "definition": "Fixed entry from Liu coding scheme for liu-activitylog",
        "min": 1,
        "binding": {
          "strength": "example",
          "valueSetUri": "http://hl7.org/fhir/ValueSet/observation-category"
        }
      },
      {
        "path": "Observation.category.coding",
        "definition": "Fixed entry from Liu coding scheme for liu-activitylog",
        "min": 1,
        "max": "1"
      },
      {
        "path": "Observation.category.coding.system",
        "fixedUri": "http://livingitup.scot/coding"
      },
      {
        "path": "Observation.category.coding.version",
        "max": "0"
      },
      {
        "path": "Observation.category.coding.code",
        "fixedCode": "liu-activitylog"
      },
      {
        "path": "Observation.category.coding.display",
        "max": "0"
      },
      {
        "path": "Observation.category.coding.userSelected",
        "max": "0"
      },
      {
        "path": "Observation.category.text",
        "max": "0"
      },
      {
        "path": "Observation.code"
      },
      {
        "path": "Observation.code.coding.system",
        "definition": "Fixed entry for Liu coding",
        "fixedUri": "http://livingitup.scot/coding"
      },
      {
        "path": "Observation.code.coding.version",
        "max": "0"
      },
      {
        "path": "Observation.code.coding.code",
        "short": "type of activity (eg liu-activity-walking)",
        "definition": "From Liu coding scheme for the type of activity (eg liu-activity-walking)",
        "min": 1
      },
      {
        "path": "Observation.code.coding.display",
        "max": "0"
      },
      {
        "path": "Observation.code.coding.userSelected",
        "max": "0"
      },
      {
        "path": "Observation.code.text",
        "max": "0"
      },
      {
        "path": "Observation.subject",
        "definition": "The Patient resource which identifies the citizen",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "profile": "http://hl7.org/fhir/StructureDefinition/Patient"
          }
        ]
      },
      {
        "path": "Observation.encounter",
        "type": [
          {
            "code": "Reference",
            "profile": "https://www.livingitup.scot/FhirProfile/CommunityChallenge",
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "path": "Observation.encounter.reference",
        "short": "Internal reference to inline Encounter",
        "definition": "Optional - only use if the entry is assigned to a Community Challenge.\r\nThe 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.)\r\n\r\n.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\r\n\r\nInternal fragment references (must start with '#') refer to contained resources."
      },
      {
        "path": "Observation.encounter.display",
        "max": "0"
      },
      {
        "path": "Observation.effectiveDateTime",
        "short": "DateTime that the user gave to the log entry",
        "definition": "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": "dateTime"
          }
        ]
      },
      {
        "path": "Observation.issued",
        "max": "0"
      },
      {
        "path": "Observation.performer",
        "max": "0"
      },
      {
        "path": "Observation.value[x]",
        "max": "0"
      },
      {
        "path": "Observation.dataAbsentReason",
        "max": "0"
      },
      {
        "path": "Observation.interpretation",
        "max": "0"
      },
      {
        "path": "Observation.comments",
        "short": "Any free text that the user added to the entry",
        "definition": "Any free text that the user added to the entry"
      },
      {
        "path": "Observation.bodySite",
        "max": "0"
      },
      {
        "path": "Observation.method",
        "max": "0"
      },
      {
        "path": "Observation.specimen",
        "max": "0"
      },
      {
        "path": "Observation.device",
        "definition": "The device that was used to make the observation (eg the iOS app)."
      },
      {
        "path": "Observation.referenceRange",
        "max": "0"
      },
      {
        "path": "Observation.related",
        "max": "0"
      },
      {
        "path": "Observation.component",
        "definition": "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. \r\n.code is filled in from the Liu coding scheme to reflect the type of measurement (eg liu-activitycomponent-steps). \r\nFor 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:\r\nTime (a positive integer, .unit: ‘minutes’)\r\nDistance (a positive number with potential decimals, .unit: ‘miles’)\r\nSteps (a positive integer, .unit: ‘steps’)",
        "max": "3"
      },
      {
        "path": "Observation.component.code",
        "definition": ""
      },
      {
        "path": "Observation.component.code.coding",
        "definition": ".code is filled in from the Liu coding scheme to reflect the type of measurement (eg liu-activitycomponent-steps). \r\nFor 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:\r\nTime (a positive integer, .unit: ‘minutes’)\r\nDistance (a positive number with potential decimals, .unit: ‘miles’)\r\nSteps (a positive integer, .unit: ‘steps’)",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required",
          "valueSetUri": "Http://livingitup.scot/coding"
        }
      },
      {
        "path": "Observation.component.code.coding.version",
        "max": "0"
      },
      {
        "path": "Observation.component.code.coding.display",
        "max": "0"
      },
      {
        "path": "Observation.component.code.coding.userSelected",
        "max": "0"
      },
      {
        "path": "Observation.component.code.text",
        "max": "0"
      },
      {
        "path": "Observation.component.valueQuantity",
        "type": [
          {
            "code": "Quantity"
          }
        ],
        "binding": {
          "strength": "required",
          "valueSetUri": "http://livingitup.scot/coding"
        }
      },
      {
        "path": "Observation.component.dataAbsentReason",
        "max": "0"
      },
      {
        "path": "Observation.component.referenceRange",
        "max": "0"
      }
    ]
  }
}