|
@@ -52,16 +52,27 @@ public interface PatientInfoQueryDao {
|
|
|
" move_flag, " +
|
|
|
" owe_flag, " +
|
|
|
" admiss_diag_str, " +
|
|
|
- " responce_type, " +
|
|
|
- " responce_name = (select rtrim(name) name from zy_zd_responce_type where code = responce_type)," +
|
|
|
+ " a.responce_type, " +
|
|
|
+ " responce_name = (select rtrim(name) name from zy_zd_responce_type where code = a.responce_type)," +
|
|
|
" balance, " +
|
|
|
" total_charge, " +
|
|
|
" zk_ward," +
|
|
|
- " admissWardName = (select rtrim(name) from zd_unit_code where code = admiss_ward)," +
|
|
|
+ " admissWardName = (select rtrim(name) from zd_unit_code where code = a.admiss_ward)," +
|
|
|
" zkWardName = (select rtrim(name) from zd_unit_code where code = zk_ward)," +
|
|
|
" birth_date = (select birth_date from a_patient_mi c where a.inpatient_no = c.inpatient_no)," +
|
|
|
- " emr_audit = (select count(1) from emr_audit_detail where pat_no = inpatient_no and times = admiss_times) " +
|
|
|
- "FROM ${tableName} a " +
|
|
|
+ " emr_audit = (select count(1) from emr_audit_detail where pat_no = a.inpatient_no and times = a.admiss_times)," +
|
|
|
+ " act_ipt_days=(datediff(day, a.admiss_date, isnull(a.dis_date,getdate())))," +
|
|
|
+ " admissPhysicianName = (select name from a_employee_mi where code = admiss_physician),\n" +
|
|
|
+ " referPhysicianName = (select name from a_employee_mi where code = refer_physician),\n" +
|
|
|
+ " zyDismissWay = (select name from zd_zy_dismiss_way where code = zy_dismiss_way),\n" +
|
|
|
+ " disDeptName = (select name from zd_unit_code where code = dis_dept),\n" +
|
|
|
+ " disMainDiag = (select name\n" +
|
|
|
+ " from t_case_frontsheet_disdiag disdiag\n" +
|
|
|
+ " where disdiag.bah = a.inpatient_no\n" +
|
|
|
+ " and disdiag.times = a.admiss_times\n" +
|
|
|
+ " and no = 1) " +
|
|
|
+ "FROM ${tableName} a" +
|
|
|
+ " left join t_case_frontsheet_main b on (a.inpatient_no = b.bah and a.admiss_times = b.admiss_times) " +
|
|
|
" ${ew.customSqlSegment} ")
|
|
|
List<Patient> getPatInfo(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper,
|
|
|
@Param("tableName") String tableName);
|