|
|
|
@ -4,9 +4,12 @@ using Microsoft.Extensions.Configuration; |
|
|
|
using NPOI.SS.Formula.Functions; |
|
|
|
using NUglify.Helpers; |
|
|
|
using Shentun.Peis.DiagnosisFunctions; |
|
|
|
using Shentun.Peis.Enums; |
|
|
|
using Shentun.Peis.ImportLisResults; |
|
|
|
using Shentun.Peis.Items; |
|
|
|
using Shentun.Peis.Models; |
|
|
|
using Shentun.Peis.PatientRegisters; |
|
|
|
using Shentun.Peis.PlugIns; |
|
|
|
using Shentun.Peis.ReferenceRanges; |
|
|
|
using Shentun.Peis.RegisterCheckItems; |
|
|
|
using Shentun.Peis.RegisterChecks; |
|
|
|
@ -32,6 +35,7 @@ namespace Shentun.Peis.ImportPacsResults |
|
|
|
[Authorize] |
|
|
|
public class ImportPacsResultAppService : ApplicationService |
|
|
|
{ |
|
|
|
private readonly IRepository<ThirdInterface> _thirdInterfaceRepository; |
|
|
|
private readonly IRepository<RegisterCheckItem> _registerCheckItemRepository; |
|
|
|
private readonly IRepository<RegisterCheckPicture> _registerCheckPictureRepository; |
|
|
|
private readonly IRepository<PatientRegister, Guid> _patientRegisterRepository; |
|
|
|
@ -85,7 +89,8 @@ namespace Shentun.Peis.ImportPacsResults |
|
|
|
ItemManager itemManager, |
|
|
|
UnitManager unitManager, |
|
|
|
RegisterCheckAppService registerCheckAppService, |
|
|
|
IRepository<RegisterCheckPicture> registerCheckPictureRepository) |
|
|
|
IRepository<RegisterCheckPicture> registerCheckPictureRepository, |
|
|
|
IRepository<ThirdInterface> thirdInterfaceRepository) |
|
|
|
{ |
|
|
|
_registerCheckRepository = registerCheckRepository; |
|
|
|
_userRepository = userRepository; |
|
|
|
@ -113,6 +118,7 @@ namespace Shentun.Peis.ImportPacsResults |
|
|
|
_unitManager = unitManager; |
|
|
|
_registerCheckAppService = registerCheckAppService; |
|
|
|
_registerCheckPictureRepository = registerCheckPictureRepository; |
|
|
|
_thirdInterfaceRepository = thirdInterfaceRepository; |
|
|
|
} |
|
|
|
|
|
|
|
[HttpPost("api/app/ImportPacsResult/ImportResult")] |
|
|
|
@ -302,5 +308,25 @@ namespace Shentun.Peis.ImportPacsResults |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[HttpPost("api/app/ImportPacsResult/ImportResultByPatientRegisterId")] |
|
|
|
public async Task ImportResultByPatientRegisterIdAsync(PatientRegisterIdInputDto input) |
|
|
|
{ |
|
|
|
var thirdInterfaces = await _thirdInterfaceRepository.GetListAsync(o => |
|
|
|
o.ThirdInterfaceType == ThirdInterfaceTypeFlag.ImportPacsResult |
|
|
|
&& o.IsActive == 'Y'); |
|
|
|
foreach (var thirdInterface in thirdInterfaces) |
|
|
|
{ |
|
|
|
var parmValue = thirdInterface.ParmValue; |
|
|
|
var configurationBuilder = new ConfigurationBuilder() |
|
|
|
.AddJsonStream(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(parmValue))); |
|
|
|
var config = configurationBuilder.Build(); |
|
|
|
var assemblyName = config.GetSection("Interface").GetSection("AssemblyName").Value; |
|
|
|
var className = config.GetSection("Interface").GetSection("ClassName").Value; |
|
|
|
object[] objects = new object[] { input.PatientRegisterId }; |
|
|
|
var pluginsOut = await Utilities.ReflectionHelper.InvokeAsync<ImportPacsResultPlugInsOut>(assemblyName, className, parmValue, "ImportResultByPatientRegisterIdAsync", objects); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |