<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-detected-issue" />
  <url value="http://pharmacyeclaims.ca/FHIR/v1.0/StructureDefinition/profile-detected-issue" />
  <name value="DetectedIssue" />
  <title value="DetectedIssue - Clinical Issue" />
  <status value="draft" />
  <description value="Used to convey clinical issues that are managed in the claim request or detected by the adjuidcator and conveyed in the claim response" />
  <purpose value="Used to convey clinical issues that are managed in the claim request or detected by the adjuidcator and conveyed in the claim response" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="DetectedIssue" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DetectedIssue" />
  <derivation value="constraint" />
  <differential>
    <element id="DetectedIssue.status">
      <path value="DetectedIssue.status" />
      <comment value="TWG --???  is a fixed value of mitigated appropriate?&#xD;&#xA;&#xD;&#xA;This element is labeled as a modifier because the status contains the codes cancelled and entered-in-error that mark the issue as not currently valid." />
      <mustSupport value="true" />
    </element>
    <element id="DetectedIssue.code">
      <path value="DetectedIssue.code" />
      <comment value="Usage:   This should be provided where known.   &#xD;&#xA;CPHA Mapping:   D.65.03.  This maps to a subset of intervention &amp; exception codes that are specificaly for DUR.  TWG work to determine this value set&#xD;&#xA;&#xD;&#xA;Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination." />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="http://pharmacyeclaims.ca/FHIR/ValueSet/DUR-codes" />
      </binding>
    </element>
    <element id="DetectedIssue.code.coding">
      <path value="DetectedIssue.code.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="DetectedIssue.code.coding.system">
      <path value="DetectedIssue.code.coding.system" />
      <fixedUri value="http://pharmacyeclaims.ca/FHIR/CodeSystem/intervention-codes" />
      <mustSupport value="true" />
    </element>
    <element id="DetectedIssue.code.coding.code">
      <path value="DetectedIssue.code.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DetectedIssue.severity">
      <path value="DetectedIssue.severity" />
      <comment value="Usage:   This should be provided where known&#xD;&#xA;CPHA Mapping:  None, this is a new code&#xD;&#xA;&#xD;&#xA;Note that FHIR strings SHALL NOT exceed 1,048,576 (1024*1024) characters in size" />
      <mustSupport value="true" />
    </element>
    <element id="DetectedIssue.implicated">
      <path value="DetectedIssue.implicated" />
      <mustSupport value="true" />
    </element>
    <element id="DetectedIssue.implicated.display">
      <path value="DetectedIssue.implicated.display" />
      <mustSupport value="true" />
    </element>
    <element id="DetectedIssue.detail">
      <path value="DetectedIssue.detail" />
      <comment value="CPHA Mapping:  None; this is new&#xD;&#xA;Usage Note:  TBC - is there value to include written detail, or does just the code suffice?&#xD;&#xA;&#xD;&#xA;Should focus on information not covered elsewhere as discrete data - no need to duplicate the narrative." />
      <mustSupport value="true" />
    </element>
    <element id="DetectedIssue.mitigation">
      <path value="DetectedIssue.mitigation" />
      <mustSupport value="true" />
    </element>
    <element id="DetectedIssue.mitigation.action">
      <path value="DetectedIssue.mitigation.action" />
      <mustSupport value="true" />
    </element>
    <element id="DetectedIssue.mitigation.action.coding.system">
      <path value="DetectedIssue.mitigation.action.coding.system" />
      <mustSupport value="true" />
    </element>
    <element id="DetectedIssue.mitigation.action.coding.code">
      <path value="DetectedIssue.mitigation.action.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="DetectedIssue.mitigation.action.text">
      <path value="DetectedIssue.mitigation.action.text" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>