From ac1cd3afc85f3ad7aa005a040917bbf46db5ce01 Mon Sep 17 00:00:00 2001 From: chenqi Date: Wed, 1 Apr 2026 18:24:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(prescription):=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=A4=84=E6=96=B9=E5=88=97=E8=A1=A8=E4=B8=AD=E6=89=8B=E6=9C=AF?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=92=8C=E5=85=B6=E4=BB=96=E5=8C=BB=E5=98=B1?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新 lodash.template 修复脚本以处理 assignWith 函数的自定义器参数 - 在多个处方组件中引入 drord_doctor_type 字典用于动态生成医嘱类型列表 - 修复手术类型(adviceType=6)的特殊处理逻辑,包括类型映射和字段过滤 - 调整后端医嘱保存服务中的类型分类逻辑,正确处理手术类型 - 更新数据库查询映射以支持手术类型的正确显示和数据传输 - 修复费用对话框和订单表单中的相关类型显示问题 --- .../DoctorStationAdviceAppServiceImpl.java | 15 +- .../web/doctorstation/dto/RequestBaseDto.java | 17 ++ .../impl/RequestFormManageAppServiceImpl.java | 2 +- .../DoctorStationAdviceAppMapper.xml | 39 +++-- .../AdviceManageAppMapper.xml | 5 +- .../RequestFormManageAppMapper.xml | 3 +- .../com/openhis/common/enums/ItemType.java | 11 +- .../fix-lodash-manual.js | 36 ++--- .../vuepress-theme-vdoing-doc/fix-lodash.sh | 35 ++-- .../vuepress-theme-vdoing-doc/package.json | 16 +- .../components/prescriptionlist.vue | 42 ++--- .../bargain/component/prescriptionlist.vue | 41 +++-- .../prescription/prescriptionlist.vue | 151 +++++++++++------- .../home/components/order/OrderForm.vue | 2 +- .../home/components/order/index.vue | 47 +++--- .../InpatientBilling/components/FeeDialog.vue | 30 +++- 16 files changed, 306 insertions(+), 186 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java index b100dc34..6d70080d 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java @@ -564,13 +564,15 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp // 耗材(前端adviceType=4,后端ItemType.DEVICE=2) List deviceList = adviceSaveList.stream() .filter(e -> ItemType.DEVICE.getValue().equals(e.getAdviceType()) - || e.getAdviceType() == 4) // 🔧 BugFix: 前端耗材类型值为4 + || e.getAdviceType() == 4) // 前端耗材类型值为4 .collect(Collectors.toList()); - // 诊疗活动(包括普通诊疗:前端adviceType=3,会诊:前端adviceType=5) + + // 诊疗活动(前端adviceType=3诊疗、adviceType=5会诊、adviceType=6手术) List activityList = adviceSaveList.stream() .filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType()) - || e.getAdviceType() == 3 // 🔧 BugFix: 前端诊疗类型值为3 - || e.getAdviceType() == 5) // 🔧 BugFix: 前端会诊类型值为5 + || e.getAdviceType() == 3 // 前端诊疗类型值为3 + || e.getAdviceType() == 5 // 前端会诊类型值为5 + || ItemType.SURGERY.getValue().equals(e.getAdviceType())) // 🔧 BugFix#318: 手术类型值为6 .collect(Collectors.toList()); // 🔍 Debug日志: 记录分类结果 @@ -599,11 +601,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp iDeviceDispenseService.deleteDeviceDispense(adviceSaveDto.getRequestId()); } - // 🔧 Bug Fix: 跳过耗材的库存校验(耗材的库存校验逻辑不同) + // 🔧 Bug Fix: 跳过耗材、诊疗、手术的库存校验 List needCheckList = adviceSaveList.stream() .filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType()) && !ItemType.ACTIVITY.getValue().equals(e.getAdviceType()) - && !ItemType.DEVICE.getValue().equals(e.getAdviceType())) // 排除耗材 + && !ItemType.DEVICE.getValue().equals(e.getAdviceType()) + && !ItemType.SURGERY.getValue().equals(e.getAdviceType())) // 🔧 BugFix#318: 排除手术类型 .collect(Collectors.toList()); // 校验库存 String tipRes = adviceUtils.checkInventory(needCheckList); diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/RequestBaseDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/RequestBaseDto.java index 4280bc8c..36422bd2 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/RequestBaseDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/RequestBaseDto.java @@ -161,6 +161,11 @@ public class RequestBaseDto { private String doseUnitCode; private String doseUnitCode_dictText; + /** + * 单价 + */ + private BigDecimal unitPrice; + /** * 总价 */ @@ -215,4 +220,16 @@ public class RequestBaseDto { @JsonSerialize(using = ToStringSerializer.class) private Long basedOnId; + /** + * 就诊id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long encounterId; + + /** + * 患者id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long patientId; + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/RequestFormManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/RequestFormManageAppServiceImpl.java index 948e76be..fa9d9871 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/RequestFormManageAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/RequestFormManageAppServiceImpl.java @@ -292,7 +292,7 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer surgeryChargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(surgeryServiceRequest.getBusNo())); surgeryChargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); surgeryChargeItem.setPatientId(patientId); - surgeryChargeItem.setContextEnum(3); // 3-诊疗 + surgeryChargeItem.setContextEnum(6); // 6-手术 surgeryChargeItem.setEncounterId(encounterId); surgeryChargeItem.setEntererId(practitionerId); surgeryChargeItem.setEnteredDate(curDate); diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml index 53e526ca..a609ba45 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml @@ -468,6 +468,7 @@ T1.dose AS dose, T1.dose_unit_code AS dose_unit_code, T4.id AS charge_item_id, + T4.unit_price AS unit_price, T4.total_price AS total_price, T4.status_enum AS charge_status, al.id AS position_id, @@ -477,7 +478,9 @@ ccd.name AS condition_definition_name, T1.sort_number AS sort_number, T1.based_on_id AS based_on_id, - T1.category_enum AS category_enum + T1.category_enum AS category_enum, + T1.encounter_id AS encounter_id, + T1.patient_id AS patient_id FROM med_medication_request AS T1 LEFT JOIN med_medication_definition AS T2 ON T2.ID = T1.medication_id AND T2.delete_flag = '0' @@ -520,6 +523,7 @@ NULL AS dose, '' AS dose_unit_code, T3.id AS charge_item_id, + T3.unit_price AS unit_price, T3.total_price AS total_price, T3.status_enum AS charge_status, al.id AS position_id, @@ -529,7 +533,9 @@ '' AS condition_definition_name, 99 AS sort_number, T1.based_on_id AS based_on_id, - T1.category_enum AS category_enum + T1.category_enum AS category_enum, + T1.encounter_id AS encounter_id, + T1.patient_id AS patient_id FROM wor_device_request AS T1 LEFT JOIN adm_device_definition AS T2 ON T2.ID = T1.device_def_id AND T2.delete_flag = '0' @@ -547,7 +553,7 @@ AND T1.refund_device_id IS NULL ORDER BY T1.status_enum) UNION ALL - (SELECT COALESCE(T1.category_enum, 3) AS advice_type, + (SELECT CASE WHEN T1.category_enum = 4 THEN 6 ELSE COALESCE(T1.category_enum, 3) END AS advice_type, T1.id AS request_id, T1.id || '-3' AS unique_key, '' AS prescription_no, @@ -561,15 +567,16 @@ COALESCE(T2.NAME, T1.content_json::jsonb->>'surgeryName', T1.content_json::jsonb->>'adviceName') AS advice_name, '' AS volume, '' AS lot_number, - T1.quantity AS quantity, - T1.unit_code AS unit_code, - T1.status_enum AS status_enum, - '' AS method_code, - '' AS rate_code, - NULL AS dose, - '' AS dose_unit_code, - T3.id AS charge_item_id, - T3.total_price AS total_price, + T1.quantity AS quantity, + T1.unit_code AS unit_code, + T1.status_enum AS status_enum, + '' AS method_code, + '' AS rate_code, + NULL AS dose, + '' AS dose_unit_code, + T3.id AS charge_item_id, + T3.unit_price AS unit_price, + T3.total_price AS total_price, T3.status_enum AS charge_status, ao.id AS position_id, ao.name AS position_name, @@ -577,9 +584,11 @@ 1 AS part_percent, '' AS condition_definition_name, 99 AS sort_number, - T1.based_on_id AS based_on_id, - T1.category_enum AS category_enum - FROM wor_service_request AS T1 + T1.based_on_id AS based_on_id, + T1.category_enum AS category_enum, + T1.encounter_id AS encounter_id, + T1.patient_id AS patient_id + FROM wor_service_request AS T1 LEFT JOIN wor_activity_definition AS T2 ON T2.ID = T1.activity_id AND T2.delete_flag = '0' diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml index 44e4b9fa..00357c45 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml @@ -203,6 +203,7 @@ T1.dose AS dose, T1.dose_unit_code AS dose_unit_code, T4.id AS charge_item_id, + T4.unit_price AS unit_price, T4.total_price AS total_price, T4.status_enum AS charge_status, al.id AS position_id, @@ -254,6 +255,7 @@ NULL AS dose, '' AS dose_unit_code, T3.id AS charge_item_id, + T3.unit_price AS unit_price, T3.total_price AS total_price, T3.status_enum AS charge_status, al.id AS position_id, @@ -281,7 +283,7 @@ AND T1.refund_device_id IS NULL ORDER BY T1.status_enum) UNION ALL - (SELECT COALESCE(T1.category_enum, 3) AS advice_type, + (SELECT CASE WHEN T1.category_enum = 4 THEN 6 ELSE COALESCE(T1.category_enum, 3) END AS advice_type, T1.id AS request_id, T1.id || '-3' AS unique_key, T1.requester_id AS requester_id, @@ -302,6 +304,7 @@ NULL AS dose, '' AS dose_unit_code, T3.id AS charge_item_id, + T3.unit_price AS unit_price, T3.total_price AS total_price, T3.status_enum AS charge_status, ao.id AS position_id, diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml index d4ea473f..fc51c6e3 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml @@ -26,12 +26,13 @@