Commit 84787808 by luoqi

feat(plans): 患者卡片加「原始档案 →」插槽(潜在治疗右侧,VIEW_PATIENT 跳转)

患者卡片右上角「潜在治疗」后加「原始档案 →」—— 走宿主 VIEW_PATIENT 跳转,
占位 {patientId}(userId)/{medicalRecordNumber}(fileNumber),与 EMR「原始病历」同一套
(resolveActionUrl + target=_top);未配 VIEW_PATIENT 则不渲染。
HOST_ACTION_META.VIEW_PATIENT 占位更新为 {patientId}+{medicalRecordNumber}。
本地验证:配 /customerInfo?userId={patientId}&fileNumber={medicalRecordNumber} 后链接正常渲染。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
parent 3c6f3372
Pipeline #3352 failed in 0 seconds
......@@ -1028,6 +1028,23 @@ function IdentityCard({
>
潜在治疗 →
</button>
{/* 原始档案 —— 宿主 VIEW_PATIENT 跳转(占位 {patientId}/{medicalRecordNumber});未配则不渲染 */}
{(() => {
const url = resolveActionUrl('VIEW_PATIENT', {
patientId: patient.externalId,
medicalRecordNumber: patient.medicalRecordNumber,
});
return url ? (
<a
href={url}
target="_top"
rel="noopener"
className="text-[10.5px] text-teal-700 hover:underline"
>
原始档案 →
</a>
) : null;
})()}
</div>
</div>
{patient.tags.length > 0 && (
......
......@@ -92,7 +92,7 @@ export type HostActionKey = (typeof HostActionKey)[keyof typeof HostActionKey];
/// 标签(中文)+ 占位变量提示(给 admin 配置页显示)
export const HOST_ACTION_META: Record<HostActionKey, { label: string; placeholders: string[] }> = {
VIEW_PATIENT: { label: '查看患者档案', placeholders: ['{patientId}'] },
VIEW_PATIENT: { label: '查看患者档案(原始档案)', placeholders: ['{patientId}', '{medicalRecordNumber}'] },
EDIT_PATIENT: { label: '编辑患者信息', placeholders: ['{patientId}'] },
CREATE_APPOINTMENT: { label: '新建预约', placeholders: ['{patientId}', '{doctorId}'] },
VIEW_APPOINTMENT: { label: '查看预约', placeholders: ['{appointmentId}'] },
......
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