Browse Source

1210

master
wxd 4 months ago
parent
commit
df013f805b
  1. 39
      src/Shentun.Peis.Application.Contracts/DirectorManagement/GetAsbitemDto.cs
  2. 14
      src/Shentun.Peis.Application.Contracts/DirectorManagement/GetAsbitemInputDto.cs
  3. 20
      src/Shentun.Peis.Application.Contracts/DirectorManagement/GetDoctorWorkLoadReportInputDto.cs
  4. 20
      src/Shentun.Peis.Application.Contracts/DirectorManagement/GetItemTypeWorkLoadReportInputDto.cs
  5. 44
      src/Shentun.Peis.Application.Contracts/DirectorManagement/GetMedicalPackageDto.cs
  6. 16
      src/Shentun.Peis.Application.Contracts/DirectorManagement/GetMedicalPackageInputDto.cs
  7. 11
      src/Shentun.Peis.Application.Contracts/DirectorManagement/GetPeisReportBase64ByPatientRegisterIdDto.cs
  8. 104
      src/Shentun.Peis.Application.Contracts/DirectorManagement/GetPeisReportDto.cs
  9. 33
      src/Shentun.Peis.Application.Contracts/DirectorManagement/GetPeisReportInputDto.cs
  10. 2
      src/Shentun.Peis.Application.Contracts/InternalReports/GetDoctorPersonnelWorkLoadReportRequestDto.cs
  11. 2
      src/Shentun.Peis.Application.Contracts/InternalReports/GetItemTypeWorkLoadInStandardRequestDto.cs
  12. 25
      src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs
  13. 8
      src/Shentun.Peis.Application/CCTJExportDatas/CCTJLMPAppService.cs
  14. 10
      src/Shentun.Peis.Application/DiagnosisFunctions/DiagnosisFunctionAppService.cs
  15. 363
      src/Shentun.Peis.Application/DirectorManagements/DirectorManagementAppService.cs
  16. 3
      src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs
  17. 8
      src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs
  18. 17
      src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs
  19. 6
      src/Shentun.Peis.Domain/PrintReports/LisRequestReportDto.cs
  20. 3
      src/Shentun.Peis.EntityFrameworkCore/DbMapping/PatientRegisters/PatientRegisterDbMapping.cs

39
src/Shentun.Peis.Application.Contracts/DirectorManagement/GetAsbitemDto.cs

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.DirectorManagement
{
public class GetAsbitemDto
{
/// <summary>
/// 名称
/// </summary>
public string AsbitemName { get; set; }
/// <summary>
/// 适用性别,M-男,F-女,A-全部
/// </summary>
public string ForSexName { get; set; }
/// <summary>
/// 婚姻状况
/// </summary>
public string MaritalStatusName { get; set; }
/// <summary>
/// 标准价格
/// </summary>
public decimal Price { get; set; }
public int DisplayOrder { get; set; }
}
}

14
src/Shentun.Peis.Application.Contracts/DirectorManagement/GetAsbitemInputDto.cs

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.DirectorManagement
{
public class GetAsbitemInputDto
{
/// <summary>
/// 模糊查询 组合项目名字
/// </summary>
public string AsbitemName { get; set; }
}
}

20
src/Shentun.Peis.Application.Contracts/DirectorManagement/GetDoctorWorkLoadReportInputDto.cs

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.DirectorManagement
{
public class GetDoctorWorkLoadReportInputDto
{
/// <summary>
/// 开始日期
/// </summary>
public string StartDate { get; set; }
/// <summary>
/// 结束日期
/// </summary>
public string EndDate { get; set; }
}
}

20
src/Shentun.Peis.Application.Contracts/DirectorManagement/GetItemTypeWorkLoadReportInputDto.cs

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.DirectorManagement
{
public class GetItemTypeWorkLoadReportInputDto
{
/// <summary>
/// 开始日期
/// </summary>
public string StartDate { get; set; }
/// <summary>
/// 结束日期
/// </summary>
public string EndDate { get; set; }
}
}

