Commit d0797f48 by luoqi

feat(plan): 患者搜索支持病历号(medical_record_number)

关键词搜索 OR 增 medicalRecordNumber 模糊匹配;左栏 placeholder
「患者号」→「病历号」。注:externalId 非病历号,medical_record_number 才是。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
parent 9a895395
...@@ -188,13 +188,16 @@ export class PlanService { ...@@ -188,13 +188,16 @@ export class PlanService {
]; ];
} }
// W3 末:服务端 keyword 模糊匹配 — patient.name / phone / externalId 任一命中 // W3 末:服务端 keyword 模糊匹配 — patient.name / phone / 病历号 / externalId 任一命中
// (替代前端本页 .filter,改成跨全表搜索,真实接入万人级数据后才能用) // (替代前端本页 .filter,改成跨全表搜索,真实接入万人级数据后才能用)
// medicalRecordNumber = 病历号(客服可读档案号,如 "BA43016")— 列表搜索占位符标的就是它;
// externalId = host 内部业务 id(对人无意义),保留兜底,不删。
const patientWhere: Prisma.PatientWhereInput = {}; const patientWhere: Prisma.PatientWhereInput = {};
if (query.keyword) { if (query.keyword) {
patientWhere.OR = [ patientWhere.OR = [
{ name: { contains: query.keyword, mode: 'insensitive' } }, { name: { contains: query.keyword, mode: 'insensitive' } },
{ phone: { contains: query.keyword } }, { phone: { contains: query.keyword } },
{ medicalRecordNumber: { contains: query.keyword, mode: 'insensitive' } },
{ externalId: { contains: query.keyword, mode: 'insensitive' } }, { externalId: { contains: query.keyword, mode: 'insensitive' } },
]; ];
} }
......
...@@ -143,7 +143,7 @@ export function PatientPickerRail({ ...@@ -143,7 +143,7 @@ export function PatientPickerRail({
type="search" type="search"
value={search} value={search}
onChange={(e) => setSearch(e.target.value)} onChange={(e) => setSearch(e.target.value)}
placeholder="姓名 / 手机 / 患者号" placeholder="姓名 / 手机 / 病历号"
className="h-7 w-full rounded-md border border-slate-100 bg-slate-50 pl-7 pr-2 text-[12px] outline-none placeholder:text-slate-400 focus:border-teal-300 focus:bg-white" className="h-7 w-full rounded-md border border-slate-100 bg-slate-50 pl-7 pr-2 text-[12px] outline-none placeholder:text-slate-400 focus:border-teal-300 focus:bg-white"
/> />
</div> </div>
......
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