コード例 #1
0
        /// <summary>
        /// 新增终端资料库中的脏器资料--外科
        /// </summary>
        /// <param name="model"></param>
        /// <param name="RecordDate"></param>
        /// <returns></returns>
        public void InsertVisceraBySurgical(RecordsPhysicalExamModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"
                            INSERT INTO 
                                ARCHIVE_VISCERAFUNCTION 
                            (
                                PhysicalID
                                ,IDCardNo
                                ,SportFunction
                                ,OutKey
                            )
                            VALUES
                             (
                                @PhysicalID
                                ,@IDCardNo
                                ,@SportFunction
                                ,@OutKey
                             )  ");

            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@SportFunction", model.SportFunction),
                new MySqlParameter("@IDCardNo", model.IDCardNo),
                new MySqlParameter("@OutKey", model.OutKey),
                new MySqlParameter("@PhysicalID", model.PhysicalID)
            };

            MySQLHelper.ExecuteSql(builder.ToString(), cmdParms);
        }
コード例 #2
0
        /// <summary>
        /// 更新终端资料库中的脏器资料--外科
        /// </summary>
        /// <param name="model"></param>
        /// <param name="RecordDate"></param>
        /// <returns></returns>
        public bool UpdateVisceraBySurgical(RecordsPhysicalExamModel model, string RecordDate)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"
                            UPDATE 
                                ARCHIVE_VISCERAFUNCTION D
                            SET 
                                SportFunction = @SportFunction
                            WHERE 
                                D.OUTKEY=
                                (
                                    SELECT 
                                        M.ID 
                                    FROM
                                        ARCHIVE_CUSTOMERBASEINFO M 
                                    WHERE  
                                        IFNULL(M.IsDel,'')!='Y'
                                        AND M.IDCardNo =@IDCardNo 
                                        AND LEFT(M.CheckDate,4) = @CheckDate 
                                        order by M.CheckDate DESC LIMIT 0,1 
                                );  ");
            if (Convert.ToString(RecordDate).Length > 3)
            {
                RecordDate = RecordDate.Substring(0, 4);
            }
            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@SportFunction", model.SportFunction),
                new MySqlParameter("@IDCardNo", model.IDCardNo),
                new MySqlParameter("@CheckDate", RecordDate)
            };

            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
コード例 #3
0
ファイル: PhysicalForm.cs プロジェクト: NET201X/KangShuoTech
        public PhysicalForm(string idcard) : base(idcard)
        {
            this.PhysicalExam = new RecordsPhysicalExamBLL().GetModel(base.Model.IDCardNo);
            if (this.PhysicalExam == null)
            {
                RecordsPhysicalExamModel recordsPhysicalExamModel = new RecordsPhysicalExamModel
                {
                    IDCardNo = base.Model.IDCardNo
                };
                this.PhysicalExam = recordsPhysicalExamModel;
            }

            this.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, 0, 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);
        }
コード例 #4
0
        /// <summary>
        /// 新增终端资料库中的健康资料--外科
        /// </summary>
        /// <param name="model"></param>
        /// <param name="RecordDate"></param>
        /// <returns></returns>
        public void InsertHealthBySurgical(RecordsPhysicalExamModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"
                            INSERT INTO 
                                ARCHIVE_HEALTHQUESTION 
                            (
                                PhysicalID
                                ,IDCardNo
                                ,ElseDis
                                ,ElseOther
                                ,OutKey
                            )
                            VALUES
                             (
                                @PhysicalID
                                ,@IDCardNo
                                ,@ElseDis
                                ,@ElseOther
                                ,@OutKey
                             )  ");

            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@ElseDis", model.ElseDis),
                new MySqlParameter("@ElseOther", model.ElseOther),
                new MySqlParameter("@IDCardNo", model.IDCardNo),
                new MySqlParameter("@OutKey", model.OutKey),
                new MySqlParameter("@PhysicalID", model.PhysicalID)
            };

            MySQLHelper.ExecuteSql(builder.ToString(), cmdParms);
        }
コード例 #5
0
        /// <summary>
        /// 更新终端资料库中的查体资料--外科
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateBySurgical(RecordsPhysicalExamModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"
                            UPDATE 
                                ARCHIVE_PHYSICALEXAM
                            SET 
                                Skin = @Skin 
                                ,SkinEx = @SkinEx 
                                ,Sclere = @Sclere 
                                ,SclereEx = @SclereEx 
                                ,Lymph = @Lymph 
                                ,LymphEx = @LymphEx 
                                ,PressPain = @PressPain 
                                ,PressPainEx = @PressPainEx 
                                ,EnclosedMass = @EnclosedMass 
                                ,EnclosedMassEx = @EnclosedMassEx 
                                ,Liver = @Liver 
                                ,LiverEx = @LiverEx 
                                ,Spleen = @Spleen 
                                ,SpleenEx = @SpleenEx 
                                ,Voiced = @Voiced 
                                ,VoicedEx = @VoicedEx 
                                ,Edema = @Edema 
                                ,FootBack = @FootBack 
                                ,Other = @Other 
                            WHERE 
                              OutKey=@OutKey  ");

            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@Skin", model.Skin),
                new MySqlParameter("@SkinEx", model.SkinEx),
                new MySqlParameter("@Sclere", model.Sclere),
                new MySqlParameter("@SclereEx", model.SclereEx),
                new MySqlParameter("@Lymph", model.Lymph),
                new MySqlParameter("@LymphEx", model.LymphEx),
                new MySqlParameter("@PressPain", model.PressPain),
                new MySqlParameter("@PressPainEx", model.PressPainEx),
                new MySqlParameter("@EnclosedMass", model.EnclosedMass),
                new MySqlParameter("@EnclosedMassEx", model.EnclosedMassEx),
                new MySqlParameter("@Liver", model.Liver),
                new MySqlParameter("@LiverEx", model.LiverEx),
                new MySqlParameter("@Spleen", model.Spleen),
                new MySqlParameter("@SpleenEx", model.SpleenEx),
                new MySqlParameter("@Voiced", model.Voiced),
                new MySqlParameter("@VoicedEx", model.VoicedEx),
                new MySqlParameter("@Edema", model.Edema),
                new MySqlParameter("@FootBack", model.FootBack),
                new MySqlParameter("@Other", model.Other),
                new MySqlParameter("@IDCardNo", model.IDCardNo),
                new MySqlParameter("@OutKey", model.OutKey)
            };

            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
