| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| data | ||
| prisma | ||
| scripts | ||
| sql | ||
| src | ||
| tests | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .swcrc | ||
| Dockerfile | ||
| jest.config.cjs | ||
| nest-cli.json | ||
| package.json | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
| tsconfig.typecheck.json |
给外部消费方(首个是 friday-ai)一套 HMAC 验签、免登录的只读接口。 ## 端点 · search / batch-get / profile —— **患者优先**:先有 patientId 才问得出东西 · appointments/window —— 唯一一个**事实优先**的查询。「明天这家店有谁要来」 患者优先答不了它,绕过去要按名册逐批查(单品牌 1200+ 次往返/轮,不可行) ## 越权防线只有一道,是刻意的 profile 的第一步就是 `PatientService.getByIds(scope, ids)`,品牌维和诊所维都在 那里过完;**后面所有查询只用它返回的 id**。⛔ 别为了少一次查询改成拿请求里的 id 直接查 fact —— 那一刻防线就没了,而且是静默的:知道一个 id 就能读别家的病历。 ## 出库时的展示串重写(open-display.ts) `patient_facts.title` 里是 code / uuid / 半截存储路径 —— 那是**入库保真**,不是 bug。 翻译是**开放面对消费方的责任**,PAC 内部一个字不动: 治疗 periodontic · 龈上洁治 → 治疗 牙周 · 龈上洁治 收款 ¥0.00(other) → 收款 ¥0.00 · 未记渠道 影像 intraoral_photo <120字符路径> → 影像 口内照片 电子病历 <32位uuid> → 电子病历 · 李闻⛔ 只改 title,`content` 一个字不动 —— 那里面是事实本身,算法直接消费它。⚠ ️ 认不出的 code **回退原值**,宿主加新码时至少 grep 得到,不静默变空。 ## 码表补全(@pac/types) 治疗类别 / 影像模态本来就带 nameZh;新增收款渠道(15 种)与预约状态(8 态)。⚠ ️ `rescheduled` 占预约的 45%(249,007/556,883)—— 消费方漏掉它就等于 近一半的预约显示成英文码。 ## 其它 · 读密钥与推送密钥分离(hmac-verifier)—— 读方拿到的密钥不该能往回写 · patient_transactions (patient_id, clinic_id) 索引 —— 诊所维反查用 · 回访任务记录并入 profile(`include: ['returnVisits']`,刻意不进默认)⚠ ️ 它**不是 fact**:装配器里写着「不进 transaction/fact、不进召回」,⛔ 别为了时间线好拼就把它改成 fact。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| data | Loading commit data... | |
| prisma | Loading commit data... | |
| scripts | Loading commit data... | |
| sql | Loading commit data... | |
| src | Loading commit data... | |
| tests | Loading commit data... | |
| .dockerignore | Loading commit data... | |
| .env.example | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .swcrc | Loading commit data... | |
| Dockerfile | Loading commit data... | |
| jest.config.cjs | Loading commit data... | |
| nest-cli.json | Loading commit data... | |
| package.json | Loading commit data... | |
| tsconfig.build.json | Loading commit data... | |
| tsconfig.json | Loading commit data... | |
| tsconfig.typecheck.json | Loading commit data... |