This commit is contained in:
liuhongrui
2025-03-17 14:16:40 +08:00
parent 4ad10ec1c2
commit 70367cbf57
4 changed files with 39 additions and 11 deletions

View File

@@ -4,6 +4,7 @@ import java.util.List;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.web.patientmanage.dto.OutpatientRecordDto;
import com.openhis.web.patientmanage.dto.OutpatientRecordInitDto;
import com.openhis.web.patientmanage.dto.OutpatientRecordSearchParam;
/**
@@ -19,7 +20,7 @@ public interface IOutpatientRecordService {
*
* @return 门诊记录初期数据列表
*/
List<String> getOutpatientRecordInit();
OutpatientRecordInitDto getOutpatientRecordInit();
/**
* 分页查询门诊记录

View File

@@ -2,7 +2,6 @@ package com.openhis.web.patientmanage.appservice.impl;
import java.util.List;
import com.openhis.web.outpatientmanage.dto.OutpatientInfusionInitDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -12,6 +11,7 @@ import com.openhis.common.enums.EncounterSubjectStatus;
import com.openhis.common.utils.EnumUtils;
import com.openhis.web.patientmanage.appservice.IOutpatientRecordService;
import com.openhis.web.patientmanage.dto.OutpatientRecordDto;
import com.openhis.web.patientmanage.dto.OutpatientRecordInitDto;
import com.openhis.web.patientmanage.dto.OutpatientRecordSearchParam;
import com.openhis.web.patientmanage.mapper.PatientManageMapper;
@@ -33,11 +33,12 @@ public class OutpatientRecordServiceImpl implements IOutpatientRecordService {
* @return 门诊记录初期数据列表
*/
@Override
public List<String> getOutpatientRecordInit() {
// 获取医生名字列表
List<String> listDoctorNames = patientManageMapper.getDoctorNames();
public OutpatientRecordInitDto getOutpatientRecordInit() {
return listDoctorNames;
OutpatientRecordInitDto intoDto = new OutpatientRecordInitDto();
// 获取医生名字列表
intoDto.setDoctorNames(patientManageMapper.getDoctorNames());
return intoDto;
}
/**

View File

@@ -156,9 +156,14 @@ public class PatientInformationServiceImpl implements IPatientInformationService
patient.setWbStr(ChineseConvertUtils.toWBFirstLetter(patient.getName()));
// 设置死亡时间,死亡时间未来时报错
if (DateUtils.isFuture(patientInformationDto.getDeceasedDate())) {
return R.fail("死亡时间未来时间是未来时间!");
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"死亡时间未来时"}));
}
patient.setDeceasedDate(DateUtils.parseDate(patientInformationDto.getDeceasedDate()));
// 身份证号存在check
if (existsByIdCard(patientInformationDto.getIdCard())) {
// 身份证号存在
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"身份证号已存在"}));
}
// 调用服务层更新病人信息
boolean result = patientService.updateById(patient);
@@ -195,21 +200,21 @@ public class PatientInformationServiceImpl implements IPatientInformationService
patient.setWbStr(ChineseConvertUtils.toWBFirstLetter(patient.getName()));
// 设置死亡时间,死亡时间未来时报错
if (DateUtils.isFuture(patientInformationDto.getDeceasedDate())) {
return R.fail("死亡时间未来时间是未来时间!");
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"死亡时间未来时"}));
}
// 身份证号存在check
if (existsByIdCard(patientInformationDto.getIdCard())) {
// 身份证号存在
return R.fail("身份证号已存在");
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"身份证号已存在"}));
}
patient.setDeceasedDate(DateUtils.parseDate(patientInformationDto.getDeceasedDate()));
// 调用服务层保存病人信息
boolean result = patientService.save(patient);
if (result) {
return R.ok("病人信息添加成功!");
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"病人信息"}));
} else {
return R.fail("病人信息添加失败!");
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, null));
}
}

View File

@@ -0,0 +1,21 @@
package com.openhis.web.patientmanage.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
/**
* 门诊记录初始化
*
* @author liuhr
* @date 2025/3/17
*/
@Data
@Accessors(chain = true)
public class OutpatientRecordInitDto {
//获取医生姓名列表
private List<String> doctorNames;
}