コード例 #6
0
        public List <RecordsPhysicalExamModel> DataTableToList(DataTable dt)
        {
            List <RecordsPhysicalExamModel> list = new List <RecordsPhysicalExamModel>();
            int count = dt.Rows.Count;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    RecordsPhysicalExamModel item = this.dal.DataRowToModel(dt.Rows[i]);
                    if (item != null)
                    {
                        list.Add(item);
                    }
                }
            }
            return(list);
        }
コード例 #7
0
        /// <summary>
        /// 更新终端资料库中的脏器资料--外科
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateVisceraBySurgical(RecordsPhysicalExamModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"
                            UPDATE 
                                ARCHIVE_VISCERAFUNCTION
                            SET 
                                SportFunction = @SportFunction
                            WHERE 
                              OutKey=@OutKey  ");

            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@SportFunction", model.SportFunction),
                new MySqlParameter("@IDCardNo", model.IDCardNo),
                new MySqlParameter("@OutKey", model.OutKey)
            };

            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
コード例 #8
0
        /// <summary>
        /// 更新终端资料库中的健康资料--外科
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateHealthBySurgical(RecordsPhysicalExamModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"
                            UPDATE 
                                ARCHIVE_HEALTHQUESTION
                            SET 
                                ElseDis = @ElseDis
                                ,ElseOther = @ElseOther
                            WHERE 
                              OutKey=@OutKey  ");

            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@ElseDis", model.ElseDis),
                new MySqlParameter("@ElseOther", model.ElseOther),
                new MySqlParameter("@IDCardNo", model.IDCardNo),
                new MySqlParameter("@OutKey", model.OutKey)
            };

            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
コード例 #9
0
        /// <summary>
        /// 更新终端资料库中的健康资料--外科
        /// </summary>
        /// <param name="model"></param>
        /// <param name="RecordDate"></param>
        /// <returns></returns>
        public bool UpdateHealthBySurgical(RecordsPhysicalExamModel model, string RecordDate)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"
                            UPDATE 
                                ARCHIVE_HEALTHQUESTION D
                            SET 
                                ElseDis = @ElseDis
                                ,ElseOther = @ElseOther
                            WHERE 
                                D.OUTKEY=
                                (
                                    SELECT 
                                        M.ID 
                                    FROM
                                        ARCHIVE_CUSTOMERBASEINFO M 
                                    WHERE  
                                        IFNULL(M.IsDel,'')!='Y'
                                        AND M.IDCardNo =@IDCardNo 
                                        AND LEFT(M.CheckDate,4) = @CheckDate 
                                        order by M.CheckDate DESC LIMIT 0,1 
                                );  ");
            if (Convert.ToString(RecordDate).Length > 3)
            {
                RecordDate = RecordDate.Substring(0, 4);
            }
            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@ElseDis", model.ElseDis),
                new MySqlParameter("@ElseOther", model.ElseOther),
                new MySqlParameter("@IDCardNo", model.IDCardNo),
                new MySqlParameter("@CheckDate", RecordDate)
            };

            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
