<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="hl7v2communication-profile" />
  <url value="http://fhir.xt.dev/StructureDefinition/HL7v2Communication" />
  <version value="1.0.1" />
  <name value="HL7v2Communication" />
  <status value="active" />
  <date value="2024-11-25T22:31:46.488095+00:00" />
  <publisher value="x-tention Informationstechnologie GmbH" />
  <contact>
    <telecom>
      <system value="email" />
      <value value="fhir.profiling@x-tention.com" />
      <use value="work" />
    </telecom>
  </contact>
  <copyright value="x-tention Informationstechnologie GmbH" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Communication" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Communication" />
  <derivation value="constraint" />
  <differential>
    <element id="Communication.text">
      <path value="Communication.text" />
      <max value="0" />
    </element>
    <element id="Communication.contained">
      <path value="Communication.contained" />
      <max value="0" />
    </element>
    <element id="Communication.identifier">
      <path value="Communication.identifier" />
      <short value="Message ID" />
      <definition value="Message ID aus MSH.10" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Communication.identifier.use">
      <path value="Communication.identifier.use" />
      <max value="0" />
    </element>
    <element id="Communication.identifier.type">
      <path value="Communication.identifier.type" />
      <max value="0" />
    </element>
    <element id="Communication.identifier.system">
      <path value="Communication.identifier.system" />
      <max value="0" />
    </element>
    <element id="Communication.identifier.value">
      <path value="Communication.identifier.value" />
      <short value="MSH.10" />
      <min value="1" />
    </element>
    <element id="Communication.identifier.period">
      <path value="Communication.identifier.period" />
      <max value="0" />
    </element>
    <element id="Communication.identifier.assigner">
      <path value="Communication.identifier.assigner" />
      <max value="0" />
    </element>
    <element id="Communication.instantiatesCanonical">
      <path value="Communication.instantiatesCanonical" />
      <max value="0" />
    </element>
    <element id="Communication.basedOn">
      <path value="Communication.basedOn" />
      <max value="0" />
    </element>
    <element id="Communication.statusReason">
      <path value="Communication.statusReason" />
      <max value="0" />
    </element>
    <element id="Communication.category">
      <path value="Communication.category" />
      <min value="1" />
      <max value="1" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://fhir.xt.dev/ValueSet/HL7v2SystemCommunicationCategories" />
      </binding>
    </element>
    <element id="Communication.category.coding">
      <path value="Communication.category.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Communication.category.coding.id">
      <path value="Communication.category.coding.id" />
      <max value="0" />
    </element>
    <element id="Communication.category.coding.userSelected">
      <path value="Communication.category.coding.userSelected" />
      <max value="0" />
    </element>
    <element id="Communication.priority">
      <path value="Communication.priority" />
      <max value="0" />
    </element>
    <element id="Communication.medium">
      <path value="Communication.medium" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Communication.medium.coding">
      <path value="Communication.medium.coding" />
      <min value="1" />
      <max value="1" />
      <fixedCoding>
        <system value="http://fhir.xt.dev/CodeSystem/ConnectionTypes" />
        <code value="hl7v2-orcsignal" />
      </fixedCoding>
    </element>
    <element id="Communication.medium.coding.userSelected">
      <path value="Communication.medium.coding.userSelected" />
      <max value="0" />
    </element>
    <element id="Communication.medium.text">
      <path value="Communication.medium.text" />
      <max value="0" />
    </element>
    <element id="Communication.subject">
      <path value="Communication.subject" />
      <short value="Patient" />
      <definition value="The patient that was communicated in the PID segment. Either a reference to the resolved master patient identity or a local patient Identifier is used. If a local identifier is used, the resource may only be stored as a contained resource." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <aggregation value="referenced" />
      </type>
    </element>
    <element id="Communication.subject.type">
      <path value="Communication.subject.type" />
      <min value="1" />
      <fixedUri value="Patient" />
    </element>
    <element id="Communication.subject.identifier">
      <path value="Communication.subject.identifier" />
      <short value="Logical reference" />
      <definition value="An identifier for the target resource. This is used when it is important to record the local patient ID. If this is used, the resource may not be stored independently in the CDS, only contained." />
    </element>
    <element id="Communication.topic">
      <path value="Communication.topic" />
      <min value="1" />
    </element>
    <element id="Communication.topic.coding">
      <path value="Communication.topic.coding" />
      <min value="1" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <description value="v2 MESSAGE TYPE" />
        <valueSet value="http://terminology.hl7.org/ValueSet/v2-0076" />
      </binding>
    </element>
    <element id="Communication.topic.coding.userSelected">
      <path value="Communication.topic.coding.userSelected" />
      <max value="0" />
    </element>
    <element id="Communication.topic.text">
      <path value="Communication.topic.text" />
      <max value="0" />
    </element>
    <element id="Communication.about">
      <path value="Communication.about" />
      <max value="0" />
    </element>
    <element id="Communication.encounter">
      <path value="Communication.encounter" />
      <short value="Encounter communicated in message" />
      <definition value="The Encounter which was communicated in the HL7 message's PV1 segment. Either as a literal reference, if it can be found in the FHIR server, or as a logical reference." />
    </element>
    <element id="Communication.recipient">
      <path value="Communication.recipient" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="reference" />
        </discriminator>
        <discriminator>
          <type value="type" />
          <path value="type" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Communication.recipient:knownOrganization">
      <path value="Communication.recipient" />
      <sliceName value="knownOrganization" />
      <short value="Message recipient (MSH.6 Organization)" />
      <definition value="The target organization of the communication, as communicated in MSH.6." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <aggregation value="referenced" />
      </type>
    </element>
    <element id="Communication.recipient:knownOrganization.reference">
      <path value="Communication.recipient.reference" />
      <min value="1" />
    </element>
    <element id="Communication.recipient:knownOrganization.type">
      <path value="Communication.recipient.type" />
      <max value="0" />
    </element>
    <element id="Communication.recipient:knownOrganization.identifier">
      <path value="Communication.recipient.identifier" />
      <max value="0" />
    </element>
    <element id="Communication.recipient:knownPractitioner">
      <path value="Communication.recipient" />
      <sliceName value="knownPractitioner" />
      <short value="Message recipient (Practitioner)" />
      <definition value="The practitioner which was the target of the communication." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <aggregation value="referenced" />
      </type>
    </element>
    <element id="Communication.recipient:knownPractitioner.reference">
      <path value="Communication.recipient.reference" />
      <min value="1" />
    </element>
    <element id="Communication.recipient:knownPractitioner.type">
      <path value="Communication.recipient.type" />
      <max value="0" />
    </element>
    <element id="Communication.recipient:knownPractitioner.identifier">
      <path value="Communication.recipient.identifier" />
      <max value="0" />
    </element>
    <element id="Communication.recipient:unknownPractitioner">
      <path value="Communication.recipient" />
      <sliceName value="unknownPractitioner" />
      <short value="Message recipient (Practitioner ID)" />
      <definition value="The practitioner which was the target of the communication. Only to be used in case the practitioner is not known in the CDS." />
      <max value="1" />
    </element>
    <element id="Communication.recipient:unknownPractitioner.reference">
      <path value="Communication.recipient.reference" />
      <max value="0" />
    </element>
    <element id="Communication.recipient:unknownPractitioner.type">
      <path value="Communication.recipient.type" />
      <min value="1" />
      <fixedUri value="Practitioner" />
    </element>
    <element id="Communication.recipient:unknownPractitioner.identifier">
      <path value="Communication.recipient.identifier" />
      <min value="1" />
    </element>
    <element id="Communication.sender">
      <path value="Communication.sender" />
      <short value="Sending Facility" />
      <definition value="Sending Facility as communicated in MSH.4. Use a reference if the organization can be resolved or an identifier if not." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <aggregation value="referenced" />
      </type>
    </element>
    <element id="Communication.sender.type">
      <path value="Communication.sender.type" />
      <min value="1" />
      <fixedUri value="Organization" />
    </element>
    <element id="Communication.sender.identifier.use">
      <path value="Communication.sender.identifier.use" />
      <max value="0" />
    </element>
    <element id="Communication.sender.identifier.type">
      <path value="Communication.sender.identifier.type" />
      <max value="0" />
    </element>
    <element id="Communication.sender.identifier.system">
      <path value="Communication.sender.identifier.system" />
      <max value="0" />
    </element>
    <element id="Communication.sender.identifier.period">
      <path value="Communication.sender.identifier.period" />
      <max value="0" />
    </element>
    <element id="Communication.sender.identifier.assigner">
      <path value="Communication.sender.identifier.assigner" />
      <max value="0" />
    </element>
    <element id="Communication.sender.display">
      <path value="Communication.sender.display" />
      <short value="MSH.4" />
      <definition value="MSH.4 content if a reference is used." />
    </element>
    <element id="Communication.reasonCode">
      <path value="Communication.reasonCode" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Communication.reasonCode.coding">
      <path value="Communication.reasonCode.coding" />
      <min value="1" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <description value="v2 EVENT TYPE CODE" />
        <valueSet value="http://terminology.hl7.org/ValueSet/v2-0003" />
      </binding>
    </element>
    <element id="Communication.reasonCode.coding.userSelected">
      <path value="Communication.reasonCode.coding.userSelected" />
      <max value="0" />
    </element>
    <element id="Communication.reasonCode.text">
      <path value="Communication.reasonCode.text" />
      <max value="0" />
    </element>
    <element id="Communication.reasonReference">
      <path value="Communication.reasonReference" />
      <max value="0" />
    </element>
    <element id="Communication.payload">
      <path value="Communication.payload" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Communication.payload.content[x]">
      <path value="Communication.payload.content[x]" />
      <short value="HL7v2 message content" />
      <definition value="HL7v2 message content. Please note the 1 MB size limit for FHIR Strings and exclude base64-encoded documents and similar large content." />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="Communication.note">
      <path value="Communication.note" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>