protected BaseCalc(ARTSite site, MorbidityForecast forecast, BudgetPeriodInfo periodinfo, int target) { ArtSite = site; Forecast = forecast; PeriodInfo = periodinfo; TargetSelected = target; RTestAlgorithm = null; }
protected BaseCalc(ARTSite site, MorbidityForecast forecast, BudgetPeriodInfo periodinfo, int target) { ArtSite = site; Forecast = forecast; PeriodInfo = periodinfo; TargetSelected = target; RTestAlgorithm = null; }
public CalcPatientNumber(ARTSite site, MorbidityForecast forecast, BudgetPeriodInfo periodinfo, int target) : base(site, forecast, periodinfo, target) { _calcPatientNos = new Dictionary <int, CalculatedSitePatientNumber>(); if (site.NTTPercentOfChildren > 0) { ArtPedTargetOnMonth0 = site.GetNTTMonthValue(0) * (site.NTTPercentOfChildren / 100d); ArtAdulTargetOnMonth0 = site.GetNTTMonthValue(0) - ArtPedTargetOnMonth0; for (int i = 1; i <= 12; i++) { CalculatedSitePatientNumber calcPatientNo = new CalculatedSitePatientNumber(); calcPatientNo.Month = i; calcPatientNo.ArtPedMonthlyTarget = site.GetNTTMonthValue(i) * (site.NTTPercentOfChildren / 100d); calcPatientNo.ArtAdultMonthlyTarget = site.GetNTTMonthValue(i) - calcPatientNo.ArtPedMonthlyTarget; _calcPatientNos.Add(i, calcPatientNo); } } else { ArtPedTargetOnMonth0 = periodinfo.DefultMonthValue[0]; ArtAdulTargetOnMonth0 = site.GetNTTMonthValue(0) - ArtPedTargetOnMonth0; for (int i = 1; i <= 12; i++) { CalculatedSitePatientNumber calcPatientNo = new CalculatedSitePatientNumber(); calcPatientNo.Month = i; calcPatientNo.ArtPedMonthlyTarget = periodinfo.DefultMonthValue[i]; calcPatientNo.ArtAdultMonthlyTarget = site.GetNTTMonthValue(i) - calcPatientNo.ArtPedMonthlyTarget; _calcPatientNos.Add(i, calcPatientNo); } } //Pre-ART Target Breakdown (as entered by the user) if (site.NTPTPercentOfChildren > 0) { PreArtPedTargetOnMonth0 = site.GetNTPTMonthValue(0) * (site.NTPTPercentOfChildren / 100d); PreArtAdulTargetOnMonth0 = site.GetNTPTMonthValue(0) - PreArtPedTargetOnMonth0; for (int i = 1; i <= 12; i++) { _calcPatientNos[i].PreArtPedMonthlyTarget = site.GetNTPTMonthValue(i) * (site.NTPTPercentOfChildren / 100d); _calcPatientNos[i].PreArtAdultMonthlyTarget = site.GetNTPTMonthValue(i) - _calcPatientNos[i].PreArtPedMonthlyTarget; } } else { PreArtPedTargetOnMonth0 = periodinfo.DefultMonthValue[0]; PreArtAdulTargetOnMonth0 = site.GetNTPTMonthValue(0) - PreArtPedTargetOnMonth0; for (int i = 1; i <= 12; i++) { _calcPatientNos[i].PreArtPedMonthlyTarget = periodinfo.DefultMonthValue[i]; _calcPatientNos[i].PreArtAdultMonthlyTarget = site.GetNTPTMonthValue(i) - _calcPatientNos[i].PreArtPedMonthlyTarget; } } AdultsMonthlyAttritionRateInTreatment = Math.Round(1d - (Math.Pow(1d - (site.AITAnnualPatientAttrition / 100d), 1d / 12d)), 4, MidpointRounding.ToEven); AdultsMonthlyAttritionRateInPreART = Math.Round(1d - (Math.Pow(1d - (site.AIPAnualPatientAttrition / 100d), 1d / 12d)), 4, MidpointRounding.ToEven); AdultMonthlyMigrationtoTreatment = Math.Round(1d - (Math.Pow(1d - (site.AIPAnnualMigration / 100d), 1d / 12d)), 4, MidpointRounding.ToEven); AdultCombinedMonthlyRate = AdultsMonthlyAttritionRateInPreART + AdultMonthlyMigrationtoTreatment; PediatricsMonthlyAttritionRateinTreatment = Math.Round(1d - Math.Pow((1d - (site.PITAnnualPatientAttrition / 100d)), (1d / 12d)), 4, MidpointRounding.ToEven); PediatricsMonthlyAttritionRateinPreART = Math.Round(1 - (Math.Pow(1d - (site.PIPAnualPatientAttrition / 100d), 1d / 12d)), 4, MidpointRounding.ToEven); PedMonthlyMigrationtoTreatment = Math.Round(1 - (Math.Pow(1d - (site.PIPAnnualMigration / 100d), 1d / 12d)), 4, MidpointRounding.ToEven); PedCombinedMonthlyRate = PediatricsMonthlyAttritionRateinPreART + PedMonthlyMigrationtoTreatment; //CurrentPatientsAtSiteInTreatment = site.TimeZeroPatientOnTreatment; //CurrentPatientsAtSiteInPreArt = site.TimeZeroPatientOnPreTreatment; CurrentAdultinTreatment = site.TimeZeroPatientOnTreatment * (1d - (site.NTTPercentOfChildren / 100d)); CurrentPediatricinTreatment = site.TimeZeroPatientOnTreatment * (site.NTTPercentOfChildren / 100d); CurrentAdultinPreArt = site.TimeZeroPatientOnPreTreatment * (1d - (site.NTPTPercentOfChildren / 100d)); CurrentPediatricinPreArt = site.TimeZeroPatientOnPreTreatment * (site.NTPTPercentOfChildren / 100d); TestingEfficiency = Math.Round((site.AdultTestingEfficiency / 100d), 4, MidpointRounding.ToEven); UseTestingE = forecast.PreTreatmentPatinetTargetEnum == Core.Util.OptPreTreatmentPatinetTargetEnum.TestingEfficiency; }
public CalcRapidTest(ARTSite site, MorbidityForecast forecast, BudgetPeriodInfo periodinfo, int target, RapidTestAlgorithm rtestAlgorithm) : base(site, forecast, periodinfo, target,rtestAlgorithm) { _lstPrimaryQuanReagents = new ListOfPrimeryQR(ClassOfMorbidityTestEnum.RapidTest); }
public CalcRapidTest(ARTSite site, MorbidityForecast forecast, BudgetPeriodInfo periodinfo, int target, RapidTestAlgorithm rtestAlgorithm) : base(site, forecast, periodinfo, target, rtestAlgorithm) { _lstPrimaryQuanReagents = new ListOfPrimeryQR(ClassOfMorbidityTestEnum.RapidTest); }
public CalcOtherTest(ARTSite site, MorbidityForecast forecast, BudgetPeriodInfo periodinfo, int target) : base(site, forecast, periodinfo, target) { _lstPrimaryQuanReagents = new ListOfPrimeryQR(ClassOfMorbidityTestEnum.OtherTest); }
public CalcViralLoad(ARTSite site, MorbidityForecast forecast, BudgetPeriodInfo periodinfo, int target) : base(site, forecast, periodinfo, target) { _lstPrimaryQuanReagents = new ListOfPrimeryQR(ClassOfMorbidityTestEnum.ViralLoad); }
public CalcPatientNumber(ARTSite site, MorbidityForecast forecast, BudgetPeriodInfo periodinfo, int target) : base(site, forecast, periodinfo, target) { _calcPatientNos = new Dictionary<int, CalculatedSitePatientNumber>(); if (site.NTTPercentOfChildren > 0) { ArtPedTargetOnMonth0 = site.GetNTTMonthValue(0) * (site.NTTPercentOfChildren / 100d); ArtAdulTargetOnMonth0 = site.GetNTTMonthValue(0) - ArtPedTargetOnMonth0; for (int i = 1; i <= 12; i++) { CalculatedSitePatientNumber calcPatientNo = new CalculatedSitePatientNumber(); calcPatientNo.Month = i; calcPatientNo.ArtPedMonthlyTarget = site.GetNTTMonthValue(i) * (site.NTTPercentOfChildren / 100d); calcPatientNo.ArtAdultMonthlyTarget = site.GetNTTMonthValue(i) - calcPatientNo.ArtPedMonthlyTarget; _calcPatientNos.Add(i, calcPatientNo); } } else { ArtPedTargetOnMonth0 = periodinfo.DefultMonthValue[0]; ArtAdulTargetOnMonth0 = site.GetNTTMonthValue(0) - ArtPedTargetOnMonth0; for (int i = 1; i <= 12; i++) { CalculatedSitePatientNumber calcPatientNo = new CalculatedSitePatientNumber(); calcPatientNo.Month = i; calcPatientNo.ArtPedMonthlyTarget =periodinfo.DefultMonthValue[i]; calcPatientNo.ArtAdultMonthlyTarget = site.GetNTTMonthValue(i) - calcPatientNo.ArtPedMonthlyTarget; _calcPatientNos.Add(i, calcPatientNo); } } //Pre-ART Target Breakdown (as entered by the user) if (site.NTPTPercentOfChildren > 0) { PreArtPedTargetOnMonth0 = site.GetNTPTMonthValue(0) * (site.NTPTPercentOfChildren / 100d); PreArtAdulTargetOnMonth0 = site.GetNTPTMonthValue(0) - PreArtPedTargetOnMonth0; for (int i = 1; i <= 12; i++) { _calcPatientNos[i].PreArtPedMonthlyTarget = site.GetNTPTMonthValue(i) * (site.NTPTPercentOfChildren / 100d); _calcPatientNos[i].PreArtAdultMonthlyTarget = site.GetNTPTMonthValue(i) - _calcPatientNos[i].PreArtPedMonthlyTarget; } } else { PreArtPedTargetOnMonth0 =periodinfo.DefultMonthValue[0]; PreArtAdulTargetOnMonth0 = site.GetNTPTMonthValue(0) - PreArtPedTargetOnMonth0; for (int i = 1; i <= 12; i++) { _calcPatientNos[i].PreArtPedMonthlyTarget = periodinfo.DefultMonthValue[i]; _calcPatientNos[i].PreArtAdultMonthlyTarget = site.GetNTPTMonthValue(i) - _calcPatientNos[i].PreArtPedMonthlyTarget; } } AdultsMonthlyAttritionRateInTreatment = Math.Round(1d - (Math.Pow(1d - (site.AITAnnualPatientAttrition / 100d), 1d / 12d)), 4, MidpointRounding.ToEven); AdultsMonthlyAttritionRateInPreART = Math.Round(1d - (Math.Pow(1d - (site.AIPAnualPatientAttrition / 100d), 1d / 12d)), 4, MidpointRounding.ToEven); AdultMonthlyMigrationtoTreatment = Math.Round(1d - (Math.Pow(1d - (site.AIPAnnualMigration / 100d), 1d / 12d)), 4, MidpointRounding.ToEven); AdultCombinedMonthlyRate = AdultsMonthlyAttritionRateInPreART + AdultMonthlyMigrationtoTreatment; PediatricsMonthlyAttritionRateinTreatment = Math.Round(1d - Math.Pow((1d - (site.PITAnnualPatientAttrition / 100d)), (1d / 12d)), 4, MidpointRounding.ToEven); PediatricsMonthlyAttritionRateinPreART =Math.Round( 1 - (Math.Pow(1d - (site.PIPAnualPatientAttrition / 100d), 1d / 12d)), 4, MidpointRounding.ToEven); PedMonthlyMigrationtoTreatment = Math.Round(1 - (Math.Pow(1d - (site.PIPAnnualMigration / 100d), 1d / 12d)), 4, MidpointRounding.ToEven); PedCombinedMonthlyRate = PediatricsMonthlyAttritionRateinPreART + PedMonthlyMigrationtoTreatment; //CurrentPatientsAtSiteInTreatment = site.TimeZeroPatientOnTreatment; //CurrentPatientsAtSiteInPreArt = site.TimeZeroPatientOnPreTreatment; CurrentAdultinTreatment = site.TimeZeroPatientOnTreatment * (1d - (site.NTTPercentOfChildren / 100d)); CurrentPediatricinTreatment = site.TimeZeroPatientOnTreatment * (site.NTTPercentOfChildren / 100d); CurrentAdultinPreArt = site.TimeZeroPatientOnPreTreatment * (1d - (site.NTPTPercentOfChildren / 100d)); CurrentPediatricinPreArt = site.TimeZeroPatientOnPreTreatment * (site.NTPTPercentOfChildren / 100d); TestingEfficiency = Math.Round((site.AdultTestingEfficiency / 100d), 4, MidpointRounding.ToEven); UseTestingE = forecast.PreTreatmentPatinetTargetEnum == Core.Util.OptPreTreatmentPatinetTargetEnum.TestingEfficiency; }
private BudgetPeriodInfo InitPeriodInfo() { BudgetPeriodInfo peridoInfo = new BudgetPeriodInfo(); peridoInfo.FirstMonth = 1; if (_forecast.StartBudgetPeriod > _forecast.EndBudgetPeriod) { peridoInfo.LastMonth = ((12 - _forecast.StartBudgetPeriod) + 1) + _forecast.EndBudgetPeriod; peridoInfo.NumberofMonthsinBudgetPeriod = (_forecast.EndBudgetPeriod + 12) - _forecast.StartBudgetPeriod + 1; } else { peridoInfo.LastMonth = (_forecast.EndBudgetPeriod - _forecast.StartBudgetPeriod) + 1; peridoInfo.NumberofMonthsinBudgetPeriod = (_forecast.EndBudgetPeriod - _forecast.StartBudgetPeriod) + 1; } peridoInfo.BufferStoks = _invAssumption.SecurityStock; peridoInfo.BeginsOnmonth = peridoInfo.LastMonth + 1; peridoInfo.EndOnMonth = peridoInfo.LastMonth + peridoInfo.BufferStoks; if (peridoInfo.EndOnMonth > 13) peridoInfo.NumberofBufferMonthsBeyondForecast = peridoInfo.EndOnMonth - 13; else peridoInfo.NumberofBufferMonthsBeyondForecast = 0; peridoInfo.WeeksinBudgetPeriod = Convert.ToInt32(Math.Ceiling((peridoInfo.NumberofMonthsinBudgetPeriod * 30d) / 7d)); peridoInfo.QuartersinBudgetPeriod = Convert.ToInt32(Math.Ceiling(peridoInfo.NumberofMonthsinBudgetPeriod / 3d)); return peridoInfo; }