Пример #1
0
 private void FillBlTest(BloodTest bl)
 {
     if (leuTB.Text.Trim() != "")
     {
         bl.bltest_leu = Convert.ToDouble(leuTB.Text.Replace('.', ','));
     }
     else
     {
         bl.bltest_leu = null;
     }
     if (hemTB.Text.Trim() != "")
     {
         bl.bltest_hem = Convert.ToInt32(hemTB.Text);
     }
     else
     {
         bl.bltest_hem = null;
     }
     if (erTB.Text.Trim() != "")
     {
         bl.bltest_er = Convert.ToDouble(erTB.Text.Replace('.', ','));
     }
     else
     {
         bl.bltest_er = null;
     }
     if (grTB.Text.Trim() != "")
     {
         bl.bltest_gran = Convert.ToInt32(grTB.Text);
     }
     else
     {
         bl.bltest_gran = null;
     }
     if (limfTB.Text.Trim() != "")
     {
         bl.bltest_limf = Convert.ToInt32(limfTB.Text);
     }
     else
     {
         bl.bltest_limf = null;
     }
     if (monoTB.Text.Trim() != "")
     {
         bl.bltest_mono = Convert.ToInt32(monoTB.Text);
     }
     else
     {
         bl.bltest_mono = null;
     }
     if (soyTB.Text.Trim() != "")
     {
         bl.bltest_soy = Convert.ToInt32(soyTB.Text);
     }
     else
     {
         bl.bltest_soy = null;
     }
 }
Пример #2
0
        public void PlanNewTest(DateTime date, int pid)
        {
            BlTest___Patient bl = new BlTest___Patient();

            bl.bltp_state = (from q in db.State where q.state_value == "заплановано" select q.state_id).FirstOrDefault();
            bl.bltp_date  = date;
            BloodTest test = new BloodTest();

            db.BloodTest.Add(test);
            bl.bltp_patid  = pid;
            bl.bltp_testid = test.bltest_id;
            db.BlTest___Patient.Add(bl);
            db.SaveChanges();
        }
Пример #3
0
        public void UpdateTest(object o)
        {
            BloodTest b    = o as BloodTest;
            BloodTest oldb = (from q in db.BloodTest where q.bltest_id == b.bltest_id select q).FirstOrDefault();

            oldb.bltest_er   = b.bltest_er;
            oldb.bltest_gran = b.bltest_gran;
            oldb.bltest_hem  = b.bltest_hem;
            oldb.bltest_leu  = b.bltest_leu;
            oldb.bltest_limf = b.bltest_limf;
            oldb.bltest_mono = b.bltest_mono;
            oldb.bltest_soy  = b.bltest_soy;
            ChangeStateToClosed(oldb.bltest_id);
            db.SaveChanges();
        }
Пример #4
0
        public int DeleteTest(int id)
        {
            BlTest___Patient bl = (from q in db.BlTest___Patient where (q.bltp_id == id) select q).FirstOrDefault();
            int testid          = bl.bltp_testid;

            db.BlTest___Patient.Remove(bl);
            db.SaveChanges();
            BloodTest test = (from q in db.BloodTest where q.bltest_id == testid select q).FirstOrDefault();

            if (test != null)
            {
                db.BloodTest.Remove(test);
                db.SaveChanges();
            }
            return(testid);
        }
Пример #5
0
        public override void Plan(DateTime date)
        {
            try
            {
                BlTest___Patient b    = new BlTest___Patient();
                BloodTest        test = new BloodTest();
                ctx.BloodTest.Add(test);

                b.bltp_patid  = pat.p_id;
                b.bltp_state  = (from c in ctx.State where (c.state_value == "заплановано") select c.state_id).FirstOrDefault();
                b.bltp_date   = date.Date;
                b.bltp_testid = test.bltest_id;
                ctx.BlTest___Patient.Add(b);
                ctx.SaveChanges();
                Renew();
            }
            catch
            {
                MessageBox.Show("Помилка при плануванні");
            }
        }
