provide a mechanism to increase the performance to calculate the balance per insuree - currently full table scans:
create a cache_balance table with those columns per “benefit”
benefit detail name (visit hospital … )
insuree id
benefit id (policy)
date of validity (policy end date) ??
balance (actually approved)
provisional (submitted claim)
temporary (draft claim)
limits
MVP:
initial update:
For all policy,
for all insuree covered by policy
get all claim details covered by policy (column in item and services)
update the common limits
update the individual limits
save all cached inquiry
schedule task to update:
for all claims updates since last run
get all policy details covered by claims (column in item and services)
get all the member of the policy
update the common limits
update the individual limits
save all cached inquiry