diff --git a/src/Shentun.WebPeis.Application.Contracts/Persons/GetCheckPacsInfoDto.cs b/src/Shentun.WebPeis.Application.Contracts/Persons/GetCheckPacsInfoDto.cs
new file mode 100644
index 0000000..4d8e2cd
--- /dev/null
+++ b/src/Shentun.WebPeis.Application.Contracts/Persons/GetCheckPacsInfoDto.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.WebPeis.Persons
+{
+ public class GetCheckPacsInfoDto
+ {
+ ///
+ /// 是否正确
+ ///
+ public char IsPass { get; set; }
+
+ public string Message { get; set; }
+ }
+}
diff --git a/src/Shentun.WebPeis.Application.Contracts/Persons/GetCheckPacsInfoInputDto.cs b/src/Shentun.WebPeis.Application.Contracts/Persons/GetCheckPacsInfoInputDto.cs
new file mode 100644
index 0000000..2a193ef
--- /dev/null
+++ b/src/Shentun.WebPeis.Application.Contracts/Persons/GetCheckPacsInfoInputDto.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.WebPeis.Persons
+{
+ public class GetCheckPacsInfoInputDto
+ {
+ ///
+ /// 姓名
+ ///
+ public string PatientName { get; set; }
+
+ ///
+ /// 条码号
+ ///
+ public string CheckRequestNo { get; set; }
+ }
+}
diff --git a/src/Shentun.WebPeis.Application.Contracts/Persons/GetPatientRegisterByIdNoInputDto.cs b/src/Shentun.WebPeis.Application.Contracts/Persons/GetPatientRegisterByIdNoInputDto.cs
new file mode 100644
index 0000000..2dece53
--- /dev/null
+++ b/src/Shentun.WebPeis.Application.Contracts/Persons/GetPatientRegisterByIdNoInputDto.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.WebPeis.Persons
+{
+ public class GetPatientRegisterByIdNoInputDto
+ {
+ public string IdNo { get; set; }
+
+ public string MobileTelephone { get; set; }
+ }
+}
diff --git a/src/Shentun.WebPeis.Application.Contracts/Persons/PersonMedicalTimesDto.cs b/src/Shentun.WebPeis.Application.Contracts/Persons/PersonMedicalTimesDto.cs
index 007d43d..c0ae0c5 100644
--- a/src/Shentun.WebPeis.Application.Contracts/Persons/PersonMedicalTimesDto.cs
+++ b/src/Shentun.WebPeis.Application.Contracts/Persons/PersonMedicalTimesDto.cs
@@ -1,14 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;
+using System.Text.Json.Serialization;
namespace Shentun.WebPeis.Persons
{
public class PersonMedicalTimesDto
{
- public Guid PatientRegisterId { get; set; }
+ public string PatientRegisterId { get; set; }
public string PersonName { get; set; }
public DateTime MedicalStartDate { get; set; }
+ public char IsOld { get; set; } = 'N';
+
+ ///
+ /// 老数据
+ ///
+ public string Summary { get; set; }
+
+ ///
+ /// 老数据
+ ///
+ public string Suggestion { get; set; }
+
+
}
}
diff --git a/src/Shentun.WebPeis.Application.Contracts/Persons/RegisterAsbitemExpendDto.cs b/src/Shentun.WebPeis.Application.Contracts/Persons/RegisterAsbitemExpendDto.cs
new file mode 100644
index 0000000..33830e6
--- /dev/null
+++ b/src/Shentun.WebPeis.Application.Contracts/Persons/RegisterAsbitemExpendDto.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.WebPeis.Persons
+{
+ public class RegisterAsbitemExpendDto
+ {
+ public int ResultShowMode { get; set; } = 0;
+
+ public ICollection ImagesBase64 { get; set; }
+
+ ///
+ /// 条码号
+ ///
+ public string CheckRequestNo { get; set; }
+
+ ///
+ /// 是否pacs检查
+ ///
+ public char IsPacsCheck { get; set; } = 'N';
+
+ ///
+ /// 项目描述
+ ///
+ public string PacsDesc { get; set; }
+
+ ///
+ /// 云胶片使用
+ ///
+ public string StudyInstanceUID { get; set; }
+
+ public long PatientRegisterId { get; set; }
+ public string AsbitemId { get; set; }
+ public string AsbitemName { get; set; }
+ public string Summary { get; set; }
+ public string CheckDoctor { get; set; }
+ public DateTime CheckDate { get; set; }
+
+
+ public virtual ICollection RegisterItem { get; set; }
+
+
+ }
+
+ public partial class RegisterAsbitemExpendRegisterItemDto
+ {
+ public long PatientRegisterId { get; set; }
+ public string AsbitemId { get; set; }
+ public string ItemId { get; set; }
+ public string ItemName { get; set; }
+ public string Result { get; set; }
+ public string Unit { get; set; }
+ public string ReferenceRangeValue { get; set; }
+ public string ReportPrompt { get; set; }
+ public int? ResultFontColor { get; set; }
+ }
+}
diff --git a/src/Shentun.WebPeis.Application.Contracts/Questions/QuestionDto.cs b/src/Shentun.WebPeis.Application.Contracts/Questions/QuestionDto.cs
index 9cd1253..14a94a3 100644
--- a/src/Shentun.WebPeis.Application.Contracts/Questions/QuestionDto.cs
+++ b/src/Shentun.WebPeis.Application.Contracts/Questions/QuestionDto.cs
@@ -51,5 +51,10 @@ namespace Shentun.WebPeis.Questions
public string SimpleCode { get; set; } = null!;
public int DisplayOrder { get; set; }
+
+ ///
+ /// 适用性别
+ ///
+ public char ForSexId { get; set; }
}
}
diff --git a/src/Shentun.WebPeis.Application/CompanyIntroductions/CompanyIntroductionAppService.cs b/src/Shentun.WebPeis.Application/CompanyIntroductions/CompanyIntroductionAppService.cs
index 2e09c70..e44b322 100644
--- a/src/Shentun.WebPeis.Application/CompanyIntroductions/CompanyIntroductionAppService.cs
+++ b/src/Shentun.WebPeis.Application/CompanyIntroductions/CompanyIntroductionAppService.cs
@@ -41,6 +41,7 @@ namespace Shentun.WebPeis.CompanyIntroductions
///
///
[HttpPost("api/app/CompanyIntroduction/GetList")]
+ [AllowAnonymous]
public async Task> GetListAsync()
{
var entlist = await _companyIntroductionRepository.GetQueryableAsync();
@@ -124,6 +125,7 @@ namespace Shentun.WebPeis.CompanyIntroductions
///
///
[HttpPost("api/app/CompanyIntroduction/GetMiniProgramConfigure")]
+ [AllowAnonymous]
public async Task GetMiniProgramConfigureAsync()
{
var resultDto = new GetMiniProgramConfigureDto();
diff --git a/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs b/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs
index f5819fe..e224f87 100644
--- a/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs
+++ b/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs
@@ -1,48 +1,49 @@
-using Shentun.WebPeis.Models;
+using IdentityModel;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Identity;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Caching.Distributed;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using NPOI.SS.Formula.Functions;
+using OpenIddict.Abstractions;
+using Scriban.Parsing;
+using Scriban.Syntax;
+using Shentun.Sms.Client;
+using Shentun.Utilities;
+using Shentun.Utilities.Enums;
+using Shentun.WebPeis.CustomerOrgs;
+using Shentun.WebPeis.Enums;
+using Shentun.WebPeis.Models;
+using Shentun.WebPeis.PatientRegisters;
+using Shentun.WebPeis.SysParmValues;
+using Shentun.WebPeis.Wechats;
+using SqlSugar;
using System;
+using System.Collections;
using System.Collections.Generic;
+using System.Data;
+using System.IdentityModel.Tokens.Jwt;
+using System.IO;
using System.Linq;
+using System.Linq.Dynamic.Core.Tokenizer;
+using System.Net;
+using System.Net.Http;
+using System.Net.Http.Headers;
using System.Text;
+using System.Text.Json;
using System.Threading.Tasks;
+using Volo.Abp;
using Volo.Abp.Application.Services;
+using Volo.Abp.Caching;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;
-using Volo.Abp.Users;
-using Shentun.WebPeis.Wechats;
-using Microsoft.Extensions.Configuration;
-using System.Net.Http;
-using System.Net;
-using System.Text.Json;
using Volo.Abp.Identity;
-using Volo.Abp;
-using Shentun.WebPeis.Enums;
-using System.Net.Http.Headers;
-
-using Microsoft.AspNetCore.Mvc;
-using OpenIddict.Abstractions;
-using Microsoft.AspNetCore.Identity;
using Volo.Abp.ObjectMapping;
-using Microsoft.AspNetCore.Authorization;
-using Volo.Abp.Caching;
-using NPOI.SS.Formula.Functions;
-using System.Linq.Dynamic.Core.Tokenizer;
-using Microsoft.Extensions.Caching.Distributed;
using Volo.Abp.Uow;
-using Scriban.Parsing;
-using System.IdentityModel.Tokens.Jwt;
-using Shentun.WebPeis.PatientRegisters;
-using Microsoft.AspNetCore.Http;
-using System.IO;
-using Shentun.WebPeis.CustomerOrgs;
-using Shentun.Utilities.Enums;
-using Shentun.Sms.Client;
-using Shentun.Utilities;
-using IdentityModel;
-using Shentun.WebPeis.SysParmValues;
-using Scriban.Syntax;
+using Volo.Abp.Users;
using static SKIT.FlurlHttpClient.Wechat.TenpayV3.Models.DepositMarketingMemberCardOpenCardCodesResponse.Types;
-using System.Data;
-using SqlSugar;
namespace Shentun.WebPeis.Persons
{
///
@@ -525,7 +526,7 @@ namespace Shentun.WebPeis.Persons
}
///
- /// 获取体检次数列表 显示报告的列表
+ /// 获取体检次数列表 显示报告的列表 增加查询老系统数据
///
///
///
@@ -545,10 +546,54 @@ namespace Shentun.WebPeis.Persons
orderby patientRegister.MedicalStartDate
select new PersonMedicalTimesDto()
{
- PatientRegisterId = patientRegister.PatientRegisterId,
+ PatientRegisterId = patientRegister.PatientRegisterId.ToString(),
PersonName = patient.PatientName,
MedicalStartDate = patientRegister.MedicalStartDate,
+ IsOld = 'N'
}).ToList();
+
+ var isOldReport = _configuration.GetValue("Report:IsOldReport", "N");
+
+ if (isOldReport == "Y")
+ {
+ var oldApiBaseUrl = _configuration.GetValue("Report:OldApiBaseUrl", "");
+
+ var patientInfo = (from user in await _identityUserRepository.GetQueryableAsync()
+ join person in await _repository.GetQueryableAsync()
+ on user.Id equals person.PersonId
+ where user.Id == input.PersonId
+ select new
+ {
+ user.PhoneNumber,
+ person.IdNo
+ }).FirstOrDefault();
+
+ if (patientInfo != null)
+ {
+ var inputParm = new GetPatientRegisterByIdNoInputDto
+ {
+ IdNo = patientInfo.IdNo,
+ MobileTelephone = patientInfo.PhoneNumber
+ };
+
+ var oldList = await CallAppServiceAsync>(oldApiBaseUrl, $"{oldApiBaseUrl}/api/PatientExamResult/GetPatientRegisterByIdNo", inputParm, "post");
+
+ if (oldList != null && oldList.Count > 0)
+ {
+ foreach (var item in oldList)
+ {
+ var isCz = entityList.FirstOrDefault(f => f.MedicalStartDate == item.MedicalStartDate);
+ if (isCz == null)
+ {
+ entityList.Add(item);
+ }
+ }
+ }
+ }
+ }
+
+ entityList = entityList.OrderBy(o => o.MedicalStartDate).ToList();
+
return entityList;
}
@@ -765,7 +810,6 @@ namespace Shentun.WebPeis.Persons
///
///
[HttpPost("api/app/Person/GetMedicalReportDetailByPatientRegisterId")]
- [AllowAnonymous]
public async Task GetMedicalReportDetailByPatientRegisterIdAsync(PatientRegisterIdInputDto input)
{
var result = new MedicalReportDetailDto();
@@ -784,7 +828,7 @@ namespace Shentun.WebPeis.Persons
///
private async Task> GetMedicalReportRegisterChecks(PatientRegisterIdInputDto input)
{
-
+
var peisBaseUrl = _configuration.GetValue("Peis:PeisBaseUrl", "");
var barCodeMode = _configuration.GetValue("Pacs:BarCodeMode", "0"); //检测条码模式 0-人员条码 1-检测条码 默认-0
@@ -830,7 +874,7 @@ namespace Shentun.WebPeis.Persons
var registerCheckIds = registerChecklist.Select(o => o.registerCheck.RegisterCheckId).Distinct().ToList();
-
+
foreach (var registerCheckId in registerCheckIds)
{
var registerCheckRows = registerChecklist.Where(o => o.registerCheck.RegisterCheckId == registerCheckId).ToList();
@@ -1039,7 +1083,7 @@ namespace Shentun.WebPeis.Persons
// });
-
+
// var isPacsCheckAsbitemList = oldDb.Ado.GetDataTable("select b.check_request_no,c.old_asbitem_id,max(d.parent_study_id) as parent_study_id " +
// " from patient_register as a " +
// " left join register_check as b on a.id=b.patient_register_id " +
@@ -1083,8 +1127,180 @@ namespace Shentun.WebPeis.Persons
// return result;
//}
+
+ ///
+ /// 校验身份 Y=通过 N=未通过
+ ///
+ ///
+ ///
+ [HttpPost("api/PatientRegister/GetCheckPacsInfo")]
+ [AllowAnonymous]
+ public GetCheckPacsInfoDto GetPacsCheckAsbitemByPatientRegisterIdAsync(GetCheckPacsInfoInputDto input)
+ {
+
+ GetCheckPacsInfoDto entDto = new GetCheckPacsInfoDto
+ {
+ IsPass = 'N'
+ };
+
+
+
+ var pacsDatabase = _configuration.GetValue("Pacs:PacsDatabase", "");
+
+ SqlSugarClient oldDb = new SqlSugarClient(new ConnectionConfig()
+ {
+ ConnectionString = pacsDatabase,
+ DbType = SqlSugar.DbType.PostgreSQL,
+ IsAutoCloseConnection = true
+ });
+
+
+
+ if (string.IsNullOrWhiteSpace(input.PatientName))
+ {
+ entDto.IsPass = 'N';
+ entDto.Message = "姓名不能为空";
+ return entDto;
+ }
+
+ if (string.IsNullOrWhiteSpace(input.CheckRequestNo))
+ {
+ entDto.IsPass = 'N';
+ entDto.Message = "条码号不能为空";
+ return entDto;
+ }
+
+
+ string oldSql = @$"select patient_name,b.check_request_no from patient_register as a
+left join register_check as b on a.id=b.patient_register_id
+where b.check_request_no='{input.CheckRequestNo}' and patient_name='{input.PatientName}'";
+
+ var patientList = oldDb.Ado.GetDataTable(oldSql);
+
+ if (patientList.Rows.Count > 0)
+ {
+ entDto.IsPass = 'Y';
+ entDto.Message = "验证成功";
+ }
+ else
+ {
+ entDto.IsPass = 'N';
+ entDto.Message = "验证失败";
+ }
+
+
+
+ return entDto;
+ }
+
#endregion
+ #region 老系统报告明细
+
+
+ ///
+ /// 调试用 增加老数据
+ ///
+ ///
+ ///
+ [HttpPost("api/app/Person/GetMedicalTimesListByPersonIdAndOld")]
+ public async Task> GetMedicalTimesListByPersonIdAndOldAsync(PersonIdInputDto input)
+ {
+ var entityList = (from user in await _identityUserRepository.GetQueryableAsync()
+ join person in await _repository.GetQueryableAsync()
+ on user.Id equals person.PersonId
+ join patient in await _patientRepository.GetQueryableAsync()
+ on new { idNo = person.IdNo, phone = user.PhoneNumber } equals new { idNo = patient.IdNo, phone = patient.MobileTelephone }
+ join patientRegister in await _patientRegisterRepository.GetQueryableAsync()
+ on patient.PatientId equals patientRegister.PatientId
+ where user.Id == input.PersonId &&
+ (patientRegister.CompleteFlag == PatientRegisterCompleteFlag.SumCheck) &&
+ !string.IsNullOrWhiteSpace(patientRegister.ReportFile)
+ orderby patientRegister.MedicalStartDate
+ select new PersonMedicalTimesDto()
+ {
+ PatientRegisterId = patientRegister.PatientRegisterId.ToString(),
+ PersonName = patient.PatientName,
+ MedicalStartDate = patientRegister.MedicalStartDate,
+ IsOld = 'N'
+ }).ToList();
+
+
+
+
+ var oldApiBaseUrl = _configuration.GetValue("Report:OldApiBaseUrl", "");
+
+ var patientInfo = (from user in await _identityUserRepository.GetQueryableAsync()
+ join person in await _repository.GetQueryableAsync()
+ on user.Id equals person.PersonId
+ where user.Id == input.PersonId
+ select new
+ {
+ user.PhoneNumber,
+ person.IdNo
+ }).FirstOrDefault();
+
+ if (patientInfo != null)
+ {
+ var inputParm = new GetPatientRegisterByIdNoInputDto
+ {
+ IdNo = patientInfo.IdNo,
+ MobileTelephone = patientInfo.PhoneNumber
+ };
+
+ var oldList = await CallAppServiceAsync>(oldApiBaseUrl, $"{oldApiBaseUrl}/api/PatientExamResult/GetPatientRegisterByIdNo", inputParm, "post");
+
+ if (oldList != null && oldList.Count > 0)
+ {
+ foreach (var item in oldList)
+ {
+ var isCz = entityList.FirstOrDefault(f => f.MedicalStartDate == item.MedicalStartDate);
+ if (isCz == null)
+ {
+ entityList.Add(item);
+ }
+ }
+ }
+ }
+
+
+ entityList = entityList.OrderBy(o => o.MedicalStartDate).ToList();
+
+ return entityList;
+
+ }
+
+
+ [HttpGet("api/app/Person/GetOldImages")]
+ public async Task