<?xml version="1.0" encoding="UTF-8"?>

<DeviceAssociation xmlns="http://hl7.org/fhir">
  <id value="implant-association"/>
  <contained>
    <Patient>
      <id value="example-patient"/>
      <name>
        <family value="Doe"/>
        <given value="John"/>
      </name>
    </Patient>
  </contained>
  <contained>
    <Device>
      <id value="implant-device"/>
      <status value="active"/>
      <name>
        <value value="ICD Model X"/>
        <type>
          <coding>
            <code value="model-name"/>
          </coding>
        </type>
      </name>
      <type>
        <coding>
          <system value="urn:iso:std:iso:11073:10101"/>
          <code value="753666"/>
          <display value="MDC_IDC_ENUM_DEV_TYPE_ICD"/>
        </coding>
      </type>
    </Device>
  </contained>
  <contained>
    <BodyStructure>
      <id value="heart-structure"/>
      <includedStructure>
        <structure>
          <coding>
            <system value="http://snomed.info/sct"/>
            <code value="80891009"/>
            <display value="Heart structure"/>
          </coding>
        </structure>
      </includedStructure>
      <description value="Anatomical site for ICD implantation"/>
      <patient>
        <reference value="#example-patient"/>
      </patient>
    </BodyStructure>
  </contained>
  <device>
    <reference value="#implant-device"/>
  </device>
  <status value="active"/>
  <associationStatus>
    <coding>
      <system value="http://hl7.org/fhir/CodeSystem/deviceassociation-association-status"/>
      <code value="attached"/>
      <display value="Attached"/>
    </coding>
  </associationStatus>
  <subject>
    <reference value="#example-patient"/>
  </subject>
  <bodyStructure>
    <reference value="#heart-structure"/>
  </bodyStructure>
  <period>
    <start value="2022-01-01"/>
  </period>
</DeviceAssociation>