会诊意见格式化存储,确保参加医师和意见完整回显 预约签到挂号时修正 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 (
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
<el-tag v-else type="warning" size="small">已确认</el-tag>
|
||||
</div>
|
||||
<div class="opinion-content">
|
||||
{{ opinion.opinion }}
|
||||
{{ formatOpinionContent(opinion.opinion) }}
|
||||
</div>
|
||||
<div v-if="opinion.signatureTime" class="opinion-footer">
|
||||
签名时间:{{ formatDateTime(opinion.signatureTime) }}
|
||||
@@ -301,6 +301,16 @@ const formatDateTime = (date) => {
|
||||
return `${yyyy}-${mm}-${dd} ${hh}:${mi}:${ss}`
|
||||
}
|
||||
|
||||
// Bug #388:去掉"科室-参加医师:"前缀,只显示意见内容
|
||||
const formatOpinionContent = (opinion) => {
|
||||
if (!opinion) return ''
|
||||
const colonIndex = opinion.indexOf(':')
|
||||
if (colonIndex > 0) {
|
||||
return opinion.substring(colonIndex + 1)
|
||||
}
|
||||
return opinion // 向后兼容旧数据
|
||||
}
|
||||
|
||||
const getDoctorName = () => userStore.nickName || userStore.name || '当前医生'
|
||||
const getDoctorDept = () => userStore.orgName || '当前科室'
|
||||
|
||||
|
||||
@@ -710,8 +710,10 @@ const loadQueueFromDb = async () => {
|
||||
id: it.id,
|
||||
queueOrder: it.queueOrder,
|
||||
patientName: it.patientName ?? '-',
|
||||
appointmentType: it.healthcareName ?? '普通',
|
||||
room: it.organizationName ?? '-',
|
||||
// 队列数据已从入队时存储的 healthcareName 读取(包含"预约"或"挂号"后缀)
|
||||
appointmentType: it.healthcareName ?? '普通号挂号',
|
||||
// Bug #410:使用 roomNo(诊室)而非 organizationName(科室)
|
||||
room: it.roomNo ?? it.organizationName ?? '-',
|
||||
doctor: it.practitionerName ?? '-',
|
||||
waitingTime: waitingTime,
|
||||
createTime: it.createTime, // 保存创建时间,用于定时器计算
|
||||
@@ -820,15 +822,18 @@ const loadDataFromApi = async () => {
|
||||
organizationName: item.organizationName,
|
||||
patientName: item.patientName ?? '-',
|
||||
age: parseAge(item.age),
|
||||
appointmentType: item.healthcareName ?? '普通',
|
||||
room: item.organizationName ? `${item.organizationName}` : '-',
|
||||
// Bug #409/410:根据 isFromAppointment 区分预约/挂号,使用 clinicRoom 诊室
|
||||
appointmentType: (item.healthcareName || '').replace('挂号', '') + (item.isFromAppointment ? '预约' : '挂号'),
|
||||
room: item.clinicRoom ?? item.organizationName ?? '-',
|
||||
doctor: item.practitionerName ?? '-',
|
||||
// 当前接口返回的是 practitionerUserId,保存为 practitionerId 供入队使用
|
||||
practitionerId: item.practitionerUserId ?? null,
|
||||
matchingRule: '-', // 这里先不做智能规则匹配
|
||||
// 号源池和槽位信息(用于分诊队列)
|
||||
poolId: item.poolId ?? null,
|
||||
slotId: item.slotId ?? null
|
||||
slotId: item.slotId ?? null,
|
||||
// 保存原始 isFromAppointment 用于调试
|
||||
isFromAppointment: item.isFromAppointment ?? false
|
||||
}))
|
||||
console.log('【心内科】候选池已加载', originalCandidatePoolList.value.length, '条今天的数据')
|
||||
} else {
|
||||
@@ -1046,7 +1051,8 @@ const handleAddToQueue = async () => {
|
||||
healthcareName: c.appointmentType,
|
||||
practitionerName: c.doctor,
|
||||
practitionerId: c.practitionerId ?? null,
|
||||
roomNo: c.roomNo ?? c.room ?? null,
|
||||
// Bug #410:c.room 已是诊室名称
|
||||
roomNo: c.room ?? null,
|
||||
poolId: c.poolId ?? null,
|
||||
slotId: c.slotId ?? null
|
||||
})
|
||||
@@ -1163,7 +1169,8 @@ const handleAddAllToQueue = async () => {
|
||||
healthcareName: c.appointmentType,
|
||||
practitionerName: c.doctor,
|
||||
practitionerId: c.practitionerId ?? null,
|
||||
roomNo: c.roomNo ?? c.room ?? null,
|
||||
// Bug #410:c.room 已是诊室名称
|
||||
roomNo: c.room ?? null,
|
||||
poolId: c.poolId ?? null,
|
||||
slotId: c.slotId ?? null
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user