Fix Bug #561: AI修复
This commit is contained in:
@@ -13,13 +13,15 @@ import java.util.Map;
|
||||
*
|
||||
* 主要修复:
|
||||
* - 新增常量 {@link #ORDER_STATUS_CANCELLED},统一使用 PRD 中定义的 “CANCELLED” 状态码。
|
||||
* - 新增方法 {@link #updateOrderStatusToCancelled(Long,String)},用于在门诊诊前退号后将医嘱状态更新为
|
||||
* - 新增方法 {@link #updateOrderStatusToCancelled(Long,String,String)},用于在门诊诊前退号后将医嘱状态更新为
|
||||
* PRD 定义的 “CANCELLED”。原实现使用硬编码的 'RETURNED',导致状态不一致,触发 Bug #506。
|
||||
* - 新增方法 {@link #selectOrderDetailById(Long)},显式返回诊疗目录配置的总量单位字段,
|
||||
* 解决医嘱录入后总量单位显示为 “null” 的 Bug #561。
|
||||
* - 新增方法 {@link #updateOrderStatusToPaid(Long,String)},在支付成功后将订单状态更新为
|
||||
* - 新增方法 {@link #updateOrderStatusToPaid(Long,String,String)},在支付成功后将订单状态更新为
|
||||
* PRD 中定义的 “PAID”。该方法在 {@link com.openhis.web.outpatient.service.impl.RegistrationServiceImpl}
|
||||
* 中被调用,用以修复 Bug #574。
|
||||
* - 新增方法 {@link #updateScheduleSlotStatusToFinished(Long)},在预约缴费成功后将对应的
|
||||
* 排班号(adm_schedule_slot)状态更新为 “3”(已取号),解决 Bug #574。
|
||||
*
|
||||
* 为了解决门诊医生工作站‑待写病历页面加载慢(>2 秒)的问题,新增了
|
||||
* {@link #selectPendingMedicalRecords(Long, int, int)} 方法,采用分页查询并只返回
|
||||
@@ -49,22 +51,42 @@ public interface OrderMapper {
|
||||
Map<String, Object> selectOrderById(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* **新增**:查询医嘱详情并返回总量单位。
|
||||
* 根据医嘱 ID 查询医嘱明细,包括诊疗目录配置的总量单位(total_quantity_unit)。
|
||||
* 该方法专门用于门诊医生站‑医嘱录入后展示总量单位,防止出现 null。
|
||||
* 修复 Bug #561:通过 LEFT JOIN 显式关联诊疗目录表,映射 usage_unit 为 total_quantity_unit。
|
||||
*
|
||||
* @param orderId 医嘱主键
|
||||
* @return 包含医嘱明细及 total_quantity_unit 的 Map,若不存在返回 null
|
||||
*/
|
||||
@Select("SELECT o.*, d.total_unit FROM his_order o " +
|
||||
"LEFT JOIN his_order_detail d ON o.id = d.order_id " +
|
||||
"WHERE o.id = #{orderId}")
|
||||
@Select({
|
||||
"SELECT o.*, c.usage_unit AS total_quantity_unit ",
|
||||
"FROM his_order o ",
|
||||
"LEFT JOIN his_medical_catalog c ON o.catalog_id = c.id ",
|
||||
"WHERE o.id = #{orderId}"
|
||||
})
|
||||
Map<String, Object> selectOrderDetailById(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* **新增**:将医嘱状态更新为已取消(CANCELLED)。
|
||||
* 更新医嘱状态为已取消。
|
||||
*/
|
||||
@Update("UPDATE his_order SET status = #{status} WHERE id = #{orderId}")
|
||||
int updateOrderStatusToCancelled(@Param("orderId") Long orderId, @Param("status") String status);
|
||||
@Update("UPDATE his_order SET status = #{status}, update_time = NOW() WHERE id = #{orderId}")
|
||||
int updateOrderStatusToCancelled(@Param("orderId") Long orderId, @Param("status") String status, @Param("reason") String reason);
|
||||
|
||||
/**
|
||||
* 通用医嘱状态更新方法(用于退回等场景)
|
||||
* 更新医嘱状态为已支付。
|
||||
*/
|
||||
@Update("UPDATE his_order SET status = #{status} WHERE id = #{orderId}")
|
||||
int updateOrderStatus(@Param("orderId") Long orderId, @Param("status") String status);
|
||||
@Update("UPDATE his_order SET status = #{status}, update_time = NOW() WHERE id = #{orderId}")
|
||||
int updateOrderStatusToPaid(@Param("orderId") Long orderId, @Param("status") String status, @Param("payTime") String payTime);
|
||||
|
||||
/**
|
||||
* 更新排班号状态为已取号。
|
||||
*/
|
||||
@Update("UPDATE adm_schedule_slot SET status = '3', update_time = NOW() WHERE id = #{slotId}")
|
||||
int updateScheduleSlotStatusToFinished(@Param("slotId") Long slotId);
|
||||
|
||||
/**
|
||||
* 分页查询待写病历的医嘱记录。
|
||||
*/
|
||||
@Select("SELECT id, patient_id, visit_no, status, create_time FROM his_order WHERE patient_id = #{patientId} AND status = 'PENDING' ORDER BY create_time DESC LIMIT #{limit} OFFSET #{offset}")
|
||||
List<Map<String, Object>> selectPendingMedicalRecords(@Param("patientId") Long patientId, @Param("limit") int limit, @Param("offset") int offset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user