<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="EngagementRecord" />
  <url value="http://hl7.org/fhir/StructureDefinition/EngagementRecord" />
  <version value="0.1" />
  <name value="EngagementRecord" />
  <status value="draft" />
  <publisher value="Synapxe" />
  <copyright value="Copyright (C) 2024 Synapxe" />
  <fhirVersion value="5.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="EngagementRecord" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
  <derivation value="specialization" />
  <differential>
    <element id="EngagementRecord">
      <path value="EngagementRecord" />
      <constraint>
        <key value="dom-3" />
        <severity value="error" />
        <human value="If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource" />
        <expression value="contained.where(((id.exists() and ('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url)))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(uri) = '#').exists()).not()).trace('unmatched', id).empty()" />
      </constraint>
    </element>
    <element id="EngagementRecord.activity">
      <path value="EngagementRecord.activity" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Activity" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="EngagementRecord.comment">
      <path value="EngagementRecord.comment" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
      <isModifier value="false" />
    </element>
  </differential>
</StructureDefinition>