﻿<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>
  <entity name='llp_incident'>
    <attribute name='llp_incidentid' />
    <attribute name='llp_incidentcode' />
    <attribute name='llp_benefitid' />
    <attribute name='llp_incidentstartdate' />
    <attribute name='llp_incidentenddate' />
    <attribute name='llp_incidentreason' />
    <attribute name='llp_firstclinicalsigns' />
    <attribute name='llp_closingincident' />
    <attribute name='llp_documenttype' />
    <attribute name='llp_settleseparately' />
    <attribute name='createdon' />
    <attribute name='statuscode' />
    <attribute name='statecode' />
    <order descending='false' attribute='llp_name' />
    <filter type='and'>
      <condition attribute='llp_incidentcode' operator='eq' value='${incidentNr}' />
    </filter>
    <link-entity name='account' to='llp_providerid' from='accountid' alias='partner' link-type='inner'>
      <attribute name='name' />
    </link-entity>
    <link-entity name='incident' to='llp_claimid' from='incidentid' alias='claim' link-type='outer' visible='false'>
      <attribute name='llp_claimnumber' />
      <attribute name='llp_policyid' />
    </link-entity>
    <link-entity name='llp_policybenefits' to='llp_benefitid' from='llp_policybenefitsid' alias='benefit' link-type='outer' visible='false'>
      <attribute name='llp_benefitname' />
    </link-entity>
    <link-entity name='llp_settlement' to='llp_settlementid' from='llp_settlementid' alias='settlement' link-type='outer' visible='false'>
      <attribute name='llp_amountpayable' />
      <attribute name='llp_amountrequested' />
      <attribute name='statuscode' />
    </link-entity>
  </entity>
</fetch>