{
  "resourceType": "StructureDefinition",
  "id": "profile-observation-results",
  "url": "http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-observation-results",
  "version": "1.0.1",
  "name": "ObservationProfileLaboratory",
  "title": "Observation Profile (Laboratory Results)",
  "status": "draft",
  "date": "2024-12-27",
  "publisher": "HL7 Canada - FHIR Implementation Work Group",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "https://infocentral.infoway-inforoute.ca/en/collaboration/wg/fhir-implementations"
        }
      ]
    }
  ],
  "description": "Proposed constraints on the Observation Resource to represent results produced by laboratory tests or panels/studies",
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "urn:iso:std:iso:3166",
          "code": "CA"
        }
      ]
    }
  ],
  "fhirVersion": "4.0.1",
  "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"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation",
        "path": "Observation",
        "short": "Observation Profile",
        "definition": "The Observation Profile is based upon the core FHIR Observation Resource",
        "constraint": [
          {
            "key": "ca-baseline-results-1",
            "severity": "warning",
            "human": "SHOULD use SNOMED CT for coded Results",
            "expression": "(component.value | value).ofType(Quantity).all(system = 'http://unitsofmeasure.org')"
          }
        ]
      },
      {
        "id": "Observation.status",
        "path": "Observation.status",
        "comment": "Statuses are fundamental to understanding lab domain results. This element is considered mandatory and is a modifier element in the base specification. This profile is seeking community and implementer feedback on whether the MustSupport flag that has been reintroduced in this profile elicits further challenges to systems."
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Observation.category:laboratory",
        "path": "Observation.category",
        "sliceName": "laboratory",
        "short": "FHIR standard classification of type of observation",
        "comment": "This profile is scoped to an event (results) which includes constraints for that event. Profiles such as the OLIS Lab Observation Profile may be scoped more broadly to include modelling for more than just a single results step in the workflow. Both forms of modelling are appropriate, however implementers should be aware of the impact of scope on the setting of constraints (like this slice) and acknowledge that if their own profile is different in scope than the CA Baseline profile, it is not expected that they meet all the constraints outlined in this profile and it may be appropriate to review the generic observation profile instead.",
        "min": 1,
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/observation-category",
              "code": "laboratory"
            }
          ]
        }
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "comment": "The binding strength of this element is [Preferred](https://www.hl7.org/fhir/terminologies.html#strength), meaning that codes are encouraged to draw from the LOINC or PCLOCD code system for interoperability purposes but are not required to do so to be considered conformant. *All* code-value and, if present, component.code-component.value pairs need to be taken into account to correctly understand the meaning of the observation.",
        "binding": {
          "strength": "preferred",
          "description": "LOINC codes identifying names of simple observations.",
          "valueSet": "http://hl7.org/fhir/ValueSet/observation-codes"
        }
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-patient",
              "http://hl7.org/fhir/StructureDefinition/Group",
              "http://hl7.org/fhir/StructureDefinition/Device",
              "http://hl7.org/fhir/StructureDefinition/Location"
            ]
          }
        ]
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "type": [
          {
            "code": "dateTime"
          },
          {
            "code": "Period"
          }
        ],
        "constraint": [
          {
            "key": "ca-baseline-datetime",
            "severity": "error",
            "human": "Datetime SHALL be at least to day",
            "expression": "($this as dateTime).toString().length() >= 8"
          }
        ]
      },
      {
        "id": "Observation.issued",
        "path": "Observation.issued",
        "comment": "Implementors should consider adding a must support flag in the case that the relevant systems are not able to support effective, but are able to support issued."
      },
      {
        "id": "Observation.performer",
        "path": "Observation.performer",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-practitioner",
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-practitionerrole",
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-organization",
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-patient"
            ]
          }
        ]
      },
      {
        "id": "Observation.value[x]",
        "path": "Observation.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Observation.value[x]:valueCodeableConcept",
        "path": "Observation.value[x]",
        "sliceName": "valueCodeableConcept",
        "comment": "A coded value **SHOULD**  be selected from [SNOMED CT](http://www.snomed.org).",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ]
      },
      {
        "id": "Observation.value[x]:valueCodeableConcept.coding",
        "path": "Observation.value[x].coding"
      },
      {
        "id": "Observation.value[x]:valueCodeableConcept.coding.system",
        "path": "Observation.value[x].coding.system",
        "short": "FHIR standard classification of type of observation code system",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Observation.value[x]:valueCodeableConcept.coding.code",
        "path": "Observation.value[x].coding.code",
        "short": "A code defining laboratory result",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Observation.value[x]:valueQuantity",
        "path": "Observation.value[x]",
        "sliceName": "valueQuantity",
        "type": [
          {
            "code": "Quantity"
          }
        ]
      },
      {
        "id": "Observation.value[x]:valueQuantity.value",
        "path": "Observation.value[x].value",
        "min": 1
      },
      {
        "id": "Observation.value[x]:valueQuantity.system",
        "path": "Observation.value[x].system"
      },
      {
        "id": "Observation.dataAbsentReason",
        "path": "Observation.dataAbsentReason",
        "comment": "This element is recommended for support and was initially flagged as must support but was later determined to be too strong for some types of lab result profiles that want to derive from the CA Baseline but do not need a dataAbsentReason concept"
      },
      {
        "id": "Observation.interpretation",
        "path": "Observation.interpretation",
        "comment": "This element is recommended for support and was initially flagged as must support but was later determined to be too strong for some types of lab result profiles (e.g., antibody results, blood typing results, etc.) that want to derive from the CA Baseline but do not have an interpretation concept (e.g., norm/abnormal, high/low)."
      },
      {
        "id": "Observation.referenceRange",
        "path": "Observation.referenceRange",
        "comment": "This element is recommended for support and was initially flagged as must support but was later determined to be too strong for some types of lab result profiles (e.g., labs with non-numeric results) that want to derive from the CA Baseline but do not have a need for a numeric reference range concept."
      },
      {
        "id": "Observation.hasMember",
        "path": "Observation.hasMember",
        "comment": "This element was initially flagged as must support but was later determined to be too strong for some types of lab result profile that want to derive from the CA Baseline but do not have a use hasMember to link results. Examples of these include but are not limited to non-panel results and panel result implementations that use alternative methods like ServiceRequest or DiagnosticReport to link panel results together."
      },
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "comment": "Some elements underneath this backbone element are considered must support. This does not incur the expectation to support these elements for any implementers that do not need to support the parent concept of observation.component. This may need to be evaluated in the future as implementations seek to derive directly from the CA Baseline profiles"
      },
      {
        "id": "Observation.component.code",
        "path": "Observation.component.code",
        "comment": "The binding strength of this element is [Preferred](https://www.hl7.org/fhir/terminologies.html#strength), meaning that codes are encouraged to draw from the LOINC code system for interoperability purposes but are not required to do so to be considered conformant. *All* code-value and, if present, component.code-component.value pairs need to be taken into account to correctly understand the meaning of the observation.",
        "binding": {
          "strength": "preferred",
          "description": "LOINC codes identifying names of simple observations.",
          "valueSet": "http://hl7.org/fhir/ValueSet/observation-codes"
        }
      },
      {
        "id": "Observation.component.value[x]",
        "path": "Observation.component.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Observation.component.value[x]:valueCodeableConcept",
        "path": "Observation.component.value[x]",
        "sliceName": "valueCodeableConcept",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ]
      },
      {
        "id": "Observation.component.value[x]:valueCodeableConcept.coding",
        "path": "Observation.component.value[x].coding",
        "short": "FHIR standard classification of type of observation code system",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Observation.component.value[x]:valueCodeableConcept.coding.system",
        "path": "Observation.component.value[x].coding.system",
        "short": "FHIR standard classification of type of observation code system",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Observation.component.value[x]:valueCodeableConcept.coding.code",
        "path": "Observation.component.value[x].coding.code",
        "short": "A code defining laboratory result",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Observation.component.value[x]:valueQuantity",
        "path": "Observation.component.value[x]",
        "sliceName": "valueQuantity",
        "type": [
          {
            "code": "Quantity"
          }
        ]
      },
      {
        "id": "Observation.component.value[x]:valueQuantity.value",
        "path": "Observation.component.value[x].value",
        "min": 1
      },
      {
        "id": "Observation.component.value[x]:valueQuantity.system",
        "path": "Observation.component.value[x].system"
      },
      {
        "id": "Observation.component.dataAbsentReason",
        "path": "Observation.component.dataAbsentReason"
      }
    ]
  }
}