Ejemplo n.º 1
0
        public void InitEveryThing()
        {
            if (HealthHouseFactory.ID == 0) //新增加时
            {
                string checkDate = DateTime.Today.ToString("yyyy-MM-dd");
                this.dtpCheckDate.Value = DateTime.Today;
                // 取得当前日期是否有查体资料
                healthHouserModel = healthHouseBLL.GetData(this.Model.IDCardNo, checkDate);
            }
            else //查询已有数据
            {
                this.healthHouserModel = healthHouseBLL.GetDataByID(HealthHouseFactory.ID);
            }

            if (healthHouserModel == null)
            {
                healthHouserModel = new HealthHouseModel();

                this.healthHouserModel.IDCardNo   = this.Model.IDCardNo;
                this.healthHouserModel.Doctor     = ConfigHelper.GetNode("doctorName");
                this.healthHouserModel.CreateBy   = ConfigHelper.GetNode("doctor");
                this.healthHouserModel.CreateDate = new DateTime?(DateTime.Today);
            }
            else
            {
                HealthHouseFactory.ID   = this.healthHouserModel.ID;
                this.dtpCheckDate.Value = this.healthHouserModel.CheckDate.Value;
            }

            this.healthHouserModel.UpdataBy   = ConfigHelper.GetNode("doctor");
            this.healthHouserModel.UpdateDate = new DateTime?(DateTime.Today);

            this.bindingManager = new SimpleBindingManager <HealthHouseModel>(this.inputRanges, this.inputrange_str,
                                                                              this.healthHouserModel);

            this.SimpleBindingC(this.txtDoctor, "Doctor", false);
            this.bindingManager.SimpleBinding(this.txtBMI, "BMI", true);
            this.bindingManager.SimpleBinding(this.txtHeight, "Height", true);
            this.bindingManager.SimpleBinding(this.txtLeftHeight, "LeftHeight", true);
            this.bindingManager.SimpleBinding(this.txtLeftPre, "LeftPre", true);
            this.bindingManager.SimpleBinding(this.txtRightHeight, "RightHeight", true);
            this.bindingManager.SimpleBinding(this.txtRightPre, "RightPre", true);
            this.bindingManager.SimpleBinding(this.txtPulseRate, "PulseRate", true);
            this.bindingManager.SimpleBinding(this.txtWeight, "Weight", true);
            this.bindingManager.SimpleBinding(this.txtBloodOxygen, "BloodOxygen", true);
            this.bindingManager.SimpleBinding(this.txtleftsl, "LeftView", true);
            this.bindingManager.SimpleBinding(this.txtrightsl, "RightView", true);
            this.bindingManager.SimpleBinding(this.txtjzleft, "LeftEyecorrect", true);
            this.bindingManager.SimpleBinding(this.txtjzrightsl, "RightEyecorrect", true);
            this.bindingManager.SimpleBinding(this.tbFat, "Fat", true);
            this.bindingManager.SimpleBinding(this.tbWater, "Water", true);
            this.bindingManager.SimpleBinding(this.tbMuscle, "Muscle", true);
            this.bindingManager.SimpleBinding(this.tbSkeleton, "Skeleton", true);
            this.bindingManager.SimpleBinding(this.tbCalorie, "Calorie", true);
            this.txtName.Text = this.Model.CustomerName;

            this.EveryThingIsOk = true;
        }
