|
@@ -72,91 +72,6 @@ public interface EmrControlDaoV2 {
|
|
|
@Param("tableName") String tableName);
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 查询指定质控患者数据
|
|
|
- *
|
|
|
- * @param start 开始时间
|
|
|
- * @param end 结束时间
|
|
|
- * @param finalControl 0 - 环节质控 1-终末质控
|
|
|
- * @param sql 额外的sql
|
|
|
- * @return 返回患者数据
|
|
|
- */
|
|
|
- @Select("select rtrim(inpatient_no) as inpatient_no, " +
|
|
|
- " admiss_times, " +
|
|
|
- " rtrim(inpatient_no) as pat_no, " +
|
|
|
- " admiss_times as times," +
|
|
|
- " sex, " +
|
|
|
- " (select [dbo].[F_GetAge]( " +
|
|
|
- " (select birth_date " +
|
|
|
- " from a_patient_mi pm " +
|
|
|
- " where pm.inpatient_no = zy.inpatient_no), " +
|
|
|
- " admiss_date)) as 'age', " +
|
|
|
- " clinic_diag_str /*门急诊诊断*/, " +
|
|
|
- " (select [dbo].F_GetDeptName(zk_ward)) as deptName, " +
|
|
|
- " (select dbo.f_GetEmpName(refer_physician)) as tubeBedDoctorName, " +
|
|
|
- " admiss_date, " +
|
|
|
- " rtrim(zy.name) as name, " +
|
|
|
- " dis_date, " +
|
|
|
- " (select name " +
|
|
|
- " from t_case_frontsheet_disdiag " +
|
|
|
- " where bah = inpatient_no " +
|
|
|
- " and times = admiss_times " +
|
|
|
- " and no = 1) as dis_diag, " +
|
|
|
- " (select [dbo].F_GetDeptName(admiss_ward)) as admiss_dept_name, " +
|
|
|
- " (select dbo.f_GetEmpName(consult_physician)) as consult_physician_name, " +
|
|
|
- " (select dbo.f_GetEmpName(dept_director)) as dept_director_name, " +
|
|
|
- " (select [dbo].[f_get_zy_date](inpatient_no, admiss_times)) as admissDay, " +
|
|
|
- " total_charge, " +
|
|
|
- " (select dbo.F_GetDeptName(dis_dept)) as disDeptName, " +
|
|
|
- " (select count(1) " +
|
|
|
- " from view_yz_all_order v " +
|
|
|
- " where v.inpatient_no = zy.inpatient_no " +
|
|
|
- " and v.admiss_times = zy.admiss_times " +
|
|
|
- " and v.status_flag = '5' " +
|
|
|
- " and order_code in " +
|
|
|
- " (select order_code " +
|
|
|
- " from yz_zd_order_item_confirm " +
|
|
|
- " where yz_zd_order_item_confirm.item_name = N'死亡')) " +
|
|
|
- " as death, " +
|
|
|
- " (select name from zd_statutory_epidemic where code = ba.fdcrb) as fdcrb, " +
|
|
|
- " pathology_diag_comment as pathologicDiagStr, " +
|
|
|
- " surgery.code as ssbm, " +
|
|
|
- " surgery.name as ssmc, " +
|
|
|
- " operator_name as operator_name, " +
|
|
|
- " cut, " +
|
|
|
- " heal, " +
|
|
|
- " level, " +
|
|
|
- " (select name from zd_anaesthesia where anaesthesia = zd_anaesthesia.code) as anaesthesia_name, " +
|
|
|
- " ba.qjcs as qjcs, " +
|
|
|
- " ba.gmwy as allergicMedicine, " +
|
|
|
- " ba.kss as kss /*1-是 2-否*/, " +
|
|
|
- " ba.xjpy as xjpy " +
|
|
|
- "from (select * " +
|
|
|
- " from (select pat_no, times " +
|
|
|
- " from emr_audit_detail " +
|
|
|
- " where review_time >= #{start} " +
|
|
|
- " and review_time <= #{end}" +
|
|
|
- " and final_control = #{finalControl} " +
|
|
|
- " and history = 0 " +
|
|
|
- " group by pat_no, times) temp, " +
|
|
|
- " view_zy_patient_all b " +
|
|
|
- " where temp.pat_no = b.inpatient_no " +
|
|
|
- " and temp.times = b.admiss_times) zy " +
|
|
|
- " left join t_case_frontsheet_surgery surgery " +
|
|
|
- " on (zy.inpatient_no = surgery.bah and zy.admiss_times = surgery.times and no = 1) " +
|
|
|
- " left join batj_ba2 ba on (ba.zyh = zy.inpatient_no and ba.zycs = zy.admiss_times) ${sql} ")
|
|
|
- List<QualityControlAnalysisOfMedicalRecords> selectSuggestionByTimeAndFinalControl(String start, String end, Integer finalControl, String sql);
|
|
|
-
|
|
|
- @Select("select a.name, remark, number_of_defects, b.emr_name,scoring_criteria, " +
|
|
|
- " a.pat_no, " +
|
|
|
- " a.times " +
|
|
|
- "from emr_audit_detail a " +
|
|
|
- " left join emr_patient_data b on (a.emr_id = b.id) " +
|
|
|
- "where doctor = #{userCode} " +
|
|
|
- " and a.history = 0 " +
|
|
|
- " and remediation_status is null")
|
|
|
- List<EmrAuditDetail> selectedAudit(String userCode);
|
|
|
-
|
|
|
@Select("select id, rule_data, type from emr_rule ")
|
|
|
List<EmrRuleData> selectEmrRule();
|
|
|
|