|
@@ -45,6 +45,7 @@ using WingInterfaceLibrary.DTO.Report;
|
|
|
using WingInterfaceLibrary.LiveConsultation.Consultation;
|
|
|
using WingInterfaceLibrary.DTO.Consultation;
|
|
|
using WingInterfaceLibrary.Request.User;
|
|
|
+using MongoDB.Driver.Core.Operations;
|
|
|
|
|
|
namespace Flyinsono.DBCopy.Tool.Service
|
|
|
{
|
|
@@ -1396,7 +1397,7 @@ namespace Flyinsono.DBCopy.Tool.Service
|
|
|
//获取上次同步到的时间
|
|
|
var builder = Builders<ConsultationRecords>.Filter;
|
|
|
var startTime = GetFactBeginTime(_migrateRecord.StartTime, _migrateRecord.EndTime);
|
|
|
- var filter = builder.Where(x => x.IsDeleted == false && ((x.CreateTime > startTime && x.CreateTime <= _migrateRecord.EndTime) || (x.UpdateTime > startTime && x.UpdateTime <= _migrateRecord.EndTime)));
|
|
|
+ var filter = builder.Where(x => x.IsDeleted == false && x.Id == "CEB9B6C593FB4661A991C5451FEA4EEA" && ((x.CreateTime > startTime && x.CreateTime <= _migrateRecord.EndTime) || (x.UpdateTime > startTime && x.UpdateTime <= _migrateRecord.EndTime)));
|
|
|
var consultations = _consultationRecordDBRepository.GetTerminalRecords(filter).OrderByDescending(x => x.CreateTime).ToList();
|
|
|
OnMigrate("consultations", consultations, SendConsultations, syncType, 1000);
|
|
|
consultations.Clear();
|
|
@@ -1408,7 +1409,11 @@ namespace Flyinsono.DBCopy.Tool.Service
|
|
|
private void SendConsultations(IList<ConsultationRecords> consultations, SyncDBEnum syncType)
|
|
|
{
|
|
|
try
|
|
|
- {
|
|
|
+ {
|
|
|
+ var builder = Builders<FollowUpVisitInfos>.Filter;
|
|
|
+ var startTime = GetFactBeginTime(_migrateRecord.StartTime, _migrateRecord.EndTime);
|
|
|
+ var filter = builder.Where(x => (x.CreateTime > startTime && x.CreateTime <= _migrateRecord.EndTime) || (x.UpdateTime > startTime && x.UpdateTime <= _migrateRecord.EndTime));
|
|
|
+ var followVistorList = _consultationRecordDBRepository.GetAllFollowUpVisitInfosRecords(filter).OrderByDescending(x => x.CreateTime).ToList();
|
|
|
var syncBatchConsultationRequest = new SyncBatchConsultationRequest();
|
|
|
syncBatchConsultationRequest.SyncType = syncType;
|
|
|
syncBatchConsultationRequest.SyncConsultations = new List<SyncConsultationRequest>();
|
|
@@ -1450,6 +1455,29 @@ namespace Flyinsono.DBCopy.Tool.Service
|
|
|
ConsultationFileList = new List<ConsultationFileDTO>()
|
|
|
};
|
|
|
|
|
|
+ //查询随访记录
|
|
|
+ if (followVistorList?.Count > 0)
|
|
|
+ {
|
|
|
+ var findList = followVistorList.Where(c => c.ConsultationRecordId == consultation.Id)?.ToList();
|
|
|
+ if (findList?.Count > 0)
|
|
|
+ {
|
|
|
+ var followUpVistorList = findList.Select(c => new SyncFollowUpVisitRequest()
|
|
|
+ {
|
|
|
+ IsDelete = c.IsDeleted,
|
|
|
+ CreateTime = c.CreateTime,
|
|
|
+ UpdateTime = c.UpdateTime,
|
|
|
+ FollowUpVisitCode = c.Id,
|
|
|
+ ConsultationRecordCode = c.ConsultationRecordId,
|
|
|
+ PatientName = c.PatientName,
|
|
|
+ PatientPhone = c.PatientPhone,
|
|
|
+ GeneralCase = c.GeneralCase,
|
|
|
+ ClinicalSituation = c.ClinicalSituation,
|
|
|
+ DoctorCode = c.Doctor,
|
|
|
+ OccurredTime = c.OccurredTime
|
|
|
+ }).ToList();
|
|
|
+ syncReportInfoRequest.SyncFollowUpVisitList = followUpVistorList;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if (consultation.ImageTokens != null && consultation.ImageTokens.Any())
|
|
|
{
|