44
src/Shentun.Peis.Application.Contracts/DirectorManagement/GetMedicalPackageDto.cs

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.DirectorManagement
{
public class GetMedicalPackageDto
{
/// <summary>
/// 名称
/// </summary>
public string MedicalPackageName { get; set; }
/// <summary>
/// 价格
/// </summary>
public decimal Price { get; set; }
/// <summary>
/// 适用性别
/// </summary>
public string ForSexName { get; set; }
/// <summary>
/// 适用婚姻状况
/// </summary>
public string MaritalStatusName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Remark { get; set; }
/// <summary>
/// 显示顺序
/// </summary>
public int DisplayOrder { get; set; }
}
}

16
src/Shentun.Peis.Application.Contracts/DirectorManagement/GetMedicalPackageInputDto.cs

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.DirectorManagement
{
public class GetMedicalPackageInputDto
{
/// <summary>
/// 模糊查询 套餐名字
/// </summary>
public string MedicalPackageName { get; set; }
}
}

11
src/Shentun.Peis.Application.Contracts/DirectorManagement/GetPeisReportBase64ByPatientRegisterIdDto.cs

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.DirectorManagement
{
public class GetPeisReportBase64ByPatientRegisterIdDto
{
public string Base64Str { get; set; }
}
}

104
src/Shentun.Peis.Application.Contracts/DirectorManagement/GetPeisReportDto.cs

@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.DirectorManagement
{
public class GetPeisReportDto
{
/// <summary>
/// 人员ID
/// </summary>
public Guid PatientRegisterId { get; set; }
/// <summary>
/// 单位名称
/// </summary>
public string CustomerOrgName { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DepartmentName { get; set; }
/// <summary>
/// 条码号
/// </summary>
public string PatientRegisterNo { get; set; }
/// <summary>
/// 档案号
/// </summary>
public string PatientNo { get; set; }
/// <summary>
/// 姓名
/// </summary>
public string PatientName { get; set; }
/// <summary>
/// 手机号
/// </summary>
public string MobileTelephone { get; set; }
/// <summary>
/// 标志(0 预登记 1正式登记 2部分已检 3已总检)
/// </summary>
public string CompleteFlag { get; set; }
/// <summary>
/// 是否已经上传web
/// </summary>
public string IsUpload { get; set; }
/// <summary>
/// 性别
/// </summary>
public string SexName { get; set; }
/// <summary>
/// 年龄
/// </summary>
public string Age { get; set; }
/// <summary>
/// 身份证号
/// </summary>
public string IdNo { get; set; }
/// <summary>
/// 体检日期 1999-01-01
/// </summary>
public string MedicalStartDate { get; set; }
/// <summary>
/// 总检医生
/// </summary>
public string SummaryDoctorName { get; set; }
/// <summary>
/// 总检时间 1999-01-01
/// </summary>
public string SummaryDate { get; set; }
/// <summary>
/// 审核医生
/// </summary>
public string AuditDoctorName { get; set; }
/// <summary>
/// 审核日期
/// </summary>
public string AuditDate { get; set; }
}
}

33
src/Shentun.Peis.Application.Contracts/DirectorManagement/GetPeisReportInputDto.cs

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.DirectorManagement
{
public class GetPeisReportInputDto
{
/// <summary>
/// 姓名
/// </summary>
public string PatientName { get; set; }
/// <summary>
/// 手机号
/// </summary>
public string MobileTelephone { get; set; }
/// <summary>
/// 身份证
/// </summary>
public string IdNo { get; set; }
/// <summary>
/// 条码号
/// </summary>
public string PatientRegisterNo { get; set; }
/// <summary>
/// 档案号
/// </summary>
public string PatientNo { get; set; }
}
}

2
src/Shentun.Peis.Application.Contracts/InternalReports/GetDoctorPersonnelWorkLoadReportRequestDto.cs

@ -10,7 +10,7 @@ namespace Shentun.Peis.InternalReports
/// <summary>
/// 医生ID 集合
/// </summary>
public List<string> UserIds { get; set; }
public List<string> UserIds { get; set; } = new List<string>();
/// <summary>
/// 开始检查日期

2
src/Shentun.Peis.Application.Contracts/InternalReports/GetItemTypeWorkLoadInStandardRequestDto.cs

@ -9,7 +9,7 @@ namespace Shentun.Peis.InternalReports
/// <summary>
/// 项目类别ID
/// </summary>
public List<Guid> ItemTypeId { get; set; }
public List<Guid> ItemTypeId { get; set; } = new List<Guid>();
/// <summary>

25
src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs

@ -616,6 +616,23 @@ namespace Shentun.Peis.CCTJExportDatas
}
/// <summary>
/// 处理单位相关
/// </summary>
/// <returns></returns>
[HttpPost("api/app/CCTJExportData/HandCustomerOrgDetailData")]
public async Task HandCustomerOrgDetailData()
{
await TransferTopCustomerOrgData();
await TransferTwoCustomerOrgData();
await TransferThreeCustomerOrgData();
await TransferFourCustomerOrgData();
await TransferCustomerOrgRegisterData();
await TransferCustomerOrgGroupData();
await TransferCustomerOrgGroupDetailData();
}
#region 基础数据
@ -2319,7 +2336,7 @@ namespace Shentun.Peis.CCTJExportDatas
MedicalCenterId = defaultMedicalCenterId,
OrgTypeId = defaultOrgTypeId, //默认为私营
ParentId = null,
PathCode = (oldCustomerOrgList.Rows.IndexOf(row) + 1).ToString().PadLeft(5, '0'),
PathCode = _customerOrgManager.CreatePathCode(null).GetAwaiter().GetResult(),
PostalCode = row["postalcode"].ToString(),
Remark = remark,
ShortName = row["short_name"].ToString(),
@ -2438,7 +2455,7 @@ namespace Shentun.Peis.CCTJExportDatas
MedicalCenterId = defaultMedicalCenterId,
OrgTypeId = defaultOrgTypeId, //默认为私营
ParentId = parentId,
PathCode = _customerOrgManager.CreatePathCode(parentId).Result,
PathCode = _customerOrgManager.CreatePathCode(parentId).GetAwaiter().GetResult(),
PostalCode = row["postalcode"].ToString(),
Remark = remark,
ShortName = row["short_name"].ToString(),
@ -2556,7 +2573,7 @@ namespace Shentun.Peis.CCTJExportDatas
MedicalCenterId = defaultMedicalCenterId,
OrgTypeId = defaultOrgTypeId, //默认为私营
ParentId = parentId,
PathCode = _customerOrgManager.CreatePathCode(parentId).Result,
PathCode = _customerOrgManager.CreatePathCode(parentId).GetAwaiter().GetResult(),
PostalCode = row["postalcode"].ToString(),
Remark = remark,
ShortName = row["short_name"].ToString(),
@ -2674,7 +2691,7 @@ namespace Shentun.Peis.CCTJExportDatas
MedicalCenterId = defaultMedicalCenterId,
OrgTypeId = defaultOrgTypeId, //默认为私营
ParentId = parentId,
PathCode = _customerOrgManager.CreatePathCode(parentId).Result,
PathCode = _customerOrgManager.CreatePathCode(parentId).GetAwaiter().GetResult(),
PostalCode = row["postalcode"].ToString(),
Remark = remark,
ShortName = row["short_name"].ToString(),

