|
@@ -558,23 +558,29 @@ public interface SiQueryDao {
|
|
|
Date selectRegisterDate(@Param("patNo") String patNo);
|
|
|
|
|
|
@Select("<script>" +
|
|
|
- "select rtrim(a.inpatient_no) inpatient_no," +
|
|
|
+ "select " +
|
|
|
+ " rtrim(a.inpatient_no) inpatient_no," +
|
|
|
" a.admiss_times," +
|
|
|
" rtrim(name) name," +
|
|
|
" refer_physician_name = (select rtrim(name) from a_employee_mi where code = refer_physician)," +
|
|
|
" small_dept_name = (select rtrim(name) from zd_unit_code where code = small_dept)," +
|
|
|
+ " zk_ward, " +
|
|
|
+ " zk_ward_name = (select rtrim(name) " +
|
|
|
+ " from zd_unit_code " +
|
|
|
+ " where code = zk_ward)," +
|
|
|
" responce_type_name = (select rtrim(name) from zy_zd_responce_type where code = responce_type)," +
|
|
|
" total_charge," +
|
|
|
" sex," +
|
|
|
- " rtrim(c.dis_diag) dis_diag," +
|
|
|
- " rtrim(c.dis_diag_comment) dis_diag_comment," +
|
|
|
+ " rtrim(c.icd_code) dis_diag," +
|
|
|
+ " rtrim(c.icd_text) dis_diag_comment," +
|
|
|
" certno," +
|
|
|
" insuplc_admdvs, " +
|
|
|
" insuplc_admdvs_name = isnull((select name from t_region where code = insuplc_admdvs), " +
|
|
|
" (select name from t_si_admdvs where code = insuplc_admdvs))" +
|
|
|
"from zy_actpatient a " +
|
|
|
"left join t_si_pat_info b on (a.inpatient_no = b.pat_no and a.admiss_times = b.times) " +
|
|
|
- "left join zy_dis_diag_yb c on (a.inpatient_no = c.inpatient_no and a.admiss_times = c.admiss_times and c.dis_diag_no = 1) " +
|
|
|
+ "left join zy_in_diag_yb c on (a.inpatient_no = c.inpatient_no and a.admiss_times = " +
|
|
|
+ "c.admiss_times and c.diag_no = 1) " +
|
|
|
"where " +
|
|
|
"setl_id is null and b.mdtrt_id is not null " +
|
|
|
"<if test=\"startTime !=null and startTime != '' \">" +
|