Пример #1
0
        public List <ChronicStrokeBaseInfoModel> DataTableToList(DataTable dt)
        {
            List <ChronicStrokeBaseInfoModel> list = new List <ChronicStrokeBaseInfoModel>();
            int count = dt.Rows.Count;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    ChronicStrokeBaseInfoModel item = this.dal.DataRowToModel(dt.Rows[i]);
                    if (item != null)
                    {
                        list.Add(item);
                    }
                }
            }
            return(list);
        }
 public int Add(ChronicStrokeBaseInfoModel model)
 {
     return(this.dal.Add(model));
 }
Пример #3
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;
            }
        }
Пример #4
0
 public bool UpdateServer(ChronicStrokeBaseInfoModel model)
 {
     return(this.dal.UpdateServer(model));
 }