挂号补单功能的完善

This commit is contained in:
2026-01-14 10:12:25 +08:00
parent 8e61490005
commit d8c4348341
8 changed files with 423 additions and 32 deletions

View File

@@ -141,4 +141,9 @@ public class CurrentDayEncounterDto {
*/
private String identifierNo;
/**
* 流水号(就诊当日序号)
*/
private Integer displayOrder;
}

View File

@@ -1818,6 +1818,10 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
// 保存就诊信息
Encounter encounter = new Encounter();
BeanUtils.copyProperties(encounterFormData, encounter);
// 将挂号医生ID提前塞入 encounter 的 registrarId便于生成“科室+医生+当日”序号
if (encounterParticipantFormData.getPractitionerId() != null) {
encounter.setRegistrarId(encounterParticipantFormData.getPractitionerId());
}
encounter.setBusNo(outpatientRegistrationSettleParam.getBusNo());
// 就诊ID
Long encounterId = iEncounterService.saveEncounterByRegister(encounter);

View File

@@ -46,6 +46,7 @@
<select id="getCurrentDayEncounter" resultType="com.openhis.web.chargemanage.dto.CurrentDayEncounterDto">
SELECT T9.tenant_id AS tenantId,
T9.encounter_id AS encounterId,
T9.display_order AS displayOrder,
T9.organization_id AS organizationId,
T9.organization_name AS organizationName,
T9.healthcare_name AS healthcareName,
@@ -70,6 +71,7 @@
from (
SELECT T1.tenant_id AS tenant_id,
T1.id AS encounter_id,
T1.display_order AS display_order,
T1.organization_id AS organization_id,
T2.NAME AS organization_name,
T3.NAME AS healthcare_name,

View File

@@ -44,8 +44,16 @@ public class EncounterServiceImpl extends ServiceImpl<EncounterMapper, Encounter
// 生成就诊编码 医保挂号时是先生成码后生成实体
encounter.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.ENCOUNTER_NUM.getPrefix(), 4));
}
// 生成就诊序号 (患者ID + 科室ID 作为当日就诊号的唯一标识)
String preFix = encounter.getPatientId() + String.valueOf(encounter.getOrganizationId());
// 生成就诊序号
// 1) 若挂号医生已传入registrarId 充当挂号医生 ID按“科室+医生+当日”递增
// Key 示例ORG-123-DOC-456 -> 1、2、3...
// 2) 否则按“科室+当日”递增
String preFix;
if (encounter.getRegistrarId() != null) {
preFix = "ORG-" + encounter.getOrganizationId() + "-DOC-" + encounter.getRegistrarId();
} else {
preFix = "ORG-" + encounter.getOrganizationId();
}
encounter.setDisplayOrder(assignSeqUtil.getSeqNoByDay(preFix));
// 患者ID
Long patientId = encounter.getPatientId();