|
|
@@ -82,7 +82,7 @@ public interface QueryEmrDao {
|
|
|
and start_time <= '${end}'
|
|
|
and emr_category_code = 'ruyuanjiluzhuanyong'
|
|
|
and del_flag <> 1
|
|
|
- and inpatient_no not like 'S%' and inpatient_no not like '%$%'
|
|
|
+ and inpatient_no not like 'S%' and inpatient_no not like '%$%' and inpatient_no not like '%JT%'
|
|
|
group by pat_no, times,start_time""")
|
|
|
List<PatientInfo.timeCheck> admissDateAndRuYuanBingLi(String start, String end);
|
|
|
|
|
|
@@ -106,9 +106,9 @@ public interface QueryEmrDao {
|
|
|
emr_patient_data b on (inpatient_no = pat_no
|
|
|
and times = admiss_times
|
|
|
and del_flag <> 1
|
|
|
- and emr_category_code = 'chuyuanjilu')
|
|
|
+ and emr_category_code = 'chuyuanjilu' or emr_category_code='siwangjilu')
|
|
|
where dis_date >= '${start}' and dis_date <= '${end}'
|
|
|
- and inpatient_no not like 'S%' and inpatient_no not like '%$%' group by dis_date,inpatient_no, admiss_times;""")
|
|
|
+ and inpatient_no not like 'S%' and inpatient_no not like '%$%' and inpatient_no not like '%JT%' group by dis_date,inpatient_no, admiss_times;""")
|
|
|
List<PatientInfo.timeCheck> disDate(String start, String end);
|
|
|
|
|
|
@Select("""
|
|
|
@@ -119,7 +119,7 @@ public interface QueryEmrDao {
|
|
|
and times = admiss_times
|
|
|
and dis_date >= '${start}'
|
|
|
and dis_date <= '${end}'
|
|
|
- and inpatient_no not like 'S%' and inpatient_no not like '%$%'
|
|
|
+ and inpatient_no not like 'S%' and inpatient_no not like '%$%' and inpatient_no not like '%JT%'
|
|
|
group by pat_no, times, dis_date""")
|
|
|
List<PatientInfo.timeCheck> firstPageOfMedicalRecord(String start, String end);
|
|
|
|
|
|
@@ -219,49 +219,68 @@ public interface QueryEmrDao {
|
|
|
List<PatientInfo> 抢救(String start, String end);
|
|
|
|
|
|
@Select("""
|
|
|
- select rtrim(inpatient_no) as inpatient_no, admiss_times, name
|
|
|
- from (select inpatient_no, admiss_times, name
|
|
|
- from zy_inactpatient zy
|
|
|
- inner join (select max(yz.start_time) as kssj, yz.inpatient_no as zyh, yz.admiss_times as zycs
|
|
|
- from yz_inact_order yz
|
|
|
- where yz.order_code in ('06025', '06026', '06027', '06053', '05973')
|
|
|
- and isnull(yz.group_no, '00') = '00'
|
|
|
- and yz.start_time >= '${start}'
|
|
|
- and yz.start_time <= '${end}'
|
|
|
- group by yz.inpatient_no, yz.admiss_times) tt
|
|
|
- on zy.inpatient_no = tt.zyh and zy.admiss_times = tt.zycs
|
|
|
- where zy.inpatient_no not like 'JT%'
|
|
|
- and zy.inpatient_no not like '%$%'
|
|
|
- and zy.inpatient_no not like '%S%'
|
|
|
- union
|
|
|
- select inpatient_no, admiss_times, name
|
|
|
- from zy_inactpatient zy
|
|
|
- inner join (select max(yz.start_time) as kssj, yz.inpatient_no as zyh, yz.admiss_times as zycs
|
|
|
- from yz_act_order yz
|
|
|
- where yz.order_code in ('06025', '06026', '06027', '06053', '05973')
|
|
|
- and isnull(yz.group_no, '00') = '00'
|
|
|
- and yz.start_time >= '${start}'
|
|
|
- and yz.start_time <= '${end}'
|
|
|
- group by yz.inpatient_no, yz.admiss_times) tt
|
|
|
- on zy.inpatient_no = tt.zyh and zy.admiss_times = tt.zycs
|
|
|
- where zy.inpatient_no not like 'JT%'
|
|
|
- and zy.inpatient_no not like '%$%'
|
|
|
- and zy.inpatient_no not like '%S%'
|
|
|
- union
|
|
|
- select inpatient_no, admiss_times, name
|
|
|
- from zy_actpatient zy
|
|
|
- inner join (select max(yz.start_time) as kssj, yz.inpatient_no as zyh, yz.admiss_times as zycs
|
|
|
- from yz_act_order yz
|
|
|
- where yz.order_code in ('06025', '06026', '06027', '06053', '05973')
|
|
|
- and isnull(yz.group_no, '00') = '00'
|
|
|
- and yz.start_time >= '${start}'
|
|
|
- and yz.start_time <= '${end}'
|
|
|
- group by yz.inpatient_no, yz.admiss_times) tt
|
|
|
- on zy.inpatient_no = tt.zyh and zy.admiss_times = tt.zycs
|
|
|
- where zy.inpatient_no not like 'JT%'
|
|
|
- and zy.inpatient_no not like '%$%'
|
|
|
- and zy.inpatient_no not like '%S%') tmp
|
|
|
- group by inpatient_no, admiss_times, name, inpatient_no, admiss_times, name""")
|
|
|
+ select inpatient_no,
|
|
|
+ admiss_times,
|
|
|
+ name,
|
|
|
+ refer_physician = (select rtrim(name) from a_employee_mi where code = refer_physician),
|
|
|
+ consult_physician = (select rtrim(name) from a_employee_mi where code = consult_physician),
|
|
|
+ dept_director = (select rtrim(name) from a_employee_mi where code = dept_director),
|
|
|
+ ward = (select rtrim(name) from zd_unit_code where code = admiss_dept),
|
|
|
+ dept = (select rtrim(name) from zd_unit_code where isnull(zk_ward, small_dept) = code)
|
|
|
+ from zy_inactpatient zy
|
|
|
+ inner join (select max(yz.start_time) as kssj, yz.inpatient_no as zyh, yz.admiss_times as zycs
|
|
|
+ from yz_inact_order yz
|
|
|
+ where yz.order_code in ('06025', '06026', '06027', '06053', '05973')
|
|
|
+ and isnull(yz.group_no, '00') = '00'
|
|
|
+ and yz.start_time >= '${start}'
|
|
|
+ and yz.start_time <= '${end}'
|
|
|
+ group by yz.inpatient_no, yz.admiss_times) tt
|
|
|
+ on zy.inpatient_no = tt.zyh and zy.admiss_times = tt.zycs
|
|
|
+ where zy.inpatient_no not like 'JT%'
|
|
|
+ and zy.inpatient_no not like '%$%'
|
|
|
+ and zy.inpatient_no not like '%S%'
|
|
|
+ union
|
|
|
+ select inpatient_no,
|
|
|
+ admiss_times,
|
|
|
+ name,
|
|
|
+ refer_physician = (select rtrim(name) from a_employee_mi where code = refer_physician),
|
|
|
+ consult_physician = (select rtrim(name) from a_employee_mi where code = consult_physician),
|
|
|
+ dept_director = (select rtrim(name) from a_employee_mi where code = dept_director),
|
|
|
+ ward = (select rtrim(name) from zd_unit_code where code = admiss_dept),
|
|
|
+ dept = (select rtrim(name) from zd_unit_code where isnull(zk_ward, small_dept) = code)
|
|
|
+ from zy_inactpatient zy
|
|
|
+ inner join (select max(yz.start_time) as kssj, yz.inpatient_no as zyh, yz.admiss_times as zycs
|
|
|
+ from yz_act_order yz
|
|
|
+ where yz.order_code in ('06025', '06026', '06027', '06053', '05973')
|
|
|
+ and isnull(yz.group_no, '00') = '00'
|
|
|
+ and yz.start_time >= '${start}'
|
|
|
+ and yz.start_time <= '${end}'
|
|
|
+ group by yz.inpatient_no, yz.admiss_times) tt
|
|
|
+ on zy.inpatient_no = tt.zyh and zy.admiss_times = tt.zycs
|
|
|
+ where zy.inpatient_no not like 'JT%'
|
|
|
+ and zy.inpatient_no not like '%$%'
|
|
|
+ and zy.inpatient_no not like '%S%'
|
|
|
+ union
|
|
|
+ select inpatient_no,
|
|
|
+ admiss_times,
|
|
|
+ name,
|
|
|
+ refer_physician = (select rtrim(name) from a_employee_mi where code = refer_physician),
|
|
|
+ consult_physician = (select rtrim(name) from a_employee_mi where code = consult_physician),
|
|
|
+ dept_director = (select rtrim(name) from a_employee_mi where code = dept_director),
|
|
|
+ ward = (select rtrim(name) from zd_unit_code where code = admiss_dept),
|
|
|
+ dept = (select rtrim(name) from zd_unit_code where isnull(zk_ward, small_dept) = code)
|
|
|
+ from zy_actpatient zy
|
|
|
+ inner join (select max(yz.start_time) as kssj, yz.inpatient_no as zyh, yz.admiss_times as zycs
|
|
|
+ from yz_act_order yz
|
|
|
+ where yz.order_code in ('06025', '06026', '06027', '06053', '05973')
|
|
|
+ and isnull(yz.group_no, '00') = '00'
|
|
|
+ and yz.start_time >= '${start}'
|
|
|
+ and yz.start_time <= '${end}'
|
|
|
+ group by yz.inpatient_no, yz.admiss_times) tt
|
|
|
+ on zy.inpatient_no = tt.zyh and zy.admiss_times = tt.zycs
|
|
|
+ where zy.inpatient_no not like 'JT%'
|
|
|
+ and zy.inpatient_no not like '%$%'
|
|
|
+ and zy.inpatient_no not like '%S%'""")
|
|
|
List<PatientInfo> chuyuanCount(String start, String end);
|
|
|
|
|
|
|
|
|
@@ -277,4 +296,17 @@ public interface QueryEmrDao {
|
|
|
select name from emr_audit_detail where pat_no = '${patNo}' and times = ${times} and final_control = 1 and history = 0""")
|
|
|
List<EmrAuditDetail> 患者意见(String patNo, Integer times);
|
|
|
|
|
|
+ @Select("""
|
|
|
+ select inpatient_no,
|
|
|
+ admiss_times,
|
|
|
+ name,
|
|
|
+ refer_physician = (select rtrim(name) from a_employee_mi where code = refer_physician),
|
|
|
+ consult_physician = (select rtrim(name) from a_employee_mi where code = consult_physician),
|
|
|
+ dept_director = (select rtrim(name) from a_employee_mi where code = dept_director),
|
|
|
+ ward = (select rtrim(name) from zd_unit_code where code = admiss_dept),
|
|
|
+ dept = (select rtrim(name) from zd_unit_code where isnull(zk_ward, small_dept) = code)
|
|
|
+ from view_zy_allpatient
|
|
|
+ where inpatient_no = '${patNo}'
|
|
|
+ and admiss_times = ${times}""")
|
|
|
+ PatientInfo 获取患者信息(String patNo, Integer times);
|
|
|
}
|