Commit 66703e8f by luoqi

fix(recall): make_interval 参数加 ::int 转型 — Prisma 数字绑成 bigint 致 42883

上个 commit 验证结论有误(管道 tail 吞了退出码,实际 SQL 报错)。本次修正后重验:
recompute-plans 全量 exit=0;recompute-persona 单患者(共用 gap 核心)success=1。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
parent cb5e4bc1
...@@ -117,7 +117,7 @@ export function buildGapCore(input: GapCoreInput): GapCorePieces { ...@@ -117,7 +117,7 @@ export function buildGapCore(input: GapCoreInput): GapCorePieces {
// 复述不 re-arm;真复发(末次治疗距再诊断超黄金窗,如修复体多年后失败)仍正常召回。 // 复述不 re-arm;真复发(末次治疗距再诊断超黄金窗,如修复体多年后失败)仍正常召回。
// 已知取舍:治疗后黄金窗内的"真二次新发"会被压到下一次诊断才召 — 临床上该场景 // 已知取舍:治疗后黄金窗内的"真二次新发"会被压到下一次诊断才召 — 临床上该场景
// 通常当场处理,误召打扰的代价更高。 // 通常当场处理,误召打扰的代价更高。
const episodeLookback = Prisma.sql`make_interval(days => ${rule.windowDays})`; const episodeLookback = Prisma.sql`make_interval(days => ${rule.windowDays}::int)`;
const afterDxFrag = rule.excludeIfEverTreated const afterDxFrag = rule.excludeIfEverTreated
? Prisma.sql`AND tx.occurred_at >= ${latestDxOfCode} - ${episodeLookback}` ? Prisma.sql`AND tx.occurred_at >= ${latestDxOfCode} - ${episodeLookback}`
: Prisma.sql`AND tx.occurred_at >= COALESCE(sig.occurred_at, sig.planned_for) - ${episodeLookback}`; : Prisma.sql`AND tx.occurred_at >= COALESCE(sig.occurred_at, sig.planned_for) - ${episodeLookback}`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment