{
  "resourceType": "StructureDefinition",
  "id": "Interweave-Observation",
  "url": "https://fhir.yhcr.nhs.uk/StructureDefinition/Interweave-Observation",
  "version": "0.1.0",
  "name": "InterweaveObservation",
  "status": "active",
  "date": "2024-02-19T09:37:00+00:00",
  "publisher": "Interweave Publisher",
  "contact": [
    {
      "name": "Interweave Publisher",
      "telecom": [
        {
          "system": "url",
          "value": "https://fhir.yhcr.nhs.uk/yhcr-publisher"
        }
      ]
    }
  ],
  "description": "Interweave Observation resource profile.",
  "fhirVersion": "3.0.2",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "sct-concept",
      "uri": "http://snomed.info/conceptdomain",
      "name": "SNOMED CT Concept Domain Binding"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "sct-attr",
      "uri": "http://snomed.org/attributebinding",
      "name": "SNOMED CT Attribute Binding"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/w5",
      "name": "W5 Mapping"
    },
    {
      "identity": "sct-attr",
      "uri": "http://snomed.info/sct",
      "name": "SNOMED CT Attribute Binding"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Observation-1",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation",
        "path": "Observation",
        "constraint": [
          {
            "key": "valint-1",
            "severity": "error",
            "human": "Cannot have both valueInteger and value[x]",
            "expression": "valueInteger.exists() != value.exists()"
          }
        ]
      },
      {
        "id": "Observation.id",
        "path": "Observation.id",
        "mustSupport": true
      },
      {
        "id": "Observation.meta",
        "path": "Observation.meta"
      },
      {
        "id": "Observation.meta.versionId",
        "path": "Observation.meta.versionId",
        "mustSupport": true
      },
      {
        "id": "Observation.meta.lastUpdated",
        "path": "Observation.meta.lastUpdated",
        "short": "MANDATORY except in Contained Resources. When the resource version last changed.",
        "mustSupport": true
      },
      {
        "id": "Observation.meta.profile",
        "path": "Observation.meta.profile",
        "short": "Profiles this resource claims to conform to. Should list (i) this profile (ii) underlying CareConnect profile",
        "mustSupport": true
      },
      {
        "id": "Observation.meta.security",
        "path": "Observation.meta.security",
        "short": "DISCOURAGED - may not be honoured by Data Consumers"
      },
      {
        "id": "Observation.meta.tag",
        "path": "Observation.meta.tag",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Observation.meta.tag:Source",
        "path": "Observation.meta.tag",
        "sliceName": "Source",
        "short": "MANDATORY except in Contained Resources. The Data Provider Id (and display text) of the system supplying the data",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.meta.tag:Source.system",
        "path": "Observation.meta.tag.system",
        "min": 1,
        "fixedUri": "https://yhcr.nhs.uk/Source"
      },
      {
        "id": "Observation.meta.tag:Source.code",
        "path": "Observation.meta.tag.code",
        "short": "The Data Provider Id of the system supplying the data",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Observation.meta.tag:Source.display",
        "path": "Observation.meta.tag.display",
        "short": "Name of the system supplying the data",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Observation.meta.tag:Provenance",
        "path": "Observation.meta.tag",
        "sliceName": "Provenance",
        "short": "MANDATORY except in Contained Resources. The ODS Code (and display text) of the organisation responsible for the data",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.meta.tag:Provenance.system",
        "path": "Observation.meta.tag.system",
        "min": 1,
        "fixedUri": "https://yhcr.nhs.uk/Provenance"
      },
      {
        "id": "Observation.meta.tag:Provenance.code",
        "path": "Observation.meta.tag.code",
        "short": "The ODS Code of the organisation responsible for the data",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Observation.meta.tag:Provenance.display",
        "path": "Observation.meta.tag.display",
        "short": "Name of the organisation supplying the data",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Observation.implicitRules",
        "path": "Observation.implicitRules",
        "short": "DISCOURAGED - may not be honoured by Data Consumers"
      },
      {
        "id": "Observation.language",
        "path": "Observation.language",
        "short": "English is assumed (not currently a multi-lingual implementation)"
      },
      {
        "id": "Observation.text",
        "path": "Observation.text",
        "short": "DISCOURAGED - the preferred approach is to offer structured data fields which a Data Consumer can then render and present in a manner most suited to its users"
      },
      {
        "id": "Observation.extension",
        "path": "Observation.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Observation.extension:valuePrecision",
        "path": "Observation.extension",
        "sliceName": "valuePrecision",
        "short": "Explicit precision of the number",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "https://fhir.yhcr.nhs.uk/StructureDefinition/Extension-Interweave-ValuePrecision"
          }
        ]
      },
      {
        "id": "Observation.extension:valueInteger",
        "path": "Observation.extension",
        "sliceName": "valueInteger",
        "short": "Inline with R4, we have pre-adopted the valueInteger field.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "https://fhir.yhcr.nhs.uk/StructureDefinition/Extension-Interweave-R4ValueInteger"
          }
        ]
      },
      {
        "id": "Observation.identifier",
        "path": "Observation.identifier",
        "mustSupport": true
      },
      {
        "id": "Observation.basedOn",
        "path": "Observation.basedOn",
        "short": "DISCOURAGED - This field does not appear to provide information which would be beneficial in a shared care record. It also allows references to a raft of request/order resources which introduces a lot of complexity for a data consumer."
      },
      {
        "id": "Observation.status",
        "path": "Observation.status",
        "short": "Only finalised observations should be shared. We do also allow for amendments and corrections to the final observation to take place. We therefore limit the list of statuses which can be used to the following - final | amended | corrected",
        "mustSupport": true
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "coding.system"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Observation.category:observationCategory",
        "path": "Observation.category",
        "sliceName": "observationCategory",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required"
        }
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "mustSupport": true,
        "binding": {
          "strength": "preferred",
          "valueSetReference": {
            "reference": "https://fhir.hl7.org.uk/STU3/ValueSet/CareConnect-ObservationType-1"
          }
        }
      },
      {
        "id": "Observation.code.coding.system",
        "path": "Observation.code.coding.system",
        "min": 1
      },
      {
        "id": "Observation.code.coding.code",
        "path": "Observation.code.coding.code",
        "min": 1
      },
      {
        "id": "Observation.code.coding.display",
        "path": "Observation.code.coding.display",
        "min": 1
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "short": "The patient whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Patient-1"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.subject.reference",
        "path": "Observation.subject.reference",
        "short": "Reference to a resource (could be Contained)",
        "min": 1
      },
      {
        "id": "Observation.subject.identifier",
        "path": "Observation.subject.identifier",
        "short": "If relevant could include an id"
      },
      {
        "id": "Observation.subject.display",
        "path": "Observation.subject.display",
        "short": "Description of the referenced resource",
        "min": 1
      },
      {
        "id": "Observation.context",
        "path": "Observation.context",
        "short": "The encounter during which this observation is made.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Encounter-1"
          }
        ]
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "short": "This is the time/time period during which the observation was taken.",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Observation.issued",
        "path": "Observation.issued",
        "max": "0"
      },
      {
        "id": "Observation.performer",
        "path": "Observation.performer",
        "short": "Who is responsible for the observation.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Practitioner-1"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.performer.reference",
        "path": "Observation.performer.reference",
        "short": "Reference to a resource (could be Contained)",
        "min": 1
      },
      {
        "id": "Observation.performer.identifier",
        "path": "Observation.performer.identifier",
        "short": "If relevant could include an id"
      },
      {
        "id": "Observation.performer.display",
        "path": "Observation.performer.display",
        "short": "Description of the referenced resource",
        "min": 1
      },
      {
        "id": "Observation.value[x]",
        "path": "Observation.value[x]",
        "type": [
          {
            "code": "Quantity"
          },
          {
            "code": "CodeableConcept"
          },
          {
            "code": "string"
          },
          {
            "code": "boolean"
          },
          {
            "code": "Range"
          },
          {
            "code": "Ratio"
          },
          {
            "code": "SampledData"
          },
          {
            "code": "time"
          },
          {
            "code": "dateTime"
          },
          {
            "code": "Period"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.dataAbsentReason",
        "path": "Observation.dataAbsentReason",
        "mustSupport": true,
        "binding": {
          "strength": "required"
        }
      },
      {
        "id": "Observation.dataAbsentReason.coding.system",
        "path": "Observation.dataAbsentReason.coding.system",
        "min": 1
      },
      {
        "id": "Observation.dataAbsentReason.coding.code",
        "path": "Observation.dataAbsentReason.coding.code",
        "min": 1
      },
      {
        "id": "Observation.dataAbsentReason.coding.display",
        "path": "Observation.dataAbsentReason.coding.display",
        "min": 1
      },
      {
        "id": "Observation.interpretation",
        "path": "Observation.interpretation",
        "mustSupport": true,
        "binding": {
          "strength": "required"
        }
      },
      {
        "id": "Observation.comment",
        "path": "Observation.comment",
        "short": "Comments about the result",
        "mustSupport": true
      },
      {
        "id": "Observation.bodySite",
        "path": "Observation.bodySite",
        "mustSupport": true,
        "binding": {
          "strength": "required"
        }
      },
      {
        "id": "Observation.method",
        "path": "Observation.method",
        "binding": {
          "strength": "preferred"
        }
      },
      {
        "id": "Observation.method.coding.system",
        "path": "Observation.method.coding.system",
        "min": 1
      },
      {
        "id": "Observation.method.coding.code",
        "path": "Observation.method.coding.code",
        "min": 1
      },
      {
        "id": "Observation.method.coding.display",
        "path": "Observation.method.coding.display",
        "min": 1
      },
      {
        "id": "Observation.specimen",
        "path": "Observation.specimen",
        "short": "Specimen used for this observation."
      },
      {
        "id": "Observation.specimen.reference",
        "path": "Observation.specimen.reference",
        "short": "Reference to a resource (could be Contained)",
        "min": 1
      },
      {
        "id": "Observation.specimen.identifier",
        "path": "Observation.specimen.identifier",
        "short": "If relevant could include an id"
      },
      {
        "id": "Observation.specimen.display",
        "path": "Observation.specimen.display",
        "short": "If relevant, description of the referenced resource"
      },
      {
        "id": "Observation.device",
        "path": "Observation.device",
        "short": "Measurement device.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Device"
          }
        ]
      },
      {
        "id": "Observation.device.reference",
        "path": "Observation.device.reference",
        "short": "Reference to a resource (could be Contained)",
        "min": 1
      },
      {
        "id": "Observation.device.identifier",
        "path": "Observation.device.identifier",
        "short": "If relevant could include an id"
      },
      {
        "id": "Observation.device.display",
        "path": "Observation.device.display",
        "short": "If relevant, description of the referenced resource"
      },
      {
        "id": "Observation.referenceRange",
        "path": "Observation.referenceRange",
        "mustSupport": true
      },
      {
        "id": "Observation.related",
        "path": "Observation.related",
        "short": "Resources related to this observation",
        "mustSupport": true
      },
      {
        "id": "Observation.related.type",
        "path": "Observation.related.type",
        "min": 1,
        "fixedCode": "derived-from",
        "mustSupport": true
      },
      {
        "id": "Observation.related.target",
        "path": "Observation.related.target",
        "short": "we limit the related field’s usage to only allow links to observation resources, from which the primary observation’s value was derived. E.g. An observation may have a value which is a score, and that score may have been derived from several other observations.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Observation-1"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "constraint": [
          {
            "key": "valint-1",
            "severity": "error",
            "human": "Cannot have both valueInteger and value[x]",
            "expression": "valueInteger.exists() != value.exists()"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component.extension",
        "path": "Observation.component.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Observation.component.extension:valuePrecision",
        "path": "Observation.component.extension",
        "sliceName": "valuePrecision",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "https://fhir.yhcr.nhs.uk/StructureDefinition/Extension-Interweave-ValuePrecision"
          }
        ]
      },
      {
        "id": "Observation.component.extension:valueInteger",
        "path": "Observation.component.extension",
        "sliceName": "valueInteger",
        "short": "Inline with R4, we have pre-adopted the valueInteger field.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "https://fhir.yhcr.nhs.uk/StructureDefinition/Extension-Interweave-R4ValueInteger"
          }
        ]
      },
      {
        "id": "Observation.component.code",
        "path": "Observation.component.code",
        "mustSupport": true,
        "binding": {
          "strength": "preferred",
          "valueSetReference": {
            "reference": "https://fhir.hl7.org.uk/STU3/ValueSet/CareConnect-ObservationType-1"
          }
        }
      },
      {
        "id": "Observation.component.code.coding.system",
        "path": "Observation.component.code.coding.system",
        "min": 1
      },
      {
        "id": "Observation.component.code.coding.code",
        "path": "Observation.component.code.coding.code",
        "min": 1
      },
      {
        "id": "Observation.component.code.coding.display",
        "path": "Observation.component.code.coding.display",
        "min": 1
      },
      {
        "id": "Observation.component.code.coding:snomedCT",
        "path": "Observation.component.code.coding",
        "sliceName": "snomedCT",
        "mustSupport": true,
        "binding": {
          "strength": "preferred"
        }
      },
      {
        "id": "Observation.component.value[x]",
        "path": "Observation.component.value[x]",
        "type": [
          {
            "code": "Quantity"
          },
          {
            "code": "CodeableConcept"
          },
          {
            "code": "string"
          },
          {
            "code": "Range"
          },
          {
            "code": "Ratio"
          },
          {
            "code": "SampledData"
          },
          {
            "code": "time"
          },
          {
            "code": "dateTime"
          },
          {
            "code": "Period"
          }
        ],
        "mustSupport": true
      }
    ]
  }
}