StableVersion4.3/HL_FristAidPlatform_DataBase/Service/T_Service_CriticalPregnan_T...

154 lines
6.4 KiB
C#
Raw Normal View History

2024-03-11 09:47:34 +08:00
using HL_FristAidPlatform_Help;
using HL_FristAidPlatform_IDataBase;
using HL_FristAidPlatform_Models;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HL_FristAidPlatform_DataBase
{
public class T_Service_CriticalPregnan_TimeDB : BaseDB, IT_Service_CriticalPregnan_Time
{
public SqlSugarClient db = GetClient();
/// <summary>
/// 获取患者不同来院方式时间集合
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public List<TimeModel> GetCriticalPregnanTime(string patientGuid)
{
List<TimeModel> list = new List<TimeModel>();
var oneClass = db.Queryable<T_Service_Patient, T_Service_CriticalPregnant_BasicInfo, T_Service_CriticalPregnan_Time>((a, b, c) => new JoinQueryInfos(JoinType.Left, a.GUID == b.PatientGuid, JoinType.Left, a.GUID == c.PatientGuid))
.Where((a, b, c) => a.GUID == patientGuid && a.DeleteFlag == 0)
.Select((a, b, c) => new
{
b.ComeHospitalWay,
b.Attack_Time,
c.VisitTime,
c.ArriveTime,
c.LeaveTime,
c.AttendingTime,
c.InRescueRoomTime,
c.OutRescueRoomTime,
c.TransferTime
}).First();
if (oneClass != null)
{
TimeModel model;
model = new TimeModel();
model.Name = "高危时间";
model.Key = "Attack_Time";
model.Value = oneClass.Attack_Time;
list.Add(model);
if (oneClass.ComeHospitalWay == "1")
{
model = new TimeModel();
model.Name = "出诊时间";
model.Key = "VisitTime";
model.Value = oneClass.VisitTime;
list.Add(model);
model = new TimeModel();
model.Name = "到达现场时间";
model.Key = "ArriveTime";
model.Value = oneClass.ArriveTime;
list.Add(model);
model = new TimeModel();
model.Name = "离开现场时间";
model.Key = "LeaveTime";
model.Value = oneClass.LeaveTime;
list.Add(model);
model = new TimeModel();
model.Name = "接诊时间";
model.Key = "AttendingTime";
model.Value = oneClass.AttendingTime;
list.Add(model);
model = new TimeModel();
model.Name = "进入抢救室时间";
model.Key = "InRescueRoomTime";
model.Value = oneClass.InRescueRoomTime;
list.Add(model);
model = new TimeModel();
model.Name = "离开抢救室时间";
model.Key = "OutRescueRoomTime";
model.Value = oneClass.OutRescueRoomTime;
list.Add(model);
}
if (oneClass.ComeHospitalWay == "2")
{
model = new TimeModel();
model.Name = "决定转院时间";
model.Key = "TransferTime";
model.Value = oneClass.TransferTime;
list.Add(model);
model = new TimeModel();
model.Name = "出诊时间";
model.Key = "VisitTime";
model.Value = oneClass.VisitTime;
list.Add(model);
model = new TimeModel();
model.Name = "离开现场时间";
model.Key = "LeaveTime";
model.Value = oneClass.LeaveTime;
list.Add(model);
model = new TimeModel();
model.Name = "接诊时间";
model.Key = "AttendingTime";
model.Value = oneClass.AttendingTime;
list.Add(model);
model = new TimeModel();
model.Name = "进入抢救室时间";
model.Key = "InRescueRoomTime";
model.Value = oneClass.InRescueRoomTime;
list.Add(model);
model = new TimeModel();
model.Name = "离开抢救室时间";
model.Key = "OutRescueRoomTime";
model.Value = oneClass.OutRescueRoomTime;
list.Add(model);
}
if (oneClass.ComeHospitalWay == "3")
{
model = new TimeModel();
model.Name = "出诊时间";
model.Key = "VisitTime";
model.Value = oneClass.VisitTime;
list.Add(model);
model.Name = "接诊时间";
model.Key = "AttendingTime";
model.Value = oneClass.AttendingTime;
list.Add(model);
model = new TimeModel();
model.Name = "进入抢救室时间";
model.Key = "InRescueRoomTime";
model.Value = oneClass.InRescueRoomTime;
list.Add(model);
model = new TimeModel();
model.Name = "离开抢救室时间";
model.Key = "OutRescueRoomTime";
model.Value = oneClass.OutRescueRoomTime;
list.Add(model);
}
if (oneClass.ComeHospitalWay == "4")
{
model = new TimeModel();
model.Name = "进入抢救室时间";
model.Key = "InRescueRoomTime";
model.Value = oneClass.InRescueRoomTime;
list.Add(model);
model = new TimeModel();
model.Name = "离开抢救室时间";
model.Key = "OutRescueRoomTime";
model.Value = oneClass.OutRescueRoomTime;
list.Add(model);
}
}
return list;
}
}
}