$v === null || $v === '' || (is_numeric($v) && (float) $v == 0.0);
$num = static function ($n, int $d = 0, bool $allowZero = false) use ($isBlank): string {
if (!$allowZero && $isBlank($n)) {
return '';
}
return MaFmt::fmtNum($n, $d);
};
$rs = static function ($n, bool $allowZero = false) use ($isBlank): string {
if (!$allowZero && $isBlank($n)) {
return '';
}
return MaFmt::fmtRs($n);
};
$pct = static function ($n, int $d = 2, bool $allowZero = false) use ($isBlank): string {
if (!$allowZero && $isBlank($n)) {
return '';
}
return MaFmt::fmtPct($n, $d);
};
$lakh = static function ($amount) use ($num): string {
if ($amount === null || $amount === '' || (is_numeric($amount) && (float) $amount == 0.0)) {
return '';
}
return '₹' . $num((float) $amount / 100000, 2) . ' Lakh';
};
$statusKeys = ['paid', 'doc_shortfall', 'policy_exclusion', 'processed', 'in_process'];
$statusNums = ['paid' => 1, 'doc_shortfall' => 2, 'policy_exclusion' => 3, 'processed' => 4, 'in_process' => 5];
$relations = ['Self', 'Spouse', 'Child', 'Parent', 'Others'];
$ageBandList = [
'0-5', '6-10', '11-15', '16-20', '21-25', '26-30', '31-35', '36-40',
'41-45', '46-50', '51-55', '56-60', '61-65', '66-70', '71-more', 'Not classified',
];
$utilBuckets = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'Above 10'];
$amountBandList = [
'Upto 10000', '10001 - 25000', '25001 – 50000', '50001 – 75000', '75001 – 100000',
'100001 – 200000', '200001 – 300000', '300001 – 400000', '400001 - 500000',
'500001 - 750000', '750001 - 1000000', 'Above 1000000',
];
$livesRelCols = [
'employee' => 'Employee', 'spouse' => 'Spouse', 'children' => 'Children',
'father' => 'Father/Father in Law', 'mother' => 'Mother/Mother in Law',
'siblings' => 'Siblings', 'others' => 'Others',
];
$renderMaFooter = static function () use ($meta): void {
$by = trim((string) ($meta['generated_by'] ?? ''));
$at = trim((string) ($meta['upload_at'] ?? $meta['generated_at'] ?? ''));
echo '
';
};
$renderMaHeader = static function (array $meta, array $header, string $logoSrc): void {
?>
>
| = esc($label) ?> |
= esc($num($row['count'] ?? 0, 0, $isTotal)) ?> |
= esc($isTotal ? '' : $pct($row['count_pct'] ?? 0)) ?> |
= esc($rs($row['claim_amount'] ?? 0, $isTotal)) ?> |
= esc($isTotal ? '' : $pct($row['claim_amount_pct'] ?? 0)) ?> |
= esc($rs($row['incurred'] ?? 0, $isTotal)) ?> |
= esc($isTotal ? '' : $pct($row['incurred_pct'] ?? 0)) ?> |
| = (int) $sectionNum ?> = esc($modeLabel) ?> | |
| = (int) $sectionNum ?>.= (int) $subNum ?> = esc($sr['label'] ?? $sk) ?> |
= esc($num($sr['count'] ?? 0)) ?> |
= esc($pct($sr['count_pct'] ?? 0)) ?> |
= esc($rs($sr['claim_amount'] ?? 0)) ?> |
= esc($pct($sr['claim_amount_pct'] ?? 0)) ?> |
= esc($rs($sr['incurred'] ?? 0)) ?> |
= esc($pct($sr['incurred_pct'] ?? 0)) ?> |
| Subtotal |
= esc($num($sub['count'] ?? 0, 0, true)) ?> |
= esc($pct($sub['count_pct'] ?? 0, 2, true)) ?> |
= esc($rs($sub['claim_amount'] ?? 0, true)) ?> |
= esc($pct($sub['claim_amount_pct'] ?? 0, 2, true)) ?> |
= esc($rs($sub['incurred'] ?? 0, true)) ?> |
= esc($pct($sub['incurred_pct'] ?? 0, 2, true)) ?> |
| ';
return;
}
echo '' . esc($num($c, 0, true)) . ' | ' . esc($rs($a, true)) . ' | ';
};
$renderAmountBandRow = static function (array $row, array $relations) use ($num, $rs, $pct): void {
?>
| = esc($row['band'] ?? '') ?> |
0, 'amount' => 0];
$hasData = ((int) ($r['count'] ?? 0)) > 0 || ((float) ($r['amount'] ?? 0)) > 0;
?>
= esc($hasData ? $num($r['count'] ?? 0, 0, true) : '') ?> |
= esc($hasData ? $rs($r['amount'] ?? 0, true) : '') ?> |
0 || ((float) ($t['amount'] ?? 0)) > 0;
?>
= esc($hasTotal ? $num($t['count'] ?? 0, 0, true) : '') ?> |
= esc($hasTotal ? $pct($t['pct'] ?? 0, 2, true) : '') ?> |
= esc($hasTotal ? $rs($t['amount'] ?? 0, true) : '') ?> |
0, 'total_premium' => 0.0, 'earned_premium' => 0.0, 'policy_run_days' => 0];
foreach ($indexPolicies as $ip) {
$indexTotals['lives'] += (int) ($ip['lives'] ?? 0);
$indexTotals['total_premium'] += (float) ($ip['total_premium'] ?? 0);
$indexTotals['earned_premium'] += (float) ($ip['earned_premium'] ?? 0);
$indexTotals['policy_run_days'] = max($indexTotals['policy_run_days'], (int) ($ip['policy_run_days'] ?? 0));
}
$pageBreak = !empty($embed) ? ' page-break' : '';
?>
Medi Assist - Portfolio Analysis Report
This report has been generated for the following policies:
| Policy Number |
Policy Holder |
Policy Start Date |
Policy End Date |
Lives |
Total Premium |
Earned Premium |
Policy Run Days |
| = esc($ip['policy_number'] ?? '') ?> |
= esc($ip['policy_holder'] ?? '') ?> |
= esc($ip['policy_start'] ?? '') ?> |
= esc($ip['policy_end'] ?? '') ?> |
= esc($num($ip['lives'] ?? 0, 0, true)) ?> |
= esc($rs($ip['total_premium'] ?? 0, true)) ?> |
= esc($rs($ip['earned_premium'] ?? 0, true)) ?> |
= esc($num($ip['policy_run_days'] ?? 0, 0, true)) ?> |
| Total | | | |
= esc($num($indexTotals['lives'], 0, true)) ?> |
= esc($rs($indexTotals['total_premium'], true)) ?> |
= esc($rs($indexTotals['earned_premium'], true)) ?> |
= esc($num($indexTotals['policy_run_days'], 0, true)) ?> |
Portfolio Report
As of = esc($portfolioSummary['report_date'] ?? $meta['report_as_on'] ?? '') ?>, the portfolio covers
= esc($num($portfolioSummary['lives'] ?? $livesCurrent, 0, true)) ?> lives. Premium updated in our system is
= esc($lakh($portfolioSummary['premium'] ?? $header['total_premium'] ?? 0)) ?>.
A total of = esc($num($portfolioSummary['claims_count'] ?? 0, 0, true)) ?> claims have been reported, with Incurred Amount of
= esc($lakh($portfolioSummary['incurred'] ?? 0)) ?>.
The Incurred Claims Ratio (ICR) is = esc($pct($portfolioSummary['icr_premium'] ?? 0, 2, true)) ?> on premium updated and
= esc($pct($portfolioSummary['icr_earned'] ?? 0, 2, true)) ?> on Earned Premium.
The claim incidence rate is = esc($pct($portfolioSummary['frequency'] ?? 0, 2, true)) ?> (Incurred Hospitalization claims per 100 lives).
Ratios based on premium in Insurer's System would prevail.
1.0 Policy Lives
| Category | Count |
| 1.1 At Inception* & Addition | = esc($num($livesAtInceptionAndAddition, 0, true)) ?> |
| 1.1.1 At Inception * | = esc($num($livesAddInception, 0, true)) ?> |
| 1.1.2 Addition | = esc($num($livesAddNew, 0, true)) ?> |
| 1.2 Deletion | = esc($livesDeletion != 0 ? $num($livesDeletion, 0, true) : '') ?> |
| Current Lives | = esc($num($livesCurrent, 0, true)) ?> |
2 Policy Premium
| Category | Amount (₹) |
| 2.1 First Time | = esc($num($policyPremium['first_time'] ?? 0, 0, true)) ?> |
| 2.2 Addition | = esc($num($policyPremium['addition'] ?? 0, 0, true)) ?> |
| 2.3 Deletion | = esc($num($policyPremium['deletion'] ?? 0, 0, true)) ?> |
| 2.4 Total Premium | = esc($num($policyPremium['total'] ?? 0, 0, true)) ?> |
| 2.5 Earned Premium (EP) | = esc($num($policyPremium['earned'] ?? 0, 0, true)) ?> |
3 By Claim Status
| Claim Status | Claim Count | % Claim Count | Claim Amount (₹) | % Claim Amount | Incurred Amount (₹) | %Incurred Amount |
Claim Type
| Claim Type | Claim Count | % Claim Count | Claim Amount (₹) | % Claim Amount | Incurred Amount (₹) | %Incurred Amount |
| IP | |
| Total (IP) |
= esc($num($ipTotal['count'] ?? 0, 0, true)) ?> |
= esc($pct($ipTotal['count_pct'] ?? 0, 2, true)) ?> |
= esc($rs($ipTotal['claim_amount'] ?? 0, true)) ?> |
= esc($pct($ipTotal['claim_amount_pct'] ?? 0, 2, true)) ?> |
= esc($rs($ipTotal['incurred'] ?? 0, true)) ?> |
= esc($pct($ipTotal['incurred_pct'] ?? 0, 2, true)) ?> |
| OP | |
| Total (OP) |
= esc($num($opTotal['count'] ?? 0, 0, true)) ?> |
= esc($pct($opTotal['count_pct'] ?? 0, 2, true)) ?> |
= esc($rs($opTotal['claim_amount'] ?? 0, true)) ?> |
= esc($pct($opTotal['claim_amount_pct'] ?? 0, 2, true)) ?> |
= esc($rs($opTotal['incurred'] ?? 0, true)) ?> |
= esc($pct($opTotal['incurred_pct'] ?? 0, 2, true)) ?> |
| Grand Total |
= esc($num($grandTotal['count'] ?? 0, 0, true)) ?> |
= esc($pct($grandTotal['count_pct'] ?? 0, 2, true)) ?> |
= esc($rs($grandTotal['claim_amount'] ?? 0, true)) ?> |
= esc($pct($grandTotal['claim_amount_pct'] ?? 0, 2, true)) ?> |
= esc($rs($grandTotal['incurred'] ?? 0, true)) ?> |
= esc($pct($grandTotal['incurred_pct'] ?? 0, 2, true)) ?> |
8 IP Claim Type
| Type | 8.1 No. of IP Claims | 8.2 Claims made per 100 Lives Insured |
| Cashless | = esc($num($ipClaimFrequency['cashless_count'] ?? 0)) ?> | = esc($pct($ipClaimFrequency['cashless_rate'] ?? 0)) ?> |
| Reimbursement | = esc($num($ipClaimFrequency['reimb_count'] ?? 0)) ?> | = esc($pct($ipClaimFrequency['reimb_rate'] ?? 0)) ?> |
| Total | = esc($num($ipClaimFrequency['total'] ?? 0, 0, true)) ?> | = esc($pct($ipClaimFrequency['total_rate'] ?? 0, 2, true)) ?> |
10 Claims that are in Error
| Status | Claim Count |
| Processed | = esc($num($claimsInError['count'] ?? 0)) ?> |
| Total | = esc($num($claimsInError['count'] ?? 0, 0, true)) ?> |
= esc($pendingIntro) ?>
9 Claims Pending With
| Category |
Medi Assist | Insurer | Member | Provider | Total |
| Claim Count | Incurred Amount (₹) |
Claim Count | Incurred Amount (₹) |
Claim Count | Incurred Amount (₹) |
Claim Count | Incurred Amount (₹) |
Claim Count | Incurred Amount (₹) |
>
| >= esc($pw['label'] ?? '') ?> |
Savings Summary
Total Savings for the portfolio from Proportionate Deduction, Defined Benefit, Copay, Hospital Discounts, FWA, and Case Management is = esc($lakh($savingsTotal)) ?>
| Classification | Claim Count | Savings (₹) |
| = esc($group) ?> | | |
| = esc($sv['label'] ?? '') ?> | = esc($num($sv['count'] ?? 0)) ?> | = esc($rs($sv['amount'] ?? 0)) ?> |
Top 10 Distribution Across Providers (In-Patient Claims)
| Ranking name | Claim Count | % Claim Count | Approved Amount (₹) | % Approved Amount |
| = esc($pr['name'] ?? '') ?> |
= esc($num($pr['count'] ?? 0)) ?> |
= esc($pct($pr['count_pct'] ?? 0)) ?> |
= esc($rs($pr['approved_amount'] ?? 0)) ?> |
= esc($pct($pr['amount_pct'] ?? 0)) ?> |
| Total |
= esc($num($pt['count'] ?? 0, 0, true)) ?> |
= esc($pct($pt['count_pct'] ?? 0, 2, true)) ?> |
= esc($rs($pt['approved_amount'] ?? 0, true)) ?> |
= esc($pct($pt['amount_pct'] ?? 0, 2, true)) ?> |
Top 10 Ailment Group wise Summary (In-Patient Claims)
| Ailment Name | Claim Count | %Claim Count | Approved Amount (₹) | % Approved Amount |
| = esc($ar['name'] ?? '') ?> |
= esc($num($ar['count'] ?? 0)) ?> |
= esc($pct($ar['count_pct'] ?? 0)) ?> |
= esc($rs($ar['approved_amount'] ?? 0)) ?> |
= esc($pct($ar['amount_pct'] ?? 0)) ?> |
| Total |
= esc($num($at['count'] ?? 0, 0, true)) ?> |
= esc($pct($at['count_pct'] ?? 0, 2, true)) ?> |
= esc($rs($at['approved_amount'] ?? 0, true)) ?> |
= esc($pct($at['amount_pct'] ?? 0, 2, true)) ?> |
Distribution Across Beneficiary and Age Wise Summary (In-Patient Claims)
| Relation Type | Claim Count | % Claim Count | Approved Amount (₹) | % Approved Amount |
| = esc($br['relation'] ?? '') ?> |
= esc($num($br['count'] ?? 0)) ?> |
= esc($pct($br['count_pct'] ?? 0)) ?> |
= esc($rs($br['approved_amount'] ?? 0)) ?> |
= esc($pct($br['amount_pct'] ?? 0)) ?> |
| Total |
= esc($num($bt['count'] ?? 0, 0, true)) ?> |
= esc($pct($bt['count_pct'] ?? 0, 2, true)) ?> |
= esc($rs($bt['approved_amount'] ?? 0, true)) ?> |
= esc($pct($bt['amount_pct'] ?? 0, 2, true)) ?> |
Age Wise Summary (In-Patient Claims)
| Age Band Bucket | Lives | Claim Count | % Claim Count | Approved Amount (₹) | % Approved Amount |
$band, 'lives' => 0, 'count' => 0, 'count_pct' => 0, 'approved_amount' => 0, 'amount_pct' => 0];
?>
| = esc($band) ?> |
= esc($num($ab['lives'] ?? 0)) ?> |
= esc($num($ab['count'] ?? 0)) ?> |
= esc($pct($ab['count_pct'] ?? 0)) ?> |
= esc($rs($ab['approved_amount'] ?? 0)) ?> |
= esc($pct($ab['amount_pct'] ?? 0)) ?> |
| Total |
= esc($num($abt['lives'] ?? 0, 0, true)) ?> |
= esc($num($abt['count'] ?? 0, 0, true)) ?> |
= esc($pct($abt['count_pct'] ?? 0, 2, true)) ?> |
= esc($rs($abt['approved_amount'] ?? 0, true)) ?> |
= esc($pct($abt['amount_pct'] ?? 0, 2, true)) ?> |
Utilization Report for Employees (In-Patient Claims)
| No. of Claims | Employees Claim Count | % Claim Count | Approved Amount (₹) | % Approved Amount |
$bucket, 'member_count' => 0, 'count_pct' => 0, 'approved_amount' => 0, 'amount_pct' => 0];
?>
| = esc($bucket) ?> |
= esc($num($ur['member_count'] ?? 0)) ?> |
= esc($pct($ur['count_pct'] ?? 0)) ?> |
= esc($rs($ur['approved_amount'] ?? 0)) ?> |
= esc($pct($ur['amount_pct'] ?? 0)) ?> |
| Total |
= esc($num($uet['member_count'] ?? 0, 0, true)) ?> |
= esc($pct($uet['count_pct'] ?? 0, 2, true)) ?> |
= esc($rs($uet['approved_amount'] ?? 0, true)) ?> |
= esc($pct($uet['amount_pct'] ?? 0, 2, true)) ?> |
Utilization Report for Dependents (In-Patient Claims)
| No. of Claims | Dependents Claim Count | % Claim Count | Approved Amount (₹) | % Approved Amount |
$bucket, 'member_count' => 0, 'count_pct' => 0, 'approved_amount' => 0, 'amount_pct' => 0];
?>
| = esc($bucket) ?> |
= esc($num($ur['member_count'] ?? 0)) ?> |
= esc($pct($ur['count_pct'] ?? 0)) ?> |
= esc($rs($ur['approved_amount'] ?? 0)) ?> |
= esc($pct($ur['amount_pct'] ?? 0)) ?> |
| Total |
= esc($num($udt['member_count'] ?? 0, 0, true)) ?> |
= esc($pct($udt['count_pct'] ?? 0, 2, true)) ?> |
= esc($rs($udt['approved_amount'] ?? 0, true)) ?> |
= esc($pct($udt['amount_pct'] ?? 0, 2, true)) ?> |
= esc($title) ?>
| Amount Band |
Self | Spouse | Child | Parent | Others |
Total |
| Count | Amount | Count | Amount | Count | Amount | Count | Amount | Count | Amount |
Count | % | Amount |
$band, 'relations' => array_fill_keys($relations, ['count' => 0, 'amount' => 0]), 'total' => ['count' => 0, 'amount' => 0, 'pct' => 0]], $relations);
}
$bandTotal = $bandsData['total'] ?? [];
?>
| Total |
0, 'amount' => 0];
$has = ((int) ($r['count'] ?? 0)) > 0 || ((float) ($r['amount'] ?? 0)) > 0;
?>
= esc($has ? $num($r['count'] ?? 0, 0, true) : '') ?> |
= esc($has ? $rs($r['amount'] ?? 0, true) : '') ?> |
= esc($num($bandTotal['count'] ?? 0, 0, true)) ?> |
= esc($pct($bandTotal['pct'] ?? 0, 2, true)) ?> |
= esc($rs($bandTotal['amount'] ?? 0, true)) ?> |
| No. of Claims Pending with | Medi Assist | Insurer | Member | Provider | Total |
>
| >= esc($label) ?> |
= esc($num($counts['medi_assist'] ?? 0)) ?> |
= esc($num($counts['insurer'] ?? 0)) ?> |
= esc($num($counts['member'] ?? 0)) ?> |
= esc($num($counts['provider'] ?? 0)) ?> |
= esc($num($counts['total'] ?? 0, 0, in_array($label, ['Subtotal', 'Total (IP)', 'Total (OP)', 'Grand Total'], true))) ?> |
| Particulars | Inception/Addition | Deletion | Current Lives |
| = esc($lr['particular'] ?? '') ?> |
= esc($num($lr['inception_addition'] ?? null)) ?> |
= esc($lr['deletion'] !== null && $lr['deletion'] !== '' ? $num($lr['deletion'], 0, true) : '') ?> |
= esc($num($lr['current'] ?? null)) ?> |
|
= esc($num($lmt['inception_addition'] ?? 0, 0, true)) ?> |
= esc($lmt['deletion'] !== null && $lmt['deletion'] !== '' ? $num($lmt['deletion'], 0, true) : '') ?> |
= esc($num($lmt['current'] ?? 0, 0, true)) ?> |
| Month | Particulars |
Employee | Spouse | Children |
Father/Father in Law | Mother/Mother in Law |
Siblings | Others |
| Add | Del | Add | Del | Add | Del | Add | Del | Add | Del | Add | Del | Add | Del |
| = esc($mr['month'] ?? '') ?> |
= esc($mr['particular'] ?? '') ?> |
= esc($num($mr[$relKey . '_add'] ?? null)) ?> |
= esc($mr[$relKey . '_del'] !== null && $mr[$relKey . '_del'] !== '' ? $num($mr[$relKey . '_del'], 0, true) : '') ?> |
| Total |
= esc($num($mmt[$relKey . '_add'] ?? 0, 0, true)) ?> |
= esc($num($mmt[$relKey . '_del'] ?? 0, 0, true)) ?> |
| Particulars | Premium | Refund | Total |
| = esc($pr['particular'] ?? '') ?> |
= esc($num($pr['premium'] ?? null)) ?> |
= esc($pr['refund'] !== null && $pr['refund'] !== '' ? $num($pr['refund'], 0, true) : '') ?> |
= esc($num($pr['total'] ?? null, 0, true)) ?> |
| Closing Premium |
= esc($num($pmt['premium'] ?? 0, 0, true)) ?> |
= esc($num($pmt['refund'] ?? 0, 0, true)) ?> |
= esc($num($pmt['total'] ?? 0, 0, true)) ?> |
| Month | Particulars | Premium | Refund | Total |
| = esc($pr['month'] ?? '') ?> |
= esc($pr['particular'] ?? '') ?> |
= esc($num($pr['premium'] ?? null)) ?> |
= esc($pr['refund'] !== null && $pr['refund'] !== '' ? $num($pr['refund'], 0, true) : '') ?> |
= esc($num($pr['total'] ?? null, 0, true)) ?> |
| = esc($pmmt['month'] ?? '') ?> |
= esc($pmmt['particular'] ?? 'Closing Premium') ?> |
= esc($num($pmmt['premium'] ?? 0, 0, true)) ?> |
= esc($num($pmmt['refund'] ?? 0, 0, true)) ?> |
= esc($num($pmmt['total'] ?? 0, 0, true)) ?> |
Report as on: = esc($meta['report_as_on'] ?? '') ?>
Glossary
| Label | Description |
| = esc($g['label'] ?? '') ?> |
= esc($g['description'] ?? '') ?> |