public void InitEveryThing()
        {
            ChekType = new List <CheckBox> {
                this.cktype1, this.cktype2, this.cktype3, this.cktype4, this.cktype5, this.cktype6, this.cktype8,
                this.cktype9, this.cktype10, this.cktype11, this.cktype12, this.cktype13, this.cktype14, this.cktype15, this.cktype16, this.cktype17,
                this.cktype18, this.cktype19, this.cktype21, this.cktype22, this.cktype24, this.cktype25, this.cktype26, this.cktype27, this.cktype28,
                this.cktype30, this.cktype31, this.cktype32, this.cktype33, this.cktype34, this.cktype37, this.cbOldFeed
            };

            this.findModels = new List <RecordsBaseInfoModel>();
            this.bds        = new BindingSource();

            this.dt_user = new RecordsBaseInfoBLL().GetUserDt("").Tables[0];
            if (this.dt_user.Rows.Count > 0)
            {
                DataRow row = this.dt_user.NewRow();
                row.ItemArray = new object[] { "不限", 0, "" };
                this.dt_user.Rows.InsertAt(row, 0);
                this.cbxUser.ValueMember   = "ID";
                this.cbxUser.DisplayMember = "CreateMenName";
                this.cbxUser.DataSource    = this.dt_user;
            }
            DataTable dt_Town = new RecordsCustomerBaseInfoBLL().GetTownList().Tables[0];

            if (dt_Town.Rows.Count > 0)
            {
                DataRow row = dt_Town.NewRow();
                row.ItemArray = new object[] { "不限" };
                dt_Town.Rows.InsertAt(row, 0);
                this.cbxTown.DisplayMember = "TownName";
                this.cbxTown.DataSource    = dt_Town;
            }
            this.EveryThingIsOk = true;
        }
        private void CheckData()
        {
            this.btnQuery.Enabled = false;
            string where          = this.GetWhere();
            if (string.IsNullOrEmpty(where))
            {
                MessageBox.Show("请选择查询条件!", "查询条件", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                this.btnQuery.Enabled = true;
            }
            else
            {
                RecordsCustomerBaseInfoBLL archive_baseinfo = new RecordsCustomerBaseInfoBLL();
                this.totalCount = archive_baseinfo.GetCustomerRecordCount(where);
                this.totalPages = (this.totalCount <= this.pageCount) ? 1 : ((this.totalCount / this.pageCount) +
                                                                             (((this.totalCount % this.pageCount) > 0) ? 1 : 0));
                this.lbTotalCount.Text = string.Format("共计{0}条", this.totalCount.ToString());
                if (this.currentPage > totalPages - 1)
                {
                    this.currentPage--;
                }

                DataSet ds = archive_baseinfo.GetCustomerListByPage(where, "CheckDate desc ,B.ID ASC", this.currentPage * this.pageCount, this.pageCount);
                this.lbPages.Text = string.Format("{0}/{1}页", this.currentPage + 1, this.totalPages);
                if (ds.Tables.Count > 0)
                {
                    this.TransDs(ds);
                    this.bds.DataSource     = ds.Tables[0];
                    this.dgvData.DataSource = this.bds;
                }
                this.groupBox1.Enabled = false;
                this.btnQuery.Enabled  = true;
                this.btnQuery.Text     = "重置条件";
            }
        }
Beispiel #3
0
        private void HealthCheckPictureBox_Click(object sender, EventArgs e) //健康体检
        {
            if (string.IsNullOrEmpty(this.IDCardNo))
            {
                new MessageForm("请先刷身份证或输入身份证登录系统!")
                {
                    StartPosition = FormStartPosition.CenterParent
                }.ShowDialog();
                return;
            }
            //DateTime checkdt = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddMonths(-3);
            DataSet customerds = new RecordsCustomerBaseInfoBLL().GetList(string.Format(" IDCardNo='{0}' and CheckDate between '{1}' and '{2}' order by CheckDate DESC ", this.IDCardNo, DateTime.Today.ToString("yyyy-01-01"), DateTime.Today.Date.ToString("yyyy-12-31")));

            // DataSet customerds = new RecordsCustomerBaseInfoBLL().GetList(string.Format(" IDCardNo='{0}' order by CheckDate desc  ", this.IDCardNo));

            if (customerds.Tables[0].Rows.Count > 0)
            {
                DataRow row         = customerds.Tables[0].Rows[0];
                string  strchekdate = DateTime.Parse(row["CheckDate"].ToString()).ToString("yyyy-MM-dd");
                if (MessageBox.Show("此人于'" + strchekdate + "'已体检,是否继续体检", "继续体检", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No)
                {
                    return;
                }
            }

            PhysicalInfoFactory.ID     = 0;
            PhysicalInfoFactory.NewAdd = true;
            using (PEControler controler = new PEControler(new PhysicalForm(this.IDCardNo), new PhysicalInfoFactory()))
            {
                controler.IParentFrm.IShowDialog();
            }
            GC.Collect();
        }
 public bool hasData()
 {
     if (!string.IsNullOrEmpty(this.CardID))
     {
         DataSet list = new RecordsCustomerBaseInfoBLL().GetList(" IDCardNo='" + this.CardID + "'");
         if (list != null && list.Tables.Count > 0 && list.Tables[0].Rows.Count > 0)
         {
             return(true);
         }
     }
     return(false);
 }
 private void btnFront_Click(object sender, EventArgs e)
 {
     if (this.currentPage > 0)
     {
         this.lbPages.Text = string.Format("{0}/{1}页", --this.currentPage + 1, this.totalPages);
         DataSet ds = new RecordsCustomerBaseInfoBLL().GetCustomerListByPage(this.GetWhere(), "CheckDate desc ,B.ID ASC", this.currentPage * this.pageCount, this.pageCount);
         if (ds.Tables.Count > 0)
         {
             this.TransDs(ds);
             this.bds.DataSource     = ds.Tables[0];
             this.dgvData.DataSource = this.bds;
         }
     }
 }
Beispiel #6
0
        public void InitEveryThing()
        {
            this.findModels = new List <RecordsBaseInfoModel>();
            this.bds        = new BindingSource();
            //string node = ConfigHelper.GetNode("orgCode");
            //if (node.Length == 12)
            //{
            //    this.dt_user = new SysUserBLL().GetList(" VillageID = " + new SysOrgVillangBLL().GetModel(node).ID).Tables[0];
            //}
            //else if (node.Length == 9)
            //{
            //    this.dt_user = new SysUserBLL().GetList(" TownID = " + new SysOrgTownBLL().GetModel(node).ID).Tables[0];
            //}
            //else if (node.Length == 6)
            //{
            //    this.dt_user = new SysOrgDistrictBLL().GetList(" DistrictID = " + new SysOrgDistrictBLL().GetModel(node).ID).Tables[0];
            //}
            //DataRow row = this.dt_user.NewRow();
            //row.ItemArray = new object[] { -1, "ph", "不限" };
            //this.dt_user.Rows.InsertAt(row, 0);
            //this.cbxUser.ValueMember = "ID";
            //this.cbxUser.DisplayMember = "USERNAME";
            //this.cbxUser.DataSource = this.dt_user;
            this.dt_user = new RecordsBaseInfoBLL().GetUserDt("").Tables[0];
            if (this.dt_user.Rows.Count > 0)
            {
                DataRow row = this.dt_user.NewRow();
                row.ItemArray = new object[] { "不限", 0, "" };
                this.dt_user.Rows.InsertAt(row, 0);
                this.cbxUser.ValueMember   = "ID";
                this.cbxUser.DisplayMember = "CreateMenName";
                this.cbxUser.DataSource    = this.dt_user;
            }
            DataTable dt_Town = new RecordsCustomerBaseInfoBLL().GetTownList().Tables[0];

            if (dt_Town.Rows.Count > 0)
            {
                DataRow row = dt_Town.NewRow();
                row.ItemArray = new object[] { "不限" };
                dt_Town.Rows.InsertAt(row, 0);
                this.cbxTown.DisplayMember = "TownName";
                this.cbxTown.DataSource    = dt_Town;
            }
            this.EveryThingIsOk = true;
        }
 private void cbxTown_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(cbxTown.Text))
     {
         string    strwhere   = string.Format("and TownName LIKE '%{0}%'", cbxTown.Text);
         DataTable dt_Village = new RecordsCustomerBaseInfoBLL().GetVillageList(strwhere).Tables[0];
         if (dt_Village.Rows.Count > 0)
         {
             DataRow row = dt_Village.NewRow();
             row.ItemArray = new object[] { "不限" };
             dt_Village.Rows.InsertAt(row, 0);
             this.cbxVillage.DisplayMember = "VillageName";
             this.cbxVillage.DataSource    = dt_Village;
         }
         else
         {
             this.cbxVillage.DataSource = null;
         }
     }
 }
