Exemplo n.º 1
0
        public DiaParentForm(string idcard)
            : base(idcard)
        {
            RecordBaseInfo = new RecordsBaseInfoBLL().GetModel(this.Model.IDCardNo);


            if (RecordBaseInfo == null)
            {
                RecordBaseInfo = new RecordsBaseInfoModel {
                    IDCardNo = this.Model.IDCardNo
                };
            }

            lklbRequired = new LinkLabel();

            this.lklbRequired.BackColor  = Color.Transparent;
            this.lklbRequired.ForeColor  = Color.Red;
            this.lklbRequired.Font       = new Font("宋体", 15f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            this.lklbRequired.FlatStyle  = FlatStyle.Flat;
            this.lklbRequired.ImageAlign = ContentAlignment.MiddleRight;
            this.lklbRequired.Location   = new Point(0xd6, 3);
            this.lklbRequired.Padding    = new System.Windows.Forms.Padding(0, 20, 0, 0);
            this.lklbRequired.Name       = "lklbRequired";
            this.lklbRequired.AutoSize   = true;
            this.lklbRequired.TabIndex   = 80;
            this.lklbRequired.Text       = "必填项设置";
            this.lklbRequired.Click     += new EventHandler(this.btnBtx_Click);
            base.flowLayoutPanel1.Controls.Add(this.lklbRequired);
        }
Exemplo n.º 2
0
        public HistoryData(RecordsBaseInfoModel p_Model)
        {
            this.Model = p_Model;
            InitializeComponent();
            this.panel1.Height = SH - 20;

            GetData();
        }
Exemplo n.º 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.Location      = new Point(-this.Width, -this.Height);
            this.ShowInTaskbar = false;
            this.Hide();

            baseInfo = new RecordsBaseInfoBLL().GetModel(idNo);

            ConfigHelper.cfgFileName = Environment.CurrentDirectory + @"\config.xml";

            this.clsTrans           = new ClsTransInfoBP("BLUE");
            ClsTransInfoBP.ReadMode = true;
            this.clsTrans.SendMsg  += new TransMessageHandle(this.clsTrans_SendMsgNt);
            this.clsTrans.InitListener();
        }
Exemplo n.º 4
0
        private void listView1_ItemActivate(object sender, EventArgs e)
        {
            Predicate <RecordsBaseInfoModel> match = null;

            this.FamilyArcID = this.listView1.FocusedItem.SubItems[2].Text;
            if (this.FamilyArcID != "")
            {
                if (match == null)
                {
                    match = c => c.IDCardNo.ToString() == this.FamilyArcID;
                }
                RecordsBaseInfoModel HouseModel = new RecordsBaseInfoModel();
                HouseModel = this.ModelList.Find(match);
                RecordsFamilyInfoModel FamilyModel = new RecordsFamilyInfoBLL().GetModel(HouseModel.IDCardNo);
                if (FamilyModel == null)
                {
                    RecordsFamilyInfoModel archive_family_info = new RecordsFamilyInfoModel
                    {
                        RecordID    = HouseModel.RecordID,
                        IDCardNo    = HouseModel.IDCardNo,
                        ToiletType  = "1",
                        HouseType   = "1",
                        LiveStatus  = "1",
                        CreatedDate = new DateTime?(DateTime.Today)
                    };
                    FamilyModel = archive_family_info;
                    FamilyModel.FamilyRecordID = HouseModel.IDCardNo;
                    FamilyModel.CreatedDate    = new DateTime?(DateTime.Today);
                    FamilyModel.CreateBy       = ConfigHelper.GetNode("doctor");
                    FamilyModel.CreateUnit     = ConfigHelper.GetNode("orgCode");
                    FamilyModel.CustomerName   = HouseModel.CustomerName;
                    //增加户主信息
                    new RecordsFamilyInfoBLL().Add(archive_family_info);

                    RecordsBaseInfoBLL recordsBaseInfoBLL = new RecordsBaseInfoBLL();
                    HouseModel.FamilyIDCardNo = FamilyModel.IDCardNo;
                    HouseModel.HouseID        = FamilyModel.IDCardNo;
                    HouseModel.HouseName      = FamilyModel.CustomerName;
                    HouseModel.HouseRelation  = "1";
                    HouseModel.HouseRealOther = "本人";
                    recordsBaseInfoBLL.Update(HouseModel);
                }
                this.Model.FamilyIDCardNo = FamilyModel.IDCardNo;
                this.Model.HouseID        = FamilyModel.IDCardNo;
                this.Model.HouseName      = FamilyModel.CustomerName;
                base.DialogResult         = DialogResult.OK;
            }
        }
Exemplo n.º 5
0
        private void mtbIdCard_Leave(object sender, EventArgs e)
        {
            //if (!CheckIDCard(mtbIdCard.Text.Trim()))
            //{
            //    MessageBox.Show("身份证格式不正确,请重新输入!");
            //    mtbIdCard.Focus();
            //    return;
            //}

            if (this.mtbIdCard.MaskCompleted)
            {
                DateTime time;
                this.mtbIdCard.Text = this.mtbIdCard.Text;
                // string str = this.mtbIdCard.Text.Substring(6, 8);

                //if (this.rd15.Checked)
                //{
                //    string str2 = this.mtbIdCard.Text.Substring(6, 6);
                //    int num = DateTime.Now.Year - 0x7d0;
                //    str = (int.Parse(str2.Substring(0, 2)) <= num) ? ("20" + str2) : ("19" + str2);
                //}
                //if (this.rd18.Checked)
                //{
                //    str = this.mtbIdCard.Text.Substring(6, 8);
                //}

                RecordsBaseInfoBLL archive_baseinfo = new RecordsBaseInfoBLL();
                if (!string.IsNullOrEmpty(this.mtbIdCard.Text))
                {
                    RecordsBaseInfoModel model = archive_baseinfo.GetModel(this.mtbIdCard.Text);

                    if (model != null)
                    {
                        this.inputIdCardInfo = model;
                        this.tbName.Text     = this.inputIdCardInfo.CustomerName;
                        this.tbAddress.Text  = this.inputIdCardInfo.HouseHoldAddress;
                        //this.hadFoundIt(true);
                    }
                    else
                    {
                        this.hadFoundIt(false);
                    }
                }
            }
        }
Exemplo n.º 6
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.Location      = new Point(-this.Width, -this.Height);
            this.ShowInTaskbar = false;
            this.Hide();

            baseInfo = new RecordsBaseInfoBLL().GetModel(idNo);

            ConfigHelper.cfgFileName = Environment.CurrentDirectory + @"\config.xml";

            this.clsTrans           = new ClsTransInfoBM("BLUE");
            ClsTransInfoBM.ReadMode = true;
            this.clsTrans.SendMsg  += new TransMessageHandle(this.clsTrans_SendMsgNt);

            string checkT = ConfigurationManager.AppSettings["CType"] == null ? "BM" : ConfigurationManager.AppSettings["CType"].ToString();

            this.clsTrans.InitListener(checkT);
        }
