private ClassOfChemistryTests[] GetCalculatedReferredForChemistry(IList <int> siteIds) { ClassOfChemistryTests[] result = new ClassOfChemistryTests[13]; for (int i = 0; i <= 12; i++) { result[i] = new ClassOfChemistryTests(); } foreach (int id in siteIds) { MorbidityCalcContainer m = _listOfMorbidityCalcContainers[id]; for (int i = 1; i <= 12; i++) { ClassOfChemistryTests ctest = result[i - 1]; foreach (ChemistrySymptomDirectedTest csdt in m.ChemistryCalculation.GetChemistryTestOutputs[i].ChemSymptomDirectedTest) { ctest.SetChemTestValue(csdt.TestId, ctest.GetChemTestValue(csdt.TestId) + csdt.TestsReferredtoAnotherFacility); } ctest.TotalSamples += m.ChemistryCalculation.GetChemistryTestOutputs[i].TotalChemistrySamples; } ClassOfChemistryTests cbeyond = result[12]; foreach (ChemistrySymptomDirectedTest csdt in m.ChemistryCalculation.GetChemistryTestOutputs[1].ChemSymptomDirectedTest) { cbeyond.SetChemTestValue(csdt.TestId, cbeyond.GetChemTestValue(csdt.TestId) + m.ChemistryCalculation.SubtotalBufferTestBeyondForecast(csdt.TestId)); } cbeyond.TotalSamples += m.ChemistryCalculation.TotalChemistrySamplesBeyoundForecast(); } return(result); }
/// <summary> /// sample referral /// </summary> /// <param name="result"></param> public void SetTestsReceivedFromReferringSites(ClassOfChemistryTests[] result) { //ChemistryTestNameEnum[] chemTests = LqtUtil.EnumToArray<ChemistryTestNameEnum>(); for (int i = 1; i <= 12; i++) { //for (int x = 0; x < chemTests.Length; x++) foreach (Test t in _testingArea.Tests) { ChemistrySymptomDirectedTest csdt = _chemMonthlyOutputs[i].GetChemSymptomDirectedTestById(t.Id); if ((i + 1) >= PeriodInfo.FirstMonth && (i + 1) <= PeriodInfo.LastMonth) { csdt.TestsonInstrumentForecastPeriodFromReferringSites = result[i - 1].GetChemTestValue(t.Id); } if ((i + 1) > PeriodInfo.LastMonth) { csdt.TestsonInstrumentBufferStockFromReferringSites = result[i - 1].GetChemTestValue(t.Id); } } if ((i + 1) >= PeriodInfo.FirstMonth && (i + 1) <= PeriodInfo.LastMonth) { _chemMonthlyOutputs[i].TotalSampleForecastPeriodRecivedFromReferrSites = result[i - 1].TotalSamples; } if ((i + 1) > PeriodInfo.LastMonth) { _chemMonthlyOutputs[i].TotalSampleBufferStockRecivedFromReferrSites = result[i - 1].TotalSamples; } } _testsReceivedFromReferringSitesBeyondForecast = result[12]; }
private ClassOfChemistryTests[] GetCalculatedReferredForChemistry(IList<int> siteIds) { ClassOfChemistryTests[] result = new ClassOfChemistryTests[13]; for (int i = 0; i <= 12; i++) { result[i] = new ClassOfChemistryTests(); } foreach (int id in siteIds) { MorbidityCalcContainer m = _listOfMorbidityCalcContainers[id]; for (int i = 1; i <= 12; i++) { ClassOfChemistryTests ctest = result[i - 1]; foreach (ChemistrySymptomDirectedTest csdt in m.ChemistryCalculation.GetChemistryTestOutputs[i].ChemSymptomDirectedTest) { ctest.SetChemTestValue(csdt.TestName, ctest.GetChemTestValue(csdt.TestName) + csdt.TestsReferredtoAnotherFacility); } ctest.TotalSamples += m.ChemistryCalculation.GetChemistryTestOutputs[i].TotalChemistrySamples; } ClassOfChemistryTests cbeyond = result[12]; foreach (ChemistrySymptomDirectedTest csdt in m.ChemistryCalculation.GetChemistryTestOutputs[1].ChemSymptomDirectedTest) { cbeyond.SetChemTestValue(csdt.TestName, cbeyond.GetChemTestValue(csdt.TestName) + m.ChemistryCalculation.SubtotalBufferTestBeyondForecast(csdt.TestName)); } cbeyond.TotalSamples += m.ChemistryCalculation.TotalChemistrySamplesBeyoundForecast(); } return result; }
/// <summary> /// sample referral /// </summary> /// <param name="result"></param> public void SetTestsReceivedFromReferringSites(ClassOfChemistryTests[] result) { ChemistryTestNameEnum[] chemTests = LqtUtil.EnumToArray<ChemistryTestNameEnum>(); for (int i = 1; i <= 12; i++) { for (int x = 0; x < chemTests.Length; x++) { ChemistrySymptomDirectedTest csdt = _chemMonthlyOutputs[i].GetChemSymptomDirectedTestById(chemTests[x]); if ((i + 1) >= PeriodInfo.FirstMonth && (i + 1) <= PeriodInfo.LastMonth) csdt.TestsonInstrumentForecastPeriodFromReferringSites = result[i - 1].GetChemTestValue(chemTests[x]); if ((i + 1) > PeriodInfo.LastMonth) csdt.TestsonInstrumentBufferStockFromReferringSites = result[i - 1].GetChemTestValue(chemTests[x]); } if ((i + 1) >= PeriodInfo.FirstMonth && (i + 1) <= PeriodInfo.LastMonth) _chemMonthlyOutputs[i].TotalSampleForecastPeriodRecivedFromReferrSites = result[i - 1].TotalSamples; if ((i + 1) > PeriodInfo.LastMonth) _chemMonthlyOutputs[i].TotalSampleBufferStockRecivedFromReferrSites = result[i - 1].TotalSamples; } _testsReceivedFromReferringSitesBeyondForecast = result[12]; }