Beispiel #8
0
        public FixedDocumentSequence getReport()
        {
            if (!string.IsNullOrEmpty(this.CardID))
            {
                if (File.Exists("printtemp\\ecg.png"))
                {
                    File.Delete("printtemp\\ecg.png");
                }

                string          xdWhere  = string.Format(" IDCardNo='{0}' AND LEFT(CreateTime,4)='{1}' ORDER BY CreateTime DESC,ID DESC LIMIT 0,1 ", this.CardID, DateTime.Now.Year.ToString());
                RecordsEcgModel ecgModel = new RecordsEcgBLL().GetModelByWhere(xdWhere);

                if (ecgModel == null)
                {
                    ecgModel = new RecordsEcgModel();
                }

                List <ListValue> list = new List <ListValue>();
                string           path = ECGReport + "\\" + ecgModel.MID + ".png";

                if (!File.Exists(path))
                {
                    list.Add(new ListValue
                    {
                        strMark = "&ecg",
                        strVal  = ""
                    });
                }
                else
                {
                    //读取文件流
                    FileStream fs = new System.IO.FileStream(path, FileMode.Open, FileAccess.Read);

                    int    byteLength = (int)fs.Length;
                    byte[] fileBytes  = new byte[byteLength];
                    fs.Read(fileBytes, 0, byteLength);

                    //文件流关閉,文件解除锁定
                    fs.Close();
                    Image image = Image.FromStream(new MemoryStream(fileBytes));

                    //if (community.Equals("聊城东昌府区"))
                    //{
                    Graphics g = Graphics.FromImage(image);

                    #region 禹城 检查医生取文字版,审核医生取手写版,检查日期取心电createTime
                    if (area.Equals("禹城"))
                    {
                        RecordsSignatureModel signModel = new RecordsSignatureBLL().GetModelByOutKey(0, "签字维护");
                        if (signModel == null)
                        {
                            signModel = new RecordsSignatureModel();
                        }

                        // 加载检查医生签名
                        string signPath = SignPath + "_Doctor16.png";

                        if (File.Exists(signPath))
                        {
                            //加载检查日期
                            string imgJianChaKong = SignPath + "_JianChaKongBai.png";
                            string imgJianChaZi   = SignPath + "Date//" + CardID + "_imgJianChaZi.png";

                            if (!File.Exists(imgJianChaKong))
                            {
                                //创建一个200*40的空白图
                                Bitmap   b1 = new Bitmap(200, 80);                             //新建位图zdb1
                                Graphics g1 = Graphics.FromImage(b1);                          //创建版b1的Graphics
                                g1.FillRectangle(Brushes.White, new Rectangle(0, 0, 200, 80)); //把b1涂成红色
                                b1.Save(imgJianChaKong);
                                b1.Dispose();
                            }

                            if (!File.Exists(SignPath + "Date"))
                            {
                                Directory.CreateDirectory(SignPath + "Date");
                            }

                            if (File.Exists(imgJianChaZi))
                            {
                                File.Delete(imgJianChaZi);
                            }

                            Bitmap     bitmap = new Bitmap(imgJianChaKong);
                            Graphics   gp     = Graphics.FromImage(bitmap);
                            Font       font   = new Font("KaiTi", 40, FontStyle.Bold);
                            SolidBrush sbrush = new SolidBrush(Color.Black);
                            gp.DrawString(signModel.AECGSn, font, sbrush, 10, 2);

                            bitmap.Save(imgJianChaZi);
                            bitmap.Dispose();

                            Image imgrq = Image.FromFile(imgJianChaZi);
                            g.DrawImage(image, 0, 0, image.Width, image.Height);
                            g.DrawImage(imgrq, 300, 1950, imgrq.Width, imgrq.Height);
                        }

                        //加载检查日期
                        string imgKong = SignPath + "_KongBai.png";
                        string imgZi   = SignPath + "Date//" + CardID + "_imgZi.png";

                        //绑定检查日期
                        DateTime checkDate;
                        if (DateTime.TryParse(ecgModel.CreateTime.ToString(), out checkDate))
                        {
                            // 加载心电检查医生签名
                            string examinePath = SignPath + "_Doctor16.png";

                            if (File.Exists(SignPath + checkDate.ToString("yyyy-MM-dd") + "//_Doctor16.png"))
                            {
                                Image img = Image.FromFile(SignPath + checkDate.ToString("yyyy-MM-dd") + "//_Doctor16.png");

                                // 将医生签名拼接到检查医生的位置
                                g.DrawImage(image, 0, 0, image.Width, image.Height);
                                g.DrawImage(img, 1300, 1950, img.Width, img.Height);
                            }
                            else
                            {
                                if (File.Exists(examinePath))
                                {
                                    Image img = Image.FromFile(examinePath);

                                    // 将医生签名拼接到检查医生的位置
                                    g.DrawImage(image, 0, 0, image.Width, image.Height);
                                    g.DrawImage(img, 1300, 1950, img.Width, img.Height);
                                }
                            }


                            if (!File.Exists(imgKong))
                            {
                                //创建一个200*40的空白图
                                Bitmap   b1 = new Bitmap(200, 40);                             //新建位图zdb1
                                Graphics g1 = Graphics.FromImage(b1);                          //创建版b1的Graphics
                                g1.FillRectangle(Brushes.White, new Rectangle(0, 0, 200, 40)); //把b1涂成红色
                                b1.Save(imgKong);
                                b1.Dispose();
                            }

                            if (!File.Exists(SignPath + "Date"))
                            {
                                Directory.CreateDirectory(SignPath + "Date");
                            }

                            if (File.Exists(imgZi))
                            {
                                File.Delete(imgZi);
                            }

                            Bitmap     bitmap = new Bitmap(imgKong);
                            Graphics   gp     = Graphics.FromImage(bitmap);
                            string     label  = checkDate.ToString("yyyy-MM-dd");
                            Font       font   = new Font("KaiTi", bitmap.Width / 10, FontStyle.Bold);
                            SolidBrush sbrush = new SolidBrush(Color.Black);
                            gp.DrawString(label, font, sbrush, 10, 2);

                            bitmap.Save(imgZi);
                            bitmap.Dispose();

                            Image imgrq = Image.FromFile(imgZi);
                            g.DrawImage(image, 0, 0, image.Width, image.Height);
                            g.DrawImage(imgrq, 1830, 1950, imgrq.Width, imgrq.Height);
                        }
                        else
                        {
                            // 加载心电检查医生签名
                            string examinePath = SignPath + "_Doctor16.png";

                            if (File.Exists(examinePath))
                            {
                                Image img = Image.FromFile(examinePath);

                                // 将医生签名拼接到检查医生的位置
                                g.DrawImage(image, 0, 0, image.Width, image.Height);
                                g.DrawImage(img, 1300, 1950, img.Width, img.Height);
                            }
                        }
                    }
                    #endregion
                    #region 乐陵
                    else if (area.Equals("乐陵"))
                    {
                        // 加载心电医生签名
                        string signPath = SignPath + "_Doctor16.png";

                        if (File.Exists(signPath))
                        {
                            Image img = Image.FromFile(signPath);

                            // 将医生签名拼接到检查医生的位置
                            g.DrawImage(image, 0, 0, image.Width, image.Height);
                            g.DrawImage(img, 300, 1950, img.Width, img.Height);
                        }

                        // 加载心电检查医生签名
                        string examinePath = SignPath + "_Doctor23.png";

                        if (File.Exists(examinePath))
                        {
                            Image img = Image.FromFile(examinePath);

                            // 将医生签名拼接到检查医生的位置
                            g.DrawImage(image, 0, 0, image.Width, image.Height);
                            g.DrawImage(img, 1300, 1950, img.Width, img.Height);
                        }

                        //加载检查日期
                        RecordsCustomerBaseInfoModel model2 = new RecordsCustomerBaseInfoModel();
                        string strYear  = DateTime.Now.Year.ToString();
                        string strWhere = string.Format(" IDCardNo='{0}'AND LEFT(CheckDate,4)='{1}' ORDER BY CheckDate DESC LIMIT 0,1 ", this.CardID, DateTime.Now.Year);

                        string imgKong = SignPath + "_KongBai.png";
                        string imgZi   = SignPath + "Date//" + CardID + "_imgZi.png";

                        //获取本年度最新一笔数据
                        model2 = new RecordsCustomerBaseInfoBLL().GetModelByWhere(strWhere);
                        if (model2 != null)
                        {
                            DateTime checkDate;
                            if (DateTime.TryParse(model2.CheckDate.ToString(), out checkDate))
                            {
                                if (!File.Exists(imgKong))
                                {
                                    //创建一个200*40的空白图
                                    Bitmap   b1 = new Bitmap(200, 40);                             //新建位图zdb1
                                    Graphics g1 = Graphics.FromImage(b1);                          //创建版b1的Graphics
                                    g1.FillRectangle(Brushes.White, new Rectangle(0, 0, 200, 40)); //把b1涂成红色
                                    b1.Save(imgKong);
                                    b1.Dispose();
                                }

                                if (!File.Exists(SignPath + "Date"))
                                {
                                    Directory.CreateDirectory(SignPath + "Date");
                                }

                                if (File.Exists(imgZi))
                                {
                                    File.Delete(imgZi);
                                }

                                Bitmap     bitmap = new Bitmap(imgKong);
                                Graphics   gp     = Graphics.FromImage(bitmap);
                                string     label  = checkDate.ToString("yyyy-MM-dd");
                                Font       font   = new Font("KaiTi", bitmap.Width / 10, FontStyle.Bold);
                                SolidBrush sbrush = new SolidBrush(Color.Black);
                                gp.DrawString(label, font, sbrush, 10, 2);

                                bitmap.Save(imgZi);
                                bitmap.Dispose();

                                Image imgrq = Image.FromFile(imgZi);
                                g.DrawImage(image, 0, 0, image.Width, image.Height);
                                g.DrawImage(imgrq, 1770, 1960, imgrq.Width, imgrq.Height);
                            }
                        }
                    }
                    #endregion
                    else
                    {
                        // 加载心电医生签名
                        string signPath = SignPath + "_Doctor16.png";

                        if (File.Exists(signPath))
                        {
                            Image img = Image.FromFile(signPath);

                            // 将医生签名拼接到检查医生的位置
                            g.DrawImage(image, 0, 0, image.Width, image.Height);
                            g.DrawImage(img, 300, 1950, img.Width, img.Height);
                        }
                    }

                    // 旋转图片
                    image.RotateFlip(RotateFlipType.Rotate270FlipNone);

                    fs.Close();
                    image.Save("printtemp\\ecg.png");

                    list.Add(new ListValue
                    {
                        strMark = "&ecg",
                        strVal  = "printtemp\\ecg.png"
                    });

                    image.Dispose();
                }

                return(DrawItems.setPage("printXps\\38心电图.xps", list));
            }

            return(null);
        }
