Пример #1
0
        private void lbtAddTest_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FrmSelectTest frm = new FrmSelectTest(_panel);
            frm.ShowDialog();

            if (frm.DialogResult == DialogResult.OK)
            {

                foreach (Test t in frm._selectedTest)
                {

                    PanelTest pt = new PanelTest();
                    pt.TestId = t;
                    pt.Panel = _panel;
                    _panel.PanelPanelTests.Add(pt);

                    if(!SymptomDirectedTestAdded(t))
                    {
                        PSymptomDirectedTest pSDT = new PSymptomDirectedTest();
                        pSDT.Test = t;
                        pSDT.PediatricInTreatmeant = 0;
                        pSDT.PediatricPreART = 0;
                        pSDT.Protocol = _panel.Protocol;
                        pSDT.AdultInTreatmeant = 0;
                        pSDT.AdultPreART = 0;
                        _panel.Protocol.SymptomDirectedTests.Add(pSDT);
                    }

                }
                PopPanelTests();

                //if (OnDataUsageEdit != null)
                //{
                //    OnDataUsageEdit(this, new EventArgs());
                //}
            }
        }
Пример #2
0
        private void CreatNewProtocol()
        {
            _protocol = new Protocol();
            _protocol.ProtocolType = (int)_classOfTest;

            switch (_classOfTest)
            {
                case ClassOfMorbidityTestEnum.CD4:
                    ProtocolPanel panel = new ProtocolPanel();
                    panel.PanelName = "CD4 Panel";
                    panel.Protocol = _protocol;
                    _protocol.ProtocolPanels.Add(panel);
                    break;
                case ClassOfMorbidityTestEnum.Chemistry:
                    string[] testname = Enum.GetNames(typeof(ChemistryTestNameEnum));
                    for (int i = 0; i < testname.Length; i++)
                    {
                        PSymptomDirectedTest sdt = new PSymptomDirectedTest();
                        sdt.ChemTestName = testname[i];
                        sdt.Protocol = _protocol;
                        _protocol.SymptomDirectedTests.Add(sdt);
                    }
                    break;
                case ClassOfMorbidityTestEnum.OtherTest:
                    string[] tname = Enum.GetNames(typeof(OtherTestNameEnum));
                    for (int i = 0; i < tname.Length; i++)
                    {
                        PSymptomDirectedTest sdt = new PSymptomDirectedTest();
                        sdt.OtherTestName = tname[i];
                        sdt.Protocol = _protocol;
                        _protocol.SymptomDirectedTests.Add(sdt);
                    }
                    break;
            }
        }
Пример #3
0
        void lvsysmpDirected_OnSubitemTextChanged(object sender, SubitemTextEventArgs e)
        {
            ListViewItem li = e.ListVItem;
            LQTListViewTag tag = (LQTListViewTag)li.Tag;

            PSymptomDirectedTest sdt=new PSymptomDirectedTest();

            if (tag.Id <= 0)
                sdt = (PSymptomDirectedTest)_protocol.SymptomDirectedTests[tag.Index];
            else
                sdt = _protocol.GetSymptomDirectedTestById(tag.Id);

            try
            {
                double sdtAITAmt = double.Parse(li.SubItems[1].Text);
                if (sdtAITAmt > 0)
                    sdt.AdultInTreatmeant = sdtAITAmt;
                else
                    li.SubItems[1].Text = sdt.AdultInTreatmeant.ToString();

                double sdtPITAmt = double.Parse(li.SubItems[2].Text);
                if (sdtPITAmt > 0)
                    sdt.PediatricInTreatmeant = sdtPITAmt;
                else
                    li.SubItems[2].Text = sdt.PediatricInTreatmeant.ToString();

                double sdtAPAAmt = double.Parse(li.SubItems[3].Text);
                if (sdtAPAAmt > 0)
                    sdt.AdultPreART = sdtAPAAmt;
                else
                    li.SubItems[3].Text = sdt.AdultPreART.ToString();

                double sdtPPAAmt = double.Parse(li.SubItems[4].Text);
                if (sdtPPAAmt > 0)
                    sdt.PediatricPreART = sdtPPAAmt;
                else
                    li.SubItems[4].Text = sdt.PediatricPreART.ToString();
            }
            catch
            {
                    li.SubItems[1].Text = sdt.AdultInTreatmeant.ToString();
                    li.SubItems[2].Text = sdt.PediatricInTreatmeant.ToString();
                    li.SubItems[3].Text = sdt.AdultPreART.ToString();
                    li.SubItems[4].Text = sdt.PediatricPreART.ToString();
            }

            if (OnDataUsageEdit != null)
            {
                OnDataUsageEdit(this, new EventArgs());
            }
        }