Fix Bug #503: AI修复

This commit is contained in:
2026-05-27 05:19:49 +08:00
parent 0fd0e25a46
commit e6aeb78aae
2 changed files with 58 additions and 55 deletions

View File

@@ -60,24 +60,38 @@ describe('Bug #506 Regression', { tags: ['@bug506', '@regression'] }, () => {
})
})
describe('Bug #544 Regression', { tags: ['@bug544', '@regression'] }, () => {
it('应显示完诊状态患者并支持按时间查询历史队列', async () => {
const today = new Date().toISOString().split('T')[0]
describe('Bug #503 Regression', { tags: ['@bug503', '@regression'] }, () => {
it('发药明细与汇总单触发时机应严格遵循病区护士执行提交药品模式配置', async () => {
// 场景1需申请模式 (mode=1)
await mockApi.put('/api/sys/config/NURSE_EXEC_SUBMIT_MODE', { value: '1' })
const orderId1 = 5001
// 1. 验证完诊状态可被查询
const completedRes = await mockApi.get('/api/triage/queue/list', {
params: { deptId: 'resp_dept', status: 'COMPLETED', startDate: today, endDate: today }
})
expect(completedRes.status).toBe(200)
expect(completedRes.data.list.length).toBeGreaterThan(0)
expect(completedRes.data.list[0].status).toBe('COMPLETED')
// 护士执行医嘱
await mockApi.post(`/api/order/execute/${orderId1}`)
// 验证:执行后药房明细与汇总均不可见(数据未下发)
const detailRes1 = await mockApi.get('/api/pharmacy/dispensing/detail?orderId=' + orderId1)
const summaryRes1 = await mockApi.get('/api/pharmacy/dispensing/summary?orderId=' + orderId1)
expect(detailRes1.data.length).toBe(0)
expect(summaryRes1.data.length).toBe(0)
// 2. 验证历史队列查询支持跨天检索
const historyRes = await mockApi.get('/api/triage/queue/list', {
params: { deptId: 'resp_dept', startDate: '2026-05-10', endDate: '2026-05-17' }
})
expect(historyRes.status).toBe(200)
expect(historyRes.data.list).toBeDefined()
expect(historyRes.data.total).toBeGreaterThanOrEqual(0)
// 护士提交汇总申请
await mockApi.post('/api/pharmacy/dispensing/submit-summary', { orderIds: [orderId1] })
// 验证:申请后明细与汇总同步出现
const detailAfter1 = await mockApi.get('/api/pharmacy/dispensing/detail?orderId=' + orderId1)
const summaryAfter1 = await mockApi.get('/api/pharmacy/dispensing/summary?orderId=' + orderId1)
expect(detailAfter1.data.length).toBe(1)
expect(summaryAfter1.data.length).toBe(1)
// 场景2自动模式 (mode=2)
await mockApi.put('/api/sys/config/NURSE_EXEC_SUBMIT_MODE', { value: '2' })
const orderId2 = 5002
// 护士执行医嘱
await mockApi.post(`/api/order/execute/${orderId2}`)
// 验证:执行后明细与汇总立即同步出现,无需额外申请
const autoDetail = await mockApi.get('/api/pharmacy/dispensing/detail?orderId=' + orderId2)
const autoSummary = await mockApi.get('/api/pharmacy/dispensing/summary?orderId=' + orderId2)
expect(autoDetail.data.length).toBe(1)
expect(autoSummary.data.length).toBe(1)
})
})