每个单元对应的sql的语句信息
select a.jbdm,a.mszd,b.icd9 from ys_zy_jbzd a
left outer join gy_jbbm b on a.jbdm=b.jbxh where a.zxlb = 1 and a.tjbz=1 and a.zfbz<>1 and a.jbzh = 1 and a.znxh = 1 and a.zdlb=‘门(急)诊诊断‘ and a.jzhm = 17663
union
select a.jbdm,a.mszd,c.jbdm from ys_zy_jbzd a
left outer join EMR_ZYJB c on a.jbdm=c.jbbs where a.zxlb = 2 and a.tjbz=1 and a.zfbz<>1 and a.jbzh = 1 and a.znxh = 1 and a.zdlb=‘门(急)诊诊断‘ and a.jzhm = 17663
--select ys_zy_jbzd_list(17663) from dual
、------------------------------------------------------------
select * from zy_brry where zyhm = 201716231;
select * from ys_zy_jbzd where jzhm = 17663 and zdlb = ‘门(急)诊诊断‘ and zfbz = 0 and tjbz = 1 ;
SELECT * FROM GY_JBBM WHERE JBXH = --108091
SELECT * FROM EMR_ZYJB WHERE JBBS = ‘40268‘
SELECT * FROM YS_ZY_JZJL
LEFT OUTER JOIN (SELECT JZHM, MSZD MJZZD FROM YS_ZY_JBZD WHERE TJBZ = 1 AND ZFBZ <> 1
AND ZDLB = ‘门(急)诊诊断‘ AND ZXLB = 1 AND JBZH = ‘1‘ AND ZNXH = 1) MJZ ON YS_ZY_JZJL.JZHM = MJZ.JZHM
LEFT OUTER JOIN (SELECT JZHM, MSZD MJZZDZY FROM YS_ZY_JBZD WHERE TJBZ = 1 AND ZFBZ <> 1
AND ZDLB = ‘门(急)诊诊断‘ AND ZXLB = 2 AND JBZH = ‘1‘ AND ZNXH = 1) MJZ ON YS_ZY_JZJL.JZHM = MJZ.JZHM
LEFT OUTER JOIN (SELECT JZHM, MSZD RYZD, QZSJ RYQZRQ FROM YS_ZY_JBZD WHERE TJBZ = 1 AND ZFBZ <> 1 AND ZDLB = ‘入院诊断‘
AND ZXLB = 1 AND JBZH = ‘1‘ AND ZNXH = 1) RY ON YS_ZY_JZJL.JZHM = RY.JZHM WHERE (YS_ZY_JZJL.JZHM = 17663)
--{PatientID}