smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java
@@ -781,7 +781,7 @@ patMedInhosp.setDelFlag("0"); patMedInhosp.setOrgid(dto.getOrgId()); patMedInhosp.setCampusid(dto.getCampusId()); if(StringUtils.isNotEmpty(dto.getHealthcareRecordStatus())&&dto.getHealthcareRecordStatus().equals("FH0109.25")) if (StringUtils.isNotEmpty(dto.getHealthcareRecordStatus()) && dto.getHealthcareRecordStatus().equals("FH0109.25")) patMedInhosp.setRemark("预出院"); return patMedInhosp; } @@ -811,9 +811,9 @@ private PatArchive processPatientArchive(ServiceSLTDInhospResDTO dto) { List<PatArchive> existingArchives = null; log.info("【processPatientArchive】新增患者档案,查询入参信息patientno:{},idcardno:{}", dto.getMedicalRecordNo(), dto.getIdCardNo()); // 第一步:按 patientno 精确查重(与插入时使用的 medicalRecordNo 一致) String patientno = dto.getMedicalRecordNo() == null ? null : String.valueOf(dto.getMedicalRecordNo()); String patientno = StringUtils.isEmpty(dto.getMedicalRecordNo()) ? null : dto.getMedicalRecordNo(); if (StringUtils.isNotEmpty(patientno)) { PatArchive queryByPatientNo = new PatArchive(); queryByPatientNo.setPatientno(patientno); @@ -831,7 +831,13 @@ if (CollectionUtils.isEmpty(existingArchives)) { try { patArchiveService.insertPatArchive(patArchive); //再查一次,确保不会有重复的 PatArchive queryByIdCard = new PatArchive(); if(StringUtils.isNotEmpty(dto.getIdCardNo())) queryByIdCard.setIdcardno(dto.getIdCardNo().trim()); if(StringUtils.isNotEmpty(dto.getMedicalRecordNo())) queryByIdCard.setPatientno(dto.getMedicalRecordNo()); List<PatArchive> archivesByIdCard = patArchiveService.selectPatArchiveList(queryByIdCard); if (CollectionUtils.isEmpty(archivesByIdCard)) patArchiveService.insertPatArchive(patArchive); log.info("【processPatientArchive】新增患者档案,患者编号:{}", patArchive.getPatientno()); } catch (org.springframework.dao.DuplicateKeyException e) { log.error("【processPatientArchive】患者档案已存在(并发插入),跳过:patientno={}, idcardno={}", patArchive.getPatientno(), patArchive.getIdcardno()); @@ -858,7 +864,7 @@ private PatArchive buildPatientArchive(ServiceSLTDInhospResDTO dto) { PatArchive patArchive = new PatArchive(); patArchive.setPatientno(dto.getMedicalRecordNo() == null ? null : String.valueOf(dto.getMedicalRecordNo())); patArchive.setPatientno(StringUtils.isEmpty(dto.getMedicalRecordNo()) ? null : dto.getMedicalRecordNo()); patArchive.setPatidHis(dto.getPatientId() == null ? null : String.valueOf(dto.getPatientId())); patArchive.setIdcardno(StringUtils.isEmpty(dto.getIdCardNo()) ? "" + dto.getMedicalCardId() : dto.getIdCardNo().trim()); patArchive.setName(dto.getPatientName()); smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -166,7 +166,7 @@ private Integer phoneEndHour; @Autowired private Icd10Mapper icd10Mapper; private IPatMedOuthospService patMedOuthospService; @Value("${spring.profiles.active}") private String active; @@ -804,7 +804,6 @@ serviceTask.setSendTimeSlot(JSON.toJSONString(serviceTaskVO.getSendTimeslot())); //修改操作,需要将stopState状态+1 ServiceTask serviceTask1 = serviceTaskService.selectServiceTaskByTaskid(serviceTask.getTaskid()); //获取到该任务所有的服务,并从队列里删除 ServiceSubtaskEntity serviceSubtaskVO = new ServiceSubtaskEntity(); serviceSubtaskVO.setTaskid(serviceTask1.getTaskid()); serviceSubtaskVO.setSendstate(2L); @@ -826,6 +825,27 @@ redisCache.removeElementFromList("cache-2", serviceSubtask.getId().toString()); redisCache.removeElementFromList("cache-3", serviceSubtask.getId().toString()); redisCache.removeElementFromList("cache-4", serviceSubtask.getId().toString()); //将出入院表的数据,还原成还未处理的状态 if(serviceSubtask.getServiceType().equals("2")) { PatMedInhosp patMedInhosp = new PatMedInhosp(); patMedInhosp.setDeptcheckFlag("0"); patMedInhosp.setWardcheckFlag("0"); patMedInhosp.setDiagcheckFlag("0"); patMedInhosp.setInhospid(serviceSubtask.getInhospid()); patMedInhospMapper.updatePatMedInhosp(patMedInhosp); }else if(serviceSubtask.getServiceType().equals("3")) { if(serviceSubtask.getInhospid()!=null) { PatMedOuthospQueryReq req=new PatMedOuthospQueryReq(); req.setOuthospno(serviceSubtask.getHospno()); List<PatMedOuthosp> patMedOuthosps = patMedOuthospMapper.callSpQueryOuthosp(req); if(CollectionUtils.isNotEmpty(patMedOuthosps)) { PatMedOuthosp patMedOuthosp = patMedOuthosps.get(0); patMedOuthosp.setServerState("0"); patMedOuthospService.updatePatMedOuthosp(patMedOuthosp); } } } } } @@ -891,12 +911,13 @@ } serviceTaskdiag.setLongtask(Long.valueOf(serviceTask.getLongTask())); serviceTaskdiag.setIcd10name(serviceTaskVO.getIcd10name()); serviceTaskdiag.setGuid(serviceTask.getGuid()); serviceTaskdiag.setOrgid(serviceTask.getOrgid()); serviceTaskdiag.setDeptCode(serviceTaskVO.getDeptcode()); serviceTaskdiag.setDeptName(serviceTaskVO.getDeptname()); serviceTaskdiag.setWardCode(serviceTaskVO.getLeavehospitaldistrictcode()); serviceTaskdiag.setWardName(serviceTaskVO.getLeavehospitaldistrictname()); serviceTaskdiag.setGuid(serviceTask1.getGuid()); serviceTaskdiag.setServiceType(serviceTask1.getServiceType()); serviceTaskdiag.setOrgid(serviceTask1.getOrgid()); serviceTaskdiag.setDeptCode(serviceTask1.getDeptcode()); serviceTaskdiag.setDeptName(serviceTask1.getDeptname()); serviceTaskdiag.setWardCode(serviceTask1.getLeavehospitaldistrictcode()); serviceTaskdiag.setWardName(serviceTask1.getLeavehospitaldistrictname()); serviceTaskdiag.setUpdateTime(new Date()); if (StringUtils.isNotEmpty(serviceTaskVO.getIcd10code())) { String[] icd10codes = serviceTaskVO.getIcd10code().split(","); smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
@@ -531,21 +531,21 @@ <update id="updateServiceTask" parameterType="com.smartor.domain.ServiceTask"> update service_task <trim prefix="SET" suffixOverrides=","> <if test="taskName != null">task_name = #{taskName},</if> <if test="taskName != null and taskName != ''">task_name = #{taskName},</if> <if test="templateid != null">templateid = #{templateid},</if> <if test="templatename != null">templatename = #{templatename},</if> <if test="templatename != null and templatename != ''">templatename = #{templatename},</if> <if test="labelinfo != null">labelinfo = #{labelinfo},</if> <if test="count != null">count = #{count},</if> <if test="executed != null">executed = #{executed},</if> <if test="unexecuted != null">unexecuted = #{unexecuted},</if> <if test="fail != null">fail = #{fail},</if> <if test="checkuserid != null">checkuserid = #{checkuserid},</if> <if test="checkusername != null">checkusername = #{checkusername},</if> <if test="checkusername != null and checkusername != ''">checkusername = #{checkusername},</if> <if test="checktime != null">checktime = #{checktime},</if> <if test="type != null">type = #{type},</if> <if test="typename != null">typename = #{typename},</if> <if test="deptcode != null">deptcode = #{deptcode},</if> <if test="deptname != null">deptname = #{deptname},</if> <if test="deptcode != null and deptcode != ''">deptcode = #{deptcode},</if> <if test="deptname != null and deptname != ''">deptname = #{deptname},</if> <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if> <if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateTime != null">update_time = #{updateTime},</if> @@ -556,11 +556,11 @@ <if test="orgid != null">orgid = #{orgid},</if> <if test="nexttaskflag != null">nexttaskflag = #{nexttaskflag},</if> <if test="nexttaskid != null">nexttaskid = #{nexttaskid},</if> <if test="nexttaskname != null">nexttaskname = #{nexttaskname},</if> <if test="nexttaskname != null and nexttaskname!=''">nexttaskname = #{nexttaskname},</if> <if test="pid != null">pid = #{pid},</if> <if test="guid != null">guid = #{guid},</if> <if test="preachform != null">preachform = #{preachform},</if> <if test="preachformDesc != null">preachform_desc = #{preachformDesc},</if> <if test="preachformDesc != null and preachformDesc!=''">preachform_desc = #{preachformDesc},</if> <if test="sendType != null">send_type = #{sendType},</if> <if test="sendState != null">send_state = #{sendState},</if> <if test="hospType != null and hospType != ''">hosp_type = #{hospType},</if> @@ -578,9 +578,9 @@ <if test="longTask != null and longTask != ''">long_task = #{longTask},</if> <if test="kcb != null and kcb != ''">kcb = #{kcb},</if> <if test="jsy != null and jsy != ''">jsy = #{jsy},</if> <if test="leavehospitaldistrictname != null ">leavehospitaldistrictname = #{leavehospitaldistrictname}, <if test="leavehospitaldistrictname != null and leavehospitaldistrictname != ''">leavehospitaldistrictname = #{leavehospitaldistrictname}, </if> <if test="leavehospitaldistrictcode != null ">leavehospitaldistrictcode = #{leavehospitaldistrictcode}, <if test="leavehospitaldistrictcode != null and leavehospitaldistrictcode != ''">leavehospitaldistrictcode = #{leavehospitaldistrictcode}, </if> <if test="compensateDate != null and compensateDate != ''">compensate_date = #{compensateDate},</if> <if test="sendDay != null ">send_day = #{sendDay},</if>