generated from BuildforSDG-Cohort1-Assessment/covid-19-estimator-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathestimator.js
30 lines (27 loc) · 1.28 KB
/
estimator.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const covid19ImpactEstimator = (data) => data;
export default covid19ImpactEstimator;
let output ={
data:{
hospitalBedsByRequestedTime='',
casesForICUByRequestedTime=''
},
impact:{
currentlyInfected:'',
infectionsByRequestedTime:'',
dollarsInFlight:''
},
severeImpact:{
currentlyInfected:'',
infectionsByRequestedTime:'',
severeCasesByRequestedTime: ''
}
};
output.impact.currentlyInfected=(covid19ImpactEstimator.reportedCases)*10;
output.severeImpact.currentlyInfected=(covid19ImpactEstimator.reportedCases)*50;
output.impact.infectionsByRequestedTime=(output.impact.currentlyInfected)*(Math.pow(2,10));
output.severeImpact.infectionsByRequestedTime=(output.severeImpact.currentlyInfected)*(Math.pow(2,10));
output.severeImpact.severeCasesByRequestedTime=(output.severeImpact.infectionsByRequestedTime)*0.15;
output.data.hospitalBedsByRequestedTime=(output.severeImpact.severeCasesByRequestedTime)-(covid19ImpactEstimator.totalHospitalBeds*(0.65));
output.data.casesForICUByRequestedTime=(output.impact.infectionsByRequestedTime*(0.2));
output.data.casesForVentilatorsByRequestedTime=(output.impact.infectionsByRequestedTime*(0.2));
output.data.dollarsInFlight=((output.impact.infectionsByRequestedTime*0.65)*1.5*30);