|
|
|
@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using NPOI.POIFS.Properties; |
|
|
|
using NPOI.POIFS.Storage; |
|
|
|
using NPOI.SS.Formula.Functions; |
|
|
|
using NPOI.Util; |
|
|
|
@ -13,6 +14,7 @@ using Shentun.Pacs.Devices; |
|
|
|
using Shentun.Pacs.Enums; |
|
|
|
using Shentun.Pacs.Migrations; |
|
|
|
using Shentun.Pacs.Models; |
|
|
|
using Shentun.Pacs.OrganizationUnits; |
|
|
|
using Shentun.Pacs.PatientRegisters; |
|
|
|
using Shentun.Pacs.Patients; |
|
|
|
using Shentun.Pacs.PrintReports; |
|
|
|
@ -84,6 +86,7 @@ namespace Shentun.Pacs.PacsBusiness |
|
|
|
private readonly IRepository<RegisterCheckSummary, Guid> _registerCheckSummaryRepository; |
|
|
|
private readonly SysParmValueManager _sysParmValueManager; |
|
|
|
private readonly IRepository<Item, Guid> _itemRepository; |
|
|
|
private readonly PeisOrganizationUnitManager _peisOrganizationUnitManager; |
|
|
|
|
|
|
|
private readonly SqlSugarClient oldDb; |
|
|
|
|
|
|
|
@ -121,7 +124,8 @@ namespace Shentun.Pacs.PacsBusiness |
|
|
|
UnitOfWorkManager unitOfWorkManager, |
|
|
|
IRepository<RegisterCheckSummary, Guid> registerCheckSummaryRepository, |
|
|
|
SysParmValueManager sysParmValueManager, |
|
|
|
IRepository<Item, Guid> itemRepository) |
|
|
|
IRepository<Item, Guid> itemRepository, |
|
|
|
PeisOrganizationUnitManager peisOrganizationUnitManager) |
|
|
|
{ |
|
|
|
_configuration = configuration; |
|
|
|
_registerCheckRepository = registerCheckRepository; |
|
|
|
@ -156,7 +160,7 @@ namespace Shentun.Pacs.PacsBusiness |
|
|
|
_registerCheckSummaryRepository = registerCheckSummaryRepository; |
|
|
|
_sysParmValueManager = sysParmValueManager; |
|
|
|
_itemRepository = itemRepository; |
|
|
|
|
|
|
|
_peisOrganizationUnitManager = peisOrganizationUnitManager; |
|
|
|
|
|
|
|
oldDb = new SqlSugarClient(new ConnectionConfig() |
|
|
|
{ |
|
|
|
@ -165,8 +169,6 @@ namespace Shentun.Pacs.PacsBusiness |
|
|
|
IsAutoCloseConnection = true |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -518,7 +520,8 @@ namespace Shentun.Pacs.PacsBusiness |
|
|
|
idNo = patient.IdNo, |
|
|
|
age = patientRegister.Age, |
|
|
|
mobileTelephone = patient.MobileTelephone, |
|
|
|
auditorUserName = _cacheService.GetSurnameAsync(registerCheck.AuditorUserId).GetAwaiter().GetResult() |
|
|
|
auditorUserName = _cacheService.GetSurnameAsync(registerCheck.AuditorUserId).GetAwaiter().GetResult(), |
|
|
|
auditTime = registerCheck.AuditTime |
|
|
|
}; |
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(input.PatientName)) |
|
|
|
@ -683,7 +686,8 @@ namespace Shentun.Pacs.PacsBusiness |
|
|
|
IdNo = fisrtItem.idNo, |
|
|
|
OldPatientNo = fisrtItem.oldPatientNo, |
|
|
|
CustomerOrgName = fisrtItem.customerOrgName, |
|
|
|
MobileTelephone = fisrtItem.mobileTelephone |
|
|
|
MobileTelephone = fisrtItem.mobileTelephone, |
|
|
|
AuditTime = DataHelper.ConversionDateToString(fisrtItem.auditTime) |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1290,7 +1294,7 @@ namespace Shentun.Pacs.PacsBusiness |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 导入老系统人员、项目数据,并自动加入worklist
|
|
|
|
/// 导入老系统人员、项目数据,并自动加入worklist 老红豚
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="input"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
@ -1340,7 +1344,15 @@ namespace Shentun.Pacs.PacsBusiness |
|
|
|
string oldDeviceTypeId = deviceTypeCodeValues.First(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Guid medicalCenterId = Guid.Empty; |
|
|
|
if (_currentUser.Id != null && _currentUser.Id != Guid.Empty) |
|
|
|
{ |
|
|
|
var peisId = await _peisOrganizationUnitManager.GetPeisIdAsync(_currentUser.Id.Value); |
|
|
|
if (peisId != null) |
|
|
|
{ |
|
|
|
medicalCenterId = peisId.Value; |
|
|
|
} |
|
|
|
} |
|
|
|
//string connectionString = _configuration.GetValue<string>("OldPeis:ConnectionStrings", "");
|
|
|
|
//SqlSugarClient oldDb = new SqlSugarClient(new ConnectionConfig()
|
|
|
|
//{
|
|
|
|
@ -1536,7 +1548,7 @@ namespace Shentun.Pacs.PacsBusiness |
|
|
|
IsUpload = 'N', |
|
|
|
IsUploadAppoint = 'N', |
|
|
|
MaritalStatusId = maritalStatusId, |
|
|
|
MedicalCenterId = Guid.Empty, |
|
|
|
MedicalCenterId = medicalCenterId, |
|
|
|
MedicalTimes = 0, |
|
|
|
PatientId = patientEnt.Id, |
|
|
|
PatientName = patientName, |
|
|
|
@ -1615,7 +1627,8 @@ namespace Shentun.Pacs.PacsBusiness |
|
|
|
AsbitemId = asbitemId, |
|
|
|
ChargePrice = oldAsbitemPrice, |
|
|
|
StandardPrice = oldAsbitemStandardPrice, |
|
|
|
IsCharge = Convert.ToChar(row["charge_flag"].ToString()), |
|
|
|
//IsCharge = Convert.ToChar(row["charge_flag"].ToString()),
|
|
|
|
IsCharge = 'N', |
|
|
|
OldAsbitemId = oldAsbitemId, |
|
|
|
OldPatientRegisterId = row["patient_register_id"].ToString(), |
|
|
|
PatientRegisterId = tempPatientRegisterId, |
|
|
|
@ -2095,23 +2108,37 @@ namespace Shentun.Pacs.PacsBusiness |
|
|
|
if (string.IsNullOrWhiteSpace(input.AuditorUserId)) |
|
|
|
{ |
|
|
|
registerCheckFirst.AuditorUserId = null; |
|
|
|
registerCheckFirst.AuditTime = null; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
registerCheckFirst.AuditorUserId = Guid.Parse(input.AuditorUserId); |
|
|
|
registerCheckFirst.AuditTime = DateTime.Now; |
|
|
|
} |
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(input.AuditTime)) |
|
|
|
{ |
|
|
|
registerCheckFirst.AuditTime = null; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
registerCheckFirst.AuditTime = DateTime.Parse(input.AuditTime); |
|
|
|
} |
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(input.CheckDoctorId)) |
|
|
|
{ |
|
|
|
registerCheckFirst.CheckDoctorId = null; |
|
|
|
registerCheckFirst.CheckDate = null; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
registerCheckFirst.CheckDoctorId = input.CheckDoctorId; |
|
|
|
registerCheckFirst.CheckDate = DateTime.Now; |
|
|
|
} |
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(input.CheckDate)) |
|
|
|
{ |
|
|
|
registerCheckFirst.CheckDate = null; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
registerCheckFirst.CheckDate = DateTime.Parse(input.CheckDate); |
|
|
|
} |
|
|
|
|
|
|
|
await _registerCheckRepository.UpdateAsync(registerCheckFirst); |
|
|
|
@ -2353,6 +2380,44 @@ namespace Shentun.Pacs.PacsBusiness |
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 云胶片信息校验
|
|
|
|
/// <summary>
|
|
|
|
/// 校验身份 Y=通过 N=未通过
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="input"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <exception cref="UserFriendlyException"></exception>
|
|
|
|
[HttpPost("api/app/PacsBusiness/GetCheckPacsInfo")] |
|
|
|
public async Task<GetCheckPacsInfoDto> GetCheckPacsInfoAsync(GetCheckPacsInfoInputDto input) |
|
|
|
{ |
|
|
|
GetCheckPacsInfoDto entDto = new GetCheckPacsInfoDto |
|
|
|
{ |
|
|
|
IsPass = 'N' |
|
|
|
}; |
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(input.PatientName)) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("姓名不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(input.CheckRequestNo)) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("条码号不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
string oldSql = $"select * from patient_register where barcode_no='{input.CheckRequestNo}' and [name]='{input.PatientName}'"; |
|
|
|
|
|
|
|
var patientList = await oldDb.Ado.GetDataTableAsync(oldSql); |
|
|
|
|
|
|
|
if (patientList.Rows.Count == 1) |
|
|
|
{ |
|
|
|
entDto.IsPass = 'Y'; |
|
|
|
} |
|
|
|
|
|
|
|
return entDto; |
|
|
|
} |
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 转换老系统性别
|
|
|
|
|