Beispiel #9
0
        private void btndataupload_Click(object sender, EventArgs e)
        {
            string strwhere = "";

            if (this.ckbcheckdate.Checked)
            {
                strwhere = string.Format(" CheckDate BETWEEN '{0}' and '{1}' ",
                                         this.dtpstart.Value.Date.ToString("yyyy-MM-dd"), this.dtpend.Value.Date.ToString("yyyy-MM-dd"));
            }

            DataSet customds = new RecordsCustomerBaseInfoBLL().GetList(strwhere);

            int amount = 0;

            progressBar1.Visible   = true;
            progressBar1.Minimum   = 0;
            progressBar1.Maximum   = customds.Tables[0].Rows.Count;
            progressBar1.BackColor = Color.Green;
            labCountnum.Text       = customds.Tables[0].Rows.Count.ToString();

            foreach (DataRow row in customds.Tables[0].Rows)
            {
                int OutKey = Convert.ToInt32(row["ID"].ToString());

                if (string.IsNullOrEmpty(row["IDCardNo"].ToString()))
                {
                    continue;
                }

                // 基本信息
                RecordsBaseInfoModel Model = new RecordsBaseInfoBLL().GetModel(row["IDCardNo"].ToString());
                if (Model == null)
                {
                    Model = new RecordsBaseInfoModel();
                }

                // 一般状况
                RecordsGeneralConditionModel generalConditionModel = new RecordsGeneralConditionBLL().GetModelByOutKey(OutKey);
                if (generalConditionModel == null)
                {
                    generalConditionModel = new RecordsGeneralConditionModel();
                }

                ChronicDiadetesVisitModel diabetesModel = new ChronicDiadetesVisitModel();

                diabetesModel.IDCardNo     = row["IDCardNo"].ToString();
                diabetesModel.Hypertension = generalConditionModel.RightHeight;
                diabetesModel.Hypotension  = generalConditionModel.RightPre;
                diabetesModel.BMI          = generalConditionModel.BMI;
                diabetesModel.Weight       = generalConditionModel.Weight;
                diabetesModel.Hight        = generalConditionModel.Height;

                if (diabetesModel.BMI != null)
                {
                    if (diabetesModel.BMI >= 24)
                    {
                        diabetesModel.TargetWeight = diabetesModel.Weight - 5;
                    }
                }

                // 生活方式
                RecordsLifeStyleModel lifeModel = new RecordsLifeStyleBLL().GetModelByOutKey(OutKey);
                if (lifeModel == null)
                {
                    lifeModel = new RecordsLifeStyleModel();
                }

                if (lifeModel.SmokeCondition == "3")
                {
                    diabetesModel.DailySmokeNum = lifeModel.SmokeDayNum;
                }
                else
                {
                    diabetesModel.DailySmokeNum = 0;
                }

                if (lifeModel.DrinkRate == "2" || lifeModel.DrinkRate == "3" || lifeModel.DrinkRate == "4")
                {
                    diabetesModel.DailyDrinkNum = lifeModel.DayDrinkVolume;
                }
                else
                {
                    diabetesModel.DailyDrinkNum = 0;
                }

                diabetesModel.DailySmokeNumTarget      = 0;
                diabetesModel.DailyDrinkNumTarget      = 0;
                diabetesModel.SportTimePerWeekTarget   = 7;
                diabetesModel.SportPerMinuteTimeTarget = 60;

                // 辅助检查
                RecordsAssistCheckModel AssistCheck = new RecordsAssistCheckBLL().GetModelByOutKey(OutKey);
                if (AssistCheck == null)
                {
                    AssistCheck = new RecordsAssistCheckModel();
                }

                diabetesModel.FPG   = AssistCheck.FPGL;
                diabetesModel.HbAlc = AssistCheck.HBALC;

                new ChronicDiadetesVisitBLL().UpdateDate(diabetesModel);

                ChronicHypertensionVisitModel hypertensionModel = new ChronicHypertensionVisitModel();
                hypertensionModel.Hypertension = generalConditionModel.RightHeight;
                hypertensionModel.Hypotension  = generalConditionModel.RightPre;
                hypertensionModel.BMI          = generalConditionModel.BMI;
                hypertensionModel.Weight       = generalConditionModel.Weight;
                hypertensionModel.Hight        = generalConditionModel.Height;

                if (hypertensionModel.BMI != null)
                {
                    if (hypertensionModel.BMI >= 24)
                    {
                        hypertensionModel.WeightTarGet = hypertensionModel.Weight - 5;
                    }
                }
                if (AssistCheck.FPGL != null)
                {
                    hypertensionModel.AssistantExam = $"空腹血糖:{AssistCheck.FPGL}mmol/L";
                }

                // 查体
                RecordsPhysicalExamModel physicalModel = new RecordsPhysicalExamBLL().GetModelByOutKey(OutKey);
                if (physicalModel == null)
                {
                    physicalModel = new RecordsPhysicalExamModel();
                }

                decimal dd = 0;
                if (!string.IsNullOrEmpty(physicalModel.HeartRate))
                {
                    if (decimal.TryParse(physicalModel.HeartRate, out dd))
                    {
                        hypertensionModel.HeartRate = dd;
                    }
                }

                if (lifeModel.SmokeCondition == "3")
                {
                    hypertensionModel.DailySmokeNum = lifeModel.SmokeDayNum;
                }
                else
                {
                    hypertensionModel.DailySmokeNum = 0;
                }

                if (lifeModel.DrinkRate == "2" || lifeModel.DrinkRate == "3" || lifeModel.DrinkRate == "4")
                {
                    hypertensionModel.DailyDrinkNum = lifeModel.DayDrinkVolume;
                }
                else
                {
                    hypertensionModel.DailyDrinkNum = 0;
                }

                hypertensionModel.DailySmokeNumTarget       = 0;
                hypertensionModel.DailyDrinkNumTarget       = 0;
                hypertensionModel.SportTimeSperWeekTarget   = 7;
                hypertensionModel.SportPerMinutesTimeTarget = 60;
                hypertensionModel.IDCardNo = row["IDCardNo"].ToString();

                new ChronicHypertensionVisitBLL().UpdateDate(hypertensionModel);

                amount++;
                labUploadnum.Text  = amount.ToString();
                progressBar1.Value = amount;
            }

            MessageBox.Show("成功匹配:" + amount + "条数据!", "提示");
            progressBar1.Visible = false;
        }
        public FixedDocumentSequence getReport()
        {
            if (!string.IsNullOrEmpty(this.CardID))
            {
                RecordsBaseInfoModel model = new RecordsBaseInfoBLL().GetModel(this.CardID);
                string strsex = "";
                if (model.Sex != null)
                {
                    if (DrawItems.objToNumStr(model.Sex, 0) == "1")
                    {
                        strsex = "男";
                    }
                    if (DrawItems.objToNumStr(model.Sex, 0) == "2")
                    {
                        strsex = "女";
                    }
                    if (DrawItems.objToNumStr(model.Sex, 0) == "0")
                    {
                        strsex = "未知";
                    }
                    if (DrawItems.objToNumStr(model.Sex, 0) == "9")
                    {
                        strsex = "未说明";
                    }
                }
                List <ListValue> dicVal = new List <ListValue>
                {
                    new ListValue
                    {
                        strMark = "$dahnum",
                        strVal  = model.RecordID
                    },
                    new ListValue
                    {
                        strMark = "$xunum",
                        strVal  = ""
                    },
                    new ListValue
                    {
                        strMark = "$name",
                        strVal  = model.CustomerName
                    },
                    new ListValue
                    {
                        strMark = "$IdCardNo",
                        strVal  = model.IDCardNo
                    },
                    new ListValue
                    {
                        strMark = "$sex",
                        strVal  = strsex
                    },
                    new ListValue
                    {
                        strMark = "$address",
                        strVal  = model.Address
                    },
                    new ListValue
                    {
                        strMark = "$huji",
                        strVal  = model.HouseHoldAddress
                    },
                    new ListValue
                    {
                        strMark = "$lianxi",
                        strVal  = model.Phone
                    },
                    new ListValue
                    {
                        strMark = "$jdrq",
                        strVal  = DrawItems.strToDate(model.CreateDate)
                    }
                };
                string strUnit  = "";
                string orgcode  = ConfigHelper.GetNode("orgCode");
                string TownCode = (orgcode.Length < 9) ? "" : orgcode.Substring(0, 9);
                if (!string.IsNullOrEmpty(TownCode))
                {
                    SysOrgTownModel TownModel = new SysOrgTownBLL().GetModel(TownCode);
                    strUnit = TownModel.Name;
                }
                dicVal.Add(new ListValue
                {
                    strMark = "$jddw",
                    strVal  = strUnit
                });
                RecordsCustomerBaseInfoModel model2 = new RecordsCustomerBaseInfoBLL().GetMaxModel(this.CardID);
                if (model2 != null)
                {
                    dicVal.Add(new ListValue
                    {
                        strMark = "$tjrq",
                        strVal  = DrawItems.strToDate(model2.CheckDate, 1)
                    });
                }
                string path = PhotoPath + this.CardID + ".jpeg";

                if (area.Equals("菏泽"))
                {
                    string path2 = PhotosPath + "Base//" + model.IDCardNo + ".jpg";
                    if (File.Exists(path2))
                    {
                        path = path2;
                    }
                }
                dicVal.Add(new ListValue
                {
                    strMark = "&photo",
                    strVal  = path
                });
                return(DrawItems.setPage("printXps\\" + PrintName, dicVal));
            }
            return(null);
        }
