之前 ⑤a 排除是 patient + category 级("DW 限制" 注释);
EMR.treat_plan 进来后 actual 带牙位,可以升级到 tooth-level overlap。
逻辑(3 路 OR):
① 信号无牙位(K05 全口诊断)→ 仍 patient/category 级
② actual 无牙位(全口洁治/牙周治疗)→ 视为"全口覆盖"→ 仍排除
③ 双方都有牙位 → tooth array overlap(PG && 操作符)
实现细节:
- regexp_replace 把"15 B;24 B"非数字非分号字符替换为 ; → "15;24"
- string_to_array + array_remove '' 去空元素(关键:两 array 都有 '' 时 '' = '' 误返 true)
- PG && 任一元素相同即 overlap
收益例子:
- 罗国标 K04 14;15 + actual endodontic 36 → tooth overlap false → 正确召回 14;15
- 之前 patient/category 级会被误排除
向下兼容:48.7% actual 带牙位 → 这部分走 tooth-level 精筛;
其余 52% actual 无牙位(全口治疗)→ 走 ② 分支,跟现状一致(全口覆盖)。
不需要重导(SQL 改动,数据不动);下次 recompute-plans 立刻生效。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .claude | Loading commit data... | |
| .history | Loading commit data... | |
| apps | Loading commit data... | |
| docs | Loading commit data... | |
| packages | Loading commit data... | |
| scripts | Loading commit data... | |
| .env.example | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .npmrc | Loading commit data... | |
| .prettierrc | Loading commit data... | |
| README.md | Loading commit data... | |
| docker-compose.prod.yml | Loading commit data... | |
| docker-compose.yml | Loading commit data... | |
| eslint.config.mjs | Loading commit data... | |
| liu.cjs | Loading commit data... | |
| package.json | Loading commit data... | |
| pnpm-lock.yaml | Loading commit data... | |
| pnpm-workspace.yaml | Loading commit data... | |
| tsconfig.base.json | Loading commit data... | |
| turbo.json | Loading commit data... |