|
@@ -17,55 +17,55 @@ import java.util.List;
|
|
|
@Mapper
|
|
|
public interface EmrControlDaoV2 {
|
|
|
|
|
|
- @Select("select rtrim(inpatient_no) as inpatient_no,\n" +
|
|
|
- " admiss_times,\n" +
|
|
|
- " sex,\n" +
|
|
|
- " (select [dbo].[F_GetAge](\n" +
|
|
|
- " (select birth_date\n" +
|
|
|
- " from a_patient_mi pm\n" +
|
|
|
- " where pm.inpatient_no = zy.inpatient_no),\n" +
|
|
|
- " admiss_date)) as 'age',\n" +
|
|
|
- " clinic_diag_str /*门急诊诊断*/,\n" +
|
|
|
- " (select [dbo].F_GetDeptName(zk_ward)) as deptName,\n" +
|
|
|
- " (select dbo.f_GetEmpName(refer_physician)) as tubeBedDoctorName,\n" +
|
|
|
- " admiss_date,\n" +
|
|
|
- " rtrim(zy.name) as name,\n" +
|
|
|
- " dis_date,\n" +
|
|
|
- " (select name\n" +
|
|
|
- " from t_case_frontsheet_disdiag\n" +
|
|
|
- " where bah = inpatient_no\n" +
|
|
|
- " and times = admiss_times\n" +
|
|
|
- " and no = 1) as dis_diag,\n" +
|
|
|
- " (select [dbo].F_GetDeptName(admiss_ward)) as admiss_dept_name,\n" +
|
|
|
- " (select dbo.f_GetEmpName(consult_physician)) as consult_physician_name,\n" +
|
|
|
- " (select dbo.f_GetEmpName(dept_director)) as dept_director_name,\n" +
|
|
|
- " (select [dbo].[f_get_zy_date](inpatient_no, admiss_times)) as admissDay,\n" +
|
|
|
- " total_charge,\n" +
|
|
|
- " (select dbo.F_GetDeptName(dis_dept)) as disDeptName,\n" +
|
|
|
- " (select count(1)\n" +
|
|
|
- " from view_yz_all_order v\n" +
|
|
|
- " where v.inpatient_no = zy.inpatient_no\n" +
|
|
|
- " and v.admiss_times = zy.admiss_times\n" +
|
|
|
- " and v.status_flag = '5'\n" +
|
|
|
- " and order_code in\n" +
|
|
|
- " (select order_code\n" +
|
|
|
- " from yz_zd_order_item_confirm\n" +
|
|
|
- " where yz_zd_order_item_confirm.item_name = N'死亡'))\n" +
|
|
|
- " as death,\n" +
|
|
|
- " (select name from zd_statutory_epidemic where code = ba.fdcrb) as fdcrb,\n" +
|
|
|
- " pathology_diag_comment as pathologicDiagStr,\n" +
|
|
|
- " surgery.code as ssbm,\n" +
|
|
|
- " surgery.name as ssmc,\n" +
|
|
|
- " operator_name as operator_name,\n" +
|
|
|
- " cut,heal,level,\n" +
|
|
|
- " (select name from zd_anaesthesia where anaesthesia = zd_anaesthesia.code) as anaesthesia_name,\n" +
|
|
|
- " ba.qjcs as qjcs,\n" +
|
|
|
- " ba.gmwy as allergicMedicine,\n" +
|
|
|
- " ba.kss as kss /*1-是 2-否*/,\n" +
|
|
|
- " ba.xjpy as xjpy\n" +
|
|
|
- "from ${tableName} zy\n" +
|
|
|
- " left join t_case_frontsheet_surgery surgery\n" +
|
|
|
- " on (zy.inpatient_no = surgery.bah and zy.admiss_times = surgery.times and no = 1)\n" +
|
|
|
+ @Select("select rtrim(inpatient_no) as inpatient_no, " +
|
|
|
+ " admiss_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 ${tableName} 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)" +
|
|
|
" ${ew.customSqlSegment} ")
|
|
|
List<QualityControlAnalysisOfMedicalRecords> queryEmrRulePatient(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper,
|