Ejemplo n.º 2
0
        public void InitEveryThing()
        {
            HealthHouseModel houseModel = new HealthHouseModel();

            if (HealthAssessFactory.ID == 0)//新增时
            {
                houseModel             = healthHouseBLL.GetMaxData(this.Model.IDCardNo);
                HealthAssessFactory.ID = houseModel.ID;
            }
            else //查询时
            {
                houseModel = healthHouseBLL.GetDataByID(HealthAssessFactory.ID);
            }

            this.AssessModel = new HealthAssessModel {
                IDCardNo = this.Model.IDCardNo
            };
            List <HealthOverviewSetModel> SetList = new List <HealthOverviewSetModel>();

            SetList = new HealthOverviewSetBLL().GetList(" and Type in (1,2,3,4) ");

            if (houseModel != null)
            {
                HealthAssessFactory.ID     = houseModel.ID;
                this.AssessModel.PID       = houseModel.ID;
                this.AssessModel.CheckDate = houseModel.CheckDate;

                this.lbBMI.Text     = houseModel.BMI.ToString();         //体质指数
                this.lbXueYa.Text   = "收缩压:" + houseModel.LeftHeight.ToString();
                this.lbxinlv.Text   = houseModel.PulseRate.ToString();   //心率
                this.lbxueyang.Text = houseModel.BloodOxygen.ToString(); //血氧

                if (SetList == null)
                {
                    this.AssessModel.BasicTest = "";
                    this.AssessModel.Blood     = "";
                    this.AssessModel.PulseRate = "";
                    this.AssessModel.Oxygen    = "";
                    this.AssessModel.Urine     = "";
                }
                else
                {
                    foreach (HealthOverviewSetModel hs in SetList)
                    {
                        if (hs.Type == "1")//体质指数
                        {
                            this.lbBMI.Text += "  参考范围:" + hs.minValues + " ~ " + hs.maxValues;
                            int res = Compare(houseModel.BMI.ToString(), hs.maxValues, hs.minValues);
                            if (res == 2 || res == 1)
                            {
                                this.lbBMI.ForeColor = Color.Red;
                            }
                        }
                        else if (hs.Type == "2")//血压
                        {
                            string[] Hmax = hs.maxValues.Split('/');
                            string[] Hmin = hs.minValues.Split('/');
                            bool     flag = false;

                            if (Hmax.Length == 2)
                            {
                                this.lbXueYa.Text += "  参考范围:" + Hmax[0] + " ~  " + Hmax[1];
                                if (Compare(houseModel.LeftHeight.ToString(), Hmax[0], Hmax[1]) == 1)
                                {
                                    this.lbXueYa.ForeColor = Color.Red;
                                }
                            }
                            this.lbXueYa.Text += "    舒张压:" + houseModel.LeftPre.ToString() + "   ";
                            if (Hmin.Length == 2)
                            {
                                this.lbXueYa.Text += "  参考范围:" + Hmin[0] + " ~  " + Hmin[1];
                                if (Compare(houseModel.LeftPre.ToString(), Hmin[0], Hmin[1]) == 2)
                                {
                                    this.lbXueYa.ForeColor = Color.Red;
                                }
                            }
                        }
                        else if (hs.Type == "3")//心率
                        {
                            this.lbxinlv.Text += "  参考范围:" + hs.maxValues + " ~  " + hs.minValues;
                            int res = Compare(houseModel.PulseRate.ToString(), hs.maxValues, hs.minValues);
                            if (res == 2 || res == 1)
                            {
                                this.lbxinlv.ForeColor = Color.Red;
                            }
                        }
                        else if (hs.Type == "4")//血氧
                        {
                            this.lbxueyang.Text += "  参考范围:" + hs.maxValues + " ~  " + hs.minValues;
                            int res = Compare(houseModel.BloodOxygen.ToString(), hs.maxValues, hs.minValues);

                            if (res == 2 || res == 1)
                            {
                                this.lbxueyang.ForeColor = Color.Red;
                                this.AssessModel.Oxygen  = "偏低";
                            }
                        }
                    }
                }
                HealthHousePhysicalAssistCheckModel HHAssistCheck = new HealthHousePhysicalAssistCheckBLL().GetModel(houseModel.ID);//辅助检查表
                if (HHAssistCheck != null)
                {
                    if (HHAssistCheck.CHESTX == "1")
                    {
                        this.lbXiongBu.Text = "正常";
                    }
                    else if (HHAssistCheck.CHESTX == "2")
                    {
                        this.lbXiongBu.ForeColor = Color.Red;
                        this.lbXiongBu.Text      = "异常";
                    }
                    if (!string.IsNullOrEmpty(HHAssistCheck.PRO) &&
                        !string.IsNullOrEmpty(HHAssistCheck.GLU) &&
                        !string.IsNullOrEmpty(HHAssistCheck.KET) &&
                        !string.IsNullOrEmpty(HHAssistCheck.BLD))
                    {
                        if (HHAssistCheck.PRO.Contains("+") ||
                            HHAssistCheck.GLU.Contains("+") ||
                            HHAssistCheck.KET.Contains("+") ||
                            HHAssistCheck.BLD.Contains("+"))
                        {
                            this.lbniao.ForeColor = Color.Red;
                            this.lbniao.Text      = "异常";
                        }
                        else
                        {
                            this.lbniao.Text = "正常";
                        }
                    }
                }
                HealthHouseBCHAOModel BchaoModel = new HealthHouseBCHAOBLL().GetModel(houseModel.ID);//B超表
                if (BchaoModel != null)
                {
                    if (BchaoModel.BCHAO == "1")
                    {
                        this.lbBchao.Text = "正常";
                    }
                    else if (BchaoModel.BCHAO == "2")
                    {
                        this.lbBchao.ForeColor = Color.Red;
                        this.lbBchao.Text      = "异常";
                    }
                }
                HealthHouseEcgModel EcgModel = new HealthHouseEcgBLL().GetModel(houseModel.ID);//心电
                if (EcgModel != null)
                {
                    if (EcgModel.ECG == "1")
                    {
                        this.lbEcg.Text = "正常";
                    }
                    else if (EcgModel.ECG == "2")
                    {
                        this.lbEcg.ForeColor = Color.Red;
                        this.lbEcg.Text      = "异常";
                    }
                }
                HHCardiovascularModel VascularModel = new HHCardiovascularBLL().GetData(this.Model.IDCardNo, houseModel.ID);//心血管
                if (VascularModel != null)
                {
                    if (VascularModel.Result == "1")
                    {
                        this.lbVascular.Text = "正常";
                    }
                    else if (VascularModel.Result == "2")
                    {
                        this.lbVascular.ForeColor = Color.Red;
                        this.lbVascular.Text      = "异常";
                    }
                }
                HHBoneModel BoneModel = new HHBoneBLL().GetData(this.Model.IDCardNo, houseModel.ID);//骨密度
                if (BoneModel != null)
                {
                    if (BoneModel.Result == "1")
                    {
                        this.lbBone.Text = "正常";
                    }
                    else if (BoneModel.Result == "2")
                    {
                        this.lbBone.ForeColor = Color.Red;
                        this.lbBone.Text      = "异常";
                    }
                }
                HHLungModel LungModel = new HHLungBLL().GetData(this.Model.IDCardNo, houseModel.ID);//肺功能
                if (LungModel != null)
                {
                    if (LungModel.Result == "1")
                    {
                        this.lbLung.Text = "正常";
                    }
                    else if (LungModel.Result == "2")
                    {
                        this.lbLung.ForeColor = Color.Red;
                        this.lbLung.Text      = "异常";
                    }
                }
                HealthHouseMediPhyModel MedModel = new HealthHouseMediPhyBLL().GetModel(houseModel.ID);//中医体质类型
                if (MedModel != null)
                {
                    string strMed = "";
                    if (!string.IsNullOrEmpty(MedModel.Mild))
                    {
                        strMed += "平和质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Faint))
                    {
                        strMed += "气虚质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Yang))
                    {
                        strMed += "阳虚质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Yin))
                    {
                        strMed += "阴虚质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.PhlegmDamp))
                    {
                        strMed += "痰湿质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Muggy))
                    {
                        strMed += "湿热质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.BloodStasis))
                    {
                        strMed += "血瘀质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.QiConstraint))
                    {
                        strMed += "气郁质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Characteristic))
                    {
                        strMed += "特兼质,";
                    }
                    if (strMed != "")
                    {
                        this.lbMed.Text = strMed.Remove(strMed.Length - 1, 1);
                    }
                }
            }
            else
            {
                MessageBox.Show("无体检信息,请先做体检!");
                return;
            }
            //SimpleBinding(this.lbBMI, "BasicTest");
            //SimpleBinding(this.lbData, "CheckDate");
            //SimpleBinding(this.lbXueYa, "Blood");
            //SimpleBinding(this.lbBchao, "BSuper");
            //SimpleBinding(this.lbXiongBu, "ChestX");
            //SimpleBinding(this.lbEcg, "ECG");
            //SimpleBinding(this.lbVascular, "Cardiovascular");
            //SimpleBinding(this.lbBone, "Bone");
            //SimpleBinding(this.lbLung, "Lung");
            //SimpleBinding(this.lbMed, "TCMConstitution");
            //SimpleBinding(this.lbxinlv, "PulseRate");
            //SimpleBinding(this.lbxueyang, "Oxygen");
            //SimpleBinding(this.lbniao, "Urine");
            this.EveryThingIsOk = true;
        }