129 lines
4.9 KiB
C#
129 lines
4.9 KiB
C#
using HL_FristAidPlatform_Help;
|
|
using HL_FristAidPlatform_IDataBase;
|
|
using HL_FristAidPlatform_Models;
|
|
using SqlSugar;
|
|
using System.Collections.Generic;
|
|
|
|
namespace HL_FristAidPlatform_DataBase
|
|
{
|
|
/// <summary>
|
|
/// 胸痛患者转归
|
|
/// </summary>
|
|
public class T_Service_ChestPain_OutComeDB : BaseDB, IT_Service_ChestPain_OutCome
|
|
{
|
|
public SqlSugarClient db = GetClient();
|
|
|
|
/// <summary>
|
|
/// 增加一条数据
|
|
/// </summary>
|
|
public T_Service_ChestPain_OutCome Add(T_Service_ChestPain_OutCome model)
|
|
{
|
|
return db.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新一条数据
|
|
/// </summary>
|
|
public bool Update(T_Service_ChestPain_OutCome model)
|
|
{
|
|
return db.Updateable(model).ExecuteCommand() == 0 ? false : true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除一条数据
|
|
/// </summary>
|
|
public bool Delete(long ID)
|
|
{
|
|
return db.Deleteable<T_Service_ChestPain_OutCome>(it => it.ID == ID).ExecuteCommand() == 0 ? false : true; ;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获得数据列表
|
|
/// </summary>
|
|
public TableModel<T_Service_ChestPain_OutCome> GetPageList(int pageIndex, int pageSize)
|
|
{
|
|
int TotalNumber = 0;
|
|
List<T_Service_ChestPain_OutCome> data = db.Queryable<T_Service_ChestPain_OutCome>().Where(it => it.DeleteFlag == 0).ToPageList(pageIndex, pageSize, ref TotalNumber);
|
|
TableModel<T_Service_ChestPain_OutCome> t = new TableModel<T_Service_ChestPain_OutCome>();
|
|
t.Code = 0;
|
|
t.PageCount = data.Count;
|
|
t.TotalNumber = TotalNumber;
|
|
t.Data = data;
|
|
t.Msg = "成功";
|
|
return t;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获得前几行数据
|
|
/// </summary>
|
|
public T_Service_ChestPain_OutCome Get(long ID)
|
|
{
|
|
return db.Queryable<T_Service_ChestPain_OutCome>().First(it => it.ID == ID);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据患者编号(GUID)+所属报表类型 获取数据信息
|
|
/// </summary>
|
|
/// <param name="patientGuid">病人编号(GUID)</param>
|
|
/// <returns></returns>
|
|
public TableModel<T_Service_ChestPain_OutCome> GetByPatientGuid(string patientGuid)
|
|
{
|
|
TableModel<T_Service_ChestPain_OutCome> t = new TableModel<T_Service_ChestPain_OutCome>();
|
|
|
|
var listMode = db.Queryable<T_Service_ChestPain_OutCome>().Where(it => it.PatientGuid == patientGuid && it.DeleteFlag == 0)
|
|
.Select(it => new T_Service_ChestPain_OutCome
|
|
{
|
|
ID = it.ID,
|
|
GUID = it.GUID,
|
|
PatientGuid = it.PatientGuid,
|
|
CP_Diagnosis_Code = it.CP_Diagnosis_Code,
|
|
CP_Diagnosis_Text = it.CP_Diagnosis_Text,
|
|
Diagnosis_Time = it.Diagnosis_Time,
|
|
Is_Heart_Failure = it.Is_Heart_Failure,
|
|
HOD = it.HOD,
|
|
Total_Cost = it.Total_Cost,
|
|
OutCome_Code = it.OutCome_Code,
|
|
OutCome_Text = it.OutCome_Text,
|
|
Leave_Time = it.Leave_Time,
|
|
Treatment_Result_Code = it.Treatment_Result_Code,
|
|
Treatment_Result_Text = it.Treatment_Result_Text,
|
|
Discharge_Medicine_Code = it.Discharge_Medicine_Code,
|
|
Discharge_Medicine_Text = it.Discharge_Medicine_Text,
|
|
Out_Grug_Dapt = it.Out_Grug_Dapt,
|
|
Out_Grug_Aceiorarb = it.Out_Grug_Aceiorarb,
|
|
Out_Drug_Statins = it.Out_Drug_Statins,
|
|
Out_Drug_Retardant = it.Out_Drug_Retardant,
|
|
Hand_Time = it.Hand_Time,
|
|
Is_Net_Hospital = it.Is_Net_Hospital,
|
|
Hand_Hospital_Name = it.Hand_Hospital_Name,
|
|
Death_Cause_Text = it.Death_Cause_Text,
|
|
Is_Trans_PCI = it.Is_Trans_PCI,
|
|
No_Trans_PCI_Reason = it.No_Trans_PCI_Reason,
|
|
Decision_Operation_Time = it.Decision_Operation_Time,
|
|
Is_Direct_Catheter = it.Is_Direct_Catheter,
|
|
Transfer_Time = it.Transfer_Time,
|
|
Admission_Dept = it.Admission_Dept,
|
|
Transfer_Reason = it.Transfer_Reason,
|
|
Death_Time = it.Death_Time,
|
|
Death_Cause_Code = it.Death_Cause_Code,
|
|
Death_Cause_Desc = it.Death_Cause_Desc,
|
|
Medical_Desc = it.Medical_Desc,
|
|
Remark = it.Remark,
|
|
DeleteFlag = it.DeleteFlag,
|
|
CreationDate = it.CreationDate,
|
|
CreatorID = it.CreatorID,
|
|
Creator = it.Creator,
|
|
EditTime = it.EditTime,
|
|
EditorID = it.EditorID,
|
|
Editor = it.Editor,
|
|
}).OrderBy(it => it.ID, OrderByType.Desc).ToList();
|
|
|
|
t.Code = 0;
|
|
t.TotalNumber = listMode.Count;
|
|
t.Data = listMode;
|
|
t.Msg = "成功";
|
|
return t;
|
|
}
|
|
}
|
|
}
|