wxd 2 years ago
parent
commit
0f286cbcbc
  1. 19
      ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ImportPatientRegisterPlugInsGem.cs
  2. 2
      ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/ImportPacsResultPlugInsGemTest.cs
  3. 9
      ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/appsettings.json
  4. 22
      src/Shentun.ColumnReferencePlugIns/ImportLisResultPlugInsBase.cs
  5. 14
      src/Shentun.ColumnReferencePlugIns/PlugInsBase.cs
  6. 3
      src/Shentun.Peis.Domain.Shared/Enums/ThirdInterfaceTypeFlag.cs
  7. 3
      src/Shentun.Peis.Domain/ThirdInterfaces/ThirdInterfaceManager.cs
  8. 4
      src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs
  9. 5
      src/Shentun.Peis.HttpApi.Host/Schedulers/ImportPacsResultInterfaceWorker.cs
  10. 17
      src/Shentun.Peis.HttpApi.Host/Schedulers/ImportPatientRegisterInterfaceWorker.cs
  11. 4
      test/Shentun.Peis.ColumnReference.Tests/appsettings.json

19
ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ImportPatientRegisterPlugInsGem.cs

@ -34,6 +34,7 @@ namespace Shentun.Peis.PlugIns.Gem
private CustomerOrgRegisterDto _customerOrgRegisterDto;
private List<PersonnelTypeDto> _personnelTypes;
private List<CustomerOrgGroupDto> _customerOrgGroupDtos;
private string _answerWebApiUrl;
public ImportPatientRegisterPlugInsGem(string parmValue) : base(parmValue)
{
@ -43,8 +44,7 @@ namespace Shentun.Peis.PlugIns.Gem
{
await LoginAsync();
await InitAsync();
for (var i = 0; i < 30; i++)
{
var qztlPatientRegisterFromInterface = await CallInterfaceServiceAsync();
if (qztlPatientRegisterFromInterface == null || !qztlPatientRegisterFromInterface.plans.Any())
{
@ -272,7 +272,7 @@ namespace Shentun.Peis.PlugIns.Gem
var succesIds = new List<string>();
var deleteIds = new List<string>();
succesIds.Add(patientRegister.Planuserid);
await NoteOk(succesIds, deleteIds);
await AnswerOk(succesIds, deleteIds);
}
catch (Exception ex)
@ -291,12 +291,6 @@ namespace Shentun.Peis.PlugIns.Gem
}
}
}
}
public async Task InitAsync()
@ -304,6 +298,7 @@ namespace Shentun.Peis.PlugIns.Gem
var customerOrgIdStr = InterfaceConfig.GetSection("Interface").GetSection("单位编号").Value;
_hospitalId = InterfaceConfig.GetSection("Interface").GetSection("HospitalId").Value;
_aesKEY = InterfaceConfig.GetSection("Interface").GetSection("aesKEY").Value;
_answerWebApiUrl = InterfaceConfig.GetSection("Interface").GetSection("AnswerWebApiUrl").Value;
if (string.IsNullOrWhiteSpace(customerOrgIdStr))
{
return;
@ -401,7 +396,7 @@ namespace Shentun.Peis.PlugIns.Gem
result = await response.Content.ReadAsStringAsync();
result = result.Replace(":\"[{", ":[{").Replace("}]\"", "}]").Replace("\\", "");
if(result.IndexOf("status") < 0)
if (result.IndexOf("status") < 0)
{
throw new Exception($"调用WebApi中无status,返回值:" + result);
}
@ -655,7 +650,7 @@ namespace Shentun.Peis.PlugIns.Gem
}
public async Task NoteOk(List<string> successIds, List<string> deleteIds)
public async Task AnswerOk(List<string> successIds, List<string> deleteIds)
{
if (successIds == null || deleteIds == null)
{
@ -690,7 +685,7 @@ namespace Shentun.Peis.PlugIns.Gem
deleteIdStr += "," + deleteIds[i];
}
}
string baseAddress = "http://62.156.10.237:8005/health/values/SetPlanOK?";
string baseAddress = _answerWebApiUrl;// "http://62.156.10.237:8005/health/values/SetPlanOK?";
string ary = "HospitalId=" + _hospitalId + (Char)38 +
"ids=" + successIdStr + (Char)38 + "delids=" + deleteIdStr + (Char)38 + "AesKey=" + _aesKEY;
baseAddress = baseAddress + ary;

2
ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/ImportPacsResultPlugInsGemTest.cs

@ -28,7 +28,7 @@ namespace Shentun.Peis.PlugIns.Gem.Test
var item = await input.ImportResultAsync(
new ImportPacsResultPlugInsInput()
{
PatientRegisterId = new Guid("3a1277ab-376c-fbdb-4419-92bbb4594607")
PatientRegisterId = new Guid("3a128200-3d63-95cd-f870-635df8e999f2")
});

9
ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/appsettings.json

@ -9,8 +9,8 @@
"RedirectAllowedUrls": "http://localhost:9530",
"Sql": "select id::varchar as Code ,display_name as DisplayName ,simple_code as SimpleCode ,display_order as DisplayOrder from asbitem",
"ColumnNames": "编码,名称",
"AppUser": "admin",
"AppPassword": "666666"
"SelfUser": "admin",
"SelfPassword": "666666"
},
"Interface": {
@ -22,9 +22,10 @@
"Sql": "select ZHID as Code ,ZHMC as DisplayName from PORTAL56_LIS.vi_tj_testitemgroup",
"ColumnNames": "编码,名称",
"EndpointAddress": "http://10.1.12.140:8082/gemse-tj/services/bstj.bstjHttpSoap11Endpoint",
//"WebApiUrl": "http://10.1.13.18:8380/ris/findReportList",
"WebApiUrl": "http://10.1.13.18:8380/ris/findReportList",
"AnswerWebApiUrl": "http://62.156.10.237:8005/health/values/SetPlanOK?",
"单位编号": "3a126b36-831f-aa9f-ddfe-a82f660fc485",
"WebApiUrl": "http://62.156.10.237:8005/health/values/GetPlan?",
//"WebApiUrl": "http://62.156.10.237:8005/health/values/GetPlan?",
"aesKEY": "Vwso4P4vBkKw0AODd1LwqgL6vIW8np8m",
"HospitalId": "3",
"Scheduler": {

22
src/Shentun.ColumnReferencePlugIns/ImportLisResultPlugInsBase.cs

@ -12,15 +12,15 @@ namespace Shentun.Peis.PlugIns
public class ImportLisResultPlugInsBase : ThirdPlugInsBase
{
protected string AppLisUser;
protected string AppLisPassword;
//protected string AppLisUser;
//protected string AppLisPassword;
public ImportLisResultPlugInsBase(string parmValue) : base(parmValue)
{
AppLisUser = AppConfig.GetSection("App")
.GetSection("LisUser").Value;
AppLisPassword = AppConfig.GetSection("App")
.GetSection("LisPassword").Value;
//AppLisUser = AppConfig.GetSection("App")
// .GetSection("LisUser").Value;
//AppLisPassword = AppConfig.GetSection("App")
// .GetSection("LisPassword").Value;
}
public virtual async Task<ImportLisResultPlugInsOut> ImportResultAsync(ImportLisResultPlugInsInput input)
{
@ -100,10 +100,10 @@ ORDER BY register_check.patient_register_id
return Task.CompletedTask;
}
protected async override Task<LoginOutDto> LoginAsync()
{
var relult = await LoginAsync(AppLisUser, AppLisPassword);
return relult;
}
//protected async override Task<LoginOutDto> LoginAsync()
//{
// var relult = await LoginAsync(AppLisUser, AppLisPassword);
// return relult;
//}
}
}

14
src/Shentun.ColumnReferencePlugIns/PlugInsBase.cs

@ -24,8 +24,8 @@ namespace Shentun.Peis.PlugIns
protected string? AppConnctionStr;
private string _appBaseAddress;
private string _accesToken;
protected string? AppUser;
protected string? AppPassword;
protected string? SelfUser;
protected string? SelfPassword;
protected string InterfaceSql;
protected string InterfaceSqlKeyColumn;
@ -53,10 +53,10 @@ namespace Shentun.Peis.PlugIns
.GetSection("Default").Value;
_appBaseAddress = AppConfig.GetSection("App")
.GetSection("SelfUrl").Value;
AppUser = AppConfig.GetSection("App")
.GetSection("AppUser").Value;
AppPassword = AppConfig.GetSection("App")
.GetSection("AppPassword").Value;
SelfUser = AppConfig.GetSection("App")
.GetSection("SelfUser").Value;
SelfPassword = AppConfig.GetSection("App")
.GetSection("SelfPassword").Value;
var configurationBuilder = new ConfigurationBuilder()
.AddJsonStream(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(parmValue)));
@ -199,7 +199,7 @@ namespace Shentun.Peis.PlugIns
protected async virtual Task<LoginOutDto> LoginAsync()
{
var relult = await LoginAsync(AppUser, AppPassword);
var relult = await LoginAsync(SelfUser, SelfPassword);
return relult;
}
public async Task<LoginOutDto> LoginAsync(string userId,string password)

