Beispiel #1
0
        public bool Update(HealthOverviewSetModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(" update HEALTHHOUSE_OVERVIEW_SET set ");
            builder.Append("Type=@Type,");
            builder.Append("maxValues=@maxValues,");
            builder.Append("minValues=@minValues,");
            builder.Append("MaxEx=@MaxEx,");
            builder.Append("MinEx=@MinEx,");
            builder.Append("Content=@Content,");
            builder.Append("Col2=@Col2,");
            builder.Append("Col3=@Col3,");
            builder.Append("CreateDate=@CreateDate,");
            builder.Append("CreateBy=@CreateBy,");
            builder.Append("UpdateDate=@UpdateDate,");
            builder.Append("UpdateBy=@UpdateBy");
            builder.Append(" where ID=@ID");
            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@Type", MySqlDbType.Int32),
                new MySqlParameter("@maxValues", MySqlDbType.String),
                new MySqlParameter("@minValues", MySqlDbType.String),
                new MySqlParameter("@MaxEx", MySqlDbType.String),
                new MySqlParameter("@MinEx", MySqlDbType.String),
                new MySqlParameter("@Content", MySqlDbType.String),
                new MySqlParameter("@Col2", MySqlDbType.String),
                new MySqlParameter("@Col3", MySqlDbType.String),
                new MySqlParameter("@CreateDate", MySqlDbType.Date),
                new MySqlParameter("@CreateBy", MySqlDbType.String),
                new MySqlParameter("@UpdateDate", MySqlDbType.Date),
                new MySqlParameter("@UpdateBy", MySqlDbType.String),
                new MySqlParameter("@ID", MySqlDbType.Int32),
            };
            cmdParms[0].Value  = model.Type;
            cmdParms[1].Value  = model.maxValues;
            cmdParms[2].Value  = model.minValues;
            cmdParms[3].Value  = model.MaxEx;
            cmdParms[4].Value  = model.MinEx;
            cmdParms[5].Value  = model.Content;
            cmdParms[6].Value  = model.Col2;
            cmdParms[7].Value  = model.Col3;
            cmdParms[8].Value  = model.CreateDate;
            cmdParms[9].Value  = model.CreateBy;
            cmdParms[10].Value = model.UpdateDate;
            cmdParms[11].Value = model.UpdateBy;
            cmdParms[12].Value = model.ID;
            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
Beispiel #2
0
        public int Add(HealthOverviewSetModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(" insert into HEALTHHOUSE_OVERVIEW_SET(");
            builder.Append("Type,maxValues,minValues,MaxEx,MinEx,Content,Col2,Col3,CreateDate,CreateBy,UpdateDate,UpdateBy)");
            builder.Append(" values (");
            builder.Append("@Type,@maxValues,@minValues,@MaxEx,@MinEx,@Content,@Col2,@Col3,@CreateDate,@CreateBy,@UpdateDate,@UpdateBy)");
            builder.Append(";select @@IDENTITY");
            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@Type", MySqlDbType.Int32),
                new MySqlParameter("@maxValues", MySqlDbType.String),
                new MySqlParameter("@minValues", MySqlDbType.String),
                new MySqlParameter("@MaxEx", MySqlDbType.String),
                new MySqlParameter("@MinEx", MySqlDbType.String),
                new MySqlParameter("@Content", MySqlDbType.String),
                new MySqlParameter("@Col2", MySqlDbType.String),
                new MySqlParameter("@Col3", MySqlDbType.String),
                new MySqlParameter("@CreateDate", MySqlDbType.Date),
                new MySqlParameter("@CreateBy", MySqlDbType.String),
                new MySqlParameter("@UpdateDate", MySqlDbType.Date),
                new MySqlParameter("@UpdateBy", MySqlDbType.String)
            };
            cmdParms[0].Value  = model.Type;
            cmdParms[1].Value  = model.maxValues;
            cmdParms[2].Value  = model.minValues;
            cmdParms[3].Value  = model.MaxEx;
            cmdParms[4].Value  = model.MinEx;
            cmdParms[5].Value  = model.Content;
            cmdParms[6].Value  = model.Col2;
            cmdParms[7].Value  = model.Col3;
            cmdParms[8].Value  = model.CreateDate;
            cmdParms[9].Value  = model.CreateBy;
            cmdParms[10].Value = model.UpdateDate;
            cmdParms[11].Value = model.UpdateBy;
            object single = MySQLHelper.GetSingle(builder.ToString(), cmdParms);

            if (single == null)
            {
                return(0);
            }
            return(Convert.ToInt32(single));
        }
Beispiel #3
0
 public bool Update(HealthOverviewSetModel model)
 {
     return(this.dal.Update(model));
 }
Beispiel #4
0
 public int Add(HealthOverviewSetModel model)
 {
     return(this.dal.Add(model));
 }
Beispiel #5
0
 private void HealthAssessSetExForm_Load(object sender, EventArgs e)
 {
     SetList = setbll.GetList("");
     if (SetList == null)
     {
         SetList = new List <HealthOverviewSetModel>();
         for (int i = 1; i < 21; i++)
         {
             SetTempModel            = new HealthOverviewSetModel();
             SetTempModel.Type       = i.ToString();
             SetTempModel.CreateDate = new DateTime?(DateTime.Today);
             SetTempModel.CreateBy   = ConfigHelper.GetNode("doctorName");
             SetList.Add(SetTempModel);
         }
     }
     foreach (HealthOverviewSetModel hs in SetList)
     {
         if (hs.Type == "1")//体质指数
         {
             SimpleBinding(this.tbBLRang, hs, "maxValues");
             SimpleBinding(this.tbBHRang, hs, "minValues");
             SimpleBinding(this.tbBHadvice, hs, "MaxEx");
             SimpleBinding(this.tbBLadvice, hs, "MinEx");
         }
         else if (hs.Type == "2")//血压
         {
             if (!string.IsNullOrEmpty(hs.maxValues))
             {
                 string[] strmax = hs.maxValues.Split('/');
                 if (strmax.Length == 2)
                 {
                     this.tbXHRang.Text = strmax[0];
                     this.tbXLRang.Text = strmax[1];
                 }
                 else
                 {
                     this.tbXHRang.Text = strmax[0];
                 }
             }
             if (!string.IsNullOrEmpty(hs.minValues))
             {
                 string[] strmin = hs.minValues.Split('/');
                 if (strmin.Length == 2)
                 {
                     this.tbXHRang2.Text = strmin[0];
                     this.tbXLRang2.Text = strmin[1];
                 }
                 else
                 {
                     this.tbXHRang2.Text = strmin[0];
                 }
             }
             SimpleBinding(this.tbXHadvice, hs, "MaxEx");
             SimpleBinding(this.tbXLadvice, hs, "MinEx");
         }
         else if (hs.Type == "3")//心率
         {
             SimpleBinding(this.tbPHRang, hs, "maxValues");
             SimpleBinding(this.tbPLRang, hs, "minValues");
             SimpleBinding(this.tbPHadvice, hs, "MaxEx");
             SimpleBinding(this.tbPLadvice, hs, "MinEx");
         }
         else if (hs.Type == "4")//血氧
         {
             SimpleBinding(this.tbOHRang, hs, "maxValues");
             SimpleBinding(this.tbOLRang, hs, "minValues");
             SimpleBinding(this.tbOHadvice, hs, "MaxEx");
             SimpleBinding(this.tbOLadvice, hs, "MinEx");
         }
         else if (hs.Type == "5")//胸部X线片
         {
             SimpleBinding(this.tbCadvice, hs, "Content");
         }
         else if (hs.Type == "6")//心电
         {
             SimpleBinding(this.tbECGadvice, hs, "Content");
         }
         else if (hs.Type == "7")//B超
         {
             SimpleBinding(this.tbBchaoadvice, hs, "Content");
         }
         else if (hs.Type == "8")//心血管
         {
             SimpleBinding(this.tbVadvice, hs, "Content");
         }
         else if (hs.Type == "9")//肺功能
         {
             SimpleBinding(this.tbLadvice, hs, "Content");
         }
         else if (hs.Type == "10")//骨密度
         {
             SimpleBinding(this.tbBoneadvice, hs, "Content");
         }
         else if (hs.Type == "11")//尿常规
         {
             SimpleBinding(this.tbNadvice, hs, "Content");
         }
         else if (hs.Type == "12") //平和质
         {
             SimpleBinding(this.tbphz, hs, "Content");
         }
         else if (hs.Type == "13") //气虚质
         {
             SimpleBinding(this.tbqxz, hs, "Content");
         }
         else if (hs.Type == "14") //阳虚质
         {
             SimpleBinding(this.tbyangxz, hs, "Content");
         }
         else if (hs.Type == "15") //阴虚质
         {
             SimpleBinding(this.tbyinxz, hs, "Content");
         }
         else if (hs.Type == "16") //痰湿质
         {
             SimpleBinding(this.tbtansz, hs, "Content");
         }
         else if (hs.Type == "17") //湿热质
         {
             SimpleBinding(this.tbshirz, hs, "Content");
         }
         else if (hs.Type == "18") //血瘀质
         {
             SimpleBinding(this.tbxueyz, hs, "Content");
         }
         else if (hs.Type == "19") //气郁质
         {
             SimpleBinding(this.tbqiyz, hs, "Content");
         }
         else if (hs.Type == "20") //特兼质
         {
             SimpleBinding(this.tbtebz, hs, "Content");
         }
     }
 }
        public void InitEveryThing()
        {
            if (HealthGuideFactory.ViewState == "修改")
            {
                // 获取指导信息
                HealthHouseGuideModel guideModel = guideBll.GetHealthGuideByIdCardNo(HealthGuideFactory.ID);

                this.lbName.Text        = guideModel.CustomerName;
                this.lbData.Text        = guideModel.CheckDate.Value.ToString("yyyy-MM-dd");
                this.lblAge.Text        = timeParser.GetAge(guideModel.Birthday);
                this.lblSex.Text        = StringPlus.GetSex(guideModel.Sex);
                this.txtSummary.Text    = guideModel.Summary;
                this.txtHealthGuid.Text = guideModel.HealthGuid;
                this.txtMedGuid.Text    = guideModel.MedGuid;
            }
            else
            {
                // 获取病人是否有健康指导
                HealthHouseModel     houseModel = new HealthHouseBLL().GetMaxData(this.Model.IDCardNo);
                RecordsBaseInfoModel baseInfo   = new RecordsBaseInfoBLL().GetModel(this.Model.IDCardNo); // 体检人基本信息

                // 获取体检标准值
                List <HealthOverviewSetModel> SetList     = new List <HealthOverviewSetModel>();
                HealthOverviewSetBLL          OverViewBll = new HealthOverviewSetBLL();
                SetList = OverViewBll.GetList(" and Type in (1,2,3,4,5,6,7,8,9,10,11)");
                HealthGuideFactory.PID = houseModel.ID; // 新增获取体检ID赋值给指导PID

                if (houseModel != null && baseInfo != null)
                {
                    HealthAssessFactory.ID = houseModel.ID;
                    this.lbName.Text       = baseInfo.CustomerName;
                    this.lbData.Text       = houseModel.CheckDate.Value.ToString("yyyy-MM-dd");
                    this.lblAge.Text       = timeParser.GetAge(baseInfo.Birthday);
                    this.lblSex.Text       = StringPlus.GetSex(baseInfo.Sex);

                    #region 体检小结/健康指导

                    if (SetList != null)
                    {
                        foreach (HealthOverviewSetModel hs in SetList)
                        {
                            #region 基本体检

                            if (hs.Type == "1")// 体质指数
                            {
                                // 对比体检数值是否正常
                                int res = Compare(houseModel.BMI.ToString(), hs.maxValues, hs.minValues);

                                if (res == 1 || res == 2)
                                {
                                    // 数据类型 返回偏高、低异常信息
                                    HealthOverviewSetModel model = OverViewBll.GetModel(" and Type=1 ");

                                    if (res == 1) // 偏高
                                    {
                                        txtSummary.Text += "体质指数:偏高\r\n";
                                        if (StringPlus.toString(model.MaxEx).Length > 0)
                                        {
                                            txtHealthGuid.Text += "体质指数:" + model.MaxEx + "\r\n";
                                        }
                                    }
                                    else if (res == 2) // 偏低
                                    {
                                        txtSummary.Text += "体质指数:偏低\r\n";
                                        if (StringPlus.toString(model.MinEx).Length > 0)
                                        {
                                            txtHealthGuid.Text += "体质指数:" + model.MinEx + "\r\n";
                                        }
                                    }
                                }
                            }
                            else if (hs.Type == "2")// 血压
                            {
                                string[] Hmax = hs.maxValues.Split('/');
                                string[] Hmin = hs.minValues.Split('/');

                                // 数据类型 返回偏高、低异常信息
                                HealthOverviewSetModel model = OverViewBll.GetModel(" and Type=2 ");

                                if (Hmax.Length == 2)  // 高血范围
                                {
                                    if (Compare(houseModel.LeftHeight.ToString(), Hmax[0], Hmax[1]) == 1)
                                    {
                                        txtSummary.Text += "高血压:偏高\r\n";
                                        if (StringPlus.toString(model.MaxEx).Length > 0)
                                        {
                                            txtHealthGuid.Text += "高血压:" + model.MaxEx + "\r\n";
                                        }
                                    }
                                }
                                if (Hmin.Length == 2)  // 低压范围
                                {
                                    if (Compare(houseModel.LeftPre.ToString(), Hmin[0], Hmin[1]) == 2)
                                    {
                                        txtSummary.Text += "低血压:偏低\r\n";
                                        if (StringPlus.toString(model.MinEx).Length > 0)
                                        {
                                            txtHealthGuid.Text += "低血压:" + model.MinEx + "\r\n";
                                        }
                                    }
                                }
                            }
                            else if (hs.Type == "3") // 心率
                            {
                                int res = Compare(houseModel.PulseRate.ToString(), hs.maxValues, hs.minValues);
                                if (res == 1 || res == 2)
                                {
                                    // 数据类型 返回偏高、低异常信息
                                    HealthOverviewSetModel model = OverViewBll.GetModel(" and Type=3 ");

                                    if (res == 1) // 偏高
                                    {
                                        txtSummary.Text += "心率:偏高\r\n";
                                        if (StringPlus.toString(model.MaxEx).Length > 0)
                                        {
                                            txtHealthGuid.Text += "心率:" + model.MaxEx + "\r\n";
                                        }
                                    }
                                    else if (res == 2) // 偏低
                                    {
                                        txtSummary.Text += "心率:偏低\r\n";
                                        if (StringPlus.toString(model.MinEx).Length > 0)
                                        {
                                            txtHealthGuid.Text += "心率:" + model.MinEx + "\r\n";
                                        }
                                    }
                                }
                            }
                            else if (hs.Type == "4") // 血氧
                            {
                                int res = Compare(houseModel.BloodOxygen.ToString(), hs.maxValues, hs.minValues);
                                if (res == 1 || res == 2)
                                {
                                    // 数据类型 返回偏高、低异常信息
                                    HealthOverviewSetModel model = OverViewBll.GetModel(" and Type=4 ");

                                    if (res == 1) // 偏高
                                    {
                                        txtSummary.Text += "血氧:偏高\r\n";
                                        if (StringPlus.toString(model.MaxEx).Length > 0)
                                        {
                                            txtHealthGuid.Text += "血氧:" + model.MaxEx + "\r\n";
                                        }
                                    }
                                    else if (res == 2) // 偏低
                                    {
                                        txtSummary.Text += "血氧:偏低\r\n";
                                        if (StringPlus.toString(model.MinEx).Length > 0)
                                        {
                                            txtHealthGuid.Text += "血氧:" + model.MinEx + "\r\n";
                                        }
                                    }
                                }
                            }

                            #endregion
                        }

                        #region 辅助检查

                        if (houseModel.CHESTX == "2")
                        {
                            txtSummary.Text += "胸部X线片:异常\r\n ";
                            if (StringPlus.toString(houseModel.CHESTXEx).Length > 0)
                            {
                                txtHealthGuid.Text += "胸部X线片:" + houseModel.CHESTXEx + "\r\n";
                            }
                        }

                        if (!string.IsNullOrEmpty(houseModel.PRO) &&
                            !string.IsNullOrEmpty(houseModel.GLU) &&
                            !string.IsNullOrEmpty(houseModel.KET) &&
                            !string.IsNullOrEmpty(houseModel.BLD))
                        {
                            if (houseModel.PRO.Contains("+") ||
                                houseModel.GLU.Contains("+") ||
                                houseModel.KET.Contains("+") ||
                                houseModel.BLD.Contains("+"))
                            {
                                // 数据类型 返回偏高、低异常信息
                                HealthOverviewSetModel model = OverViewBll.GetModel(" and Type =11 ");

                                txtSummary.Text += "尿常规:异常\r\n";
                                if (StringPlus.toString(model.Content).Length > 0)
                                {
                                    txtHealthGuid.Text += "尿常规:" + model.Content + "\r\n";
                                }
                            }
                        }

                        #endregion

                        #region 心电/B超/心血管/肺功能/骨密度

                        // 心电
                        if (houseModel.ECG == "2")
                        {
                            txtSummary.Text += "心电:异常\r\n";
                            if (StringPlus.toString(houseModel.ECGEx).Length > 0)
                            {
                                txtHealthGuid.Text += "心电:" + houseModel.ECGEx + "\r\n";
                            }
                        }

                        // B超
                        if (houseModel.BCHAO == "2")
                        {
                            txtSummary.Text += "B超:异常\r\n";
                            if (StringPlus.toString(houseModel.BCHAOEx).Length > 0)
                            {
                                txtHealthGuid.Text += "B超:" + houseModel.BCHAOEx + "\r\n";
                            }
                        }
                        // B超其他
                        if (houseModel.BCHAOther == "2")
                        {
                            txtSummary.Text += "B超其他:异常\r\n";
                            if (StringPlus.toString(houseModel.BCHAOtherEx).Length > 0)
                            {
                                txtHealthGuid.Text += "B超其他:" + houseModel.BCHAOtherEx + "\r\n";
                            }
                        }

                        // 心血管
                        if (houseModel.CResult == "2")
                        {
                            txtSummary.Text += "心血管:异常\r\n";
                            if (StringPlus.toString(houseModel.CResultEx).Length > 0)
                            {
                                txtHealthGuid.Text += "心血管:" + houseModel.CResultEx + "\r\n";
                            }
                        }

                        // 肺功能
                        if (houseModel.LResult == "2")
                        {
                            txtSummary.Text += "肺功能:异常\r\n";
                            if (StringPlus.toString(houseModel.LResultEx).Length > 0)
                            {
                                txtHealthGuid.Text += "肺功能:" + houseModel.LResultEx + "\r\n";
                            }
                        }

                        // 骨密度
                        if (houseModel.Result == "2")
                        {
                            txtSummary.Text += "骨密度:异常\r\n";
                            if (StringPlus.toString(houseModel.ResultEx).Length > 0)
                            {
                                txtHealthGuid.Text += "骨密度:" + houseModel.ResultEx + "\r\n";
                            }
                        }

                        #endregion
                    }

                    #endregion

                    #region 中医健康指导

                    HealthHouseMediPhyModel MedModel = new HealthHouseMediPhyBLL().GetModel(houseModel.ID);//中医体质类型
                    if (MedModel != null)
                    {
                        string strMed = "";
                        if (!string.IsNullOrEmpty(MedModel.Mild))
                        {
                            // 平和质 健康指导
                            HealthOverviewSetModel model = OverViewBll.GetModel(" and Type=12 ");

                            if (model != null && !string.IsNullOrEmpty(model.Content))
                            {
                                strMed += "平和质 \r\n" + model.Content;
                            }
                            else
                            {
                                strMed += "平和质 \r\n";
                            }
                        }
                        if (!string.IsNullOrEmpty(MedModel.Faint))
                        {
                            // 气虚质 健康指导
                            HealthOverviewSetModel model = OverViewBll.GetModel(" and Type=13 ");

                            strMed += "气虚质 \r\n";
                        }
                        if (!string.IsNullOrEmpty(MedModel.Yang))
                        {
                            // 阳虚质 健康指导
                            HealthOverviewSetModel model = OverViewBll.GetModel(" and Type=14 ");

                            strMed += "阳虚质 \r\n";
                        }
                        if (!string.IsNullOrEmpty(MedModel.Yin))
                        {
                            // 阴虚质 健康指导
                            HealthOverviewSetModel model = OverViewBll.GetModel(" and Type=15 ");

                            strMed += "阴虚质 \r\n";
                        }
                        if (!string.IsNullOrEmpty(MedModel.PhlegmDamp))
                        {
                            // 痰湿质 健康指导
                            HealthOverviewSetModel model = OverViewBll.GetModel(" and Type=16 ");

                            strMed += "痰湿质 \r\n";
                        }
                        if (!string.IsNullOrEmpty(MedModel.Muggy))
                        {
                            // 湿热质 健康指导
                            HealthOverviewSetModel model = OverViewBll.GetModel(" and Type=17 ");

                            strMed += "湿热质 \r\n";
                        }
                        if (!string.IsNullOrEmpty(MedModel.BloodStasis))
                        {
                            // 血瘀质 健康指导
                            HealthOverviewSetModel model = OverViewBll.GetModel(" and Type=18 ");

                            strMed += "血瘀质 \r\n";
                        }
                        if (!string.IsNullOrEmpty(MedModel.QiConstraint))
                        {
                            // 气郁质 健康指导
                            HealthOverviewSetModel model = OverViewBll.GetModel(" and Type=19 ");

                            strMed += "气郁质 \r\n";
                        }
                        if (!string.IsNullOrEmpty(MedModel.Characteristic))
                        {
                            // 特兼质 健康指导
                            HealthOverviewSetModel model = OverViewBll.GetModel(" and Type=20 ");

                            strMed += "特兼质 \r\n";
                        }
                        if (strMed != "")
                        {
                            this.txtMedGuid.Text = strMed.Remove(strMed.Length - 1, 1);
                        }
                    }

                    #endregion
                }
                else
                {
                    MessageBox.Show("无体检信息,请先做体检!");
                    return;
                }
            }

            this.EveryThingIsOk = true;
        }