8
src/Shentun.Peis.Application/CCTJExportDatas/CCTJLMPAppService.cs

@ -287,10 +287,14 @@ namespace Shentun.Peis.CCTJExportDatas
#region 检测是否有手动增加的项目
List<Guid> pcAsbitemIds = new List<Guid>();
pcAsbitemIds.Add(Guid.Parse("3a1e0db7-8601-c251-917a-107adcb65fc6"));
pcAsbitemIds.Add(Guid.Parse("3a1e0db6-2056-2a51-b7b7-ad2fac5d5d06"));
var query = (from asbitem in await _asbitemRepository.GetQueryableAsync()
join fieldComparison in (await _fieldComparisonRepository.GetQueryableAsync()).Where(m => m.TableName == "asbitem") on asbitem.Id.ToString() equals fieldComparison.NewKeyValue into fieldComparisonTemp
from fieldComparisonEmptyHave in fieldComparisonTemp.DefaultIfEmpty()
where fieldComparisonEmptyHave == null
where fieldComparisonEmptyHave == null && !pcAsbitemIds.Contains(asbitem.Id)
select asbitem.DisplayName).ToList();
if (query.Any())
@ -477,7 +481,7 @@ namespace Shentun.Peis.CCTJExportDatas
}
/// <summary>
/// 同步体检单位数据 一级

10
src/Shentun.Peis.Application/DiagnosisFunctions/DiagnosisFunctionAppService.cs

