{
  "resourceType": "StructureDefinition",
  "id": "profile-diagnosticreport-results",
  "meta": {
    "lastUpdated": "2021-01-20T14:26:33.57+00:00"
  },
  "url": "https://fhir.infoway-inforoute.ca/StructureDefinition/profile-diagnosticreport-results",
  "name": "PHIAccessLabResultsDiagnosticReport",
  "title": "PHI Access DiagnosticReport Profile - Lab Results",
  "status": "draft",
  "date": "2021-01-20T14:21:23.7117865+00:00",
  "publisher": "Canada Health Infoway",
  "description": "Constraints on the DiagnosticReport resource that is used to convey information about the results of a patient's diagnostic report (e.g., clinical chemistry, hematology, microbiology, pathology, etc.).",
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "urn:iso:std:iso:3166",
          "code": "CA",
          "display": "Canada"
        }
      ]
    }
  ],
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "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"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "DiagnosticReport",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/DiagnosticReport",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "DiagnosticReport",
        "path": "DiagnosticReport",
        "constraint": [
          {
            "key": "access-2",
            "severity": "error",
            "human": "If there is no presentedForm element then either a value[x] or a data absent reason must be present",
            "expression": "(result.empty()) implies (presentedForm.exists() or text.status='additional')",
            "xpath": "exists(f:presentedForm) or exists(f:result) or exists(f:text.status.additional)",
            "source": "https://fhir.infoway-inforoute.ca/StructureDefinition/profile-diagnosticreport-results"
          }
        ]
      },
      {
        "id": "DiagnosticReport.id",
        "path": "DiagnosticReport.id",
        "requirements": "Necessary for preventing collisions and duplication of resources",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.meta",
        "path": "DiagnosticReport.meta",
        "requirements": "Necessary for preventing collisions and duplication of resources",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.meta.id",
        "path": "DiagnosticReport.meta.id",
        "mustSupport": false
      },
      {
        "id": "DiagnosticReport.meta.versionId",
        "path": "DiagnosticReport.meta.versionId",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.meta.lastUpdated",
        "path": "DiagnosticReport.meta.lastUpdated",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.meta.source",
        "path": "DiagnosticReport.meta.source",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.text",
        "path": "DiagnosticReport.text",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.text.status",
        "path": "DiagnosticReport.text.status",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.text.div",
        "path": "DiagnosticReport.text.div",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.identifier",
        "path": "DiagnosticReport.identifier",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.identifier.type",
        "path": "DiagnosticReport.identifier.type",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.identifier.type.coding",
        "path": "DiagnosticReport.identifier.type.coding",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.identifier.type.coding.system",
        "path": "DiagnosticReport.identifier.type.coding.system",
        "min": 1
      },
      {
        "id": "DiagnosticReport.identifier.type.coding.code",
        "path": "DiagnosticReport.identifier.type.coding.code",
        "min": 1
      },
      {
        "id": "DiagnosticReport.identifier.type.text",
        "path": "DiagnosticReport.identifier.type.text",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.identifier.system",
        "path": "DiagnosticReport.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.identifier.value",
        "path": "DiagnosticReport.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.status",
        "path": "DiagnosticReport.status",
        "short": "partial | preliminary | final | amended | corrected | appended",
        "comment": "Note that FHIR strings SHALL NOT exceed 1MB in size. \r\n\r\nThis value set may be further constrained to partial, final, and corrected if there is no evidence that other jurisdictions actively use codes that map to preliminary, amended, and appended.",
        "requirements": "The scope of this profile is  diagnosticReports containing result information. In order to uphold constraints that ensure a presentedForm (attachment) of the results is always available for issued diagnosticReports, the value set is constrained to eliminate diagnosticReports of registered status that do not contain result information.",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.infoway-inforoute.ca/ValueSet/PHI-access-diagnosticreport-status"
        }
      },
      {
        "id": "DiagnosticReport.category",
        "path": "DiagnosticReport.category",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "requirements": "Used for filtering the DiagnosticReports that are retrieved and displayed",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "extensible"
        }
      },
      {
        "id": "DiagnosticReport.category:Laboratory",
        "path": "DiagnosticReport.category",
        "sliceName": "Laboratory",
        "min": 1,
        "max": "1",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/v2-0074",
              "code": "LAB",
              "display": "Laboratory"
            }
          ],
          "text": "Laboratory"
        },
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.category:Laboratory.coding",
        "path": "DiagnosticReport.category.coding",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.category:Laboratory.coding.system",
        "path": "DiagnosticReport.category.coding.system",
        "min": 1,
        "mustSupport": false
      },
      {
        "id": "DiagnosticReport.category:Laboratory.coding.code",
        "path": "DiagnosticReport.category.coding.code",
        "min": 1,
        "mustSupport": false
      },
      {
        "id": "DiagnosticReport.category:Laboratory.text",
        "path": "DiagnosticReport.category.text",
        "min": 1
      },
      {
        "id": "DiagnosticReport.category:Other",
        "path": "DiagnosticReport.category",
        "sliceName": "Other",
        "definition": "A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. microbiology, biochemistry, hematology, etc.). This is used for searching, sorting and display purposes.",
        "max": "1",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://fhir.infoway-inforoute.ca/ValueSet/PHIaccess-diagnosticreport-lab-category"
            }
          ]
        },
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "description": "Codes from DiagnosticService Section with additional profile constraints",
          "valueSet": "https://fhir.infoway-inforoute.ca/ValueSet/PHIaccess-diagnosticreport-lab-category"
        }
      },
      {
        "id": "DiagnosticReport.category:Other.coding",
        "path": "DiagnosticReport.category.coding",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.category:Other.coding.system",
        "path": "DiagnosticReport.category.coding.system",
        "min": 1
      },
      {
        "id": "DiagnosticReport.category:Other.coding.code",
        "path": "DiagnosticReport.category.coding.code",
        "min": 1
      },
      {
        "id": "DiagnosticReport.category:Other.text",
        "path": "DiagnosticReport.category.text",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.code",
        "path": "DiagnosticReport.code",
        "requirements": "Flagged as must support to enable searching against an identified panel. Standard terminologies like LOINC are not expected to be used in NB for panels. In addition to the must support coding elements, code.text has a required cardinality of 1..1 to ensure the information is meaningful to patients.",
        "mustSupport": true,
        "binding": {
          "strength": "preferred",
          "valueSet": "https://fhir.infoway-inforoute.ca/ValueSet/PHI-access-DiagnosticReport-codes"
        }
      },
      {
        "id": "DiagnosticReport.code.coding",
        "path": "DiagnosticReport.code.coding",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.code.coding.system",
        "path": "DiagnosticReport.code.coding.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.code.coding.code",
        "path": "DiagnosticReport.code.coding.code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.code.coding.display",
        "path": "DiagnosticReport.code.coding.display",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.code.text",
        "path": "DiagnosticReport.code.text",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.subject",
        "path": "DiagnosticReport.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.infoway-inforoute.ca/StructureDefinition/profile-patient-DataConnector"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.subject.reference",
        "path": "DiagnosticReport.subject.reference",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.effective[x]",
        "path": "DiagnosticReport.effective[x]",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.issued",
        "path": "DiagnosticReport.issued",
        "comment": "May be different from the update time of the resource itself, because that is the status of the record (potentially a secondary copy), not the actual release time of the report. \r\n\r\nImplementation Guidance: Zero-fill to necessary precision",
        "requirements": "The date the report was released is expected to be available and is more meaningful to patients and clinicians than the collection time of the specimen(s).",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.performer",
        "path": "DiagnosticReport.performer",
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-organization"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.result",
        "path": "DiagnosticReport.result",
        "definition": "Observations that are part of this diagnostic report.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.infoway-inforoute.ca/StructureDefinition/profile-observation-results"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.result.reference",
        "path": "DiagnosticReport.result.reference",
        "min": 1
      },
      {
        "id": "DiagnosticReport.conclusion",
        "path": "DiagnosticReport.conclusion",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.presentedForm",
        "path": "DiagnosticReport.presentedForm",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "contentType"
            }
          ],
          "rules": "open"
        },
        "comment": "application/pdf is recommended as the most reliable and interoperable in this context. Expected to be produced by the jurisdictional lab information system or through the Gateway. It's expected that almost all lab reports have a rendered form, this form should be propogated to avoid shifting the burden to client applications to develop custom rendering.\n\nImplementation Note: This element will tighten it's cardinality to 1..* in future releases but has been marked as must support and optional, to enable the jurisdictions time to work with their lab result senders to send the pdf following the first release. This element is further enforced with an invariant that ensures either a result, dataAbsentReason is present if presentedForm is not populated.",
        "requirements": "Enforces the support lab approved/jurisdiction approved rendering to ensure fully formatted report for clinical fidelity.",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.presentedForm:PDFContentType",
        "path": "DiagnosticReport.presentedForm",
        "sliceName": "PDFContentType",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.presentedForm:PDFContentType.contentType",
        "path": "DiagnosticReport.presentedForm.contentType",
        "min": 1,
        "fixedCode": "application/pdf",
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.presentedForm:PDFContentType.data",
        "path": "DiagnosticReport.presentedForm.data",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DiagnosticReport.presentedForm:PDFContentType.title",
        "path": "DiagnosticReport.presentedForm.title",
        "mustSupport": true
      }
    ]
  }
}