2 Commits

5 changed files with 22 additions and 17 deletions

View File

@@ -45,9 +45,9 @@ public interface IPatientInformationService {
/**
* 添加病人信息
*
* @param patientInfoDto 病人信息
* @param patientBaseInfoDto 病人信息
*/
R<?> addPatient(PatientBaseInfoDto patientInfoDto);
R<?> addPatient(PatientBaseInfoDto patientBaseInfoDto);
/**
* 更新患者手机号

View File

@@ -254,31 +254,32 @@ public class PatientInformationServiceImpl implements IPatientInformationService
/**
* 添加病人信息
*
* @param patientInfoDto 病人信息
* @param patientBaseInfoDto 病人信息
*/
@Override
public R<?> addPatient(PatientBaseInfoDto patientInfoDto) {
public R<?> addPatient(PatientBaseInfoDto patientBaseInfoDto) {
// log.debug("添加病人信息,patientInfoDto:{}", patientBaseInfoDto);
// 如果患者没有输入身份证号则根据年龄自动生成
String idCard = patientInfoDto.getIdCard();
String idCard = patientBaseInfoDto.getIdCard();
if (idCard == null || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) {
if (patientInfoDto.getAge() != null) {
idCard = IdCardUtil.generateIdByAge(patientInfoDto.getAge());
patientInfoDto.setIdCard(idCard);
if (patientBaseInfoDto.getAge() != null) {
idCard = IdCardUtil.generateIdByAge(patientBaseInfoDto.getAge());
patientBaseInfoDto.setIdCard(idCard);
}
}
// 身份证号是否存在
List<Patient> idCardList
= patientService.list(new LambdaQueryWrapper<Patient>().eq(Patient::getIdCard, patientInfoDto.getIdCard()));
= patientService.list(new LambdaQueryWrapper<Patient>().eq(Patient::getIdCard, patientBaseInfoDto.getIdCard()));
if (!idCardList.isEmpty()) {
throw new ServiceException("身份证号:" + patientInfoDto.getIdCard() + "已经存在");
throw new ServiceException("身份证号:" + patientBaseInfoDto.getIdCard() + "已经存在");
}
// 处理患者信息
Patient patient = this.handlePatientInfo(patientInfoDto);
Patient patient = this.handlePatientInfo(patientBaseInfoDto);
// 新增患者身份子表信息
if (patientInfoDto.getPatientIdInfoList() != null) {
List<PatientIdInfoDto> patientIdInfoList = patientInfoDto.getPatientIdInfoList();
if (patientBaseInfoDto.getPatientIdInfoList() != null) {
List<PatientIdInfoDto> patientIdInfoList = patientBaseInfoDto.getPatientIdInfoList();
PatientIdentifier patientIdentifier;
for (PatientIdInfoDto patientIdInfoDto : patientIdInfoList) {
patientIdentifier = new PatientIdentifier();

View File

@@ -38,11 +38,12 @@ public class PatientInformationController {
/**
* 添加病人信息
*
* @param patientInfoDto 病人信息
* @param patientBaseInfoDto 病人信息
*/
@PostMapping("/patient-information")
public R<?> addPatient(@RequestBody PatientBaseInfoDto patientInfoDto) {
return patientInformationService.addPatient(patientInfoDto);
public R<?> addPatient(@RequestBody PatientBaseInfoDto patientBaseInfoDto) {
// log.debug("添加病人信息,patientInfoDto:{}", patientBaseInfoDto);
return patientInformationService.addPatient(patientBaseInfoDto);
}
/**

View File

@@ -1201,6 +1201,7 @@ function submitForm() {
form.value.patientIdInfoList = [
{
typeCode: form.value.typeCode,
identifierNo: form.value.identifierNo,
},
];
if (form.value.idCard) {
@@ -1235,6 +1236,8 @@ function submitForm() {
emits('submit', 'update');
});
} else {
// console.log('患者就诊卡号:', form.value.identifierNo)
// console.log('患者就诊信息:', form.value.patientIdInfoList)
// 新增患者
addPatient(form.value).then((response) => {
proxy.$modal.msgSuccess('新增成功');

View File

@@ -2,7 +2,7 @@
<el-dialog
title="添加中医诊断"
v-model="props.openAddDiagnosisDialog"
width="1500px"
width="1300px"
append-to-body
destroy-on-close
@open="handleOpen"