提交验证未出院信息

master
wyb 2 years ago
parent 59872e3a7b
commit a18732a81e

@ -110,6 +110,10 @@ public class SdBusinessServiceImpl implements SdBusinessService {
dto.setPriority(4);
CommonResult<String> task = collectTaskService.compensateTask(dto);
if (ResultCode.FAILED.getCode().equals(task.getCode())) {
String data = task.getData();
if (Func.isNotBlank(data) && data.contains("出院")) {
throw new BaseException("患者未出院!");
}
throw new RuntimeException("补偿失败!");
}
}
@ -121,6 +125,20 @@ public class SdBusinessServiceImpl implements SdBusinessService {
if (patientIds.size() > 1) {
throw new BaseException("住院号+住院次数 ,系统中患者有多个!");
}
if (!isDischarge(patientIds.get(0))) {
throw new BaseException("该患者未出院!");
}
}
/**
*
*
* @param patientId
* @return
*/
private boolean isDischarge(String patientId) {
int count = tBasicMapper.getDischargeCount(patientId);
return count > 0;
}

@ -6,12 +6,13 @@ import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface TBasicMapper{
List<String> getPatientIdsByInpatientNoAndTimes(@Param("inpatientNo")String inHospIndexNo, @Param("admissTimes") Integer visitNo);
public interface TBasicMapper {
List<String> getPatientIdsByInpatientNoAndTimes(@Param("inpatientNo") String inHospIndexNo, @Param("admissTimes") Integer visitNo);
/**
*
* @param patientId
*
* @param patientId
* @param submitTime
* @return database
*/
@ -19,7 +20,8 @@ public interface TBasicMapper{
/**
*
* @param patientId
*
* @param patientId
* @param submitTime
* @return database
*/
@ -27,9 +29,18 @@ public interface TBasicMapper{
/**
*
*
* @param patientId
* @param fileCount
* @return database
*/
int insertOrUpdateNurseFileCount(@Param("patientId")String patientId,@Param("fileCount") Integer fileCount);
int insertOrUpdateNurseFileCount(@Param("patientId") String patientId, @Param("fileCount") Integer fileCount);
/**
*
*
* @param patientId
* @return
*/
int getDischargeCount(@Param("patientId") String patientId);
}

@ -22,4 +22,11 @@
FROM `docus_medicalrecord`.t_basic tb
WHERE tb.inpatient_no=#{inpatientNo} and tb.admiss_times=#{admissTimes}
</select>
<select id="getDischargeCount" resultType="java.lang.Integer">
SELECT count(1)
FROM `docus_medicalrecord`.t_basic tb
WHERE tb.patient_id=#{patientId}
and tb.dis_date > '1801-02-03 00:00:00'
</select>
</mapper>

Loading…
Cancel
Save