﻿<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>
  <entity name='incident'>
    <attribute name='llp_claimnumber'/>
    <attribute name='createdon'/>
    <attribute name='description'/>
    <attribute name='title'/>
    <order attribute='createdon' descending='true'/>
    <filter type='and'>
      <condition attribute='statuscode' value='856900000' operator='eq'/>
    </filter>
    <link-entity name='llp_insurancepolicy' from='llp_insurancepolicyid' to='llp_policyid' link-type='inner' alias='policy'>
      <filter type='and'>
        <condition attribute='llp_policynumber' operator='eq' value='${policyNr}'/>
      </filter>
    </link-entity>
    <link-entity name='account' from='accountid' to='llp_reportingpartner' link-type='outer' alias='provider'>
      <attribute name='name' />
    </link-entity>
  </entity>
</fetch>
