You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
3.1 KiB
87 lines
3.1 KiB
using Shentun.Peis.ChargeRequests;
|
|
using Shentun.Peis.ImportLisResults;
|
|
using Shentun.Peis.Models;
|
|
using Shentun.Peis.PatientRegisters;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Volo.Abp.Domain.Repositories;
|
|
using Volo.Abp.Uow;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Shentun.Peis
|
|
{
|
|
public class ImportLisResultAppServiceTest : PeisApplicationTestBase
|
|
{
|
|
private readonly IRepository<ImportLisResult> _repository;
|
|
private readonly ImportLisResultAppService _appService;
|
|
private readonly ITestOutputHelper _output;
|
|
private readonly IUnitOfWorkManager _unitOfWorkManager;
|
|
public ImportLisResultAppServiceTest(ITestOutputHelper testOutputHelper)
|
|
{
|
|
_output = testOutputHelper;
|
|
_unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
|
|
_repository = GetRequiredService<IRepository<ImportLisResult>>();
|
|
_appService = GetRequiredService<ImportLisResultAppService>();
|
|
}
|
|
[Fact]
|
|
public async Task ImportResultAsync()
|
|
{
|
|
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
|
|
{
|
|
|
|
var entity = new List<CreateImportLisResultDto>()
|
|
{
|
|
new CreateImportLisResultDto()
|
|
{
|
|
LisRequestNo = "2405100389",
|
|
ItemId = new Guid("3a126b34-dc65-fba2-49ed-40413c36babb"),
|
|
Result = "阴性",
|
|
//Unit = "g/l",
|
|
//ReferenceRangeValue = "0~20"
|
|
CheckDoctorName = "测试"
|
|
},
|
|
new CreateImportLisResultDto()
|
|
{
|
|
LisRequestNo = "2405100389",
|
|
ItemId = new Guid("3a126b34-dc9b-8893-ddf3-a4e05044145b"),
|
|
Result = "阴性",
|
|
//Unit = "ml",
|
|
//ReferenceRangeValue = "10~50"
|
|
CheckDoctorName = "测试"
|
|
},
|
|
new CreateImportLisResultDto()
|
|
{
|
|
LisRequestNo = "2405100389",
|
|
ItemId = new Guid("3a126b34-dcda-b371-a13f-9f1efba0ee27"),
|
|
Result = "阴性",
|
|
//Unit = "次",
|
|
//ReferenceRangeValue = "10~60"
|
|
CheckDoctorName = "测试"
|
|
}
|
|
};
|
|
|
|
await _appService.ImportResultAsync(entity);
|
|
await unitOfWork.CompleteAsync();
|
|
}
|
|
}
|
|
|
|
|
|
[Fact]
|
|
public async Task ImportResultByPatientRegisterIdAsync()
|
|
{
|
|
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
|
|
{
|
|
await _appService.ImportResultByPatientRegisterIdAsync(new PatientRegisterIdInputDto()
|
|
{
|
|
PatientRegisterId = new Guid("3a128196-ec34-aa17-0a04-b4bb6bafc752")
|
|
});
|
|
await unitOfWork.CompleteAsync();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|