3
src/Shentun.Peis.Domain.Shared/Enums/ThirdInterfaceTypeFlag.cs

@ -20,5 +20,8 @@ namespace Shentun.Peis.Enums
[Description("Pacs结果导入")]
public const string ImportPacsResult = "04";
[Description("人员登记信息结果导入")]
public const string ImportPatientRegister = "05";
}
}

3
src/Shentun.Peis.Domain/ThirdInterfaces/ThirdInterfaceManager.cs

@ -121,7 +121,8 @@ namespace Shentun.Peis.ThirdInterfaces
if (entity.ThirdInterfaceType != ThirdInterfaceTypeFlag.LisRequest
&& entity.ThirdInterfaceType != ThirdInterfaceTypeFlag.ChargeRequest
&& entity.ThirdInterfaceType != ThirdInterfaceTypeFlag.ImportLisResult
&& entity.ThirdInterfaceType != ThirdInterfaceTypeFlag.ImportPacsResult)
&& entity.ThirdInterfaceType != ThirdInterfaceTypeFlag.ImportPacsResult
&& entity.ThirdInterfaceType != ThirdInterfaceTypeFlag.ImportPatientRegister)
{
throw new ArgumentException($"接口类型参数为:{entity.ThirdInterfaceType},是无效值");
}

4
src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs

@ -619,6 +619,10 @@ public class PeisHttpApiHostModule : AbpModule
{
RecurringJob.AddOrUpdate<IImportPacsResultInterfaceWorker>("导入Pacs结果接口", o => o.DoWork(thirdInterfaceDto.Id), corn, TimeZoneInfo.Local);
}
else if (thirdInterfaceDto.ThirdInterfaceType == "05")
{
RecurringJob.AddOrUpdate<IImportPatientRegisterInterfaceWorker>("导入人员登记信息结果接口", o => o.DoWork(thirdInterfaceDto.Id), corn, TimeZoneInfo.Local);
}
}
}

5
src/Shentun.Peis.HttpApi.Host/Schedulers/ImportPacsResultInterfaceWorker.cs

@ -17,10 +17,7 @@ namespace Shentun.Peis.Schedulers
}
public class ImportPacsResultInterfaceWorker : ThirdInterfaceWorkerBase, IImportPacsResultInterfaceWorker
{
private string isActive = "N";
private static long i;
private static bool _isRunning = false;
private static readonly object lockObject = new object();
public void DoWork()

17
src/Shentun.Peis.HttpApi.Host/Schedulers/ImportPatientRegisterInterfaceWorker.cs

@ -0,0 +1,17 @@
using System;
namespace Shentun.Peis.Schedulers
{
public interface IImportPatientRegisterInterfaceWorker
{
public void DoWork(Guid interfaceId);
public void DoWork();
}
public class ImportPatientRegisterInterfaceWorker : ThirdInterfaceWorkerBase, IImportPatientRegisterInterfaceWorker
{
public void DoWork()
{
throw new NotImplementedException();
}
}
}

4
test/Shentun.Peis.ColumnReference.Tests/appsettings.json

@ -9,8 +9,8 @@
"Sql": "SELECT TMH AS LisRequestNo,TJBH AS PatientId,TESTID as ItemId,XMMC as ItemName,XMJG as Result,UNIT as Unit,CKFW AS ReferenceRangeValue FROM PORTAL56_LIS.VI_TJ_RESULT",
"ColumnNames": "Code=编码,DisplayName=名称",
"AsbitemColumnReferenceId": "",
"LisUser": "admin",
"LisPassword": "666666"
"SelfUser": "admin",
"SelfPassword": "666666"
},
"Interface": {
//"DbType": "SqlServer",

Loading…
Cancel
Save