Ejemplo n.º 1
0
        public FrmMorbidityTest(MorbidityTest morbidityTest, LqtMainWindowForm MdiParentForm)
        {
            this._morbidityTest = morbidityTest;
            this._mdiParentForm = MdiParentForm;
            this._products      = DataRepository.GetAllProductByClassOfTest(_morbidityTest.ClassOfTest);


            InitializeComponent();
            LoadSiteListView();

            lqtToolStrip1.SaveAndCloseClick += new EventHandler(lqtToolStrip1_SaveAndCloseClick);
            lqtToolStrip1.SaveAndNewClick   += new EventHandler(lqtToolStrip1_SaveAndNewClick);

            PopInstrument();
            BindMorbidityTest();
        }
Ejemplo n.º 2
0
        private void lqtToolStrip1_SaveAndNewClick(object sender, EventArgs e)
        {
            try
            {
                LQTUserMessage msg = SaveOrUpdateObject();
                ((LqtMainWindowForm)_mdiParentForm).ShowStatusBarInfo(msg.Message, true);

                MorbidityTest mtest = new MorbidityTest();
                mtest.ClassOfTest = _morbidityTest.ClassOfTest;
                _morbidityTest    = mtest;
                BindMorbidityTest();
            }
            catch (Exception ex)
            {
                new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog();
            }
        }
Ejemplo n.º 3
0
        public static void CreateQuantifyMenus(MorbidityTest morbidityTest)
        {
            QuantifyMenu qmenuTest = CreateNewQMenu(morbidityTest);

            qmenuTest.Title = BuildTestName(morbidityTest.Instrument.InstrumentName, morbidityTest.ClassOfTestEnum);
            if (morbidityTest.ClassOfTestEnum != ClassOfMorbidityTestEnum.Chemistry)
            {
                qmenuTest.TestType = TestTypeEnum.Test.ToString();
                morbidityTest.QuantifyMenus.Add(qmenuTest);
            }
            else
            {
                qmenuTest.TestType = TestTypeEnum.SamplesRunOn.ToString();
                morbidityTest.QuantifyMenus.Add(qmenuTest);
                CreateChemistryTestQM(morbidityTest);
            }

            QuantifyMenu qmenuCon = CreateNewQMenu(morbidityTest);

            qmenuCon.Title    = String.Format("{0} Controls - {1}", morbidityTest.ClassOfTest, morbidityTest.Instrument.InstrumentName);
            qmenuCon.TestType = TestTypeEnum.ControlTest.ToString();
            qmenuCon.Duration = TestingDurationEnum.TotalControl.ToString();
            morbidityTest.QuantifyMenus.Add(qmenuCon);

            QuantifyMenu qmenuPertest = CreateNewQMenu(morbidityTest);

            qmenuPertest.Title    = String.Format("{0} Controls Per Test-{1}", morbidityTest.ClassOfTest, morbidityTest.Instrument.InstrumentName);
            qmenuPertest.TestType = TestTypeEnum.ControlTest.ToString();
            qmenuPertest.Duration = TestingDurationEnum.PerTest.ToString();
            morbidityTest.QuantifyMenus.Add(qmenuPertest);

            QuantifyMenu qmenuDaily = CreateNewQMenu(morbidityTest);

            qmenuDaily.Title    = String.Format("{0} Daily Controls-{1}", GetTestShortName(morbidityTest.ClassOfTestEnum), morbidityTest.Instrument.InstrumentName);
            qmenuDaily.TestType = TestTypeEnum.ControlTest.ToString();
            qmenuDaily.Duration = TestingDurationEnum.Daily.ToString();
            morbidityTest.QuantifyMenus.Add(qmenuDaily);

            QuantifyMenu qmenuWeekly = CreateNewQMenu(morbidityTest);

            qmenuWeekly.Title    = String.Format("{0} Weekly Controls-{1}", GetTestShortName(morbidityTest.ClassOfTestEnum), morbidityTest.Instrument.InstrumentName);
            qmenuWeekly.TestType = TestTypeEnum.ControlTest.ToString();
            qmenuWeekly.Duration = TestingDurationEnum.Weekly.ToString();
            morbidityTest.QuantifyMenus.Add(qmenuWeekly);

            QuantifyMenu qmenuMonth = CreateNewQMenu(morbidityTest);

            qmenuMonth.Title    = String.Format("{0} Monthly Controls-{1}", GetTestShortName(morbidityTest.ClassOfTestEnum), morbidityTest.Instrument.InstrumentName);
            qmenuMonth.TestType = TestTypeEnum.ControlTest.ToString();
            qmenuMonth.Duration = TestingDurationEnum.Monthly.ToString();
            morbidityTest.QuantifyMenus.Add(qmenuMonth);

            QuantifyMenu qmenuQua = CreateNewQMenu(morbidityTest);

            qmenuQua.Title    = String.Format("{0} Quarterly Controls-{1}", GetTestShortName(morbidityTest.ClassOfTestEnum), morbidityTest.Instrument.InstrumentName);
            qmenuQua.TestType = TestTypeEnum.ControlTest.ToString();
            qmenuQua.Duration = TestingDurationEnum.Quarterly.ToString();
            morbidityTest.QuantifyMenus.Add(qmenuQua);

            QuantifyMenu qmenuPerins = CreateNewQMenu(morbidityTest);

            qmenuPerins.Title    = String.Format("Per Instrument-{0}", morbidityTest.Instrument.InstrumentName);
            qmenuPerins.TestType = TestTypeEnum.PerInstrument.ToString();
            morbidityTest.QuantifyMenus.Add(qmenuPerins);

            QuantifyMenu qmenuPerday = CreateNewQMenu(morbidityTest);

            qmenuPerday.Title    = String.Format("Per Day-{0}", morbidityTest.Instrument.InstrumentName);
            qmenuPerday.TestType = TestTypeEnum.PerDay.ToString();
            morbidityTest.QuantifyMenus.Add(qmenuPerday);
        }
