StableVersion4.3/HL_FristAidPlatform_Bussiness/Service/T_Service_PatientGradeBLL.cs

493 lines
17 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_PatientGradeBLL
{
IT_Service_PatientGrade service = new T_Service_PatientGradeDB();
IT_Service_Patient serviceP = new T_Service_PatientDB();
/// <summary>
/// 查看NIHSS详情
/// </summary>
/// <param name="guid"></param>
/// <returns></returns>
public T_Service_PatientNIHSS GetNIHSS(string guid, int flag)
{
return service.GetNIHSS(guid, flag);
}
/// <summary>
/// 获取NIHSS评分详情
/// </summary>
/// <param name="patientGuid"></param>
/// <param name="flag"></param>
/// <returns></returns>
public PatientNIHSSModel GetNIHSSModel(string patientGuid, int flag)
{
return service.GetNIHSSModel(patientGuid, flag);
}
/// <summary>
/// 修改或更新NIHSS评分
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public MessageModel<bool> SaveNIHSS(T_Service_PatientNIHSS model)
{
T_Service_Patient patient = new T_Service_Patient();
patient = serviceP.Get(model.PatientGUID);
if (patient == null)
{
return new MessageModel<bool> { Success = false, Msg = "该患者不存在" };
}
else
{
//if (patient.SystemModuleID == 3)
//{
int rt = model.RTopLimbScore == 9 ? 0 : model.RTopLimbScore;
int lt = model.LTopLimbScore == 9 ? 0 : model.LTopLimbScore;
int lu = model.LUpperLimbScore == 9 ? 0 : model.LUpperLimbScore;
int ru = model.RUpperLimbScore == 9 ? 0 : model.RUpperLimbScore;
int at = model.AtaxiaScore == 9 ? 0 : model.AtaxiaScore;
int dy = model.DysarthriaScore == 9 ? 0 : model.DysarthriaScore;
model.TotalScore = model.QuestionScore + model.LevelScore + model.InstructScore + model.GazeScore + model.ViewScore + model.PacioplegiaScore + rt + lt + lu + ru + at + model.SenseScore + model.LanguageScore + dy + model.NeglectScore;
//}
//else
//{
// model.TotalScore = model.QuestionScore + model.LevelScore + model.InstructScore + model.GazeScore + model.ViewScore + model.PacioplegiaScore + model.LTopLimbScore + model.RTopLimbScore + model.LUpperLimbScore + model.RUpperLimbScore + model.AtaxiaScore + model.SenseScore + model.LanguageScore + model.DysarthriaScore + model.NeglectScore;
//}
}
if (service.SaveNIHSS(model))
{
return new MessageModel<bool> { Success = true, Msg = "保存成功" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "保存失败" };
}
}
/// <summary>
/// 获取GCS评分详情
/// </summary>
/// <param name="patientGuid"></param>
/// <param name="flag"></param>
/// <returns></returns>
public T_Service_PatientGCS GetGCS(string patientGuid, int flag)
{
return service.GetGCS(patientGuid, flag);
}
// <summary>
/// 获取GCS评分详情
/// </summary>
/// <param name="patientGuid"></param>
/// <param name="flag"></param>
/// <returns></returns>
public PatientGCSModel GetGCSModel(string patientGuid, int flag)
{
return service.GetGCSModel(patientGuid, flag);
}
/// <summary>
/// 修改或更新GCS评分
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public MessageModel<bool> SaveGCS(T_Service_PatientGCS model)
{
T_Service_Patient patient = new T_Service_Patient();
patient = serviceP.Get(model.PatientGUID);
if (patient == null)
{
return new MessageModel<bool> { Success = false, Msg = "该患者不存在" };
}
else
{
if (service.SaveGCS(model))
{
return new MessageModel<bool> { Success = true, Msg = "保存成功" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "保存失败" };
}
}
}
/// <summary>
/// 获取FASFT评分详情
/// </summary>
/// <param name="patientGuid"></param>
/// <param name="flag"></param>
/// <returns></returns>
public T_Service_PatientFASTScore GetFAST(string patientGuid)
{
return service.GetFAST(patientGuid);
}
/// <summary>
/// 获取FAST评分详情
/// </summary>
/// <param name="patientGuid"></param>
/// <param name="flag"></param>
/// <returns></returns>
public PatientFASTModel GetFASTModel(string patientGuid)
{
return service.GetFASTModel(patientGuid);
}
/// <summary>
/// 保存FSAT评分
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public MessageModel<bool> SaveFAST(T_Service_PatientFASTScore model)
{
T_Service_Patient patient = new T_Service_Patient();
patient = serviceP.Get(model.PatientGUID);
if (patient == null)
{
return new MessageModel<bool> { Success = false, Msg = "该患者不存在" };
}
else
{
if (service.SaveFAST(model))
{
return new MessageModel<bool> { Success = true, Msg = "保存成功" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "保存失败" };
}
}
}
/// <summary>
/// 查看所有评分列表
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public TableModel<PatientScoreModel> GetList(string patientGuid)
{
return service.GetList(patientGuid);
}
/// <summary>
/// 查看所有评分列表
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public TableModel<FirstAid_PatientNIHSSListModel> GetPatientNIHSSList(string patientGuid)
{
return service.GetPatientNIHSSList(patientGuid);
}
/// <summary>
/// 卒中患者评分列表
/// </summary>
/// <param name="patientGuid"></param>
/// <param name="str">1 NIHSS 2 GCS 3 mRS 4 waterSwallow</param>
/// <returns></returns>
public List<PatientScoreModel> GetPatientScoreList(string patientGuid, string str)
{
return service.GetPatientScoreList(patientGuid, str);
}
/// <summary>
/// 卒中患者评分列表(诊疗相关评分)
/// </summary>
/// <param name="patientGuid"></param>
/// <param name="str">1 NIHSS 2 GCS 3 mRS 4 waterSwallow</param>
/// <returns></returns>
public List<PatientScoreModel> GetPatientScoreListOfDiagnosis(string patientGuid, string str)
{
return service.GetPatientScoreListOfDiagnosis(patientGuid, str);
}
/// <summary>
/// 卒中患者评分列表(其他评分)
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public List<PatientScoreModel> GetPatientOtherScoreList(string patientGuid)
{
return service.GetPatientOtherScoreList(patientGuid);
}
/// <summary>
/// 洼田饮水试验
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public RYTunYanModel GetRYTunYanModel(string patientGuid)
{
return service.GetRYTunYanModel(patientGuid);
}
/// <summary>
/// 获取MRS评分
/// </summary>
/// <param name="patientGuid"></param>
/// <param name="flag"></param>
/// <returns></returns>
public MRSModel GetMRSModel(string patientGuid, int flag)
{
return service.GetMRSModel(patientGuid, flag);
}
/// <summary>
/// 保存患者ABCD2评分
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public MessageModel<bool> SavePatientABCD2(PatientABCD2Model model)
{
T_Service_PatientABCD2 abcd2 = new T_Service_PatientABCD2();
abcd2.PatientGuid = model.PatientGuid;
abcd2.Age = model.Age;
abcd2.BloodPressure = model.BloodPressure;
abcd2.linicalFeature = model.linicalFeature;
abcd2.Duration = model.Duration;
abcd2.Diabetes = model.Diabetes;
abcd2.TotalScore = model.TotalScore;
abcd2.CreationDate = model.CreationDate;
abcd2.CreatorID = model.CreatorID;
if (service.SavePatientABCD2(abcd2))
{
return new MessageModel<bool> { Success = true, Msg = "评分完成" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "评分失败" };
}
}
/// <summary>
/// 获取患者ABCD2评分
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public T_Service_PatientABCD2 GetPatientABCD2(string patientGuid)
{
return service.GetPatientABCD2(patientGuid);
}
/// <summary>
/// 卒中-保存NIHSS评分具体信息以及对应诊疗表中评分信息
/// </summary>
/// <param name="nihss"></param>
/// <returns></returns>
public MessageModel<bool> SaveNIHSSDetailANDField(T_Service_PatientNIHSS nihss)
{
//int rt = nihss.RTopLimbScore == 9 ? 0 : nihss.RTopLimbScore;
//int lt = nihss.LTopLimbScore == 9 ? 0 : nihss.LTopLimbScore;
//int lu = nihss.LUpperLimbScore == 9 ? 0 : nihss.LUpperLimbScore;
//int ru = nihss.RUpperLimbScore == 9 ? 0 : nihss.RUpperLimbScore;
//int at = nihss.AtaxiaScore == 9 ? 0 : nihss.AtaxiaScore;
//int dy = nihss.DysarthriaScore == 9 ? 0 : nihss.DysarthriaScore;
//nihss.TotalScore = nihss.QuestionScore + nihss.LevelScore + nihss.InstructScore + nihss.GazeScore + nihss.ViewScore + nihss.PacioplegiaScore + rt + lt + lu + ru + at + nihss.SenseScore + nihss.LanguageScore + dy + nihss.NeglectScore;
if (service.SaveNIHSSDetailANDField(nihss))
{
return new MessageModel<bool> { Success = true, Msg = "评分完成" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "评分失败" };
}
}
/// <summary>
/// 卒中-保存GCS评分具体信息以及对应诊疗表中评分信息
/// </summary>
/// <param name="gcs"></param>
/// <returns></returns>
public MessageModel<bool> SaveGCSADNField(T_Service_PatientGCS gcs)
{
if (service.SaveGCSADNField(gcs))
{
return new MessageModel<bool> { Success = true, Msg = "评分完成" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "评分失败" };
}
}
/// <summary>
/// 保存Caprini血栓风险因素评估表
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public MessageModel<bool> SaveCaprini(T_Service_PatientCaprini model)
{
if (service.SaveCaprini(model))
{
return new MessageModel<bool> { Success = true, Msg = "评分完成" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "评分失败" };
}
}
/// <summary>
/// 获取Caprini血栓风险因素评估
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public T_Service_PatientCaprini GetCaprini(string patientGuid)
{
return service.GetCaprini(patientGuid);
}
/// <summary>
/// 保存AIS-APS肺炎风险评分
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public MessageModel<bool> SaveAISAPS(T_Service_Patient_AISAPS model)
{
if (service.SaveAISAPS(model))
{
return new MessageModel<bool> { Success = true, Msg = "评分完成" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "评分失败" };
}
}
/// <summary>
/// 获取AIS-APS肺炎风险评分
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public T_Service_Patient_AISAPS GetAISAPS(string patientGuid)
{
return service.GetAISAPS(patientGuid);
}
/// <summary>
/// 保存GRACE缺血风险评估
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public MessageModel<bool> SaveGRACE(T_Service_Patient_GRACE model)
{
if (service.SaveGRACE(model))
{
return new MessageModel<bool> { Success = true, Msg = "评分完成" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "评分失败" };
}
}
/// <summary>
/// 获取GRACE缺血风险评估
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public T_Service_Patient_GRACE GetGRACE(string patientGuid)
{
return service.GetGRACE(patientGuid);
}
/// <summary>
/// 保存非ST段抬高心肌埂塞的TIMI危险评分
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public MessageModel<bool> SaveUNSTTIMI(T_Service_Patient_UNSTTIMI model)
{
if (service.SaveUNSTTIMI(model))
{
return new MessageModel<bool> { Success = true, Msg = "评分完成" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "评分失败" };
}
}
/// <summary>
/// 获取非ST段抬高心肌埂塞的TIMI危险评分
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public T_Service_Patient_UNSTTIMI GetUNSTTIMI(string patientGuid)
{
return service.GetUNSTTIMI(patientGuid);
}
/// <summary>
/// 保存ST段抬高心肌埂塞的TIMI危险评分
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public MessageModel<bool> SaveSTTIMI(T_Service_Patient_STTIMI model)
{
if (service.SaveSTTIMI(model))
{
return new MessageModel<bool> { Success = true, Msg = "评分完成" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "评分失败" };
}
}
/// <summary>
/// 获取ST段抬高心肌埂塞的TIMI危险评分
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public T_Service_Patient_STTIMI GetSTTIMI(string patientGuid)
{
return service.GetSTTIMI(patientGuid);
}
/// <summary>
/// 胸痛患者评分列表
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public List<PatientScoreModel> GetChestPatientSoreList(string patientGuid)
{
return service.GetChestPatientSoreList(patientGuid);
}
/// <summary>
/// 保存MRS评分
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public MessageModel<bool> SaveMRS(SaveMRSModel model)
{
if (service.SaveMRS(model))
{
return new MessageModel<bool> { Success = true, Msg = "评分完成" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "评分失败" };
}
}
}
}