同步报告流程

1.查询待同步人员名单

根据appsetting.config文件夹中:
ReportConfig ReportSql查询

查看报告当前时间节点
select keyvalue from tbl_dictionary where keyname =’MytijianReport’
查看时间间隔
appsetting.json:
ReportConfig.TimeSpan
{0}:keyvalue +(TimeSpan)为起始时间
{1}:keyvalue 为结束时间
最终语句(根据实际情况配置):

最新配置语句

  1. select * from (select tjh000 from HM_YW_DJLS00 a where djbz00='6' and djrq00 between '{0}' and '{1}' order by djrq00 asc,djsj00 asc) group by tjh000

此配置已停用
~~select tjh000 from hm_yw_tjz000 where ( tjlxid in () and zswc00 = ‘1’ and zsrq00 between ‘{0}’and ‘{1}’ ) or ( tjlxid in () and zjwc00 = ‘1’ and zjrq00 between ‘{0}’and ‘{1}’)or ( tjlxid in () and fjwc00=’1’ and fjwcrq between ‘{0}’and ‘{1}’) ~~

zswc00:总审完成看总审日期
zjwc00:总检完成看总检日期
fjwc00:分科完成看分科日期

2.查询人员详细信息

最新配置语句

  1. create or replace view mtjk_report_info as
  2. select A.*,
  3. ( select f.reportTime from ( select to_date(substr(tx_superman.SF_PT_GetRQ00(1, DJRQ00, DJSJ00), 1, 30),'yyyy-MM-dd hh24:mi:ss') as reportTime ,d.tjh000 from HM_YW_DJLS00 d where djbz00='6'
  4. order by djrq00 desc,djsj00 desc ) f where f.tjh000 =a.tjh000 and rownum <2 ) as reportTime,
  5. to_date(zjrq00,'YYYY-MM-DD') as auditTime,
  6. 'D://TJPDFBG//'||TJH000||'//'||TJH000||'.pdf' as pdfurl
  7. from HM_YW_TJZ000 A where zjwc00 = '1' and zjrq00 !='00000000';

此配置已停用

  1. 已经停用!!!!
  2. create or replace view MTJK_REPORT_INFO as
  3. --总审
  4. select A.*,
  5. a.TJH000 as reportNo, --体检号
  6. to_date(zsrq00,'YYYY-MM-DD') as reportTime,
  7. to_date(zsrq00,'YYYY-MM-DD') as auditTime,
  8. 'D://PDFBG//'||TJH000||'//'||TJH000||'_'||xm0000||'.pdf' as pdfurl,
  9. ZS0000 as detail,
  10. JY0000 as advice,
  11. (select Ygxm00 from pt_ygbm00 where ygbh00=a.zjysid) as docName,
  12. (select ygxm00 from pt_ygbm00 where ygbh00=a.zsys00) as auditDoc
  13. from HM_YW_TJZ000 A where tjlxid in () and zswc00 = '1' and zsrq00 !='00000000'
  14. union all
  15. --总检
  16. select A.*,
  17. a.TJH000 as reportNo, --体检号
  18. to_date(zjrq00,'YYYY-MM-DD') as reportTime,
  19. to_date(zjrq00,'YYYY-MM-DD') as auditTime,
  20. 'D://PDFBG//'||TJH000||'//'||TJH000||'_'||xm0000||'.pdf' as pdfurl,
  21. ZS0000 as detail,
  22. JY0000 as advice,
  23. (select Ygxm00 from pt_ygbm00 where ygbh00=a.zjysid) as docName,
  24. (select ygxm00 from pt_ygbm00 where ygbh00=a.zsys00) as auditDoc
  25. from HM_YW_TJZ000 A where tjlxid in () and zjwc00 = '1' and zjrq00 !='00000000'
  26. union all
  27. --分科
  28. select A.*,
  29. a.TJH000 as reportNo, --体检号
  30. to_date(fjwcrq,'YYYY-MM-DD') as reportTime,
  31. to_date(fjwcrq,'YYYY-MM-DD') as auditTime,
  32. 'D://PDFBG//'||TJH000||'//'||TJH000||'_'||xm0000||'.pdf' as pdfurl,
  33. ZS0000 as detail,
  34. JY0000 as advice,
  35. (select Ygxm00 from pt_ygbm00 where ygbh00=a.zjysid) as docName,
  36. (select ygxm00 from pt_ygbm00 where ygbh00=a.zsys00) as auditDoc
  37. from HM_YW_TJZ000 A where tjlxid in () and fjwc00 = '1' and fjwcrq !='00000000'
  1. select * from MTJK_REPORT_INFO where reportNo=''

pdfUrl:为pdf文件地址

