<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-diagnosticreport-results" />
  <meta>
    <lastUpdated value="2021-01-20T14:26:33.570+00:00" />
  </meta>
  <url value="https://fhir.infoway-inforoute.ca/StructureDefinition/profile-diagnosticreport-results" />
  <name value="PHIAccessLabResultsDiagnosticReport" />
  <title value="PHI Access DiagnosticReport Profile - Lab Results" />
  <status value="draft" />
  <date value="2021-01-20T14:21:23.7117865+00:00" />
  <publisher value="Canada Health Infoway" />
  <description value="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 value="urn:iso:std:iso:3166" />
      <code value="CA" />
      <display value="Canada" />
    </coding>
  </jurisdiction>
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="DiagnosticReport" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DiagnosticReport" />
  <derivation value="constraint" />
  <differential>
    <element id="DiagnosticReport">
      <path value="DiagnosticReport" />
      <constraint>
        <key value="access-2" />
        <severity value="error" />
        <human value="If there is no presentedForm element then either a value[x] or a data absent reason must be present" />
        <expression value="(result.empty()) implies (presentedForm.exists() or text.status='additional')" />
        <xpath value="exists(f:presentedForm) or exists(f:result) or exists(f:text.status.additional)" />
        <source value="https://fhir.infoway-inforoute.ca/StructureDefinition/profile-diagnosticreport-results" />
      </constraint>
    </element>
    <element id="DiagnosticReport.id">
      <path value="DiagnosticReport.id" />
      <requirements value="Necessary for preventing collisions and duplication of resources" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.meta">
      <path value="DiagnosticReport.meta" />
      <requirements value="Necessary for preventing collisions and duplication of resources" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.meta.id">
      <path value="DiagnosticReport.meta.id" />
      <mustSupport value="false" />
    </element>
    <element id="DiagnosticReport.meta.versionId">
      <path value="DiagnosticReport.meta.versionId" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.meta.lastUpdated">
      <path value="DiagnosticReport.meta.lastUpdated" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.meta.source">
      <path value="DiagnosticReport.meta.source" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.text">
      <path value="DiagnosticReport.text" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.text.status">
      <path value="DiagnosticReport.text.status" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.text.div">
      <path value="DiagnosticReport.text.div" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.identifier">
      <path value="DiagnosticReport.identifier" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.identifier.type">
      <path value="DiagnosticReport.identifier.type" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.identifier.type.coding">
      <path value="DiagnosticReport.identifier.type.coding" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.identifier.type.coding.system">
      <path value="DiagnosticReport.identifier.type.coding.system" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.identifier.type.coding.code">
      <path value="DiagnosticReport.identifier.type.coding.code" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.identifier.type.text">
      <path value="DiagnosticReport.identifier.type.text" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.identifier.system">
      <path value="DiagnosticReport.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.identifier.value">
      <path value="DiagnosticReport.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.status">
      <path value="DiagnosticReport.status" />
      <short value="partial | preliminary | final | amended | corrected | appended" />
      <comment value="Note that FHIR strings SHALL NOT exceed 1MB in size. &#xD;&#xA;&#xD;&#xA;This 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 value="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 value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/PHI-access-diagnosticreport-status" />
      </binding>
    </element>
    <element id="DiagnosticReport.category">
      <path value="DiagnosticReport.category" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <requirements value="Used for filtering the DiagnosticReports that are retrieved and displayed" />
      <min value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
      </binding>
    </element>
    <element id="DiagnosticReport.category:Laboratory">
      <path value="DiagnosticReport.category" />
      <sliceName value="Laboratory" />
      <min value="1" />
      <max value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/v2-0074" />
          <code value="LAB" />
          <display value="Laboratory" />
        </coding>
        <text value="Laboratory" />
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.category:Laboratory.coding">
      <path value="DiagnosticReport.category.coding" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.category:Laboratory.coding.system">
      <path value="DiagnosticReport.category.coding.system" />
      <min value="1" />
      <mustSupport value="false" />
    </element>
    <element id="DiagnosticReport.category:Laboratory.coding.code">
      <path value="DiagnosticReport.category.coding.code" />
      <min value="1" />
      <mustSupport value="false" />
    </element>
    <element id="DiagnosticReport.category:Laboratory.text">
      <path value="DiagnosticReport.category.text" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.category:Other">
      <path value="DiagnosticReport.category" />
      <sliceName value="Other" />
      <definition value="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 value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="https://fhir.infoway-inforoute.ca/ValueSet/PHIaccess-diagnosticreport-lab-category" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <description value="Codes from DiagnosticService Section with additional profile constraints" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/PHIaccess-diagnosticreport-lab-category" />
      </binding>
    </element>
    <element id="DiagnosticReport.category:Other.coding">
      <path value="DiagnosticReport.category.coding" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.category:Other.coding.system">
      <path value="DiagnosticReport.category.coding.system" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.category:Other.coding.code">
      <path value="DiagnosticReport.category.coding.code" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.category:Other.text">
      <path value="DiagnosticReport.category.text" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.code">
      <path value="DiagnosticReport.code" />
      <requirements value="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 value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/PHI-access-DiagnosticReport-codes" />
      </binding>
    </element>
    <element id="DiagnosticReport.code.coding">
      <path value="DiagnosticReport.code.coding" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.code.coding.system">
      <path value="DiagnosticReport.code.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.code.coding.code">
      <path value="DiagnosticReport.code.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.code.coding.display">
      <path value="DiagnosticReport.code.coding.display" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.code.text">
      <path value="DiagnosticReport.code.text" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.subject">
      <path value="DiagnosticReport.subject" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.infoway-inforoute.ca/StructureDefinition/profile-patient-DataConnector" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.subject.reference">
      <path value="DiagnosticReport.subject.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.effective[x]">
      <path value="DiagnosticReport.effective[x]" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.issued">
      <path value="DiagnosticReport.issued" />
      <comment value="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. &#xD;&#xA;&#xD;&#xA;Implementation Guidance: Zero-fill to necessary precision" />
      <requirements value="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 value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.performer">
      <path value="DiagnosticReport.performer" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-organization" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.result">
      <path value="DiagnosticReport.result" />
      <definition value="Observations that are part of this diagnostic report." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.infoway-inforoute.ca/StructureDefinition/profile-observation-results" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.result.reference">
      <path value="DiagnosticReport.result.reference" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.conclusion">
      <path value="DiagnosticReport.conclusion" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.presentedForm">
      <path value="DiagnosticReport.presentedForm" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="contentType" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <comment value="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.&#xA;&#xA;Implementation 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 value="Enforces the support lab approved/jurisdiction approved rendering to ensure fully formatted report for clinical fidelity." />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.presentedForm:PDFContentType">
      <path value="DiagnosticReport.presentedForm" />
      <sliceName value="PDFContentType" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.presentedForm:PDFContentType.contentType">
      <path value="DiagnosticReport.presentedForm.contentType" />
      <min value="1" />
      <fixedCode value="application/pdf" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.presentedForm:PDFContentType.data">
      <path value="DiagnosticReport.presentedForm.data" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.presentedForm:PDFContentType.title">
      <path value="DiagnosticReport.presentedForm.title" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>