Browse Source

worklist

master
wxd 1 year ago
parent
commit
16a63a9bf6
  1. 2
      src/Shentun.Peis.Application.Contracts/PacsBusiness/GetPatientRegisterByCheckRequestNoDto.cs
  2. 2
      src/Shentun.Peis.Application.Contracts/Worklists/CreateRegisterCheckWorklistInputDto.cs
  3. 39
      src/Shentun.Peis.Application.Contracts/Worklists/GetWorklistPatientListDto.cs
  4. 26
      src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs
  5. 124
      src/Shentun.Peis.Application/Worklists/WorklistAppService.cs
  6. 4
      src/Shentun.Peis.DbMigrator/appsettings.json

2
src/Shentun.Peis.Application.Contracts/PacsBusiness/GetPatientRegisterByCheckRequestNoDto.cs

@ -13,5 +13,7 @@ namespace Shentun.Peis.PacsBusiness
public string PatientSex { get; set; }
public string PatientAge { get; set; }
public string HospitalName { get; set; }
}
}

2
src/Shentun.Peis.Application.Contracts/Worklists/CreateRegisterCheckWorklistInputDto.cs

@ -9,7 +9,7 @@ namespace Shentun.Peis.Worklists
/// <summary>
/// 预检Aet
/// </summary>
public string ScheduledAET { get; set; }
public string ScheduledAet { get; set; }
/// <summary>
/// 检查条码

39
src/Shentun.Peis.Application.Contracts/Worklists/GetWorklistPatientListDto.cs

@ -6,59 +6,62 @@ namespace Shentun.Peis.Worklists
{
public class GetWorklistPatientListDto
{
public string AccessionNumber { get; set; } = string.Empty;
public string AccessionNumber { get; set; }
/// <summary>
/// 检查条码号
/// </summary>
public string PatientID { get; set; } = string.Empty;
public string PatientID { get; set; }
public string Surname { get; set; } = string.Empty;
public string Surname { get; set; }
/// <summary>
/// 姓名
/// </summary>
public string Forename { get; set; } = string.Empty;
public string Forename { get; set; }
public string Title { get; set; } = string.Empty;
public string Title { get; set; }
/// <summary>
/// 性别
/// </summary>
public string Sex { get; set; } = string.Empty;
public string Sex { get; set; }
/// <summary>
/// 出生日期
/// </summary>
public DateTime DateOfBirth { get; set; } = DateTime.Now;
public DateTime DateOfBirth { get; set; }
public string ReferringPhysician { get; set; } = string.Empty;
public string ReferringPhysician { get; set; }
public string PerformingPhysician { get; set; } = string.Empty;
public string PerformingPhysician { get; set; }
public string Modality { get; set; } = string.Empty;
/// <summary>
/// 设备类型
/// </summary>
public string Modality { get; set; }
/// <summary>
/// 扫码日期
/// </summary>
public DateTime ExamDateAndTime { get; set; } = DateTime.Now;
public DateTime ExamDateAndTime { get; set; }
public string ExamRoom { get; set; } = string.Empty;
public string ExamRoom { get; set; }
public string ExamDescription { get; set; } = string.Empty;
public string ExamDescription { get; set; }
public string StudyUID { get; set; } = string.Empty;
public string StudyUID { get; set; }
public string ProcedureID { get; set; } = string.Empty;
public string ProcedureID { get; set; }
public string ProcedureStepID { get; set; } = string.Empty;
public string ProcedureStepID { get; set; }
public string HospitalName { get; set; } = string.Empty;
public string HospitalName { get; set; }
/// <summary>
/// 预检Aet
/// </summary>
public string ScheduledAET { get; set; } = string.Empty;
public string ScheduledAET { get; set; }
}
}

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

