コード例 #1
0
        public List <ChronicStrokeVisitModel> DataTableToList(DataTable dt)
        {
            List <ChronicStrokeVisitModel> list = new List <ChronicStrokeVisitModel>();
            int count = dt.Rows.Count;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    ChronicStrokeVisitModel item = this.dal.DataRowToModel(dt.Rows[i]);
                    if (item != null)
                    {
                        list.Add(item);
                    }
                }
            }
            return(list);
        }
コード例 #2
0
 public int Add(ChronicStrokeVisitModel model, string Version = "V2.0")
 {
     return(this.dal.Add(model, Version));
 }
コード例 #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 ChronicStrokeVisitModel GetModelFollowUpDate(ChronicStrokeVisitModel model)
 {
     return(this.dal.GetModelFollowUpDate(model));
 }
コード例 #5
0
 public ChronicStrokeVisitModel ExistsCheckDate(ChronicStrokeVisitModel model)
 {
     return(this.dal.ExistsCheckDate(model));
 }
コード例 #6
0
 public int AddServer(ChronicStrokeVisitModel model)
 {
     return(this.dal.AddServer(model));
 }
コード例 #7
0
 public bool UpdateServer(ChronicStrokeVisitModel model)
 {
     return(this.dal.UpdateServer(model));
 }