Exemple #1
0
        public IList <ChemandOtherNumberofTest> GetChemistryTestNumber()
        {
            _chemtestNumber = new List <ChemandOtherNumberofTest>();
            if (ArtSite.ForecastChemistry)
            {
                foreach (PSymptomDirectedTest sdt in ChemTestProtocol.SymptomDirectedTests)
                {
                    ChemandOtherNumberofTest ct = new ChemandOtherNumberofTest();
                    ct.ForecastId = Forecast.Id;
                    ct.SiteId     = ArtSite.Site.Id;
                    ct.Platform   = (int)ClassOfMorbidityTestEnum.Chemistry;
                    ct.TestId     = sdt.Test.Id;
                    //ct.TestName = sdt.ChemTestName;

                    for (int i = 1; i <= 12; i++)
                    {
                        ChemistrySymptomDirectedTest csdt = _chemMonthlyOutputs[i].GetChemSymptomDirectedTestById(sdt.Test.Id);
                        ct.InvalidTestandWastage    += csdt.AdditionalTestsdueToWastage;
                        ct.RepeatedDuetoClinicalReq += csdt.RepeatedDuetoClinicianRequest();
                        ct.SymptomDirectedTests     += csdt.TotalSymptomDirectTest();
                        ct.TestBasedOnProtocols     += _chemMonthlyOutputs[i].GetSumOfChemTest(sdt.Test.Id);
                        //ct.TestBasedOnProtocols += csdt.TestBasedonProtocol;
                    }

                    foreach (ChemistryPlatformTests ptc in  _chemPlatformTests)
                    {
                        if (ct.TestBasedOnProtocols > 0)
                        {
                            ct.ReagentstoRunControls += ptc.TotalControlsFP() + ptc.SampleReferredTotalControlsFP();
                            ct.BufferStock           += ptc.TotalControlsBP() + ptc.SampleReferredTotalControlsBP();
                        }
                        else
                        {
                            ct.ReagentstoRunControls = 0;
                            ct.BufferStock          += ptc.TotalControlsBP();
                        }
                    }
                    _chemtestNumber.Add(ct);
                }
            }
            return(_chemtestNumber);
        }