appsetting.json:
ReportConfig.Type:
DATA,文字版本,则需要继续创建几个视图
URL,能够直接访问到的URL,会下载到本地
FILE,本地能够直接访问到的URL
FTP,ftp模式,配置ftp,会下载到本地

!!!天瑞B/S版本视图脚本

  1. -- b/s版本一般不用到
  2. create or replace view mtjk_report_info as
  3. select a.pe_no as reportno,
  4. b.user_name as name,
  5. b.id_card_no as idCard,
  6. to_date(b.birthday,'YYYY-MM-DD') as birthday,
  7. b.pe_age as age,
  8. b.sex as gender,
  9. b.phone_no as mobile,
  10. a.pe_date as examDate,
  11. a.create_time as reportTime,
  12. a.create_time as auditTime,
  13. replace( a.pdf_report_url ,'http://192.168.0.24','http://miniwx.trhealth.net/whdyyy') as pdfurl
  14. from pemi_report a left join pec_pebill b
  15. on a.pe_no = b.pe_no;

3.上传PDF

上传成功后,会向tbl_report_record表中插入一条数据
status:1 则代表成功

reportTime: 本字段来源MTJK_REPORT_INFO中reporttime,

如果报告更新,会将MTJK_REPORT_INFO.reporttime 与 tbl_report_record.reportTime比较,如果不一致,会再次更新上传

文字报告

  1. --报告科室结论
  2. create view MTJK_REPORT_DEPARTMENT as
  3. select * from (
  4. select
  5. A.TJH000 as reportNo, --体检号
  6. A.BMBH00 as agentDepartmentId,--部门ID
  7. C.BMMC00 name, --部门名称
  8. A.KSXJ00 as result, --科室小结
  9. to_date(A.KSSHRQ||' '||A.KSSHSJ,'YYYY-MM-DD HH24:MI:SS') as examTime, --科室审核时间
  10. (select YGXM00 from PT_YGBM00 where YGBH00 = A.KSYS00) as docName, --科室医生
  11. lpad(C.PXXH00,4,0) as orderBy
  12. from HM_YW_TJFKJC A, PT_BMBM00 C
  13. where A.BMBH00 = C.BMBH00 and A.kssh00=1 order by C.PXXH00 asc);
  1. --报告项目详情
  2. create view MTJK_REPORT_DETAIL as
  3. select * from (
  4. select
  5. A.TJH000 as reportNo, --体检报告主键
  6. A.BMBH00 as departmentId, --检查分科ID
  7. (select BMMC00 from PT_BMBM00 where BMBH00 = A.BMBH00) as department,--体检科室名称
  8. A.SQXMID as classId, --项目ID, FK=HM_ZD_TJSQXM.SQXMID
  9. A.SQXMMC as className, --项目名称
  10. E.KSXJ00 as classResult,
  11. A.JCXMID as itemId, --检查项目ID
  12. A.JCXMMC as itemName, --检查项目名称
  13. nvl(A.jyjg00,replace(A.TZCMS0, B.ZDW000, '')) as itemResult,
  14. '' as explain,
  15. A.CKFW00 as reference, --参考范围
  16. A.JGSM00 as itemTip, --结果说明
  17. A.JCXMDW as unit, --检查项目单位
  18. '' as pic_url,
  19. lpad(D.PXXH00,4,0) ord_department,
  20. lpad(C.XSXH00,4,0) ord_class,
  21. lpad(B.XSXH00,4,0) ord_item,
  22. nvl((select JCYSXM from HM_YW_TJYW00 where SFYWID = A.SFYWID),
  23. (select ygxm00 from pt_ygbm00 where ygbh00=(select KSYS00 from HM_YW_TJFKJC where BMBH00 = A.BMBH00 and rownum = 1 ))) as docName,
  24. to_date((select FKKSRQ from HM_YW_TJYW00 where SFYWID = A.SFYWID and FKKSRQ !=00000000 ),'YYYY-MM-DD') as examTime
  25. from HM_YW_TJJCXM A, HM_ZD_JCXM00 B, HM_ZD_TJSQXM C, PT_BMBM00 D ,HM_YW_TJFKJC E
  26. where A.JCXMID = B.JCXMID and A.SQXMID = C.SQXMID and A.BMBH00 = D.BMBH00 and A.TJH000 = E.TJH000 and A.BMBH00 =E.BMBH00+0
  27. and not exists (select 1 from HM_YW_TJYW00 where TJH000 = A.TJH000 and SFYWID = A.SFYWID and TFNTBZ in ('1','2')))

ftp报告

配置文件

视图

url报告

NoCache报告

实时查询保

注意:此模式下端口不允许随便修改,否则可能会查不到报告信息

最新逻辑
文档更新时间: 2023-11-02 18:32