From 39000d628b2e93b2f22819ae3fa5cffc04b9cd38 Mon Sep 17 00:00:00 2001 From: hujl Date: Thu, 17 Nov 2022 17:12:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=90=8D=E5=AD=97=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/beHospitaledController.java | 4 +- .../com/emr/dao/Archive_MasterMapper.java | 3 +- .../emr/service/Archive_MasterService.java | 8 ++ .../ipml/Archive_MasterServiceImpl.java | 94 +++++++++++-------- .../resources/mapper/Archive_MasterMapper.xml | 84 ++++++++++++++++- src/main/resources/mapper/V_CountMapper.xml | 16 ++-- src/main/webapp/WEB-INF/views/index.jsp | 4 +- .../views/lastVerifyDir/lastVerifyList.jsp | 19 +++- .../js/lastVerifyList/lastVerifyList.js | 81 ++++++++++------ .../webapp/static/js/vCount/vCountList.js | 6 +- 10 files changed, 225 insertions(+), 94 deletions(-) diff --git a/src/main/java/com/emr/controller/beHospitaledController.java b/src/main/java/com/emr/controller/beHospitaledController.java index 863327a..9e61c00 100644 --- a/src/main/java/com/emr/controller/beHospitaledController.java +++ b/src/main/java/com/emr/controller/beHospitaledController.java @@ -193,7 +193,7 @@ public class beHospitaledController { //校验完整性 @ResponseBody @RequestMapping(value = "/checkSuccess") - private String checkSuccessMethod(String archiveDetailId){ + private String checkSuccessMethod(String archiveDetailId,String refreshFlag){ String result = ""; /*Archive_Master archiveMaster = archiveMasterService.selectByPrimaryKey(archiveDetailId); result = archiveMaster.getLockinfo();*/ @@ -203,7 +203,7 @@ public class beHospitaledController { Client client = null; try { client = factory.createClient(endpoint); - Object[] res = client.invoke(method, archiveDetailId); + Object[] res = client.invoke(method, archiveDetailId,refreshFlag); result = (String) res[0]; //更新master表完整性字段 if(StringUtils.isNotBlank(result)){ diff --git a/src/main/java/com/emr/dao/Archive_MasterMapper.java b/src/main/java/com/emr/dao/Archive_MasterMapper.java index 61a5864..3c1acc8 100644 --- a/src/main/java/com/emr/dao/Archive_MasterMapper.java +++ b/src/main/java/com/emr/dao/Archive_MasterMapper.java @@ -29,6 +29,7 @@ public interface Archive_MasterMapper { int updateByClo(Archive_Master record); + int updateByClo2(Archive_Master record); int updateById(Archive_Master record); List getDoctorFileInfo(@Param("deptCode")String deptCode,@Param("doctor")String doctor,@Param("startTime")String startTime,@Param("endTime")String endTime); @@ -100,5 +101,5 @@ public interface Archive_MasterMapper { int insertCommonlyUsed(CommomVo commomVo); - List selectCommonlyUsed(Archive_Master record); + List selectCommonlyUsed(@Param("patientIds")String patientIds); } \ No newline at end of file diff --git a/src/main/java/com/emr/service/Archive_MasterService.java b/src/main/java/com/emr/service/Archive_MasterService.java index 8d30719..dda2c82 100644 --- a/src/main/java/com/emr/service/Archive_MasterService.java +++ b/src/main/java/com/emr/service/Archive_MasterService.java @@ -83,6 +83,14 @@ public interface Archive_MasterService { */ int updateByClo(Archive_Master record); + + /** + * 根据条件查询记录 + * @param record + * @return + */ + int updateByClo2(Archive_Master record); + /** * 根据id修改记录 * @param record diff --git a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java index 9120aa0..cac3f45 100644 --- a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java @@ -726,6 +726,10 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { public int updateByClo(Archive_Master record) { return archiveMasterMapper.updateByClo(record); } + @Override + public int updateByClo2(Archive_Master record) { + return archiveMasterMapper.updateByClo2(record); + } @Override public int updateById(Archive_Master record) { @@ -1189,53 +1193,61 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { String username = (String) SecurityUtils.getSubject().getSession().getAttribute("userSession");//获取前面登录的用户名 SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String ids = master.getId(); + String patientId = master.getPatientId(); String[] idList = ids.split(","); + if (patientId.length()<10){ + patientId="'"+patientId+"'"; + } List archiveFlowRoles = flowRoleMapper.selectAll(); - List archive_masterVos = archive_masterMapper.selectCommonlyUsed(master); + List archive_masterVos = archive_masterMapper.selectCommonlyUsed(patientId); if(CollectionUtils.isEmpty(archive_masterVos)){ return; } - Archive_Master archive_master_vos = archive_masterVos.get(0); CommomVo commomVo=new CommomVo(); - commomVo.setPatientId(archive_master_vos.getId()); - commomVo.setAdmissTimes(archive_master_vos.getVisitId()); - commomVo.setAdmissId(archive_master_vos.getInpNo()); - commomVo.setInpatientNo(archive_master_vos.getInpNo()); - commomVo.setName(archive_master_vos.getName()); - commomVo.setCheckedDatetime(format1.format(new Date())); - commomVo.setSex(archive_master_vos.getSex()); - commomVo.setAdmissId(archive_master_vos.getId()); - String subAssort = archive_master_vos.getSubAssort(); - int index = subAssort.indexOf("岁"); - String before = subAssort.substring(0,index); - commomVo.setAge(before); - DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - Date date1=null; - Date date2=null; - String dischargeDateTime = archive_master_vos.getDischargeDateTime(); - String admissionDateTime = archive_master_vos.getAdmissionDateTime(); - try { - date1=format.parse(dischargeDateTime); - date2=format.parse(admissionDateTime); - } catch (ParseException e) { - e.printStackTrace(); + for (int a=0;archive_masterVos.size()>a;a++){ + commomVo.setPatientId(archive_masterVos.get(a).getId()); + String patientId1 = commomVo.getPatientId(); + System.out.println("patientId1::::"+patientId1); + commomVo.setAdmissTimes(archive_masterVos.get(a).getVisitId()); + commomVo.setAdmissId(archive_masterVos.get(a).getInpNo()); + commomVo.setInpatientNo(archive_masterVos.get(a).getInpNo()); + commomVo.setName(archive_masterVos.get(a).getName()); + commomVo.setCheckedDatetime(format1.format(new Date())); + commomVo.setSex(archive_masterVos.get(a).getSex()); + commomVo.setAdmissId(archive_masterVos.get(a).getId()); + String subAssort = archive_masterVos.get(a).getSubAssort(); + int index = subAssort.indexOf("岁"); + String before = subAssort.substring(0,index); + commomVo.setAge(before); + DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + Date date1=null; + Date date2=null; + String dischargeDateTime = archive_masterVos.get(a).getDischargeDateTime(); + String admissionDateTime = archive_masterVos.get(a).getAdmissionDateTime(); + try { + date1=format.parse(dischargeDateTime); + date2=format.parse(admissionDateTime); + } catch (ParseException e) { + e.printStackTrace(); + } + Calendar ca1 = Calendar.getInstance(); + Calendar ca2 = Calendar.getInstance(); + ca1.setTime(date1); + ca2.setTime(date2); + long distanceMin =( ca1.getTimeInMillis()- ca2.getTimeInMillis())/(1000*60*60*24); + int i2= (int)distanceMin; + commomVo.setAdmissDays(i2); + int i = Integer.parseInt(before); + int i1 = i * 12; + String s = String.valueOf(i1); + commomVo.setAgeMonth(s); + commomVo.setAdmissDate(archive_masterVos.get(a).getAdmissionDateTime()); + commomVo.setDisDate(archive_masterVos.get(a).getDischargeDateTime()); + commomVo.setDisDept(archive_masterVos.get(a).getDeptName1()); + commomVo.setAttending(archive_masterVos.get(a).getDoctorInCharge()); + archive_masterMapper.insertCommonlyUsed(commomVo); } - Calendar ca1 = Calendar.getInstance(); - Calendar ca2 = Calendar.getInstance(); - ca1.setTime(date1); - ca2.setTime(date2); - long distanceMin =( ca1.getTimeInMillis()- ca2.getTimeInMillis())/(1000*60*60*24); - int i2= (int)distanceMin; - commomVo.setAdmissDays(i2); - int i = Integer.parseInt(before); - int i1 = i * 12; - String s = String.valueOf(i1); - commomVo.setAgeMonth(s); - commomVo.setAdmissDate(archive_master_vos.getAdmissionDateTime()); - commomVo.setDisDate(archive_master_vos.getDischargeDateTime()); - commomVo.setDisDept(archive_master_vos.getDeptName1()); - commomVo.setAttending(archive_master_vos.getDoctorInCharge()); - archive_masterMapper.insertCommonlyUsed(commomVo); + for(String id : idList) { if(StringUtils.isNotBlank(id)) { //修改病案归档状态 @@ -1259,7 +1271,7 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { //设为已归档状态 archiveMaster.setArchivestate(EnumVerify.DocState.MedicalRoomCheck.getCode() + ""); //更新 - updateByClo(archiveMaster); + updateByClo2(archiveMaster); //当前节点两种可能病案室审核和已召回 //是已召回,将当前节点code置为病案室审核 String currentStatus = EnumVerify.DocState.MedicalRoomCheck.getCode() + ""; diff --git a/src/main/resources/mapper/Archive_MasterMapper.xml b/src/main/resources/mapper/Archive_MasterMapper.xml index fbce876..924e3e5 100644 --- a/src/main/resources/mapper/Archive_MasterMapper.xml +++ b/src/main/resources/mapper/Archive_MasterMapper.xml @@ -711,7 +711,7 @@ CASE WHEN T1 IS NOT NULL AND YEAR ( T1 ) != '1801' THEN - '已签收' ELSE '未签收' + '已' ELSE '未' END remark, CASE WHEN jzh IS NOT NULL THEN @@ -781,6 +781,16 @@ and m.visit_id=#{visitId,jdbcType=NCHAR} + + + + and m.LockInfo = '完整' + + + and m.LockInfo != '完整' + + + and m.name like '%'+#{name,jdbcType=NCHAR}+'%' @@ -1384,6 +1394,76 @@ where id = #{id,jdbcType=NVARCHAR} + + + update archive_master + + + inp_no = #{inpNo,jdbcType=NVARCHAR}, + + + visit_id = #{visitId,jdbcType=NVARCHAR}, + + + name = #{name,jdbcType=NVARCHAR}, + + + sex = #{sex,jdbcType=NVARCHAR}, + + + dept_name = #{deptName,jdbcType=NVARCHAR}, + + + discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR}, + + + ArchiveState = #{archivestate,jdbcType=NVARCHAR}, + + + admission_date_time = #{admissionDateTime,jdbcType=NVARCHAR}, + + + dept_admission_to = #{deptAdmissionTo,jdbcType=NVARCHAR}, + + + check_doctor = #{checkDoctor,jdbcType=NVARCHAR}, + + + check_datetime = #{checkDatetime,jdbcType=NVARCHAR}, + + + checked_doctor = #{checkedDoctor,jdbcType=NVARCHAR}, + + + checked_datetime = #{checkedDatetime,jdbcType=NVARCHAR}, + + + LockInfo = #{lockinfo,jdbcType=NVARCHAR}, + + + DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR}, + + + ID_NO = #{idNo,jdbcType=NVARCHAR}, + + + DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR}, + + + dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR}, + + + returnto_role = #{returntoRole,jdbcType=NVARCHAR}, + + + return_oper_username = #{returnOperUsername,jdbcType=NVARCHAR}, + + + change_reason = #{changeReason,jdbcType=NVARCHAR}, + + + where id = #{id,jdbcType=NVARCHAR} + update archive_master set patient_id = #{patientId,jdbcType=NVARCHAR}, @@ -1691,7 +1771,7 @@ select *,emr_dictionary.Name as deptName1 from archive_master LEFT JOIN emr_dictionary ON archive_master.dept_name = emr_dictionary. CODE AND emr_dictionary.parent_id = 'dept_code' - where patient_id=#{patientId} + where patient_id in (${patientIds}) SELECT diff --git a/src/main/resources/mapper/V_CountMapper.xml b/src/main/resources/mapper/V_CountMapper.xml index 3ab20b4..ce401f5 100644 --- a/src/main/resources/mapper/V_CountMapper.xml +++ b/src/main/resources/mapper/V_CountMapper.xml @@ -43,7 +43,7 @@ t5.Num - ISNULL(t4.deathNum, 0) ) AS FLOAT ) / ( - t2.fileNum - ISNULL(t4.deathNum, 0) + t1.outNum-ISNULL(t4.deathNum, 0) - ISNULL(t4.deathNum, 0) ), 2 ) @@ -58,7 +58,7 @@ t6.Num - ISNULL(t4.deathNum, 0) ) AS FLOAT ) / ( - t2.fileNum - ISNULL(t4.deathNum, 0) + t1.outNum-ISNULL(t4.deathNum, 0) - ISNULL(t4.deathNum, 0) ), 2 ) @@ -68,7 +68,7 @@ 0 ELSE ROUND( - CAST(t7.Num AS FLOAT) / (t2.fileNum), + CAST(t7.Num AS FLOAT) / (t1.outNum), 2 ) END day7Rate @@ -88,7 +88,7 @@ group by dept_name) as t1 on c.dept_name= t1.dept_name - left join (select dept_name,COUNT(*) AS fileNum from archive_master as s where (s.ArchiveState = '128' OR (s.ArchiveState = '64' and s.T1 is not null and s.T1 != '' and s.T1 >= '1801-02-04 00:00:00')) and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D' + left join (select dept_name,COUNT(*) AS fileNum from archive_master as s where (s.ArchiveState = '128' OR (s.ArchiveState = '64' and s.T1 is not null and s.T1 != '' and s.T1 >= '1801-02-04 00:00:00')) and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D' and s.ArchiveState='128' and discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and @@ -102,7 +102,7 @@ group by dept_name) as t2 on c.dept_name= t2.dept_name - left join (select dept_name,COUNT(*) AS deathNum from archive_master as s where s.DISCHARGE_DISPOSITION=5 and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D' + left join (select dept_name,COUNT(*) AS deathNum from archive_master as s where s.DISCHARGE_DISPOSITION=5 and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D' and s.ArchiveState='128' and discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and @@ -116,7 +116,7 @@ group by dept_name) as t4 on c.dept_name= t4.dept_name - left join (select dept_name,COUNT(*) AS Num from archive_master as s where s.ArchiveState = '128' and ( datediff( d, discharge_date_time, checked_datetime ) - ( SELECT COUNT(1) FROM emr_holiday_set WHERE date BETWEEN CONVERT ( VARCHAR (10), discharge_date_time, 120 ) AND checked_datetime AND flag = 2 )) <= 2 and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D' + left join (select dept_name,COUNT(*) AS Num from archive_master as s where s.ArchiveState = '128' and ( datediff( d, discharge_date_time, checked_datetime ) - ( SELECT COUNT(1) FROM emr_holiday_set WHERE date BETWEEN CONVERT ( VARCHAR (10), discharge_date_time, 120 ) AND checked_datetime AND flag = 2 )) <= 2 and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D' and s.ArchiveState='128' and discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and @@ -130,7 +130,7 @@ group by dept_name) as t5 on c.dept_name= t5.dept_name - left join (select dept_name,COUNT(*) AS Num from archive_master as s where (s.ArchiveState = '128' OR (s.ArchiveState = '64' and s.T1 is not null and s.T1 != '' and s.T1 >= '1801-02-04 00:00:00')) and ( datediff( d, discharge_date_time, checked_datetime ) - ( SELECT COUNT(1) FROM emr_holiday_set WHERE date BETWEEN CONVERT ( VARCHAR (10), discharge_date_time, 120 ) AND checked_datetime AND flag = 2 )) <= 3 and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D' + left join (select dept_name,COUNT(*) AS Num from archive_master as s where (s.ArchiveState = '128' OR (s.ArchiveState = '64' and s.T1 is not null and s.T1 != '' and s.T1 >= '1801-02-04 00:00:00')) and ( datediff( d, discharge_date_time, checked_datetime ) - ( SELECT COUNT(1) FROM emr_holiday_set WHERE date BETWEEN CONVERT ( VARCHAR (10), discharge_date_time, 120 ) AND checked_datetime AND flag = 2 )) <= 3 and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D' and s.ArchiveState='128' and discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and @@ -144,7 +144,7 @@ group by dept_name) as t6 on c.dept_name= t6.dept_name - left join (select dept_name,COUNT(*) AS Num from archive_master as s where (s.ArchiveState = '128' OR (s.ArchiveState = '64' and s.T1 is not null and s.T1 != '' and s.T1 >= '1801-02-04 00:00:00')) and ( datediff( d, discharge_date_time, checked_datetime ) - ( SELECT COUNT(1) FROM emr_holiday_set WHERE date BETWEEN CONVERT ( VARCHAR (10), discharge_date_time, 120 ) AND checked_datetime AND flag = 2 )) <= 7 and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D' + left join (select dept_name,COUNT(*) AS Num from archive_master as s where (s.ArchiveState = '128' OR (s.ArchiveState = '64' and s.T1 is not null and s.T1 != '' and s.T1 >= '1801-02-04 00:00:00')) and ( datediff( d, discharge_date_time, checked_datetime ) - ( SELECT COUNT(1) FROM emr_holiday_set WHERE date BETWEEN CONVERT ( VARCHAR (10), discharge_date_time, 120 ) AND checked_datetime AND flag = 2 )) <= 5 and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D' and s.ArchiveState='128' and discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and diff --git a/src/main/webapp/WEB-INF/views/index.jsp b/src/main/webapp/WEB-INF/views/index.jsp index 693c977..a32214b 100644 --- a/src/main/webapp/WEB-INF/views/index.jsp +++ b/src/main/webapp/WEB-INF/views/index.jsp @@ -3,7 +3,7 @@ - 病案归档系统 + 病案无纸化归档系统 @@ -239,7 +239,7 @@ <%--ALT--%> - 病案归档系统 + 病案无纸化归档系统