<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="CA-eReC-Communication" />
  <url value="http://fhir.infoway-inforoute.ca/io/CA-pipeline-test/StructureDefinition/CA-eReC-Communication" />
  <name value="Communication" />
  <title value="Communication" />
  <status value="draft" />
  <description value="Communication resource is used to achieve the bi-directional communication between two systems. The Communication resource can be used to ask questions regarding a referral, request a referral be updated with missing information, or request additional information not covered by the specific referral dataset." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Communication" />
  <baseDefinition value="http://fhir.infoway-inforoute.ca/cacore/StructureDefinition/communication-ca-core" />
  <derivation value="constraint" />
  <differential>
    <element id="Communication.basedOn">
      <path value="Communication.basedOn" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-ServiceRequest" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Communication.basedOn.reference">
      <path value="Communication.basedOn.reference" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.basedOn.identifier">
      <path value="Communication.basedOn.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.basedOn.identifier.use">
      <path value="Communication.basedOn.identifier.use" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.basedOn.identifier.system">
      <path value="Communication.basedOn.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.basedOn.identifier.value">
      <path value="Communication.basedOn.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.inResponseTo">
      <path value="Communication.inResponseTo" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.status">
      <path value="Communication.status" />
      <fixedCode value="completed" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/event-status" />
      </binding>
    </element>
    <element id="Communication.category">
      <path value="Communication.category" />
      <mustSupport value="true" />
      <binding>
        <strength value="example" />
        <valueSet value="http://fhir.infoway-inforoute.ca/io/CA-eReC/ValueSet/communication-category" />
      </binding>
    </element>
    <element id="Communication.subject">
      <path value="Communication.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Communication.subject.reference">
      <path value="Communication.subject.reference" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.subject.identifier">
      <path value="Communication.subject.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.subject.identifier.system">
      <path value="Communication.subject.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.subject.identifier.value">
      <path value="Communication.subject.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.sent">
      <path value="Communication.sent" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.received">
      <path value="Communication.received" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.sender">
      <path value="Communication.sender" />
      <comment value="When the communication comes from a CAT, then HealthcareService can be used to identify the sender." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-PractitionerRole" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-HealthcareService" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Communication.sender.reference">
      <path value="Communication.sender.reference" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.sender.identifier">
      <path value="Communication.sender.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.sender.identifier.system">
      <path value="Communication.sender.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.sender.identifier.value">
      <path value="Communication.sender.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.payload">
      <path value="Communication.payload" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.payload.content[x]">
      <path value="Communication.payload.content[x]" />
      <type>
        <code value="string" />
      </type>
      <type>
        <code value="Attachment" />
      </type>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>