@ -30,7 +30,6 @@ using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Users;
using static Volo.Abp.Identity.Settings.IdentitySettingNames;
namespace Shentun.Peis.PacsBusiness
{
@ -61,6 +60,7 @@ namespace Shentun.Peis.PacsBusiness
private readonly ILogger<PacsBusinessAppService> _logger;
private readonly IRepository<ItemType, Guid> _itemTypeRepository;
private readonly CustomerOrgManager _customerOrgManager;
private readonly IRepository<Volo.Abp.Identity.OrganizationUnit, Guid> _organizationUnitRepository;
public PacsBusinessAppService(
IConfiguration configuration,
IRepository<RegisterCheck, Guid> registerCheckRepository,
@ -81,7 +81,8 @@ namespace Shentun.Peis.PacsBusiness
IRepository<DicomFileDetail, Guid> dicomFileDetailRepository,
ILogger<PacsBusinessAppService> logger,
IRepository<ItemType, Guid> itemTypeRepository,
CustomerOrgManager customerOrgManager)
CustomerOrgManager customerOrgManager,
IRepository<Volo.Abp.Identity.OrganizationUnit, Guid> organizationUnitRepository)
{
_configuration = configuration;
_registerCheckRepository = registerCheckRepository;
@ -103,6 +104,7 @@ namespace Shentun.Peis.PacsBusiness
_logger = logger;
_itemTypeRepository = itemTypeRepository;
_customerOrgManager = customerOrgManager;
_organizationUnitRepository = organizationUnitRepository;
}
@ -717,10 +719,19 @@ namespace Shentun.Peis.PacsBusiness
{
throw new UserFriendlyException("检查条码不能为空");
}
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 patientRegister).FirstOrDefault();
select new
{
patientRegister,
medicalCenterName = organizationUnitHaveEmpty != null ? organizationUnitHaveEmpty.DisplayName : ""
}).FirstOrDefault();
if (patientRegisterEnt == null)
{
@ -729,10 +740,11 @@ namespace Shentun.Peis.PacsBusiness
var entDto = new GetPatientRegisterByCheckRequestNoDto
{
PatientAge = patientRegisterEnt.Age == null ? "" : patientRegisterEnt.Age.ToString(),
PatientBirthDate = patientRegisterEnt.BirthDate == null ? "" : DataHelper.ConversionDateShortNoSymbolToString(patientRegisterEnt.BirthDate),
PatientName = patientRegisterEnt.PatientName,
PatientSex = patientRegisterEnt.SexId.ToString()
PatientAge = patientRegisterEnt.patientRegister.Age == null ? "" : patientRegisterEnt.patientRegister.Age.ToString(),
PatientBirthDate = patientRegisterEnt.patientRegister.BirthDate == null ? "" : DataHelper.ConversionDateShortNoSymbolToString(patientRegisterEnt.patientRegister.BirthDate),
PatientName = patientRegisterEnt.patientRegister.PatientName,
PatientSex = patientRegisterEnt.patientRegister.SexId.ToString(),
HospitalName = patientRegisterEnt.medicalCenterName
};
return entDto;

124
src/Shentun.Peis.Application/Worklists/WorklistAppService.cs

@ -1,11 +1,14 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Shentun.Peis.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
namespace Shentun.Peis.Worklists
{
@ -13,9 +16,25 @@ namespace Shentun.Peis.Worklists
[Authorize]
public class WorklistAppService : ApplicationService
{
public WorklistAppService()
{
private readonly IRepository<RegisterCheck, Guid> _registerCheckRepository;
private readonly IRepository<RegisterCheckAsbitem, Guid> _registerCheckAsbitemRepository;
private readonly IRepository<Asbitem, Guid> _asbitemRepository;
private readonly IRepository<DeviceType, Guid> _deviceTypeRepository;
private readonly IRepository<PatientRegister, Guid> _patientRegisterRepository;
public WorklistAppService(
IRepository<RegisterCheck, Guid> registerCheckRepository,
IRepository<RegisterCheckAsbitem, Guid> registerCheckAsbitemRepository,
IRepository<Asbitem, Guid> asbitemRepository,
IRepository<DeviceType, Guid> deviceTypeRepository,
IRepository<PatientRegister, Guid> patientRegisterRepository)
{
_registerCheckRepository = registerCheckRepository;
_registerCheckAsbitemRepository = registerCheckAsbitemRepository;
_asbitemRepository = asbitemRepository;
_deviceTypeRepository = deviceTypeRepository;
_patientRegisterRepository = patientRegisterRepository;
}
/// <summary>
@ -23,9 +42,66 @@ namespace Shentun.Peis.Worklists
/// </summary>
/// <returns></returns>
[HttpPost("api/app/Worklist/GetWorklistPatientList")]
[AllowAnonymous]
public async Task<List<GetWorklistPatientListDto>> GetWorklistPatientListAsync(GetWorklistPatientListInputDto input)
{
return new List<GetWorklistPatientListDto>();
if (string.IsNullOrWhiteSpace(input.ScheduledAet))
{
throw new UserFriendlyException("预检AET不能为空");
}
if (string.IsNullOrWhiteSpace(input.Modality))
{
throw new UserFriendlyException("设备类型不能为空");
}
if (string.IsNullOrWhiteSpace(input.StartDate) || string.IsNullOrWhiteSpace(input.EndDate))
{
throw new UserFriendlyException("日期不能为空");
}
var queryList = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
join registerCheck in await _registerCheckRepository.GetQueryableAsync() on patientRegister.Id equals registerCheck.PatientRegisterId
join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync() on registerCheck.Id equals registerCheckAsbitem.RegisterCheckId
join asbitem in await _asbitemRepository.GetQueryableAsync() on registerCheckAsbitem.AsbitemId equals asbitem.Id
join deviceType in await _deviceTypeRepository.GetQueryableAsync() on asbitem.DeviceTypeId equals deviceType.Id
where registerCheck.ScheduledAet == input.ScheduledAet
&& registerCheck.WorklistPreCheckDate != null
&& registerCheck.WorklistPreCheckDate >= Convert.ToDateTime(input.StartDate)
&& registerCheck.WorklistPreCheckDate < Convert.ToDateTime(input.EndDate).AddDays(1)
&& deviceType.DisplayName == input.Modality
select new
{
patientRegister,
registerCheck,
deviceType
}).ToList();
var entListDto = queryList.Select(s => new GetWorklistPatientListDto
{
DateOfBirth = s.patientRegister.BirthDate != null ? s.patientRegister.BirthDate.Value : DateTime.Now,
ExamDateAndTime = s.registerCheck.WorklistPreCheckDate != null ? s.registerCheck.WorklistPreCheckDate.Value : DateTime.Now,
Modality = s.deviceType.DisplayName,
PatientID = s.registerCheck.CheckRequestNo,
Forename = s.patientRegister.PatientName,
ScheduledAET = s.registerCheck.ScheduledAet,
Sex = s.patientRegister.SexId.ToString(),
AccessionNumber = "",
Surname = "",
ExamDescription = "",
ExamRoom = "",
HospitalName = "",
PerformingPhysician = "",
ProcedureID = "",
ProcedureStepID = "",
ReferringPhysician = "",
StudyUID = "",
Title = ""
}).ToList();
return entListDto;
}
@ -36,7 +112,47 @@ namespace Shentun.Peis.Worklists
[HttpPost("api/app/Worklist/CreateRegisterCheckWorklist")]
public async Task CreateRegisterCheckWorklistAsync(CreateRegisterCheckWorklistInputDto input)
{
if (string.IsNullOrWhiteSpace(input.ScheduledAet))
{
throw new UserFriendlyException("预检AET不能为空");
}
if (string.IsNullOrWhiteSpace(input.CheckRequestNo))
{
throw new UserFriendlyException("检查条码不能为空");
}
var queryList = (from registerCheck in await _registerCheckRepository.GetQueryableAsync()
join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync() on registerCheck.Id equals registerCheckAsbitem.RegisterCheckId
join asbitem in await _asbitemRepository.GetQueryableAsync() on registerCheckAsbitem.AsbitemId equals asbitem.Id
where registerCheck.CheckRequestNo == input.CheckRequestNo
select new
{
registerCheck,
asbitem
}).ToList();
if (!queryList.Any())
{
throw new UserFriendlyException("条码号不正确");
}
foreach (var item in queryList)
{
if (item.asbitem.DeviceTypeId == null || item.asbitem.DeviceTypeId == Guid.Empty)
{
throw new UserFriendlyException($"组合项目:{item.asbitem.DisplayName}未配置仪器类别");
}
}
var registerCheckEnt = queryList.Select(s => s.registerCheck).FirstOrDefault();
registerCheckEnt.WorklistFlag = '1';
registerCheckEnt.WorklistPreCheckDate = DateTime.Now;
registerCheckEnt.ScheduledAet = input.ScheduledAet;
await _registerCheckRepository.UpdateAsync(registerCheckEnt);
}
}
}

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;"
},

Loading…
Cancel
Save