@@ -211,33 +213,34 @@ public IActionResult Update(DATAEXTRACT dataExtract)
}
//网站拉取json
//[HttpPost("Ybyp")]
//[AllowAnonymous]
//public async Task<IActionResult> Ybyp()
//{
// for (long i = 1188; i <= 2104; i++)
// {
// var client = new HttpClient();
// var request = new HttpRequestMessage
// {
// Method = HttpMethod.Post,
// RequestUri = new Uri("https://code.nhsa.gov.cn/yp/getPublishGoodsDataInfo.html?companyNameSc=®isteredProductName=&approvalCode=&batchNumber=20220920&_search=false&nd=1663825733775&rows=100&page="+i+"&sidx=&sord=asc"),
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
and ksdate=(select max(ksdate ) from [dbo].[解析任务] where hos_id =a.id)) 解析日志 ,
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 ExecOpenLink is not null and ExecDatabase is not null and
ExecOpenLink !='' and ExecDatabase !='' {where} )a )b WHERE id<={paseIndex}*10 and id>({paseIndex} - 1)*10 ").ToList();
IEnumerable<dynamic>sj=Connection(181).Query($@"
select*FROM(
SELECT ROW_NUMBER() OVER(ORDER BY ts desc,(select max(ksdate ) from [dbo].[解析任务] where hos_id =a.编号) desc,
case when isnull([ExecOpenLink],'')!='' and isnull([ExecDatabase],'')!=''
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();
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]
SET I_TYPE_NAME = B.insurance_category
...
...
@@ -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
ON B.CATEGORY=t.CATEGORY
where I_TYPE_NAME = '挂号/诊查费' or I_TYPE_NAME = '手术/麻醉费' or I_TYPE_NAME = '床位/护理费'";
@@ -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}
FROM {item.ExecDatabase}.[dbo].OUT_REG_INFO A
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
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
...
...
@@ -409,7 +409,7 @@ UNION ALL
}
catch(Exceptionex)
{
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);
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);