Пример #6
0
        public TestDetailsEntry()
        {
            InitializeComponent();
            labpatient = new LabPatient();
            dbr        = new DBRetrieve();
            validation = new Validation();
            bloodtest  = new BloodTest();
            labtest    = new LabTest();

            txt_Panel1 = new Dictionary <string, string> {
                { "Field", "" }, { "DType", "" }, { "Error_lbl", "" }, { "Value", "" }
            };
            txt_Panel2 = new Dictionary <string, string> {
                { "Field", "" }, { "DType", "" }, { "Error_lbl", "" }, { "Value", "" }
            };
            txt_Panel3 = new Dictionary <string, string> {
                { "Field", "" }, { "DType", "" }, { "Error_lbl", "" }, { "Value", "" }
            };

            //updatingTest = new Dictionary<string, string> { { "field_num", "" } };
        }
Пример #7
0
        public ViewForm(object PID, object testid)
        {
            InitializeComponent();

            if (testid.ToString() == "LTBCC002")
            {
                var     bloodtest        = new BloodTest();
                DataSet ds               = bloodtest.fillCellcountReport(PID.ToString());
                var     cellcount_report = new CrystalReportCellCount();
                cellcount_report.SetDataSource(ds);
                crystalReportViewerLabReport.ReportSource = cellcount_report;
            }

            if (testid.ToString() == "LTBS001")
            {
                var     bloodtest    = new BloodTest();
                DataSet ds           = bloodtest.fillSugarReport(PID.ToString());
                var     sugar_report = new CrystalReportSugar();
                sugar_report.SetDataSource(ds);
                crystalReportViewerLabReport.ReportSource = sugar_report;
            }

            if (testid.ToString() == "LTBPC007")
            {
                var     bloodtest       = new BloodTest();
                DataSet ds              = bloodtest.fillPlateletReport(PID.ToString());
                var     platelet_report = new CrystalReportPlateletCount();
                platelet_report.SetDataSource(ds);
                crystalReportViewerLabReport.ReportSource = platelet_report;
            }

            if (testid.ToString() == "LTLC003")
            {
                var     cholesterol_test = new LipidTest();
                DataSet ds = cholesterol_test.fillCholesterolReport(PID.ToString());
                var     cholesterol_report = new CrystalReportCholesterolTest();
                cholesterol_report.SetDataSource(ds);
                crystalReportViewerLabReport.ReportSource = cholesterol_report;
            }
        }
Пример #8
0
        public BloodTestForm(int testid, DateTime date, mode _m)
        {
            InitializeComponent();

            ctx  = new TubDataBaseEntities();
            m    = _m;
            test = testid;
            bl   = (from c in ctx.BloodTest where (c.bltest_id == testid) select c).FirstOrDefault();
            if (m == mode.Redact)
            {
                this.StatusL.Text = "Завершено " + date.ToShortDateString();
                LoadTest(testid);
            }
            else if (m == mode.Create)
            {
                this.StatusL.Text = "Закінчити тест за " + date.ToShortDateString();
            }
            else if (m == mode.Losed)
            {
                this.StatusL.Text = "Пропущений тест за " + date.ToShortDateString();
            }
        }
Пример #9
0
 public void AtkBlood(BloodTest b, int dmg) //内部方法,外部不调用,设置某个滑动框的血条
 {
     b.Change(b.currentBlood, dmg);
 }
Пример #10
0
 public void ReSetBlood(BloodTest b, int now, int max) //内部方法,外部不调用,设置某个滑动框的血条
 {
     //Debug.Log("" + b.currentBlood + " " + now);
     b.ResetBlood(now, max);
 }
Пример #11
0
 public void SetBlood(BloodTest b, int now) //内部方法,外部不调用,设置某个滑动框的血条
 {
     //Debug.Log("" + b.currentBlood + " " + now);
     b.Change(b.currentBlood, b.currentBlood - now);
 }
Пример #12
0
        public object GetActiveTest(int id)
        {
            BloodTest test = (from q in db.BloodTest where q.bltest_id == id select q).FirstOrDefault();

            return(test);
        }
Пример #13
0
        public List <BloodTest> getBloodTestsResults([FromUri] int userId)
        {
            var           path   = HttpContext.Current.Server.MapPath(@"~/xml/test.xml");
            XmlTextReader reader = new XmlTextReader(path);

            try
            {
                BloodTest  bt        = new BloodTest();
                List <int> lacksList = new List <int>();
                while (reader.Read())
                {
                    string temp = "";

                    reader.MoveToContent();
                    if (reader.NodeType == XmlNodeType.Element)
                    {
                        temp = reader.Name;
                    }
                    if (reader.NodeType == XmlNodeType.Element)
                    {
                        if (temp == "VALUE")
                        {
                            bt.value = int.Parse(reader.ReadString());
                        }
                        else if (temp == "NAME")
                        {
                            bt.name = reader.ReadString();
                        }
                        else if (temp == "MIN_VAL")
                        {
                            bt.min_val = int.Parse(reader.ReadString());
                        }
                        else if (temp == "MAX_VAL")
                        {
                            bt.max_val = int.Parse(reader.ReadString());
                            contents.Add(bt);

                            if (bt.value < bt.min_val)
                            {
                                int NutrientId = EntitiesManager.getInstance().GetNutrientIdByName(bt.name);

                                if (NutrientId != -1)
                                {
                                    lacksList.Add(NutrientId);
                                }
                            }
                            else if (bt.name == "total cholesterol" && bt.value > bt.max_val)
                            {
                                int NutrientId = EntitiesManager.getInstance().GetNutrientIdByName(bt.name);

                                if (NutrientId != -1)
                                {
                                    lacksList.Add(NutrientId);
                                }
                            }

                            bt = new BloodTest();
                        }
                    }
                }

                EntitiesManager.getInstance().SaveBloodResultsLacks(lacksList, userId);
            }
            catch (Exception ex)
            {
                //add an exeption to the result
            }

            return(contents);
        }
Пример #14
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (grpBxScans.Visible)
            {
                var scan = new Scans();


                if (radioReset.Checked)
                {
                    if (scan.setScanStatus(Convert.ToInt32(labtest.LTRNumber), false, true))
                    {
                        radioSet.Checked   = false;
                        radioReset.Checked = false;
                        fillPatientsTests(labpatient.getPatientsTestList());
                    }
                }
            }


            var bloodtest = new BloodTest();


            if (txt_Panel1["Field"] == "Sugar")
            {
                if (!bloodtest.insertSugar(labpatient.ID, labtest.ID, txt_Panel1["Value"]))
                {
                    MessageBox.Show("Please Fill the Relevant Field", "Error", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
                else
                {
                    txtTest_Panel1.Text = "";
                    fillPatientsTests(labpatient.getPatientsTestList());
                    //labtest.Status = true;
                }
            }

            if (txt_Panel1["Field"] == "Platelet Count")
            {
                if (!bloodtest.insertPlatelet(labpatient.ID, labtest.ID, txt_Panel1["Value"]))
                {
                    MessageBox.Show("Please Fill the Relevant Field", "Error", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
                else
                {
                    txtTest_Panel1.Text = "";
                    fillPatientsTests(labpatient.getPatientsTestList());
                    //labtest.Status = true;
                }
            }


            if (txt_Panel1["Field"] == "WBC" && txt_Panel2["Field"] == "RBC")
            {
                if (!bloodtest.insertCellCount(labpatient.ID, labtest.ID, txt_Panel1["Value"], txt_Panel2["Value"]))
                {
                    MessageBox.Show("Please Fill the Relevant Field", "Error", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
                else
                {
                    txtTest_Panel1.Text = "";
                    txtTest_Panel2.Text = "";
                    fillPatientsTests(labpatient.getPatientsTestList());
                    //labtest.Status = true;
                }
            }

            if (txt_Panel1["Field"] == "HDL" && txt_Panel2["Field"] == "LDL" && txt_Panel3["Field"] == "Serum Cholesterol")
            {
                var cholesterol = new LipidTest();
                if (!cholesterol.updateCholesterolTest(labpatient.ID, txt_Panel1["Value"], txt_Panel2["Value"], txt_Panel3["Value"]))
                {
                    MessageBox.Show("Please Fill the Relevant Field", "Error", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }

                else
                {
                    txtTest_Panel1.Text = "";
                    txtTest_Panel2.Text = "";
                    txtTest_Panel3.Text = "";
                    fillPatientsTests(labpatient.getPatientsTestList());
                    //labtest.Status = true;
                }
            }

            //clearDictionarys();
            FillAppointments(null, null, null);
        }
Пример #15
0
 public ActionResult UpdateBloodTest(BloodTest blood)
 {
     HelperSelector.get(model.ViewName).UpdateTest(blood);
     model.Single = null;
     return(redirect());
 }