Beispiel #11
0
        private void pictureBoxDataupload_Click(object sender, EventArgs e)
        {
            string strwhere = "";

            if (this.ckbcheckdate.Checked)
            {
                strwhere = string.Format(" CheckDate BETWEEN '{0}' and '{1}' ",
                                         this.dtpstart.Value.Date.ToString("yyyy-MM-dd"), this.dtpend.Value.Date.ToString("yyyy-MM-dd"));
            }

            DataSet customds = new RecordsCustomerBaseInfoBLL().GetList(strwhere);

            int amount = 0;

            progressBar1.Visible   = true;
            progressBar1.Minimum   = 0;
            progressBar1.Maximum   = customds.Tables[0].Rows.Count;
            progressBar1.BackColor = Color.Green;
            labCountnum.Text       = customds.Tables[0].Rows.Count.ToString();

            foreach (DataRow row in customds.Tables[0].Rows)
            {
                if (string.IsNullOrEmpty(row["IDCardNo"].ToString()))
                {
                    continue;
                }

                int OutKey = Convert.ToInt32(row["ID"].ToString());

                // 基本信息
                this.Model = new RecordsBaseInfoBLL().GetModel(row["IDCardNo"].ToString());
                if (this.Model == null)
                {
                    this.Model = new RecordsBaseInfoModel();
                }

                // 健康评价
                this.AssessmentGuides = new RecordsAssessmentGuideBLL().GetModelByOutKey(OutKey);

                if (this.AssessmentGuides == null)
                {
                    this.AssessmentGuides = new RecordsAssessmentGuideModel();
                }

                this.AssessmentGuides.IDCardNo = this.Model.IDCardNo;

                // 辅助检查
                this.AssistCheck = new RecordsAssistCheckBLL().GetModelByOutKey(OutKey);
                if (this.AssistCheck == null)
                {
                    this.AssistCheck = new RecordsAssistCheckModel();
                }

                // 一般状况
                this.generalconditionmodel = new RecordsGeneralConditionBLL().GetModelByOutKey(OutKey);
                if (this.generalconditionmodel == null)
                {
                    this.generalconditionmodel = new RecordsGeneralConditionModel();
                }

                // 查体
                this.physicalModel = new RecordsPhysicalExamBLL().GetModelByOutKey(OutKey);
                if (this.physicalModel == null)
                {
                    this.physicalModel = new RecordsPhysicalExamModel();
                }

                // 现存健康问题
                this.questionModel = new RecordsHealthQuestionBLL().GetModelByOutKey(OutKey);
                if (this.questionModel == null)
                {
                    this.questionModel = new RecordsHealthQuestionModel();
                }

                // 生活方式
                this.liftModel = new RecordsLifeStyleBLL().GetModelByOutKey(OutKey);
                if (this.liftModel == null)
                {
                    this.liftModel = new RecordsLifeStyleModel();
                }

                //脏器功能
                this.visceraFunctionModel = new RecordsVisceraFunctionBLL().GetModelByOutKey(OutKey);
                if (this.visceraFunctionModel == null)
                {
                    this.visceraFunctionModel = new RecordsVisceraFunctionModel();
                }
                AssessmentGuides.IsNormal      = "1";
                AssessmentGuides.Exception1    = null;
                AssessmentGuides.Exception2    = null;
                AssessmentGuides.Exception3    = null;
                AssessmentGuides.Exception4    = null;
                AssessmentGuides.HealthGuide   = null;
                AssessmentGuides.DangerControl = null;
                AssessmentGuides.Arm           = null;
                AssessmentGuides.VaccineAdvice = null;
                AssessmentGuides.Other         = null;
                AssessmentGuides.WaistlineArm  = null;

                #region  赋值给RecordsManageMentModel

                RecordsManageMentModel.Symptom            = row["Symptom"].ToString();
                RecordsManageMentModel.Other              = row["Other"].ToString();
                RecordsManageMentModel.BMI                = this.generalconditionmodel.BMI;
                RecordsManageMentModel.RightHeight        = this.generalconditionmodel.RightHeight;
                RecordsManageMentModel.RightPre           = this.generalconditionmodel.RightPre;
                RecordsManageMentModel.LeftHeight         = this.generalconditionmodel.LeftHeight;
                RecordsManageMentModel.LeftPre            = this.generalconditionmodel.LeftPre;
                RecordsManageMentModel.Waistline          = this.generalconditionmodel.Waistline;
                RecordsManageMentModel.Height             = this.generalconditionmodel.Height;
                RecordsManageMentModel.PulseRate          = this.generalconditionmodel.PulseRate;
                RecordsManageMentModel.Weight             = this.generalconditionmodel.Weight;
                RecordsManageMentModel.OldSelfCareability = this.generalconditionmodel.OldSelfCareability;
                RecordsManageMentModel.DrinkRate          = this.liftModel.DrinkRate;
                RecordsManageMentModel.SmokeCondition     = this.liftModel.SmokeCondition;
                RecordsManageMentModel.ExerciseRate       = this.liftModel.ExerciseRate;

                if (this.liftModel.ExerciseTimes.HasValue)
                {
                    RecordsManageMentModel.ExerciseTimes = this.liftModel.ExerciseTimes.ToString();
                }
                else
                {
                    RecordsManageMentModel.ExerciseTimes = "";
                }

                RecordsManageMentModel.DietaryHabit = this.liftModel.DietaryHabit;
                RecordsManageMentModel.ECG          = this.AssistCheck.ECG;
                RecordsManageMentModel.ECGEx        = "";

                if (!string.IsNullOrEmpty(this.AssistCheck.ECG))
                {
                    if (this.AssistCheck.ECG.Contains("2"))
                    {
                        RecordsManageMentModel.ECGEx += "ST-T改变,";
                    }
                    if (this.AssistCheck.ECG.Contains("3"))
                    {
                        RecordsManageMentModel.ECGEx += "陈旧性心肌梗塞,";
                    }
                    if (this.AssistCheck.ECG.Contains("4"))
                    {
                        RecordsManageMentModel.ECGEx += "窦性心动过速,";
                    }
                    if (this.AssistCheck.ECG.Contains("5"))
                    {
                        RecordsManageMentModel.ECGEx += "窦性心动过缓,";
                    }
                    if (this.AssistCheck.ECG.Contains("6"))
                    {
                        RecordsManageMentModel.ECGEx += "早搏,";
                    }
                    if (this.AssistCheck.ECG.Contains("7"))
                    {
                        RecordsManageMentModel.ECGEx += "房颤,";
                    }
                    if (this.AssistCheck.ECG.Contains("8"))
                    {
                        RecordsManageMentModel.ECGEx += "房室传导阻滞,";
                    }
                    if (this.AssistCheck.ECG.Contains("9"))
                    {
                        RecordsManageMentModel.ECGEx += this.AssistCheck.ECGEx;
                    }
                }
                else
                {
                    RecordsManageMentModel.ECGEx = "";
                }

                RecordsManageMentModel.BCHAO      = this.AssistCheck.BCHAO;
                RecordsManageMentModel.BCHAOEx    = this.AssistCheck.BCHAOEx;
                RecordsManageMentModel.PRO        = this.AssistCheck.PRO;
                RecordsManageMentModel.GLU        = this.AssistCheck.GLU;
                RecordsManageMentModel.KET        = this.AssistCheck.KET;
                RecordsManageMentModel.BLD        = this.AssistCheck.BLD;
                RecordsManageMentModel.UrineOther = this.AssistCheck.UrineOther;
                RecordsManageMentModel.HB         = this.AssistCheck.HB;
                RecordsManageMentModel.WBC        = this.AssistCheck.WBC;
                RecordsManageMentModel.PLT        = this.AssistCheck.PLT;
                RecordsManageMentModel.SGPT       = this.AssistCheck.SGPT;
                RecordsManageMentModel.GOT        = this.AssistCheck.GOT;
                RecordsManageMentModel.BP         = this.AssistCheck.BP;
                RecordsManageMentModel.TBIL       = this.AssistCheck.TBIL;
                RecordsManageMentModel.CB         = this.AssistCheck.CB;
                RecordsManageMentModel.SCR        = this.AssistCheck.SCR;
                RecordsManageMentModel.BUN        = this.AssistCheck.BUN;
                RecordsManageMentModel.PC         = this.AssistCheck.PC;
                RecordsManageMentModel.TC         = this.AssistCheck.TC;
                RecordsManageMentModel.HYPE       = this.AssistCheck.HYPE;
                RecordsManageMentModel.TG         = this.AssistCheck.TG;
                RecordsManageMentModel.GT         = this.AssistCheck.GT;
                RecordsManageMentModel.LowCho     = this.AssistCheck.LowCho;
                RecordsManageMentModel.HeiCho     = this.AssistCheck.HeiCho;
                RecordsManageMentModel.FPGL       = this.AssistCheck.FPGL;
                RecordsManageMentModel.HCY        = this.AssistCheck.HCY;
                RecordsManageMentModel.Other      = this.AssistCheck.Other;

                if (community.Equals("威海美年大健康") && StringPlus.toString(this.AssistCheck.UA) != "")
                {
                    RecordsManageMentModel.UA = this.AssistCheck.UA;
                }

                RecordsManageMentModel.BrainDis      = this.questionModel.BrainDis;
                RecordsManageMentModel.RenalDis      = this.questionModel.RenalDis;
                RecordsManageMentModel.HeartDis      = this.questionModel.HeartDis;
                RecordsManageMentModel.EyeDis        = this.questionModel.EyeDis;
                RecordsManageMentModel.NerveDis      = this.questionModel.NerveDis;
                RecordsManageMentModel.ElseDis       = this.questionModel.ElseDis;
                RecordsManageMentModel.BrainOther    = this.questionModel.BrainOther;
                RecordsManageMentModel.RenalOther    = this.questionModel.RenalOther;
                RecordsManageMentModel.HeartOther    = this.questionModel.HeartOther;
                RecordsManageMentModel.EyeOther      = this.questionModel.EyeOther;
                RecordsManageMentModel.NerveOther    = this.questionModel.NerveOther;
                RecordsManageMentModel.ElseOther     = this.questionModel.ElseOther;
                RecordsManageMentModel.BarrelChest   = this.physicalModel.BarrelChest;  //桶状胸
                RecordsManageMentModel.BreathSounds  = this.physicalModel.BreastEx;     //呼吸音
                RecordsManageMentModel.Rale          = this.physicalModel.Rale;         //罗音
                RecordsManageMentModel.HeartRhythm   = this.physicalModel.HeartRhythm;  //心律
                RecordsManageMentModel.Noise         = this.physicalModel.Noise;        //杂音
                RecordsManageMentModel.PressPain     = this.physicalModel.PressPain;    //压痛
                RecordsManageMentModel.EnclosedMass  = this.physicalModel.EnclosedMass; //包块
                RecordsManageMentModel.Liver         = this.physicalModel.Liver;        //肝大
                RecordsManageMentModel.Spleen        = this.physicalModel.Spleen;       //脾大
                RecordsManageMentModel.Voiced        = this.physicalModel.Voiced;       //移动性浊音
                RecordsManageMentModel.FootBack      = this.physicalModel.FootBack;     //足背动脉搏动
                RecordsManageMentModel.Edema         = this.physicalModel.Edema;        // 下肢水肿
                RecordsManageMentModel.LeftView      = this.visceraFunctionModel.LeftView;
                RecordsManageMentModel.RightView     = this.visceraFunctionModel.RightView;
                RecordsManageMentModel.HeartRate     = this.physicalModel.HeartRate;
                RecordsManageMentModel.Listen        = visceraFunctionModel.Listen;
                RecordsManageMentModel.SportFunction = visceraFunctionModel.SportFunction;

                #endregion

                healthAssessment = new HealthAssessment {
                    Model = this.Model
                };
                olderCnandResult = new OlderCnAndResult();

                // 异常信息
                this.AssessmentGuides = healthAssessment.SetHealthEx(this.AssessmentGuides);

                // 危险因素控制
                this.AssessmentGuides = healthAssessment.SetDangerous(this.AssessmentGuides);

                //随访中医辨识更新
                olderCnandResult.SetCnResult(row["IDCardNo"].ToString());

                // 健康评价异常的更新
                if (this.AssessmentGuides != null)
                {
                    this.AssessmentGuides.OutKey = OutKey;
                    RecordsAssessmentGuideBLL recordsAssessmentGuideBll = new RecordsAssessmentGuideBLL();
                    if (!recordsAssessmentGuideBll.ExistsOutKey(this.AssessmentGuides.IDCardNo, OutKey))
                    {
                        if (recordsAssessmentGuideBll.Add(this.AssessmentGuides) > 0)
                        {
                            amount++;
                            labUploadnum.Text  = amount.ToString();
                            progressBar1.Value = amount;
                        }
                    }
                    else
                    {
                        if (recordsAssessmentGuideBll.Update(this.AssessmentGuides))
                        {
                            amount++;
                            labUploadnum.Text  = amount.ToString();
                            progressBar1.Value = amount;
                        }
                    }
                }
            }

            MessageBox.Show("成功匹配:" + amount + "条数据!", "提示");
            progressBar1.Visible = false;
        }
        public FixedDocumentSequence getReport()
        {
            if (!string.IsNullOrEmpty(this.CardID))
            {
                bool flagEx = false;
                RecordsBaseInfoModel model = new RecordsBaseInfoBLL().GetModel(this.CardID);
                string     strage = "", strsex = "";
                TimeParser timeParser = new TimeParser();
                strage = timeParser.GetAge(model.Birthday);

                if (model.Sex != null)
                {
                    if (DrawItems.objToNumStr(model.Sex, 0) == "1")
                    {
                        strsex = "男";
                    }
                    if (DrawItems.objToNumStr(model.Sex, 0) == "2")
                    {
                        strsex = "女";
                    }
                    if (DrawItems.objToNumStr(model.Sex, 0) == "0")
                    {
                        strsex = "未知";
                    }
                    if (DrawItems.objToNumStr(model.Sex, 0) == "9")
                    {
                        strsex = "未说明";
                    }
                }
                List <ListValue> list = new List <ListValue>
                {
                    new ListValue
                    {
                        strMark = "$name",
                        strVal  = model.CustomerName
                    },
                    new ListValue
                    {
                        strMark = "$age",
                        strVal  = strage
                    },
                    new ListValue
                    {
                        strMark = "$sex",
                        strVal  = strsex
                    },
                    new ListValue
                    {
                        strMark = "$fkys",
                        strVal  = model.Doctor
                    },
                    new ListValue
                    {
                        strMark = "$zhen",
                        strVal  = model.TownName
                    },
                    new ListValue
                    {
                        strMark = "$cun",
                        strVal  = model.VillageName
                    },
                    new ListValue
                    {
                        strMark = "$cardid",
                        strVal  = model.IDCardNo
                    },
                    new ListValue
                    {
                        strMark = "$archiveid",
                        strVal  = model.RecordID
                    },
                    new ListValue
                    {
                        strMark = "$address",
                        strVal  = model.Address
                    }
                };

                string phone = ConfigHelper.GetSetNode("phone");

                list.Add(new ListValue
                {
                    strMark = "$zxdh",
                    strVal  = phone
                });
                string strOrg = ConfigHelper.GetNode("orgCode").Substring(0, 9);
                string TownID = (strOrg.Length < 9) ? "" : strOrg.Substring(0, 9);
                if (!string.IsNullOrEmpty(TownID))
                {
                    SysOrgTownModel townmodel = new SysOrgTownBLL().GetModel(strOrg);
                    if (townmodel != null)
                    {
                        list.Add(new ListValue
                        {
                            strMark = "^wsy",
                            strVal  = townmodel.Name
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$zxwsy",
                            strVal  = townmodel.Name
                        });
                    }
                }
                RecordsCustomerBaseInfoModel model2 = new RecordsCustomerBaseInfoBLL().GetMaxModel(this.CardID);
                if (model2 != null)
                {
                    list.Add(new ListValue
                    {
                        strMark = "$tjsj",
                        strVal  = DrawItems.strToDate(model2.CheckDate, 1)
                    });
                    RecordsGeneralConditionModel model3 = new RecordsGeneralConditionDAL().GetModelByOutKey(model2.ID);
                    if (model3 != null)
                    {
                        list.Add(new ListValue
                        {
                            strMark = "$height",
                            strVal  = DrawItems.objToNumStr(model3.Height)
                        });
                        string strBMI = model3.BMI.ToString();
                        if (model3.BMI > 24)
                        {
                            strBMI += "↑";
                        }
                        else if (model3.BMI < 18)
                        {
                            strBMI += "↓";
                        }
                        list.Add(new ListValue
                        {
                            strMark = "$tzzs",
                            strVal  = strBMI
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$weight",
                            strVal  = DrawItems.objToNumStr(model3.Weight)
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$ml",
                            strVal  = DrawItems.objToNumStr(model3.PulseRate)
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$xyg",
                            strVal  = DrawItems.objToNumStr(model3.RightHeight, 0)
                        });
                        string strxyd = DrawItems.objToNumStr(model3.RightPre, 0);
                        if (!string.IsNullOrEmpty(Convert.ToString(model3.RightHeight)) || !string.IsNullOrEmpty(Convert.ToString(model3.RightPre)))
                        {
                            if (Convert.ToDouble(model3.RightHeight) > 140 || Convert.ToDouble(model3.RightPre) > 90)
                            {
                                flagEx  = true;
                                strxyd += "↑";
                            }
                            else if (Convert.ToDouble(model3.RightHeight) < 90 || Convert.ToDouble(model3.RightPre) < 60)
                            {
                                flagEx  = true;
                                strxyd += "↓";
                            }
                        }
                        list.Add(new ListValue
                        {
                            strMark = "$xyd",
                            strVal  = strxyd
                        });

                        list.Add(new ListValue
                        {
                            strMark = "$gy",
                            strVal  = DrawItems.objToNumStr(model3.LeftHeight, 0)
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$dy",
                            strVal  = DrawItems.objToNumStr(model3.LeftPre, 0)
                        });

                        list.Add(new ListValue
                        {
                            strMark = "$rgy",
                            strVal  = DrawItems.objToNumStr(model3.RightHeight, 0)
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$rdy",
                            strVal  = DrawItems.objToNumStr(model3.RightPre, 0)
                        });
                    }

                    //尿液常规
                    string  strYear  = DateTime.Now.Year.ToString();
                    string  strWhere = string.Format("IDCardNo='{0}' AND Devicetype=33 AND LEFT(UpdateData,4)='{1}' ORDER BY UpdateData DESC,ID DESC LIMIT 0,1 ", this.CardID, strYear);
                    DataSet UrineDt  = new DeviceInfoDAL().GetList(strWhere);

                    if (UrineDt.Tables.Count > 0)
                    {
                        foreach (DataRow UrineRow in UrineDt.Tables[0].Rows)
                        {
                            // 白细胞
                            list.Add(new ListValue
                            {
                                strMark = "$nbxb",
                                strVal  = UrineRow["VALUE9"].ToString()
                            });

                            // 亚硝酸盐
                            list.Add(new ListValue
                            {
                                strMark = "$sy",
                                strVal  = UrineRow["VALUE8"].ToString()
                            });

                            // 尿胆原
                            list.Add(new ListValue
                            {
                                strMark = "$ndy",
                                strVal  = UrineRow["VALUE1"].ToString()
                            });

                            // 胆红素
                            list.Add(new ListValue
                            {
                                strMark = "$dhs",
                                strVal  = UrineRow["VALUE3"].ToString()
                            });

                            // 维生素C
                            list.Add(new ListValue
                            {
                                strMark = "$vc",
                                strVal  = UrineRow["VALUE11"].ToString()
                            });

                            // PH值
                            list.Add(new ListValue
                            {
                                strMark = "$ph",
                                strVal  = UrineRow["VALUE7"].ToString()
                            });

                            // 比重
                            list.Add(new ListValue
                            {
                                strMark = "$bz",
                                strVal  = UrineRow["VALUE10"].ToString()
                            });
                        }
                    }

                    RecordsAssistCheckModel model7 = new RecordsAssistCheckBLL().GetModelByOutKey(model2.ID);

                    if (model7 != null)
                    {
                        string strHB = "", strWBC = "", strPLT = "", strTC = "", strTG = "", strHeiCho = "", strLowCho = "",
                               strFPGL = "", strSGPT = "", strGOT = "", strTBIL = "", strSCR = "", strBUN = "", strHCY = "";

                        #region
                        if (File.Exists(Application.StartupPath + "\\SHValueRange.xml"))
                        {
                            DataSet ds = new DataSet();
                            ds.ReadXml(Application.StartupPath + "\\SHValueRange.xml");
                            DataTable dtSH = ds.Tables[0];
                            if (dtSH.Rows.Count > 0)
                            {
                                foreach (DataRow item in dtSH.Rows)
                                {
                                    if (item["name"].ToString() == "血红蛋白") //血红蛋白
                                    {
                                        strHB = model7.HB.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$hbg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });
                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.HB)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.HB) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strHB  = model7.HB.ToString() + "↓";
                                            }
                                            else if (Convert.ToDouble(model7.HB) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strHB  = model7.HB.ToString() + "↑";
                                            }
                                        }
                                        continue;
                                    }
                                    if (item["name"].ToString() == "白细胞") //白细胞
                                    {
                                        strWBC = model7.WBC.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$wbcg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });
                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.WBC)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.WBC) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strWBC = model7.WBC.ToString() + "↓";
                                            }
                                            else if (Convert.ToDouble(model7.WBC) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strWBC = model7.WBC.ToString() + "↑";
                                            }
                                        }
                                        continue;
                                    }
                                    if (item["name"].ToString() == "血小板") //血小板PLT
                                    {
                                        strPLT = model7.PLT.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$xxbg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });
                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.PLT)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.PLT) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strPLT = model7.PLT.ToString() + "↓";
                                            }
                                            else if (Convert.ToDouble(model7.PLT) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strPLT = model7.PLT.ToString() + "↑";
                                            }
                                        }
                                        continue;
                                    }
                                    if (item["name"].ToString() == "总胆固醇") //总胆固醇(TC)
                                    {
                                        strTC = model7.TC.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$tcg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });
                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.TC)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.TC) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strTC  = model7.TC.ToString() + "↓";
                                            }
                                            else if (Convert.ToDouble(model7.TC) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strTC  = model7.TC.ToString() + "↑";
                                            }
                                        }
                                        continue;
                                    }
                                    if (item["name"].ToString() == "甘油三酯")  //甘油三酯(TG)
                                    {
                                        strTG = model7.TG.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$tgg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });

                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.TG)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.TG) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strTG  = model7.TG.ToString() + "↑";
                                            }
                                            else if (Convert.ToDouble(model7.TG) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strTG  = model7.TG.ToString() + "↓";
                                            }
                                        }
                                        continue;
                                    }
                                    if (item["name"].ToString() == "血清高密度脂蛋白胆固醇") //高密度脂蛋白HeiCho
                                    {
                                        strHeiCho = model7.HeiCho.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$gzg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });

                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.HeiCho)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.HeiCho) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx    = true;
                                                strHeiCho = model7.HeiCho.ToString() + "↑";
                                            }
                                            else if (Convert.ToDouble(model7.HeiCho) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx    = true;
                                                strHeiCho = model7.HeiCho.ToString() + "↓";
                                            }
                                        }
                                        continue;
                                    }
                                    if (item["name"].ToString() == "血清低密度脂蛋白胆固醇")  //低密度脂蛋白LowCho
                                    {
                                        strLowCho = model7.LowCho.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$dzg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });

                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.LowCho)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.LowCho) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx    = true;
                                                strLowCho = model7.LowCho.ToString() + "↑";
                                            }
                                            else if (Convert.ToDouble(model7.LowCho) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx    = true;
                                                strLowCho = model7.LowCho.ToString() + "↓";
                                            }
                                        }
                                        continue;
                                    }
                                    if (item["name"].ToString() == "空腹血糖") //空腹血糖FPGL
                                    {
                                        strFPGL = model7.FPGL.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$xtg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });

                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.FPGL)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.FPGL) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx  = true;
                                                strFPGL = model7.FPGL.ToString() + "↑";
                                            }
                                            else if (Convert.ToDouble(model7.FPGL) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx  = true;
                                                strFPGL = model7.FPGL.ToString() + "↓";
                                            }
                                        }
                                        continue;
                                    }
                                    if (item["name"].ToString() == "血清谷丙转氨酶") //谷丙转氨酶SGPT
                                    {
                                        strSGPT = model7.SGPT.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$gbg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });

                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.SGPT)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.SGPT) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx  = true;
                                                strSGPT = model7.SGPT.ToString() + "↑";
                                            }
                                            else if (Convert.ToDouble(model7.SGPT) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx  = true;
                                                strSGPT = model7.SGPT.ToString() + "↓";
                                            }
                                        }
                                        continue;
                                    }
                                    if (item["name"].ToString() == "血清谷草转氨酶") //谷草转氨酶GOT
                                    {
                                        strGOT = model7.GOT.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$gcg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });

                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.GOT)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.GOT) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strGOT = model7.GOT.ToString() + "↑";
                                            }
                                            else if (Convert.ToDouble(model7.GOT) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strGOT = model7.GOT.ToString() + "↓";
                                            }
                                        }
                                        continue;
                                    }
                                    if (item["name"].ToString() == "同型半胱氨酸") //同型半胱氨酸
                                    {
                                        strHCY = model7.HCY.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$bgdg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });

                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.HCY)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.HCY) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strHCY = model7.HCY.ToString() + "↑";
                                            }
                                            else if (Convert.ToDouble(model7.HCY) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strHCY = model7.HCY.ToString() + "↓";
                                            }
                                        }
                                        continue;
                                    }
                                    if (item["name"].ToString() == "总胆红素") //总胆红素TBIL
                                    {
                                        strTBIL = model7.TBIL.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$zdg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });

                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.TBIL)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.TBIL) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx  = true;
                                                strTBIL = model7.TBIL.ToString() + "↑";
                                            }
                                            else if (Convert.ToDouble(model7.TBIL) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx  = true;
                                                strTBIL = model7.TBIL.ToString() + "↓";
                                            }
                                        }
                                        continue;
                                    }
                                    if (item["name"].ToString() == "血清肌酐") //肌酐SCR
                                    {
                                        strSCR = model7.SCR.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$jgg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });
                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.SCR)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.SCR) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strSCR = model7.SCR.ToString() + "↑";
                                            }
                                            else if (Convert.ToDouble(model7.SCR) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strSCR = model7.SCR.ToString() + "↓";
                                            }
                                        }
                                        continue;
                                    }
                                    if (item["name"].ToString() == "血尿素氮") //尿素氮BUN
                                    {
                                        strBUN = model7.BUN.ToString();
                                        list.Add(new ListValue
                                        {
                                            strMark = "$sdg",
                                            strVal  = item["minvalue"].ToString() + " - " + item["maxvalue"].ToString()
                                        });
                                        if (!string.IsNullOrEmpty(Convert.ToString(model7.BUN)) && !string.IsNullOrEmpty(item["minvalue"].ToString()) && !string.IsNullOrEmpty(item["maxvalue"].ToString()))
                                        {
                                            if (Convert.ToDouble(model7.BUN) > Convert.ToDouble(item["maxvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strBUN = model7.BUN.ToString() + "↑";
                                            }
                                            else if (Convert.ToDouble(model7.BUN) < Convert.ToDouble(item["minvalue"].ToString()))
                                            {
                                                flagEx = true;
                                                strBUN = model7.BUN.ToString() + "↓";
                                            }
                                        }
                                        continue;
                                    }
                                }
                            }
                        }
                        #endregion

                        #region

                        list.Add(new ListValue     //血红蛋白
                        {
                            strMark = "$xhdb",
                            strVal  = strHB
                        });
                        list.Add(new ListValue     //白细胞数
                        {
                            strMark = "$bxbs",
                            strVal  = strWBC
                        });
                        list.Add(new ListValue     //血小板PLT
                        {
                            strMark = "$xxb",
                            strVal  = strPLT
                        });
                        list.Add(new ListValue     //总胆固醇(TC)
                        {
                            strMark = "$zdgc",
                            strVal  = strTC
                        });

                        list.Add(new ListValue     //甘油三酯(TG)
                        {
                            strMark = "$gysz",
                            strVal  = strTG
                        });

                        list.Add(new ListValue     //高密度脂蛋白HeiCho
                        {
                            strMark = "$gzdb",
                            strVal  = strHeiCho
                        });
                        list.Add(new ListValue     //低密度脂蛋白LowCho
                        {
                            strMark = "$dzdb",
                            strVal  = strLowCho
                        });

                        list.Add(new ListValue     //尿蛋白PRO
                        {
                            strMark = "$ncdb",
                            strVal  = model7.PRO
                        });
                        list.Add(new ListValue     //尿糖GLU
                        {
                            strMark = "$ncnt",
                            strVal  = model7.GLU
                        });
                        list.Add(new ListValue     //尿酮体KET
                        {
                            strMark = "$nctt",
                            strVal  = model7.KET
                        });
                        list.Add(new ListValue     //尿潜血BLD
                        {
                            strMark = "$ncqx",
                            strVal  = model7.BLD
                        });
                        list.Add(new ListValue     // 尿常规其他
                        {
                            strMark = "%nqt",
                            strVal  = model7.UrineOther
                        });
                        if ((model7.PRO + model7.GLU + model7.KET + model7.BLD + model7.UrineOther).Contains("+"))
                        {
                            flagEx = true;
                        }
                        list.Add(new ListValue    //空腹血糖FPGL
                        {
                            strMark = "$kfxt",
                            strVal  = strFPGL
                        });

                        list.Add(new ListValue    //谷丙转氨酶SGPT
                        {
                            strMark = "$bzam",
                            strVal  = strSGPT
                        });
                        list.Add(new ListValue   //谷草转氨酶GOT
                        {
                            strMark = "$czam",
                            strVal  = strGOT
                        });
                        list.Add(new ListValue   //总胆红素TBIL
                        {
                            strMark = "$zdhs",
                            strVal  = strTBIL
                        });
                        list.Add(new ListValue    //肌酐SCR
                        {
                            strMark = "$jig",
                            strVal  = strSCR
                        });
                        list.Add(new ListValue   //尿素氮BUN
                        {
                            strMark = "$nsd",
                            strVal  = strBUN
                        });
                        #endregion

                        string strECG = "", strECGex = "";
                        if (!string.IsNullOrEmpty(model7.ECG))
                        {
                            string[] ecg = model7.ECG.Split(new char[] { ',' });
                            foreach (string c in ecg)
                            {
                                switch (c)
                                {
                                case "1":
                                    strECG = "1";
                                    break;

                                case "2":
                                    strECG    = "2";
                                    strECGex += "ST-T改变,";
                                    break;

                                case "3":
                                    strECG    = "2";
                                    strECGex += "陈旧性心肌梗塞,";
                                    break;

                                case "4":
                                    strECG    = "2";
                                    strECGex += "窦性心动过速,";
                                    break;

                                case "5":
                                    strECG    = "2";
                                    strECGex += "窦性心动过缓,";
                                    break;

                                case "6":
                                    strECG    = "2";
                                    strECGex += "早搏,";
                                    break;

                                case "7":
                                    strECG    = "2";
                                    strECGex += "房颤,";
                                    break;

                                case "8":
                                    strECG    = "2";
                                    strECGex += "房室传导阻滞,";
                                    break;

                                case "9":
                                    strECG = "2";
                                    break;
                                }
                            }
                        }
                        list.Add(new ListValue
                        {
                            strMark = "#xdt",
                            strVal  = strECG
                        });

                        if (!string.IsNullOrEmpty(model7.ECGEx))
                        {
                            strECGex += "其他:" + model7.ECGEx.Replace('\n', ';').Replace('\r', ' ').Replace(" ", "");
                        }
                        list.Add(new ListValue
                        {
                            strMark = "$xdtex",
                            strVal  = strECGex
                        });
                        list.Add(new ListValue
                        {
                            strMark = "#bc",
                            strVal  = model7.BCHAO
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$BCex",
                            strVal  = model7.BCHAOEx
                        });
                        string strex = "1";
                        if (flagEx)
                        {
                            strex = "2";
                        }
                        list.Add(new ListValue
                        {
                            strMark = "#tjjl",
                            strVal  = strex
                        });
                    }

                    RecordsAssessmentGuideModel guidemodel = new RecordsAssessmentGuideDAL().GetModelByOutKey(model2.ID);
                    if (guidemodel != null)
                    {
                        list.Add(new ListValue
                        {
                            strMark = "#tjjl",
                            strVal  = guidemodel.IsNormal
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$Ex1",
                            strVal  = guidemodel.Exception1
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$Ex2",
                            strVal  = guidemodel.Exception2
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$Ex3",
                            strVal  = guidemodel.Exception3
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$Ex4",
                            strVal  = guidemodel.Exception4
                        });
                    }
                }
                //int Count = 0;
                OlderSelfCareabilityModel CareModel = new OlderSelfCareabilityBLL().GetModel(this.CardID);
                if (CareModel != null)
                {
                    OlderMedicineResultModel model4 = new OlderMedicineResultBLL().GetModel(this.CardID, CareModel.ID);
                    if (model4 != null)
                    {
                        string strzytz = "";
                        if (!string.IsNullOrEmpty(model4.Mild) && (model4.Mild == "1" || model4.Mild == "2"))
                        {
                            strzytz += "平和质、";
                        }
                        if (!string.IsNullOrEmpty(model4.Faint) && (model4.Faint == "1" || model4.Faint == "2"))
                        {
                            strzytz += "气虚质、";
                        }
                        if (!string.IsNullOrEmpty(model4.Yang) && (model4.Yang == "1" || model4.Yang == "2"))
                        {
                            strzytz += "阳虚质、";
                        }
                        if (!string.IsNullOrEmpty(model4.Yin) && (model4.Yin == "1" || model4.Yin == "2"))
                        {
                            strzytz += "阴虚质、";
                        }
                        if (!string.IsNullOrEmpty(model4.PhlegmDamp) && (model4.PhlegmDamp == "1" || model4.PhlegmDamp == "2"))
                        {
                            strzytz += "痰湿质、";
                        }
                        if (!string.IsNullOrEmpty(model4.Muggy) && (model4.Muggy == "1" || model4.Muggy == "2"))
                        {
                            strzytz += "湿热质、";
                        }
                        if (!string.IsNullOrEmpty(model4.BloodStasis) && (model4.BloodStasis == "1" || model4.BloodStasis == "2"))
                        {
                            strzytz += "血瘀质、";
                        }
                        if (!string.IsNullOrEmpty(model4.QiConstraint) && (model4.QiConstraint == "1" || model4.QiConstraint == "2"))
                        {
                            strzytz += "气郁质、";
                        }
                        if (!string.IsNullOrEmpty(model4.Characteristic) && (model4.Characteristic == "1" || model4.Characteristic == "2"))
                        {
                            strzytz += "特兼质、";
                        }
                        if (!string.IsNullOrEmpty(strzytz))
                        {
                            strzytz = strzytz.Trim(new char[] { '、' });
                        }
                        list.Add(new ListValue
                        {
                            strMark = "$zytz",
                            strVal  = strzytz
                        });
                    }
                }
                list.Add(new ListValue
                {
                    strMark = "&photo",
                    strVal  = PhotoPath + this.CardID + ".jpeg"
                });
                list.Add(new ListValue
                {
                    strMark = "&fkys",
                    strVal  = SignPath + "_Doctor13.png"
                });
                return(DrawItems.setPage("printXps\\" + this.PrintName, list));
            }
            return(null);
        }
Beispiel #13
0
        //默认项设置
        private void PresetValue()
        {
            DataView dv = dsRequire.Tables[0].DefaultView;

            dv.RowFilter = " IsSetValue='是' or IsSetValue='预设上次体检' ";
            DataTable dt = dv.ToTable();
            RecordsCustomerBaseInfoModel        CustomerBaseInfos        = new RecordsCustomerBaseInfoBLL().GetMaxModel(this.Model.IDCardNo);//获取最新一笔体检数据
            List <RecordsHospitalHistoryModel>  HospitalHistoryTemp      = new List <RecordsHospitalHistoryModel>();
            List <RecordsFamilyBedHistoryModel> FamilyBedHistoryInfoTemp = new List <RecordsFamilyBedHistoryModel>();
            List <RecordsMedicationModel>       MedicationTemp           = new List <RecordsMedicationModel>();

            if (CustomerBaseInfos != null)
            {
                HospitalHistoryTemp      = new RecordsHospitalHistoryBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, CustomerBaseInfos.ID));
                FamilyBedHistoryInfoTemp = new RecordsFamilyBedHistoryBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, CustomerBaseInfos.ID));
                MedicationTemp           = new RecordsMedicationBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, CustomerBaseInfos.ID));
            }

            foreach (DataRow item in dt.Rows)
            {
                switch (item["ChinName"].ToString())
                {
                case "住院史":
                    if (item["IsSetValue"].ToString() == "是")
                    {
                        if (!string.IsNullOrEmpty(item["ItemValue"].ToString()))
                        {
                            string[] reslist = item["ItemValue"].ToString().Split(';');
                            RecordsHospitalHistoryModel hModel = new RecordsHospitalHistoryModel();
                            hModel.InHospitalDate  = Convert.ToDateTime(reslist[0].ToString());
                            hModel.OutHospitalDate = Convert.ToDateTime(reslist[1].ToString());
                            hModel.Reason          = reslist[2].ToString();
                            hModel.HospitalName    = reslist[3].ToString();
                            hModel.IllcaseNum      = reslist[4].ToString();
                            this.HospitalHistory.Add(hModel);
                        }
                    }
                    else
                    {
                        this.HospitalHistory = HospitalHistoryTemp;
                    }
                    break;

                case "家庭病床史":
                    if (item["IsSetValue"].ToString() == "预设上次体检")
                    {
                        this.FamilyBedHistoryInfo = FamilyBedHistoryInfoTemp;
                    }
                    break;

                case "用药情况":
                    if (item["IsSetValue"].ToString() == "预设上次体检" && !community.Equals("平度云山医院"))
                    {
                        this.Medication = MedicationTemp;
                    }
                    break;

                default:
                    break;
                }
            }
        }
Beispiel #14
0
        private void TransDs(DataSet ds)
        {
            ds.Tables[0].Columns.Add("MustChoose");
            string mustchoosenode = ConfigHelper.GetMustChooseNode("mustchoose");

            if (string.IsNullOrEmpty(mustchoosenode))
            {
                mustchoosenode = "0000000000000000000000000000000000000000000000000";
                ConfigHelper.WriteNode("mustchoose", "0000000000000000000000000000000000000000000000000");
            }
            char[] chrArray = mustchoosenode.ToCharArray();
            RecordsCustomerBaseInfoBLL CustomerBaseBll     = new RecordsCustomerBaseInfoBLL();
            RecordsGeneralConditionBLL GeneralConditionBll = new RecordsGeneralConditionBLL();
            RecordsLifeStyleBLL        LifeStyleBll        = new RecordsLifeStyleBLL();
            RecordsPhysicalExamBLL     PhysicalExamBll     = new RecordsPhysicalExamBLL();
            RecordsAssistCheckBLL      AssistCheckBll      = new RecordsAssistCheckBLL();
            RecordsVisceraFunctionBLL  VisceraFunctionBll  = new RecordsVisceraFunctionBLL();
            RecordsHealthQuestionBLL   HealthQuestionBll   = new RecordsHealthQuestionBLL();
            RecordsAssessmentGuideBLL  AssessmentGuideBll  = new RecordsAssessmentGuideBLL();

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                string str = "";
                row["Sex"] = !(row["Sex"].ToString() == "1") ? "女" : "男";
                DataTable CustomerBaseInfoDt = CustomerBaseBll.GetList(string.Format("IDCardNo = '{0}'", row["IDCardNo"])).Tables[0];
                DataTable GeneralConditionDt = GeneralConditionBll.GetList(string.Format("IDCardNo = '{0}'", row["IDCardNo"])).Tables[0];
                if (CustomerBaseInfoDt.Rows.Count > 0 || GeneralConditionDt.Rows.Count > 0)
                {
                    str = str + "一般状况:";
                    if (CustomerBaseInfoDt.Rows.Count > 0)
                    {
                        DataRow CustomerBaseInforow = CustomerBaseInfoDt.Rows[0];
                        if (chrArray[0] == '1' && string.IsNullOrEmpty(CustomerBaseInforow["Symptom"].ToString()))
                        {
                            str = str + "症状、";
                        }
                    }
                    if (GeneralConditionDt.Rows.Count > 0)
                    {
                        DataRow GeneralConditionrow = GeneralConditionDt.Rows[0];
                        if (chrArray[1] == '1' && string.IsNullOrEmpty(GeneralConditionrow["AnimalHeat"].ToString()))
                        {
                            str = str + "体温、";
                        }
                        if (chrArray[2] == '1' && string.IsNullOrEmpty(GeneralConditionrow["BreathRate"].ToString()))
                        {
                            str = str + "呼吸频率、";
                        }
                        if (chrArray[3] == '1' && string.IsNullOrEmpty(GeneralConditionrow["Waistline"].ToString()))
                        {
                            str = str + "腰围、";
                        }
                        if (chrArray[4] == '1' && string.IsNullOrEmpty(GeneralConditionrow["Height"].ToString()))
                        {
                            str = str + "身高、";
                        }
                        if (chrArray[5] == '1' && string.IsNullOrEmpty(GeneralConditionrow["PulseRate"].ToString()))
                        {
                            str = str + "脉率、";
                        }
                        if (chrArray[6] == '1' && string.IsNullOrEmpty(GeneralConditionrow["Weight"].ToString()))
                        {
                            str = str + "体重、";
                        }
                        if (chrArray[7] == '1' && string.IsNullOrEmpty(GeneralConditionrow["BMI"].ToString()))
                        {
                            str = str + "体质指数、";
                        }
                        if (chrArray[8] == '1' && string.IsNullOrEmpty(GeneralConditionrow["LeftPre"].ToString()))
                        {
                            str = str + "左侧低血压、";
                        }
                        if (chrArray[9] == '1' && string.IsNullOrEmpty(GeneralConditionrow["RightPre"].ToString()))
                        {
                            str = str + "右侧低血压、";
                        }
                        if (chrArray[10] == '1' && string.IsNullOrEmpty(GeneralConditionrow["LeftHeight"].ToString()))
                        {
                            str = str + "左侧高血压、";
                        }
                        if (chrArray[11] == '1' && string.IsNullOrEmpty(GeneralConditionrow["RightHeight"].ToString()))
                        {
                            str = str + "右侧高血压、";
                        }

                        if (str.Length > 2)
                        {
                            if (str == "一般状况:")
                            {
                                str = "";
                            }
                            else
                            {
                                str = str.Substring(0, str.Length - 1) + ",";
                            }
                        }
                    }
                }

                string    strlife     = "";
                DataTable LifeStyleDt = LifeStyleBll.GetList(string.Format("IDCardNo = '{0}'", row["IDCardNo"])).Tables[0];
                if (LifeStyleDt.Rows.Count > 0)
                {
                    strlife = strlife + "生活方式:";
                    DataRow LifeStylerow = LifeStyleDt.Rows[0];
                    if (chrArray[12] == '1' && string.IsNullOrEmpty(LifeStylerow["DietaryHabit"].ToString()))
                    {
                        strlife = strlife + "饮食习惯、";
                    }
                    if (chrArray[13] == '1' && string.IsNullOrEmpty(LifeStylerow["CareerHarmFactorHistory"].ToString()))
                    {
                        strlife = strlife + "职业病危害因素接触史、";
                    }
                }
                if (strlife.Length > 2)
                {
                    if (strlife == "生活方式:")
                    {
                        strlife = "";
                    }
                    else
                    {
                        str = str + strlife.Substring(0, strlife.Length - 1) + ",";
                    }
                }

                string    strphysicalexam = "";
                DataTable PhysicalExamDt  = PhysicalExamBll.GetList(string.Format("IDCardNo = '{0}'", row["IDCardNo"])).Tables[0];
                if (PhysicalExamDt.Rows.Count > 0)
                {
                    strphysicalexam = strphysicalexam + "查体信息:";
                    DataRow PhysicalExamrow = PhysicalExamDt.Rows[0];
                    if (chrArray[14] == '1' && string.IsNullOrEmpty(PhysicalExamrow["Skin"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "皮肤、";
                    }
                    if (chrArray[15] == '1' && string.IsNullOrEmpty(PhysicalExamrow["Sclere"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "巩膜、";
                    }
                    if (chrArray[16] == '1' && string.IsNullOrEmpty(PhysicalExamrow["Lymph"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "淋巴结、";
                    }
                    if (chrArray[17] == '1' && string.IsNullOrEmpty(PhysicalExamrow["BarrelChest"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "桶状胸、";
                    }
                    if (chrArray[18] == '1' && string.IsNullOrEmpty(PhysicalExamrow["BreathSounds"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "呼吸音、";
                    }
                    if (chrArray[19] == '1' && string.IsNullOrEmpty(PhysicalExamrow["Rale"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "罗音、";
                    }
                    if (chrArray[20] == '1' && string.IsNullOrEmpty(PhysicalExamrow["HeartRate"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "心率、";
                    }
                    if (chrArray[21] == '1' && string.IsNullOrEmpty(PhysicalExamrow["HeartRhythm"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "心律、";
                    }
                    if (chrArray[22] == '1' && string.IsNullOrEmpty(PhysicalExamrow["Noise"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "杂音、";
                    }
                    if (chrArray[23] == '1' && string.IsNullOrEmpty(PhysicalExamrow["EnclosedMass"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "包块、";
                    }
                    if (chrArray[24] == '1' && string.IsNullOrEmpty(PhysicalExamrow["Edema"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "下肢水肿、";
                    }
                    if (chrArray[25] == '1' && string.IsNullOrEmpty(PhysicalExamrow["FootBack"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "足背动脉搏动、";
                    }
                    if (chrArray[26] == '1' && string.IsNullOrEmpty(PhysicalExamrow["Anus"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "肛门指诊、";
                    }
                    if (chrArray[27] == '1' && string.IsNullOrEmpty(PhysicalExamrow["Breast"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "乳腺、";
                    }
                    if (chrArray[28] == '1' && string.IsNullOrEmpty(PhysicalExamrow["PressPain"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "压痛、";
                    }
                    if (chrArray[29] == '1' && string.IsNullOrEmpty(PhysicalExamrow["Liver"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "肝大、";
                    }
                    if (chrArray[30] == '1' && string.IsNullOrEmpty(PhysicalExamrow["Spleen"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "脾大、";
                    }
                    if (chrArray[31] == '1' && string.IsNullOrEmpty(PhysicalExamrow["Voiced"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "移动性浊音、";
                    }
                    if (chrArray[32] == '1' && string.IsNullOrEmpty(PhysicalExamrow["EyeRound"].ToString()))
                    {
                        strphysicalexam = strphysicalexam + "眼底、";
                    }
                }
                if (strphysicalexam.Length > 2)
                {
                    if (strphysicalexam == "查体信息:")
                    {
                        strphysicalexam = "";
                    }
                    else
                    {
                        str = str + strphysicalexam.Substring(0, strphysicalexam.Length - 1) + ",";
                    }
                }

                string    strAssistCheck = "";
                DataTable AssistCheckDt  = AssistCheckBll.GetList(string.Format("IDCardNo = '{0}'", row["IDCardNo"])).Tables[0];
                if (AssistCheckDt.Rows.Count > 0)
                {
                    strAssistCheck = strAssistCheck + "辅助检查:";
                    DataRow AssistCheckrow = AssistCheckDt.Rows[0];
                    if (chrArray[33] == '1' && string.IsNullOrEmpty(AssistCheckrow["FPGL"].ToString()))
                    {
                        strAssistCheck = strAssistCheck + "空腹血糖DL、";
                    }
                }
                if (strAssistCheck.Length > 2)
                {
                    if (strAssistCheck == "辅助检查:")
                    {
                        strAssistCheck = "";
                    }
                    else
                    {
                        str = str + strAssistCheck.Substring(0, strAssistCheck.Length - 1) + ",";
                    }
                }

                string    strVisceraFunction = "";
                DataTable VisceraFunctionDt  = VisceraFunctionBll.GetList(string.Format("IDCardNo = '{0}'", row["IDCardNo"])).Tables[0];
                if (VisceraFunctionDt.Rows.Count > 0)
                {
                    strVisceraFunction = strVisceraFunction + "脏器功能:";
                    DataRow VisceraFunctionrow = VisceraFunctionDt.Rows[0];
                    if (chrArray[34] == '1' && string.IsNullOrEmpty(VisceraFunctionrow["Lips"].ToString()))
                    {
                        strAssistCheck = strAssistCheck + "口唇、";
                    }
                    if (chrArray[35] == '1' && string.IsNullOrEmpty(VisceraFunctionrow["ToothResides"].ToString()))
                    {
                        strAssistCheck = strAssistCheck + "齿列、";
                    }
                    if (chrArray[36] == '1' && string.IsNullOrEmpty(VisceraFunctionrow["Pharyngeal"].ToString()))
                    {
                        strAssistCheck = strAssistCheck + "咽部、";
                    }
                    if (chrArray[37] == '1' && string.IsNullOrEmpty(VisceraFunctionrow["Listen"].ToString()))
                    {
                        strAssistCheck = strAssistCheck + "听力、";
                    }
                    if (chrArray[38] == '1' && string.IsNullOrEmpty(VisceraFunctionrow["SportFunction"].ToString()))
                    {
                        strAssistCheck = strAssistCheck + "运动功能、";
                    }
                }
                if (strVisceraFunction.Length > 2)
                {
                    if (strVisceraFunction == "脏器功能:")
                    {
                        strVisceraFunction = "";
                    }
                    else
                    {
                        str = str + strVisceraFunction.Substring(0, strVisceraFunction.Length - 1) + ",";
                    }
                }

                string    strHealthQuestion = "";
                DataTable HealthQuestionDt  = HealthQuestionBll.GetList(string.Format("IDCardNo = '{0}'", row["IDCardNo"])).Tables[0];
                if (HealthQuestionDt.Rows.Count > 0)
                {
                    strHealthQuestion = strHealthQuestion + "健康问题:";
                    DataRow HealthQuestionrow = HealthQuestionDt.Rows[0];
                    if (chrArray[39] == '1' && string.IsNullOrEmpty(HealthQuestionrow["BrainDis"].ToString()))
                    {
                        strHealthQuestion = strHealthQuestion + "脑血管疾病、";
                    }
                    if (chrArray[40] == '1' && string.IsNullOrEmpty(HealthQuestionrow["RenalDis"].ToString()))
                    {
                        strHealthQuestion = strHealthQuestion + "肾脏疾病、";
                    }
                    if (chrArray[41] == '1' && string.IsNullOrEmpty(HealthQuestionrow["HeartDis"].ToString()))
                    {
                        strHealthQuestion = strHealthQuestion + "心脏疾病、";
                    }
                    if (chrArray[42] == '1' && string.IsNullOrEmpty(HealthQuestionrow["VesselDis"].ToString()))
                    {
                        strHealthQuestion = strHealthQuestion + "血管疾病、";
                    }
                    if (chrArray[43] == '1' && string.IsNullOrEmpty(HealthQuestionrow["EyeDis"].ToString()))
                    {
                        strHealthQuestion = strHealthQuestion + "眼部疾病、";
                    }
                    if (chrArray[44] == '1' && string.IsNullOrEmpty(HealthQuestionrow["NerveDis"].ToString()))
                    {
                        strHealthQuestion = strHealthQuestion + "神经系统疾病、";
                    }
                    if (chrArray[45] == '1' && string.IsNullOrEmpty(HealthQuestionrow["ElseDis"].ToString()))
                    {
                        strHealthQuestion = strHealthQuestion + "其他系统疾病、";
                    }
                }
                if (strHealthQuestion.Length > 2)
                {
                    if (strHealthQuestion == "健康问题:")
                    {
                        strHealthQuestion = "";
                    }
                    else
                    {
                        str = str + strHealthQuestion.Substring(0, strHealthQuestion.Length - 1) + ",";
                    }
                }

                string    strAssessmentGuide = "";
                DataTable AssessmentGuideDt  = AssessmentGuideBll.GetList(string.Format("IDCardNo = '{0}'", row["IDCardNo"])).Tables[0];
                if (AssessmentGuideDt.Rows.Count > 0)
                {
                    strAssessmentGuide = strAssessmentGuide + "健康评价:";
                    DataRow AssessmentGuiderow = AssessmentGuideDt.Rows[0];
                    if (chrArray[46] == '1' && string.IsNullOrEmpty(AssessmentGuiderow["IsNormal"].ToString()))
                    {
                        strAssessmentGuide = strAssessmentGuide + "是否正常1:体检无异常2:有异常、";
                    }
                    if (chrArray[47] == '1' && string.IsNullOrEmpty(AssessmentGuiderow["HealthGuide"].ToString()))
                    {
                        strAssessmentGuide = strAssessmentGuide + "健康指导、";
                    }
                    if (chrArray[48] == '1' && string.IsNullOrEmpty(AssessmentGuiderow["DangerControl"].ToString()))
                    {
                        strAssessmentGuide = strAssessmentGuide + "危险因素控制、";
                    }
                }
                if (strAssessmentGuide.Length > 2)
                {
                    if (strAssessmentGuide == "健康评价:")
                    {
                        strAssessmentGuide = "";
                    }
                    else
                    {
                        str = str + strAssessmentGuide.Substring(0, strAssessmentGuide.Length - 1) + ",";
                    }
                }
                if (str.Length > 0)
                {
                    str = str.Substring(0, str.Length - 1);
                }

                row["MustChoose"] = str;
            }
        }
Beispiel #15
0
        public FixedDocumentSequence getReport()
        {
            if (!string.IsNullOrEmpty(this.CardID))
            {
                List <ListValue>     list  = new List <ListValue>();
                RecordsBaseInfoModel model = new RecordsBaseInfoBLL().GetModel(this.CardID);

                if (model.PopulationType.Contains("4"))//老年人
                {
                    list.Add(new ListValue
                    {
                        strMark = "@rq1",
                        strVal  = "1"
                    });
                }
                if (model.PopulationType.Contains("6"))//高血压
                {
                    list.Add(new ListValue
                    {
                        strMark = "@rq2",
                        strVal  = "1"
                    });
                }
                if (model.PopulationType.Contains("7"))//糖尿病
                {
                    list.Add(new ListValue
                    {
                        strMark = "@rq3",
                        strVal  = "1"
                    });
                }
                if (!model.PopulationType.Contains("4") && !model.PopulationType.Contains("6") && !model.PopulationType.Contains("7"))
                {
                    list.Add(new ListValue
                    {
                        strMark = "@rq4",
                        strVal  = "1"
                    });
                }
                list.Add(new ListValue
                {
                    strMark = "$name",
                    strVal  = model.CustomerName
                });
                list.Add(new ListValue
                {
                    strMark = "$org",
                    strVal  = model.CreateUnitName
                });
                list.Add(new ListValue
                {
                    strMark = "$Phone",
                    strVal  = ConfigHelper.GetSetNode("phone")
                });
                list.Add(new ListValue
                {
                    strMark = "$town",
                    strVal  = model.TownName.Replace("乡", "").Replace("镇", "").Replace("乡镇", "").Replace("街道", "")
                });
                list.Add(new ListValue
                {
                    strMark = "$village",
                    strVal  = model.VillageName.Replace("村", "").Replace("社区", "")
                });
                RecordsCustomerBaseInfoModel BaseModel = new RecordsCustomerBaseInfoBLL().GetMaxModel(this.CardID);
                if (BaseModel != null)
                {
                    list.Add(new ListValue
                    {
                        strMark = "$conect",
                        strVal  = BaseModel.Doctor
                    });
                }
                return(DrawItems.setPage("printXps\\" + this.PrintName, list));
            }
            return(null);
        }