8 changed files with 388 additions and 25 deletions
-
2src/Shentun.ColumnReferencePlugIns/Shentun.Peis.PlugIns.csproj
-
64src/Shentun.Peis.Application.Contracts/ImportLisResults/CreateImportLisResultDto.cs
-
13src/Shentun.Peis.Application.Contracts/ImportLisResults/IImportLisResultAppService.cs
-
185src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs
-
8src/Shentun.Peis.Application/ReferenceRanges/ReferenceRangeAppService.cs
-
54src/Shentun.Peis.Domain/ReferenceRanges/ReferenceRangeManager.cs
-
68test/Shentun.Peis.Application.Tests/ImportLisResultAppServiceTest.cs
-
5test/Shentun.Peis.Application.Tests/appsettings.json
@ -0,0 +1,64 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace Shentun.Peis.ImportLisResults |
||||
|
{ |
||||
|
public class CreateImportLisResultDto |
||||
|
{ |
||||
|
public string LisRequestNo { get; set; } |
||||
|
/// 项目编号
|
||||
|
/// </summary>
|
||||
|
public Guid ItemId { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 项目名称
|
||||
|
/// </summary>
|
||||
|
public string ItemName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 结果
|
||||
|
/// </summary>
|
||||
|
public string? Result { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 单位
|
||||
|
/// </summary>
|
||||
|
|
||||
|
public string? Unit { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 参考范围
|
||||
|
/// </summary>
|
||||
|
|
||||
|
public string? ReferenceRangeValue { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 危急值范围
|
||||
|
/// </summary>
|
||||
|
|
||||
|
public string? CriticalRangeValue { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 危急值
|
||||
|
/// </summary>
|
||||
|
|
||||
|
public string? CriticalValue { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 报告单状态
|
||||
|
/// </summary>
|
||||
|
|
||||
|
public string? ResultStatusId { get; set; } = "01";//01-正常
|
||||
|
/// <summary>
|
||||
|
/// 报告单提示
|
||||
|
/// </summary>
|
||||
|
public string ReportPrompt { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 检查医生
|
||||
|
/// </summary>
|
||||
|
|
||||
|
public string? CheckDoctorName { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 检查日期
|
||||
|
/// </summary>
|
||||
|
|
||||
|
public DateTime? CheckDate { get; set; } |
||||
|
|
||||
|
public Guid ExecOrganizationUnitId { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace Shentun.Peis.ImportLisResults |
||||
|
{ |
||||
|
public interface IImportLisResultAppService |
||||
|
{ |
||||
|
public Task ImportResultAsync(List<CreateImportLisResultDto> input); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,68 @@ |
|||||
|
using Shentun.Peis.ChargeRequests; |
||||
|
using Shentun.Peis.ImportLisResults; |
||||
|
using Shentun.Peis.Models; |
||||
|
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 = "T202404290063", |
||||
|
ItemId = new Guid("3a1203c2-c974-de89-ee07-3427f22fa8f7"), |
||||
|
Result = "32", |
||||
|
Unit = "g/l", |
||||
|
ReferenceRangeValue = "0-20" |
||||
|
}, |
||||
|
new CreateImportLisResultDto() |
||||
|
{ |
||||
|
LisRequestNo = "T202404290063", |
||||
|
ItemId = new Guid("3a1203c2-ccd1-e29b-84b4-26bd28bbe12e"), |
||||
|
Result = "51.63", |
||||
|
Unit = "ml", |
||||
|
ReferenceRangeValue = "0-20" |
||||
|
}, |
||||
|
new CreateImportLisResultDto() |
||||
|
{ |
||||
|
LisRequestNo = "T202404290063", |
||||
|
ItemId = new Guid("3a1203c2-d3b1-61fe-94e9-1210fd5555ec"), |
||||
|
Result = "123.001", |
||||
|
Unit = "次", |
||||
|
ReferenceRangeValue = "0-20" |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
await _appService.ImportResultAsync(entity); |
||||
|
await unitOfWork.CompleteAsync(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue