Browse Source

发送结果增加审核医生

master
wxd 7 months ago
parent
commit
9819c3b135
  1. 26
      src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetPacsPatientRegisterWithDicomIsExistDto.cs
  2. 19
      src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetPacsPatientRegisterWithDicomIsExistInputDto.cs
  3. 5
      src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetPatientRegisterPacsCheckDto.cs
  4. 6
      src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetPatientRegisterPacsCheckInputDto.cs
  5. 76
      src/Shentun.Pacs.Application.Contracts/PacsBusiness/ImportDicomServiceDataWithIsSignInInputDto.cs
  6. 19
      src/Shentun.Pacs.Application.Contracts/PacsBusiness/UpdateRegisterCheckRemarkInputDto.cs
  7. 216
      src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs
  8. 7
      src/Shentun.Pacs.Domain/RegisterChecks/RegisterCheck.cs
  9. 3
      src/Shentun.Pacs.EntityFrameworkCore/DbMapping/RegisterChecks/RegisterCheckDbMapping.cs
  10. 16305
      src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250401080639_register_check_add_is_send.Designer.cs
  11. 27
      src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250401080639_register_check_add_is_send.cs
  12. 7
      src/Shentun.Pacs.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

26
src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetPacsPatientRegisterWithDicomIsExistDto.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Pacs.PacsBusiness
{
public class GetPacsPatientRegisterWithDicomIsExistDto
{
public string PatientName { get; set; }
public string PatientNameEng { get; set; }
public string PatientBirthDate { get; set; }
public string PatientSex { get; set; }
public string PatientAge { get; set; }
public string HospitalName { get; set; }
/// <summary>
/// 是否存储 Y N
/// </summary>
public char IsExistDicom { get; set; }
}
}

19
src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetPacsPatientRegisterWithDicomIsExistInputDto.cs

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Pacs.PacsBusiness
{
public class GetPacsPatientRegisterWithDicomIsExistInputDto
{
/// <summary>
/// 条码号
/// </summary>
public string CheckRequestNo { get; set; }
/// <summary>
/// 实例ID
/// </summary>
public string InstanceId { get; set; }
}
}

5
src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetPatientRegisterPacsCheckDto.cs

@ -60,5 +60,10 @@ namespace Shentun.Pacs.PacsBusiness
/// 体检类型名称
/// </summary>
public string MedicalTypeName { get; set; }
/// <summary>
/// 是否发送结果到体检系统 Y N
/// </summary>
public char IsSend { get; set; }
}
}

6
src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetPatientRegisterPacsCheckInputDto.cs

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
namespace Shentun.Pacs.PacsBusiness
@ -59,5 +60,10 @@ namespace Shentun.Pacs.PacsBusiness
/// </summary>
public string CheckDoctorId { get; set; }
/// <summary>
/// 是否发送结果到体检系统
/// </summary>
public char? IsSend { get; set; }
}
}

76
src/Shentun.Pacs.Application.Contracts/PacsBusiness/ImportDicomServiceDataWithIsSignInInputDto.cs

@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Pacs.PacsBusiness
{
public class ImportDicomServiceDataWithIsSignInInputDto
{
/// <summary>
/// 条码号
/// </summary>
public string CheckRequestNo { get; set; }
/// <summary>
/// 预检AET
/// </summary>
public string ScheduledAet { get; set; }
/// <summary>
/// 设备类型
/// </summary>
public string Modality { get; set; }
/// <summary>
/// 实例ID
/// </summary>
public string InstanceId { get; set; }
/// <summary>
/// 患者ID
/// </summary>
public string ParentPatientId { get; set; }
/// <summary>
/// 系列ID
/// </summary>
public string ParentSeriesId { get; set; }
/// <summary>
/// 研究ID
/// </summary>
public string ParentStudyId { get; set; }
/// <summary>
/// 路径
/// </summary>
public string Path { get; set; }
/// <summary>
/// 文件名称
/// </summary>
public string FileName { get; set; }
/// <summary>
/// 状态
/// </summary>
public string Status { get; set; }
/// <summary>
/// 检查日期
/// </summary>
public string PacsCheckDate { get; set; }
/// <summary>
/// 上传日期
/// </summary>
public string PacsUploadDate { get; set; }
/// <summary>
/// 是否检查 Y N 默认为Y
/// </summary>
public char IsPacsCheck { get; set; } = 'Y';
}
}

19
src/Shentun.Pacs.Application.Contracts/PacsBusiness/UpdateRegisterCheckRemarkInputDto.cs

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Pacs.PacsBusiness
{
public class UpdateRegisterCheckRemarkInputDto
{
/// <summary>
/// 检查id
/// </summary>
public Guid RegisterCheckId { get; set; }
/// <summary>
/// 项目备注
/// </summary>
public string Remark { get; set; }
}
}

216
src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs

@ -467,7 +467,8 @@ namespace Shentun.Pacs.PacsBusiness
medicalTypeId = patientRegister.MedicalTypeId,
encodingFlag = deviceHaveEmpty == null ? '0' : deviceHaveEmpty.EncodingFlag,
isFilmRelease = asbitem.IsFilmRelease,
checkDoctorId = registerCheck.CheckDoctorId
checkDoctorId = registerCheck.CheckDoctorId,
isSend = registerCheck.IsSend
};
if (!string.IsNullOrWhiteSpace(input.PatientName))
@ -542,6 +543,12 @@ namespace Shentun.Pacs.PacsBusiness
{
query = query.Where(m => m.checkDoctorId == input.CheckDoctorId);
}
if (input.IsSend != null)
{
query = query.Where(m => m.isSend == input.IsSend);
}
//#region 增加项目类别权限
//string AdminId = _configuration.GetValue<string>("AdminId");
@ -605,7 +612,8 @@ namespace Shentun.Pacs.PacsBusiness
PacsDesc = pacsDesc,
MedicalTypeName = _cacheService.GetMedicalTypeNameAsync(fisrtItem.medicalTypeId).GetAwaiter().GetResult(),
CheckDoctorId = fisrtItem.checkDoctorId,
CheckDoctorName = _cacheService.GetSurnameAsync(fisrtItem.checkDoctorId).GetAwaiter().GetResult()
CheckDoctorName = _cacheService.GetSurnameAsync(fisrtItem.checkDoctorId).GetAwaiter().GetResult(),
IsSend = fisrtItem.isSend
});
}
@ -1769,7 +1777,12 @@ namespace Shentun.Pacs.PacsBusiness
checkDoctorName = checkDoctorId;
}
}
string auditDoctorName = "";
if (_currentUser.Id != null)
{
auditDoctorName = await _cacheService.GetSurnameAsync(_currentUser.Id);
}
//小结
string summary = "";
@ -1780,14 +1793,18 @@ namespace Shentun.Pacs.PacsBusiness
}
await oldDb.Ado.ExecuteCommandAsync("update register_asbitem set summary=@summary,complete_flag=@complete_flag," +
"check_doctor=@check_doctor,check_date=@check_date where patient_register_id=@patient_register_id and asbitem_id=@asbitem_id ",
"check_doctor=@check_doctor,check_date=@check_date,audit_flag=@audit_flag,audit_doctor=@audit_doctor,audit_date=@audit_date" +
" where patient_register_id=@patient_register_id and asbitem_id=@asbitem_id ",
new List<SugarParameter>() {
new SugarParameter("patient_register_id",registerCheckFirst.registerCheckAsbitem.OldPatientRegisterId),
new SugarParameter("asbitem_id",registerCheckFirst.registerCheckAsbitem.OldAsbitemId),
new SugarParameter("summary",summary),
new SugarParameter("complete_flag",registerCheckFirst.registerCheck.CompleteFlag),
new SugarParameter("check_doctor",checkDoctorName),
new SugarParameter("check_date",registerCheckFirst.registerCheck.CheckDate)
new SugarParameter("check_date",registerCheckFirst.registerCheck.CheckDate),
new SugarParameter("audit_flag",'Y'),
new SugarParameter("audit_doctor",auditDoctorName),
new SugarParameter("audit_date",DateTime.Now)
});
#endregion
@ -1840,7 +1857,9 @@ namespace Shentun.Pacs.PacsBusiness
await uow.CompleteAsync();
}
//更新发送状态
registerCheckFirst.registerCheck.IsSend = 'Y';
await _registerCheckRepository.UpdateAsync(registerCheckFirst.registerCheck);
}
@ -1897,6 +1916,193 @@ namespace Shentun.Pacs.PacsBusiness
}
/// <summary>
/// 单独更新项目备注
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/PacsBusiness/UpdateRegisterCheckRemark")]
public async Task UpdateRegisterCheckRemarkAsync(UpdateRegisterCheckRemarkInputDto input)
{
var registerCheckEnt = await _registerCheckRepository.FirstOrDefaultAsync(f => f.Id == input.RegisterCheckId);
if (registerCheckEnt == null)
{
throw new UserFriendlyException("检查id不正确");
}
registerCheckEnt.Remark = input.Remark;
await _registerCheckRepository.UpdateAsync(registerCheckEnt);
}
#endregion
#region 新接口20250403
/// <summary>
/// 根据检查条码跟InstanceId获取人员信息、是否存在dicom数据记录
/// </summary>
/// <returns></returns>
[HttpPost("api/app/PacsBusiness/GetPacsPatientRegisterWithDicomIsExist")]
public async Task<GetPacsPatientRegisterWithDicomIsExistDto> GetPacsPatientRegisterWithDicomIsExistAsync(GetPacsPatientRegisterWithDicomIsExistInputDto input)
{
var result = new GetPacsPatientRegisterWithDicomIsExistDto();
if (string.IsNullOrWhiteSpace(input.CheckRequestNo))
{
throw new UserFriendlyException("检查条码不能为空");
}
if (string.IsNullOrWhiteSpace(input.InstanceId))
{
throw new UserFriendlyException("实例ID不能为空");
}
var isExistDicomQuery = (from dicomFileDetail in await _dicomFileDetailRepository.GetQueryableAsync()
join registerCheck in await _registerCheckRepository.GetQueryableAsync() on dicomFileDetail.RegisterCheckId equals registerCheck.Id
where registerCheck.CheckRequestNo == input.CheckRequestNo && dicomFileDetail.InstanceId == input.InstanceId
select registerCheck.CheckRequestNo).Count();
result.IsExistDicom = isExistDicomQuery > 0 ? 'Y' : 'N';
var patientRegisterEnt = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
join registerCheck in await _registerCheckRepository.GetQueryableAsync() on patientRegister.Id equals registerCheck.PatientRegisterId
join organizationUnit in await _organizationUnitRepository.GetQueryableAsync()
on patientRegister.MedicalCenterId equals organizationUnit.Id into organizationUnitTemp
from organizationUnitHaveEmpty in organizationUnitTemp.DefaultIfEmpty()
where registerCheck.CheckRequestNo == input.CheckRequestNo
select new
{
patientRegister,
medicalCenterName = organizationUnitHaveEmpty != null ? organizationUnitHaveEmpty.DisplayName : ""
}).FirstOrDefault();
if (patientRegisterEnt == null)
{
throw new UserFriendlyException("检查条码不存在");
}
string medicalCenterName = await _sysParmValueManager.GetSysParmValueAsync(Guid.Empty, "medical_center_name");
result.PatientAge = patientRegisterEnt.patientRegister.Age == null ? "" : patientRegisterEnt.patientRegister.Age.ToString();
result.PatientBirthDate = patientRegisterEnt.patientRegister.BirthDate == null ? "" : DataHelper.ConversionDateShortNoSymbolToString(patientRegisterEnt.patientRegister.BirthDate);
result.PatientName = patientRegisterEnt.patientRegister.PatientName;
result.PatientSex = patientRegisterEnt.patientRegister.SexId.ToString();
result.HospitalName = medicalCenterName;
result.PatientNameEng = LanguageConverter.GetPYAllName(patientRegisterEnt.patientRegister.PatientName);
return result;
}
/// <summary>
/// 导入dicom数据、更新worklist签收状态
/// </summary>
/// <returns></returns>
[HttpPost("api/app/PacsBusiness/ImportDicomServiceDataWithIsSignIn")]
public async Task ImportDicomServiceDataWithIsSignInAsync(ImportDicomServiceDataWithIsSignInInputDto input)
{
if (string.IsNullOrWhiteSpace(input.CheckRequestNo))
throw new UserFriendlyException("条码号不能为空");
if (string.IsNullOrWhiteSpace(input.ScheduledAet))
throw new UserFriendlyException("预检AET不能为空");
if (string.IsNullOrWhiteSpace(input.Modality))
throw new UserFriendlyException("设备类型不能为空");
if (string.IsNullOrWhiteSpace(input.InstanceId))
throw new UserFriendlyException("InstanceId不正确");
if (string.IsNullOrWhiteSpace(input.ParentStudyId))
throw new UserFriendlyException("ParentStudyId不正确");
if (string.IsNullOrWhiteSpace(input.ParentPatientId))
throw new UserFriendlyException("ParentPatientId不正确");
if (string.IsNullOrWhiteSpace(input.ParentSeriesId))
throw new UserFriendlyException("ParentSeriesId不正确");
if (string.IsNullOrWhiteSpace(input.Status))
throw new UserFriendlyException("状态不能为空");
if (string.IsNullOrWhiteSpace(input.Path))
throw new UserFriendlyException("路径不能为空");
if (string.IsNullOrWhiteSpace(input.FileName))
throw new UserFriendlyException("文件名称不能为空");
var registerCheckList = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
join registerCheck in await _registerCheckRepository.GetQueryableAsync() on patientRegister.Id equals registerCheck.PatientRegisterId
join device in await _deviceRepository.GetQueryableAsync() on patientRegister.DeviceId equals device.Id
join deviceType in await _deviceTypeRepository.GetQueryableAsync() on device.DeviceTypeId equals deviceType.Id
where registerCheck.CheckRequestNo == input.CheckRequestNo
&& registerCheck.ScheduledAet == input.ScheduledAet
&& (deviceType.DisplayName == input.Modality || deviceType.Alias.Contains(input.Modality))
select registerCheck).ToList();
if (!registerCheckList.Any())
throw new UserFriendlyException("条码号不正确");
var dicomFileDetailEnt = await _dicomFileDetailRepository.FirstOrDefaultAsync(f => f.InstanceId == input.InstanceId);
if (dicomFileDetailEnt == null)
{
foreach (var item in registerCheckList)
{
dicomFileDetailEnt = new DicomFileDetail
{
DisplayOrder = registerCheckList.IndexOf(item) + 1,
RegisterCheckId = item.Id,
FileName = input.FileName,
InstanceId = input.InstanceId,
ParentPatientId = input.ParentPatientId,
ParentSeriesId = input.ParentSeriesId,
ParentStudyId = input.ParentStudyId,
Path = input.Path,
Status = input.Status
};
await _dicomFileDetailRepository.InsertAsync(dicomFileDetailEnt);
}
}
foreach (var item in registerCheckList)
{
bool isUpdate = false;
if (item.IsPacsCheck != 'Y')
{
item.IsPacsCheck = input.IsPacsCheck;
item.PacsCheckDate = Convert.ToDateTime(input.PacsCheckDate);
item.PacsUploadDate = DateTime.Now;
isUpdate = true;
}
if (item.IsSignIn != 'Y')
{
item.IsSignIn = 'Y';
item.SignInTime = DateTime.Now;
isUpdate = true;
}
if (isUpdate)
{
await _registerCheckRepository.UpdateAsync(item);
}
}
}
#endregion

