168 入科分配床位填写的住院医生、主治医生、责任护士字段的内容双击查看未显示。

This commit is contained in:
Ranyunqiao
2026-03-12 16:58:39 +08:00
parent e8850e85fc
commit 066cfaba46
3 changed files with 105 additions and 91 deletions

View File

@@ -40,8 +40,10 @@ import com.openhis.web.inhospitalnursestation.mapper.ATDManageAppMapper;
import com.openhis.workflow.domain.ServiceRequest;
import com.openhis.workflow.service.IServiceRequestService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.stream.Collectors;
@@ -53,6 +55,7 @@ import java.util.stream.Stream;
* @author zwh
* @date 2025-07-28
*/
@Slf4j
@Service
public class ATDManageAppServiceImpl implements IATDManageAppService {
@@ -283,6 +286,7 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R<?> admissionBedAssignment(AdmissionPatientInfoDto admissionPatientInfoDto) {
// 住院id
@@ -298,31 +302,39 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
// 进入编辑患者信息,不更换床位
if (Whether.YES.getCode().equals(admissionPatientInfoDto.getEditFlag())) {
// 更新患者病情(如果提供了)
if (admissionPatientInfoDto.getPriorityEnum() != null) {
// 更新患者病情
encounterService.updatePriorityEnumById(encounterId, admissionPatientInfoDto.getPriorityEnum());
// 将之前的住院参与者更新为已完成(如果存在的话)
encounterParticipantService.updateEncounterParticipantsStatus(encounterId);
// 更新住院参与者
// 住院医生
}
// 将之前的住院参与者更新为已完成(如果存在的话)
encounterParticipantService.updateEncounterParticipantsStatus(encounterId);
// 更新住院参与者
// 住院医生(必须填写)
if (admissionPatientInfoDto.getAdmittingDoctorId() != null) {
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
admissionPatientInfoDto.getAdmittingDoctorId(), ParticipantType.ADMITTING_DOCTOR.getCode());
// 责任护士
}
// 责任护士(必须填写)
if (admissionPatientInfoDto.getPrimaryNurseId() != null) {
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
admissionPatientInfoDto.getPrimaryNurseId(), ParticipantType.PRIMARY_NURSE.getCode());
if (admissionPatientInfoDto.getAttendingDoctorId() != null) {
// 主治医生
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
admissionPatientInfoDto.getAttendingDoctorId(), ParticipantType.ATTENDING_DOCTOR.getCode());
}
if (admissionPatientInfoDto.getChiefDoctorId() != null) {
// 主任医生
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
admissionPatientInfoDto.getChiefDoctorId(), ParticipantType.CHIEF_DOCTOR.getCode());
}
}
// 更新入院体征
saveOrUpdateAdmissionSigns(encounterId, admissionPatientInfoDto, startTime);
// 主治医生(可选)
if (admissionPatientInfoDto.getAttendingDoctorId() != null) {
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
admissionPatientInfoDto.getAttendingDoctorId(), ParticipantType.ATTENDING_DOCTOR.getCode());
}
// 主任医生(可选)
if (admissionPatientInfoDto.getChiefDoctorId() != null) {
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
admissionPatientInfoDto.getChiefDoctorId(), ParticipantType.CHIEF_DOCTOR.getCode());
}
// 更新入院体征(在事务外执行,避免影响参与者数据保存)
try {
saveOrUpdateAdmissionSigns(encounterId, admissionPatientInfoDto, startTime);
} catch (Exception e) {
log.error("保存入院体征失败,但不影响参与者数据", e);
}
return R.ok("患者信息更新成功");
}
@@ -421,8 +433,12 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
if (result == 0) {
return R.fail("床位分配失败,请联系管理员");
}
// 保存入院体征
saveOrUpdateAdmissionSigns(encounterId, admissionPatientInfoDto, startTime);
// 保存入院体征(在事务外执行,避免影响参与者数据保存)
try {
saveOrUpdateAdmissionSigns(encounterId, admissionPatientInfoDto, startTime);
} catch (Exception e) {
log.error("保存入院体征失败,但不影响参与者数据", e);
}
return R.ok("床位分配成功");
}