/// <summary>Creates aggregate data.</summary> /// <param name="orgId"> The organization.</param> /// <param name="deviceData"> [out] Information describing the device.</param> /// <param name="patientData">[out] Information describing the patient.</param> /// <param name="testData"> [out] Information describing the test.</param> /// <param name="workerData"> [out] Information describing the worker.</param> private static void CreateAggregateData( string orgId, out OrgDeviceData deviceData, out OrgPatientData patientData, out OrgTestData testData, out OrgWorkerData workerData) { int initialBedCount; if (_useLookup) { initialBedCount = HospitalManager.BedsForHospital(orgId); } else { initialBedCount = GeoManager.BedsForHospital(); } double icuRate = (_rand.NextDouble() * (_maxIcuPercent - _minIcuPercent)) + _minIcuPercent; int icuBeds = (int)(initialBedCount * icuRate); if (icuBeds < 1) { icuBeds = 1; } int inpatientBeds = initialBedCount - icuBeds; int ventilators = (int)(icuBeds * _ventilatorsPerIcu); if (ventilators < 1) { ventilators = 1; } // create device data for this org deviceData = new OrgDeviceData( initialBedCount, inpatientBeds, icuBeds, ventilators); // figure out patient numbers based on initial capacity int patients = (int)(initialBedCount * _initialOccupancy); int positive = (int)(patients * _positiveTestRate); int positiveNeedIcu = (int)(positive * _patientToIcuRate); int positiveNeedVent = (int)(positive * _icuToVentilatorRate); int negative = patients - positive; int negativeNeedIcu = 0; // (int)(negative * _patientToIcuRate); int negativeNeedVent = 0; // (int)(negativeNeedIcu * _icuToVentilatorRate); int onsetInCare = 0; int recovered = 0; int dead = 0; // create patient data patientData = new OrgPatientData( patients, positive, positiveNeedIcu, positiveNeedVent, negative, negativeNeedIcu, negativeNeedVent, onsetInCare, recovered, dead); // extrapolate test data int performedTests = (int)(patients / _hospitalizationRate); int positiveTests = (int)(performedTests * _positiveTestRate); int negativeTests = performedTests - positive; int pendingTests = _rand.Next(0, 10); performedTests += pendingTests; // create test data record testData = new OrgTestData( performedTests, positiveTests, negativeTests, pendingTests); workerData = new OrgWorkerData(); }