Browse Source

pacs

master
wxd 1 year ago
parent
commit
9ff1694366
  1. 28
      src/Shentun.Peis.Application.Contracts/PacsBusiness/ImportPacsDicomDataInputDto.cs
  2. 29
      src/Shentun.Peis.Application.Contracts/RegisterCheckPictures/UpdateRegisterCheckPictureInputDto.cs
  3. 49
      src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs
  4. 45
      src/Shentun.Peis.Application/RegisterCheckPictures/RegisterCheckPictureAppService.cs
  5. 4
      src/Shentun.Peis.DbMigrator/appsettings.json
  6. 6
      src/Shentun.Peis.Domain/RegisterCheckPacsPictures/RegisterCheckPacsPicture.cs
  7. 8
      src/Shentun.Peis.Domain/RegisterCheckPacss/RegisterCheckPacs.cs
  8. 15619
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240909023810_update_pacs_local_path_name.Designer.cs
  9. 37
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240909023810_update_pacs_local_path_name.cs
  10. 10
      src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
  11. 12
      src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs
  12. 9
      src/Shentun.Peis.HttpApi.Host/VirtualPath/MyFileProvider.cs
  13. 1
      src/Shentun.Peis.HttpApi.Host/appsettings.json

28
src/Shentun.Peis.Application.Contracts/PacsBusiness/ImportPacsDicomDataInputDto.cs

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.PacsBusiness
{
public class ImportPacsDicomDataInputDto
{
/// <summary>
/// 条码号
/// </summary>
public string RegisterCheckNo { get; set; }
/// <summary>
/// 资源集合
/// </summary>
public List<ImportPacsDicomDataInputDetailDto> Details { get; set; }
}
public class ImportPacsDicomDataInputDetailDto
{
/// <summary>
/// 文件路径 服务器上的绝对路径
/// </summary>
public string FilePathName { get; set; }
}
}

29
src/Shentun.Peis.Application.Contracts/RegisterCheckPictures/UpdateRegisterCheckPictureInputDto.cs

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.RegisterCheckPictures
{
public class UpdateRegisterCheckPictureInputDto
{
/// <summary>
/// 主键ID
/// </summary>
public Guid RegisterCheckPictureId { get; set; }
/// <summary>
/// 文件名称
/// </summary>
public string FileName { get; set; }
/// <summary>
/// 本地地址
/// </summary>
public string LocalPathName { get; set; }
/// <summary>
/// 图片base64字符串
/// </summary>
public string PictureBaseStr { get; set; }
}
}

49
src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs

@ -15,7 +15,7 @@ using Volo.Abp.Domain.Repositories;
namespace Shentun.Peis.PacsBusiness
{
/// <summary>
/// pacs相关接口
/// pacs相关接口 免登录
/// </summary>
[ApiExplorerSettings(GroupName = "Work")]
public class PacsBusinessAppService : ApplicationService
@ -25,17 +25,20 @@ namespace Shentun.Peis.PacsBusiness
private readonly IRepository<RegisterCheck, Guid> _registerCheckRepository;
private readonly IRepository<PatientRegister, Guid> _patientRegisterRepository;
private readonly IRepository<RegisterCheckPicture, Guid> _registerCheckPictureRepository;
private readonly IRepository<RegisterCheckPacs, Guid> _registerCheckPacsRepository;
public PacsBusinessAppService(
IConfiguration configuration,
IRepository<RegisterCheck, Guid> registerCheckRepository,
IRepository<PatientRegister, Guid> patientRegisterRepository,
IRepository<RegisterCheckPicture, Guid> registerCheckPictureRepository)
IRepository<RegisterCheckPicture, Guid> registerCheckPictureRepository,
IRepository<RegisterCheckPacs, Guid> registerCheckPacsRepository)
{
_configuration = configuration;
_registerCheckRepository = registerCheckRepository;
_patientRegisterRepository = patientRegisterRepository;
_registerCheckPictureRepository = registerCheckPictureRepository;
_registerCheckPacsRepository = registerCheckPacsRepository;
}
@ -127,5 +130,47 @@ namespace Shentun.Peis.PacsBusiness
}
}
/// <summary>
/// 导入pacs dicom数据
/// </summary>
/// <returns></returns>
[HttpPost("api/app/PacsBusiness/ImportPacsDicomData")]
public async Task ImportPacsDicomDataAsync(ImportPacsDicomDataInputDto input)
{
var realPath = _configuration["DicomVirtualPath:RealPath"];
var requestPath = _configuration["DicomVirtualPath:RequestPath"];
if (string.IsNullOrWhiteSpace(input.RegisterCheckNo))
throw new UserFriendlyException("条码号不能为空");
var registerCheckEnt = await _registerCheckRepository.FirstOrDefaultAsync(f => f.CheckRequestNo == input.RegisterCheckNo);
if (registerCheckEnt == null)
throw new UserFriendlyException("条码号不正确");
if (input.Details.Any())
{
List<RegisterCheckPacs> registerCheckPacss = new List<RegisterCheckPacs>();
foreach (var item in input.Details)
{
if (!item.FilePathName.Contains(realPath))
throw new UserFriendlyException("资源路径跟体检配置不一致");
var dicomPathName = item.FilePathName.Replace(realPath, requestPath);
registerCheckPacss.Add(new RegisterCheckPacs
{
CheckDesc = "",
CheckResult = "",
DicomPathName = dicomPathName,
DisplayOrder = input.Details.IndexOf(item) + 1,
LocalPathName = item.FilePathName,
RegisterCheckId = registerCheckEnt.Id
});
}
await _registerCheckPacsRepository.InsertManyAsync(registerCheckPacss);
}
}
}
}