Exemplo n.º 7
0
        public List <RecordsBaseInfoModel> DataTableToList(DataTable dt)
        {
            List <RecordsBaseInfoModel> list = new List <RecordsBaseInfoModel>();
            int count = dt.Rows.Count;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    RecordsBaseInfoModel item = this.dal.DataRowToModel(dt.Rows[i]);
                    if (item != null)
                    {
                        list.Add(item);
                    }
                }
            }
            return(list);
        }
Exemplo n.º 8
0
        private void pbxSearch_Click(object sender, EventArgs e)
        {
            RecordsBaseInfoBLL archive_baseinfo = new RecordsBaseInfoBLL();

            if (!string.IsNullOrEmpty(this.mtbIdCard.Text))
            {
                RecordsBaseInfoModel model = archive_baseinfo.GetModel(this.mtbIdCard.Text);
                if (model != null)
                {
                    int num2;
                    this.inputIdCardInfo = model;
                    this.tbName.Text     = this.inputIdCardInfo.CustomerName;
                    this.tbAddress.Text  = this.inputIdCardInfo.HouseHoldAddress;
                    this.hadFoundIt(true);
                }
                else
                {
                    this.hadFoundIt(false);
                }
            }
        }
Exemplo n.º 9
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.Location      = new Point(-this.Width, -this.Height);
            this.ShowInTaskbar = false;
            this.Hide();

            baseInfo = new RecordsBaseInfoBLL().GetModel(idNo);

            ConfigHelper.cfgFileName = Environment.CurrentDirectory + @"\config.xml";

            //  新尿机
            if (Type.ToUpper().Equals("EMP_NEW"))
            {
                if (comm == null || !this.comm.IsOpen)
                {
                    comm = new SerialPort();

                    comm.PortName = ConfigurationManager.AppSettings["EMPUI"].ToString();
                    comm.BaudRate = 9600;

                    try
                    {
                        this.comm.Open();
                        this.comm.DataReceived += new SerialDataReceivedEventHandler(this.comm_DataReceived);

                        Thread.Sleep(200);
                    }
                    catch (Exception)
                    {
                    }
                }
            }
            else
            {
                this.clsTrans           = new ClsTransInfoUI("BLUE");
                ClsTransInfoUI.ReadMode = true;
                this.clsTrans.SendMsg  += new TransMessageHandle(this.clsTrans_SendMsgNt);
                this.clsTrans.InitListener();
            }
        }
Exemplo n.º 10
0
        private void FrmInputIDCard_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(IDCardNo))
            {
                this.mtbIdCard.Text = IDCardNo;
                RecordsBaseInfoBLL archive_baseinfo = new RecordsBaseInfoBLL();
                if (!string.IsNullOrEmpty(this.mtbIdCard.Text))
                {
                    RecordsBaseInfoModel model = archive_baseinfo.GetModel(this.mtbIdCard.Text);

                    if (model != null)
                    {
                        this.inputIdCardInfo = model;
                        this.tbName.Text     = this.inputIdCardInfo.CustomerName;
                        this.tbAddress.Text  = this.inputIdCardInfo.HouseHoldAddress;
                    }
                    else
                    {
                        this.hadFoundIt(false);
                    }
                }
            }
        }
Exemplo n.º 11
0
        public void ConbinData(RecordsBaseInfoModel BaseModel, string idCardNo, string error)
        {
            if (BaseModel != null)
            {
                DataRow dr2 = this.dtData.NewRow();

                dr2[0] = BaseModel.CustomerName;
                dr2[1] = BaseModel.IDCardNo;
                dr2[2] = error;

                this.dtData.Rows.Add(dr2);
            }
            else
            {
                DataRow dr2 = this.dtData.NewRow();

                dr2[0] = "";
                dr2[1] = idCardNo;
                dr2[2] = "没有基本资料";

                this.dtData.Rows.Add(dr2);
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// 冠心病
        /// </summary>
        /// <param name="IDCardNo"></param>
        /// <param name="CheckDate"></param>
        /// <param name="VersionNo"></param>
        /// <param name="Model"></param>
        public void SaveChd(string IDCardNo, DateTime CheckDate, string VersionNo, RecordsBaseInfoModel Model)
        {
            try
            {
                // 获取最后一次随访数据
                ChronicChdVisitModel chdOldModel = ChdVisitBLL.GetMaxModel(IDCardNo);
                if (chdOldModel == null)
                {
                    chdOldModel = new ChronicChdVisitModel();
                }
                ChronicChdVisitModel chdNewModel = new ChronicChdVisitModel();

                #region 冠心病基本信息

                // 是否有基本信息
                int count = ChdVisitBLL.GetBaseDataCount(IDCardNo);

                if (count < 1)
                {
                    // 新增冠心病基本信息
                    ChronicChdBaseInfoModel baseModel = new ChronicChdBaseInfoModel()
                    {
                        IDCardNo       = IDCardNo,
                        RecordID       = Model.RecordID,
                        CreateBy       = ConfigHelper.GetNodeDec("doctor"),
                        CreateDate     = DateTime.Now,
                        LastUpdateBy   = ConfigHelper.GetNodeDec("doctor"),
                        LastUpdateDate = DateTime.Now
                    };

                    ChdVisitBLL.Add(baseModel, VersionNo);
                }

                #endregion

                #region 随访信息

                chdNewModel = EntityAssignment <ChronicChdVisitModel>(chdOldModel, chdNewModel);

                chdNewModel.IDCardNo       = IDCardNo;
                chdNewModel.RecordID       = Model.RecordID;
                chdNewModel.VisitDate      = CheckDate;
                chdNewModel.NextVisitDate  = CheckDate.AddMonths(3);
                chdNewModel.VisitDoctor    = ConfigHelper.GetNode("doctorName");
                chdNewModel.CreateBy       = ConfigHelper.GetNodeDec("doctor");
                chdNewModel.CreateDate     = DateTime.Now;
                chdNewModel.LastUpDateBy   = ConfigHelper.GetNodeDec("doctor");
                chdNewModel.LastUpDateDate = DateTime.Now;

                #endregion

                #region 保存默认值

                // 随访信息存档
                int id = ChdVisitBLL.Add(chdNewModel, VersionNo);

                #endregion
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(ex.ToString());
                throw ex;
            }
        }
Exemplo n.º 13
0
        public FixedDocumentSequence getReport()
        {
            if (!string.IsNullOrEmpty(this.CardID))
            {
                this.model = new RecordsBaseInfoBLL().GetModel(this.CardID);
                string strsex = "", strage = "";

                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 = "未说明";
                    }
                }
                TimeParser timeParser = new TimeParser();
                strage = timeParser.GetAge(model.Birthday);

                List <ListValue> list = new List <ListValue>
                {
                    new ListValue
                    {
                        strMark = "$archiveid",
                        strVal  = model.RecordID
                    },
                    new ListValue
                    {
                        strMark = "$name",
                        strVal  = model.CustomerName
                    },
                    new ListValue
                    {
                        strMark = "$idcard",
                        strVal  = model.IDCardNo
                    },
                    new ListValue
                    {
                        strMark = "$xb",
                        strVal  = strsex
                    },
                    new ListValue
                    {
                        strMark = "$nl",
                        strVal  = strage
                    }
                };

                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;
                }

                list.Add(new ListValue
                {
                    strMark = "^Unit",
                    strVal  = strUnit
                });

                string strYear   = DateTime.Now.Year.ToString();
                string strPWhere = string.Format("IDCardNo='{0}' and LEFT(CheckDate ,4)='{1}' ORDER BY CheckDate DESC LIMIT 0,1 ", this.CardID, strYear);
                RecordsCustomerBaseInfoModel model2 = new RecordsCustomerBaseInfoDAL().GetModelByWhere(strPWhere);//获取本年度最新一笔
                DataSet AssistDateSet = new DataSet();

                if (model2 != null)
                {
                    list.Add(new ListValue
                    {
                        strMark = "$tjrq",
                        strVal  = DrawItems.strToDate(model2.CheckDate, 1)
                    });

                    AssistDateSet = new RecordsAssistCheckDAL().GetList("OutKey=" + model2.ID);

                    strYear = Convert.ToDateTime(model2.CheckDate).ToString("yyyy");
                }
                else
                {
                    list.Add(new ListValue
                    {
                        strMark = "$tjrq",
                        strVal  = DrawItems.strToDate(DateTime.Now.Date, 1)
                    });
                }

                DataTable dtSH = null;
                if (File.Exists(Application.StartupPath + "\\SHValueRange.xml"))
                {
                    DataSet ds = new DataSet();
                    ds.ReadXml(Application.StartupPath + "\\SHValueRange.xml");
                    dtSH = ds.Tables[0];
                }

                // 血常规数据
                if (AssistDateSet.Tables.Count > 0)
                {
                    string strXuex = "";
                    switch (AssistDateSet.Tables[0].Rows[0]["BloodType"].ToString())
                    {
                    case "1": strXuex = "A型"; break;

                    case "2": strXuex = "B型"; break;

                    case "3": strXuex = "O型"; break;

                    case "4": strXuex = "AB型"; break;

                    default: break;
                    }

                    list.Add(new ListValue
                    {
                        strMark = "$xx",
                        strVal  = strXuex
                    });

                    #region 禹城乙肝五项

                    if (area == "禹城")
                    {
                        list.Add(new ListValue
                        {
                            strMark = "$xmmc" + num.ToString(),
                            strVal  = "乙肝表面抗原"
                        });
                        if (AssistDateSet.Tables[0].Rows[0]["HBSAG"].ToString() == "1")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "-"
                            });
                        }
                        else if (AssistDateSet.Tables[0].Rows[0]["HBSAG"].ToString() == "2")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "+"
                            });
                        }
                        else if (AssistDateSet.Tables[0].Rows[0]["HBSAG"].ToString() == "3")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "+-"
                            });
                        }
                        num++;

                        list.Add(new ListValue
                        {
                            strMark = "$xmmc" + num.ToString(),
                            strVal  = "乙肝表面抗体"
                        });
                        if (AssistDateSet.Tables[0].Rows[0]["HBSAB"].ToString() == "1")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "-"
                            });
                        }
                        else if (AssistDateSet.Tables[0].Rows[0]["HBSAB"].ToString() == "2")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "+"
                            });
                        }
                        else if (AssistDateSet.Tables[0].Rows[0]["HBSAB"].ToString() == "3")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "+-"
                            });
                        }
                        num++;

                        list.Add(new ListValue
                        {
                            strMark = "$xmmc" + num.ToString(),
                            strVal  = "乙肝e抗原"
                        });
                        if (AssistDateSet.Tables[0].Rows[0]["HBEAG"].ToString() == "1")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "-"
                            });
                        }
                        else if (AssistDateSet.Tables[0].Rows[0]["HBEAG"].ToString() == "2")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "+"
                            });
                        }
                        else if (AssistDateSet.Tables[0].Rows[0]["HBEAG"].ToString() == "3")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "+-"
                            });
                        }
                        num++;

                        list.Add(new ListValue
                        {
                            strMark = "$xmmc" + num.ToString(),
                            strVal  = "乙肝e抗体"
                        });
                        if (AssistDateSet.Tables[0].Rows[0]["HBEAB"].ToString() == "1")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "-"
                            });
                        }
                        else if (AssistDateSet.Tables[0].Rows[0]["HBEAB"].ToString() == "2")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "+"
                            });
                        }
                        else if (AssistDateSet.Tables[0].Rows[0]["HBEAB"].ToString() == "3")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "+-"
                            });
                        }
                        num++;

                        list.Add(new ListValue
                        {
                            strMark = "$xmmc" + num.ToString(),
                            strVal  = "乙肝核心抗体"
                        });
                        if (AssistDateSet.Tables[0].Rows[0]["HBCAB"].ToString() == "1")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "-"
                            });
                        }
                        else if (AssistDateSet.Tables[0].Rows[0]["HBCAB"].ToString() == "2")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "+"
                            });
                        }
                        else if (AssistDateSet.Tables[0].Rows[0]["HBCAB"].ToString() == "3")
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcjg" + num.ToString(),
                                strVal  = "+-"
                            });
                        }
                        num++;
                    }

                    #endregion

                    // 生化常规数据
                    if (community.Equals("聊城韩集乡医院"))
                    {
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "TP", true));   //总蛋白
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "GLB", true));  //球蛋白
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "AG", true));   //白球比
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "CB", true));   //直接胆红素
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "IBIL", true)); //间接胆红素
                    }

                    if (area.Equals("禹城"))
                    {
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "FPGL", true));   //空腹血糖
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "TC", true));     //总胆固醇
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "TG", true));     //甘油三脂
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "HeiCho", true)); //高密度脂蛋白
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "LowCho", true)); //低密度脂蛋白
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "TP", true));     //总蛋白
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "GLB", true));    //球蛋白
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "BP", true));     //白蛋白
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "AG", true));     //白球比
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "GOT", true));    //血清谷草氨酸
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "SGPT", true));   //血清谷丙氨酸
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "GT", true));     //谷氨酰氨基转肽酶
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "TBIL", true));   //总胆红素
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "SCR", true));    //血清肌酐
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "BUN", true));    //血尿素氮
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "UA", true));     //尿酸

                        XueStart = 26;
                    }
                    else if (area.Equals("乐陵"))
                    {
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "BP", true)); //白蛋白
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "CB", true)); //结合胆红素
                    }

                    if (!area.Equals("禹城"))
                    {
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "TBIL", true));   //总胆红素
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "GOT", true));    //血清谷草氨酸
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "SGPT", true));   //血清谷丙氨酸
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "TC", true));     //总胆固醇
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "TG", true));     //甘油三脂
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "LowCho", true)); //低密度脂蛋白
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "HeiCho", true)); //高密度脂蛋白
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "SCR", true));    //血清肌酐
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "BUN", true));    //血尿素氮
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "FPGL", true));   //空腹血糖
                    }

                    if (community.Equals("威海美年大健康"))
                    {
                        list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "UA", false));//血清尿酸
                        XueStart = 12;
                    }
                }

                // 血常规
                num = XueStart;

                list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "HB", false));  //血红蛋白
                list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "PLT", false)); //血小板
                list.AddRange(CombinData(AssistDateSet.Tables[0], dtSH, "WBC", false)); //白细胞

                //血液细胞检测报告
                string  strWhere = string.Format("IDCardNo='{0}' AND LEFT(TestTime ,4)='{1}' ORDER BY TestTime DESC,ID DESC LIMIT 0,1 ", this.CardID, strYear);
                DataSet BlooDt   = new RecordsxqDAL().GetDT(strWhere);

                if (BlooDt.Tables.Count > 0)
                {
                    //血液细胞数据
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "NEU_B", false));   //中性粒细胞百分比
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "LYMPH_B", false)); //淋巴细胞百分比
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "MON_B", false));   //单核细胞百分比
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "EOS_B", false));   //嗜酸性粒细胞百分比
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "BAS_B", false));   //嗜碱性粒细胞百分比
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "NEU_N", false));   //中性粒细胞数目
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "LYMPH_N", false)); //淋巴细胞数目
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "MON_N", false));   //单核细胞数目
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "EOS_N", false));   //嗜酸性粒细胞数目
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "BAS_N", false));   //嗜碱性粒细胞数目
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "RBC", false));     //红细胞数目
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "HCT", false));     //红细胞压积
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "MCV", false));     //平均红细胞体积
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "MCH", false));     //平均红细胞血红蛋白含量
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "MCHC", false));    //平均红细胞血红蛋白浓度
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "RDW_CV", false));  //红细胞分布宽度变异系数
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "RDW_SD", false));  //红细胞分布宽度标准差
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "MPV", false));     //平均血小板体积
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "PDW", false));     //血小板分布宽度
                    list.AddRange(CombinData(BlooDt.Tables[0], dtSH, "PCT", false));     //血小板压积
                }

                //尿液常规
                string  strUWhere = 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(strUWhere);

                if (UrineDt != null && UrineDt.Tables.Count > 0 && UrineDt.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow UrineRow in UrineDt.Tables[0].Rows)
                    {
                        list.Add(new ListValue
                        {
                            strMark = "$bxp",
                            strVal  = UrineRow["VALUE9"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$bxpf",
                            strVal  = UrineRow["VALUE9"].ToString().Contains("+") ? "阳性" : "阴性"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$yxs",
                            strVal  = UrineRow["VALUE8"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$yxsf",
                            strVal  = UrineRow["VALUE8"].ToString().Contains("+") ? "阳性" : "阴性"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$nny",
                            strVal  = UrineRow["VALUE1"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$nnyf",
                            strVal  = UrineRow["VALUE1"].ToString().Contains("+") ? "阳性" : "阴性"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$dbz",
                            strVal  = UrineRow["VALUE6"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$dbzf",
                            strVal  = UrineRow["VALUE6"].ToString().Contains("+") ? "阳性" : "阴性"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$qx",
                            strVal  = UrineRow["VALUE2"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$qxf",
                            strVal  = UrineRow["VALUE2"].ToString().Contains("+") ? "阳性" : "阴性"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$phz",
                            strVal  = UrineRow["VALUE7"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$tt",
                            strVal  = UrineRow["VALUE4"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$ttf",
                            strVal  = UrineRow["VALUE4"].ToString().Contains("+") ? "阳性" : "阴性"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$dhs",
                            strVal  = UrineRow["VALUE3"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$dhsf",
                            strVal  = UrineRow["VALUE3"].ToString().Contains("+") ? "阳性" : "阴性"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$ptt",
                            strVal  = UrineRow["VALUE5"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$pttf",
                            strVal  = UrineRow["VALUE5"].ToString().Contains("+") ? "阳性" : "阴性"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$vss",
                            strVal  = UrineRow["VALUE11"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$vssf",
                            strVal  = UrineRow["VALUE11"].ToString().Contains("+") ? "阳性" : "阴性"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$bz",
                            strVal  = UrineRow["VALUE10"].ToString()
                        });
                        foreach (DataRow dtrow in dtSH.Rows)
                        {
                            if (dtrow["code"].ToString() == "SG")
                            {
                                list.Add(new ListValue
                                {
                                    strMark = "$bzf",
                                    strVal  = dtrow["minvalue"].ToString() + "-" + dtrow["maxvalue"].ToString()
                                });
                            }
                            if (dtrow["code"].ToString() == "PH")
                            {
                                list.Add(new ListValue
                                {
                                    strMark = "$phf",
                                    strVal  = dtrow["minvalue"].ToString() + "-" + dtrow["maxvalue"].ToString()
                                });
                            }
                        }
                    }
                }
                else
                {
                    if (AssistDateSet.Tables.Count > 0)//
                    {
                        list.Add(new ListValue
                        {
                            strMark = "$dbz",
                            strVal  = AssistDateSet.Tables[0].Rows[0]["PRO"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$dbzf",
                            strVal  = AssistDateSet.Tables[0].Rows[0]["PRO"].ToString().Contains("+") ? "阳性" : "阴性"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$ptt",
                            strVal  = AssistDateSet.Tables[0].Rows[0]["GLU"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$pttf",
                            strVal  = AssistDateSet.Tables[0].Rows[0]["GLU"].ToString().Contains("+") ? "阳性" : "阴性"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$tt",
                            strVal  = AssistDateSet.Tables[0].Rows[0]["KET"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$ttf",
                            strVal  = AssistDateSet.Tables[0].Rows[0]["KET"].ToString().Contains("+") ? "阳性" : "阴性"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$qx",
                            strVal  = AssistDateSet.Tables[0].Rows[0]["BLD"].ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$qxf",
                            strVal  = AssistDateSet.Tables[0].Rows[0]["BLD"].ToString().Contains("+") ? "阳性" : "阴性"
                        });
                    }
                }
                list.Add(new ListValue
                {
                    strMark = "&q1",
                    strVal  = SignPath + "_Doctor6.png"
                });
                if (area.Equals("平度") || area.Equals("济南") || area.Equals("禹城"))
                {
                    list.Add(new ListValue
                    {
                        strMark = "&q2",
                        strVal  = SignPath + "_Doctor6.png"
                    });
                    list.Add(new ListValue
                    {
                        strMark = "&q3",
                        strVal  = SignPath + "_Doctor6.png"
                    });
                }
                else if (area.Equals("乐陵") || area.Equals("菏泽") || area.Equals("聊城") || area.Equals("泰安"))
                {
                    list.Add(new ListValue
                    {
                        strMark = "&q2",
                        strVal  = SignPath + "_Doctor6.png"
                    });
                    list.Add(new ListValue
                    {
                        strMark = "&q3",
                        strVal  = SignPath + "_Doctor6.png"
                    });
                    if (File.Exists(SignPath + "_Doctor22.png"))
                    {
                        list.Add(new ListValue
                        {
                            strMark = "&q4",
                            strVal  = SignPath + "_Doctor22.png"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "&q5",
                            strVal  = SignPath + "_Doctor22.png"
                        });
                        list.Add(new ListValue
                        {
                            strMark = "&q6",
                            strVal  = SignPath + "_Doctor22.png"
                        });
                    }
                    else
                    {
                        RecordsSignatureModel signModel = new RecordsSignatureBLL().GetModel("签字维护");
                        if (signModel != null)
                        {
                            list.Add(new ListValue
                            {
                                strMark = "$jcys1",
                                strVal  = signModel.ExamineDoctor
                            });
                            list.Add(new ListValue
                            {
                                strMark = "$jcys2",
                                strVal  = signModel.ExamineDoctor
                            });
                            list.Add(new ListValue
                            {
                                strMark = "$jcys3",
                                strVal  = signModel.ExamineDoctor
                            });
                        }
                    }
                }

                return(DrawItems.setPage("printXps\\" + this.PrintName, list));
            }

            return(null);
        }
Exemplo n.º 14
0
        public static bool TranslateToModel(DeviceInfoModel devInfo, RecordsBaseInfoModel baseinfo)
        {
            bool flag = false;

            devInfo.DeviceName = ClsResult.DeviceFriendName;
            devInfo.DeviceType = GetDeviceType(ClsResult.DeviceName);
            devInfo.FirstName  = ClsResult.DeviceName;
            switch (ClsResult.DeviceName)
            {
            case "QCTBG":
                devInfo.Value1 = ClsResult.DeviceValue.QCTBG.XueTang;
                return(flag);

            case "QCTBH":
                devInfo.Value1 = ClsResult.DeviceValue.QCTBH.ShenGao;
                devInfo.Value2 = ClsResult.DeviceValue.QCTBH.TiZhong;
                devInfo.Value3 = ClsResult.DeviceValue.QCTBH.ZhiShu;
                return(flag);

            case "QCTBP":
                devInfo.Value1 = ClsResult.DeviceValue.QCTBP.GaoYa;
                devInfo.Value2 = ClsResult.DeviceValue.QCTBP.DiYa;
                devInfo.Value3 = ClsResult.DeviceValue.QCTBP.XinLv;
                return(flag);

            case "CHITBP":
                devInfo.Value1 = ClsResult.DeviceValue.CHITBP.GaoYa;
                devInfo.Value2 = ClsResult.DeviceValue.CHITBP.DiYa;
                devInfo.Value3 = ClsResult.DeviceValue.CHITBP.XinLv;
                return(flag);

            case "QCTBT":
                devInfo.Value1 = ClsResult.DeviceValue.QCTBT.XueYang;
                devInfo.Value2 = ClsResult.DeviceValue.QCTBT.MaiLv;
                ClsResult.DeviceValue.QCTBT.XueYang = string.Empty;
                ClsResult.DeviceValue.QCTBT.MaiLv   = string.Empty;
                return(flag);

            case "QCTBPT":
                devInfo.Value1 = ClsResult.DeviceValue.QCTBPT.GaoYa;
                devInfo.Value2 = ClsResult.DeviceValue.QCTBPT.DiYa;
                devInfo.Value3 = ClsResult.DeviceValue.QCTBPT.XinLv;
                devInfo.Value4 = ClsResult.DeviceValue.QCTBPT.XueYang;
                devInfo.Value5 = ClsResult.DeviceValue.QCTBPT.MaiLv;
                return(flag);

            case "QCTBU":
                if (!(ClsResult.DeviceFriendName == "尿液"))
                {
                    if (ClsResult.DeviceFriendName == "血液")
                    {
                        devInfo.DeviceName = ClsResult.DeviceValue.QCTBU.ChildType;
                    }
                    break;
                }
                devInfo.DeviceName  = "尿液";
                devInfo.ChildTypeBu = ClsResult.DeviceValue.QCTBU.ChildType;
                break;

            case "QCTCOMBU":
            case "QCTAKBU":
                if (!(ClsResult.DeviceFriendName == "血生化"))
                {
                    return(flag);
                }
                devInfo.DeviceName = ClsResult.DeviceValue.QCTBU.ChildType;
                if ((ClsResult.m_UnitList != null) && (ClsResult.m_UnitList.Count > 0))
                {
                    foreach (TYPEANDVALUE typeandvalue in ClsResult.m_UnitList)
                    {
                        BUToMOdel(typeandvalue.ChildType, ref devInfo);
                        new DeviceInfoBLL().Add(devInfo);
                    }
                }
                return(true);

            case "QCTBM":
                devInfo.Value1 = ClsResult.DeviceValue.QCTBM.TiZhong;
                return(flag);

            case "QCTTF":
                devInfo.Value1 = ClsResult.DeviceValue.QCTTF.TiWen;
                return(flag);

            case "QCTUI":
            case "EMPUI":
                devInfo.Value1  = ClsResult.DeviceValue.QCTUI.URO_NiaoDanYuan;
                devInfo.Value2  = ClsResult.DeviceValue.QCTUI.BLD_QianXue;
                devInfo.Value3  = ClsResult.DeviceValue.QCTUI.BIL_DanHongSu;
                devInfo.Value4  = ClsResult.DeviceValue.QCTUI.KET_TongTi;
                devInfo.Value5  = ClsResult.DeviceValue.QCTUI.GLU_PuTaoTang;
                devInfo.Value6  = ClsResult.DeviceValue.QCTUI.PRO_DanBaiZhi;
                devInfo.Value7  = ClsResult.DeviceValue.QCTUI.PH;
                devInfo.Value8  = ClsResult.DeviceValue.QCTUI.NIT_XiaoSuanYan;
                devInfo.Value9  = ClsResult.DeviceValue.QCTUI.LEU_BaiXiBao;
                devInfo.Value10 = ClsResult.DeviceValue.QCTUI.SG_BiZhong;
                devInfo.Value11 = ClsResult.DeviceValue.QCTUI.VC;
                return(flag);

            case "QCTHB":
                devInfo.Value1 = ClsResult.DeviceValue.QCTHB.HB;
                devInfo.Value2 = ClsResult.DeviceValue.QCTHB.HTC;
                return(flag);

            case "QCTZQ":
                devInfo.Value1 = ClsResult.DeviceValue.QCTZQ.result;
                return(flag);

            default:
                return(flag);
            }
            BUToMOdel(ClsResult.DeviceValue.QCTBU.ChildType, ref devInfo);
            return(flag);
        }
Exemplo n.º 15
0
 public int Add(RecordsBaseInfoModel model)
 {
     return(this.dal.Add(model));
 }
Exemplo n.º 16
0
 public bool Update(RecordsBaseInfoModel model)
 {
     return(this.dal.Update(model));
 }
Exemplo n.º 17
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;
        }
Exemplo n.º 18
0
        /// <summary>
        /// 高血压
        /// </summary>
        /// <param name="IDCardNo"></param>
        /// <param name="CheckDate"></param>
        /// <param name="VersionNo"></param>
        /// <param name="Model"></param>
        public void SaveHypertension(string IDCardNo, DateTime CheckDate, string VersionNo, RecordsBaseInfoModel Model, RecordsCustomerBaseInfoModel CustomerModel)
        {
            try
            {
                DataView dv = dsRequire.DefaultView;

                // 获取最后一次随访数据
                ChronicHypertensionVisitModel hypertensionOldModel = HypertensionVisitBLL.GetMaxModel(IDCardNo, VersionNo);
                if (hypertensionOldModel == null)
                {
                    hypertensionOldModel = new ChronicHypertensionVisitModel();
                }
                ChronicHypertensionVisitModel hypertensionNewModel = new ChronicHypertensionVisitModel();

                // 取得体检一般情况资料
                RecordsGeneralConditionModel conditionModel = new RecordsGeneralConditionBLL().GetModelByOutKey(CustomerModel.ID);

                // 取得体检生活方式资料
                RecordsLifeStyleModel lifeModel = new RecordsLifeStyleBLL().GetModelByOutKey(CustomerModel.ID);
                if (lifeModel == null)
                {
                    lifeModel = new RecordsLifeStyleModel();
                }

                // 取得体检查体资料
                RecordsPhysicalExamModel physicalModel = new RecordsPhysicalExamBLL().GetModelByOutKey(CustomerModel.ID);
                if (physicalModel == null)
                {
                    physicalModel = new RecordsPhysicalExamModel();
                }

                #region 高血压基本信息

                dv.RowFilter = null;
                dv.RowFilter = "TabName='高血压随访' AND Comment='高血压基本信息' AND (IsSetValue='是' OR IsSetValue='预设上次随访') ";
                DataTable dt = dv.ToTable();

                // 是否有基本信息
                int count = HypertensionVisitBLL.GetDataCount(IDCardNo);

                if (count < 1)
                {
                    // 新增高血压基本信息
                    ChronicHypertensionBaseInfoModel baseModel = new ChronicHypertensionBaseInfoModel()
                    {
                        IDCardNo       = IDCardNo,
                        RecordID       = Model.RecordID,
                        CreatedBy      = ConfigHelper.GetNodeDec("doctor"),
                        CreatedDate    = DateTime.Now,
                        LastUpdateBy   = ConfigHelper.GetNodeDec("doctor"),
                        LastUpdateDate = DateTime.Now
                    };

                    baseModel = EntityAssignment <ChronicHypertensionBaseInfoModel>(baseModel, baseModel, dt);

                    HypertensionVisitBLL.Add(baseModel, VersionNo);
                }

                #endregion

                #region 随访信息

                dv.RowFilter = null;
                dv.RowFilter = "TabName='高血压随访' AND Comment='高血压随访信息' AND (IsSetValue='是' OR IsSetValue='预设上次随访') AND ChinName<>'用药情况' ";
                dt           = dv.ToTable();

                hypertensionNewModel = EntityAssignment <ChronicHypertensionVisitModel>(hypertensionOldModel, hypertensionNewModel, dt);

                hypertensionNewModel.IDCardNo         = IDCardNo;
                hypertensionNewModel.RecordID         = Model.RecordID;
                hypertensionNewModel.CustomerName     = StringPlus.toString(hypertensionNewModel.CustomerName) == "" ? Model.CustomerName : hypertensionNewModel.CustomerName;
                hypertensionNewModel.Hypertension     = conditionModel.LeftHeight;
                hypertensionNewModel.Hypotension      = conditionModel.LeftPre;
                hypertensionNewModel.Weight           = conditionModel.Weight;
                hypertensionNewModel.Height           = conditionModel.Height;
                hypertensionNewModel.BMI              = conditionModel.BMI;
                hypertensionNewModel.HeartRate        = physicalModel.HeartRate;
                hypertensionNewModel.DailySmokeNum    = lifeModel.SmokeDayNum;
                hypertensionNewModel.DailyDrinkNum    = lifeModel.DayDrinkVolume;
                hypertensionNewModel.FollowUpDate     = CheckDate;
                hypertensionNewModel.NextFollowUpDate = CheckDate.AddMonths(3);
                hypertensionNewModel.FollowUpDoctor   = ConfigHelper.GetNode("doctorName");
                hypertensionNewModel.CreatedBy        = ConfigHelper.GetNode("doctor");
                hypertensionNewModel.CreatedDate      = DateTime.Now;
                hypertensionNewModel.LastUpdateBy     = ConfigHelper.GetNode("doctor");
                hypertensionNewModel.LastUpdateDate   = DateTime.Now;

                #endregion

                #region 保存默认值

                if (VersionNo.Contains("3.0"))
                {
                    hypertensionNewModel.FollowUpType = hypertensionNewModel.VisitType;
                    hypertensionNewModel.FollowUpWay  = hypertensionNewModel.VisitWay;
                }

                // 随访信息存档
                int id = HypertensionVisitBLL.Add(hypertensionNewModel, VersionNo);

                #endregion

                // 保存用药
                SaveMedication(IDCardNo, "1", id);
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(ex.ToString());
                throw ex;
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// 肺结核
        /// </summary>
        /// <param name="IDCardNo"></param>
        /// <param name="CheckDate"></param>
        /// <param name="VersionNo"></param>
        /// <param name="Model"></param>
        public void SaveLunger(string IDCardNo, DateTime CheckDate, string VersionNo, RecordsBaseInfoModel Model)
        {
            try
            {
                // 取得第一次随访信息
                ChronicLungerFirstVisitModel lungerFirstOldModel = LungerVisitBLL.GetFirstMaxModel(IDCardNo, VersionNo);
                int outKey = 0;

                if (lungerFirstOldModel == null)
                {
                    // 新增第一次入户随访
                    ChronicLungerFirstVisitModel baseModel = new ChronicLungerFirstVisitModel()
                    {
                        IDCardNo       = IDCardNo,
                        RecordID       = Model.RecordID,
                        CustomerName   = Model.CustomerName,
                        FollowupDate   = CheckDate,
                        VisitDoctor    = ConfigHelper.GetNode("doctorName"),
                        EstimateDoctor = ConfigHelper.GetNode("doctorName"),
                        NextVisitDate  = CheckDate.AddMonths(3),
                        CreatedBy      = ConfigHelper.GetNode("doctor"),
                        CreatedDate    = DateTime.Now,
                        LastUpdateBy   = ConfigHelper.GetNode("doctor"),
                        LastUpdateDate = DateTime.Now,
                    };

                    LungerVisitBLL.Add(baseModel, VersionNo);
                }
                else
                {
                    #region 随访信息

                    // 获取最后一次随访数据
                    ChronicLungerVisitModel lungerVisitOldModel = LungerVisitBLL.GetMaxModel(IDCardNo, VersionNo);

                    ChronicLungerVisitModel lungerVisitNewModel = new ChronicLungerVisitModel();

                    if (lungerVisitOldModel == null)
                    {
                        outKey = lungerFirstOldModel.ID;

                        lungerVisitOldModel = new ChronicLungerVisitModel();
                    }

                    // 肺结核随访信息预设上次随访内容
                    lungerVisitNewModel = EntityAssignment <ChronicLungerVisitModel>(lungerVisitOldModel, lungerVisitNewModel);

                    lungerVisitNewModel.IDCardNo       = IDCardNo;
                    lungerVisitNewModel.RecordID       = Model.RecordID;
                    lungerVisitNewModel.CustomerName   = StringPlus.toString(lungerVisitNewModel.CustomerName) == "" ? Model.CustomerName : lungerVisitNewModel.CustomerName;
                    lungerVisitNewModel.OutKey         = lungerVisitNewModel.OutKey > 0 ? lungerVisitNewModel.OutKey : outKey;
                    lungerVisitNewModel.FollowupDate   = CheckDate;
                    lungerVisitNewModel.VisitDoctor    = ConfigHelper.GetNode("doctorName");
                    lungerVisitNewModel.EstimateDoctor = ConfigHelper.GetNode("doctorName");
                    lungerVisitNewModel.NextVisitDate  = CheckDate.AddMonths(3);
                    lungerVisitNewModel.CreatedBy      = ConfigHelper.GetNode("doctor");
                    lungerVisitNewModel.CreatedDate    = DateTime.Now;
                    lungerVisitNewModel.LastUpdateBy   = ConfigHelper.GetNode("doctor");
                    lungerVisitNewModel.LastUpdateDate = DateTime.Now;

                    if (VersionNo.Contains("3.0"))
                    {
                        lungerVisitNewModel.FollowupWay = lungerVisitNewModel.VisitWay;
                    }

                    LungerVisitBLL.Add(lungerVisitNewModel, VersionNo);

                    #endregion
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(ex.ToString());
                throw ex;
            }
        }
Exemplo n.º 20
0
        /// <summary>
        /// 脑卒中
        /// </summary>
        /// <param name="IDCardNo"></param>
        /// <param name="CheckDate"></param>
        /// <param name="VersionNo"></param>
        /// <param name="Model"></param>
        public void SaveStroke(string IDCardNo, DateTime CheckDate, string VersionNo, RecordsBaseInfoModel Model)
        {
            try
            {
                // 获取最后一次随访数据
                ChronicStrokeVisitModel strokeOldModel = StrokeVisitBLL.GetMaxModel(IDCardNo, VersionNo);
                if (strokeOldModel == null)
                {
                    strokeOldModel = new ChronicStrokeVisitModel();
                }
                ChronicStrokeVisitModel strokeNewModel = new ChronicStrokeVisitModel();

                #region 脑卒中基本信息

                // 是否有基本信息
                int count = StrokeVisitBLL.GetDataCount(IDCardNo);

                if (count < 1)
                {
                    // 新增脑卒中基本信息
                    ChronicStrokeBaseInfoModel baseModel = new ChronicStrokeBaseInfoModel()
                    {
                        IDCardNo       = IDCardNo,
                        RecordID       = Model.RecordID,
                        CreatedBy      = ConfigHelper.GetNodeDec("doctor"),
                        CreatedDate    = DateTime.Now,
                        LastUpdateBy   = ConfigHelper.GetNodeDec("doctor"),
                        LastUpdateDate = DateTime.Now
                    };

                    StrokeVisitBLL.Add(baseModel);
                }

                #endregion

                #region 随访信息

                strokeNewModel = EntityAssignment <ChronicStrokeVisitModel>(strokeOldModel, strokeNewModel);

                strokeNewModel.IDCardNo         = IDCardNo;
                strokeNewModel.RecordID         = Model.RecordID;
                strokeNewModel.FollowupDate     = CheckDate;
                strokeNewModel.NextFollowupDate = CheckDate.AddMonths(3);
                strokeNewModel.FollowUpDoctor   = ConfigHelper.GetNode("doctorName");
                strokeNewModel.CreatedBy        = ConfigHelper.GetNodeDec("doctor");
                strokeNewModel.CreatedDate      = DateTime.Now;
                strokeNewModel.LastUpdateBy     = ConfigHelper.GetNodeDec("doctor");
                strokeNewModel.LastUpdateDate   = DateTime.Now;

                #endregion

                #region 保存默认值

                if (VersionNo.Contains("3.0"))
                {
                    strokeNewModel.FollowupType = strokeNewModel.VisitType;
                    strokeNewModel.FollowupWay  = strokeNewModel.VisitWay;
                }

                // 随访信息存档
                int id = StrokeVisitBLL.Add(strokeNewModel, VersionNo);

                #endregion
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(ex.ToString());
                throw ex;
            }
        }
Exemplo n.º 21
0
        public void SaveFollowUp(string IDCardNo, DateTime CheckDate, string PopulationType, string VersionNo, RecordsBaseInfoModel Model, RecordsCustomerBaseInfoModel CustomerModel)
        {
            try
            {
                dsRequire = new RequireBLL().GetList("TabName LIKE '%随访' ").Tables[0];

                // 4:老年人
                if (PopulationType.Contains("4"))
                {
                    SaveOld(IDCardNo, CheckDate, VersionNo);
                }

                // 5:重精神病
                if (PopulationType.Contains("5"))
                {
                    SaveMental(IDCardNo, CheckDate, VersionNo, Model);
                }

                // 6:高血压
                if (PopulationType.Contains("6"))
                {
                    SaveHypertension(IDCardNo, CheckDate, VersionNo, Model, CustomerModel);
                }

                // 7:糖尿病
                if (PopulationType.Contains("7"))
                {
                    SaveDiadetes(IDCardNo, CheckDate, VersionNo, Model, CustomerModel);
                }

                // 8:冠心病
                if (PopulationType.Contains("8"))
                {
                    SaveChd(IDCardNo, CheckDate, VersionNo, Model);
                }

                // 9:脑卒中
                if (PopulationType.Contains("9"))
                {
                    SaveStroke(IDCardNo, CheckDate, VersionNo, Model);
                }

                // 10:肺结核
                if (PopulationType.Contains("10"))
                {
                    SaveLunger(IDCardNo, CheckDate, VersionNo, Model);
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(ex.ToString());
                throw ex;
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// 糖尿病
        /// </summary>
        /// <param name="IDCardNo"></param>
        /// <param name="CheckDate"></param>
        /// <param name="VersionNo"></param>
        /// <param name="Model"></param>
        public void SaveDiadetes(string IDCardNo, DateTime CheckDate, string VersionNo, RecordsBaseInfoModel Model, RecordsCustomerBaseInfoModel CustomerModel)
        {
            try
            {
                DataView dv = dsRequire.DefaultView;

                // 获取最后一次随访数据
                ChronicDiadetesVisitModel diadetesOldModel = DiadetesVisitBLL.GetMaxModel(IDCardNo);
                if (diadetesOldModel == null)
                {
                    diadetesOldModel = new ChronicDiadetesVisitModel();
                }
                ChronicDiadetesVisitModel diadetesNewModel = new ChronicDiadetesVisitModel();

                // 取得体检一般情况资料
                RecordsGeneralConditionModel conditionModel = new RecordsGeneralConditionBLL().GetModelByOutKey(CustomerModel.ID);

                // 取得体检生活方式资料
                RecordsLifeStyleModel lifeModel = new RecordsLifeStyleBLL().GetModelByOutKey(CustomerModel.ID);
                if (lifeModel == null)
                {
                    lifeModel = new RecordsLifeStyleModel();
                }

                // 取得体检查体资料
                RecordsPhysicalExamModel physicalModel = new RecordsPhysicalExamBLL().GetModelByOutKey(CustomerModel.ID);
                if (physicalModel == null)
                {
                    physicalModel = new RecordsPhysicalExamModel();
                }

                // 取得体检辅助检查资料
                RecordsAssistCheckModel checkModel = new RecordsAssistCheckBLL().GetModelByOutKey(CustomerModel.ID);

                #region 糖尿病基本信息

                dv.RowFilter = null;
                dv.RowFilter = "TabName='糖尿病随访' AND Comment='糖尿病基本信息' AND (IsSetValue='是' OR IsSetValue='预设上次随访') ";
                DataTable dt = dv.ToTable();

                // 是否有基本信息
                int count = DiadetesVisitBLL.GetBaseDataCount(IDCardNo);

                if (count < 1)
                {
                    // 新增糖尿病基本信息
                    ChronicDiabetesBaseInfoModel baseModel = new ChronicDiabetesBaseInfoModel()
                    {
                        IDCardNo       = IDCardNo,
                        RecordID       = Model.RecordID,
                        CreateBy       = ConfigHelper.GetNodeDec("doctor"),
                        CreateDate     = DateTime.Now,
                        LastUpdateBy   = ConfigHelper.GetNodeDec("doctor"),
                        LastUpdateDate = DateTime.Now
                    };

                    baseModel = EntityAssignment <ChronicDiabetesBaseInfoModel>(baseModel, baseModel, dt);

                    DiadetesVisitBLL.Add(baseModel, VersionNo);
                }

                #endregion

                #region 随访信息

                dv.RowFilter = null;
                dv.RowFilter = "TabName='糖尿病随访' AND Comment='糖尿病随访信息' AND (IsSetValue='是' OR IsSetValue='预设上次随访') AND ChinName<>'用药情况'  ";
                dt           = dv.ToTable();

                diadetesNewModel = EntityAssignment <ChronicDiadetesVisitModel>(diadetesOldModel, diadetesNewModel, dt);

                diadetesNewModel.IDCardNo           = IDCardNo;
                diadetesNewModel.RecordID           = Model.RecordID;
                diadetesNewModel.CustomerName       = StringPlus.toString(diadetesNewModel.CustomerName) == "" ? Model.CustomerName : diadetesNewModel.CustomerName;
                diadetesNewModel.Hypertension       = conditionModel.LeftHeight;
                diadetesNewModel.Hypotension        = conditionModel.LeftPre;
                diadetesNewModel.Weight             = conditionModel.Weight;
                diadetesNewModel.Height             = conditionModel.Height;
                diadetesNewModel.BMI                = conditionModel.BMI;
                diadetesNewModel.DorsalisPedispulse = StringPlus.toString(physicalModel.FootBack) != "" ? (int.Parse(physicalModel.FootBack) - 1).ToString() : null;
                diadetesNewModel.DailySmokeNum      = lifeModel.SmokeDayNum;
                diadetesNewModel.DailyDrinkNum      = lifeModel.DayDrinkVolume;
                diadetesNewModel.FPG                = checkModel.FPGL;
                diadetesNewModel.HbAlc              = checkModel.HBALC;
                diadetesNewModel.VisitDate          = CheckDate;
                diadetesNewModel.NextVisitDate      = CheckDate.AddMonths(3);
                diadetesNewModel.VisitDoctor        = ConfigHelper.GetNode("doctorName");
                diadetesNewModel.CreateBy           = ConfigHelper.GetNode("doctor");
                diadetesNewModel.CreateDate         = DateTime.Now;
                diadetesNewModel.LastUpdateBy       = ConfigHelper.GetNode("doctor");
                diadetesNewModel.LastUpdateDate     = DateTime.Now;

                #endregion

                #region 保存默认值

                // 随访信息存档
                int id = DiadetesVisitBLL.Add(diadetesNewModel, VersionNo);

                #endregion

                // 保存用药
                SaveMedication(IDCardNo, "2", id);
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(ex.ToString());
                throw ex;
            }
        }