コード例 #10
0
        public int Add(RecordsPhysicalExamModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("INSERT INTO ARCHIVE_PHYSICALEXAM(");
            builder.Append("PhysicalID,IDCardNo,Skin,Sclere,Lymph,BarrelChest,BreathSounds,Rale,HeartRate, ");
            builder.Append("HeartRhythm,Noise,EnclosedMass,Edema,FootBack,Anus,Breast,Vulva,V****a,CervixUteri, ");
            builder.Append("Corpus,Attach,Other,PressPain,Liver,Spleen,Voiced,SkinEx,SclereEx,LymphEx,BreastEx, ");
            builder.Append("AnusEx,BreathSoundsEx,RaleEx,NoiseEx,CervixUteriEx,CorpusEx,AttachEx,VulvaEx, ");
            builder.Append("VaginaEx,PressPainEx,LiverEx,SpleenEx,VoicedEx,EnclosedMassEx,EyeRound,EyeRoundEx,OutKey)");
            builder.Append(" VALUES (");
            builder.Append("@PhysicalID,@IDCardNo,@Skin,@Sclere,@Lymph,@BarrelChest,@BreathSounds,@Rale,@HeartRate, ");
            builder.Append("@HeartRhythm,@Noise,@EnclosedMass,@Edema,@FootBack,@Anus,@Breast,@Vulva,@V****a,@CervixUteri, ");
            builder.Append("@Corpus,@Attach,@Other,@PressPain,@Liver,@Spleen,@Voiced,@SkinEx,@SclereEx,@LymphEx,@BreastEx, ");
            builder.Append("@AnusEx,@BreathSoundsEx,@RaleEx,@NoiseEx,@CervixUteriEx,@CorpusEx,@AttachEx,@VulvaEx, ");
            builder.Append("@VaginaEx,@PressPainEx,@LiverEx,@SpleenEx,@VoicedEx,@EnclosedMassEx,@EyeRound,@EyeRoundEx,@OutKey)");
            builder.Append(";SELECT @@IDENTITY");

            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@PhysicalID", MySqlDbType.String, 100),
                new MySqlParameter("@IDCardNo", MySqlDbType.String, 21),
                new MySqlParameter("@Skin", MySqlDbType.String, 50),
                new MySqlParameter("@Sclere", MySqlDbType.String, 50),
                new MySqlParameter("@Lymph", MySqlDbType.String, 1),
                new MySqlParameter("@BarrelChest", MySqlDbType.String, 1),
                new MySqlParameter("@BreathSounds", MySqlDbType.String, 1),
                new MySqlParameter("@Rale", MySqlDbType.String, 50),
                new MySqlParameter("@HeartRate", MySqlDbType.String, 100),
                new MySqlParameter("@HeartRhythm", MySqlDbType.String, 1),
                new MySqlParameter("@Noise", MySqlDbType.String, 1),
                new MySqlParameter("@EnclosedMass", MySqlDbType.String, 1),
                new MySqlParameter("@Edema", MySqlDbType.String, 1),
                new MySqlParameter("@FootBack", MySqlDbType.String, 1),
                new MySqlParameter("@Anus", MySqlDbType.String, 50),
                new MySqlParameter("@Breast", MySqlDbType.String, 100),
                new MySqlParameter("@Vulva", MySqlDbType.String, 1),
                new MySqlParameter("@V****a", MySqlDbType.String, 1),
                new MySqlParameter("@CervixUteri", MySqlDbType.String, 1),
                new MySqlParameter("@Corpus", MySqlDbType.String, 1),
                new MySqlParameter("@Attach", MySqlDbType.String, 1),
                new MySqlParameter("@Other", MySqlDbType.String, 100),
                new MySqlParameter("@PressPain", MySqlDbType.String, 1),
                new MySqlParameter("@Liver", MySqlDbType.String, 1),
                new MySqlParameter("@Spleen", MySqlDbType.String, 1),
                new MySqlParameter("@Voiced", MySqlDbType.String, 1),
                new MySqlParameter("@SkinEx", MySqlDbType.String, 100),
                new MySqlParameter("@SclereEx", MySqlDbType.String, 100),
                new MySqlParameter("@LymphEx", MySqlDbType.String, 100),
                new MySqlParameter("@BreastEx", MySqlDbType.String, 100),
                new MySqlParameter("@AnusEx", MySqlDbType.String, 100),
                new MySqlParameter("@BreathSoundsEx", MySqlDbType.String, 100),
                new MySqlParameter("@RaleEx", MySqlDbType.String, 100),
                new MySqlParameter("@NoiseEx", MySqlDbType.String, 100),
                new MySqlParameter("@CervixUteriEx", MySqlDbType.String, 100),
                new MySqlParameter("@CorpusEx", MySqlDbType.String, 100),
                new MySqlParameter("@AttachEx", MySqlDbType.String, 100),
                new MySqlParameter("@VulvaEx", MySqlDbType.String, 100),
                new MySqlParameter("@VaginaEx", MySqlDbType.String, 100),
                new MySqlParameter("@PressPainEx", MySqlDbType.String, 100),
                new MySqlParameter("@LiverEx", MySqlDbType.String, 100),
                new MySqlParameter("@SpleenEx", MySqlDbType.String, 100),
                new MySqlParameter("@VoicedEx", MySqlDbType.String, 100),
                new MySqlParameter("@EnclosedMassEx", MySqlDbType.String, 100),
                new MySqlParameter("@EyeRound", MySqlDbType.String, 1),
                new MySqlParameter("@EyeRoundEx", MySqlDbType.String, 100),
                new MySqlParameter("@OutKey", MySqlDbType.Int32, 11)
            };
            cmdParms[0].Value  = model.PhysicalID;
            cmdParms[1].Value  = model.IDCardNo;
            cmdParms[2].Value  = model.Skin;
            cmdParms[3].Value  = model.Sclere;
            cmdParms[4].Value  = model.Lymph;
            cmdParms[5].Value  = model.BarrelChest;
            cmdParms[6].Value  = model.BreathSounds;
            cmdParms[7].Value  = model.Rale;
            cmdParms[8].Value  = model.HeartRate;
            cmdParms[9].Value  = model.HeartRhythm;
            cmdParms[10].Value = model.Noise;
            cmdParms[11].Value = model.EnclosedMass;
            cmdParms[12].Value = model.Edema;
            cmdParms[13].Value = model.FootBack;
            cmdParms[14].Value = model.Anus;
            cmdParms[15].Value = model.Breast;
            cmdParms[16].Value = model.Vulva;
            cmdParms[17].Value = model.V****a;
            cmdParms[18].Value = model.CervixUteri;
            cmdParms[19].Value = model.Corpus;
            cmdParms[20].Value = model.Attach;
            cmdParms[21].Value = model.Other;
            cmdParms[22].Value = model.PressPain;
            cmdParms[23].Value = model.Liver;
            cmdParms[24].Value = model.Spleen;
            cmdParms[25].Value = model.Voiced;
            cmdParms[26].Value = model.SkinEx;
            cmdParms[27].Value = model.SclereEx;
            cmdParms[28].Value = model.LymphEx;
            cmdParms[29].Value = model.BreastEx;
            cmdParms[30].Value = model.AnusEx;
            cmdParms[31].Value = model.BreathSoundsEx;
            cmdParms[32].Value = model.RaleEx;
            cmdParms[33].Value = model.NoiseEx;
            cmdParms[34].Value = model.CervixUteriEx;
            cmdParms[35].Value = model.CorpusEx;
            cmdParms[36].Value = model.AttachEx;
            cmdParms[37].Value = model.VulvaEx;
            cmdParms[38].Value = model.VaginaEx;
            cmdParms[39].Value = model.PressPainEx;
            cmdParms[40].Value = model.LiverEx;
            cmdParms[41].Value = model.SpleenEx;
            cmdParms[42].Value = model.VoicedEx;
            cmdParms[43].Value = model.EnclosedMassEx;
            cmdParms[44].Value = model.EyeRound;
            cmdParms[45].Value = model.EyeRoundEx;
            cmdParms[46].Value = model.OutKey;
            object single = MySQLHelper.GetSingle(builder.ToString(), cmdParms);

            if (single == null)
            {
                return(0);
            }
            return(Convert.ToInt32(single));
        }
コード例 #11
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;
            }
        }
コード例 #12
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;
            }
        }
コード例 #13
0
 /// <summary>
 /// 更新终端资料库中的健康资料--外科
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool UpdateHealthBySurgical(RecordsPhysicalExamModel model)
 {
     return(dal.UpdateHealthBySurgical(model));
 }
コード例 #14
0
 /// <summary>
 /// 新增终端资料库中的查体资料--内科,外科
 /// </summary>
 /// <param name="model"></param>
 /// <param name="RecordDate"></param>
 /// <returns></returns>
 public void Insert(RecordsPhysicalExamModel model)
 {
     this.dal.Insert(model);
 }
コード例 #15
0
 /// <summary>
 /// 更新终端资料库中的查体资料--内科
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool UpdateByInternalMedicine(RecordsPhysicalExamModel model)
 {
     return(this.dal.UpdateByInternalMedicine(model));
 }
コード例 #16
0
 /// <summary>
 /// 新增终端资料库中的健康资料--外科
 /// </summary>
 /// <param name="model"></param>
 /// <param name="RecordDate"></param>
 /// <returns></returns>
 public void InsertHealthBySurgical(RecordsPhysicalExamModel model)
 {
     dal.InsertHealthBySurgical(model);
 }
