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); }
public int Add(ChronicStrokeVisitModel model, string Version = "V2.0") { return(this.dal.Add(model, Version)); }
/// <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; } }
public ChronicStrokeVisitModel GetModelFollowUpDate(ChronicStrokeVisitModel model) { return(this.dal.GetModelFollowUpDate(model)); }
public ChronicStrokeVisitModel ExistsCheckDate(ChronicStrokeVisitModel model) { return(this.dal.ExistsCheckDate(model)); }
public int AddServer(ChronicStrokeVisitModel model) { return(this.dal.AddServer(model)); }
public bool UpdateServer(ChronicStrokeVisitModel model) { return(this.dal.UpdateServer(model)); }