45
src/Shentun.Peis.Application/RegisterCheckPictures/RegisterCheckPictureAppService.cs

@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.IdentityModel.Tokens;
using Shentun.Peis.Enums;
using Shentun.Peis.GuideTypes;
using Shentun.Peis.Models;
@ -555,5 +556,49 @@ namespace Shentun.Peis.RegisterCheckPictures
return msg;
}
/// <summary>
/// 修改图片内容
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/RegisterCheckPicture/UpdateRegisterCheckPicture")]
public async Task UpdateRegisterCheckPictureAsync(UpdateRegisterCheckPictureInputDto input)
{
var registerCheckPictureEnt = await _registerCheckPictureRepository.FirstOrDefaultAsync(f => f.Id == input.RegisterCheckPictureId);
if (registerCheckPictureEnt == null)
throw new UserFriendlyException("RegisterCheckPictureId不正确");
if (string.IsNullOrWhiteSpace(input.PictureBaseStr))
{
throw new UserFriendlyException("图片数据有误");
}
string AbsolutePath = _configuration.GetValue<string>("VirtualPath:RealPath");
string AbsoluteName = _configuration.GetValue<string>("VirtualPath:Alias");
var registerCheckEnt = await _registerCheckRepository.FirstOrDefaultAsync(f => f.Id == registerCheckPictureEnt.RegisterCheckId);
if (registerCheckEnt == null)
throw new UserFriendlyException("检查数据不存在");
string PictureUrl = ImageHelper.Base64StrToImageInAbsolutePath(AbsolutePath, input.FileName, input.PictureBaseStr,
registerCheckEnt.PatientRegisterId.ToString(),
registerCheckEnt.Id.ToString(), AbsoluteName);
if (string.IsNullOrEmpty(PictureUrl))
{
throw new UserFriendlyException("图片资源不正确");
}
registerCheckPictureEnt.PictureFilename = PictureUrl;
if (!string.IsNullOrWhiteSpace(input.LocalPathName))
{
registerCheckPictureEnt.LocalPathName = input.LocalPathName;
}
await _registerCheckPictureRepository.UpdateAsync(registerCheckPictureEnt);
}
}
}

4
src/Shentun.Peis.DbMigrator/appsettings.json

