Commit 272deee2 by tangzhongyang

1

parent af0984c3
...@@ -71,12 +71,12 @@ public AnalysisController(IMemoryCache cache, AnalysisQueries aQueries, HomeQuer ...@@ -71,12 +71,12 @@ public AnalysisController(IMemoryCache cache, AnalysisQueries aQueries, HomeQuer
} }
if (sys_.num <= 5) if (sys_.num <= 5)
{ {
_aQueries.updateztZ(id, sys_.hosid, "--5匹配更新标准库 DIC_DRUG_ATC的标准字段"); _aQueries.updateztZ(id, sys_.hosid, "--5匹配更新标准库DIC_DRUG_ATC的标准字段");
_aQueries.JX_DIC_DRUG_ATC(id, sys_.hosid);//5匹配更新标准库 DIC_DRUG_ATC的标准字段 _aQueries.JX_DIC_DRUG_ATC(id, sys_.hosid);//5匹配更新标准库 DIC_DRUG_ATC的标准字段
} }
if (sys_.num <= 6) if (sys_.num <= 6)
{ {
_aQueries.updateztZ(id, sys_.hosid, "--6未匹配上的导入 [dbo].[DA_Drug] 做处理"); _aQueries.updateztZ(id, sys_.hosid, "--6未匹配上的导入DA_Drug 做处理");
_aQueries.JX_ADD_DA_Drug(id, sys_.hosid);//6未匹配上的导入 [dbo].[DA_Drug] 做处理 _aQueries.JX_ADD_DA_Drug(id, sys_.hosid);//6未匹配上的导入 [dbo].[DA_Drug] 做处理
} }
if (sys_.num <= 7) if (sys_.num <= 7)
...@@ -91,7 +91,7 @@ public AnalysisController(IMemoryCache cache, AnalysisQueries aQueries, HomeQuer ...@@ -91,7 +91,7 @@ public AnalysisController(IMemoryCache cache, AnalysisQueries aQueries, HomeQuer
} }
if (sys_.num <= 9) if (sys_.num <= 9)
{ {
_aQueries.updateztZ(id, sys_.hosid, "--9新导入的诊断跑权重,生成标准科室,标准一级诊断,标准二级诊断"); _aQueries.updateztZ(id, sys_.hosid, "--9新导入的诊断跑权重,生成标准科室,标准一级诊断,标准二级诊断");
_aQueries.JX_DIAGNOSIS_DATA_QZ(sys_.hosid);//9新导入的诊断跑权重,生成标准科室,标准一级诊断,标准二级诊断 _aQueries.JX_DIAGNOSIS_DATA_QZ(sys_.hosid);//9新导入的诊断跑权重,生成标准科室,标准一级诊断,标准二级诊断
} }
if (sys_.num <= 10) if (sys_.num <= 10)
...@@ -111,7 +111,7 @@ public AnalysisController(IMemoryCache cache, AnalysisQueries aQueries, HomeQuer ...@@ -111,7 +111,7 @@ public AnalysisController(IMemoryCache cache, AnalysisQueries aQueries, HomeQuer
} }
if (sys_.num <= 13) if (sys_.num <= 13)
{ {
_aQueries.updateztZ(id, sys_.hosid, "--13医保(1--插入card_type表,2--更改SOURCE ,3--修改登记表i_card_type)"); _aQueries.updateztZ(id, sys_.hosid, "--13医保(1插入card_type表,2更改SOURCE,3修改登记表i_card_type)");
_aQueries.JX_REMOVE_CARD_TYPE(id, sys_.hosid);//13医保(1--插入card_type表,2--更改SOURCE ,3--修改登记表i_card_type) _aQueries.JX_REMOVE_CARD_TYPE(id, sys_.hosid);//13医保(1--插入card_type表,2--更改SOURCE ,3--修改登记表i_card_type)
} }
if (sys_.num <= 14) if (sys_.num <= 14)
...@@ -136,10 +136,6 @@ public AnalysisController(IMemoryCache cache, AnalysisQueries aQueries, HomeQuer ...@@ -136,10 +136,6 @@ public AnalysisController(IMemoryCache cache, AnalysisQueries aQueries, HomeQuer
{ {
semaphore.Release(); semaphore.Release();
} }
} }
/// <summary> /// <summary>
/// 下拉框 /// 下拉框
......
...@@ -31,61 +31,92 @@ public DrugqueryController(DrugqueryQueries drugqueryQueries, HomeQueries homeQu ...@@ -31,61 +31,92 @@ public DrugqueryController(DrugqueryQueries drugqueryQueries, HomeQueries homeQu
{ {
var icd_or_diseaseCondition = ""; var icd_or_diseaseCondition = "";
var notdisease = ""; var notdisease = "";
var notdrugs = "";
var notmaterialName = "";
long type = 0; long type = 0;
long num = 0; long num = 0;
var drugs = ""; var drugs = "";
var materialNames = ""; var materialNames = "";
//icd 诊断
if (sYS_Drugquery.icd != null) if (sYS_Drugquery.icd != null)
{ {
foreach (var icdname in sYS_Drugquery.icd) foreach (var icdname in sYS_Drugquery.icd)
{ {
if (!string.IsNullOrEmpty(icdname)) if (!string.IsNullOrEmpty(icdname) & !icdname.Contains("!") & !icdname.Contains("!"))
icd_or_diseaseCondition = icd_or_diseaseCondition + $"or icd like '%{icdname}%'"; icd_or_diseaseCondition = icd_or_diseaseCondition + $"or icd like '%{icdname}%'";
if (!string.IsNullOrEmpty(icdname) & (icdname.Contains("!") || icdname.Contains("!")))
notdisease = notdisease + $"and icd not like '%{icdname.Replace("!", "").Replace("!", "")}%'";
} }
} }
if (sYS_Drugquery.diseaseName != null) if (sYS_Drugquery.diseaseName != null)
{ {
foreach (var disease in sYS_Drugquery.diseaseName) foreach (var disease in sYS_Drugquery.diseaseName)
{ {
if (!string.IsNullOrEmpty(disease)& !disease.Contains("!")) if (!string.IsNullOrEmpty(disease) & !disease.Contains("!") & !disease.Contains("!"))
{
icd_or_diseaseCondition = icd_or_diseaseCondition + $"or DISEASE_NAME like '%{disease}%'"; icd_or_diseaseCondition = icd_or_diseaseCondition + $"or DISEASE_NAME like '%{disease}%'";
}
if (!string.IsNullOrEmpty(disease) & disease.Contains("!")) else
notdisease = notdisease + $"and DISEASE_NAME not like '%{disease.Replace("!","").Replace("!", "")}%'"; {
notdisease = notdisease + $"and DISEASE_NAME not like '%{disease.Replace("!", "").Replace("!", "")}%'";
}
} }
} }
if (icd_or_diseaseCondition.Length > 0) if (icd_or_diseaseCondition.Length > 0)
{ {
icd_or_diseaseCondition = icd_or_diseaseCondition.Substring(2, icd_or_diseaseCondition.Length - 2); icd_or_diseaseCondition = icd_or_diseaseCondition.Substring(2, icd_or_diseaseCondition.Length - 2);
if (notdisease.Length > 0) if (notdisease.Length > 0)
icd_or_diseaseCondition = "(" + icd_or_diseaseCondition + ")" + notdisease; icd_or_diseaseCondition = "(" + icd_or_diseaseCondition + ")" + notdisease;
} }
//药品
if (sYS_Drugquery.drugName != null) if (sYS_Drugquery.drugName != null)
{ {
foreach (var drug in sYS_Drugquery.drugName) foreach (var drug in sYS_Drugquery.drugName)
{ {
if (!string.IsNullOrEmpty(drug)) if (!string.IsNullOrEmpty(drug) & !drug.Contains("!") & !drug.Contains("!"))
{
drugs = drugs + $"or item_name like '%{drug}%'"; drugs = drugs + $"or item_name like '%{drug}%'";
}
else
{
notdrugs = notdrugs + $"and item_name not like '%{drug.Replace("!", "").Replace("!", "")}%'";
}
} }
} }
if (drugs.Length > 0) if (drugs.Length > 0)
{ {
drugs = drugs.Substring(2, drugs.Length - 2); drugs = drugs.Substring(2, drugs.Length - 2);
if (notdrugs.Length > 0)
drugs = "(" + drugs + ")" + notdrugs;
} }
//材料
if (sYS_Drugquery.materialName != null) if (sYS_Drugquery.materialName != null)
{ {
foreach (var materialname in sYS_Drugquery.materialName) foreach (var materialname in sYS_Drugquery.materialName)
{ {
if (!string.IsNullOrEmpty(materialname)) if (!string.IsNullOrEmpty(materialname) & !materialname.Contains("!") & !materialname.Contains("!"))
{
materialNames = materialNames + $"or item_name like '%{materialname}%'"; materialNames = materialNames + $"or item_name like '%{materialname}%'";
}
else
{
notmaterialName = notmaterialName + $"and item_name not like '%{materialname.Replace("!", "").Replace("!", "")}%'";
}
} }
} }
if (materialNames.Length > 0) if (materialNames.Length > 0)
{ {
materialNames = materialNames.Substring(2, materialNames.Length - 2); materialNames = materialNames.Substring(2, materialNames.Length - 2);
if (notmaterialName.Length > 0)
materialNames = "(" + materialNames + ")" + notmaterialName;
} }
if (!string.IsNullOrEmpty(icd_or_diseaseCondition) && string.IsNullOrEmpty(drugs) && string.IsNullOrEmpty(materialNames)) if (!string.IsNullOrEmpty(icd_or_diseaseCondition) && string.IsNullOrEmpty(drugs) && string.IsNullOrEmpty(materialNames))
{ {
type = 1;//1疾病 type = 1;//1疾病
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
using QueryPlatform.Api.Infrastructure.Queries; using QueryPlatform.Api.Infrastructure.Queries;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
...@@ -211,33 +213,34 @@ public IActionResult Update(DATAEXTRACT dataExtract) ...@@ -211,33 +213,34 @@ public IActionResult Update(DATAEXTRACT dataExtract)
} }
//网站拉取json //网站拉取json
//[HttpPost("Ybyp")] [HttpPost("Ybyp")]
//[AllowAnonymous] [AllowAnonymous]
//public async Task<IActionResult> Ybyp() public async Task<IActionResult> Ybyp( int dqy,int zys)
//{ {
// for (long i = 1188; i <= 2104; i++) for (long i = dqy; i <= zys; i++)
// { {
// var client = new HttpClient(); var client = new HttpClient();
// var request = new HttpRequestMessage var request = new HttpRequestMessage
// { {
// Method = HttpMethod.Post, Method = HttpMethod.Post,
// RequestUri = new Uri("https://code.nhsa.gov.cn/yp/getPublishGoodsDataInfo.html?companyNameSc=&registeredProductName=&approvalCode=&batchNumber=20220920&_search=false&nd=1663825733775&rows=100&page="+i+"&sidx=&sord=asc"), RequestUri = new Uri("https://code.nhsa.gov.cn/yp/getPublishGoodsDataInfo.html?companyNameSc=&registeredProductName=&approvalCode=&batchNumber=20220920&_search=false&nd=1663825733775&rows=100&page=" + i + "&sidx=&sord=asc"),
// Content = new StringContent("{\r\n\"companyNameSc\":null,\r\n\"registeredProductName\": null,\r\n\"approvalCode\": null,\r\n\"batchNumber\": \"20220920\",\r\n\"_search\": false,\r\n\"nd\": \"1663825733775\",\r\n\"rows\": 100,\r\n\"page\": "+i+",\r\n\"sidx\":null,\r\n\"sord\": \"asc\",\r\n}") Content = new StringContent("{\r\n\"companyNameSc\":null,\r\n\"registeredProductName\": null,\r\n\"approvalCode\": null,\r\n\"batchNumber\": \"20220920\",\r\n\"_search\": false,\r\n\"nd\": \"1663825733775\",\r\n\"rows\": 100,\r\n\"page\": " + i + ",\r\n\"sidx\":null,\r\n\"sord\": \"asc\",\r\n}")
// { {
// Headers = { ContentType = new MediaTypeHeaderValue("text/plain") } Headers = { ContentType = new MediaTypeHeaderValue("text/plain") }
// } }
// }; };
// using (var response = await client.SendAsync(request)) using (var response = await client.SendAsync(request))
// { {
// response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
// var body = await response.Content.ReadAsStringAsync(); var body = await response.Content.ReadAsStringAsync();
_homeQueries.Ybyp(body, i);
// _homeQueries.Ybyp(body, i); }
// }
// } }
// return Ok(); return Ok();
//} }
/// <summary> /// <summary>
/// 邮箱推送 /// 邮箱推送
/// </summary> /// </summary>
......
...@@ -82,7 +82,7 @@ public async Task<(IEnumerable<dynamic>, IEnumerable<dynamic>, string, string, I ...@@ -82,7 +82,7 @@ public async Task<(IEnumerable<dynamic>, IEnumerable<dynamic>, string, string, I
[AllowAnonymous] [AllowAnonymous]
public async Task<string> DownloadFileAsync([FromBody] SYS_Cs sYS_Cs) public async Task<string> DownloadFileAsync([FromBody] SYS_Cs sYS_Cs)
{ {
var dz = await resourceQueries.ProjectReport1(sYS_Cs.id, sYS_Cs.MEDIC_AREA, sYS_Cs.item_name, sYS_Cs.GENERIC_NAME, sYS_Cs.PROJECT_NAME, sYS_Cs.icd, sYS_Cs.DISEASE_NAME, _webHostEnvironment.WebRootPath, 1); var dz = await resourceQueries.ProjectReport1(sYS_Cs.id, sYS_Cs.MEDIC_AREA, sYS_Cs.item_name, sYS_Cs.GENERIC_NAME, sYS_Cs.PROJECT_NAME, sYS_Cs.icd, sYS_Cs.DISEASE_NAME, _webHostEnvironment.WebRootPath, 1);
return dz.Item7; return dz.Item7;
} }
......
...@@ -54,22 +54,36 @@ public IEnumerable<dynamic> JxLx() ...@@ -54,22 +54,36 @@ public IEnumerable<dynamic> JxLx()
{ {
where = where + " and id =" + hos_id; where = where + " and id =" + hos_id;
} }
IEnumerable<dynamic> sj = Connection(181).Query($@"select*FROM( IEnumerable<dynamic> sj = Connection(181).Query($@"
SELECT ROW_NUMBER() OVER(ORDER BY ts desc,解析 )AS id,* FROM(SELECT select*FROM(
A.[ID] 编号,[HosName] 医院名称,[HosLevel] 医院等级,[HosType] 医院类型,[ExecOpenLink] 服务器,[ExecDatabase] 数据库, Replace([Province],' ','') 省份, SELECT ROW_NUMBER() OVER(ORDER BY ts desc,(select max(ksdate ) from [dbo].[解析任务] where hos_id =a.编号) desc,
Replace([Region],' ','') 市, Replace([City],' ','') 区, (SELECT concat('执行人:',czr,' 当前状态:',status,case when ts <>'' and ts is not null then concat(' 提示:',ts) else '' end ) FROM [dbo].[解析任务] where hos_id =a.id 医院等级,解析,Replace(Replace(医院名称,'新系统',''),'老系统','') desc )AS id,* FROM(
and ksdate=(select max(ksdate ) from [dbo].[解析任务] where hos_id =a.id)) 解析日志 , SELECT
case [ID] 编号,
when (SELECT status FROM [SV_QueryPlatform].[dbo].[解析任务] where hos_id =a.id and ksdate=(select max(ksdate ) from [dbo].[解析任务] where hos_id =a.id)) is null then 1 [HosName] 医院名称,
when (SELECT status FROM [SV_QueryPlatform].[dbo].[解析任务] where hos_id =a.id and ksdate=(select max(ksdate ) from [dbo].[解析任务] where hos_id =a.id))in ('执行完成','执行失败') then 1 [HosLevel] 医院等级,
else 0 end 解析, [HosType] 医院类型,
case [ExecOpenLink] 服务器,
when (SELECT ts FROM [SV_QueryPlatform].[dbo].[解析任务] where hos_id =a.id and ksdate=(select max(ksdate ) from [dbo].[解析任务] where hos_id =a.id)) like '%category未分类%' then 1 [ExecDatabase] 数据库,
else 0 end ts Replace([Province],' ','') 省份,
Replace([Region],' ','') 市,
FROM [192.168.18.156].[DB_SV_Data_Config].[dbo].[SYS_Hospital] A Replace([City],' ','') 区,
WHERE A.id<>1 and ExecOpenLink is not null and ExecDatabase is not null and case when isnull([ExecOpenLink],'')!='' and isnull([ExecDatabase],'')!=''
ExecOpenLink !='' and ExecDatabase !='' {where} )a )b WHERE id<={paseIndex}*10 and id>({paseIndex} - 1)*10 ").ToList(); then isnull(
(SELECT
concat('',status,
case when ts <>'' and ts is not null then concat(' 提示:',ts) else '' end
)FROM [dbo].[解析任务] where hos_id =a.id and ksdate=(select max(ksdate ) from [dbo].[解析任务] where hos_id =a.id)) ,'执行完成')
else null end 解析日志 ,
case
when (SELECT status FROM [SV_QueryPlatform].[dbo].[解析任务] where hos_id =a.id and ksdate=(select max(ksdate ) from [dbo].[解析任务] where hos_id =a.id)) is null then 1
when (SELECT status FROM [SV_QueryPlatform].[dbo].[解析任务] where hos_id =a.id and ksdate=(select max(ksdate ) from [dbo].[解析任务] where hos_id =a.id))in ('执行完成') then 1
else 0 end 解析,
case
when (SELECT ts FROM [SV_QueryPlatform].[dbo].[解析任务] where hos_id =a.id and ksdate=(select max(ksdate ) from [dbo].[解析任务] where hos_id =a.id)) like '%category未分类%' then 1
else 0 end ts
FROM [192.168.18.156].[DB_SV_Data_Config].[dbo].[SYS_Hospital] A WHERE A.id<>1 and isnull([ExecDatabase],'')!='' {where}
)a )b WHERE id<={paseIndex}*10 and id>({paseIndex} - 1)*10").ToList();
IEnumerable<dynamic> zon = Connection(181).Query($@" SELECT CAST(COUNT(*)AS MONEY)totalCount ,{paseIndex} paseIndex FROM( IEnumerable<dynamic> zon = Connection(181).Query($@" SELECT CAST(COUNT(*)AS MONEY)totalCount ,{paseIndex} paseIndex FROM(
SELECT DISTINCT * SELECT DISTINCT *
FROM [192.168.18.156].[DB_SV_Data_Config].[dbo].[SYS_Hospital] WHERE id<>1 and ExecOpenLink is not null and ExecDatabase is not null and FROM [192.168.18.156].[DB_SV_Data_Config].[dbo].[SYS_Hospital] WHERE id<>1 and ExecOpenLink is not null and ExecDatabase is not null and
...@@ -845,26 +859,26 @@ public void JX_INSERT_CATEGORY(int id, int hos_id) ...@@ -845,26 +859,26 @@ public void JX_INSERT_CATEGORY(int id, int hos_id)
hos = Connection(156, "DB_SV_Data_Config", "SV_DATA_CONFIG").Query<SYS_Hospital>(sql).FirstOrDefault(); hos = Connection(156, "DB_SV_Data_Config", "SV_DATA_CONFIG").Query<SYS_Hospital>(sql).FirstOrDefault();
服务器 fwq = Connection(181).Query<服务器>($"SELECT [服务器ip],[数据库账号],[数据库密码] FROM[SV_QueryPlatform].[dbo].[服务器] where[服务器ip] ='{hos.ExecOpenLink}'").FirstOrDefault(); 服务器 fwq = Connection(181).Query<服务器>($"SELECT [服务器ip],[数据库账号],[数据库密码] FROM[SV_QueryPlatform].[dbo].[服务器] where[服务器ip] ='{hos.ExecOpenLink}'").FirstOrDefault();
var msConnectionString = string.Format("Server={0};Database={1};User ID={2};Password={3};Trusted_Connection=False;", hos.ExecOpenLink, hos.ExecDatabase, fwq.数据库账号, fwq.数据库密码); var msConnectionString = string.Format("Server={0};Database={1};User ID={2};Password={3};Trusted_Connection=False;", hos.ExecOpenLink, hos.ExecDatabase, fwq.数据库账号, fwq.数据库密码);
var fwqip = hos.ExecOpenLink == "192.168.18.156" ? "" : @$"[{hos.ExecOpenLink}]."; var fwqip = "192.168.18.156" ;
sql = $@"INSERT intO [DB_SV_Data_Config].[dbo].[DA_Hos_Category] sql = $@"INSERT intO [DB_SV_Data_Config].[dbo].[DA_Hos_Category]
([category],[HospitalID]) ([category],[HospitalID])
SELECT t2.category,org_code SELECT t2.category,org_code
FROM [DB_SV_Data_Config].dbo.DA_Hos_Category t1 FROM [DB_SV_Data_Config].dbo.DA_Hos_Category t1
RIGHT JOIN (SELECT category,org_code RIGHT JOIN (SELECT category,org_code
FROM {fwqip}[{hos.ExecDatabase}].[dbo].[OUT_FEE] FROM [{hos.ExecOpenLink}].[{hos.ExecDatabase}].[dbo].[OUT_FEE]
GROUP BY category,org_code GROUP BY category,org_code
UNION UNION
SELECT category,org_code SELECT category,org_code
FROM {fwqip}[{hos.ExecDatabase}].[dbo].INPAT_FEE FROM [{hos.ExecOpenLink}].[{hos.ExecDatabase}].[dbo].INPAT_FEE
GROUP BY category,org_code) t2 GROUP BY category,org_code) t2
ON t1.category = t2.category ON t1.category = t2.category
WHERE t1.id IS NULL and t2.category is not null;"; WHERE t1.id IS NULL and t2.category is not null;";
updatezt(id, hos_id, sql.Replace("'", "''"), null); updatezt(id, hos_id, sql.Replace("'", "''"), null);
int num = Connection(156, "DB_SV_Data_Config", "SV_DATA_CONFIG").Execute(sql, commandTimeout: 60 * 60 * 12); int num = Connection(156, "DB_SV_Data_Config", "SV_DATA_CONFIG").Execute(hos.ExecOpenLink == "192.168.18.156"?sql.Replace("[192.168.18.156].",""):sql, commandTimeout: 60 * 60 * 12);
if (num > 0) if (num > 0)
{ {
updatezt(id, hos_id, sql.Replace("'", "''"), "您有category未分类,请到156配置库下添加category!!!select*from [192.168.18.156].[DB_SV_Data_Config].[dbo].[DA_Hos_Category] where HospitalID=" + hos_id); updatezt(id, hos_id, sql.Replace("'", "''"),@$"您有category未分类,请到156配置库下添加category!!!select*from [192.168.18.156].[DB_SV_Data_Config].[dbo].[DA_Hos_Category] where HospitalID={hos_id}");
} }
sql = $@"UPDATE [dbo].[OUT_FEE] sql = $@"UPDATE [dbo].[OUT_FEE]
SET I_TYPE_NAME = B.insurance_category SET I_TYPE_NAME = B.insurance_category
...@@ -887,7 +901,7 @@ public void JX_INSERT_CATEGORY(int id, int hos_id) ...@@ -887,7 +901,7 @@ public void JX_INSERT_CATEGORY(int id, int hos_id)
FROM [dbo].[INPAT_FEE] t LEFT JOIN [192.168.18.156].DB_SV_DATA_CONFIG.[dbo].[DA_Hos_Category] B FROM [dbo].[INPAT_FEE] t LEFT JOIN [192.168.18.156].DB_SV_DATA_CONFIG.[dbo].[DA_Hos_Category] B
ON B.CATEGORY=t.CATEGORY ON B.CATEGORY=t.CATEGORY
where I_TYPE_NAME = '挂号/诊查费' or I_TYPE_NAME = '手术/麻醉费' or I_TYPE_NAME = '床位/护理费'"; where I_TYPE_NAME = '挂号/诊查费' or I_TYPE_NAME = '手术/麻醉费' or I_TYPE_NAME = '床位/护理费'";
Connection(0, msConnectionString).Execute(sql, commandTimeout: 60 * 60 * 12); Connection(0, msConnectionString).Execute(hos.ExecOpenLink == "192.168.18.156" ? sql.Replace("[192.168.18.156].", "") : sql, commandTimeout: 60 * 60 * 12);
} }
} }
} }
...@@ -81,7 +81,7 @@ public long SqlAdd(SYS_Drugquery sYS_Drugquery, long type, string zxr) ...@@ -81,7 +81,7 @@ public long SqlAdd(SYS_Drugquery sYS_Drugquery, long type, string zxr)
DbConnection connection = new SqlConnection(_configConnectionString); DbConnection connection = new SqlConnection(_configConnectionString);
var sql = @$"INSERT into [SV_QueryPlatform_].[dbo].[MEDIC_SEARCH_RECORD]([HOS_TYPE],[PROJECT_NAME],[GENERIC_NAME],[COMMODITY_NAME],[DISEASE_NAME],[ICD], var sql = @$"INSERT into [SV_QueryPlatform_].[dbo].[MEDIC_SEARCH_RECORD]([HOS_TYPE],[PROJECT_NAME],[GENERIC_NAME],[COMMODITY_NAME],[DISEASE_NAME],[ICD],
[COMPLETE_MARK],[search_time],type ,[TYPE1_2],zxr ) [COMPLETE_MARK],[search_time],type ,[TYPE1_2],zxr )
VALUES(0,'{peojectName}','{ drugName}',null,'{diseaseName}', VALUES(0,'{peojectName}','{drugName}',null,'{diseaseName}',
'{icd}',0,getdate(),'{lx}','{sYS_Drugquery.type1_2}','{zxr}')"; '{icd}',0,getdate(),'{lx}','{sYS_Drugquery.type1_2}','{zxr}')";
connection.Execute(sql, commandTimeout: 60 * 60 * 5); connection.Execute(sql, commandTimeout: 60 * 60 * 5);
...@@ -136,7 +136,7 @@ public void updateCOMPLETE_MARK(long Indexs, long COMPLETE_MARK) ...@@ -136,7 +136,7 @@ public void updateCOMPLETE_MARK(long Indexs, long COMPLETE_MARK)
{ {
configConnection.Execute(@$" configConnection.Execute(@$"
EXEC SV_QueryPlatform_.[dbo].[MEDIC_PERSON_INFORMATION处理] @indexs ={Indexs} EXEC SV_QueryPlatform_.[dbo].[MEDIC_PERSON_INFORMATION处理] @indexs ={Indexs}
update [SV_QueryPlatform_].[dbo].[MEDIC_SEARCH_RECORD] set COMPLETE_MARK = 22,END_TIME=getdate() where COMPLETE_MARK != 22 and id= {Indexs}"); update [SV_QueryPlatform_].[dbo].[MEDIC_SEARCH_RECORD] set COMPLETE_MARK = 22,END_TIME=getdate() where COMPLETE_MARK != 22 and id= {Indexs}", commandTimeout: 60 * 60 * 5);
} }
if (COMPLETE_MARK == 21) if (COMPLETE_MARK == 21)
{ {
...@@ -211,7 +211,7 @@ UNION ALL ...@@ -211,7 +211,7 @@ UNION ALL
{item.ExecDatabase}.[DBO].PUB_PATIENT C {item.ExecDatabase}.[DBO].PUB_PATIENT C
WHERE A.REG_CODE=B.REG_CODE AND A.PERSON_CODE=C.PERSON_CODE"; WHERE A.REG_CODE=B.REG_CODE AND A.PERSON_CODE=C.PERSON_CODE";
conn.Execute(sql2, commandTimeout: 60 * 60 * 5); conn.Execute(sql2, commandTimeout: 60 * 60 * 5);
sql2 = $@" insert into [SV_QueryPlatform_].[dbo].MEDIC_PERSON_INFORMATION_{Indexs } sql2 = $@" insert into [SV_QueryPlatform_].[dbo].MEDIC_PERSON_INFORMATION_{Indexs}
( [HOS_ID],[MASTER_INDEX],[BIRTHDAY],[SEX],[PERSON_CODE],[PERSON_ID],[REG_CODE],[REG_ID],[REG_SOURCE], ( [HOS_ID],[MASTER_INDEX],[BIRTHDAY],[SEX],[PERSON_CODE],[PERSON_ID],[REG_CODE],[REG_ID],[REG_SOURCE],
[REG_TIME], AREA_ID,[INDEXS],[TYPE],[DEPT_NAME] ) [REG_TIME], AREA_ID,[INDEXS],[TYPE],[DEPT_NAME] )
SELECT [HOS_ID],[MASTER_INDEX],[BIRTHDAY],[SEX],[PERSON_CODE],[PERSON_ID],[REG_CODE],[REG_ID],[REG_SOURCE], SELECT [HOS_ID],[MASTER_INDEX],[BIRTHDAY],[SEX],[PERSON_CODE],[PERSON_ID],[REG_CODE],[REG_ID],[REG_SOURCE],
...@@ -349,7 +349,7 @@ public void Drugquery(long typefee, long type1_2, string drugs, string[] drugNam ...@@ -349,7 +349,7 @@ public void Drugquery(long typefee, long type1_2, string drugs, string[] drugNam
C.BIRTHDAY,C.SEX,1 TYPE,A.DEPT_NAME into [{item.ExecDatabase}].[dbo].MEDIC_PERSON_INFORMATION_{Indexs} C.BIRTHDAY,C.SEX,1 TYPE,A.DEPT_NAME into [{item.ExecDatabase}].[dbo].MEDIC_PERSON_INFORMATION_{Indexs}
FROM {item.ExecDatabase}.[dbo].OUT_REG_INFO A FROM {item.ExecDatabase}.[dbo].OUT_REG_INFO A
JOIN (SELECT DISTINCT REG_CODE,D.ID FROM {item.ExecDatabase}.[dbo].{mzb} E JOIN (SELECT DISTINCT REG_CODE,D.ID FROM {item.ExecDatabase}.[dbo].{mzb} E
join [192.168.18.181].[SV_QueryPlatform_].[dbo].[MEDIC_AREA_{Indexs}] D ON {(typefee==1?"E.ITEM_NAME": "REPLACE(REPLACE(E.MEDIC_GENERAL_NAME,E.MEDIC_SPEC,''),' ','')")} = D.ITEM_NAME AND ISNULL(E.MEDIC_AREA,'') = ISNULL(D.MEDIC_AREA,'') AND INDEXS={Indexs} AND HOS_ID = cast( RIGHT ( '{item.ExecDatabase}', 3 ) AS int ))B join [192.168.18.181].[SV_QueryPlatform_].[dbo].[MEDIC_AREA_{Indexs}] D ON {(typefee == 1 ? "E.ITEM_NAME" : "REPLACE(REPLACE(E.MEDIC_GENERAL_NAME,E.MEDIC_SPEC,''),' ','')")} = D.ITEM_NAME AND ISNULL(E.MEDIC_AREA,'') = ISNULL(D.MEDIC_AREA,'') AND INDEXS={Indexs} AND HOS_ID = cast( RIGHT ( '{item.ExecDatabase}', 3 ) AS int ))B
ON A.REG_CODE = B.REG_CODE ON A.REG_CODE = B.REG_CODE
JOIN {item.ExecDatabase}.[dbo].PUB_PATIENT C ON A.PERSON_CODE = C.PERSON_CODE JOIN {item.ExecDatabase}.[dbo].PUB_PATIENT C ON A.PERSON_CODE = C.PERSON_CODE
WHERE A.REG_CODE = B.REG_CODE AND A.PERSON_CODE = C.PERSON_CODE WHERE A.REG_CODE = B.REG_CODE AND A.PERSON_CODE = C.PERSON_CODE
...@@ -409,7 +409,7 @@ UNION ALL ...@@ -409,7 +409,7 @@ UNION ALL
} }
catch (Exception ex) catch (Exception ex)
{ {
configConnection.Execute($"update [SV_QueryPlatform_].[dbo].[MEDIC_SEARCH_RECORD] set COMPLETE_MARK = 23,END_TIME=getdate(),log='ex:{ex.ToString()}sql:{ sql2.Replace("'", "''")}' where COMPLETE_MARK != 22 and id= " + Indexs); configConnection.Execute($"update [SV_QueryPlatform_].[dbo].[MEDIC_SEARCH_RECORD] set COMPLETE_MARK = 23,END_TIME=getdate(),log='ex:{ex.ToString()}sql:{sql2.Replace("'", "''")}' where COMPLETE_MARK != 22 and id= " + Indexs);
HomeQueries home = new HomeQueries(_configConnectionString); HomeQueries home = new HomeQueries(_configConnectionString);
home.SendMail(@$"药品/疾病/材料平台提醒", @$"药品拉取失败{string.Join(",", drugName)} 错误日志:{ex.ToString().Replace("'", "''")}", zxr); home.SendMail(@$"药品/疾病/材料平台提醒", @$"药品拉取失败{string.Join(",", drugName)} 错误日志:{ex.ToString().Replace("'", "''")}", zxr);
} }
...@@ -566,7 +566,7 @@ UNION ALL ...@@ -566,7 +566,7 @@ UNION ALL
} }
catch (Exception ex) catch (Exception ex)
{ {
configConnection.Execute($"update [SV_QueryPlatform_].[dbo].[MEDIC_SEARCH_RECORD] set COMPLETE_MARK = 23,END_TIME=getdate(),log='{ sql2.Replace("'", "''")}' where COMPLETE_MARK != 22 and id= " + Indexs); configConnection.Execute($"update [SV_QueryPlatform_].[dbo].[MEDIC_SEARCH_RECORD] set COMPLETE_MARK = 23,END_TIME=getdate(),log='{sql2.Replace("'", "''")}' where COMPLETE_MARK != 22 and id= " + Indexs);
HomeQueries home = new HomeQueries(_configConnectionString); HomeQueries home = new HomeQueries(_configConnectionString);
home.SendMail(@$"药品/疾病/材料平台提醒", @$"材料拉取失败 {string.Join(",", drugName)} 错误日志:{ex.ToString().Replace("'", "''")}", zxr); home.SendMail(@$"药品/疾病/材料平台提醒", @$"材料拉取失败 {string.Join(",", drugName)} 错误日志:{ex.ToString().Replace("'", "''")}", zxr);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment