diff --git a/src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs b/src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs index 8ad66e5..cd01ee3 100644 --- a/src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs +++ b/src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs @@ -312,6 +312,14 @@ namespace Shentun.Peis.ImportLisResults } } + /// + /// 根据lis传过来的参考范围更新体检系统的值 + /// + /// + /// + /// + /// + /// private async Task UpdateItemReferenceRangeValueAsync(Guid itemId, char sexId, int? age, string referenceRangeValue) { var referenceRanges = _referenceRanges.Where(o => o.ItemId == itemId).ToList(); @@ -324,6 +332,7 @@ namespace Shentun.Peis.ImportLisResults ReferenceRange referenceRange = null; if (_referenceRangeManager.IsNumberReferenceRange(referenceRangeValue)) { + //数字型 item.ReferenceRangeTypeFlag = ItemReferenceRangeTypeFlag.Number; await _itemRepository.UpdateAsync(item); diff --git a/src/Shentun.Peis.HttpApi.Host/Schedulers/SyncPatientRegisterReportInterfaceWorker.cs b/src/Shentun.Peis.HttpApi.Host/Schedulers/SyncPatientRegisterReportInterfaceWorker.cs index af46bb7..f89292d 100644 --- a/src/Shentun.Peis.HttpApi.Host/Schedulers/SyncPatientRegisterReportInterfaceWorker.cs +++ b/src/Shentun.Peis.HttpApi.Host/Schedulers/SyncPatientRegisterReportInterfaceWorker.cs @@ -116,11 +116,18 @@ namespace Shentun.Peis.Schedulers //需要导入的天数 var QueryDays = Convert.ToInt32(interfaceConfig.GetSection("Interface").GetSection("Scheduler") .GetSection("QueryDays").Value); - + //获取报告地址 var reportApiBaseAddress = interfaceConfig.GetSection("Interface").GetSection("ReportApiBaseAddress").Value; var reportApiUrl = interfaceConfig.GetSection("Interface").GetSection("ReportApiUrl").Value; + //是否开启自动导报告 + var IsSyncReport = interfaceConfig.GetSection("Interface").GetSection("Scheduler") + .GetSection("IsSyncReport").Value; + + //是否开启同步预登记数据 + var IsSyncPreRegister = interfaceConfig.GetSection("Interface").GetSection("Scheduler") + .GetSection("IsSyncPreRegister").Value; SyncPatientRegisterReportInputDto input = new SyncPatientRegisterReportInputDto { @@ -133,61 +140,67 @@ namespace Shentun.Peis.Schedulers var funName = "GetSyncPatientRegisterIds"; object[] classConstructorArg = new object[] { thirdInterfaceDto.Id }; object[] objects = [input]; - - var pluginsOut = ReflectionHelper.InvokeAsync>(assemblyName, className, classConstructorArg, funName, objects).Result; + + #region 同步备单数据 - var preRegistrationFunName = "GetSyncPreRegistrationPatientRegisterIds"; - var preRegistrationPluginsOut = ReflectionHelper.InvokeAsync>(assemblyName, className, classConstructorArg, preRegistrationFunName, objects).Result; - - if (preRegistrationPluginsOut.Any()) + if (IsSyncPreRegister == "Y") { - - foreach (var item in preRegistrationPluginsOut) + var preRegistrationFunName = "GetSyncPreRegistrationPatientRegisterIds"; + var preRegistrationPluginsOut = ReflectionHelper.InvokeAsync>(assemblyName, className, classConstructorArg, preRegistrationFunName, objects).Result; + + if (preRegistrationPluginsOut.Any()) { - PatientRegisterIdInputDto patientRegisterIdDto = new PatientRegisterIdInputDto + foreach (var item in preRegistrationPluginsOut) { - PatientRegisterId = item.Id - }; - appServiceHelper.CallAppService("api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId", patientRegisterIdDto); - } + PatientRegisterIdInputDto patientRegisterIdDto = new PatientRegisterIdInputDto + { + PatientRegisterId = item.Id + }; + appServiceHelper.CallAppService("api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId", patientRegisterIdDto); + } - Logger.LogError("同步预登记数据成功"); - } + Logger.LogError("同步预登记数据成功"); + } + } #endregion - - //需要同步报告的数据 - if (pluginsOut.Any()) + #region 同步报告 + if (IsSyncReport == "Y") { - // pluginsOut = pluginsOut.Take(10).ToList(); - - foreach (var item in pluginsOut) + //需要同步报告的数据 + var pluginsOut = ReflectionHelper.InvokeAsync>(assemblyName, className, classConstructorArg, funName, objects).Result; + if (pluginsOut.Any()) { + // pluginsOut = pluginsOut.Take(10).ToList(); - PatientRegisterIdInputDto patientRegisterIdDto = new PatientRegisterIdInputDto + foreach (var item in pluginsOut) { - PatientRegisterId = item.Id - }; - appServiceHelper.CallAppService("api/app/TransToWebPeis/SyncPatientRegisterReportByPatientRegisterId", patientRegisterIdDto); - } + PatientRegisterIdInputDto patientRegisterIdDto = new PatientRegisterIdInputDto + { + PatientRegisterId = item.Id + }; + appServiceHelper.CallAppService("api/app/TransToWebPeis/SyncPatientRegisterReportByPatientRegisterId", patientRegisterIdDto); + } - Logger.LogError($"同步数据成功:人员登记ID[{string.Join(',', pluginsOut.Select(s => s.Id))}]"); - } - else - { - Logger.LogError("无数据需要同步"); - } + Logger.LogError($"同步数据成功:人员登记ID[{string.Join(',', pluginsOut.Select(s => s.Id))}]"); + } + else + { + Logger.LogError("无数据需要同步"); + } + } + #endregion }