389 lines
19 KiB
C#
389 lines
19 KiB
C#
using HL_FristAidPlatform_DataBase;
|
|
using HL_FristAidPlatform_Help;
|
|
using HL_FristAidPlatform_IDataBase;
|
|
using HL_FristAidPlatform_Models;
|
|
using System;
|
|
|
|
namespace HL_FristAidPlatform_Bussiness
|
|
{
|
|
public class ApoplexyPatientServiceBLL
|
|
{
|
|
IApoplexyPatientService service = new ApoplexyPatientService();
|
|
IT_Service_Apoplexy_ZYYW zyywService = new T_Service_Apoplexy_ZYYWDB();
|
|
IT_Service_Apoplexy_SHYW shywService = new T_Service_Apoplexy_SHYWDB();
|
|
IT_Service_Patient patientService = new T_Service_PatientDB();
|
|
IT_Service_Apoplexy_JKJY jkjyService = new T_Service_Apoplexy_JKJYDB();
|
|
IT_Service_Apoplexy_TOAST toastService = new T_Service_Apoplexy_TOASTDB();
|
|
IT_Service_Apoplexy_KFZL kfzlService = new T_Service_Apoplexy_KFZLDB();
|
|
IT_Service_Apoplexy_PatientOutcome outcomeService = new T_Service_Apoplexy_PatientOutcomeDB();
|
|
IT_Service_Apoplexy_Prehospital prehospitalService = new T_Service_Apoplexy_PrehospitalDB();
|
|
IT_Service_PatientGrade gradeService = new T_Service_PatientGradeDB();
|
|
IT_Service_Apoplexy_PatientsTimeAxis axisService = new T_Service_Apoplexy_PatientsTimeAxisDB();
|
|
IT_Service_FirstAid_PatientGCS patientGCS = new T_Service_FirstAid_PatientGCSDB();
|
|
|
|
/// <summary>
|
|
/// 更新或新增住院治疗信息
|
|
/// 1.住院治疗
|
|
/// 2.CEA/CAS 术后药物治疗表
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public MessageModel<bool> SaveHospitalization(HospitalizationModel model)
|
|
{
|
|
T_Service_Patient patient = new T_Service_Patient();
|
|
patient = patientService.Get(model.PatientGuid);
|
|
if (patient == null)
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "该患者不存在" };
|
|
}
|
|
else
|
|
{
|
|
if (string.IsNullOrEmpty(patient.acZLType))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "请先确定患者治疗类型及其他相关信息" };
|
|
}
|
|
if (!string.IsNullOrEmpty(patient.acZLType) && patient.acZLType == ";04;")
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "该患者治疗类型为:颅内动脉瘤,不需要填写该信息" };
|
|
}
|
|
|
|
//if (patient.AuditStatus == 2)
|
|
//{
|
|
// return new MessageModel<bool> { Success = false, Msg = "该患者病例审核状态已通过审核,无法修改" };
|
|
//}
|
|
|
|
T_Service_Apoplexy_ZYYW zyyw = new T_Service_Apoplexy_ZYYW();
|
|
T_Service_Apoplexy_SHYW shyw = new T_Service_Apoplexy_SHYW();
|
|
|
|
if (patient.acZLType.Contains("01") || patient.acZLType.Contains("02") || patient.acZLType.Contains("03"))
|
|
{
|
|
if ((patient.acZLType.Contains("01") || patient.acZLType.Contains("02")) && string.IsNullOrEmpty(model.YYXueXiaoBan))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "是否抗血小板治疗参数不能为空" };
|
|
}
|
|
if (model.YYXueXiaoBan == "1" && string.IsNullOrEmpty(model.YYXxbYm))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "抗血小板药物参数不能为空" };
|
|
}
|
|
if (model.YYXueXiaoBan == "1" && string.IsNullOrEmpty(model.YYXxbYm48Gy))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "是否发病48小时内用药参数不能为空" };
|
|
}
|
|
if ((patient.acZLType.Contains("01") || patient.acZLType.Contains("02") || patient.acZLType.Contains("03")) && string.IsNullOrEmpty(model.YYJiangYa))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "是否降压参数不能为空" };
|
|
}
|
|
if (model.YYJiangYa == "1" && string.IsNullOrEmpty(model.YYJyZl))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "降压药物参数不能为空" };
|
|
}
|
|
|
|
|
|
if (model.YYTiaoZhi == "1" && string.IsNullOrEmpty(model.YYTzZl))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "调脂药物参数不能为空" };
|
|
}
|
|
|
|
if (model.YYJiangTang == "1" && string.IsNullOrEmpty(model.YYJtZl))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "降糖药物参数不能为空" };
|
|
}
|
|
|
|
T_Service_Apoplexy_ZYYW zyyw1 = zyywService.GetOfPatientGuid(model.PatientGuid);
|
|
if (zyyw1 != null)
|
|
{
|
|
zyyw.UpdateID = model.CreatorID;
|
|
zyyw.UpdateTime = DateTime.Now;
|
|
zyyw.CreatorID = zyyw1.CreatorID;
|
|
zyyw.GUID = zyyw1.GUID;
|
|
}
|
|
else
|
|
{
|
|
zyyw.CreatorID = model.CreatorID;
|
|
}
|
|
zyyw.PatientGuid = model.PatientGuid;
|
|
zyyw.YYXueXiaoBan = model.YYXueXiaoBan;
|
|
zyyw.YYXxbYm = model.YYXxbYm;
|
|
zyyw.YYXxbYm48Gy = model.YYXxbYm48Gy;
|
|
zyyw.YYKangNing = model.YYKangNing;
|
|
zyyw.YYKnYm = model.YYKnYm;
|
|
zyyw.YYJiangYa = model.YYJiangYa;
|
|
zyyw.YYJyZl = model.YYJyZl;
|
|
zyyw.YYTiaoZhi = model.YYTiaoZhi;
|
|
zyyw.YYTzZl = model.YYTzZl;
|
|
zyyw.YYJiangTang = model.YYJiangTang;
|
|
zyyw.YYJtZl = model.YYJtZl;
|
|
}
|
|
if (patient.acZLType.Contains("05"))
|
|
{
|
|
if (string.IsNullOrEmpty(model.CEAYYXueXiaoBan))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "抗血小板参数不能为空" };
|
|
}
|
|
if (model.CEAYYXueXiaoBan == "1" && string.IsNullOrEmpty(model.CEAYYXxbYm))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "抗血小板药物参数不能为空" };
|
|
}
|
|
if (model.CEAYYXueXiaoBan == "2" && string.IsNullOrEmpty(model.Str1))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "未用药参数不能为空" };
|
|
}
|
|
if (model.CEAYYKangNing == "1" && string.IsNullOrEmpty(model.CEAYYKnYm))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "抗凝药物参数不能为空" };
|
|
}
|
|
if (model.CEAYYJiangYa == "1" && string.IsNullOrEmpty(model.CEAYYJyZl))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "降压药物参数不能为空" };
|
|
}
|
|
if (model.CEATiaoZhi == "1" && string.IsNullOrEmpty(model.CEATzZl))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "调脂药物参数不能为空" };
|
|
}
|
|
if (model.CEAJiangTang == "1" && string.IsNullOrEmpty(model.CEAJtZl))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "降糖药物参数不能为空" };
|
|
}
|
|
T_Service_Apoplexy_SHYW shyw1 = shywService.GetOfPatientGuid(model.PatientGuid);
|
|
if (shyw1 != null)
|
|
{
|
|
shyw.GUID = shyw1.GUID;
|
|
shyw.CreatorID = shyw1.CreatorID;
|
|
shyw.UpdateID = model.CreatorID;
|
|
shyw.UpdateTime = DateTime.Now;
|
|
}
|
|
else
|
|
{
|
|
shyw.CreatorID = model.CreatorID;
|
|
}
|
|
shyw.CEAYYXueXiaoBan = model.CEAYYXueXiaoBan;
|
|
shyw.CEAYYXxbYm = model.CEAYYXxbYm;
|
|
shyw.Str1 = model.Str1;
|
|
shyw.CEAYYKangNing = model.CEAYYKangNing;
|
|
shyw.CEAYYKnYm = model.CEAYYKnYm;
|
|
shyw.CEAYYJiangYa = model.CEAYYJiangYa;
|
|
shyw.CEAYYJyZl = model.CEAYYJyZl;
|
|
shyw.CEATiaoZhi = model.CEATiaoZhi;
|
|
shyw.CEATzZl = model.CEATzZl;
|
|
shyw.CEAJiangTang = model.CEAJiangTang;
|
|
shyw.CEAJtZl = model.CEAJtZl;
|
|
shyw.PatientGuid = model.PatientGuid;
|
|
}
|
|
T_Service_Apoplexy_NutritionalRisk nutritionalRisk = new T_Service_Apoplexy_NutritionalRisk();
|
|
if (!string.IsNullOrEmpty(model.GUID))
|
|
nutritionalRisk.GUID = model.GUID;
|
|
nutritionalRisk.PatientGuid = model.PatientGuid;
|
|
nutritionalRisk.Age = model.Age;
|
|
nutritionalRisk.Disease = model.Disease;
|
|
nutritionalRisk.Nutritional = model.Nutritional;
|
|
if (service.SaveHospitalization(zyyw, shyw, nutritionalRisk))
|
|
{
|
|
return new MessageModel<bool> { Success = true, Msg = "保存成功" };
|
|
}
|
|
else
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "保存失败" };
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 更新或新增患者转归信息
|
|
/// </summary>
|
|
/// <param name="jkjy"></param>
|
|
/// <param name="toast"></param>
|
|
/// <param name="kfzl"></param>
|
|
/// <param name="outcome"></param>
|
|
/// <returns></returns>
|
|
public MessageModel<bool> SaveTurnOver(PatientTurnOverModel model)
|
|
{
|
|
T_Service_Patient patient = new T_Service_Patient();
|
|
patient = patientService.Get(model.PatientGuid);
|
|
if (patient == null)
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "该患者不存在" };
|
|
}
|
|
else
|
|
{
|
|
if (string.IsNullOrEmpty(patient.acZLType))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "请先确定患者治疗类型及其他相关信息" };
|
|
}
|
|
//if (!string.IsNullOrEmpty(patient.acZLType) && patient.acZLType.Contains("98"))
|
|
//{
|
|
// return new MessageModel<bool> { Success = false, Msg = "患者治疗类型为:保守治疗。无需填写该信息" };
|
|
//}
|
|
//if (patient.AuditStatus == 2)
|
|
//{
|
|
// return new MessageModel<bool> { Success = false, Msg = "该患者病例审核状态已通过审核,无法修改" };
|
|
//}
|
|
|
|
//RYQK
|
|
T_Service_Apoplexy_Prehospital prehospital = new T_Service_Apoplexy_Prehospital();
|
|
prehospital = prehospitalService.GetOfPatient(model.PatientGuid);
|
|
T_Service_Apoplexy_PatientOutcome outcome1 = new T_Service_Apoplexy_PatientOutcome();
|
|
outcome1 = outcomeService.GetByPatientGuid(model.PatientGuid);
|
|
patient.EmergencyState = 2;
|
|
patient.Status = 2;
|
|
patient.HospitalizationTime = model.HospitalizationTime;
|
|
|
|
#region 健康教育
|
|
T_Service_Apoplexy_JKJY jkjy = new T_Service_Apoplexy_JKJY();
|
|
T_Service_Apoplexy_JKJY jkjy1 = new T_Service_Apoplexy_JKJY();
|
|
jkjy1 = jkjyService.GetByPatientGuid(model.PatientGuid);
|
|
if (jkjy1 != null)
|
|
{
|
|
jkjy.GUID = jkjy1.GUID;
|
|
}
|
|
jkjy.PatientGuid = model.PatientGuid;
|
|
jkjy.JYEduWays = model.JYEduWays;
|
|
jkjy.JYEduYN = model.JYEduYN;
|
|
#endregion
|
|
#region 康复治疗
|
|
T_Service_Apoplexy_KFZL kfzl = new T_Service_Apoplexy_KFZL();
|
|
T_Service_Apoplexy_KFZL kfzl1 = new T_Service_Apoplexy_KFZL();
|
|
kfzl1 = kfzlService.GetByPatientGuid(model.PatientGuid);
|
|
if (kfzl1 != null)
|
|
{
|
|
kfzl.GUID = kfzl1.GUID;
|
|
}
|
|
kfzl.PatientGuid = model.PatientGuid;
|
|
kfzl.KFPlace = model.KFPlace;
|
|
kfzl.KFWays = model.KFWays;
|
|
kfzl.KFZLYN = model.KFZLYN;
|
|
#endregion
|
|
|
|
T_Service_Apoplexy_PatientOutcome outcome = new T_Service_Apoplexy_PatientOutcome();
|
|
|
|
if (outcome1 != null)
|
|
{
|
|
outcome.GUID = outcome1.GUID;
|
|
}
|
|
outcome.CreateUser = model.CreateUser;
|
|
outcome.PatientGuid = model.PatientGuid;
|
|
T_Service_Apoplexy_PatientsTimeAxis axis = new T_Service_Apoplexy_PatientsTimeAxis();
|
|
|
|
|
|
outcome.CYTime = model.CYTime;
|
|
if (!string.IsNullOrEmpty(patient.acZLType) && string.IsNullOrEmpty(model.CYLyFs))
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "离院方式不能为空" };
|
|
}
|
|
outcome.CYLyFs = model.CYLyFs;
|
|
outcome.CYSwSj = model.CYSwSj;
|
|
|
|
outcome.CYDY = model.CYDY;
|
|
outcome.CYSwYyOther = model.CYSwYyOther;
|
|
outcome.CYSwYy = model.CYSwYy;
|
|
|
|
outcome.CYMRSYesNo = model.CYMRSYesNo;
|
|
|
|
outcome.CYMRS = model.CYMRS;
|
|
outcome.CYNIHSSYesNo = model.CYNIHSSYesNo;
|
|
|
|
outcome.CYNIHSS = model.CYNIHSS;
|
|
string DMLLCType = prehospital.DMLLCType;
|
|
|
|
outcome.ZWMPGCYGCSYN = model.ZWMPGCYGCSYN;
|
|
|
|
outcome.ZWMPGCYGCS = model.ZWMPGCYGCS;
|
|
outcome.Diagnosis = model.Diagnosis;
|
|
outcome.RelatedDiagnosis = model.RelatedDiagnosis;
|
|
outcome.Remark = model.Remark;
|
|
|
|
outcome.HospitalDay = model.HospitalDay;
|
|
outcome.AllInCost = model.AllInCost;
|
|
outcome.MainDiagnosticName = model.MainDiagnosticName;
|
|
outcome.MainDiagnosticCode = model.MainDiagnosticCode;
|
|
outcome.OtherDiagnosticName1 = model.OtherDiagnosticName1;
|
|
outcome.OtherDiagnosticCode1 = model.OtherDiagnosticCode1;
|
|
outcome.OtherDiagnosticName2 = model.OtherDiagnosticName2;
|
|
outcome.OtherDiagnosticCode2 = model.OtherDiagnosticCode2;
|
|
outcome.OtherDiagnosticName3 = model.OtherDiagnosticName3;
|
|
outcome.OtherDiagnosticCode3 = model.OtherDiagnosticCode3;
|
|
outcome.OtherDiagnosticName4 = model.OtherDiagnosticName4;
|
|
outcome.OtherDiagnosticCode4 = model.OtherDiagnosticCode4;
|
|
outcome.OtherDiagnosticName5 = model.OtherDiagnosticName5;
|
|
outcome.OtherDiagnosticCode5 = model.OtherDiagnosticCode5;
|
|
outcome.OtherDiagnosticName6 = model.OtherDiagnosticName6;
|
|
outcome.OtherDiagnosticCode6 = model.OtherDiagnosticCode6;
|
|
outcome.OtherDiagnosticName7 = model.OtherDiagnosticName7;
|
|
outcome.OtherDiagnosticCode7 = model.OtherDiagnosticCode7;
|
|
outcome.OtherDiagnosticName8 = model.OtherDiagnosticName8;
|
|
outcome.OtherDiagnosticCode8 = model.OtherDiagnosticCode8;
|
|
outcome.OtherDiagnosticName9 = model.OtherDiagnosticName9;
|
|
outcome.OtherDiagnosticCode9 = model.OtherDiagnosticCode9;
|
|
outcome.OtherDiagnosticName10 = model.OtherDiagnosticName10;
|
|
outcome.OtherDiagnosticCode10 = model.OtherDiagnosticCode10;
|
|
outcome.OtherDiagnosticName11 = model.OtherDiagnosticName11;
|
|
outcome.OtherDiagnosticCode11 = model.OtherDiagnosticCode11;
|
|
outcome.OtherDiagnosticName12 = model.OtherDiagnosticName12;
|
|
outcome.OtherDiagnosticCode12 = model.OtherDiagnosticCode12;
|
|
outcome.OtherDiagnosticName13 = model.OtherDiagnosticName13;
|
|
outcome.OtherDiagnosticCode13 = model.OtherDiagnosticCode13;
|
|
outcome.OtherDiagnosticName14 = model.OtherDiagnosticName14;
|
|
outcome.OtherDiagnosticCode14 = model.OtherDiagnosticCode14;
|
|
outcome.OtherDiagnosticName15 = model.OtherDiagnosticName15;
|
|
outcome.OtherDiagnosticCode15 = model.OtherDiagnosticCode15;
|
|
outcome.DiagnosisTime = model.DiagnosisTime;
|
|
outcome.TreatmentEffect = model.TreatmentEffect;
|
|
outcome.Comorbidities = model.Comorbidities;
|
|
outcome.DVT = model.DVT;
|
|
outcome.DischargeDepartment = model.DischargeDepartment;
|
|
outcome.DischargeDoctor = model.DischargeDoctor;
|
|
|
|
|
|
T_Service_PatientNIHSS niss = new T_Service_PatientNIHSS();
|
|
if (model.NIHSS != null && model.NIHSS.Flag > 0)
|
|
{
|
|
niss = model.NIHSS;
|
|
niss.PatientGUID = model.PatientGuid;
|
|
if (niss.Flag > 0)
|
|
{
|
|
if (patient.SystemModuleID == 3)//卒中
|
|
{
|
|
int rt = niss.RTopLimbScore == 9 ? 0 : niss.RTopLimbScore;
|
|
int lt = niss.LTopLimbScore == 9 ? 0 : niss.LTopLimbScore;
|
|
int lu = niss.LUpperLimbScore == 9 ? 0 : niss.LUpperLimbScore;
|
|
int ru = niss.RUpperLimbScore == 9 ? 0 : niss.RUpperLimbScore;
|
|
int at = niss.AtaxiaScore == 9 ? 0 : niss.AtaxiaScore;
|
|
int dy = niss.DysarthriaScore == 9 ? 0 : niss.DysarthriaScore;
|
|
niss.TotalScore = niss.QuestionScore + niss.LevelScore + niss.InstructScore + niss.GazeScore + niss.ViewScore + niss.PacioplegiaScore + rt + lt + lu + ru + at + niss.SenseScore + niss.LanguageScore + dy + niss.NeglectScore;
|
|
}
|
|
else
|
|
{
|
|
niss.TotalScore = niss.QuestionScore + niss.LevelScore + niss.InstructScore + niss.GazeScore + niss.ViewScore + niss.PacioplegiaScore + niss.LTopLimbScore + niss.RTopLimbScore + niss.LUpperLimbScore + niss.RUpperLimbScore + niss.AtaxiaScore + niss.SenseScore + niss.LanguageScore + niss.DysarthriaScore + niss.NeglectScore;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
T_Service_PatientGCS gcs = new T_Service_PatientGCS();
|
|
|
|
if (model.GCS != null && model.GCS.Flag > 0)
|
|
{
|
|
gcs = model.GCS;
|
|
gcs.Flag = 2;
|
|
gcs.CreateUser = model.CreateUser;
|
|
gcs.PatientGUID = model.PatientGuid;
|
|
}
|
|
|
|
|
|
if (service.SaveTurnOver(patient, jkjy, kfzl, outcome, niss, gcs))
|
|
{
|
|
return new MessageModel<bool> { Success = true, Msg = "保存成功" };
|
|
}
|
|
else
|
|
{
|
|
return new MessageModel<bool> { Success = false, Msg = "保存失败" };
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|