using HL_FristAidPlatform_DataBase; using HL_FristAidPlatform_Help; using HL_FristAidPlatform_IDataBase; using HL_FristAidPlatform_Models; using System; using System.Collections.Generic; namespace HL_FristAidPlatform_Bussiness { public class T_Service_FirstAid_ApoplexyHighRiskScreeningBLL { IT_Service_FirstAid_ApoplexyHighRiskScreening screening = new T_Service_FirstAid_ApoplexyHighRiskScreeningDB(); /// /// 再次保存初筛内容 /// /// /// public MessageModel SaveHighRiskScreen(T_Service_FirstAid_ApoplexyInitialScreeningModel model) { T_Service_FirstAid_ApoplexyHighRiskScreening apoplexyHighRiskScreening = new T_Service_FirstAid_ApoplexyHighRiskScreening(); apoplexyHighRiskScreening = screening.GetApoplexyHighRiskScreeningByPatientGuid(model.PatientGUID); if (apoplexyHighRiskScreening != null) { apoplexyHighRiskScreening.InitialScreenNum = apoplexyHighRiskScreening.InitialScreenNum + 1; } else { if (string.IsNullOrEmpty(model.GUID)) { apoplexyHighRiskScreening.GUID = Guid.NewGuid().ToString(); } else { apoplexyHighRiskScreening.GUID = model.GUID; } apoplexyHighRiskScreening.PatientGUID = model.PatientGUID; apoplexyHighRiskScreening.InitialScreenNum = 1; apoplexyHighRiskScreening.ShareUserID = model.ShareUserID; apoplexyHighRiskScreening.ShareUserName = model.ShareUserName; apoplexyHighRiskScreening.ShareUserDepartment = model.ShareUserDepartment; } if (!string.IsNullOrEmpty(model.CreateTime + "")) { apoplexyHighRiskScreening.CreateTime = Convert.ToDateTime(model.CreateTime.ToString("yyyy-MM-dd HH:mm")); } else { apoplexyHighRiskScreening.CreateTime= Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm")); } apoplexyHighRiskScreening.Hypertension = model.Hypertension; apoplexyHighRiskScreening.BoolFat = model.BoolFat; apoplexyHighRiskScreening.Diabetes = model.Diabetes; apoplexyHighRiskScreening.HeartDisease = model.HeartDisease; apoplexyHighRiskScreening.Smoke = model.Smoke; apoplexyHighRiskScreening.AmountOfExercise = model.AmountOfExercise; apoplexyHighRiskScreening.RelativeHistory = model.RelativeHistory; apoplexyHighRiskScreening.Obese = model.Obese; apoplexyHighRiskScreening.TIA = model.TIA; apoplexyHighRiskScreening.Apoplexy = model.Apoplexy; apoplexyHighRiskScreening.Source = model.Source; apoplexyHighRiskScreening.Category = model.Category; apoplexyHighRiskScreening.Remarks = model.Remarks; //8项危险因素 int count1 = model.Hypertension + model.BoolFat + model.Diabetes + model.HeartDisease + model.Smoke + model.AmountOfExercise + model.RelativeHistory + model.Obese; int count2 = count1 + model.TIA + model.Apoplexy; if (count1 < 3) { apoplexyHighRiskScreening.HighRisk = 0; } if (count2 == 0) { apoplexyHighRiskScreening.HighRisk = 3; } if (model.Hypertension == 1 || model.Diabetes == 1 || model.HeartDisease == 1) { apoplexyHighRiskScreening.HighRisk = 2; } if (count1 >= 3) { apoplexyHighRiskScreening.HighRisk = 1; } if ((model.TIA + model.Apoplexy) > 0) { apoplexyHighRiskScreening.HighRisk = 1; } if (apoplexyHighRiskScreening == null) { if (screening.Add(apoplexyHighRiskScreening)) { return new MessageModel { Success = true, Msg = "保存成功" }; } else { return new MessageModel { Success = false, Msg = "保存失败" }; } } else { if (screening.Update(apoplexyHighRiskScreening)) { return new MessageModel { Success = true, Msg = "保存成功" }; } else { return new MessageModel { Success = false, Msg = "保存失败" }; } } } public T_Service_FirstAid_ApoplexyHighRiskScreeningBaseInfo GetBaseByPatientGuid(string GUID) { return screening.GetBaseByPatientGuid(GUID); } /// /// 查询初筛表内容 /// /// /// public T_Service_FirstAid_ApoplexyInitialScreeningModel GetApoplexyInitialScreeningByPatientGuid(string patientGuid) { return screening.GetApoplexyInitialScreeningByPatientGuid(patientGuid); } /// /// 卒中高危人群列表查询 /// /// 姓名 /// 身份证 /// -1 全部 0不是高危人群 1是高危人群 /// -1 全部 0男 1女 /// /// /// public TableModel GetList(string hospitalGuid, string name, string idCard, int highRisk, int gender, string ShareUserName, string ShareUserDepartment, int pageIndex, int pageSize) { return screening.GetList(hospitalGuid, name, idCard, highRisk, gender, ShareUserName, ShareUserDepartment, pageIndex, pageSize); } public NotificationModel GetByPatientGuid(string patientGuid) { return screening.GetByPatientGuid(patientGuid); } public bool Update(T_Service_FirstAid_ApoplexyHighRiskScreening modle) { return screening.Update(modle); } public TableModel GetWorkloadStatistics(string startTime, string endTime) { return screening.GetWorkloadStatistics(startTime, endTime); } /// /// 修改知情同意书接口 /// /// /// public bool UpdateNotification(NotificationModel model) { T_Service_FirstAid_ApoplexyHighRiskScreening apoplexyHighRiskScreening = new T_Service_FirstAid_ApoplexyHighRiskScreening(); apoplexyHighRiskScreening.PatientGUID=model.PatientGUID; apoplexyHighRiskScreening.ParticipantSignature = model.ParticipantSignature; apoplexyHighRiskScreening.ParticipantSignatureTime = model.ParticipantSignatureTime; apoplexyHighRiskScreening.ProjectStaffSign = model.ProjectStaffSign; apoplexyHighRiskScreening.ProjectStaffSignTime = model.ProjectStaffSignTime; apoplexyHighRiskScreening.InformedConsentImg = model.InformedConsentImg; apoplexyHighRiskScreening.FileAddress = model.FileAddress; return screening.UpdateNotification(apoplexyHighRiskScreening); } /// /// PrintDataApoplexyHighRiskScreeningModel 打印卒中筛查表接口 ----新 /// /// /// public PrintDataApoplexyHighRiskScreeningModel GetPrintDataByPatientGuid(string PatientGUID) { return screening.GetPrintDataByPatientGuid(PatientGUID); } } }