@ -719,7 +719,15 @@ namespace Shentun.Peis.DiagnosisFunctions
return diagnosis;
}
/// <summary>
/// 根据参考范围获取诊断
/// </summary>
/// <param name="itemName"></param>
/// <param name="result"></param>
/// <param name="unit"></param>
/// <param name="isLower"></param>
/// <param name="referenceRange"></param>
/// <returns></returns>
private async Task<string> GetNumberDiagnosis(string itemName, string result, string unit, bool isLower,
ReferenceRange referenceRange)
{

363
src/Shentun.Peis.Application/DirectorManagements/DirectorManagementAppService.cs

@ -1,15 +1,24 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using NPOI.POIFS.Storage;
using Shentun.Peis.DirectorManagement;
using Shentun.Peis.Enums;
using Shentun.Peis.InternalReports;
using Shentun.Peis.Models;
using Shentun.Peis.PatientRegisters;
using Shentun.Peis.PrintReports;
using Shentun.Peis.TransToWebPeiss;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Services;
@ -32,6 +41,10 @@ namespace Shentun.Peis.DirectorManagements
private readonly IRepository<Asbitem, Guid> _asbitemRepository;
private readonly IRepository<MedicalPackage, Guid> _medicalPackageRepository;
private readonly IRepository<CustomerOrg, Guid> _customerOrgRepository;
private readonly InternalReportAppService _internalReportAppService;
private readonly IRepository<ThirdInterface, Guid> _thirdInterfaceRepository;
private readonly PrintReportAppService _printReportAppService;
public DirectorManagementAppService(
IRepository<PatientRegister, Guid> patientRegisterRepository,
IRepository<Patient, Guid> patientRepository,
@ -40,7 +53,10 @@ namespace Shentun.Peis.DirectorManagements
IRepository<RegisterCheckAsbitem, Guid> registerCheckAsbitemRepository,
IRepository<Asbitem, Guid> asbitemRepository,
IRepository<MedicalPackage, Guid> medicalPackageRepository,
IRepository<CustomerOrg, Guid> customerOrgRepository)
IRepository<CustomerOrg, Guid> customerOrgRepository,
InternalReportAppService internalReportAppService,
IRepository<ThirdInterface, Guid> thirdInterfaceRepository,
PrintReportAppService printReportAppService)
{
_patientRegisterRepository = patientRegisterRepository;
_patientRepository = patientRepository;
@ -50,6 +66,9 @@ namespace Shentun.Peis.DirectorManagements
_asbitemRepository = asbitemRepository;
_medicalPackageRepository = medicalPackageRepository;
_customerOrgRepository = customerOrgRepository;
_internalReportAppService = internalReportAppService;
_thirdInterfaceRepository = thirdInterfaceRepository;
_printReportAppService = printReportAppService;
}
/// <summary>
@ -320,6 +339,348 @@ namespace Shentun.Peis.DirectorManagements
}
/// <summary>
/// 工作量统计 某段时间科室工作量统计
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/DirectorManagement/GetItemTypeWorkLoadReport")]
public async Task<List<GetItemTypeWorkLoadInStandardDto>> GetItemTypeWorkLoadReportAsync(GetItemTypeWorkLoadReportInputDto input)
{
if (string.IsNullOrWhiteSpace(input.StartDate) || string.IsNullOrWhiteSpace(input.EndDate))
{
throw new UserFriendlyException("请选择查询时间段");
}
var entListDto = await _internalReportAppService.GetItemTypeWorkLoadInStandardAsync(new GetItemTypeWorkLoadInStandardRequestDto
{
StartDate = input.StartDate,
EndDate = input.EndDate
});
return entListDto;
}
/// <summary>
/// 工作量统计 某段时间医生工作量统计
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/DirectorManagement/GetDoctorWorkLoadReport")]
public async Task<List<GetDoctorPersonnelWorkLoadReportDto>> GetDoctorWorkLoadReportAsync(GetDoctorWorkLoadReportInputDto input)
{
if (string.IsNullOrWhiteSpace(input.StartDate) || string.IsNullOrWhiteSpace(input.EndDate))
{
throw new UserFriendlyException("请选择查询时间段");
}
var entListDto = await _internalReportAppService.GetDoctorPersonnelWorkLoadReportAsync(new GetDoctorPersonnelWorkLoadReportRequestDto
{
StartDate = input.StartDate,
EndDate = input.EndDate
});
return entListDto;
}
/// <summary>
/// 套餐价格查询
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/DirectorManagement/GetMedicalPackage")]
public async Task<List<GetMedicalPackageDto>> GetMedicalPackageAsync(GetMedicalPackageInputDto input)
{
var query = from medicalPackage in await _medicalPackageRepository.GetQueryableAsync()
where medicalPackage.IsActive == 'Y'
select medicalPackage;
if (!string.IsNullOrWhiteSpace(input.MedicalPackageName))
{
query = query.Where(m => input.MedicalPackageName.Contains(m.DisplayName));
}
var entListDto = query.ToList().Select(s => new GetMedicalPackageDto
{
DisplayOrder = s.DisplayOrder,
ForSexName = GetForSexName(s.ForSexId),
MaritalStatusName = _cacheService.GetMaritalStatusNameAsync(s.MaritalStatusId).GetAwaiter().GetResult(),
MedicalPackageName = s.DisplayName,
Price = s.Price,
Remark = s.Remark
}).OrderBy(o => o.DisplayOrder).ToList();
return entListDto;
}
/// <summary>
/// 组合项目价格查询
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/DirectorManagement/GetAsbitem")]
public async Task<List<GetAsbitemDto>> GetAsbitemAsync(GetAsbitemInputDto input)
{
var query = from asbitem in await _asbitemRepository.GetQueryableAsync()
where asbitem.IsActive == 'Y'
select asbitem;
if (!string.IsNullOrWhiteSpace(input.AsbitemName))
{
query = query.Where(m => input.AsbitemName.Contains(m.DisplayName));
}
var entListDto = query.ToList().Select(s => new GetAsbitemDto
{
DisplayOrder = s.DisplayOrder,
ForSexName = GetForSexName(s.ForSexId),
MaritalStatusName = _cacheService.GetMaritalStatusNameAsync(s.MaritalStatusId).GetAwaiter().GetResult(),
AsbitemName = s.DisplayName,
Price = s.Price
}).OrderBy(o => o.DisplayOrder).ToList();
return entListDto;
}
/// <summary>
/// 客户体检报告查询
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/DirectorManagement/GetPeisReport")]
public async Task<List<GetPeisReportDto>> GetPeisReportAsync(GetPeisReportInputDto input)
{
var query = from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
join patient in await _patientRepository.GetQueryableAsync() on patientRegister.PatientId equals patient.Id
where patientRegister.CompleteFlag == PatientRegisterCompleteFlag.Audit || patientRegister.CompleteFlag == PatientRegisterCompleteFlag.SumCheck
select new
{
patientRegister,
patient
};
if (!string.IsNullOrWhiteSpace(input.PatientName))
{
query = query.Where(m => m.patientRegister.PatientName == input.PatientName);
}
if (!string.IsNullOrWhiteSpace(input.MobileTelephone))
{
query = query.Where(m => m.patient.MobileTelephone == input.MobileTelephone);
}
if (!string.IsNullOrWhiteSpace(input.PatientNo))
{
query = query.Where(m => m.patient.PatientNo == input.PatientNo);
}
if (!string.IsNullOrWhiteSpace(input.IdNo))
{
query = query.Where(m => m.patient.IdNo == input.IdNo);
}
if (!string.IsNullOrWhiteSpace(input.PatientRegisterNo))
{
query = query.Where(m => m.patientRegister.PatientRegisterNo == input.PatientRegisterNo);
}
var entListDto = query.Select(s => new GetPeisReportDto
{
Age = s.patientRegister.Age == null ? "" : s.patientRegister.Age.ToString(),
MedicalStartDate = DataHelper.ConversionDateShortToString(s.patientRegister.MedicalStartDate),
AuditDate = DataHelper.ConversionDateShortToString(s.patientRegister.AuditDate),
AuditDoctorName = _cacheService.GetSurnameAsync(s.patientRegister.AuditDoctorId).GetAwaiter().GetResult(),
IdNo = s.patient.IdNo,
MobileTelephone = s.patient.MobileTelephone,
PatientNo = s.patient.PatientNo,
SexName = GetSexName(s.patientRegister.SexId),
CompleteFlag = GetPatientRegisterCompleteFlag(s.patientRegister.CompleteFlag),
IsUpload = s.patientRegister.IsUpload == 'Y' ? "已上传" : "未上传",
PatientName = s.patientRegister.PatientName,
PatientRegisterId = s.patientRegister.Id,
PatientRegisterNo = s.patientRegister.PatientRegisterNo,
SummaryDate = DataHelper.ConversionDateShortToString(s.patientRegister.SummaryDate),
SummaryDoctorName = _cacheService.GetSurnameAsync(s.patientRegister.SummaryDoctorId).GetAwaiter().GetResult(),
CustomerOrgName = _cacheService.GetTopCustomerOrgNameAsync(s.patientRegister.CustomerOrgId).GetAwaiter().GetResult(),
DepartmentName = _cacheService.GetCustomerOrgNameAsync(s.patientRegister.CustomerOrgId).GetAwaiter().GetResult()
}).OrderBy(o => o.PatientRegisterId).ToList();
return entListDto;
}
/// <summary>
/// 根据体检人员Id查询报告 返回的报告base64
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/DirectorManagement/GetPeisReportBase64ByPatientRegisterId")]
public async Task<GetPeisReportBase64ByPatientRegisterIdDto> GetPeisReportBase64ByPatientRegisterIdAsync(PatientRegisterIdInputDto input)
{
var entDto = new GetPeisReportBase64ByPatientRegisterIdDto();
entDto.Base64Str = await GetPeisBase64Async(input);
return entDto;
}
/// <summary>
/// 获取报告bse64 调用服务器上客户端
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
/// <exception cref="Exception"></exception>
private async Task<string> GetPeisBase64Async(PatientRegisterIdInputDto input)
{
var thirdInterface = await _thirdInterfaceRepository.FirstOrDefaultAsync(f => f.ThirdInterfaceType == ThirdInterfaceTypeFlag.TranToWebPeis);
if (thirdInterface.IsActive != 'Y')
{
throw new UserFriendlyException("该接口已禁用");
}
var parmValue = thirdInterface.ParmValue;
var configurationBuilder = new ConfigurationBuilder()
.AddJsonStream(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(parmValue)));
var config = configurationBuilder.Build();
var reportApiBaseAddress = config.GetSection("Interface").GetSection("ReportApiBaseAddress").Value;
var reportApiUrl = config.GetSection("Interface").GetSection("ReportApiUrl").Value;
string reportBase64 = "";
var printReportData = await _printReportAppService.GetMedicalReportConvertToReportAsync(input);
using (var httpClientHandler = new HttpClientHandler())
{
using (var httpClient = new HttpClient(httpClientHandler))
{
httpClient.BaseAddress = new Uri(reportApiBaseAddress);
httpClient.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));//设置accept标头,告诉JSON是可接受的响应类型
var sendData = JsonConvert.SerializeObject(printReportData);
using (HttpContent httpContent = new StringContent(sendData))
{
httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
HttpResponseMessage response = null;
response = await httpClient.PostAsync(reportApiUrl, httpContent);
string result;
if (!response.IsSuccessStatusCode)
{
result = response.Content.ReadAsStringAsync().Result;
throw new Exception("http通信错误:" + response.StatusCode + ",结果:" + result);
}
result = await response.Content.ReadAsStringAsync();
var resultDto = JsonConvert.DeserializeObject<WebApiClientOutDto>(result);
if (resultDto != null)
{
if (resultDto.code != 1)
{
throw new Exception($"调用WebApi失败,返回-1,消息:" + result);
}
reportBase64 = resultDto.data;
}
}
}
}
return reportBase64;
}
/// <summary>
/// 转换适用性别
/// </summary>
/// <param name="ForSexId"></param>
/// <returns></returns>
private string GetForSexName(char ForSexId)
{
string msg = "";
if (ForSexId == 'A')
{
msg = "全部";
}
else if (ForSexId == 'M')
{
msg = "男";
}
else if (ForSexId == 'F')
{
msg = "女";
}
return msg;
}
/// <summary>
/// 转换性别
/// </summary>
/// <param name="SexId"></param>
/// <returns></returns>
private string GetSexName(char SexId)
{
string msg = "";
if (SexId == 'U')
{
msg = "未知";
}
else if (SexId == 'M')
{
msg = "男";
}
else if (SexId == 'F')
{
msg = "女";
}
return msg;
}
/// <summary>
/// 转换人员状态
/// </summary>
/// <param name="completeFlag"></param>
/// <returns></returns>
private string GetPatientRegisterCompleteFlag(char completeFlag)
{
string msg = "";
if (completeFlag == '0')
{
msg = "预登记";
}
else if (completeFlag == '1')
{
msg = "正式登记";
}
else if (completeFlag == '2')
{
msg = "部分已检";
}
else if (completeFlag == '3')
{
msg = "已总检";
}
return msg;
}
}
}

