17 changed files with 865 additions and 27 deletions
-
28ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PacsImportResultInterfaceInput.cs
-
74ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PacsImportResultInterfaceOut.cs
-
110ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PacsImportResultPlugInsGem.cs
-
37ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/PacsImportResultPlugInsGemTest.cs
-
6ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/appsettings.json
-
9src/Shentun.ColumnReferencePlugIns/LisResultImportPlugInsBase.cs
-
8src/Shentun.ColumnReferencePlugIns/PacsImportResultPlugInsBase.cs
-
4src/Shentun.ColumnReferencePlugIns/PacsRequestForImportResultPlugIns.cs
-
39src/Shentun.ColumnReferencePlugIns/PlugInsBase.cs
-
2src/Shentun.ColumnReferencePlugIns/ThirdPlugInsBase.cs
-
87src/Shentun.Peis.Application.Contracts/ImportPacsResults/CreateImportPacsResultDto.cs
-
259src/Shentun.Peis.Application/ImportPacsResults/ImportPacsResultAppService.cs
-
61src/Shentun.Peis.Domain/ImageHelper.cs
-
42src/Shentun.Utilities/FileHelper.cs
-
40src/Shentun.Utilities/PDFHelper.cs
-
3src/Shentun.Utilities/Shentun.Utilities.csproj
-
83test/Shentun.Peis.Application.Tests/ImportPacsResultAppServiceTest.cs
@ -0,0 +1,28 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Shentun.Peis.PlugIns.Gem |
|||
{ |
|||
public class PacsImportResultInterfaceInput |
|||
{ |
|||
public string tjNum { get; set; } |
|||
public string checkupItemId { get; set; } |
|||
public string organizeCode { get; set; } |
|||
public string examTypeCode { get; set; } |
|||
public string idCard { get; set; } |
|||
public string patientType { get; set; } |
|||
public string patientId { get; set; } |
|||
public string requestId { get; set; } |
|||
public string clinicId { get; set; } |
|||
public string hospizationId { get; set; } |
|||
public string visitId { get; set; } |
|||
public long? examRequestId { get; set; } |
|||
public string beginTime { get; set; } |
|||
public string endTime { get; set; } |
|||
public int pageNo { get; set; } |
|||
public int pageSize { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Shentun.Peis.PlugIns.Gem |
|||
{ |
|||
public class PacsImportResultInterfaceOut |
|||
{ |
|||
public string code { get; set; } |
|||
public string msg { get; set; } |
|||
public List<PacsImportResultInterfaceData> data { get; set; } |
|||
} |
|||
|
|||
public class PacsImportResultInterfaceData |
|||
{ |
|||
/// <summary>
|
|||
/// 姓名
|
|||
/// </summary>
|
|||
public string patientName { get; set; } |
|||
/// <summary>
|
|||
/// 科室名称
|
|||
/// </summary>
|
|||
public string reportDeptName { get; set; } |
|||
/// <summary>
|
|||
/// 放射DICOM影像浏览地址
|
|||
/// </summary>
|
|||
public string webPacsURL { get; set; } |
|||
/// <summary>
|
|||
/// 1阳性 0阴性
|
|||
/// </summary>
|
|||
|
|||
public int malignant { get; set; } |
|||
/// <summary>
|
|||
/// 结论
|
|||
/// </summary>
|
|||
|
|||
public string examDiagnosis { get; set; } |
|||
/// <summary>
|
|||
/// 描述
|
|||
/// </summary>
|
|||
public string examDescript { get; set; } |
|||
/// <summary>
|
|||
/// 建议
|
|||
/// </summary>
|
|||
public string suggestion { get; set; } |
|||
/// <summary>
|
|||
/// 报告医生
|
|||
/// </summary>
|
|||
public string reportDoctorName { get; set; } |
|||
/// <summary>
|
|||
/// 审核医生
|
|||
/// </summary>
|
|||
public string reviewDoctorName { get; set; } |
|||
/// <summary>
|
|||
/// 报告时间
|
|||
/// </summary>
|
|||
|
|||
public string reportDateTime { get; set; } |
|||
/// <summary>
|
|||
/// 审核时间
|
|||
/// </summary>
|
|||
public string reviewDateTime { get; set; } |
|||
/// <summary>
|
|||
/// 图文报告浏览地址
|
|||
/// </summary>
|
|||
public string reportUrl { get; set; } |
|||
/// <summary>
|
|||
/// 超声打印图片列表,字符串base64数组
|
|||
/// </summary>
|
|||
public List<string> imageList { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
using Shentun.Utilities; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Xunit.Abstractions; |
|||
|
|||
namespace Shentun.Peis.PlugIns.Gem.Test |
|||
{ |
|||
public class PacsImportResultPlugInsGemTest |
|||
{ |
|||
private readonly ITestOutputHelper _output; |
|||
public PacsImportResultPlugInsGemTest(ITestOutputHelper testOutputHelper) |
|||
{ |
|||
_output = testOutputHelper; |
|||
|
|||
} |
|||
|
|||
[Fact] |
|||
public async Task ImportResultAsync() |
|||
{ |
|||
string configParm; |
|||
string filePath = DirectoryHelper.GetAppDirectory() + "/appsettings.json"; |
|||
configParm = File.ReadAllText(filePath); |
|||
|
|||
var input = new PacsImportResultPlugInsGem(configParm); |
|||
var item = await input.ImportResultAsync( |
|||
new PacsImportResultPlugInsInput() |
|||
{ |
|||
PatientRegisterId = new Guid("3a1277ab-376c-fbdb-4419-92bbb4594607") |
|||
}); |
|||
|
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,87 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.ImportPacsResults |
|||
{ |
|||
public class CreateImportPacsResultDto |
|||
{ |
|||
public string CheckRequestNo { get; set; } |
|||
/// <summary>
|
|||
/// 姓名
|
|||
/// </summary>
|
|||
|
|||
public string PatientName { get; set; } |
|||
/// <summary>
|
|||
/// 检查所见
|
|||
/// </summary>
|
|||
public string? Result { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 结论
|
|||
/// </summary>
|
|||
public string? Summary { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 结论
|
|||
/// </summary>
|
|||
public string? Suggestion { 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; } |
|||
public List<CreateImportPacsResultPictureDto> Files { get; set; } = new List<CreateImportPacsResultPictureDto>(); |
|||
} |
|||
|
|||
public class CreateImportPacsResultPictureDto |
|||
{ |
|||
/// <summary>
|
|||
/// 文件格式,0-图片,1-pdf
|
|||
/// </summary>
|
|||
public string FileFormat { get; set; } |
|||
/// <summary>
|
|||
/// 0-json,1-url
|
|||
/// </summary>
|
|||
|
|||
public string FileTransMode { get; set; } |
|||
/// <summary>
|
|||
/// 文件名
|
|||
/// </summary>
|
|||
public string FileName { get; set; } |
|||
/// <summary>
|
|||
/// base64文件
|
|||
/// </summary>
|
|||
public string FileBase64 { get; set; } |
|||
|
|||
public char IsPrint { get; set; } |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,259 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.Extensions.Configuration; |
|||
using NPOI.SS.Formula.Functions; |
|||
using NUglify.Helpers; |
|||
using Shentun.Peis.DiagnosisFunctions; |
|||
using Shentun.Peis.ImportLisResults; |
|||
using Shentun.Peis.Items; |
|||
using Shentun.Peis.Models; |
|||
using Shentun.Peis.ReferenceRanges; |
|||
using Shentun.Peis.RegisterCheckItems; |
|||
using Shentun.Peis.RegisterChecks; |
|||
using Shentun.Peis.Units; |
|||
using Shentun.Utilities; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.Identity; |
|||
using Volo.Abp.Users; |
|||
|
|||
namespace Shentun.Peis.ImportPacsResults |
|||
{ |
|||
public class ImportPacsResultAppService : ApplicationService |
|||
{ |
|||
private readonly IRepository<RegisterCheckItem> _registerCheckItemRepository; |
|||
private readonly IRepository<RegisterCheckPicture> _registerCheckPictureRepository; |
|||
private readonly IRepository<PatientRegister, Guid> _patientRegisterRepository; |
|||
private readonly IRepository<ReferenceRange, Guid> _referenceRangeRepository; |
|||
private readonly IRepository<RegisterCheck, Guid> _registerCheckRepository; |
|||
private readonly IRepository<RegisterCheckAsbitem, Guid> _registerCheckAsbitemRepository; |
|||
private readonly IRepository<LisRequest, Guid> _lisRequestRepository; |
|||
private readonly IRepository<Item, Guid> _itemRepository; |
|||
private readonly IRepository<RegisterCheckSummary, Guid> _registerCheckSummaryRepository; |
|||
private readonly IRepository<RegisterCheckSuggestion, Guid> _registerCheckSuggestionRepository; |
|||
private readonly IRepository<IdentityUser, Guid> _userRepository; |
|||
private readonly IRepository<Unit, Guid> _unitRepository; |
|||
private readonly RegisterCheckManager _registerCheckManager; |
|||
private readonly RegisterCheckItemManager _registerCheckItemManager; |
|||
private readonly CacheService _cacheService; |
|||
private readonly IGuidGenerator _guidGenerator; |
|||
private readonly IConfiguration _configuration; |
|||
private readonly ICurrentUser _currentUser; |
|||
private readonly IRepository<UserItemType> _userItemTypeRepository; |
|||
private readonly IRepository<Asbitem, Guid> _asbitemRepository; |
|||
private readonly DiagnosisFunctionAppService _diagnosisFunctionAppService; |
|||
private readonly ReferenceRangeManager _referenceRangeManager; |
|||
private readonly ItemManager _itemManager; |
|||
private readonly UnitManager _unitManager; |
|||
private readonly RegisterCheckAppService _registerCheckAppService; |
|||
private List<Unit> _units; |
|||
private List<ReferenceRange> _referenceRanges; |
|||
private static bool _isRunning = false; |
|||
private static readonly object lockObject = new object(); |
|||
public ImportPacsResultAppService(IRepository<RegisterCheck, Guid> registerCheckRepository, |
|||
IRepository<RegisterCheckItem> registerCheckItemRepository, |
|||
IRepository<PatientRegister, Guid> patientRegisterRepository, |
|||
IRepository<ReferenceRange, Guid> referenceRangeRepository, |
|||
IRepository<RegisterCheckSummary, Guid> registerCheckSummaryRepository, |
|||
IRepository<RegisterCheckSuggestion, Guid> registerCheckSuggestionRepository, |
|||
IRepository<IdentityUser, Guid> userRepository, |
|||
RegisterCheckManager registerCheckManager, |
|||
RegisterCheckItemManager registerCheckItemManager, |
|||
CacheService cacheService, |
|||
IGuidGenerator guidGenerator, |
|||
IConfiguration configuration, |
|||
ICurrentUser currentUser, |
|||
IRepository<UserItemType> userItemTypeRepository, |
|||
IRepository<Asbitem, Guid> asbitemRepository, |
|||
IRepository<RegisterCheckAsbitem, Guid> registerCheckAsbitemRepository, |
|||
IRepository<LisRequest, Guid> lisRequestRepository, |
|||
IRepository<Unit, Guid> unitRepository, |
|||
DiagnosisFunctionAppService diagnosisFunctionAppService, |
|||
ReferenceRangeManager referenceRangeManager, |
|||
IRepository<Item, Guid> itemRepository, |
|||
ItemManager itemManager, |
|||
UnitManager unitManager, |
|||
RegisterCheckAppService registerCheckAppService, |
|||
IRepository<RegisterCheckPicture> registerCheckPictureRepository) |
|||
{ |
|||
_registerCheckRepository = registerCheckRepository; |
|||
_userRepository = userRepository; |
|||
_registerCheckManager = registerCheckManager; |
|||
_patientRegisterRepository = patientRegisterRepository; |
|||
_referenceRangeRepository = referenceRangeRepository; |
|||
_registerCheckItemRepository = registerCheckItemRepository; |
|||
_registerCheckSummaryRepository = registerCheckSummaryRepository; |
|||
_registerCheckSuggestionRepository = registerCheckSuggestionRepository; |
|||
_registerCheckItemManager = registerCheckItemManager; |
|||
_cacheService = cacheService; |
|||
_guidGenerator = guidGenerator; |
|||
_configuration = configuration; |
|||
_currentUser = currentUser; |
|||
_userItemTypeRepository = userItemTypeRepository; |
|||
_asbitemRepository = asbitemRepository; |
|||
_registerCheckAsbitemRepository = registerCheckAsbitemRepository; |
|||
_lisRequestRepository = lisRequestRepository; |
|||
_diagnosisFunctionAppService = diagnosisFunctionAppService; |
|||
_referenceRangeManager = referenceRangeManager; |
|||
_itemRepository = itemRepository; |
|||
_itemManager = itemManager; |
|||
_unitRepository = unitRepository; |
|||
_units = _unitRepository.GetListAsync().Result; |
|||
_unitManager = unitManager; |
|||
_registerCheckAppService = registerCheckAppService; |
|||
_registerCheckPictureRepository = registerCheckPictureRepository; |
|||
} |
|||
|
|||
[HttpPost("api/app/ImportPacsResult/ImportResult")] |
|||
public async Task ImportResultAsync(CreateImportPacsResultDto input) |
|||
{ |
|||
//设置结果
|
|||
|
|||
var list = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync() |
|||
join registerCheck in await _registerCheckRepository.GetQueryableAsync() |
|||
on patientRegister.Id equals registerCheck.PatientRegisterId |
|||
join registerCheckItem in await _registerCheckItemRepository.GetQueryableAsync() |
|||
on registerCheck.Id equals registerCheckItem.RegisterCheckId |
|||
join item in await _itemRepository.GetQueryableAsync() |
|||
on registerCheckItem.ItemId equals item.Id |
|||
where registerCheck.CheckRequestNo == input.CheckRequestNo |
|||
select new |
|||
{ |
|||
patientRegister, |
|||
registerCheck, |
|||
registerCheckItem, |
|||
item, |
|||
}).ToList(); |
|||
if (!list.Any()) |
|||
{ |
|||
return; |
|||
} |
|||
var firstEntity = list.First(); |
|||
|
|||
if (string.IsNullOrWhiteSpace(input.Result)) |
|||
{ |
|||
return; |
|||
} |
|||
if (string.IsNullOrWhiteSpace(input.CheckDoctorName)) |
|||
{ |
|||
throw new UserFriendlyException("检查医生不能为空"); |
|||
} |
|||
if (string.IsNullOrWhiteSpace(input.PatientName)) |
|||
{ |
|||
throw new UserFriendlyException("姓名不能为空"); |
|||
} |
|||
if (input.PatientName != firstEntity.patientRegister.PatientName) |
|||
{ |
|||
throw new UserFriendlyException($"Pacs姓名{input.PatientName}和体检系统姓名{firstEntity.patientRegister.PatientName}不一致"); |
|||
} |
|||
var updateCheckResultDto = new UpdateCheckResultDto() |
|||
{ |
|||
RegisterCheckId = firstEntity.registerCheck.Id, |
|||
CheckDoctorId = input.CheckDoctorName, |
|||
CheckDate = input.CheckDate, |
|||
ExecOrganizationUnitId = input.ExecOrganizationUnitId, |
|||
RegisterCheckItems = list |
|||
.Select(o => new UpdateRegisterCheckItemDetail() |
|||
{ |
|||
ItemId = o.registerCheckItem.ItemId, |
|||
Result = input.Result, |
|||
|
|||
}).ToList() |
|||
|
|||
}; |
|||
|
|||
|
|||
//生成小结
|
|||
updateCheckResultDto.Summarys.Add(new UpdateRegisterCheckSummaryDetail() |
|||
{ |
|||
Summary = input.Summary, |
|||
SummaryFlag = '0' |
|||
}); |
|||
//保存明细结果和小结
|
|||
await _registerCheckAppService.UpdateCheckResult(updateCheckResultDto); |
|||
//保存图片
|
|||
string absolutePath = _configuration.GetValue<string>("VirtualPath:RealPath"); |
|||
//删除以前的图片
|
|||
var registerCheckPictures = await _registerCheckPictureRepository.GetListAsync(o => o.RegisterCheckId == firstEntity.registerCheck.Id); |
|||
await _registerCheckPictureRepository.DeleteManyAsync(registerCheckPictures); |
|||
//插入新图片
|
|||
string pictureUrl; |
|||
foreach (var file in input.Files) |
|||
{ |
|||
string fileName; |
|||
if (string.IsNullOrWhiteSpace(file.FileName)) |
|||
{ |
|||
fileName = Guid.NewGuid().ToString(); |
|||
} |
|||
else |
|||
{ |
|||
fileName = Path.GetFileNameWithoutExtension(file.FileName); |
|||
} |
|||
|
|||
//0-图片,1-PDF
|
|||
if (file.FileFormat == "0") |
|||
{ |
|||
|
|||
pictureUrl = ImageHelper.Base64StrToImageInAbsolutePath(absolutePath, fileName, file.FileBase64, firstEntity.patientRegister.Id.ToString(), |
|||
firstEntity.registerCheck.Id.ToString()); |
|||
|
|||
} |
|||
else if (file.FileFormat == "1") |
|||
{ |
|||
byte[] pdfBytes = Convert.FromBase64String(file.FileBase64); |
|||
var tempFilePath = DirectoryHelper.GetAppDirectory() + "\\temp-files"; |
|||
if (!Directory.Exists(tempFilePath)) |
|||
{ |
|||
Directory.CreateDirectory(tempFilePath); |
|||
} |
|||
|
|||
string tempPdf = tempFilePath + "\\temp.pdf"; |
|||
using (System.IO.FileStream stream = new System.IO.FileStream(tempPdf, System.IO.FileMode.Create)) |
|||
{ |
|||
//通过流的方式写入
|
|||
using(System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream) ) |
|||
{ |
|||
writer.Write(pdfBytes, 0, pdfBytes.Length); |
|||
writer.Close(); |
|||
} |
|||
|
|||
} |
|||
PDFHelper.ConvertPdfToImage(tempPdf, tempFilePath ,"tempImage"); |
|||
|
|||
pictureUrl = ImageHelper.SavePacsFile(absolutePath, tempFilePath + "\\tempImage_0.jpg", firstEntity.patientRegister.Id.ToString(), |
|||
firstEntity.registerCheck.Id.ToString(), fileName); |
|||
} |
|||
else |
|||
{ |
|||
throw new UserFriendlyException("不支持的文件类型"); |
|||
} |
|||
|
|||
|
|||
|
|||
if (string.IsNullOrEmpty(pictureUrl)) |
|||
{ |
|||
throw new UserFriendlyException("pictureUrl是空值"); |
|||
} |
|||
var registerCheckPicture = new RegisterCheckPicture |
|||
{ |
|||
DisplayOrder = input.Files.IndexOf(file) + 1, |
|||
IsPrint = file.IsPrint, |
|||
PictureFilename = pictureUrl, |
|||
RegisterCheckId = firstEntity.registerCheck.Id, |
|||
}; |
|||
|
|||
await _registerCheckPictureRepository.InsertAsync(registerCheckPicture); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
using Spire.Pdf; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Drawing; |
|||
using System.Drawing.Imaging; |
|||
using System.IO; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Shentun.Utilities |
|||
{ |
|||
public class PDFHelper |
|||
{ |
|||
public static void ConvertPdfToImage(string? pdfFullPath, string? imageFilePath, string imageFileName) |
|||
{ |
|||
if (string.IsNullOrWhiteSpace(pdfFullPath)) |
|||
throw new ArgumentNullException(pdfFullPath); |
|||
if (string.IsNullOrWhiteSpace(imageFilePath)) |
|||
throw new ArgumentNullException(imageFilePath); |
|||
|
|||
if (!File.Exists(pdfFullPath)) |
|||
throw new FileNotFoundException(pdfFullPath); |
|||
var doc = new PdfDocument(); |
|||
doc.LoadFromFile(pdfFullPath); |
|||
var pageCount = doc.Pages.Count; |
|||
for (int i = 0; i < pageCount; i++) |
|||
{ |
|||
string jpgFullName = string.Empty; |
|||
|
|||
jpgFullName = imageFilePath + "\\" + imageFileName + $"_{i}" + ".jpg"; |
|||
using var stream = File.Open(jpgFullName, FileMode.Create); |
|||
using Image bmp = doc.SaveAsImage(i); |
|||
bmp.Save(stream, ImageFormat.Jpeg); |
|||
|
|||
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,83 @@ |
|||
using Shentun.Peis.ImportLisResults; |
|||
using Shentun.Peis.ImportPacsResults; |
|||
using Shentun.Peis.Models; |
|||
using Shentun.Utilities; |
|||
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 ImportPacsResultAppServiceTest : PeisApplicationTestBase |
|||
{ |
|||
private readonly IRepository<ImportPacsResult> _repository; |
|||
private readonly ImportPacsResultAppService _appService; |
|||
private readonly ITestOutputHelper _output; |
|||
private readonly IUnitOfWorkManager _unitOfWorkManager; |
|||
public ImportPacsResultAppServiceTest(ITestOutputHelper testOutputHelper) |
|||
{ |
|||
_output = testOutputHelper; |
|||
_unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>(); |
|||
_repository = GetRequiredService<IRepository<ImportPacsResult>>(); |
|||
_appService = GetRequiredService<ImportPacsResultAppService>(); |
|||
} |
|||
[Fact] |
|||
public async Task ImportResultAsync() |
|||
{ |
|||
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) |
|||
{ |
|||
|
|||
var entity = new CreateImportPacsResultDto() |
|||
{ |
|||
CheckRequestNo = "2405112185", |
|||
PatientName = "测试pacs", |
|||
Result = "Pacs检查所见", |
|||
Summary = "Pacs结论", |
|||
Suggestion = "Pacs建议", |
|||
CheckDate = DateTime.Now, |
|||
CheckDoctorName = "张医生", |
|||
Files = new List<CreateImportPacsResultPictureDto>() |
|||
{ |
|||
new CreateImportPacsResultPictureDto() |
|||
{ |
|||
IsPrint = 'Y', |
|||
FileName = Guid.NewGuid().ToString(), |
|||
FileFormat = "0", |
|||
FileBase64 = Shentun.Utilities.FileHelper.ToBase64("E:\\Whitedolphins\\prog20220722\\pic\\login.png") |
|||
}, |
|||
new CreateImportPacsResultPictureDto() |
|||
{ |
|||
IsPrint = 'Y', |
|||
FileFormat = "0", |
|||
FileName = Guid.NewGuid().ToString(), |
|||
FileBase64 = Shentun.Utilities.FileHelper.ToBase64("E:\\Whitedolphins\\prog20220722\\pic\\首页背景图.jpg") |
|||
}, |
|||
new CreateImportPacsResultPictureDto() |
|||
{ |
|||
IsPrint = 'Y', |
|||
FileFormat = "1", |
|||
FileName = Guid.NewGuid().ToString(), |
|||
FileBase64 = Shentun.Utilities.FileHelper.ToBase64("E:\\Whitedolphins\\doc\\体检中心排队系统.pdf") |
|||
}, |
|||
} |
|||
}; |
|||
|
|||
await _appService.ImportResultAsync(entity); |
|||
await unitOfWork.CompleteAsync(); |
|||
} |
|||
} |
|||
|
|||
|
|||
[Fact] |
|||
public void ConvertPdfToImage() |
|||
{ |
|||
PDFHelper.ConvertPdfToImage("E:\\Whitedolphins\\doc\\体检中心排队系统.pdf", "E:\\Whitedolphins\\prog20220722\\pic", "测试"); |
|||
} |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue