コード例 #1
0
        private void FrmSelect_Load(object sender, EventArgs e)
        {
            string str = !(this.m_DeviceType == "24") ? string.Format(" IDCardNo = '{0}' and DEVICETYPE = '{1}' ", this.m_User, this.m_DeviceType) : string.Format(" IDCardNo = '{0}' and (devicetype = 24 or (devicetype = 35 and devicename = '血糖' )) ", this.m_User, this.m_DeviceType);

            if (this.m_DeviceType == "35")
            {
                str = str + string.Format(" and deviceName = '{0}'", this.mytypeName);
            }
            if (this.m_DeviceType == "20")
            {
                if (this.ItemTypeName == "心率")
                {
                    str = str + string.Format(" and Value3 != '' ", new object[0]);
                }
                if (this.ItemTypeName == "血压")
                {
                    str = str + string.Format(" and Value1 != '' ", new object[0]);
                }
            }
            this.devInfo = new DeviceInfoBLL().GetModelList(str + " ORDER BY ID DESC ");
            if (this.m_DeviceType == "20")
            {
                for (int j = 0; j < this.devInfo.Count; j++)
                {
                    if ((string.IsNullOrEmpty(this.devInfo[j].Value1 + this.devInfo[j].Value2) && !(this.ItemTypeName == "心率")) && (this.ItemTypeName == "血压"))
                    {
                        this.devInfo.RemoveAt(j);
                    }
                    if (string.IsNullOrEmpty(this.devInfo[j].Value3) && (this.ItemTypeName == "心率"))
                    {
                        this.devInfo.RemoveAt(j);
                    }
                }
                /// <summary>
                /// 左侧低血压
                /// </summary>
                RequireModel LeftLowModel = new RequireBLL().GetModel("健康体检", "一般状况", "左侧低血压");
                /// <summary>
                /// 左侧高血压
                /// </summary>
                RequireModel LeftHeightModel = new RequireBLL().GetModel("健康体检", "一般状况", "左侧高血压");
                /// <summary>
                /// 右侧低血压
                /// </summary>
                RequireModel RightLowModel = new RequireBLL().GetModel("健康体检", "一般状况", "右侧低血压");
                /// <summary>
                /// 右侧高血压
                /// </summary>
                RequireModel RightHeightModel = new RequireBLL().GetModel("健康体检", "一般状况", "右侧高血压");
                int          num = 0;
                //山东禹城 单侧为右
                for (int i = 0; i < this.devInfo.Count; i++)
                {
                    //如果数据为左侧血压
                    if (devInfo[i].DeviceName == "左侧血压")
                    {
                        //判断默认项是否存在左侧高血压  value1 是左侧高血压
                        if (LeftHeightModel != null)
                        {
                            //判断是否可以转换int
                            if (int.TryParse(devInfo[i].Value1, out num))
                            {
                                //默认项是偶数
                                if (LeftHeightModel.IsOdevity == "偶数")
                                {
                                    //取余 如果余数不是0 表示是奇数,需要-1处理成偶数
                                    if (int.Parse(devInfo[i].Value1) % 2 != 0)
                                    {
                                        devInfo[i].Value1 = (int.Parse(devInfo[i].Value1) - 1).ToString();
                                    }
                                }
                                //默认项是奇数
                                if (LeftHeightModel.IsOdevity == "奇数")
                                {
                                    //取余 如果余数是0 表示是偶数,需要-1处理成奇数
                                    if (int.Parse(devInfo[i].Value1) % 2 == 0)
                                    {
                                        devInfo[i].Value1 = (int.Parse(devInfo[i].Value1) - 1).ToString();
                                    }
                                }
                            }
                        }
                        //判断默认项是否存在左侧低血压 value2 是左侧低血压
                        if (LeftLowModel != null)
                        {
                            //判断是否可以转换int
                            if (int.TryParse(devInfo[i].Value2, out num))
                            {
                                //默认项是偶数
                                if (LeftLowModel.IsOdevity == "偶数")
                                {
                                    //取余 如果余数不是0 表示是奇数,需要-1处理成偶数
                                    if (int.Parse(devInfo[i].Value2) % 2 != 0)
                                    {
                                        devInfo[i].Value2 = (int.Parse(devInfo[i].Value2) - 1).ToString();
                                    }
                                }
                                //默认项是奇数
                                if (LeftLowModel.IsOdevity == "奇数")
                                {
                                    //取余 如果余数是0 表示是偶数,需要-1处理成奇数
                                    if (int.Parse(devInfo[i].Value2) % 2 == 0)
                                    {
                                        devInfo[i].Value2 = (int.Parse(devInfo[i].Value2) - 1).ToString();
                                    }
                                }
                            }
                        }
                    }
                    //山东地区 单侧为右
                    if (devInfo[i].DeviceName == "右侧血压" || devInfo[i].DeviceName == "血压" || string.IsNullOrEmpty(devInfo[i].DeviceName))
                    {
                        //判断默认项是否存在右侧高血压  value1 是右侧高血压
                        if (RightHeightModel != null)
                        {
                            //判断是否可以转换int
                            if (int.TryParse(devInfo[i].Value1, out num))
                            {
                                //默认项是偶数
                                if (RightHeightModel.IsOdevity == "偶数")
                                {
                                    //取余 如果余数不是0 表示是奇数,需要-1处理成偶数
                                    if (int.Parse(devInfo[i].Value1) % 2 != 0)
                                    {
                                        devInfo[i].Value1 = (int.Parse(devInfo[i].Value1) - 1).ToString();
                                    }
                                }
                                //默认项是奇数
                                if (RightHeightModel.IsOdevity == "奇数")
                                {
                                    //取余 如果余数是0 表示是偶数,需要-1处理成奇数
                                    if (int.Parse(devInfo[i].Value1) % 2 == 0)
                                    {
                                        devInfo[i].Value1 = (int.Parse(devInfo[i].Value1) - 1).ToString();
                                    }
                                }
                            }
                        }
                        //判断默认项是否存在左侧低血压 value2 是左侧低血压
                        if (RightLowModel != null)
                        {
                            //判断是否可以转换int
                            if (int.TryParse(devInfo[i].Value2, out num))
                            {
                                //默认项是偶数
                                if (RightLowModel.IsOdevity == "偶数")
                                {
                                    //取余 如果余数不是0 表示是奇数,需要-1处理成偶数
                                    if (int.Parse(devInfo[i].Value2) % 2 != 0)
                                    {
                                        devInfo[i].Value2 = (int.Parse(devInfo[i].Value2) - 1).ToString();
                                    }
                                }
                                //默认项是奇数
                                if (RightLowModel.IsOdevity == "奇数")
                                {
                                    //取余 如果余数是0 表示是偶数,需要-1处理成奇数
                                    if (int.Parse(devInfo[i].Value2) % 2 == 0)
                                    {
                                        devInfo[i].Value2 = (int.Parse(devInfo[i].Value2) - 1).ToString();
                                    }
                                }
                            }
                        }
                    }
                }
                this.dataGridView1.Columns.Add(this.GetTextColums("收缩压", "Value1", 0x58));
                this.dataGridView1.Columns.Add(this.GetTextColums("舒张压", "Value2", 0x58));
                this.dataGridView1.Columns.Add(this.GetTextColums("心率", "Value3", 0x58));
                if (this.m_direction != "Right")
                {
                    this.dataGridView1.Columns.Add(this.GetTextColums("检测时间", "UpdateData", 120));
                }
            }
            else if (this.m_DeviceType == "22")
            {
                this.dataGridView1.Columns.Add(this.GetTextColums("体重", "Value1", 0x42));
                this.dataGridView1.Columns.Add(this.GetTextColums("检测时间", "UpdateData", 120));
            }
            else if (this.m_DeviceType == "24")
            {
                this.dataGridView1.Columns.Add(this.GetTextColums("血糖", "Value1", 70));
                this.dataGridView1.Columns.Add(this.GetTextColums("检测时间", "UpdateData", 120));
            }
            else if (this.m_DeviceType == "32")
            {
                this.dataGridView1.Columns.Add(this.GetTextColums("血氧", "Value1", 0x58));
                this.dataGridView1.Columns.Add(this.GetTextColums("脉率", "Value2", 0x58));
                this.dataGridView1.Columns.Add(this.GetTextColums("检测时间", "UpdateData", 120));
            }
            else if (this.m_DeviceType == "33")
            {
                this.dataGridView1.Columns.Add(this.GetTextColums("检测时间", "UpdateData", 120));
                this.dataGridView1.Columns.Add(this.GetTextColums("尿胆原", "Value1", 50));
                this.dataGridView1.Columns.Add(this.GetTextColums("潜血", "Value2", 50));
                this.dataGridView1.Columns.Add(this.GetTextColums("胆红素", "Value3", 50));
                this.dataGridView1.Columns.Add(this.GetTextColums("酮体", "Value4", 50));
                this.dataGridView1.Columns.Add(this.GetTextColums("葡萄糖", "Value5", 50));
                this.dataGridView1.Columns.Add(this.GetTextColums("蛋白质", "Value6", 50));
                this.dataGridView1.Columns.Add(this.GetTextColums("PH", "Value7", 50));
                this.dataGridView1.Columns.Add(this.GetTextColums("亚硝酸盐", "Value8", 50));
                this.dataGridView1.Columns.Add(this.GetTextColums("白细胞", "Value9", 50));
                this.dataGridView1.Columns.Add(this.GetTextColums("比重", "Value10", 50));
                this.dataGridView1.Columns.Add(this.GetTextColums("维生素C", "Value11", 50));
            }
            else if (this.m_DeviceType == "35")
            {
                this.dataGridView1.Columns.Add(this.GetTextColums(this.mytypeName, "Value1", 0x58));
                this.dataGridView1.Columns.Add(this.GetTextColums("检测时间", "UpdateData", 120));
            }
            else if (this.m_DeviceType == "39")
            {
                this.dataGridView1.Columns.Add(this.GetTextColums("身高", "Value1", 0x42));
                this.dataGridView1.Columns.Add(this.GetTextColums("检测时间", "UpdateData", 120));
            }
            else if (this.m_DeviceType == "40")
            {
                this.dataGridView1.Columns.Add(this.GetTextColums("体温", "Value1", 0x42));
                this.dataGridView1.Columns.Add(this.GetTextColums("检测时间", "UpdateData", 120));
            }
            else if (this.m_DeviceType == "98")
            {
                this.dataGridView1.Columns.Add(this.GetTextColums("呼吸频率", "Value1", 0x42));
                this.dataGridView1.Columns.Add(this.GetTextColums("检测时间", "UpdateData", 120));
            }
            else if (this.m_DeviceType == "41")
            {
                this.dataGridView1.Columns.Add(this.GetTextColums("幽门螺杆菌", "Value1", 0x42));
                this.dataGridView1.Columns.Add(this.GetTextColums("检测时间", "UpdateData", 120));
            }
            else if (this.m_DeviceType == "42")
            {
                this.dataGridView1.Columns.Add(this.GetTextColums("胸围", "Value1", 0x4c));
                this.dataGridView1.Columns.Add(this.GetTextColums("腰围", "Value2", 0x4c));
                this.dataGridView1.Columns.Add(this.GetTextColums("臀围", "Value3", 0x4c));
                this.dataGridView1.Columns.Add(this.GetTextColums("检测时间", "UpdateData", 120));
            }
            else if (this.m_DeviceType == "52")
            {
                this.dataGridView1.Columns.Add(this.GetTextColums("血红蛋白值", "Value1", 0x42));
                this.dataGridView1.Columns.Add(this.GetTextColums("检测时间", "UpdateData", 120));
            }
            else if (this.m_DeviceType == "97")
            {
                this.dataGridView1.Columns.Add(this.GetTextColums("检测结果", "Value1", 0xf6));
                this.dataGridView1.Columns.Add(this.GetTextColums("检测时间", "UpdateData", 120));
            }
            for (int i = 1; i < this.dataGridView1.ColumnCount; i++)
            {
                this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
            }
            this.bds            = new BindingSource();
            this.bds.DataSource = this.devInfo;
            this.dataGridView1.AutoGenerateColumns = false;
            this.dataGridView1.DataSource          = this.bds;
        }
