private void LoadPatientAssumptions() { PatientsNoofTest _p = DataRepository.GetPatientsNoofTestSummery(_forecast.Id); if (_p != null) { double[] yval = { Math.Round(_p.PITMonth1), Math.Round(_p.PITMonth2), Math.Round(_p.PITMonth3), Math.Round(_p.PITMonth4), Math.Round(_p.PITMonth5), Math.Round(_p.PITMonth6), Math.Round(_p.PITMonth7), Math.Round(_p.PITMonth8), Math.Round(_p.PITMonth9), Math.Round(_p.PITMonth10), Math.Round(_p.PITMonth11), Math.Round(_p.PITMonth12) }; string[] xval = new string[12]; for (int i = 0; i < 12; i++) { xval[i] = "Month " + (i + 1); } chartPatientAss.Series["Series1"].Points.DataBindXY(xval, yval); double[] yval1 = { Math.Round(_p.PPARTMonth1), Math.Round(_p.PPARTMonth2), Math.Round(_p.PPARTMonth3), Math.Round(_p.PPARTMonth4), Math.Round(_p.PPARTMonth5), Math.Round(_p.PPARTMonth6), Math.Round(_p.PPARTMonth7), Math.Round(_p.PPARTMonth8), Math.Round(_p.PPARTMonth9), Math.Round(_p.PPARTMonth10), Math.Round(_p.PPARTMonth11), Math.Round(_p.PPARTMonth12) }; string[] xval1 = new string[12]; for (int i = 0; i < 12; i++) { xval1[i] = "Month " + (i + 1); } chartPatientAss.Series["Series4"].Points.DataBindXY(xval1, yval1); } chartPatientAss.Update(); chartPatientAss.Show(); }
private void chartMPatientNo_Load(object sender, EventArgs e) { _p = DataRepository.GetPatientsNoofTestSummery(_ForecastId); double[] yval = { Math.Round(_p.PITMonth1), Math.Round(_p.PITMonth2), Math.Round(_p.PITMonth3), Math.Round(_p.PITMonth4), Math.Round(_p.PITMonth5), Math.Round(_p.PITMonth6), Math.Round(_p.PITMonth7), Math.Round(_p.PITMonth8), Math.Round(_p.PITMonth9), Math.Round(_p.PITMonth10), Math.Round(_p.PITMonth11), Math.Round(_p.PITMonth12) }; string[] xval = new string[12]; for (int i = 0; i < 12; i++) { int y = i + 1; xval[i] = "Month " + y; } chart1.Series["Series1"].Points.DataBindXY(xval, yval); double[] yval1 = { Math.Round(_p.PPARTMonth1), Math.Round(_p.PPARTMonth2), Math.Round(_p.PPARTMonth3), Math.Round(_p.PPARTMonth4), Math.Round(_p.PPARTMonth5), Math.Round(_p.PPARTMonth6), Math.Round(_p.PPARTMonth7), Math.Round(_p.PPARTMonth8), Math.Round(_p.PPARTMonth9), Math.Round(_p.PPARTMonth10), Math.Round(_p.PPARTMonth11), Math.Round(_p.PPARTMonth12) }; string[] xval1 = new string[12]; for (int i = 0; i < 12; i++) { int y = i + 1; xval1[i] = "Month " + y; } chart1.Series["Series4"].Points.DataBindXY(xval1, yval1); }
public void CalculateTestConducted() { int count = 1; foreach (ARTSite site in _artSites) { if (UpdateCalculationEvent != null) { UpdateCalculationEvent(count, new PerformMorbidityCalculationArgs() { SiteName = site.Site.SiteName, ArgumentType = 1 }); } count++; _peridoInfo.WorkingDaysinBudgetPeriod = _peridoInfo.NumberofMonthsinBudgetPeriod * site.Site.MaxWorkingDays(); CalcPatientNumber calcPatientNo = new CalcPatientNumber(site, _forecast, _peridoInfo, _targetSelected); calcPatientNo.DoCalculation(); ArtSiteCalculated scalculated = new ArtSiteCalculated(site.Site.Id); scalculated.SiteName = site.Site.SiteName; Dictionary <int, CalculatedSitePatientNumber> pNumbers = calcPatientNo.CalculatedPatientNumbers; scalculated.PatientNumbers = pNumbers; PatientsNoofTest ptest = new PatientsNoofTest(); ptest.SiteId = site.Site.Id; ptest.ForecastId = _forecast.Id; for (int i = 1; i <= 12; i++) { ptest.SetArtPatinetNumber(i, pNumbers[i].TotalPatinetInTreatment()); ptest.SetPreArtPatinetNumber(i, pNumbers[i].TotalPatientInPreART()); } scalculated.PatinetNoOfTest = ptest; //--------------------end patient numbers---------------------- CalcRapidTest calcRapid = new CalcRapidTest(site, _forecast, _peridoInfo, _targetSelected, _rapidTestAlgorithm); calcRapid.CalculatedPatientNos = pNumbers; calcRapid.RapidTestPlatformQuantifyObject = _platformFactory.RapidTestPlatform; InitBaseCalcValue(calcPatientNo, calcRapid); calcRapid.DoCalculation(); scalculated.RapidNumberofTest = calcRapid.RapidNumberofTest(); CopySupplyForecast(calcRapid.QuantifyedReagents(), scalculated.TestReagents); //--------------------end rapid test---------------------- MorbidityCalcContainer mcalcContainer = new MorbidityCalcContainer(site.Site.Id); //--------------------init container---------------------- CalcCD4Test calcCd4 = new CalcCD4Test(site, _forecast, _peridoInfo, _targetSelected); calcCd4.CalculatedPatientNos = pNumbers; calcCd4.TestingArea = CD4TestingArea; calcCd4.RapidTestOutputs = calcRapid.RapidTestOutputs; calcCd4.CD4TestProtocol = _cd4Protocol; InitBaseCalcValue(calcPatientNo, calcCd4); calcCd4.CalculateTestConducted(); mcalcContainer.CD4Calculation = calcCd4; mcalcContainer.CD4ReferedSites = DataRepository.GetListOfReferedSites(scalculated.SiteId, ClassOfMorbidityTestEnum.CD4.ToString()); //--------------------end CD4 test---------------------- CalcHematology calcHema = new CalcHematology(site, _forecast, _peridoInfo, _targetSelected); calcHema.CalculatedPatientNos = pNumbers; calcHema.TestingArea = HematologyTestingArea; calcHema.HemTestProtocol = _hemProtocol; InitBaseCalcValue(calcPatientNo, calcHema); calcHema.CalculateTestConducted(); mcalcContainer.HematologyCalculation = calcHema; mcalcContainer.HemaReferedSites = DataRepository.GetListOfReferedSites(scalculated.SiteId, ClassOfMorbidityTestEnum.Hematology.ToString()); //--------------------end Hema test---------------------- CalcViralLoad calcVl = new CalcViralLoad(site, _forecast, _peridoInfo, _targetSelected); calcVl.CalculatedPatientNos = pNumbers; calcVl.TestingArea = ViralLoadTestingArea; calcVl.VLTestProtocol = _vilProtocol; InitBaseCalcValue(calcPatientNo, calcVl); calcVl.CalculateTestConducted(); mcalcContainer.ViralLoadCalculation = calcVl; mcalcContainer.ViraReferedSites = DataRepository.GetListOfReferedSites(scalculated.SiteId, ClassOfMorbidityTestEnum.ViralLoad.ToString()); //--------------------end VL test---------------------- CalcChemistryTest calcChem = new CalcChemistryTest(site, _forecast, _peridoInfo, _targetSelected); calcChem.CalculatedPatientNos = pNumbers; calcChem.TestingArea = ChemistryTestingArea; calcChem.ChemTestProtocol = _cheProtocol; InitBaseCalcValue(calcPatientNo, calcChem); calcChem.CalculateTestConducted(); mcalcContainer.ChemistryCalculation = calcChem; mcalcContainer.ChemReferedSites = DataRepository.GetListOfReferedSites(scalculated.SiteId, ClassOfMorbidityTestEnum.Chemistry.ToString()); //--------------------end Chemistry test---------------------- CalcConsumable calcCon = new CalcConsumable(site, _forecast, _peridoInfo, _targetSelected); calcCon.CalculatedPatientNos = pNumbers; calcCon.ConsumablePlatformQuantifyObject = _platformFactory.ConsumablePlatform; calcCon.CD4MonthlyOutputs = calcCd4.GetCD4TestOutputs; calcCon.RapidTestOutputs = calcRapid.RapidTestOutputs; calcCon.RapidTestCalculator = calcRapid; calcCon.CD4TestCalculator = calcCd4; calcCon.ChemistryTestCalculator = calcChem; calcCon.HematologyTestCalculator = calcHema; calcCon.ViralTestCalculator = calcVl; InitBaseCalcValue(calcPatientNo, calcCon); mcalcContainer.ConsumableCalculation = calcCon; //--------------------end Consumable---------------------- CalcOtherTest calcOth = new CalcOtherTest(site, _forecast, _peridoInfo, _targetSelected); calcOth.CalculatedPatientNos = pNumbers; calcOth.TestingArea = OtherTestTestingArea; calcOth.CalculatedConsumable = calcCon; calcOth.OtherTestProtocol = _othProtocol; InitBaseCalcValue(calcPatientNo, calcOth); mcalcContainer.OtherTestCalculation = calcOth; //--------------------end Other test---------------------- _artsiteCalculated.Add(scalculated.SiteId, scalculated); _listOfMorbidityCalcContainers.Add(mcalcContainer.SiteId, mcalcContainer); } }