当输入患者的姓名和身份号码两个字段的值已经存在时,提醒挂号工作人员该患者档案已经存在

This commit is contained in:
Auora
2025-10-22 15:15:11 +08:00
parent 8bc5d45976
commit 48b2188cf9
5 changed files with 72 additions and 2 deletions

View File

@@ -53,4 +53,13 @@ public interface IPatientInformationService {
*/
R<?> addPatient(PatientInformationDto patientInformationDto);
/**
* 检查患者是否存在
*
* @param name 患者姓名
* @param idCardNo 身份证号
* @return 是否存在
*/
boolean checkPatientExists(String name, String idCardNo);
}

View File

@@ -257,4 +257,14 @@ public class PatientInformationServiceImpl implements IPatientInformationService
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"病人信息"}));
}
@Override
public boolean checkPatientExists(String name, String idCardNo) {
QueryWrapper<Patient> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("name", name)
.eq("id_card", idCardNo)
.eq("delete_flag", "0");
return patientService.count(queryWrapper) > 0;
}
}

View File

@@ -78,4 +78,16 @@ public class PatientInformationController {
.ok(patientInformationService.getPatientInfo(patientInfoSearchParam, searchKey, pageNo, pageSize, request));
}
/**
* 检查患者是否存在
*
* @param name 患者姓名
* @param idCardNo 身份证号
* @return 是否存在
*/
@GetMapping("/check-exists")
public R<?> checkPatientExists(@RequestParam String name, @RequestParam String idCardNo) {
return R.ok(patientInformationService.checkPatientExists(name, idCardNo));
}
}