tyt-api-nest/docs/patients.md

35 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 患者模块说明(`src/patients`
## 1. 目标
- B 端:维护患者、手术、植入设备及生命周期数据。
- C 端:家属小程序登录后,按已绑定手机号聚合查询跨院患者生命周期。
## 2. B 端能力
- 患者列表、详情、创建、更新、删除
- 手术记录新增
- 植入设备录入与历史保留
## 3. C 端能力
- 家属账号通过小程序手机号登录
- `GET /c/patients/my-lifecycle`
- 查询口径:按 `FamilyMiniAppAccount.phone` 聚合 `Patient.phone`
- 返回内容:手术事件 + 调压事件的时间线
## 4. 当前规则
- 同一个手机号可关联多个患者C 端会统一聚合返回。
- C 端手机号来源于患者手术/档案中维护的联系电话。
- 仅已登录的家属小程序账号可访问 `my-lifecycle`
- 家属账号不存在或 token 无效时返回 `401`
- 手机号下无患者档案时,登录阶段直接拦截,不进入生命周期查询。
## 5. 典型接口
- `GET /b/patients`
- `POST /b/patients`
- `POST /b/patients/:id/surgeries`
- `GET /c/patients/my-lifecycle`