コード例 #17
0
        public void SavePhysical(string IDCardNo, DateTime CheckDate, string VersionNo, string barCode = "")
        {
            try
            {
                DataTable dsRequire = new RequireBLL().GetList("TabName = '健康体检' ").Tables[0];
                DataView  dv        = dsRequire.DefaultView;

                // 获取最后一次体检数据
                RecordsCustomerBaseInfoModel customerOldModel = CustomerBaseInfoBLL.GetMaxModel(IDCardNo);
                if (customerOldModel == null)
                {
                    customerOldModel = new RecordsCustomerBaseInfoModel();
                }
                RecordsCustomerBaseInfoModel customerNewModel = new RecordsCustomerBaseInfoModel();

                customerNewModel.IDCardNo       = IDCardNo;
                customerNewModel.CheckDate      = CheckDate;
                customerNewModel.CustomerID     = barCode;
                customerNewModel.Doctor         = ConfigHelper.GetNode("doctorName");
                customerNewModel.CreateBy       = ConfigHelper.GetNodeDec("doctor");
                customerNewModel.CreateDate     = DateTime.Now;
                customerNewModel.LastUpdateBy   = ConfigHelper.GetNodeDec("doctor");
                customerNewModel.LastUpdateDate = DateTime.Now;

                #region 一般状况

                dv.RowFilter = "Comment='一般状况' AND (IsSetValue='是' OR IsSetValue='预设上次体检') AND OptionName='Symptom' ";
                DataTable dt = dv.ToTable();

                // 栏位名遍历默认项配置
                foreach (DataRow item in dt.Rows)
                {
                    if (item["IsSetValue"].ToString() == "是")
                    {
                        customerNewModel.Symptom = item["ItemValue"].ToString();
                    }
                    else
                    {
                        customerNewModel.Symptom = customerOldModel.Symptom;
                        customerNewModel.Other   = customerOldModel.Other;
                    }
                }

                dv.RowFilter = null;
                dv.RowFilter = "Comment='一般状况' AND (IsSetValue='是' OR IsSetValue='预设上次体检') AND OptionName<>'Symptom' ";
                dt           = dv.ToTable();
                RecordsGeneralConditionModel gerneralOldModel = GeneralConditionBLL.GetModelByOutKey(customerOldModel.ID);
                RecordsGeneralConditionModel gerneralNewModel = new RecordsGeneralConditionModel();

                gerneralNewModel = EntityAssignment <RecordsGeneralConditionModel>(gerneralOldModel, gerneralNewModel, dt);

                #endregion

                #region 生活方式

                dv.RowFilter = null;
                dv.RowFilter = "Comment='生活方式' AND (IsSetValue='是' OR IsSetValue='预设上次体检') ";
                dt           = dv.ToTable();
                RecordsLifeStyleModel lifeStyleOldModel = LifeStyleBLL.GetModelByOutKey(customerOldModel.ID);
                RecordsLifeStyleModel lifeStyleNewModel = new RecordsLifeStyleModel();
                if (lifeStyleOldModel == null)
                {
                    lifeStyleOldModel = new RecordsLifeStyleModel();
                }

                lifeStyleNewModel = EntityAssignment <RecordsLifeStyleModel>(lifeStyleOldModel, lifeStyleNewModel, dt);

                #endregion

                #region 查体信息

                dv.RowFilter = null;
                dv.RowFilter = "Comment='查体信息' AND (IsSetValue='是' OR IsSetValue='预设上次体检') ";
                dt           = dv.ToTable();
                RecordsPhysicalExamModel physicalExamOldModel = PhysicalExamBLL.GetModelByOutKey(customerOldModel.ID);
                RecordsPhysicalExamModel physicalExamNewModel = new RecordsPhysicalExamModel();
                if (physicalExamOldModel == null)
                {
                    physicalExamOldModel = new RecordsPhysicalExamModel();
                }

                physicalExamNewModel = EntityAssignment <RecordsPhysicalExamModel>(physicalExamOldModel, physicalExamNewModel, dt);

                #endregion

                #region 辅助检查

                dv.RowFilter = null;
                dv.RowFilter = "Comment='辅助检查' AND (IsSetValue='是' OR IsSetValue='预设上次体检') ";
                dt           = dv.ToTable();
                RecordsAssistCheckModel assistCheckOldModel = AssistCheckBLL.GetModelByOutKey(customerOldModel.ID);
                RecordsAssistCheckModel assistCheckNewModel = new RecordsAssistCheckModel();
                if (assistCheckOldModel == null)
                {
                    assistCheckOldModel = new RecordsAssistCheckModel();
                }

                assistCheckNewModel = EntityAssignment <RecordsAssistCheckModel>(assistCheckOldModel, assistCheckNewModel, dt);

                #endregion

                #region 脏器功能

                dv.RowFilter = null;
                dv.RowFilter = "Comment='脏器功能' AND (IsSetValue='是' OR IsSetValue='预设上次体检') ";
                dt           = dv.ToTable();
                RecordsVisceraFunctionModel visceraOldModel = VisceraFunctionBLL.GetModelByOutKey(customerOldModel.ID);
                RecordsVisceraFunctionModel visceraNewModel = new RecordsVisceraFunctionModel();
                if (visceraOldModel == null)
                {
                    visceraOldModel = new RecordsVisceraFunctionModel();
                }

                visceraNewModel = EntityAssignment <RecordsVisceraFunctionModel>(visceraOldModel, visceraNewModel, dt);

                #endregion

                #region 中医体质

                RecordsMediPhysDistModel mediPhysDistModel = new RecordsMediPhysDistModel();

                #endregion

                #region 健康评价

                RecordsAssessmentGuideModel assessmentGuideModel = new RecordsAssessmentGuideModel();

                #endregion

                #region 健康问题

                dv.RowFilter = null;
                dv.RowFilter = "Comment='健康问题' AND (IsSetValue='是' OR IsSetValue='预设上次体检') ";
                dt           = dv.ToTable();
                RecordsHealthQuestionModel questionOldModel = HealthQuestionBLL.GetModelByOutKey(customerOldModel.ID);
                RecordsHealthQuestionModel questionNewModel = new RecordsHealthQuestionModel();
                if (questionOldModel == null)
                {
                    questionOldModel = new RecordsHealthQuestionModel();
                }

                questionNewModel = EntityAssignment <RecordsHealthQuestionModel>(questionOldModel, questionNewModel, dt);

                #endregion

                #region 住院史、用药情况

                dv.RowFilter = null;
                dv.RowFilter = "Comment='治疗情况' AND (IsSetValue='是' OR IsSetValue='预设上次体检' OR IsSetValue='预设随访用药') ";
                dt           = dv.ToTable();

                // 获取list model对象,用来获取最后一次体检数据的值
                List <RecordsHospitalHistoryModel> hospitalHistoryOld = HospitalHistoryBLL.GetModelList(
                    string.Format("IDCardNo='{0}' AND OutKey={1}", IDCardNo, customerOldModel.ID));
                List <RecordsFamilyBedHistoryModel> familyBedHistoryInfoOld = FamilyBedHistoryBLL.GetModelList(
                    string.Format("IDCardNo='{0}' AND OutKey={1}", IDCardNo, customerOldModel.ID));
                List <RecordsMedicationModel> medicationOld = MedicationBLL.GetModelList(
                    string.Format("IDCardNo='{0}' AND OutKey={1}", IDCardNo, customerOldModel.ID));

                if (hospitalHistoryOld == null)
                {
                    hospitalHistoryOld = new List <RecordsHospitalHistoryModel>();
                }
                if (familyBedHistoryInfoOld == null)
                {
                    familyBedHistoryInfoOld = new List <RecordsFamilyBedHistoryModel>();
                }
                if (medicationOld == null)
                {
                    medicationOld = new List <RecordsMedicationModel>();
                }

                #region 随访用药

                List <RecordsMedicationModel> medicationFollowUp = new List <RecordsMedicationModel>();

                // 高血压随访
                ChronicHypertensionVisitModel HyperModel = new ChronicHypertensionVisitBLL().GetMaxModel(IDCardNo, VersionNo);

                if (HyperModel != null)
                {
                    List <ChronicDrugConditionModel> DrugConditions = new ChronicDrugConditionBLL().GetModelList(
                        string.Format(" IDCardNo='{0}' AND Type='{1}' AND OutKey='{2}' ", IDCardNo, "1", HyperModel.ID));

                    foreach (ChronicDrugConditionModel drugModel in DrugConditions)
                    {
                        RecordsMedicationModel newModel = new RecordsMedicationModel
                        {
                            MedicinalName = drugModel.Name,
                            UseNum        = drugModel.DosAge,
                            IDCardNo      = IDCardNo
                        };

                        medicationFollowUp.Add(newModel);
                    }
                }

                // 糖尿病随访
                ChronicDiadetesVisitModel DiaModel = new ChronicDiadetesVisitBLL().GetMaxModel(IDCardNo);

                if (DiaModel != null)
                {
                    List <ChronicDrugConditionModel> DiaDrugConditions = new ChronicDrugConditionBLL().GetModelList(
                        string.Format(" IDCardNo='{0}' AND Type='{1}' AND OutKey='{2}' ", IDCardNo, "2", DiaModel.ID));

                    foreach (ChronicDrugConditionModel drugModel in DiaDrugConditions)
                    {
                        RecordsMedicationModel newModel = new RecordsMedicationModel
                        {
                            MedicinalName = drugModel.Name,
                            UseNum        = drugModel.DosAge,
                            IDCardNo      = IDCardNo
                        };

                        medicationFollowUp.Add(newModel);
                    }
                }

                #endregion

                // 用于存储需存档的体检数据
                List <RecordsHospitalHistoryModel>  hospitalHistoryNew      = new List <RecordsHospitalHistoryModel>();
                List <RecordsFamilyBedHistoryModel> familyBedHistoryInfoNew = new List <RecordsFamilyBedHistoryModel>();
                List <RecordsMedicationModel>       medicationNew           = new List <RecordsMedicationModel>();

                // 临时存储住院史的默认值
                RecordsHospitalHistoryModel hModel = new RecordsHospitalHistoryModel();

                //通过栏位名,遍历默认项配置
                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(';');

                                if (resList.Length > 4)
                                {
                                    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();
                                }
                                else if (resList.Length == 1)
                                {
                                    hModel.Reason = resList[0].ToString();
                                }

                                hospitalHistoryNew.Add(hModel);
                            }
                        }
                        else
                        {
                            hospitalHistoryNew = hospitalHistoryOld;
                        }
                        break;

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

                    case "用药情况":
                        if (item["IsSetValue"].ToString() == "预设上次体检")
                        {
                            medicationNew = medicationOld;
                        }
                        else if (item["IsSetValue"].ToString() == "预设随访用药")
                        {
                            medicationNew = medicationFollowUp;
                        }
                        break;

                    default:
                        break;
                    }
                }

                #endregion

                #region 预防接种史

                dv.RowFilter = null;
                dv.RowFilter = "Comment='健康评价' AND (IsSetValue='是' OR IsSetValue='预设上次体检') ";
                dt           = dv.ToTable();
                List <RecordsInoculationHistoryModel> inoculationHistoryOld = InoculationHistoryBLL.GetModelList(
                    string.Format("IDCardNo='{0}' AND OutKey={1}", IDCardNo, customerOldModel.ID));
                if (inoculationHistoryOld == null)
                {
                    inoculationHistoryOld = new List <RecordsInoculationHistoryModel>();
                }

                List <RecordsInoculationHistoryModel> inoculationHistoryNew = new List <RecordsInoculationHistoryModel>();

                foreach (DataRow item in dt.Rows)
                {
                    switch (item["ChinName"].ToString())
                    {
                    case "非免疫预防接种史":
                        if (item["IsSetValue"].ToString() == "预设上次体检")
                        {
                            inoculationHistoryNew = inoculationHistoryOld;
                        }
                        break;
                    }
                }

                #endregion

                #region 保存默认值

                // 体检主档保存
                int id = CustomerBaseInfoBLL.Add(customerNewModel);

                if (id > 0)
                {
                    // 一般状况
                    gerneralNewModel.IDCardNo = IDCardNo;
                    gerneralNewModel.OutKey   = id;
                    GeneralConditionBLL.Add(gerneralNewModel, VersionNo);

                    // 生活方式
                    lifeStyleNewModel.IDCardNo = IDCardNo;
                    lifeStyleNewModel.OutKey   = id;
                    LifeStyleBLL.Add(lifeStyleNewModel);

                    // 查体信息
                    physicalExamNewModel.IDCardNo = IDCardNo;
                    physicalExamNewModel.OutKey   = id;
                    PhysicalExamBLL.Add(physicalExamNewModel);

                    // 辅助检查
                    assistCheckNewModel.IDCardNo = IDCardNo;
                    assistCheckNewModel.OutKey   = id;
                    AssistCheckBLL.Add(assistCheckNewModel);

                    // 脏器功能
                    visceraNewModel.IDCardNo = IDCardNo;
                    visceraNewModel.OutKey   = id;
                    VisceraFunctionBLL.Add(visceraNewModel);

                    // 中医体质
                    mediPhysDistModel.IDCardNo = IDCardNo;
                    mediPhysDistModel.OutKey   = id;
                    MediPhysDistBLL.Add(mediPhysDistModel);

                    // 健康问题
                    questionNewModel.IDCardNo = IDCardNo;
                    questionNewModel.OutKey   = id;
                    HealthQuestionBLL.Add(questionNewModel);

                    // 健康评价
                    assessmentGuideModel.IDCardNo = IDCardNo;
                    assessmentGuideModel.OutKey   = id;
                    AssessmentGuideBLL.Add(assessmentGuideModel);

                    // 住院史
                    if (hospitalHistoryNew.Count > 0)
                    {
                        foreach (RecordsHospitalHistoryModel recordsInoculationHistoryModel in hospitalHistoryNew)
                        {
                            recordsInoculationHistoryModel.OutKey   = id;
                            recordsInoculationHistoryModel.IDCardNo = IDCardNo;
                        }

                        HospitalHistoryBLL.AddList(hospitalHistoryNew);
                    }

                    // 家庭住院史
                    if (familyBedHistoryInfoNew.Count > 0)
                    {
                        foreach (RecordsFamilyBedHistoryModel model in familyBedHistoryInfoNew)
                        {
                            model.OutKey   = id;
                            model.IDCardNo = IDCardNo;
                        }

                        FamilyBedHistoryBLL.AddList(familyBedHistoryInfoNew);
                    }

                    // 用药
                    if (medicationNew.Count > 0)
                    {
                        foreach (RecordsMedicationModel model in medicationNew)
                        {
                            model.OutKey   = id;
                            model.IDCardNo = IDCardNo;
                        }

                        MedicationBLL.AddList(medicationNew);
                    }

                    // 接种史
                    if (inoculationHistoryNew.Count > 0)
                    {
                        foreach (RecordsInoculationHistoryModel model in inoculationHistoryNew)
                        {
                            model.OutKey   = id;
                            model.IDCardNo = IDCardNo;
                        }

                        InoculationHistoryBLL.AddList(inoculationHistoryNew);
                    }
                }

                #endregion
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(ex.ToString());
                throw ex;
            }
        }
コード例 #18
0
        /// <summary>
        /// 更新终端资料库中的查体资料--外科
        /// </summary>
        /// <param name="model"></param>
        /// <param name="RecordDate"></param>
        /// <returns></returns>
        public bool UpdateBySurgical(RecordsPhysicalExamModel model, string RecordDate)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"
                            UPDATE 
                                ARCHIVE_PHYSICALEXAM D
                            SET 
                                Skin = @Skin 
                                ,SkinEx = @SkinEx 
                                ,Sclere = @Sclere 
                                ,SclereEx = @SclereEx 
                                ,Lymph = @Lymph 
                                ,LymphEx = @LymphEx 
                                ,PressPain = @PressPain 
                                ,PressPainEx = @PressPainEx 
                                ,EnclosedMass = @EnclosedMass 
                                ,EnclosedMassEx = @EnclosedMassEx 
                                ,Liver = @Liver 
                                ,LiverEx = @LiverEx 
                                ,Spleen = @Spleen 
                                ,SpleenEx = @SpleenEx 
                                ,Voiced = @Voiced 
                                ,VoicedEx = @VoicedEx 
                                ,Edema = @Edema 
                                ,FootBack = @FootBack 
                                ,Other = @Other 
                            WHERE 
                              D.OUTKEY=
                                (
                                    SELECT 
                                        M.ID 
                                    FROM
                                        ARCHIVE_CUSTOMERBASEINFO M 
                                    WHERE  
                                        IFNULL(M.IsDel,'')!='Y'
                                        AND M.IDCardNo =@IDCardNo 
                                        AND LEFT(M.CheckDate,4) = @CheckDate 
                                        order by M.CheckDate DESC LIMIT 0,1 
                                );  ");
            if (Convert.ToString(RecordDate).Length > 3)
            {
                RecordDate = RecordDate.Substring(0, 4);
            }
            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@Skin", model.Skin),
                new MySqlParameter("@SkinEx", model.SkinEx),
                new MySqlParameter("@Sclere", model.Sclere),
                new MySqlParameter("@SclereEx", model.SclereEx),
                new MySqlParameter("@Lymph", model.Lymph),
                new MySqlParameter("@LymphEx", model.LymphEx),
                new MySqlParameter("@PressPain", model.PressPain),
                new MySqlParameter("@PressPainEx", model.PressPainEx),
                new MySqlParameter("@EnclosedMass", model.EnclosedMass),
                new MySqlParameter("@EnclosedMassEx", model.EnclosedMassEx),
                new MySqlParameter("@Liver", model.Liver),
                new MySqlParameter("@LiverEx", model.LiverEx),
                new MySqlParameter("@Spleen", model.Spleen),
                new MySqlParameter("@SpleenEx", model.SpleenEx),
                new MySqlParameter("@Voiced", model.Voiced),
                new MySqlParameter("@VoicedEx", model.VoicedEx),
                new MySqlParameter("@Edema", model.Edema),
                new MySqlParameter("@FootBack", model.FootBack),
                new MySqlParameter("@Other", model.Other),
                new MySqlParameter("@IDCardNo", model.IDCardNo),
                new MySqlParameter("@CheckDate", RecordDate)
            };

            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
コード例 #19
0
 public int AddServer(RecordsPhysicalExamModel model)
 {
     return(this.dal.AddServer(model));
 }
コード例 #20
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;
        }
コード例 #21
0
        /// <summary>
        /// 更新终端资料库中的查体资料--内科
        /// </summary>
        /// <param name="model"></param>
        /// <param name="RecordDate"></param>
        /// <returns></returns>
        public bool UpdateByInternalMedicine(RecordsPhysicalExamModel model, string RecordDate)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"
                            UPDATE 
                                ARCHIVE_PHYSICALEXAM D
                            SET 
                                EyeRound = @EyeRound 
                                ,EyeRoundEx = @EyeRoundEx 
                                ,BarrelChest = @BarrelChest 
                                ,BreathSounds = @BreathSounds 
                                ,BreathSoundsEx = @BreathSoundsEx 
                                ,Rale = @Rale 
                                ,RaleEx = @RaleEx 
                                ,HeartRhythm = @HeartRhythm 
                                ,Noise = @Noise 
                                ,NoiseEx = @NoiseEx 
                                ,Anus = @Anus 
                                ,AnusEx = @AnusEx 
                                ,Breast = @Breast 
                                ,BreastEx = @BreastEx 
                                ,Vulva = @Vulva 
                                ,VulvaEx = @VulvaEx 
                                ,V****a = @V****a 
                                ,VaginaEx = @VaginaEx 
                                ,CervixUteri = @CervixUteri 
                                ,CervixUteriEx = @CervixUteriEx 
                                ,Corpus = @Corpus 
                                ,CorpusEx = @CorpusEx 
                                ,Attach = @Attach 
                                ,AttachEx = @AttachEx 
                            WHERE 
                                D.OUTKEY=
                                (
                                    SELECT 
                                        M.ID 
                                    FROM
                                        ARCHIVE_CUSTOMERBASEINFO M 
                                    WHERE  
                                        IFNULL(M.IsDel,'')!='Y'
                                        AND M.IDCardNo =@IDCardNo 
                                        AND LEFT(M.CheckDate,4) = @CheckDate 
                                        order by M.CheckDate DESC LIMIT 0,1 
                                );  ");

            if (Convert.ToString(RecordDate).Length > 3)
            {
                RecordDate = RecordDate.Substring(0, 4);
            }

            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@EyeRound", model.EyeRound),
                new MySqlParameter("@EyeRoundEx", model.EyeRoundEx),
                new MySqlParameter("@BarrelChest", model.BarrelChest),
                new MySqlParameter("@BreathSounds", model.BreathSounds),
                new MySqlParameter("@BreathSoundsEx", model.BreathSoundsEx),
                new MySqlParameter("@Rale", model.Rale),
                new MySqlParameter("@RaleEx", model.RaleEx),
                new MySqlParameter("@HeartRhythm", model.HeartRhythm),
                new MySqlParameter("@Noise", model.Noise),
                new MySqlParameter("@NoiseEx", model.NoiseEx),
                new MySqlParameter("@Anus", model.Anus),
                new MySqlParameter("@AnusEx", model.AnusEx),
                new MySqlParameter("@Breast", model.Breast),
                new MySqlParameter("@BreastEx", model.BreastEx),
                new MySqlParameter("@Vulva", model.Vulva),
                new MySqlParameter("@VulvaEx", model.VulvaEx),
                new MySqlParameter("@V****a", model.V****a),
                new MySqlParameter("@VaginaEx", model.VaginaEx),
                new MySqlParameter("@CervixUteri", model.CervixUteri),
                new MySqlParameter("@CervixUteriEx", model.CervixUteriEx),
                new MySqlParameter("@Corpus", model.Corpus),
                new MySqlParameter("@CorpusEx", model.CorpusEx),
                new MySqlParameter("@Attach", model.Attach),
                new MySqlParameter("@AttachEx", model.AttachEx),
                new MySqlParameter("@IDCardNo", model.IDCardNo),
                new MySqlParameter("@CheckDate", RecordDate)
            };

            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
コード例 #22
0
 public bool UpdateByTJMiniPad(RecordsPhysicalExamModel model, string checkDate) //Ìå¼ìÎÊѯͬ²½
 {
     return(this.dal.UpdateByTJMiniPad(model, checkDate));
 }
コード例 #23
0
        /// <summary>
        /// 更新终端资料库中的查体资料--内科
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateByInternalMedicine(RecordsPhysicalExamModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"
                            UPDATE 
                                ARCHIVE_PHYSICALEXAM
                            SET 
                                EyeRound = @EyeRound 
                                ,EyeRoundEx = @EyeRoundEx 
                                ,BarrelChest = @BarrelChest 
                                ,BreathSounds = @BreathSounds 
                                ,BreathSoundsEx = @BreathSoundsEx 
                                ,Rale = @Rale 
                                ,RaleEx = @RaleEx 
                                ,HeartRhythm = @HeartRhythm 
                                ,Noise = @Noise 
                                ,NoiseEx = @NoiseEx 
                                ,Anus = @Anus 
                                ,AnusEx = @AnusEx 
                                ,Breast = @Breast 
                                ,BreastEx = @BreastEx 
                                ,Vulva = @Vulva 
                                ,VulvaEx = @VulvaEx 
                                ,V****a = @V****a 
                                ,VaginaEx = @VaginaEx 
                                ,CervixUteri = @CervixUteri 
                                ,CervixUteriEx = @CervixUteriEx 
                                ,Corpus = @Corpus 
                                ,CorpusEx = @CorpusEx 
                                ,Attach = @Attach 
                                ,AttachEx = @AttachEx 
                            WHERE 
                              OutKey=@OutKey  ");

            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@EyeRound", model.EyeRound),
                new MySqlParameter("@EyeRoundEx", model.EyeRoundEx),
                new MySqlParameter("@BarrelChest", model.BarrelChest),
                new MySqlParameter("@BreathSounds", model.BreathSounds),
                new MySqlParameter("@BreathSoundsEx", model.BreathSoundsEx),
                new MySqlParameter("@Rale", model.Rale),
                new MySqlParameter("@RaleEx", model.RaleEx),
                new MySqlParameter("@HeartRhythm", model.HeartRhythm),
                new MySqlParameter("@Noise", model.Noise),
                new MySqlParameter("@NoiseEx", model.NoiseEx),
                new MySqlParameter("@Anus", model.Anus),
                new MySqlParameter("@AnusEx", model.AnusEx),
                new MySqlParameter("@Breast", model.Breast),
                new MySqlParameter("@BreastEx", model.BreastEx),
                new MySqlParameter("@Vulva", model.Vulva),
                new MySqlParameter("@VulvaEx", model.VulvaEx),
                new MySqlParameter("@V****a", model.V****a),
                new MySqlParameter("@VaginaEx", model.VaginaEx),
                new MySqlParameter("@CervixUteri", model.CervixUteri),
                new MySqlParameter("@CervixUteriEx", model.CervixUteriEx),
                new MySqlParameter("@Corpus", model.Corpus),
                new MySqlParameter("@CorpusEx", model.CorpusEx),
                new MySqlParameter("@Attach", model.Attach),
                new MySqlParameter("@AttachEx", model.AttachEx),
                new MySqlParameter("@IDCardNo", model.IDCardNo),
                new MySqlParameter("@OutKey", model.OutKey)
            };

            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
コード例 #24
0
        /// <summary>
        /// 更新终端资料库中的查体资料--内科,外科
        /// </summary>
        /// <param name="model"></param>
        /// <param name="RecordDate"></param>
        /// <returns></returns>
        public void Insert(RecordsPhysicalExamModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"
                            INSERT INTO
                                ARCHIVE_PHYSICALEXAM
                            (
                                PhysicalID
                                ,IDCardNo
                                ,Skin
                                ,Sclere
                                ,Lymph
                                ,BarrelChest
                                ,BreathSounds
                                ,Rale
                                ,HeartRhythm
                                ,Noise
                                ,EnclosedMass
                                ,Edema
                                ,FootBack
                                ,Anus
                                ,Breast
                                ,Vulva
                                ,V****a
                                ,CervixUteri
                                ,Corpus
                                ,Attach
                                ,Other
                                ,PressPain
                                ,Liver
                                ,Spleen
                                ,Voiced
                                ,SkinEx
                                ,SclereEx
                                ,LymphEx
                                ,BreastEx
                                ,AnusEx
                                ,BreathSoundsEx
                                ,RaleEx
                                ,NoiseEx
                                ,CervixUteriEx
                                ,CorpusEx
                                ,AttachEx
                                ,VulvaEx
                                ,VaginaEx
                                ,PressPainEx
                                ,LiverEx
                                ,SpleenEx
                                ,VoicedEx
                                ,EnclosedMassEx
                                ,EyeRound
                                ,EyeRoundEx
                                ,OutKey
                            )
                            VALUES
                             (
                                @PhysicalID
                                ,@IDCardNo
                                ,@Skin
                                ,@Sclere
                                ,@Lymph
                                ,@BarrelChest
                                ,@BreathSounds
                                ,@Rale
                                ,@HeartRhythm
                                ,@Noise
                                ,@EnclosedMass
                                ,@Edema
                                ,@FootBack
                                ,@Anus
                                ,@Breast
                                ,@Vulva
                                ,@V****a
                                ,@CervixUteri
                                ,@Corpus
                                ,@Attach
                                ,@Other
                                ,@PressPain
                                ,@Liver
                                ,@Spleen
                                ,@Voiced
                                ,@SkinEx
                                ,@SclereEx
                                ,@LymphEx
                                ,@BreastEx
                                ,@AnusEx
                                ,@BreathSoundsEx
                                ,@RaleEx
                                ,@NoiseEx
                                ,@CervixUteriEx
                                ,@CorpusEx
                                ,@AttachEx
                                ,@VulvaEx
                                ,@VaginaEx
                                ,@PressPainEx
                                ,@LiverEx
                                ,@SpleenEx
                                ,@VoicedEx
                                ,@EnclosedMassEx
                                ,@EyeRound
                                ,@EyeRoundEx
                                ,@OutKey
                            ) ");

            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@Skin", model.Skin),
                new MySqlParameter("@Sclere", model.Sclere),
                new MySqlParameter("@Lymph", model.Lymph),
                new MySqlParameter("@BarrelChest", model.BarrelChest),
                new MySqlParameter("@BreathSounds", model.BreathSounds),
                new MySqlParameter("@Rale", model.Rale),
                new MySqlParameter("@HeartRhythm", model.HeartRhythm),
                new MySqlParameter("@Noise", model.Noise),
                new MySqlParameter("@EnclosedMass", model.EnclosedMass),
                new MySqlParameter("@Edema", model.Edema),
                new MySqlParameter("@FootBack", model.FootBack),
                new MySqlParameter("@Anus", model.Anus),
                new MySqlParameter("@Breast", model.Breast),
                new MySqlParameter("@Vulva", model.Vulva),
                new MySqlParameter("@V****a", model.V****a),
                new MySqlParameter("@CervixUteri", model.CervixUteri),
                new MySqlParameter("@Corpus", model.Corpus),
                new MySqlParameter("@Attach", model.Attach),
                new MySqlParameter("@Other", model.Other),
                new MySqlParameter("@PressPain", model.PressPain),
                new MySqlParameter("@Liver", model.Liver),
                new MySqlParameter("@Spleen", model.Spleen),
                new MySqlParameter("@Voiced", model.Voiced),
                new MySqlParameter("@SkinEx", model.SkinEx),
                new MySqlParameter("@SclereEx", model.SclereEx),
                new MySqlParameter("@LymphEx", model.LymphEx),
                new MySqlParameter("@BreastEx", model.BreastEx),
                new MySqlParameter("@AnusEx", model.AnusEx),
                new MySqlParameter("@BreathSoundsEx", model.BreathSoundsEx),
                new MySqlParameter("@RaleEx", model.RaleEx),
                new MySqlParameter("@NoiseEx", model.NoiseEx),
                new MySqlParameter("@CervixUteriEx", model.CervixUteriEx),
                new MySqlParameter("@CorpusEx", model.CorpusEx),
                new MySqlParameter("@AttachEx", model.AttachEx),
                new MySqlParameter("@VulvaEx", model.VulvaEx),
                new MySqlParameter("@VaginaEx", model.VaginaEx),
                new MySqlParameter("@PressPainEx", model.PressPainEx),
                new MySqlParameter("@LiverEx", model.LiverEx),
                new MySqlParameter("@SpleenEx", model.SpleenEx),
                new MySqlParameter("@VoicedEx", model.VoicedEx),
                new MySqlParameter("@EnclosedMassEx", model.EnclosedMassEx),
                new MySqlParameter("@EyeRound", model.EyeRound),
                new MySqlParameter("@EyeRoundEx", model.EyeRoundEx),
                new MySqlParameter("@IDCardNo", model.IDCardNo),
                new MySqlParameter("@OutKey", model.OutKey),
                new MySqlParameter("@PhysicalID", model.PhysicalID)
            };

            MySQLHelper.ExecuteSql(builder.ToString(), cmdParms);
        }
コード例 #25
0
 /// <summary>
 /// 新增终端资料库中的脏器资料--外科
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void InsertVisceraBySurgical(RecordsPhysicalExamModel model)
 {
     dal.InsertVisceraBySurgical(model);
 }
コード例 #26
0
 /// <summary>
 /// 妇科B超更新查体其他
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool UpdateBC(RecordsPhysicalExamModel model)
 {
     return(this.dal.UpdateBC(model));
 }
コード例 #27
0
 /// <summary>
 /// 更新终端资料库中的脏器资料--外科
 /// </summary>
 /// <param name="model"></param>
 /// <param name="RecordDate"></param>
 /// <returns></returns>
 public bool UpdateVisceraBySurgical(RecordsPhysicalExamModel model, string RecordDate)
 {
     return(dal.UpdateVisceraBySurgical(model, RecordDate));
 }