Esempio n. 1
0
        private IList <PlatformQuantifyMenu> GetListOfChemistryPQM(IList <MorbidityTest> list)
        {
            IList <PlatformQuantifyMenu> listofPQM = new List <PlatformQuantifyMenu>();

            foreach (MorbidityTest mt in list)
            {
                CTestPlatformQuantifyMenu pqm = new CTestPlatformQuantifyMenu(mt.Instrument.Id);
                foreach (QuantifyMenu qm in mt.QuantifyMenus)
                {
                    if (qm.TestTypeToEnum == TestTypeEnum.Test)
                    {
                        pqm.SetChemQuantifyMenuId(qm.ChemTestNameToEnum, qm.Id);
                    }
                    else if (qm.TestTypeToEnum == TestTypeEnum.PerDay)
                    {
                        pqm.SetQuantifyMenuId(TestTypeEnum.PerDay, qm.Id);
                    }
                    else if (qm.TestTypeToEnum == TestTypeEnum.PerInstrument)
                    {
                        pqm.SetQuantifyMenuId(TestTypeEnum.PerInstrument, qm.Id);
                    }
                    else if (qm.TestTypeToEnum == TestTypeEnum.ControlTest)
                    {
                        pqm.SetQuantifyMenuId(qm.DurationToEnum, qm.Id);
                    }
                    else if (qm.TestTypeToEnum == TestTypeEnum.SamplesRunOn)
                    {
                        pqm.TotalPatientSamplesRunOnIns = qm.Id;
                    }
                }
                listofPQM.Add(pqm);
            }
            return(listofPQM);
        }