7
src/Shentun.Pacs.Domain/RegisterChecks/RegisterCheck.cs

@ -328,6 +328,13 @@ namespace Shentun.Pacs.Models
[Column("remark")]
public string Remark { get; set; }
/// <summary>
/// 是否发送结果到体检系统
/// </summary>
[Column("is_send")]
public char IsSend { get; set; }
[Column("concurrency_stamp")]
public string ConcurrencyStamp { get; set; }

3
src/Shentun.Pacs.EntityFrameworkCore/DbMapping/RegisterChecks/RegisterCheckDbMapping.cs

@ -41,7 +41,10 @@ namespace Shentun.Pacs.DbMapping
entity.Property(t => t.WorklistFlag).HasComment("Worklist标记(0-默认值,1-已扫码登记,2-设备已获取数据,预留设计)").HasDefaultValueSql("'0'");
entity.Property(t => t.ScheduledAet).HasComment("预检AET");
entity.Property(t => t.Remark).HasComment("备注");
entity.Property(t => t.IsSend).HasComment("是否发送结果到体检系统").IsRequired().HasDefaultValueSql("'N'");
entity.Property(e => e.Id).ValueGeneratedNever();
//entity.Property(e => e.LastModificationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");

16305
src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250401080639_register_check_add_is_send.Designer.cs
File diff suppressed because it is too large
View File

27
src/Shentun.Pacs.EntityFrameworkCore/Migrations/20250401080639_register_check_add_is_send.cs

@ -0,0 +1,27 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Pacs.Migrations
{
public partial class register_check_add_is_send : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<char>(
name: "is_send",
table: "register_check",
type: "character(1)",
nullable: false,
defaultValueSql: "'N'",
comment: "是否发送结果到体检系统");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "is_send",
table: "register_check");
}
}
}

7
src/Shentun.Pacs.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

@ -8929,6 +8929,13 @@ namespace Shentun.Pacs.Migrations
.HasColumnType("character(1)")
.HasColumnName("is_review");
b.Property<char>("IsSend")
.ValueGeneratedOnAdd()
.HasColumnType("character(1)")
.HasColumnName("is_send")
.HasDefaultValueSql("'N'")
.HasComment("是否发送结果到体检系统");
b.Property<char>("IsSignIn")
.ValueGeneratedOnAdd()
.HasMaxLength(1)

Loading…
Cancel
Save