会诊意见格式化存储,确保参加医师和意见完整回显 预约签到挂号时修正 serviceTypeId 为预约类型而非挂号类型 分诊队列显示诊室而非科室,区分预约/挂号类型
This commit is contained in:
@@ -165,4 +165,9 @@ public class CurrentDayEncounterDto {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long poolId;
|
||||
|
||||
/**
|
||||
* 诊室名称(Bug #410:分诊队列需显示诊室而非科室)
|
||||
*/
|
||||
private String clinicRoom;
|
||||
|
||||
}
|
||||
|
||||
@@ -1395,9 +1395,17 @@ public class ConsultationAppServiceImpl implements IConsultationAppService {
|
||||
}
|
||||
|
||||
// 4. 更新邀请记录(存储会诊意见)
|
||||
// 直接存储用户输入的原始意见内容,不添加医师姓名前缀
|
||||
invited.setInvitedStatus(ConsultationStatusEnum.CONFIRMED.getCode()); // 已确认
|
||||
invited.setConfirmOpinion(dto.getConsultationOpinion()); // 直接存储原始意见,不添加前缀
|
||||
// Bug #388:格式化存储,确保回显时参加医师和意见完整
|
||||
invited.setInvitedStatus(ConsultationStatusEnum.CONFIRMED.getCode());
|
||||
|
||||
String deptName = StringUtils.hasText(dto.getConfirmingDeptName())
|
||||
? dto.getConfirmingDeptName() : invited.getInvitedDepartmentName();
|
||||
String physician = StringUtils.hasText(dto.getConfirmingPhysician())
|
||||
? dto.getConfirmingPhysician() : currentPhysicianName;
|
||||
|
||||
// 格式:科室-参加医师:意见内容
|
||||
String formattedOpinion = String.format("%s-%s:%s", deptName, physician, dto.getConsultationOpinion());
|
||||
invited.setConfirmOpinion(formattedOpinion);
|
||||
invited.setConfirmTime(new Date());
|
||||
consultationInvitedMapper.updateById(invited);
|
||||
|
||||
|
||||
@@ -59,7 +59,9 @@ import com.openhis.web.personalization.dto.ActivityDeviceDto;
|
||||
import com.openhis.triageandqueuemanage.domain.TriageQueueItem;
|
||||
import com.openhis.triageandqueuemanage.service.TriageQueueItemService;
|
||||
import com.openhis.appointmentmanage.domain.ScheduleSlot;
|
||||
import com.openhis.appointmentmanage.domain.SchedulePool;
|
||||
import com.openhis.appointmentmanage.mapper.ScheduleSlotMapper;
|
||||
import com.openhis.appointmentmanage.mapper.SchedulePoolMapper;
|
||||
import com.openhis.clinical.domain.Order;
|
||||
import com.openhis.clinical.service.IOrderService;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
@@ -196,6 +198,8 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
|
||||
private IOrderService iOrderService;
|
||||
@Autowired
|
||||
private ScheduleSlotMapper scheduleSlotMapper;
|
||||
@Autowired
|
||||
private SchedulePoolMapper schedulePoolMapper;
|
||||
|
||||
/**
|
||||
* 【门诊预结算】
|
||||
@@ -1982,6 +1986,60 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
|
||||
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
|
||||
// Bug #409:预约签到挂号时,修正 serviceTypeId 为预约类型而非挂号类型
|
||||
// 数据链:Order → ScheduleSlot → SchedulePool → HealthcareService
|
||||
try {
|
||||
Order appointmentOrder = iOrderService.getOne(
|
||||
new LambdaQueryWrapper<Order>()
|
||||
.eq(Order::getPatientId, encounterFormData.getPatientId())
|
||||
.eq(Order::getStatus, CommonConstants.AppointmentOrderStatus.CHECKED_IN)
|
||||
.eq(Order::getDeleteFlag, "0")
|
||||
.orderByDesc(Order::getCreateTime)
|
||||
.last("LIMIT 1")
|
||||
);
|
||||
|
||||
if (appointmentOrder != null && appointmentOrder.getSlotId() != null) {
|
||||
ScheduleSlot slot = scheduleSlotMapper.selectById(appointmentOrder.getSlotId());
|
||||
if (slot != null && slot.getPoolId() != null) {
|
||||
SchedulePool pool = schedulePoolMapper.selectById(slot.getPoolId());
|
||||
if (pool != null && pool.getRegType() != null) {
|
||||
// pool.getRegType() 存储号别名称如"普通号-预约",精确匹配 HealthcareService
|
||||
HealthcareService appointmentHealthcareService = healthcareServiceService.getOne(
|
||||
new LambdaQueryWrapper<HealthcareService>()
|
||||
.eq(HealthcareService::getOfferedOrgId, encounterFormData.getOrganizationId())
|
||||
.eq(HealthcareService::getDeleteFlag, "0")
|
||||
.eq(HealthcareService::getName, pool.getRegType())
|
||||
.last("LIMIT 1")
|
||||
);
|
||||
|
||||
if (appointmentHealthcareService != null) {
|
||||
encounterFormData.setServiceTypeId(appointmentHealthcareService.getId());
|
||||
encounterFormData.setOrderId(appointmentOrder.getId());
|
||||
logger.info("预约签到挂号修正serviceTypeId={},号别={}",
|
||||
appointmentHealthcareService.getId(), pool.getRegType());
|
||||
} else {
|
||||
// 精确匹配失败,尝试 LIKE 匹配
|
||||
appointmentHealthcareService = healthcareServiceService.getOne(
|
||||
new LambdaQueryWrapper<HealthcareService>()
|
||||
.eq(HealthcareService::getOfferedOrgId, encounterFormData.getOrganizationId())
|
||||
.eq(HealthcareService::getDeleteFlag, "0")
|
||||
.like(HealthcareService::getName, pool.getRegType())
|
||||
.last("LIMIT 1")
|
||||
);
|
||||
if (appointmentHealthcareService != null) {
|
||||
encounterFormData.setServiceTypeId(appointmentHealthcareService.getId());
|
||||
encounterFormData.setOrderId(appointmentOrder.getId());
|
||||
logger.info("预约签到挂号(LIKE)serviceTypeId={},号别={}",
|
||||
appointmentHealthcareService.getId(), pool.getRegType());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.warn("修正serviceTypeId失败,不影响挂号流程", e);
|
||||
}
|
||||
|
||||
// 保存就诊信息
|
||||
Encounter encounter = new Encounter();
|
||||
BeanUtils.copyProperties(encounterFormData, encounter);
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
T9.organization_id AS organizationId,
|
||||
T9.organization_name AS organizationName,
|
||||
T9.healthcare_name AS healthcareName,
|
||||
T9.clinic_room AS clinicRoom, -- Bug #410:诊室名称
|
||||
T9.practitioner_user_id AS practitionerUserId,
|
||||
T9.practitioner_name AS practitionerName,
|
||||
T9.contract_name AS contractName,
|
||||
@@ -99,10 +100,12 @@
|
||||
T18.identifier_no AS identifier_no,
|
||||
T1.order_id AS order_id,
|
||||
om.slot_id AS slot_id,
|
||||
ss.pool_id AS pool_id
|
||||
ss.pool_id AS pool_id,
|
||||
sp.clinic_room AS clinic_room -- Bug #410:从号源池获取诊室
|
||||
FROM adm_encounter AS T1
|
||||
LEFT JOIN order_main AS om ON T1.order_id = om.id AND om.delete_flag = '0'
|
||||
LEFT JOIN adm_schedule_slot AS ss ON om.slot_id = ss.id AND ss.delete_flag = '0'
|
||||
LEFT JOIN adm_schedule_pool AS sp ON ss.pool_id = sp.id AND sp.delete_flag = '0' -- Bug #410
|
||||
LEFT JOIN adm_organization AS T2 ON T1.organization_id = T2.ID AND T2.delete_flag = '0'
|
||||
LEFT JOIN adm_healthcare_service AS T3 ON T1.service_type_id = T3.ID AND T3.delete_flag = '0'
|
||||
LEFT JOIN (
|
||||
|
||||
Reference in New Issue
Block a user