168 入科分配床位填写的住院医生、主治医生、责任护士字段的内容双击查看未显示。
This commit is contained in:
@@ -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("床位分配成功");
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.openhis.administration.mapper.EncounterParticipantMapper;
|
||||
import com.openhis.administration.service.IEncounterParticipantService;
|
||||
import com.openhis.common.enums.EncounterActivityStatus;
|
||||
import com.openhis.common.enums.ParticipantType;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -22,6 +23,7 @@ import java.util.List;
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class EncounterParticipantServiceImpl extends ServiceImpl<EncounterParticipantMapper, EncounterParticipant>
|
||||
implements IEncounterParticipantService {
|
||||
@@ -58,9 +60,12 @@ public class EncounterParticipantServiceImpl extends ServiceImpl<EncounterPartic
|
||||
@Override
|
||||
public void creatEncounterParticipants(Long encounterId, Date startTime, Long practitionerId, String typeCode) {
|
||||
EncounterParticipant encounterParticipant = new EncounterParticipant();
|
||||
encounterParticipant.setEncounterId(encounterId).setStartTime(startTime).setPractitionerId(practitionerId)
|
||||
.setTypeCode(typeCode);
|
||||
baseMapper.insert(encounterParticipant);
|
||||
encounterParticipant.setEncounterId(encounterId)
|
||||
.setStartTime(startTime)
|
||||
.setPractitionerId(practitionerId)
|
||||
.setTypeCode(typeCode)
|
||||
.setStatusEnum(EncounterActivityStatus.ACTIVE.getValue());
|
||||
int result = baseMapper.insert(encounterParticipant);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,12 +77,15 @@ public class EncounterParticipantServiceImpl extends ServiceImpl<EncounterPartic
|
||||
@Override
|
||||
public Integer updateEncounterParticipantsStatus(Long encounterId) {
|
||||
// 更新状态为已完成
|
||||
return baseMapper.update(null,
|
||||
Integer result = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<EncounterParticipant>()
|
||||
.set(EncounterParticipant::getStatusEnum, EncounterActivityStatus.COMPLETED.getValue())
|
||||
.eq(EncounterParticipant::getEncounterId, encounterId).in(EncounterParticipant::getTypeCode,
|
||||
.eq(EncounterParticipant::getEncounterId, encounterId)
|
||||
.eq(EncounterParticipant::getStatusEnum, EncounterActivityStatus.ACTIVE.getValue())
|
||||
.in(EncounterParticipant::getTypeCode,
|
||||
ParticipantType.ATTENDING_DOCTOR.getCode(), ParticipantType.CHIEF_DOCTOR.getCode(),
|
||||
ParticipantType.PRIMARY_NURSE.getCode(), ParticipantType.ADMITTING_DOCTOR.getCode()));
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user