コード例 #2
0
ファイル: HypInfoForm.cs プロジェクト: NET201X/KangShuoTech
        //private void MustChoose() //必选项设置
        //{
        //    DataTable HyperInfoDt = new ChronicHypertensionBaseInfoBLL().GetList("IDCardNo ='" + Model.IDCardNo + "'").Tables[0];
        //    bool flag = (HyperInfoDt.Rows.Count > 0) ? true : false;

        //    if (File.Exists(Application.StartupPath + "\\requiredHyper.xml"))
        //    {
        //        DataSet dsrequire = new DataSet();
        //        dsrequire.ReadXml(Application.StartupPath + "\\requiredHyper.xml");
        //        DataTable dt = dsrequire.Tables[0];
        //        foreach (DataRow item in dt.Rows)
        //        {
        //            if (item["ISREQUIRED"].ToString() == "1" && item["COMMENT"].ToString() == "基本信息,家族史")
        //            {
        //                if (flag)
        //                {
        //                    DataRow row = HyperInfoDt.Rows[0];
        //                    if (string.IsNullOrEmpty(row["FatherHistory"].ToString()))
        //                    {
        //                        this.groupBox3.Text = "*家族史";
        //                        this.groupBox3.ForeColor = System.Drawing.Color.Red;
        //                    }
        //                    else
        //                    {
        //                        this.groupBox3.Text = "家族史";
        //                        this.groupBox3.ForeColor = System.Drawing.Color.Black;
        //                    }
        //                    break;
        //                }
        //                else
        //                {
        //                    this.groupBox3.Text = "*家族史";
        //                    this.groupBox3.ForeColor = System.Drawing.Color.Red;
        //                }

        //            }
        //        }
        //        foreach (DataRow item in dt.Rows)
        //        {
        //            if (item["ISREQUIRED"].ToString() == "1" && item["COMMENT"].ToString() == "基本信息,目前症状")
        //            {
        //                if (flag)
        //                {
        //                    DataRow row = HyperInfoDt.Rows[0];
        //                    if (string.IsNullOrEmpty(row["Symptom"].ToString()))
        //                    {
        //                        this.groupBox2.Text = "*目前症状";
        //                        this.groupBox2.ForeColor = System.Drawing.Color.Red;
        //                    }
        //                    else
        //                    {
        //                        this.groupBox2.Text = "目前症状";
        //                        this.groupBox2.ForeColor = System.Drawing.Color.Black;
        //                    }
        //                    break;
        //                }
        //                else
        //                {
        //                    this.groupBox2.Text = "*目前症状";
        //                    this.groupBox2.ForeColor = System.Drawing.Color.Red;
        //                }
        //            }
        //        }
        //        foreach (DataRow item in dt.Rows)
        //        {
        //            if (item["ISREQUIRED"].ToString() == "1" && item["COMMENT"].ToString() == "基本信息,是否使用降压药")
        //            {
        //                if (flag)
        //                {
        //                    DataRow row = HyperInfoDt.Rows[0];
        //                    if (string.IsNullOrEmpty(row["Hypotensor"].ToString()))
        //                    {
        //                        this.label3.Text = "*是否使用降压药:";
        //                        this.label3.ForeColor = System.Drawing.Color.Red;
        //                    }
        //                    else
        //                    {
        //                        this.label3.Text = "是否使用降压药:";
        //                        this.label3.ForeColor = System.Drawing.Color.Black;
        //                    }
        //                    break;
        //                }
        //                else
        //                {
        //                    this.label3.Text = "*是否使用降压药:";
        //                    this.label3.ForeColor = System.Drawing.Color.Red;
        //                }
        //            }
        //        }

        //    }
        //}
        private void MustChoose()
        {
            DataSet dsrequire = new DataSet();

            dsrequire = new RequireBLL().GetList("TabName = '高血压随访' and Comment = '高血压基本信息' ");
            DataTable dt = dsrequire.Tables[0];

            if (this.hpyBaseInfo == null)
            {
                foreach (DataRow item in dt.Rows)
                {
                    if (item["Isrequired"].ToString() == "1")
                    {
                        switch (item["ChinName"].ToString())
                        {
                        case "家族史":
                            this.groupBox3.Text      = "*家族史";
                            this.groupBox3.ForeColor = System.Drawing.Color.Red;
                            break;

                        case "目前症状":
                            this.groupBox2.Text      = "*目前症状";
                            this.groupBox2.ForeColor = System.Drawing.Color.Red;
                            break;

                        case "是否使用降压药":
                            this.label3.Text      = "*是否使用降压药:";
                            this.label3.ForeColor = System.Drawing.Color.Red;
                            break;

                        case "管理组别":
                            this.label35.Text      = "*管理组别:";
                            this.label35.ForeColor = System.Drawing.Color.Red;
                            break;

                        case "病历来源":
                            this.label1.Text      = "*病历来源:";
                            this.label1.ForeColor = System.Drawing.Color.Red;
                            break;

                        case "高血压并发症情况":
                            this.groupBox4.Text      = "*高血压并发症情况";
                            this.groupBox4.ForeColor = System.Drawing.Color.Red;
                            break;

                        default: break;
                        }
                    }
                }
            }
            else
            {
                foreach (DataRow item in dt.Rows)
                {
                    switch (item["ChinName"].ToString())
                    {
                    case "家族史":
                        if (string.IsNullOrEmpty(this.hpyBaseInfo.FatherHistory))
                        {
                            this.groupBox3.Text      = "*家族史";
                            this.groupBox3.ForeColor = System.Drawing.Color.Red;
                        }
                        else
                        {
                            this.groupBox3.Text      = "家族史";
                            this.groupBox3.ForeColor = System.Drawing.Color.Black;
                        }
                        break;

                    case "目前症状":
                        if (string.IsNullOrEmpty(this.hpyBaseInfo.Symptom))
                        {
                            this.groupBox2.Text      = "*目前症状";
                            this.groupBox2.ForeColor = System.Drawing.Color.Red;
                        }
                        else
                        {
                            this.groupBox2.Text      = "目前症状";
                            this.groupBox2.ForeColor = System.Drawing.Color.Black;
                        }
                        break;

                    case "是否使用降压药":
                        if (string.IsNullOrEmpty(this.hpyBaseInfo.Hypotensor))
                        {
                            this.label3.Text      = "*是否使用降压药:";
                            this.label3.ForeColor = System.Drawing.Color.Red;
                        }
                        else
                        {
                            this.label3.Text      = "是否使用降压药:";
                            this.label3.ForeColor = System.Drawing.Color.Black;
                        }
                        break;

                    case "管理组别":
                        if (string.IsNullOrEmpty(this.hpyBaseInfo.ManagementGroup))
                        {
                            this.label35.Text      = "*管理组别:";
                            this.label35.ForeColor = System.Drawing.Color.Red;
                        }
                        else
                        {
                            this.label35.Text      = "管理组别:";
                            this.label35.ForeColor = System.Drawing.Color.Black;
                        }
                        break;

                    case "病历来源":
                        if (string.IsNullOrEmpty(this.hpyBaseInfo.CaseOurce))
                        {
                            this.label1.Text      = "*病历来源:";
                            this.label1.ForeColor = System.Drawing.Color.Red;
                        }
                        else
                        {
                            this.label1.Text      = "病历来源:";
                            this.label1.ForeColor = System.Drawing.Color.Black;
                        }
                        break;

                    case "高血压并发症情况":
                        if (string.IsNullOrEmpty(this.hpyBaseInfo.HypertensionComplication))
                        {
                            this.groupBox4.Text      = "*高血压并发症情况";
                            this.groupBox4.ForeColor = System.Drawing.Color.Red;
                        }
                        else
                        {
                            this.groupBox4.Text      = "高血压并发症情况";
                            this.groupBox4.ForeColor = System.Drawing.Color.Black;
                        }
                        break;

                    default: break;
                    }
                }
            }
        }