Esempio n. 2
0
        private void DoQuantification()
        {
            //DOES THIS SITE RECEIVE Chemistry SUPPLIES?
            if (ArtSite.ForecastChemistry)
            {
                InitTotalValues();
                int    allChemQMid = 0;
                double value, allChemInsQty = 0;
                foreach (QuantifyMenu qm in _platformObject.GeneralQuantifyMenus)
                {
                    value = 0;
                    if (qm.Title == GeneralQuantifyMenuEnum.Total_Chemistry_Patient_Samples_Run_On_All_Instruments.ToString())
                    {
                        value = TotalPatientSamples;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Total_Chemistry_controls_for_all_instruments.ToString())
                    {
                        value = TotalControls;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Total_ALP_Tests_on_all_instruments.ToString())
                    {
                        value = TotalALP;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Total_ALT_Tests_on_all_instruments.ToString())
                    {
                        value = TotalALT;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Total_AMY_Tests_on_all_instruments.ToString())
                    {
                        value = TotalAMY;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Total_AST_Tests_on_all_instruments.ToString())
                    {
                        value = TotalAST;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Total_CHO_Tests_on_all_instruments.ToString())
                    {
                        value = TotalCHO;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Total_CO2_Tests_on_all_instruments.ToString())
                    {
                        value = TotalCO2;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Total_CRE_Tests_on_all_instruments.ToString())
                    {
                        value = TotalCRE;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Total_Electrolyte_Panel_tests_on_all_instruments.ToString())
                    {
                        value = TotalElectrolyte;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Total_GGT_Tests_on_all_instruments.ToString())
                    {
                        value = TotalGGT;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Total_GLC_Tests_on_all_instruments.ToString())
                    {
                        value = TotalGLC;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Total_TG_Tests_on_all_instruments.ToString())
                    {
                        value = TotalTG;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Total_Urea_tests_on_all_instruments.ToString())
                    {
                        value = TotalUrea;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Per_Instrument_All_Chemistry_Instruments.ToString())
                    {
                        allChemQMid = qm.Id;
                    }
                    else if (qm.Title == GeneralQuantifyMenuEnum.Per_Day_All_Chemistry_Instruments.ToString() && _chemPlatformTests.Count > 0)
                    {
                        value = ArtSite.Site.ChemistryTestingDaysPerMonth * (PeriodInfo.NumberofBufferMonthsBeyondForecast + PeriodInfo.NumberofMonthsinBudgetPeriod);
                    }

                    if (value > 0)
                    {
                        QMenuWithValue qval = new QMenuWithValue();
                        qval.QuantifyMenuId   = qm.Id;
                        qval.SiteValue        = value;
                        qval.ReferalSiteValue = 0;
                        _listOfQMenuWithValue.Add(qval);
                    }
                }

                ChemistryTestNameEnum[] chemTests = LqtUtil.EnumToArray <ChemistryTestNameEnum>();
                TestingDurationEnum[]   tduration = LqtUtil.EnumToArray <TestingDurationEnum>();

                foreach (ChemistryPlatformTests cpt in _chemPlatformTests)
                {
                    allChemInsQty += cpt.Quantity;

                    CTestPlatformQuantifyMenu pqm = (CTestPlatformQuantifyMenu)_platformObject.GetPlatformQuantifyMenuByInsId(cpt.InstrumentId);
                    if (pqm != null)
                    {
                        QMenuWithValue qval = new QMenuWithValue();
                        qval.QuantifyMenuId   = pqm.TotalPatientSamplesRunOnIns;
                        qval.SiteValue        = cpt.TotalSmaples();
                        qval.ReferalSiteValue = 0;
                        _listOfQMenuWithValue.Add(qval);

                        qval = new QMenuWithValue();
                        qval.QuantifyMenuId   = pqm.GetQuantifyMenuId(TestTypeEnum.PerInstrument);
                        qval.SiteValue        = cpt.Quantity;
                        qval.ReferalSiteValue = 0;
                        _listOfQMenuWithValue.Add(qval);

                        qval = new QMenuWithValue();
                        qval.QuantifyMenuId   = pqm.GetQuantifyMenuId(TestTypeEnum.PerDay);
                        qval.SiteValue        = ArtSite.Site.ChemistryTestingDaysPerMonth * (PeriodInfo.NumberofBufferMonthsBeyondForecast + PeriodInfo.NumberofMonthsinBudgetPeriod);
                        qval.ReferalSiteValue = 0;
                        _listOfQMenuWithValue.Add(qval);

                        for (int i = 0; i < chemTests.Length; i++)
                        {
                            if (ParameterIncluded(chemTests[i]))
                            {
                                qval = new QMenuWithValue();
                                qval.QuantifyMenuId   = pqm.GetChemQuantifyMenuId(chemTests[i]);
                                qval.SiteValue        = cpt.TotalTestsOnInstrument(chemTests[i]);
                                qval.ReferalSiteValue = 0;
                                _listOfQMenuWithValue.Add(qval);
                            }
                        }

                        for (int i = 0; i < tduration.Length; i++)
                        {
                            qval = new QMenuWithValue();
                            qval.QuantifyMenuId   = pqm.GetQuantifyMenuId(tduration[i]);
                            qval.SiteValue        = cpt.GetSumOfControlsByDuration(tduration[i]);
                            qval.ReferalSiteValue = 0;
                            _listOfQMenuWithValue.Add(qval);
                        }
                    }
                }

                //Per Instrument - All Chemistry Instruments
                QMenuWithValue qv = new QMenuWithValue();
                qv.QuantifyMenuId   = allChemQMid;
                qv.SiteValue        = allChemInsQty;
                qv.ReferalSiteValue = 0;
                _listOfQMenuWithValue.Add(qv);

                foreach (QMenuWithValue qm in _listOfQMenuWithValue)
                {
                    IList <QuantificationMetric> list = _platformObject.GetQuanMetricByQuanMenuId(qm.QuantifyMenuId);

                    foreach (QuantificationMetric r in list)
                    {
                        PrimeryQuantifyedReagent pqr = new PrimeryQuantifyedReagent();
                        pqr.ProductId = r.Product.Id;
                        pqr.UnitCost  = r.Product.GetActiveProductPrice(DateTime.Now).Price;
                        pqr.PackSize  = r.Product.GetActiveProductPrice(DateTime.Now).PackSize;
                        pqr.Unit      = r.Product.BasicUnit;

                        double testperpack   = r.Product.GetActiveProductPrice(DateTime.Now).PackSize / r.UsageRate;
                        double valueofmetric = r.CollectionSupplieAppliedTo == CollectionSupplieAppliedToEnum.Collection.ToString() ? qm.SiteValue : qm.TotalValue;
                        if (ArtSite.Site.ChemistryRefSite > 0 && r.CollectionSupplieAppliedTo == CollectionSupplieAppliedToEnum.Testing.ToString())
                        {
                            valueofmetric = 0;
                        }
                        pqr.Value           = testperpack > 0 ? valueofmetric / testperpack : 0;
                        pqr.MinimumQuantity = r.Product.MinimumPackSize;
                        _lstPrimaryQuanReagents.AddPrimeryQR(pqr);
                    }
                }
            }
        }
Esempio n. 3
0
        private IList<PlatformQuantifyMenu> GetListOfChemistryPQM(IList<MorbidityTest> list)
        {
            IList<PlatformQuantifyMenu> listofPQM = new List<PlatformQuantifyMenu>();

            foreach (MorbidityTest mt in list)
            {
                CTestPlatformQuantifyMenu pqm = new CTestPlatformQuantifyMenu(mt.Instrument.Id);
                foreach (QuantifyMenu qm in mt.QuantifyMenus)
                {
                    if (qm.TestTypeToEnum == TestTypeEnum.Test)
                        pqm.SetChemQuantifyMenuId(qm.ChemTestNameToEnum, qm.Id);
                    else if (qm.TestTypeToEnum == TestTypeEnum.PerDay)
                        pqm.SetQuantifyMenuId(TestTypeEnum.PerDay, qm.Id);
                    else if (qm.TestTypeToEnum == TestTypeEnum.PerInstrument)
                        pqm.SetQuantifyMenuId(TestTypeEnum.PerInstrument, qm.Id);
                    else if (qm.TestTypeToEnum == TestTypeEnum.ControlTest)
                        pqm.SetQuantifyMenuId(qm.DurationToEnum, qm.Id);
                    else if(qm.TestTypeToEnum == TestTypeEnum.SamplesRunOn)
                        pqm.TotalPatientSamplesRunOnIns = qm.Id;
                }
                listofPQM.Add(pqm);
            }
            return listofPQM;
        }