From d405e9cb5e1c70f69d90b3a3514ceb4920046f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E=E4=BD=97?= Date: Wed, 10 Jun 2026 00:26:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(Bug#708):=20=E4=BF=AE=E5=A4=8D=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E8=84=9A=E6=9C=ACopenhis=E6=97=A7=E5=90=8D=E5=BC=95?= =?UTF-8?q?=E7=94=A8=20+=20=E5=8C=BB=E5=98=B1=E6=A0=A1=E5=AF=B9=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=80=97=E6=9D=90=E8=AF=B7=E6=B1=82=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - start.sh/start.bat: openhis-application/domain/common → healthlink-his-application/domain/common - start.sh/start.bat: com.openhis.OpenHisApplication → com.healthlink.his.HealthLinkHisApplication - AGENTS.md: 修正模块引用名 - AdviceProcessAppServiceImpl: 医嘱校对/驳回增加WOR_DEVICE_REQUEST类型处理 - AdviceProcessAppMapper.xml: 查询增加WOR_DEVICE_REQUEST表关联 - RequestFormDetailQueryDto: 字段修正 - surgeryApplication/surgery vue: 前端适配 --- .../java/com/healthlink/his/web/AGENTS.md | 2 +- .../impl/AdviceProcessAppServiceImpl.java | 21 ++- .../mapper/AdviceProcessAppMapper.java | 3 +- .../dto/RequestFormDetailQueryDto.java | 4 +- .../AdviceProcessAppMapper.xml | 133 ++++++++++++++++++ .../RequestFormManageAppMapper.xml | 2 +- healthlink-his-server/start.bat | 4 +- healthlink-his-server/start.sh | 6 +- .../applicationShow/surgeryApplication.vue | 1 + .../order/applicationForm/surgery.vue | 2 +- 10 files changed, 165 insertions(+), 13 deletions(-) diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/AGENTS.md b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/AGENTS.md index 34ea6717c..0feef56ed 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/AGENTS.md +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/AGENTS.md @@ -1,6 +1,6 @@ # Web Layer - API Controllers -**Module**: `openhis-application/web` +**Module**: `healthlink-his-application/web` **Role**: API endpoint layer - all REST controllers for frontend communication ## OVERVIEW diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java index 471f51875..3d84e113f 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java @@ -208,6 +208,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { Page inpatientAdvicePage = adviceProcessAppMapper.selectInpatientAdvicePage(new Page<>(pageNo, pageSize), queryWrapper, CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST, + CommonConstants.TableName.WOR_DEVICE_REQUEST, RequestStatus.DRAFT.getValue(), EncounterActivityStatus.ACTIVE.getValue(), LocationForm.BED.getValue(), ParticipantType.ADMITTING_DOCTOR.getCode(), AccountType.PERSONAL_CASH_ACCOUNT.getCode(), ChargeItemStatus.BILLABLE.getValue(), ChargeItemStatus.BILLED.getValue(), @@ -379,14 +380,17 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { */ @Override public R adviceVerify(List performInfoList) { - // 分别创建两个列表来存储不同类型的请求 + // 分别创建列表来存储不同类型的请求 List serviceRequestList = new ArrayList<>(); List medRequestList = new ArrayList<>(); + List deviceRequestList = new ArrayList<>(); for (PerformInfoDto item : performInfoList) { if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(item.getRequestTable())) { serviceRequestList.add(item); } else if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(item.getRequestTable())) { medRequestList.add(item); + } else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(item.getRequestTable())) { + deviceRequestList.add(item); } } Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId(); @@ -425,6 +429,11 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { medicationRequestService.updateCompletedStatusBatch( medRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate); } + if (!deviceRequestList.isEmpty()) { + // 更新耗材请求状态已完成 + deviceRequestService.updateCompletedStatusBatch( + deviceRequestList.stream().map(PerformInfoDto::getRequestId).toList()); + } return R.ok(null, "校对成功"); } @@ -436,14 +445,17 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { */ @Override public R adviceReject(List performInfoList) { - // 分别创建两个列表来存储不同类型的请求 + // 分别创建列表来存储不同类型的请求 List serviceRequestList = new ArrayList<>(); List medRequestList = new ArrayList<>(); + List deviceRequestList = new ArrayList<>(); for (PerformInfoDto item : performInfoList) { if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(item.getRequestTable())) { serviceRequestList.add(item); } else if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(item.getRequestTable())) { medRequestList.add(item); + } else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(item.getRequestTable())) { + deviceRequestList.add(item); } } // 校验医嘱是否已执行,已执行的医嘱需要先取消执行后才能退回 @@ -493,6 +505,11 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { medicationRequestService.updateDraftStatusBatch( medRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate, backReason); } + if (!deviceRequestList.isEmpty()) { + // 更新耗材请求状态待发送 + deviceRequestService.updateDraftStatusBatch( + deviceRequestList.stream().map(PerformInfoDto::getRequestId).toList()); + } return R.ok(null, "退回成功"); } diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/mapper/AdviceProcessAppMapper.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/mapper/AdviceProcessAppMapper.java index 591433890..e9affdd62 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/mapper/AdviceProcessAppMapper.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/mapper/AdviceProcessAppMapper.java @@ -65,7 +65,8 @@ public interface AdviceProcessAppMapper { Page selectInpatientAdvicePage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("medMedicationRequest") String medMedicationRequest, - @Param("worServiceRequest") String worServiceRequest, @Param("draft") Integer draft, + @Param("worServiceRequest") String worServiceRequest, + @Param("worDeviceRequest") String worDeviceRequest, @Param("draft") Integer draft, @Param("active") Integer active, @Param("bed") Integer bed, @Param("admittingDoctor") String admittingDoctor, @Param("personalCashAccount") String personalCashAccount, @Param("billable") Integer billable, @Param("billed") Integer billed, @Param("refunded") Integer refunded, @Param("imp") Integer imp, diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/dto/RequestFormDetailQueryDto.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/dto/RequestFormDetailQueryDto.java index ad3b61d58..ae7ff6f93 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/dto/RequestFormDetailQueryDto.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/dto/RequestFormDetailQueryDto.java @@ -14,9 +14,9 @@ import java.math.BigDecimal; public class RequestFormDetailQueryDto { /** - * 诊疗活动定义ID(wor_service_request.activity_id,与开立检验时项目字典的 id / adviceDefinitionId 一致,用于编辑回显) + * 诊疗活动定义ID(wor_service_request.id,与开立检验时项目字典的 id / adviceDefinitionId 一致,用于编辑回显) */ - private Long activityId; + private Long adviceDefinitionId; /** 医嘱名称 */ private String adviceName; diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml index 0b66034f6..bc64c54ef 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml @@ -439,6 +439,139 @@ ELSE 1=1 END AND T1.refund_service_id IS NULL ORDER BY T1.status_enum ) + UNION + ( SELECT DISTINCT T1.encounter_id, + T1.tenant_id, + #{worDeviceRequest} AS advice_table, + T1.id AS request_id, + T1.req_authored_time AS start_time, + NULL::timestamp AS end_time, + T1.requester_id AS requester_id, + T1.create_time AS request_time, + NULL::integer AS skin_test_flag, + NULL::integer AS inject_flag, + NULL::bigint AS group_id, + T1.performer_check_id, + T2."name" AS advice_name, + T2.id AS item_id, + NULL::varchar AS volume, + T1.lot_number AS lot_number, + T1.quantity AS quantity, + T1.unit_code AS unit_code, + T1.status_enum AS request_status, + NULL::varchar AS method_code, + T1.rate_code AS rate_code, + NULL::numeric AS dose, + NULL::varchar AS dose_unit_code, + ao1.id AS position_id, + ao1."name" AS position_name, + NULL::integer AS dispense_per_duration, + 1::numeric AS part_percent, + ccd."name" AS condition_definition_name, + NULL::integer AS therapy_enum, + NULL::integer AS sort_number, + T1.quantity AS execute_num, + af.day_times, + ae.bus_no, + ap."name" AS patient_name, + al2."name" AS bed_name, + ap.gender_enum, + ap.birth_date, + ap.id AS patient_id, + fc.contract_name, + diagnosis.condition_names, + pra."name" AS admitting_doctor_name, + personal_account.balance_amount, + personal_account.id AS account_id, + T2.category_code, + NULL::integer AS dispense_status, + NULL::numeric AS unit_price, + NULL::numeric AS total_price, + NULL::bigint AS stopper_id, + NULL::varchar AS stopper_name + 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' + LEFT JOIN adm_organization AS ao1 + ON ao1.id = T1.org_id + AND ao1.delete_flag = '0' + LEFT JOIN cli_condition AS cc + ON cc.id = T1.condition_id + AND cc.delete_flag = '0' + LEFT JOIN cli_condition_definition AS ccd + ON ccd.id = cc.definition_id + AND ccd.delete_flag = '0' + LEFT JOIN adm_encounter ae + ON ae.id = T1.encounter_id + AND ae.class_enum = #{imp} + AND ae.delete_flag = '0' + LEFT JOIN adm_patient ap + ON ae.patient_id = ap.id + AND ap.delete_flag = '0' + LEFT JOIN adm_encounter_location ael + ON ae.id = ael.encounter_id + AND ael.delete_flag = '0' + AND ael.status_enum = #{active} + AND ael.form_enum = #{bed} + LEFT JOIN adm_location al2 + ON ael.location_id = al2.id + AND al2.delete_flag = '0' + LEFT JOIN adm_account aa + ON ae.id = aa.encounter_id + AND aa.encounter_flag = 1 + AND aa.delete_flag = '0' + LEFT JOIN fin_contract fc + ON aa.contract_no = fc.bus_no + AND fc.delete_flag = '0' + LEFT JOIN ( SELECT aed.encounter_id, + STRING_AGG(ccd.name, ', ') AS condition_names + FROM adm_encounter_diagnosis aed + INNER JOIN cli_condition cc + ON cc.id = aed.condition_id + AND cc.delete_flag = '0' + INNER JOIN cli_condition_definition ccd + ON ccd.id = cc.definition_id + AND ccd.delete_flag = '0' + WHERE aed.delete_flag = '0' + GROUP BY aed.encounter_id + ) AS diagnosis + ON ae.id = diagnosis.encounter_id + LEFT JOIN adm_encounter_participant aep + ON ae.id = aep.encounter_id + AND aep.delete_flag = '0' + AND aep.status_enum = #{active} + AND aep.type_code = #{admittingDoctor} + LEFT JOIN adm_practitioner pra + ON aep.practitioner_id = pra.id + AND pra.delete_flag = '0' + LEFT JOIN ( SELECT aa.id, + aa.encounter_id, + (aa.balance_amount - + COALESCE(SUM(CASE WHEN aci.status_enum IN (#{billed}, #{billable}) + THEN aci.total_price ELSE 0 END), 0) + + COALESCE(SUM(CASE WHEN aci.status_enum = #{refunded} + THEN aci.total_price ELSE 0 END), 0)) AS balance_amount + FROM adm_account aa + LEFT JOIN adm_charge_item aci + ON aa.encounter_id = aci.encounter_id + AND aa.delete_flag = '0' + WHERE aa.type_code = #{personalCashAccount} + AND aa.delete_flag = '0' + GROUP BY aa.id, + aa.encounter_id, + aa.balance_amount + ) AS personal_account + ON personal_account.encounter_id = ae.id + LEFT JOIN adm_frequency af + ON af.rate_code = T1.rate_code + AND af.delete_flag = '0' + WHERE T1.delete_flag = '0' + AND T1.generate_source_enum = #{doctorPrescription} + AND CASE WHEN T1.status_enum = #{draft} + THEN FALSE + ELSE TRUE END + ORDER BY T1.status_enum ) ) AS ii ${ew.customSqlSegment} diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml index 46051997d..1361aa607 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml @@ -140,7 +140,7 @@