Ejemplo n.º 4
0
 public FrmSelectPro(MorbidityTest mtest, IList <MasterProduct> products) : this(mtest.QuantifyMenus, products)
 {
     _morbidityTest = mtest;
 }
Ejemplo n.º 5
0
 public static void DeleteMorbidityTest(MorbidityTest mtest)
 {
     DaoFactory.GetDaoFactory().CreateMorbidityTestDao().Delete(mtest);
 }
Ejemplo n.º 6
0
 public static void SaveOrUpdateMorbidityTest(MorbidityTest mtest)
 {
     DaoFactory.GetDaoFactory().CreateMorbidityTestDao().SaveOrUpdate(mtest);
 }
Ejemplo n.º 7
0
        private void butSave_Click(object sender, EventArgs e)
        {
            int count = 0;
            int error = 0;

            try
            {
                foreach (ImportInsData rd in _rdata)
                {
                    if (!rd.IsExist)
                    {
                        Instrument ins = new Instrument();

                        ins.InstrumentName = rd.InsName;
                        ins.MaxThroughPut  = rd.Rate;
                        // ins.MonthMaxTPut = (rd.Rate * 5) * 22;
                        ins.TestingArea           = rd.TestingArea;
                        ins.DailyCtrlTest         = rd.DailyCtrTest;
                        ins.WeeklyCtrlTest        = rd.WeeklyCtrTest;
                        ins.MonthlyCtrlTest       = rd.MonthlyCtrTest;
                        ins.QuarterlyCtrlTest     = rd.QuarterlyCtrTest;
                        ins.MaxTestBeforeCtrlTest = rd.PerTestCtr;
                        count++;
                        DataRepository.SaveOrUpdateInstrument(ins);

                        if (rd.TestingArea.UseInDemography)
                        {
                            if (rd.TestingArea.ClassOfTestToEnum == ClassOfMorbidityTestEnum.CD4 ||
                                rd.TestingArea.ClassOfTestToEnum == ClassOfMorbidityTestEnum.Chemistry ||
                                rd.TestingArea.ClassOfTestToEnum == ClassOfMorbidityTestEnum.Hematology ||
                                rd.TestingArea.ClassOfTestToEnum == ClassOfMorbidityTestEnum.ViralLoad)
                            {
                                MorbidityTest mtest = new MorbidityTest();
                                mtest.Instrument  = ins;
                                mtest.ClassOfTest = rd.TestingArea.Category;
                                mtest.TestName    = ManageQuantificationMenus.BuildTestName(ins.InstrumentName, mtest.ClassOfTestEnum);
                                ManageQuantificationMenus.CreateQuantifyMenus(mtest);

                                DataRepository.SaveOrUpdateMorbidityTest(mtest);
                            }
                        }
                    }
                    else
                    {
                        error++;
                    }
                }

                MessageBox.Show(count + " Instruments are imported and saved successfully." + Environment.NewLine + error + " Instruments Failed.", "Importing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
            catch
            {
                MessageBox.Show("Error: Unable to import and save Instrument data.", "Importing", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                DataRepository.CloseSession();
            }
        }