StableVersion4.3/HL_FristAidPlatform_Bussiness/Service/T_Service_FirstAid_PatientP...

98 lines
3.0 KiB
C#

using HL_FristAidPlatform_DataBase;
using HL_FristAidPlatform_Help;
using HL_FristAidPlatform_IDataBase;
using HL_FristAidPlatform_Models;
namespace HL_FristAidPlatform_Bussiness
{
public class T_Service_FirstAid_PatientPHIBLL
{
IT_Service_FirstAid_PatientPHI service = new T_Service_FirstAid_PatientPHIDB();
/// <summary>
/// 新增PHI评分
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public MessageModel<bool> Add(FirstAid_PatientPHIModel model)
{
T_Service_FirstAid_PatientPHI phi = new T_Service_FirstAid_PatientPHI();
phi.PatientGUID = model.PatientGUID;
phi.SystolicPressureScore = model.SystolicPressureScore;
phi.BreathingScore = model.BreathingScore;
phi.PulseScore = model.PulseScore;
phi.SonsciousScore = model.SonsciousScore;
phi.InjuryScore = model.InjuryScore;
phi.CreateUser = model.CreateUser;
phi.TotalScore =model.TotalScore;
phi.Flag = model.Flag;
if (model.PHILevel <= 0)
{
if (phi.TotalScore <= 3)
{
phi.PHILevel = 1;
}
else if (phi.TotalScore >= 4 && phi.TotalScore <= 6)
{
phi.PHILevel = 2;
}
else if (phi.TotalScore > 6) { phi.PHILevel = 3; }
}
else {
phi.PHILevel = model.PHILevel;
}
if (service.Add(phi))
{
return new MessageModel<bool> { Success = true, Msg = "操作成功" };
}
else
{
return new MessageModel<bool> { Success = true, Msg = "失败" };
}
}
/// <summary>
/// 查看详情
/// </summary>
/// <param name="guid"></param>
/// <returns></returns>
public PatientPHIModel Get(string guid)
{
return service.Get(guid);
}
/// <summary>
/// 查看详情
/// </summary>
/// <param name="guid"></param>
/// <returns></returns>
public PatientPHIModel GetPHIByPatientGuid(string patientGuid,int flag)
{
return service.GetPHIByPatientGuid(patientGuid,flag);
}
/// <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<PatientPHIListModel> GetPatientPHIList(string patientGuid)
{
return service.GetPatientPHIList(patientGuid);
}
}
}