StableVersion4.3/HL_FristAidPlatform_DataBase/Service/T_Service_Apoplexy_Opration...

584 lines
31 KiB
C#

using HL_FristAidPlatform_Help;
using HL_FristAidPlatform_IDataBase.Service;
using HL_FristAidPlatform_Models;
using HL_FristAidPlatform_Models.Sercice;
using SqlSugar;
using System;
using System.Collections.Generic;
namespace HL_FristAidPlatform_DataBase.Service
{
public class T_Service_Apoplexy_OprationInfoDB : BaseDB, IT_Service_Apoplexy_OprationInfo
{
public SqlSugarClient db = GetClient();
T_Service_PatientGradeDB gradeService = new T_Service_PatientGradeDB();
T_Service_Apoplexy_EmergencyRoomDB emergencyRoomDB = new T_Service_Apoplexy_EmergencyRoomDB();
/// <summary>
/// 增加一条数据
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public T_Service_Apoplexy_OprationInfo Add(T_Service_Apoplexy_OprationInfo model)
{
return db.Insertable(model).ExecuteReturnEntity();
//throw new NotImplementedException();
}
/// <summary>
/// 删除一条数据
/// </summary>
public bool Delete(long ID)
{
return db.Deleteable<T_Service_Apoplexy_OprationInfo>(it => it.ID == ID).ExecuteCommand() == 0 ? false : true; ;
//throw new NotImplementedException();
}
/// <summary>
/// 获得前几行数据
/// </summary>
public T_Service_Apoplexy_OprationInfo Get(long ID)
{
return db.Queryable<T_Service_Apoplexy_OprationInfo>().First(it => it.ID == ID);
//throw new NotImplementedException();
}
/// <summary>
/// 根据患者编号(GUID)获取数据信息
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public TableModel<T_Service_Apoplexy_OprationInfo> GetByPatientGuid(string patientGuid)
{
//throw new NotImplementedException();
List<T_Service_Apoplexy_OprationInfo> data = db.Queryable<T_Service_Apoplexy_OprationInfo>().Where(it => it.PatientGuid == patientGuid && it.DeleteFlag == 0).ToList();
TableModel<T_Service_Apoplexy_OprationInfo> t = new TableModel<T_Service_Apoplexy_OprationInfo>();
t.Code = 0;
t.PageCount = data.Count;
t.TotalNumber = data.Count;
t.Data = data;
t.Msg = "成功";
return t;
}
/// <summary>
/// 根据患者编号(PatientGuid)获取一条信息
/// </summary>
/// <param name="GetByPatientGuid1"></param>
/// <returns></returns>
public T_Service_Apoplexy_OprationInfo GetByPatientGuid1(string PatientGuid)
{
//return db.Queryable<T_Service_Apoplexy_OprationInfo>().First(it => it.PatientGuid == PatientGuid);
return db.Queryable<T_Service_Patient, T_Service_Apoplexy_Prehospital, T_Service_Apoplexy_NCXSS, T_Service_Apoplexy_DMLSS, T_Service_Apoplexy_CEACZ, T_Service_Apoplexy_XGZL,T_Service_Apoplexy_EmergencyRoom>((Patient, Prehospital, NCXSS, DMLSS, CEACZ, XGZL,EmergencyRoom) => new JoinQueryInfos(
JoinType.Left, Patient.GUID == Prehospital.PatientGuid,
JoinType.Left, Patient.GUID == NCXSS.PatientGuid,
JoinType.Left, Patient.GUID == DMLSS.PatientGuid,
JoinType.Left, Patient.GUID == CEACZ.PatientGuid,
JoinType.Left, Patient.GUID == XGZL.PatientGuid,
JoinType.Left, Patient.GUID == EmergencyRoom.PatientGuid))
.Where(Patient => Patient.GUID == PatientGuid)
.Select((Patient, Prehospital, NCXSS, DMLSS, CEACZ, XGZL, EmergencyRoom) =>
new T_Service_Apoplexy_OprationInfo()
{
ArrivalCatheterRoomTime= EmergencyRoom.ArrivalCatheterRoomTime,
StartCatheterRoomTime = EmergencyRoom.StartCatheterRoomTime,
//脑出血手术
PatientGuid = Patient.GUID,
NCXOpStartTime = NCXSS.NCXOpStartTime,
NCXOpEndTime = NCXSS.NCXOpEndTime,
NCXOpThEndTime = NCXSS.NCXOpThEndTime,
NCXOpStEndTime = NCXSS.NCXOpStEndTime,
NCXOpMaZui = NCXSS.NCXOpMaZui,
NCXOpWays = NCXSS.NCXOpWays,
Str2 = NCXSS.Str2,
Str3 = NCXSS.Str3,
NCXOpWayOther = NCXSS.NCXOpWayOther,
NCXOpBFZ = NCXSS.NCXOpBFZ,
NCXOpBFZNR = NCXSS.NCXOpBFZNR,
NCXOpYuHou = NCXSS.NCXOpYuHou,
NCXOpConversationTime = NCXSS.NCXOpConversationTime,
NCXOpSignTime = NCXSS.NCXOpSignTime,
//动脉瘤手术
DMLNum = DMLSS.DMLNum,
DMLSide1 = DMLSS.DMLSide1,
DMLSite1 = DMLSS.DMLSite1,
DMLSiteICA1 = DMLSS.DMLSiteICA1,
DMLSiteACA1 = DMLSS.DMLSiteACA1,
DMLSiteMCA1 = DMLSS.DMLSiteMCA1,
DMLSiteVA1 = DMLSS.DMLSiteVA1,
DMLSiteBA1 = DMLSS.DMLSiteBA1,
DMLSitePCA1 = DMLSS.DMLSitePCA1,
DMLOther1 = DMLSS.DMLOther1,
DMLLong1 = DMLSS.DMLLong1,
DMLLide1 = DMLSS.DMLLide1,
DMLHigh1 = DMLSS.DMLHigh1,
DMLL11 = DMLSS.DMLL11,
DMLType1 = DMLSS.DMLType1,
DMLSide2 = DMLSS.DMLSide2,
DMLSite2 = DMLSS.DMLSite2,
DMLSiteICA2 = DMLSS.DMLSiteICA2,
DMLSiteACA2 = DMLSS.DMLSiteACA2,
DMLSiteMCA2 = DMLSS.DMLSiteMCA2,
DMLSiteVA2 = DMLSS.DMLSiteVA2,
DMLSiteBA2 = DMLSS.DMLSiteBA2,
DMLSitePCA2 = DMLSS.DMLSitePCA2,
DMLOther2 = DMLSS.DMLOther2,
DMLLong2 = DMLSS.DMLLong2,
DMLLide2 = DMLSS.DMLLide2,
DMLHigh2 = DMLSS.DMLHigh2,
DMLL12 = DMLSS.DMLL12,
DMLType2 = DMLSS.DMLType2,
DMLSide3 = DMLSS.DMLSide3,
DMLSite3 = DMLSS.DMLSite3,
DMLSiteICA3 = DMLSS.DMLSiteICA3,
DMLSiteACA3 = DMLSS.DMLSiteACA3,
DMLSiteMCA3 = DMLSS.DMLSiteMCA3,
DMLSiteVA3 = DMLSS.DMLSiteVA3,
DMLSiteBA3 = DMLSS.DMLSiteBA3,
DMLSitePCA3 = DMLSS.DMLSitePCA3,
DMLOther3 = DMLSS.DMLOther3,
DMLLong3 = DMLSS.DMLLong3,
DMLLide3 = DMLSS.DMLLide3,
DMLHigh3 = DMLSS.DMLHigh3,
DMLL13 = DMLSS.DMLL13,
DMLType3 = DMLSS.DMLType3,
DMLSide4 = DMLSS.DMLSide4,
DMLSite4 = DMLSS.DMLSite4,
DMLSiteICA4 = DMLSS.DMLSiteICA4,
DMLSiteACA4 = DMLSS.DMLSiteACA4,
DMLSiteMCA4 = DMLSS.DMLSiteMCA4,
DMLSiteVA4 = DMLSS.DMLSiteVA4,
DMLSiteBA4 = DMLSS.DMLSiteBA4,
DMLSitePCA4 = DMLSS.DMLSitePCA4,
DMLOther4 = DMLSS.DMLOther4,
DMLLong4 = DMLSS.DMLLong4,
DMLLide4 = DMLSS.DMLLide4,
DMLHigh4 = DMLSS.DMLHigh4,
DMLL14 = DMLSS.DMLL14,
DMLType4 = DMLSS.DMLType4,
//动脉瘤手术-----是否手术操作
DMLOpYN1 = DMLSS.DMLOpYN1,
DMLOpType1 = DMLSS.DMLOpType1,
DMLOpTime1 = DMLSS.DMLOpTime1,
DMLJBJG1 = DMLSS.DMLJBJG1,
DMLJBQK1 = DMLSS.DMLJBQK1,
DMLJBBFZYN1 = DMLSS.DMLJBBFZYN1,
DMLJBBFZNR1 = DMLSS.DMLJBBFZNR1,
DMLJBOther1 = DMLSS.DMLJBOther1,
DMLJRTuJing1 = DMLSS.DMLJRTuJing1,
DMLJRTHYN1 = DMLSS.DMLJRTHYN1,
DMLJRTHNum1 = DMLSS.DMLJRTHNum1,
DMLJRZJYN1 = DMLSS.DMLJRZJYN1,
DMLJRZJName1 = DMLSS.DMLJRZJName1,
DMLJRZJNameOther1 = DMLSS.DMLJRZJNameOther1,
DMLJRQNYN1 = DMLSS.DMLJRQNYN1,
DMLJRQNNum1 = DMLSS.DMLJRQNNum1,
DMLJRMaterial1 = DMLSS.DMLJRMaterial1,
DMLJROther1 = DMLSS.DMLJROther1,
DMLJRJG1 = DMLSS.DMLJRJG1,
DMLJRQK1 = DMLSS.DMLJRQK1,
DMLJRBFZYN1 = DMLSS.DMLJRBFZYN1,
DMLJRBFZ1 = DMLSS.DMLJRBFZ1,
DMLJRXSBW1 = DMLSS.DMLJRXSBW1,
DMLJRDMJCBW1 = DMLSS.DMLJRDMJCBW1,
DMLJRBFZOther1 = DMLSS.DMLJRBFZOther1,
DMLOpYN2 = DMLSS.DMLOpYN2,
DMLOpType2 = DMLSS.DMLOpType2,
DMLOpTime2 = DMLSS.DMLOpTime2,
DMLJBJG2 = DMLSS.DMLJBJG2,
DMLJBQK2 = DMLSS.DMLJBQK2,
DMLJBBFZYN2 = DMLSS.DMLJBBFZYN2,
DMLJBBFZNR2 = DMLSS.DMLJBBFZNR2,
DMLJBOther2 = DMLSS.DMLJBOther2,
DMLJRTuJing2 = DMLSS.DMLJRTuJing2,
DMLJRTHYN2 = DMLSS.DMLJRTHYN2,
DMLJRTHNum2 = DMLSS.DMLJRTHNum2,
DMLJRZJYN2 = DMLSS.DMLJRZJYN2,
DMLJRZJName2 = DMLSS.DMLJRZJName2,
DMLJRZJNameOther2 = DMLSS.DMLJRZJNameOther2,
DMLJRQNYN2 = DMLSS.DMLJRQNYN2,
DMLJRQNNum2 = DMLSS.DMLJRQNNum2,
DMLJRMaterial2 = DMLSS.DMLJRMaterial2,
DMLJROther2 = DMLSS.DMLJROther2,
DMLJRJG2 = DMLSS.DMLJRJG2,
DMLJRQK2 = DMLSS.DMLJRQK2,
DMLJRBFZYN2 = DMLSS.DMLJRBFZYN2,
DMLJRBFZ2 = DMLSS.DMLJRBFZ2,
DMLJRXSBW2 = DMLSS.DMLJRXSBW2,
DMLJRDMJCBW2 = DMLSS.DMLJRDMJCBW2,
DMLJRBFZOther2 = DMLSS.DMLJRBFZOther2,
DMLOpYN3 = DMLSS.DMLOpYN3,
DMLOpType3 = DMLSS.DMLOpType3,
DMLOpTime3 = DMLSS.DMLOpTime3,
DMLJBJG3 = DMLSS.DMLJBJG3,
DMLJBQK3 = DMLSS.DMLJBQK3,
DMLJBBFZYN3 = DMLSS.DMLJBBFZYN3,
DMLJBBFZNR3 = DMLSS.DMLJBBFZNR3,
DMLJBOther3 = DMLSS.DMLJBOther3,
DMLJRTuJing3 = DMLSS.DMLJRTuJing3,
DMLJRTHYN3 = DMLSS.DMLJRTHYN3,
DMLJRTHNum3 = DMLSS.DMLJRTHNum3,
DMLJRZJYN3 = DMLSS.DMLJRZJYN3,
DMLJRZJName3 = DMLSS.DMLJRZJName3,
DMLJRZJNameOther3 = DMLSS.DMLJRZJNameOther3,
DMLJRQNYN3 = DMLSS.DMLJRQNYN3,
DMLJRQNNum3 = DMLSS.DMLJRQNNum3,
DMLJRMaterial3 = DMLSS.DMLJRMaterial3,
DMLJROther3 = DMLSS.DMLJROther3,
DMLJRJG3 = DMLSS.DMLJRJG3,
DMLJRQK3 = DMLSS.DMLJRQK3,
DMLJRBFZYN3 = DMLSS.DMLJRBFZYN3,
DMLJRBFZ3 = DMLSS.DMLJRBFZ3,
DMLJRXSBW3 = DMLSS.DMLJRXSBW3,
DMLJRDMJCBW3 = DMLSS.DMLJRDMJCBW3,
DMLJRBFZOther3 = DMLSS.DMLJRBFZOther3,
DMLOpYN4 = DMLSS.DMLOpYN4,
DMLOpType4 = DMLSS.DMLOpType4,
DMLOpTime4 = DMLSS.DMLOpTime4,
DMLJBJG4 = DMLSS.DMLJBJG4,
DMLJBQK4 = DMLSS.DMLJBQK4,
DMLJBBFZYN4 = DMLSS.DMLJBBFZYN4,
DMLJBBFZNR4 = DMLSS.DMLJBBFZNR4,
DMLJBOther4 = DMLSS.DMLJBOther4,
DMLJRTuJing4 = DMLSS.DMLJRTuJing4,
DMLJRTHYN4 = DMLSS.DMLJRTHYN4,
DMLJRTHNum4 = DMLSS.DMLJRTHNum4,
DMLJRZJYN4 = DMLSS.DMLJRZJYN4,
DMLJRZJName4 = DMLSS.DMLJRZJName4,
DMLJRZJNameOther4 = DMLSS.DMLJRZJNameOther4,
DMLJRQNYN4 = DMLSS.DMLJRQNYN4,
DMLJRQNNum4 = DMLSS.DMLJRQNNum4,
DMLJRMaterial4 = DMLSS.DMLJRMaterial4,
DMLJROther4 = DMLSS.DMLJROther4,
DMLJRJG4 = DMLSS.DMLJRJG4,
DMLJRQK4 = DMLSS.DMLJRQK4,
DMLJRBFZYN4 = DMLSS.DMLJRBFZYN4,
DMLJRBFZ4 = DMLSS.DMLJRBFZ4,
DMLJRXSBW4 = DMLSS.DMLJRXSBW4,
DMLJRDMJCBW4 = DMLSS.DMLJRDMJCBW4,
DMLJRBFZOther4 = DMLSS.DMLJRBFZOther4,
DMLOpEndTime1=DMLSS.DMLOpEndTime1,
DMLOpEndTime2=DMLSS.DMLOpEndTime2,
DMLOpEndTime3=DMLSS.DMLOpEndTime3,
DMLOpEndTime4=DMLSS.DMLOpEndTime4,
DMLOpConversationTime = DMLSS.DMLOpConversationTime,
DMLOpSignTime = DMLSS.DMLOpSignTime,
//CEA/CAS手术操作表
CEAStTime = CEACZ.CEAStTime,
CEAEdTime = CEACZ.CEAEdTime,
CEAOpSite = CEACZ.CEAOpSite,
CEAMaZui = CEACZ.CEAMaZui,
CEAJianCe = CEACZ.CEAJianCe,
CEAOpWay = CEACZ.CEAOpWay,
CEABuPian = CEACZ.CEABuPian,
CEABFZ = CEACZ.CEABFZ,
CASBFZ = CEACZ.CASBFZ,
CEAConversationTime = CEACZ.CEAConversationTime,
CEASignTime = CEACZ.CEASignTime,
//血管治疗
Str6 = XGZL.Str6,
XGFaBingTime2 = XGZL.XGFaBingTime2,
XGSQNIHSSYN = XGZL.XGSQNIHSSYN,
XGSQNIHSS = XGZL.XGSQNIHSS,
XGASPECTYN = XGZL.XGASPECTYN,
XGSQCT = XGZL.XGSQCT,
XGSHASPECTYN = XGZL.XGSHASPECTYN,
SHASPECT = XGZL.SHASPECT,
XGSQTICIYN = XGZL.XGSQTICIYN,
XGSQTICI = XGZL.XGSQTICI,
XGPunctureEnd = XGZL.XGPunctureEnd,
XGOPT = XGZL.XGOPT,
XGDPT = XGZL.XGDPT,
XGXGKT = XGZL.XGXGKT,
XGXGKTOther = XGZL.XGXGKTOther,
XGSHNIHSSYN = XGZL.XGSHNIHSSYN,
XGSHNIHSS = XGZL.XGSHNIHSS,
XGSHTICIYN = XGZL.XGSHTICIYN,
XGSHTICI = XGZL.XGSHTICI,
XGXGZTTime = XGZL.XGXGZTTime,
XGDRT = XGZL.XGDRT,
XGOpBFZ = XGZL.XGOpBFZ,
XGOpBFZOther = XGZL.XGOpBFZOther,
XGSH24NIHSSYN = XGZL.XGSH24NIHSSYN,
XGSH24NIHSS = XGZL.XGSH24NIHSS,
XGSH7dNIHSSYN = XGZL.XGSH7dNIHSSYN,
XGSH7dNIHSS = XGZL.XGSH7dNIHSS,
RSReason = XGZL.RSReason,
InterveneDoctorImageFiles = XGZL.InterveneDoctorImageFiles,
InterventionConversationTime = XGZL.InterventionConversationTime,
InterventionSignTime = XGZL.InterventionSignTime,
InterventionalReceptionTime = XGZL.InterventionalReceptionTime,
InterventionalDoctor = XGZL.InterventionalDoctor,
InterventionalConsultationLocation = XGZL.InterventionalConsultationLocation,
InterventionalEvaluationTime = XGZL.InterventionalEvaluationTime,
IndicationEvaluationResults = XGZL.IndicationEvaluationResults,
ContraindicationEvaluationResults = XGZL.ContraindicationEvaluationResults,
InterventionalEndTime = XGZL.InterventionalEndTime,
//患者基础表
acZLType = Patient.acZLType,
//院前时间节点
NGSJZFaBingTime = Prehospital.NGSJZFaBingTime,
NGSJZDaoYuanTime = Prehospital.NGSJZDaoYuanTime,
NCXJZFaBingTime = Prehospital.NCXJZFaBingTime,
NCXJZDaoYuanTime = Prehospital.NCXJZDaoYuanTime
}).First();
}
/// <summary>
/// 获得数据列表
/// </summary>
public TableModel<T_Service_Apoplexy_OprationInfo> GetPageList(int pageIndex, int pageSize)
{
//throw new NotImplementedException();
int total = 0;
List<T_Service_Apoplexy_OprationInfo> data = db.Queryable<T_Service_Apoplexy_OprationInfo>().Where(it => it.DeleteFlag == 0).ToPageList(pageIndex, pageSize, ref total);
TableModel<T_Service_Apoplexy_OprationInfo> t = new TableModel<T_Service_Apoplexy_OprationInfo>();
t.Code = 0;
t.PageCount = data.Count;
t.TotalNumber = total;
t.Data = data;
t.Msg = "成功";
return t;
}
/// <summary>
/// 更新一条数据
/// </summary>
public int Update(T_Service_Apoplexy_OprationInfo model)
{
//throw new NotImplementedException();
return db.Updateable(model).ExecuteCommand();
}
public bool UpdateOrInsertHospitalization(T_Service_Apoplexy_NCXSS ncxss, T_Service_Apoplexy_DMLSS dmlss, T_Service_Apoplexy_CEACZ CEA, T_Service_Apoplexy_XGZL xgzl, string temp, List<T_Service_PatientNIHSS> nihsslist,string ArrivalCatheterRoomTime, string StartCatheterRoomTime)
{
try
{
db.Ado.BeginTran();
if (string.IsNullOrEmpty(temp))
{
if (SqlFunc.IsNullOrEmpty(ncxss.GUID))
{
ncxss.GUID = Guid.NewGuid().ToString();
db.Insertable(ncxss).IgnoreColumns(it => new { it.ID }).ExecuteCommand();
}
else
{
db.Updateable(ncxss).IgnoreColumns(it => new { it.ID }).ExecuteCommand();
}
if (SqlFunc.IsNullOrEmpty(dmlss.GUID))
{
dmlss.GUID = Guid.NewGuid().ToString();
db.Insertable(dmlss).IgnoreColumns(it => new { it.ID }).ExecuteCommand();
}
else
{
db.Updateable(dmlss).IgnoreColumns(it => new { it.ID }).ExecuteCommand();
}
if (SqlFunc.IsNullOrEmpty(CEA.GUID))
{
CEA.GUID = Guid.NewGuid().ToString();
db.Insertable(CEA).IgnoreColumns(it => new { it.ID }).ExecuteCommand();
}
else
{
db.Updateable(CEA).IgnoreColumns(it => new { it.ID }).ExecuteCommand();
}
if (SqlFunc.IsNullOrEmpty(xgzl.GUID))
{
xgzl.GUID = Guid.NewGuid().ToString();
db.Insertable(xgzl).IgnoreColumns(it => new { it.ID }).ExecuteCommand();
}
else
{
db.Updateable(xgzl).IgnoreColumns(it => new { it.ID }).ExecuteCommand();
}
//NIHSS评分列表
if (nihsslist != null)
{
if (nihsslist.Count > 0)
{
T_Service_PatientNIHSS niss = new T_Service_PatientNIHSS();
for (int i = 0; i < nihsslist.Count; i++)
{
if (nihsslist[i] != null)
{
niss = nihsslist[i];
//nihsslist[i].PatientGUID = xgzl.PatientGuid;
T_Service_PatientNIHSS patientNIHSS = new T_Service_PatientNIHSS();
patientNIHSS = gradeService.GetNIHSS(niss.PatientGUID, niss.Flag);
if (!SqlFunc.IsNullOrEmpty(niss.PatientGUID))
{
if (patientNIHSS == null)
{
niss.GUID = Guid.NewGuid().ToString();
db.Insertable(niss).IgnoreColumns(ignoreNullColumn: true).ExecuteCommand();
}
else
{
niss.GUID = patientNIHSS.GUID;
db.Updateable(niss).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
}
}
}
}
}
}
T_Service_Apoplexy_EmergencyRoom emergencyRoom = new T_Service_Apoplexy_EmergencyRoom();
emergencyRoom = emergencyRoomDB.GetByPatientGuid1(xgzl.PatientGuid);
if (emergencyRoom == null)
{
emergencyRoom = new T_Service_Apoplexy_EmergencyRoom();
emergencyRoom.GUID = Guid.NewGuid().ToString();
emergencyRoom.PatientGuid = xgzl.PatientGuid;
emergencyRoom.ArrivalCatheterRoomTime = ArrivalCatheterRoomTime;
emergencyRoom.StartCatheterRoomTime = StartCatheterRoomTime;
db.Insertable(emergencyRoom).IgnoreColumns(it => new { it.ID }).ExecuteCommand();
}
else
{
emergencyRoom.ArrivalCatheterRoomTime = ArrivalCatheterRoomTime;
emergencyRoom.StartCatheterRoomTime = StartCatheterRoomTime;
db.Updateable(emergencyRoom).UpdateColumns(it => new { it.ArrivalCatheterRoomTime,it.StartCatheterRoomTime }).Where(it => it.PatientGuid == emergencyRoom.PatientGuid).ExecuteCommand();
}
}
else
{
if (temp.Contains("03"))
{
if (SqlFunc.IsNullOrEmpty(ncxss.GUID))
{
ncxss.GUID = Guid.NewGuid().ToString();
db.Insertable(ncxss).IgnoreColumns(ignoreNullColumn: true).ExecuteCommand();
}
else
{
db.Updateable(ncxss).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
}
}
if (temp.Contains("04"))
{
if (SqlFunc.IsNullOrEmpty(dmlss.GUID))
{
dmlss.GUID = Guid.NewGuid().ToString();
db.Insertable(dmlss).IgnoreColumns(ignoreNullColumn: true).ExecuteCommand();
}
else
{
db.Updateable(dmlss).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
}
}
if (temp.Contains("05"))
{
if (SqlFunc.IsNullOrEmpty(CEA.GUID))
{
CEA.GUID = Guid.NewGuid().ToString();
db.Insertable(CEA).IgnoreColumns(ignoreNullColumn: true).ExecuteCommand();
}
else
{
db.Updateable(CEA).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
}
}
if (temp.Contains("02"))
{
if (SqlFunc.IsNullOrEmpty(xgzl.GUID))
{
xgzl.GUID = Guid.NewGuid().ToString();
db.Insertable(xgzl).IgnoreColumns(ignoreNullColumn: true).ExecuteCommand();
}
else
{
db.Updateable(xgzl).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
}
//NIHSS评分列表
if (nihsslist != null)
{
if (nihsslist.Count > 0)
{
T_Service_PatientNIHSS niss = new T_Service_PatientNIHSS();
for (int i = 0; i < nihsslist.Count; i++)
{
if (nihsslist[i] != null)
{
niss = nihsslist[i];
//nihsslist[i].PatientGUID = xgzl.PatientGuid;
T_Service_PatientNIHSS patientNIHSS = new T_Service_PatientNIHSS();
patientNIHSS = gradeService.GetNIHSS(niss.PatientGUID, niss.Flag);
if (!SqlFunc.IsNullOrEmpty(niss.PatientGUID))
{
if (patientNIHSS == null)
{
niss.GUID = Guid.NewGuid().ToString();
db.Insertable(niss).IgnoreColumns(ignoreNullColumn: true).ExecuteCommand();
}
else
{
niss.GUID = patientNIHSS.GUID;
db.Updateable(niss).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
}
}
}
}
}
}
}
T_Service_Apoplexy_EmergencyRoom emergencyRoom = new T_Service_Apoplexy_EmergencyRoom();
emergencyRoom = emergencyRoomDB.GetByPatientGuid1(xgzl.PatientGuid);
if (emergencyRoom == null)
{
emergencyRoom = new T_Service_Apoplexy_EmergencyRoom();
emergencyRoom.GUID = Guid.NewGuid().ToString();
emergencyRoom.PatientGuid = xgzl.PatientGuid;
emergencyRoom.ArrivalCatheterRoomTime = ArrivalCatheterRoomTime;
emergencyRoom.StartCatheterRoomTime = StartCatheterRoomTime;
db.Insertable(emergencyRoom).IgnoreColumns(it => new { it.ID }).ExecuteCommand();
}
else
{
emergencyRoom.ArrivalCatheterRoomTime = ArrivalCatheterRoomTime;
emergencyRoom.StartCatheterRoomTime = StartCatheterRoomTime;
db.Updateable(emergencyRoom).UpdateColumns(it => new { it.ArrivalCatheterRoomTime,it.StartCatheterRoomTime }).Where(it => it.PatientGuid == emergencyRoom.PatientGuid).ExecuteCommand();
}
}
db.Ado.CommitTran();
return true;
}
catch (Exception ex)
{
db.Ado.RollbackTran();
Help.WriteErrorLog("介入手术报错日志:", ex.ToString());
return false;
throw;
}
}
}
}