Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pac
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tools
pac
Commits
f26f0dde
Commit
f26f0dde
authored
Aug 30, 2026
by
luoqi
Browse files
Options
Browse Files
Download
Plain Diff
merge: main → test(反向合)
parents
bac5db09
aa23e1c8
Pipeline
#3639
failed in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
+28
-2
apps/pac-service/src/cli/verify-gap-equivalence.cli.ts
+28
-2
No files found.
apps/pac-service/src/cli/verify-gap-equivalence.cli.ts
View file @
f26f0dde
...
@@ -313,8 +313,34 @@ async function bootstrap(): Promise<number> {
...
@@ -313,8 +313,34 @@ async function bootstrap(): Promise<number> {
if
(
!
entries
.
length
)
throw
new
Error
(
`--sub=
${
args
.
sub
}
不是已知子场景`
);
if
(
!
entries
.
length
)
throw
new
Error
(
`--sub=
${
args
.
sub
}
不是已知子场景`
);
for
(
const
t
of
tenants
)
{
for
(
const
t
of
tenants
)
{
const
scope
:
ScenarioScope
=
{
hostId
:
host
.
id
,
tenantId
:
t
.
tenantId
,
now
};
// --subset=N:把对拍收窄到 N 位患者。生产 113 万患者全量差分要几小时,还会跟
out
(
`▶ host=
${
args
.
host
}
tenant=
${
t
.
tenantId
}
子场景=
${
entries
.
length
}
个`
);
// 2 小时批次抢 RDS;收窄后几分钟就能在**生产真实数据**上拿到零差异证据。
// ⚠️ 收窄降低的是**覆盖**不是可信度:差异一旦出现仍然是真差异。
// 但"子集零差异"≠"全量零差异" —— 报告时必须写清跑的是多少患者。
let
subsetIds
:
string
[]
|
undefined
;
if
(
args
.
subset
>
0
)
{
const
rows
=
await
prisma
.
$queryRaw
<
{
id
:
string
}[]
>
(
Prisma
.
sql
`
SELECT p.id FROM patients p
WHERE p.host_id =
${
host
.
id
}
::uuid AND p.tenant_id =
${
t
.
tenantId
}
AND p.active = true
AND EXISTS (
SELECT 1 FROM patient_facts f
WHERE f.patient_id = p.id AND f.status = 'active'
AND f.type IN ('diagnosis_record','recommendation_record')
)
ORDER BY p.id LIMIT
${
args
.
subset
}
`
);
subsetIds
=
rows
.
map
((
r
)
=>
r
.
id
);
out
(
` 收窄到
${
subsetIds
.
length
}
位**有 active 诊断/建议信号**的患者(--subset)`
);
}
const
scope
:
ScenarioScope
=
{
hostId
:
host
.
id
,
tenantId
:
t
.
tenantId
,
now
,
...(
subsetIds
?
{
patientIds
:
subsetIds
}
:
{}),
};
out
(
`▶ host=
${
args
.
host
}
tenant=
${
t
.
tenantId
}
子场景=
${
entries
.
length
}
个 `
+
`患者域=
${
args
.
subset
>
0
?
`
${
args
.
subset
}
位子集`
:
'全量'
}
`
,
);
for
(
const
[
subKey
,
cfg
]
of
entries
)
{
for
(
const
[
subKey
,
cfg
]
of
entries
)
{
const
rule
=
lookupDxTreatment
(
cfg
.
primaryCode
);
const
rule
=
lookupDxTreatment
(
cfg
.
primaryCode
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment