Beispiel #1
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;
            }
        }
Beispiel #2
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;
            }
        }