3
src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs

@ -388,6 +388,7 @@ namespace Shentun.Peis.PrintReports
PatientNo = o.patient.PatientNo,
Age = o.patientRegister.Age,
AsbitemNames = string.IsNullOrEmpty(o.asbitem.ShortName) ? o.asbitem.DisplayName : o.asbitem.ShortName,
AsbitemDisplayOrder = o.asbitem.DisplayOrder,
LisRequestNo = o.lisRequest.LisRequestNo,
PatientName = o.patientRegister.PatientName,
PatientRegisterNo = o.patientRegister.PatientRegisterNo,
@ -488,7 +489,7 @@ namespace Shentun.Peis.PrintReports
LisRequestNo = lisRequestNoPrintMode == "0" ? s.Key.LisRequestNo : s.Key.PatientRegisterNo,
CustomerOrgName = s.Key.CustomerOrgName,
DepartmentName = s.Key.DepartmentName,
AsbitemNames = string.Join(",", s.Select(d => d.AsbitemNames)),
AsbitemNames = string.Join(",", s.OrderBy(sa => sa.AsbitemDisplayOrder).Select(d => d.AsbitemNames)),
IsPrint = s.Key.IsPrint,
IsSignIn = s.Key.IsSignIn,
SamplingTime = s.Key.SamplingTime,