@ -1,7 +1,7 @@
{
"ConnectionStrings": {
"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis240701;User ID=postgres;Password=shentun123;"
//"Default": "Host=192.168.2.67;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;"
//"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis240701;User ID=postgres;Password=shentun123;"
"Default": "Host=192.168.2.67;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;"
//"Default": "Host=localhost;Port=5432;Database=ShentunPeis1218;User ID=postgres;Password=wxd123;"
//"Default": "Host=10.1.12.140;Port=5432;Database=ShentunPeis0508;User ID=postgres;Password=st123;"
},

6
src/Shentun.Peis.Domain/RegisterCheckPacsPictures/RegisterCheckPacsPicture.cs

@ -36,6 +36,12 @@ namespace Shentun.Peis.Models
[StringLength(200)]
public string PicturePathName { get; set; }
/// <summary>
/// 本地资源路径
/// </summary>
[Column("local_path_name")]
[StringLength(200)]
public string LocalPathName { get; set; }
/// <summary>
/// 显示顺序

8
src/Shentun.Peis.Domain/RegisterCheckPacss/RegisterCheckPacs.cs

@ -37,6 +37,14 @@ namespace Shentun.Peis.Models
[StringLength(200)]
public string DicomPathName { get; set; }
/// <summary>
/// 本地资源路径
/// </summary>
[Column("local_path_name")]
[StringLength(200)]
public string LocalPathName { get; set; }
/// <summary>
/// 检查结果
/// </summary>

15619
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240909023810_update_pacs_local_path_name.Designer.cs
File diff suppressed because it is too large
View File

37
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240909023810_update_pacs_local_path_name.cs

@ -0,0 +1,37 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class update_pacs_local_path_name : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "local_path_name",
table: "register_check_pacs_picture",
type: "character varying(200)",
maxLength: 200,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "local_path_name",
table: "register_check_pacs",
type: "character varying(200)",
maxLength: 200,
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "local_path_name",
table: "register_check_pacs_picture");
migrationBuilder.DropColumn(
name: "local_path_name",
table: "register_check_pacs");
}
}
}

10
src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

@ -9050,6 +9050,11 @@ namespace Shentun.Peis.Migrations
.HasColumnType("uuid")
.HasColumnName("last_modifier_id");
b.Property<string>("LocalPathName")
.HasMaxLength(200)
.HasColumnType("character varying(200)")
.HasColumnName("local_path_name");
b.Property<Guid>("RegisterCheckId")
.HasColumnType("uuid")
.HasColumnName("register_check_id")
@ -9109,6 +9114,11 @@ namespace Shentun.Peis.Migrations
.HasColumnType("uuid")
.HasColumnName("last_modifier_id");
b.Property<string>("LocalPathName")
.HasMaxLength(200)
.HasColumnType("character varying(200)")
.HasColumnName("local_path_name");
b.Property<string>("PicturePathName")
.HasMaxLength(200)
.HasColumnType("character varying(200)")

12
src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs

@ -223,11 +223,11 @@ public class PeisHttpApiHostModule : AbpModule
//虚拟目录
context.Services.AddSingleton(new MyFileProvider(configuration["VirtualPath:RealPath"], configuration["VirtualPath:Alias"]));
////虚拟目录
//context.Services.AddSingleton(new MyFileProvider(configuration["VirtualPath:RealPath"], configuration["VirtualPath:Alias"]));
//Pacs虚拟目录
context.Services.AddSingleton(new MyFileProvider(configuration["PacsVirtualPath:RealPath"], configuration["PacsVirtualPath:Alias"]));
////Pacs虚拟目录
//context.Services.AddSingleton(new MyFileProvider(configuration["PacsVirtualPath:RealPath"], configuration["PacsVirtualPath:Alias"]));
/*
Configure<AbpAspNetCoreMvcOptions>(options =>
@ -498,7 +498,6 @@ public class PeisHttpApiHostModule : AbpModule
{
config.UsePostgreSqlStorage(configuration.GetConnectionString("Default"));
});
//context.Services.AddHangfireServer();
}
public override async void OnApplicationInitialization(ApplicationInitializationContext context)
{
@ -572,8 +571,7 @@ public class PeisHttpApiHostModule : AbpModule
RequestPath = "/UserSign"
});
//虚拟目录
app.UseStaticFiles(new StaticFileOptions
{

9
src/Shentun.Peis.HttpApi.Host/VirtualPath/MyFileProvider.cs

@ -8,14 +8,7 @@ namespace Shentun.Peis.VirtualPath
{
this.Alias = alias;
}
public MyFileProvider(
string root,
Microsoft.Extensions.FileProviders.Physical.ExclusionFilters filters,
string alias) : base(root, filters)
{
this.Alias = alias;
}
/// <summary>
/// 别名

1
src/Shentun.Peis.HttpApi.Host/appsettings.json

@ -1,6 +1,5 @@
{
"App": {
//"SelfUrl": "http://10.1.12.140:9529",
"SelfUrl": "http://localhost:9530",
"ClientUrl": "http://localhost:9530",
"CorsOrigins": "https://*.Peis.com,http://localhost:4200,http://localhost:9530,http://192.168.1.108:9530,http://localhost:8080,http://localhost:8081",

Loading…
Cancel
Save