StableVersion4.3/HL_FristAidPlatform_Bussiness/Service/T_Service_Apoplexy_FirstAid...

141 lines
6.6 KiB
C#

using HL_FristAidPlatform_DataBase;
using HL_FristAidPlatform_Help;
using HL_FristAidPlatform_IDataBase;
using HL_FristAidPlatform_Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HL_FristAidPlatform_Bussiness
{
public class T_Service_Apoplexy_FirstAidMeasuresBLL
{
private IT_Service_Apoplexy_FirstAidMeasures IService = new T_Service_Apoplexy_FirstAidMeasuresDB();
/// <summary>
/// 新增或更新
/// </summary>
public MessageModel<bool> AddOrUpdateFirstAidMeasures(FirstAidMeasuresModel model)
{
T_Service_Apoplexy_EmergencyRoom emergencyRoom = new T_Service_Apoplexy_EmergencyRoom();
T_Service_Apoplexy_EmergencyRoom emergencyRoom1 = IService.GetEmergencyRoomByPatient(model.PatientGuid);
T_Service_Apoplexy_Prehospital prehospital = new T_Service_Apoplexy_Prehospital();
T_Service_Apoplexy_Prehospital pre = IService.GetPrehospitalByPatient(model.PatientGuid);
if (pre != null)
{
prehospital.GUID = pre.GUID;
}
prehospital.PatientGuid = model.PatientGuid;
prehospital.ADoctorImageFiles = model.ADoctorImageFiles;
prehospital.DoctorVisitTime = model.DoctorVisitTime;
if (emergencyRoom1 != null)
{
emergencyRoom.GUID = emergencyRoom1.GUID;
}
emergencyRoom.PatientGuid = model.PatientGuid;
emergencyRoom.BloodCollectionTime = model.BloodCollectionTime;
emergencyRoom.CoagulationRoutineReportTime = model.CoagulationRoutineReportTime;
emergencyRoom.BloodRoutineReportTime = model.BloodRoutineReportTime;
emergencyRoom.ECGExaminationTime = model.ECGExaminationTime;
emergencyRoom.ECGReportTime = model.ECGReportTime;
T_Service_Apoplexy_FirstAidMeasures fir = new T_Service_Apoplexy_FirstAidMeasures();
fir = IService.GetFirstAidMeasures(model.PatientGuid);
T_Service_Apoplexy_FirstAidMeasures first = new T_Service_Apoplexy_FirstAidMeasures();
if (fir == null)
{
if (string.IsNullOrEmpty(model.CreateTime + "") || model.CreateTime == Convert.ToDateTime("0001-01-01 00:00:00") || model.CreateTime == Convert.ToDateTime("1753-01-01 00:00:00"))
{
first.CreateTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
}
else
{
first.CreateTime = model.CreateTime;
}
}
else
{
if (string.IsNullOrEmpty(fir.CreateTime + "" ) || fir.CreateTime == Convert.ToDateTime("0001-01-01 00:00:00")|| fir.CreateTime == Convert.ToDateTime("1753-01-01 00:00:00"))
{
fir.CreateTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
}
first.GUID = fir.GUID;
first.CreateTime = fir.CreateTime;
}
first.UnobstructedAirway = model.UnobstructedAirway;
first.CardiacMassage = model.CardiacMassage;
first.ECGMonitoring = model.ECGMonitoring;
first.OxygenInhalation = model.OxygenInhalation;
first.ElectricMembraneRemoval = model.ElectricMembraneRemoval;
first.RespiratoryAssistance = model.RespiratoryAssistance;
first.TraumaManagement = model.TraumaManagement;
first.FractureManagement = model.FractureManagement;
first.PlannedArrivalHospitalExam = model.PlannedArrivalHospitalExam;
first.Position = model.Position;
first.Others = model.Others;
first.OnSiteAndEnRouteMedicationSituation = model.OnSiteAndEnRouteMedicationSituation;
first.PatientGuid = model.PatientGuid;
first.DeleteFlag = model.DeleteFlag;
first.CreateID = model.CreateID;
first.VenousPathwayTime = model.VenousPathwayTime;
first.BloodSampleSubmissionTime = model.BloodSampleSubmissionTime;
first.DeliveryTimeToTheLaboratory = model.DeliveryTimeToTheLaboratory;
first.LiverAndKidneyFunctionElectrolyteReportTime = model.LiverAndKidneyFunctionElectrolyteReportTime;
first.RapidBloodGlucose = model.RapidBloodGlucose;
first.RapidBloodGlucoseValue = model.RapidBloodGlucoseValue;
first.RapidBloodGlucoseTime = model.RapidBloodGlucoseTime;
first.LaboratoryDoctor = model.LaboratoryDoctor;
first.ECGExaminationResults = model.ECGExaminationResults;
first.FacialColorLips = model.FacialColorLips;
first.Skin = model.Skin;
first.Photoreaction = model.Photoreaction;
first.Pupil = model.Pupil;
first.PupilLeft = model.PupilLeft;
first.PupilRight = model.PupilRight;
first.Head = model.Head;
first.Breathe = model.Breathe;
first.Chest = model.Chest;
first.PulmonaryBreathSounds = model.PulmonaryBreathSounds;
first.HeartRate = model.HeartRate;
first.HeartSounds = model.HeartSounds;
first.Abdomen = model.Abdomen;
first.AbdominalTenderness = model.AbdominalTenderness;
first.Spine = model.Spine;
first.TheFourLimbs = model.TheFourLimbs;
first.CoagulationReportImage = model.CoagulationReportImage;
first.BloodRoutineReportImage = model.BloodRoutineReportImage;
first.LiverAndKidneyFunctionElectrolyteReportImage = model.LiverAndKidneyFunctionElectrolyteReportImage;
first.Electrocardiogram = model.Electrocardiogram;
first.ArriveRescueRoomTime = model.ArriveRescueRoomTime;
first.LeaveRescueRoomTime = model.LeaveRescueRoomTime;
first.StrandedRescueRoomDuration = model.StrandedRescueRoomDuration;
first.FastScore = model.FastScore;
first.RatingOrNot = model.RatingOrNot;
if (IService.SaveOrUpdateFirstAidMeasures(first, emergencyRoom, prehospital))
{
return new MessageModel<bool> { Success = true, Msg = "保存成功" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "保存失败" };
}
}
public FirstAidMeasuresModel GetByPatientGuidAndEmergencyRoomGUID(string patientGuid)
{
return IService.GetByPatientGuidAndEmergencyRoomGUID(patientGuid);
}
}
}