smartor/src/main/java/com/smartor/mapper/PatMedInhospMapper.java
@@ -25,6 +25,8 @@ */ public PatMedInhosp selectPatMedInhospByInhospid(Long inhospid); public List<PatMedInhosp> selectPatMedInhosp(PatMedInhosp patMedInhosp); public String getTagnameBypatid(Long patid); /** smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java
@@ -39,7 +39,7 @@ public List<ServiceSubtask> selectServiceSubtaskListAgain(ServiceSubtaskVO serviceSubtaskVO); public Integer selectSendstateByCondition(ServiceSubtask serviceSubtask); public List<Integer> selectSendstateByCondition(ServiceSubtask serviceSubtask); /** * 新增单一任务(随访) smartor/src/main/java/com/smartor/service/IPatMedInhospService.java
@@ -23,6 +23,8 @@ */ public PatMedInhosp selectPatMedInhospByInhospid(Long inhospid); public List<PatMedInhosp> selectPatMedInhosp(PatMedInhosp patMedInhosp); /** * 查询患者住院记录列表 * @@ -34,7 +36,7 @@ /** * 出院、门诊人数和随访量统计(周,月,年) */ public Map<String,Integer> queryPersonCount(PatServiceCount patServiceCount); public Map<String, Integer> queryPersonCount(PatServiceCount patServiceCount); /** * 查询当前登陆人自己(病区、部门)的患者住院记录列表 @@ -100,6 +102,7 @@ /** * 医护与患者关联关系 * * @param patMedInhosp * @return */ smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -66,6 +66,11 @@ return patMedInhospMapper.selectPatMedInhospByInhospid(inhospid); } @Override public List<PatMedInhosp> selectPatMedInhosp(PatMedInhosp patMedInhosp) { return patMedInhospMapper.selectPatMedInhosp(patMedInhosp); } /** * 查询患者住院记录列表 * smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java
@@ -441,11 +441,14 @@ if (Objects.isNull(dto)) continue; PatArchive patArchive = processPatientArchive(dto, orgid); PatMedOuthosp patMedOuthosp = buildPatMedOuthosp(dto, patArchive, orgid); //查询当前新增的门急诊数据,是否在过渡表中是否存在,如果存在,就不往门急诊表里新增了 PatMedOuthospProvisional pmop = DtoConversionUtils.sourceToTarget(patMedOuthosp, PatMedOuthospProvisional.class); // //查询当前新增的门急诊数据,是否在过渡表中是否存在,如果存在,就不往门急诊表里新增了(这个先不写了,抽空了再写) // PatMedOuthospProvisional pmop = DtoConversionUtils.sourceToTarget(patMedOuthosp, PatMedOuthospProvisional.class); patMedOuthospMapper.insertPatMedOuthosp(patMedOuthosp); //先查询一下,是不是已经存在该流水号了,如果存在,就不新增了 PatMedOuthosp pmo2 = new PatMedOuthosp(); pmo2.setSerialnum(patMedOuthosp.getSerialnum()); List<PatMedOuthosp> patMedOuthosps = patMedOuthospMapper.selectPatMedOuthospList(pmo2); if (CollectionUtils.isEmpty(patMedOuthosps)) patMedOuthospMapper.insertPatMedOuthosp(patMedOuthosp); } return true; } @@ -503,11 +506,14 @@ queryInhosp.setCampusid(dto.getCampusId()); queryInhosp.setInhospstate(cry); log.info("----------------这里的入参为:{}", queryInhosp); List<PatMedInhosp> existingInhosps = patMedInhospService.selectPatMedInhospList(queryInhosp); List<PatMedInhosp> existingInhosps = patMedInhospService.selectPatMedInhosp(queryInhosp); if (cry.equals("0") && CollectionUtils.isNotEmpty(existingInhosps)) { //新增过的入院数据,不再处理 return; } else if (cry.equals("1") && CollectionUtils.isNotEmpty(existingInhosps)) { //新增过的出院数据,也不再处理 return; } log.info("----------------这里的返参为:{}", existingInhosps); smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
@@ -717,6 +717,13 @@ for (Integer taskId : sendTaskids) { ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(Long.valueOf(taskId)); String content = sendMQContent(serviceTask, null); //先查询一下,该患者在该service_task中,是否已经存在,如果已经存在,则不用再保存了 ServiceSubtask ss = new ServiceSubtask(); ss.setTaskid(Long.valueOf(taskId)); ss.setPatid(serviceSubtask.getPatid()); List<Integer> list = serviceSubtaskMapper.selectSendstateByCondition(ss); if (CollectionUtils.isNotEmpty(list)) return true; //先修改状态 insertServiceSubtask(serviceTask, new Date(), serviceSubtask); //立即发送 @@ -724,7 +731,7 @@ serviceTask.setStopState(null); log.info("消息发送成功"); } return null; return true; } @@ -736,6 +743,7 @@ serviceSubtask.setTemplatename(serviceTask.getTemplatename()); serviceSubtask.setTemplateid(serviceTask.getTemplateid()); serviceSubtask.setSendstate(2L); serviceSubtask.setCurrentPreachform(null); serviceSubtask.setVisitTime(date); serviceSubtask.setId(null); serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
@@ -263,9 +263,10 @@ ServiceSubtask ss = new ServiceSubtask(); ss.setTaskid(taskid); ss.setPatid(patid); Integer integer = serviceSubtaskMapper.selectSendstateByCondition(ss); if (integer != null && integer != 6) { ss.setSendstate(1L); ss.setSendstate(3L); List<Integer> integer = serviceSubtaskMapper.selectSendstateByCondition(ss); if (integer != null) { ss.setSendstate(6L); serviceSubtaskMapper.updateServiceSubtaskByCondition(ss); } } @@ -603,8 +604,9 @@ ServiceSubtask serviceSubtask = new ServiceSubtask(); serviceSubtask.setTaskid(taskid); serviceSubtask.setPatid(patid); Integer integer = serviceSubtaskMapper.selectSendstateByCondition(serviceSubtask); if (integer == 3) { serviceSubtask.setSendstate(3L); List<Integer> integer = serviceSubtaskMapper.selectSendstateByCondition(serviceSubtask); if (integer != null) { serviceSubtask.setResult("完成"); serviceSubtask.setFinishtime(new Date()); serviceSubtask.setSendstate(6L); smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -305,7 +305,8 @@ </if> </select> <select id="selectPatMedInhospListBySerialnum" parameterType="com.smartor.domain.PatMedInhosp" resultMap="PatMedInhospResult"> <select id="selectPatMedInhospListBySerialnum" parameterType="com.smartor.domain.PatMedInhosp" resultMap="PatMedInhospResult"> select b.inhospid, b.nurse_id, @@ -507,6 +508,74 @@ <select id="selectPatMedInhospByInhospid" parameterType="Long" resultMap="PatMedInhospResult"> <include refid="selectPatMedInhospVo"/> where inhospid = #{inhospid} </select> <select id="selectPatMedInhosp" parameterType="Long" resultMap="PatMedInhospResult"> <include refid="selectPatMedInhospVo"/> where del_flag=0 <if test="cry != null and cry == 0 ">and endtime is null</if> <if test="cry != null and cry == 1 ">and inhospstate=1</if> <if test="serialnum != null">and serialnum = #{serialnum}</if> <if test="hospitalname != null">and hospitalname = #{hospitalname}</if> <if test="hospitalcode != null">and hospitalcode = #{hospitalcode}</if> <if test="hospitaldistrictcode != null">and hospitaldistrictcode = #{hospitaldistrictcode}</if> <if test="hospitaldistrictname != null">and hospitaldistrictname = #{hospitaldistrictname}</if> <if test="icd10code != null">and icd10code = #{icd10code}</if> <if test="diagname != null">and diagname = #{diagname}</if> <if test="starttime != null">and starttime = #{starttime}</if> <if test="endtime != null">and endtime = #{endtime}</if> <if test="deptcode != null">and deptcode = #{deptcode}</if> <if test="deptname != null">and deptname = #{deptname}</if> <if test="roomno != null">and roomno = #{roomno}</if> <if test="bedNo != null">and bed_no = #{bedNo}</if> <if test="orgid != null">and orgid = #{orgid}</if> <if test="updateBy != null">and update_by = #{updateBy}</if> <if test="updateTime != null">and update_time = #{updateTime}</if> <if test="createBy != null">and create_by = #{createBy}</if> <if test="createTime != null">and create_time = #{createTime}</if> <if test="isupload != null">and isupload = #{isupload}</if> <if test="uploadTime != null">and upload_time = #{uploadTime}</if> <if test="patid != null">and patid = #{patid}</if> <if test="leavediagname != null">and leavediagname = #{leavediagname}</if> <if test="leaveicd10code != null">and leaveicd10code = #{leaveicd10code}</if> <if test="drcode != null">and drcode = #{drcode}</if> <if test="drname != null">and drname = #{drname}</if> <if test="schemestatus != null">and schemestatus = #{schemestatus}</if> <if test="generalschemestatus != null">and generalschemestatus = #{generalschemestatus}</if> <if test="leaveldeptcode != null">and leaveldeptcode = #{leaveldeptcode}</if> <if test="leaveldeptname != null">and leaveldeptname = #{leaveldeptname}</if> <if test="hospitaldistrictid != null">and hospitaldistrictid = #{hospitaldistrictid}</if> <if test="leavehospitaldistrictcode != null">and leavehospitaldistrictcode = #{leavehospitaldistrictcode}</if> <if test="leavehospitaldistrictname != null">and leavehospitaldistrictname = #{leavehospitaldistrictname}</if> <if test="leavehospitaldistrictid != null">and leavehospitaldistrictid = #{leavehospitaldistrictid}</if> <if test="deptid != null">and deptid = #{deptid}</if> <if test="leaveldeptid != null">and leaveldeptid = #{leaveldeptid}</if> <if test="schemetime != null">and schemetime = #{schemetime}</if> <if test="patname!= null">and patname = #{patname}</if> <if test="patno != null">and patno = #{patno}</if> <if test="inhospstate != null">and inhospstate = #{inhospstate}</if> <if test="deptcheckFlag != null">and deptcheck_flag = #{deptcheckFlag}</if> <if test="wardcheckFlag != null">and wardcheck_flag = #{wardcheckFlag}</if> <if test="diagcheckFlag != null">and diagcheck_flag = #{diagcheckFlag}</if> <if test="longTaskReason != null">and long_task_reason = #{longTaskReason}</if> <if test="nurseId != null ">and nurse_id = #{nurseId}</if> <if test="nurseName != null ">and nurse_name = #{nurseName}</if> <if test="outWayId != null ">and out_way_id = #{outWayId}</if> <if test="outWayName != null ">and out_way_name = #{outWayName}</if> <if test="guid != null ">and guid = #{guid}</if> <if test="operator != null ">and operator = #{operator}</if> <if test="operatorId != null ">and operator_id = #{operatorId}</if> <if test="remark != null ">and remark = #{remark}</if> <if test="fuflag != null ">and fuflag = #{fuflag}</if> <if test="fudate != null ">and fudate = #{fudate}</if> <if test="fuperiod != null ">and fuperiod = #{fuperiod}</if> <if test="futypecode != null ">and futypecode = #{futypecode}</if> <if test="futypedesc != null ">and futypedesc = #{futypedesc}</if> <if test="fuadvice != null ">and fuadvice = #{fuadvice}</if> <if test="fuspecialadvice != null ">and fuspecialadvice = #{fuspecialadvice}</if> <if test="managementDoctor != null ">and management_doctor = #{managementDoctor}</if> <if test="managementDoctorCode != null ">and management_doctor_code = #{managementDoctorCode}</if> <if test="campusid != null ">and campusid = #{campusid}</if> </select> @@ -751,7 +820,7 @@ <if test="fuadvice != null ">fuadvice = #{fuadvice},</if> <if test="fuspecialadvice != null ">fuspecialadvice = #{fuspecialadvice},</if> <if test="managementDoctor != null ">management_doctor = #{managementDoctor},</if> <if test="managementDoctorCode != null ">management_doctor_code = #{managementDoctorCode}</if> <if test="managementDoctorCode != null ">management_doctor_code = #{managementDoctorCode},</if> <if test="campusid != null ">campusid = #{campusid}</if> </trim> smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -475,9 +475,11 @@ <select id="selectSendstateByCondition" parameterType="com.smartor.domain.ServiceSubtask" resultType="Integer"> SELECT b.sendstate from service_task a JOIN service_subtask b on a.taskid = b.taskid and a.pat_cycle = 0 and b.del_flag = 0 where b.taskid = #{taskid} and b.patid = #{patid} JOIN service_subtask b on a.taskid = b.taskid and a.pat_cycle = 0 and b.del_flag = 0 <where>b.taskid = #{taskid} and b.patid = #{patid} <if test="sendstate != null ">and b.sendstate = #{sendstate}</if> </where> </select> <select id="selectTimelyRate" parameterType="com.smartor.domain.ServiceSubtask" resultType="double">