194 lines
8.1 KiB
C#
194 lines
8.1 KiB
C#
|
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();
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 再次保存初筛内容
|
|||
|
/// </summary>
|
|||
|
/// <param name="model"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public MessageModel<bool> 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<bool> { Success = true, Msg = "保存成功" };
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return new MessageModel<bool> { Success = false, Msg = "保存失败" };
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
if (screening.Update(apoplexyHighRiskScreening))
|
|||
|
{
|
|||
|
return new MessageModel<bool> { Success = true, Msg = "保存成功" };
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return new MessageModel<bool> { Success = false, Msg = "保存失败" };
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public T_Service_FirstAid_ApoplexyHighRiskScreeningBaseInfo GetBaseByPatientGuid(string GUID)
|
|||
|
{
|
|||
|
return screening.GetBaseByPatientGuid(GUID);
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 查询初筛表内容
|
|||
|
/// </summary>
|
|||
|
/// <param name="patientGuid"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public T_Service_FirstAid_ApoplexyInitialScreeningModel GetApoplexyInitialScreeningByPatientGuid(string patientGuid)
|
|||
|
{
|
|||
|
return screening.GetApoplexyInitialScreeningByPatientGuid(patientGuid);
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 卒中高危人群列表查询
|
|||
|
/// </summary>
|
|||
|
/// <param name="name">姓名</param>
|
|||
|
/// <param name="idCard">身份证</param>
|
|||
|
/// <param name="highRisk">-1 全部 0不是高危人群 1是高危人群</param>
|
|||
|
/// <param name="gender">-1 全部 0男 1女</param>
|
|||
|
/// <param name="pageIndex"></param>
|
|||
|
/// <param name="pageSize"></param>
|
|||
|
/// <returns></returns>
|
|||
|
|
|||
|
public TableModel<T_Service_FirstAid_ApoplexyHighRiskScreening> 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<T_Service_FirstAid_ApoplexyHighRiskScreening> GetWorkloadStatistics(string startTime, string endTime)
|
|||
|
{
|
|||
|
return screening.GetWorkloadStatistics(startTime, endTime);
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// 修改知情同意书接口
|
|||
|
/// </summary>
|
|||
|
/// <param name="model"></param>
|
|||
|
/// <returns></returns>
|
|||
|
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);
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// PrintDataApoplexyHighRiskScreeningModel 打印卒中筛查表接口 ----新
|
|||
|
/// </summary>
|
|||
|
/// <param name="GUID"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public PrintDataApoplexyHighRiskScreeningModel GetPrintDataByPatientGuid(string PatientGUID)
|
|||
|
{
|
|||
|
return screening.GetPrintDataByPatientGuid(PatientGUID);
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|