diff --git a/src/Shentun.Peis.Application.Contracts/ThirdPartyPublicInterfaces/PatientPacsInfoDto.cs b/src/Shentun.Peis.Application.Contracts/ThirdPartyPublicInterfaces/PatientPacsInfoDto.cs
new file mode 100644
index 0000000..4ca87a8
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/ThirdPartyPublicInterfaces/PatientPacsInfoDto.cs
@@ -0,0 +1,110 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.ThirdPartyPublicInterfaces
+{
+ public class PatientPacsInfoDto
+ {
+ ///
+ /// 人员信息
+ ///
+ public PatientPacsInfo_PatientInfoDto PatientInfo { get; set; }
+
+ ///
+ /// 项目信息
+ ///
+ public List Items { get; set; }
+ }
+
+ public class PatientPacsInfo_ItemsDto
+ {
+ ///
+ /// 申请单号 (check_request_no+排序值) check_request_no-1 check_request_no-2
+ ///
+ public string sqdh { get; set; }
+
+ ///
+ /// 项目编号 id
+ ///
+ public string xmbh { get; set; }
+
+ ///
+ /// 项目名称
+ ///
+ public string xmmc { get; set; }
+
+ ///
+ /// 检查类型
+ ///
+ public string xmlx { get; set; }
+
+ ///
+ /// 科室编码 id
+ ///
+ public string ksbm { get; set; }
+
+ ///
+ /// 科室名称
+ ///
+ public string ksmc { get; set; }
+ }
+
+ public class PatientPacsInfo_PatientInfoDto
+ {
+ ///
+ /// 体检编号 对应check_request_no
+ ///
+ public string tjbh { get; set; }
+
+ ///
+ /// 姓名
+ ///
+ public string xm { get; set; }
+
+ ///
+ /// 性别 性别代码1.男 2.女 9.未知
+ ///
+ public string xb { get; set; }
+
+ ///
+ /// 年龄
+ ///
+ public string nl { get; set; }
+
+ ///
+ /// 出生日期 (格式yyyy-MM-dd HH:mm:SS)
+ ///
+ public string csrq { get; set; }
+
+ ///
+ /// 登记人
+ ///
+ public string djr { get; set; }
+
+ ///
+ /// 登记日期 (格式yyyy-MM-dd HH:mm:SS)
+ ///
+ public string djrq { get; set; }
+
+ ///
+ /// 身份证号
+ ///
+ public string sfzh { get; set; }
+
+ ///
+ /// 体检日期(格式yyyy-MM-dd HH:mm:SS)
+ ///
+ public string tjrq { get; set; }
+
+ ///
+ /// 联系电话
+ ///
+ public string lxdh { get; set; }
+
+ ///
+ /// 地址
+ ///
+ public string addr { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/ThirdPartyPublicInterfaces/PatientPacsInfoInputDto.cs b/src/Shentun.Peis.Application.Contracts/ThirdPartyPublicInterfaces/PatientPacsInfoInputDto.cs
new file mode 100644
index 0000000..ace0bba
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/ThirdPartyPublicInterfaces/PatientPacsInfoInputDto.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.ThirdPartyPublicInterfaces
+{
+ public class PatientPacsInfoInputDto
+ {
+ ///
+ /// 体检编号
+ ///
+ public string tjbh { get; set; }
+
+ ///
+ /// 检查类型
+ ///
+ public string xmlx { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs b/src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs
index 61e5d19..3aced6f 100644
--- a/src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs
+++ b/src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs
@@ -19,7 +19,6 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces
///
/// 第三方公开接口
///
- [Authorize(PeisPermissions.Third.Default)]
public class ThirdPartyPublicInterfaceAppService : ApplicationService
{
private readonly IRepository _patientRegisterRepository;
@@ -28,6 +27,8 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces
private readonly IRepository _registerCheckItemRepository;
private readonly IRepository- _itemRepository;
private readonly IRepository _itemTypeRepository;
+ private readonly IRepository _asbitemRepository;
+ private readonly IRepository _patientRepository;
private readonly CacheService _cacheService;
public ThirdPartyPublicInterfaceAppService(
IRepository patientRegisterRepository,
@@ -36,7 +37,9 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces
IRepository registerCheckAsbitemRepository,
IRepository registerCheckItemRepository,
IRepository
- itemRepository,
- IRepository itemTypeRepository)
+ IRepository itemTypeRepository,
+ IRepository asbitemRepository,
+ IRepository patientRepository)
{
_patientRegisterRepository = patientRegisterRepository;
_cacheService = cacheService;
@@ -45,6 +48,8 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces
_registerCheckItemRepository = registerCheckItemRepository;
_itemRepository = itemRepository;
_itemTypeRepository = itemTypeRepository;
+ _asbitemRepository = asbitemRepository;
+ _patientRepository = patientRepository;
}
@@ -53,6 +58,7 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces
///
///
///
+ [Authorize(PeisPermissions.Third.Default)]
[HttpPost("api/Third/ThirdPartyPublicInterface/GetBasicInformationOfMedicalExaminationPersonnel")]
public async Task GetBasicInformationOfMedicalExaminationPersonnelAsync(PublicPatientRegisterNoInputDto input)
{
@@ -94,6 +100,7 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces
///
///
///
+ [Authorize(PeisPermissions.Third.Default)]
[HttpPost("api/Third/ThirdPartyPublicInterface/GetPhysicalExaminationDetailsItemInformation")]
public async Task
> GetPhysicalExaminationDetailsItemInformationAsync(PublicPatientRegisterNoInputDto input)
{
@@ -138,5 +145,86 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces
+
+ ///
+ /// 查询pacs条码信息
+ ///
+ ///
+ ///
+ [HttpPost("api/Third/ThirdPartyPublicInterface/getPatientItems")]
+ public async Task GetPatientPacsInfoAsync(PatientPacsInfoInputDto input)
+ {
+ if (input == null)
+ {
+ throw new UserFriendlyException($"请求参数错误");
+ }
+
+ if (string.IsNullOrEmpty(input.tjbh))
+ throw new UserFriendlyException($"体检编号不能为空");
+
+
+ var query = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
+ join patient in await _patientRepository.GetQueryableAsync() on patientRegister.PatientId equals patient.Id into patientTemp
+ from patientHaveEmpty in patientTemp.DefaultIfEmpty()
+ 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 itemType in await _itemTypeRepository.GetQueryableAsync() on asbitem.ItemTypeId equals itemType.Id into itemTypeTemp
+ from itemTypeHaveEmpty in itemTypeTemp.DefaultIfEmpty()
+ where registerCheck.CheckRequestNo == input.tjbh
+ orderby asbitem.DisplayOrder ascending
+ select new
+ {
+ patientRegister,
+ IdNo = patientHaveEmpty != null ? patientHaveEmpty.IdNo : "",
+ MobileTelephone = patientHaveEmpty != null ? patientHaveEmpty.MobileTelephone : "",
+ CheckRequestNo = registerCheck.CheckRequestNo,
+ asbitem,
+ ItemTypeName = itemTypeHaveEmpty != null ? itemTypeHaveEmpty.DisplayName : "",
+ ItemTypeId = itemTypeHaveEmpty != null ? itemTypeHaveEmpty.Id.ToString() : ""
+ }).ToList();
+
+
+ if (!string.IsNullOrEmpty(input.xmlx))
+ {
+ //检查类型检索
+ }
+
+ if (query.Count == 0)
+ throw new UserFriendlyException($"体检编号不存在");
+
+ var patientInfo = new PatientPacsInfo_PatientInfoDto
+ {
+ addr = "",
+ tjbh = query.FirstOrDefault().CheckRequestNo,
+ csrq = query.FirstOrDefault().patientRegister.BirthDate != null ? query.FirstOrDefault().patientRegister.BirthDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
+ djr = _cacheService.GetSurnameAsync(query.FirstOrDefault().patientRegister.CreatorId).Result,
+ djrq = query.FirstOrDefault().patientRegister.CreationTime.ToString("yyyy-MM-dd HH:mm:ss"),
+ lxdh = query.FirstOrDefault().MobileTelephone,
+ nl = query.FirstOrDefault().patientRegister.Age.ToString(),
+ sfzh = query.FirstOrDefault().IdNo,
+ tjrq = query.FirstOrDefault().patientRegister.MedicalStartDate != null ? query.FirstOrDefault().patientRegister.MedicalStartDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
+ xb = query.FirstOrDefault().patientRegister.SexId == 'M' ? "1" : (query.FirstOrDefault().patientRegister.SexId == 'F' ? "2" : "9"),
+ xm = query.FirstOrDefault().patientRegister.PatientName
+ };
+
+
+ var items = query.Select(s => new PatientPacsInfo_ItemsDto
+ {
+ ksbm = s.ItemTypeId,
+ ksmc = s.ItemTypeName,
+ sqdh = s.CheckRequestNo + "-" + (query.IndexOf(s) + 1),
+ xmbh = s.asbitem.Id.ToString(),
+ xmlx = "1",
+ xmmc = s.asbitem.DisplayName,
+ }).ToList();
+
+ return new PatientPacsInfoDto
+ {
+ PatientInfo = patientInfo,
+ Items = items
+ };
+ }
+
}
}
diff --git a/src/Shentun.Peis.HttpApi.Host/Filter/CustomerActionFilterAttribute.cs b/src/Shentun.Peis.HttpApi.Host/Filter/CustomerActionFilterAttribute.cs
index ae2ad08..7cc99d9 100644
--- a/src/Shentun.Peis.HttpApi.Host/Filter/CustomerActionFilterAttribute.cs
+++ b/src/Shentun.Peis.HttpApi.Host/Filter/CustomerActionFilterAttribute.cs
@@ -2,15 +2,20 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Newtonsoft.Json;
+using NPOI.SS.Formula.Functions;
+using OpenAI_API.Moderation;
using Shentun.Peis.DiagnosisFunctions;
+using Shentun.Peis.Filter;
//using Microsoft.AspNetCore.Mvc;
//using Microsoft.AspNetCore.Mvc.Filters;
using Shentun.WebApi.Service;
+using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Volo.Abp;
+using static Shentun.Peis.Permissions.PeisPermissions;
namespace Shentun.Peis
{
@@ -19,9 +24,6 @@ namespace Shentun.Peis
///
public class CustomerActionFilterAttribute : ActionFilterAttribute
{
-
-
-
public override void OnActionExecuted(ActionExecutedContext context)
{
//if (context.Result is ObjectResult objRst)
@@ -55,32 +57,24 @@ namespace Shentun.Peis
else
{
-
-
- List filterApiUrl = new List { "/api/app/diagnosisfunction/getdiagnosisresult" };
-
-
- if (!filterApiUrl.Contains(context.HttpContext.Request.Path.ToString().ToLower()))
+ List filterApiUrl = new List { "/api/third/thirdpartypublicinterface/getpatientitems" };
+
+ if (filterApiUrl.Contains(context.HttpContext.Request.Path.ToString().ToLower()))
+ {
+ ThirdReturn msg = new ThirdReturn
+ {
+ code = "200",
+ message = "处理成功",
+ data = result.Value
+ };
+
+ context.Result = new OkObjectResult(msg);
+ }
+ else
{
context.Result = new OkObjectResult(ReturnValue.CreateSuccessInstance(result.Value));
-
- //Type type = result.Value.GetType();
-
- //PropertyInfo IsTH = type.GetProperty("CustomerMessage");
-
- //if (IsTH != null)
- //{
- // string message = IsTH.GetValue(result.Value).ToString();
-
- // //FieldInfo field = type.GetField("<" + IsTH.Name + ">k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance); // 根据属性名称生成字段名称
- // //if (field != null)
- // // field.SetValue(result.Value, null); // 将字段值设置为 null,相当于删除属性
- //}
-
- //GetDiagnosisResultDto myObj = (GetDiagnosisResultDto)result.Value;
- //context.Result = new OkObjectResult(ReturnValue.CreateCustomErrorInstance(result.Value, message));
}
-
+
}
@@ -122,14 +116,14 @@ namespace Shentun.Peis
//var result = context.Result as FileContentResult;
//context.Result = new OkObjectResult(result);
}
+
//else if (context.Result == null)
//{
// //全局加返回值
// context.Result = new OkObjectResult(ReturnValue.CreateErrorInstance(context.Exception.Message));
//}
else
- {
-
+ {
//if (context.Exception != null && !string.IsNullOrEmpty(context.Exception.Message))
//{
// context.Result = new OkObjectResult(ReturnValue.CreateErrorInstance(context.Exception.Message));
diff --git a/src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs b/src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs
index a5181a5..542cf55 100644
--- a/src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs
+++ b/src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs
@@ -3,8 +3,10 @@ using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
+using Shentun.Peis.Filter;
using Shentun.WebApi.Service;
using System;
+using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp;
@@ -77,7 +79,7 @@ namespace Shentun.Peis
{
errorMessage = exceptionContext.Exception.Message;
}
-
+
}
else
{
@@ -85,14 +87,43 @@ namespace Shentun.Peis
}
- exceptionContext.Result = new ContentResult
+ List filterApiUrl = new List { "/api/third/thirdpartypublicinterface/getpatientitems" };
+
+
+ if (filterApiUrl.Contains(exceptionContext.HttpContext.Request.Path.ToString().ToLower()))
{
- // 返回状态码设置为200,表示成功
- StatusCode = 200,
- // 设置返回格式
- ContentType = "application/json;charset=utf-8",
- Content = JsonConvert.SerializeObject(ReturnValue.CreateErrorInstance(errorMessage))
- };
+ ThirdReturn msg = new ThirdReturn
+ {
+ code = "-1",
+ message = exceptionContext.Exception.Message,
+ data = null
+ };
+
+
+ exceptionContext.Result = new ContentResult
+ {
+ // 返回状态码设置为200,表示成功
+ StatusCode = 200,
+ // 设置返回格式
+ ContentType = "application/json;charset=utf-8",
+ Content = JsonConvert.SerializeObject(msg)
+ };
+ }
+ else
+ {
+
+ exceptionContext.Result = new ContentResult
+ {
+ // 返回状态码设置为200,表示成功
+ StatusCode = 200,
+ // 设置返回格式
+ ContentType = "application/json;charset=utf-8",
+ Content = JsonConvert.SerializeObject(ReturnValue.CreateErrorInstance(errorMessage))
+ };
+ }
+
+
+
}
// 设置为true,表示异常已经被处理了
diff --git a/src/Shentun.Peis.HttpApi.Host/Filter/ThirdReturn.cs b/src/Shentun.Peis.HttpApi.Host/Filter/ThirdReturn.cs
new file mode 100644
index 0000000..56ad795
--- /dev/null
+++ b/src/Shentun.Peis.HttpApi.Host/Filter/ThirdReturn.cs
@@ -0,0 +1,11 @@
+namespace Shentun.Peis.Filter
+{
+ public class ThirdReturn
+ {
+ public string code { get; set; }
+
+ public string message { get; set; }
+
+ public object data { get; set; }
+ }
+}