8
src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs

@ -382,6 +382,14 @@ namespace Shentun.Peis.RegisterChecks
registerCheck.SubmissionTime = input.SubmissionTime;
if (input.AuditorTime != null)
registerCheck.AuditorTime = input.AuditorTime;
//更新体检标识跟体检日期
if (patientRegister.CompleteFlag == PatientRegisterCompleteFlag.Registration)
{
//第一次保存
patientRegister.IsMedicalStart = 'Y';
patientRegister.MedicalStartDate = DateTime.Now;
}
//更新人员登记信息完成标志
patientRegister.CompleteFlag = PatientRegisterCompleteFlag.PartCheck;
await _patientRegisterRepository.UpdateAsync(patientRegister);

17
src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs

@ -346,6 +346,23 @@ namespace Shentun.Peis.Models
[Column("summary_historical_review")]
public string SummaryHistoricalReview { get; set; }
/// <summary>
/// 报告是否领取
/// </summary>
[Column("is_receive_report")]
public char IsReceiveReport { get; set; }
/// <summary>
/// 报告领取人
/// </summary>
[Column("report_receive_name")]
public string ReportReceiveName { get; set; }
/// <summary>
/// 报告领取时间
/// </summary>
[Column("report_receive_date")]
public DateTime? ReportReceiveDate { get; set; }
[Column("concurrency_stamp")]
public string ConcurrencyStamp { get; set; }

