|
|
|
@ -1,5 +1,6 @@ |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
using Shentun.Peis.DiagnosisFunctions; |
|
|
|
using Shentun.Peis.Models; |
|
|
|
using Shentun.Peis.PlugIns; |
|
|
|
using Shentun.Peis.RegisterCheckItems; |
|
|
|
@ -36,7 +37,7 @@ namespace Shentun.Peis.ImportLisResults |
|
|
|
private readonly ICurrentUser _currentUser; |
|
|
|
private readonly IRepository<UserItemType> _userItemTypeRepository; |
|
|
|
private readonly IRepository<Asbitem, Guid> _asbitemRepository; |
|
|
|
|
|
|
|
private readonly DiagnosisFunctionAppService _diagnosisFunctionAppService; |
|
|
|
public ImportLisResultAppService(IRepository<RegisterCheck, Guid> registerCheckRepository, |
|
|
|
IRepository<RegisterCheckItem> registerCheckItemRepository, |
|
|
|
IRepository<PatientRegister, Guid> patientRegisterRepository, |
|
|
|
@ -53,7 +54,8 @@ namespace Shentun.Peis.ImportLisResults |
|
|
|
IRepository<UserItemType> userItemTypeRepository, |
|
|
|
IRepository<Asbitem, Guid> asbitemRepository, |
|
|
|
IRepository<RegisterCheckAsbitem, Guid> registerCheckAsbitemRepository, |
|
|
|
IRepository<LisRequest, Guid> lisRequestRepository) |
|
|
|
IRepository<LisRequest, Guid> lisRequestRepository, |
|
|
|
DiagnosisFunctionAppService diagnosisFunctionAppService) |
|
|
|
{ |
|
|
|
_registerCheckRepository = registerCheckRepository; |
|
|
|
_userRepository = userRepository; |
|
|
|
@ -72,6 +74,7 @@ namespace Shentun.Peis.ImportLisResults |
|
|
|
_asbitemRepository = asbitemRepository; |
|
|
|
_registerCheckAsbitemRepository = registerCheckAsbitemRepository; |
|
|
|
_lisRequestRepository = lisRequestRepository; |
|
|
|
_diagnosisFunctionAppService = diagnosisFunctionAppService; |
|
|
|
} |
|
|
|
[HttpGet("api/app/ImportLisResult/ImportResult")] |
|
|
|
public async Task ImportResultAsync(List<LisResult> input) |
|
|
|
@ -103,10 +106,34 @@ namespace Shentun.Peis.ImportLisResults |
|
|
|
{ |
|
|
|
continue; |
|
|
|
} |
|
|
|
var itemSource = new RegisterCheckItem() |
|
|
|
{ |
|
|
|
Result = inputItem.Result, |
|
|
|
ReferenceRangeValue = inputItem.ReferenceRangeValue, |
|
|
|
Unit = inputItem.Unit, |
|
|
|
CriticalRangeValue = inputItem.CriticalRangeValue |
|
|
|
}; |
|
|
|
|
|
|
|
await _registerCheckItemManager.UpdateRegisterCheckItemAsync(itemSource, lisRequestItem.registerCheckItem); |
|
|
|
await _registerCheckItemRepository.UpdateAsync(lisRequestItem.registerCheckItem); |
|
|
|
|
|
|
|
} |
|
|
|
//生成小结
|
|
|
|
var registerChecks = list.Select(o=>o.registerCheck).Distinct().ToList(); |
|
|
|
foreach(var registerCheck in registerChecks) |
|
|
|
{ |
|
|
|
var getDiagnosisResultRequestDto = new GetDiagnosisResultRequestDto() |
|
|
|
{ |
|
|
|
RegisterCheckId = registerCheck.Id, |
|
|
|
Items = list.Where(o=>o.registerCheck.Id == registerCheck.Id) |
|
|
|
.Select(o=>new GetDiagnosisResultRequest_Item() |
|
|
|
{ |
|
|
|
ItemId = o.registerCheckItem.ItemId, |
|
|
|
Result = o.registerCheckItem.Result, |
|
|
|
}).ToList() |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
//保存小结
|
|
|
|
|
|
|
|
} |
|
|
|
|