neherlab / covid19_scenarios

Models of COVID-19 outbreak trajectories and hospital demand
https://covid19-scenarios.org
MIT License
1.36k stars 354 forks source link

Palliative flux added #752

Closed tiagoandresvaz closed 4 years ago

tiagoandresvaz commented 4 years ago

Related issues and PRs

Description

To implement the new proposed flux in the model and interfaces according to the discussion above.

Impacted Areas in the application

Model changes highlights:

severity.forEach(({ ageGroup, confirmed, critical, isolated, fatal, severe, palliative}, i) => { const freq = (1.0 ageDistribution[i].population) / total sim.ageDistribution[i].population = freq sim.frac.severe[i] = (severe / 100) (confirmed / 100) sim.frac.critical[i] = sim.frac.severe[i] (critical / 100) sim.frac.fatal[i] = sim.frac.critical[i] (fatal / 100) NEW> sim.frac.palliative[i] = sim.frac.severe[i] * (palliative / 100) ...

 NEW> const dPalliative = palliative / 100

// Age specific rates
sim.frac.isolated[i] = isolated / 100
sim.rate.recovery[i] = (1 - dHospital) / infectiousPeriodDays
sim.rate.severe[i] = dHospital / infectiousPeriodDays
OLD>sim.rate.discharge[i] = (1 - dCritical) / hospitalStayDays
NEW> sim.rate.discharge[i] = (1 - dCritical - dPalliative) / hospitalStayDays
NEW> sim.rate.palliative[i] = dPalliative / hospitalStayDays
sim.rate.critical[i] = dCritical / hospitalStayDays
sim.rate.stabilize[i] = (1 - dFatal) / icuStayDays
sim.rate.fatality[i] = dFatal / icuStayDays

...

grad.cumulative.recovered[age] = flux.infectious.recovered[age] + flux.severe.recovered[age] grad.cumulative.hospitalized[age] = flux.infectious.severe[age] grad.cumulative.critical[age] = flux.severe.critical[age] OLD grad.cumulative.fatality[age] = flux.critical.fatality[age] + flux.overflow.fatality[age] NEW grad.cumulative.fatality[age] = flux.critical.fatality[age] + flux.overflow.fatality[age] + flux.severe.palliative[age]

Testing

vercel[bot] commented 4 years ago

This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/neherlab/covid19-scenarios/5763t8hp7 ✅ Preview: https://covid19-scenarios-git-fork-tiagoandresvaz-master.neherlab.vercel.app

codeclimate[bot] commented 4 years ago

Code Climate has analyzed commit 671b35e1 and detected 0 issues on this pull request.

View more on Code Climate.