6
src/Shentun.Peis.Domain/PrintReports/LisRequestReportDto.cs

@ -99,6 +99,12 @@ namespace Shentun.Peis.PrintReports
/// </summary>
public string AsbitemNames { get; set; }
/// <summary>
///
/// </summary>
public int AsbitemDisplayOrder { get; set; }
/// <summary>
/// 单位名称
/// </summary>

3
src/Shentun.Peis.EntityFrameworkCore/DbMapping/PatientRegisters/PatientRegisterDbMapping.cs

@ -103,6 +103,9 @@ namespace Shentun.Peis.DbMapping
entity.Property(t => t.DeviceGuidePrintTimes).HasComment("设备体检报告打印次数").IsRequired().HasDefaultValue((short)0);
entity.Property(t => t.ReportPrintOperating).HasComment("体检报告打印操作者");
entity.Property(t => t.SummaryHistoricalReview).HasComment("总检历次综述内容");
entity.Property(t => t.IsReceiveReport).HasComment("报告是否领取").HasDefaultValueSql("'N'");
entity.Property(t => t.ReportReceiveName).HasComment("报告领取人");
entity.Property(t => t.ReportReceiveDate).HasComment("报告领取时间");
//entity.HasOne(d => d.CustomerOrgRegister)
// .WithMany(p => p.PatientRegisters)

Loading…
Cancel
Save