コード例 #3
0
        private void MustChoose()
        {
            DataSet dsrequire = new DataSet();

            dsrequire = new RequireBLL().GetList("TabName = '老年人随访' and Comment = '健康评估' ");
            DataTable dt    = dsrequire.Tables[0];
            DataTable older = new OlderSelfCareabilityBLL().GetList("IDCardNo ='" + Model.IDCardNo + "'").Tables[0];
            bool      flag  = (older.Rows.Count > 0) ? true : false;

            if (flag)
            {
                DataRow row = older.Rows[0];
                foreach (DataRow item in dt.Rows)
                {
                    if (item["Isrequired"].ToString() == "1")
                    {
                        switch (item["ChinName"].ToString())
                        {
                        case "进餐":
                            if (string.IsNullOrEmpty(row["Dine"].ToString()))
                            {
                                this.label10.Text      = "*进    餐:";
                                this.label10.ForeColor = System.Drawing.Color.Red;
                            }
                            else
                            {
                                this.label10.Text      = "进    餐:";
                                this.label10.ForeColor = System.Drawing.Color.Black;
                            }
                            break;
                            break;

                        case "梳洗":
                            if (string.IsNullOrEmpty(row["Groming"].ToString()))
                            {
                                this.label13.Text      = "*梳    洗:";
                                this.label13.ForeColor = System.Drawing.Color.Red;
                            }
                            else
                            {
                                this.label13.Text      = "梳    洗:";
                                this.label13.ForeColor = System.Drawing.Color.Black;
                            }
                            break;

                        case "穿衣":
                            if (string.IsNullOrEmpty(row["Dressing"].ToString()))
                            {
                                this.label16.Text      = "*穿    衣:";
                                this.label16.ForeColor = System.Drawing.Color.Red;
                            }
                            else
                            {
                                this.label16.Text      = "穿    衣:";
                                this.label16.ForeColor = System.Drawing.Color.Black;
                            }
                            break;

                        case "如厕":
                            if (string.IsNullOrEmpty(row["Tolet"].ToString()))
                            {
                                this.label19.Text      = "*如    厕:";
                                this.label19.ForeColor = System.Drawing.Color.Red;
                            }
                            else
                            {
                                this.label19.Text      = "如    厕:";
                                this.label19.ForeColor = System.Drawing.Color.Black;
                            }
                            break;

                        case "活动":
                            if (string.IsNullOrEmpty(row["Activity"].ToString()))
                            {
                                this.label1.Text      = "*活    动:";
                                this.label1.ForeColor = System.Drawing.Color.Red;
                            }
                            else
                            {
                                this.label1.Text      = "活    动:";
                                this.label1.ForeColor = System.Drawing.Color.Black;
                            }
                            break;

                        default: break;
                        }
                    }
                }
            }
            else
            {
                foreach (DataRow item in dt.Rows)
                {
                    if (item["Isrequired"].ToString() == "1")
                    {
                        switch (item["ChinName"].ToString())
                        {
                        case "进餐":
                            this.label10.Text      = "*进    餐:";
                            this.label10.ForeColor = System.Drawing.Color.Red;
                            break;

                        case "梳洗":
                            this.label13.Text      = "*梳    洗:";
                            this.label13.ForeColor = System.Drawing.Color.Red;
                            break;

                        case "穿衣":
                            this.label16.Text      = "*穿    衣:";
                            this.label16.ForeColor = System.Drawing.Color.Red;
                            break;

                        case "如厕":
                            this.label19.Text      = "*如    厕:";
                            this.label19.ForeColor = System.Drawing.Color.Red;
                            break;

                        case "活动":
                            this.label1.Text      = "*活    动:";
                            this.label1.ForeColor = System.Drawing.Color.Red;
                            break;

                        default: break;
                        }
                    }
                }
            }
        }