当输入患者的姓名和身份号码两个字段的值已经存在时,提醒挂号工作人员该患者档案已经存在
This commit is contained in:
@@ -53,4 +53,13 @@ public interface IPatientInformationService {
|
||||
*/
|
||||
R<?> addPatient(PatientInformationDto patientInformationDto);
|
||||
|
||||
/**
|
||||
* 检查患者是否存在
|
||||
*
|
||||
* @param name 患者姓名
|
||||
* @param idCardNo 身份证号
|
||||
* @return 是否存在
|
||||
*/
|
||||
boolean checkPatientExists(String name, String idCardNo);
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user