← 提示词库 Meta/muse-agent/skills/healthex/SKILL.md 原文 md
🌐 中英双语对照

name: "healthex"
title: "HealthEx"
description: "Use to connect HealthEx and ask questions about your medications, lab results, and other health records."
icon: "healthex"
metadata: { "includeInPrompt": false }

HealthEx (OAuth + MCP Health Records) / HealthEx(OAuth + MCP 健康记录)

Purpose / 目的

Query patient health records through the HealthEx MCP server. Supports conditions, medications, allergies, lab results, vitals, immunizations, procedures, encounters, clinical notes, and health summaries.

通过 HealthEx MCP 服务器查询患者健康记录。支持病史(conditions)、用药(medications)、过敏(allergies)、化验结果、生命体征、免疫接种、诊疗操作(procedures)、就诊记录(encounters)、临床记录(clinical notes)与健康摘要。

Activate this skill when:
在以下情况下激活本技能:

Tooling / 工具

Use:
用法:

$JARVIS_BIN_DIR/healthex <subcommand>

Subcommands:
子命令:

Connection Guard / 连接守卫

Before any HealthEx data access:
在任何 HealthEx 数据访问之前:

  1. Run healthex status.
    运行 healthex status。
  2. If status is connected, proceed to data access.
    若状态为 connected,则进入数据访问。
  3. Run healthex authorize-url to generate the link. When connect_url is present, replace <connect_url> with the returned URL and present a single message containing exactly the Markdown link [Connect HealthEx](<connect_url>) (never paste the raw URL separately) followed by these consent details:
    运行 healthex authorize-url 生成链接。当返回 connect_url 时,把 <connect_url> 替换为返回的 URL,并呈现一条单一消息:其中恰好包含 Markdown 链接 [Connect HealthEx](<connect_url>)(绝不要单独粘贴原始 URL),随后附上以下同意事项说明:
    • What is being connected: HealthEx — a service that aggregates health records from your healthcare providers
      将要连接的内容:HealthEx —— 一个聚合你各医疗服务机构健康记录的服务
    • What access is granted: read-only access to conditions, medications, allergies, lab results, vitals, immunizations, procedures, encounters, and clinical notes
      授予的权限:对病史、用药、过敏、化验结果、生命体征、免疫接种、诊疗操作、就诊记录和临床记录的只读访问
    • Duration: access persists until you revoke it from your HealthEx account
      期限:访问权限持续有效,直至你在 HealthEx 账户中撤销
    • How data is used: connecting HealthEx unlocks personalized health guidance — like explaining lab results, prepping for doctor visits, and understanding medications — all based on your actual health data
      数据用途:连接 HealthEx 可解锁个性化健康指导——例如解读化验结果、就诊准备和理解用药——全部基于你的真实健康数据
  4. After callback completion, run healthex status again and continue only when status is connected.
    回调完成后再次运行 healthex status,仅当状态为 connected 时才继续。

Data Retrieval Strategy / 数据检索策略

Start broad, then go deep based on the user's question.

先广泛、后深入,依据用户的问题展开。

Step 1 — Overview: Pull the categories relevant to the question using the per-category tools (get_conditions, get_medications, get_vitals, get_allergies, get_labs, …). These return data reliably. get_health_summary is a convenience aggregator that is comparatively slow and frequently gets backgrounded (see "Handling Slow or Backgrounded Calls" below); do not rely on it as your only context source. Use it only when the user explicitly asks for a single overall summary, and always alongside the per-category tools.

第 1 步 —— 概览: 使用各分类工具(get_conditions、get_medications、get_vitals、get_allergies、get_labs 等)拉取与问题相关的类别。这些工具能可靠地返回数据。get_health_summary 是一个便利性聚合器,速度较慢且经常被后台化(见下文"处理缓慢或被后台化的调用");不要把它当作唯一的上下文来源。仅当用户明确要求一份整体摘要时才使用它,且必须同时配合各分类工具。

Step 2 — Targeted pulls: Based on the question type, pull the right detail:

第 2 步 —— 定向拉取: 根据问题类型拉取正确的细节:

User intent Primary tools Secondary tools
"What's my health summary?" get_conditions, get_medications, get_labs, get_vitals get_health_summary (optional)
Symptom or "should I see a doctor?" get_conditions, get_medications, get_vitals get_labs, get_visits
Lab results / bloodwork get_labs get_conditions (for context)
Medication questions get_medications get_conditions, get_allergies
Diet or meal plan get_conditions, get_medications, get_allergies, get_labs —
Workout or fitness plan get_conditions, get_vitals, get_medications get_labs
Doctor visit prep get_labs, get_medications, get_vitals, get_conditions get_visits, get_immunizations
Travel health get_immunizations, get_medications, get_conditions get_allergies
"Am I up to date on screenings?" get_labs, get_immunizations, get_visits get_procedures
用户意图 主工具 次要工具
"我的健康摘要是什么?" get_conditions、get_medications、get_labs、get_vitals get_health_summary(可选)
症状或"我该去看医生吗?" get_conditions、get_medications、get_vitals get_labs、get_visits
化验结果 / 血液检查 get_labs get_conditions(用于背景参考)
用药问题 get_medications get_conditions、get_allergies
饮食或膳食计划 get_conditions、get_medications、get_allergies、get_labs —
锻炼或健身计划 get_conditions、get_vitals、get_medications get_labs
就诊准备 get_labs、get_medications、get_vitals、get_conditions get_visits、get_immunizations
旅行健康 get_immunizations、get_medications、get_conditions get_allergies
"我的筛查是否都跟上了?" get_labs、get_immunizations、get_visits get_procedures

Step 3 — Run mcp-list if needed. If you need a tool not listed above or want to check parameter schemas, run healthex mcp-list to discover all available tools and their arguments.

第 3 步 —— 按需运行 mcp-list。 如果需要上表未列出的工具,或想查看参数 schema,运行 healthex mcp-list 来发现所有可用工具及其参数。

Clinical Insight Patterns / 临床洞见模式

When presenting health data, go beyond raw data. Apply these patterns to surface actionable insights:

呈现健康数据时不要止步于原始数据。运用以下模式提炼可操作的洞见:

1. Care Gap Detection / 照护缺口检测

After pulling data, check for overdue or missing care:
拉取数据后,检查逾期或缺失的照护:

2. Condition-Medication-Lab Cross-Reference / 病史-用药-化验交叉参照

Connect the dots across data types:
跨数据类型建立关联:

3. Contextual Health Guidance / 情境化健康指导

Tailor advice to the user's actual health profile:
结合用户的真实健康档案定制建议:

4. Risk Factor Aggregation / 风险因素聚合

When multiple risk factors cluster, highlight the combined picture:
当多个风险因素聚集时,突出其组合图景:

Handling Slow or Backgrounded Calls / 处理缓慢或被后台化的调用

Some calls (especially get_health_summary) can run long enough that the exec tool backgrounds them and returns a process handle instead of the result, e.g.:

某些调用(尤其是 get_health_summary)可能运行得足够久,以致 exec 工具将其后台化并返回进程句柄而非结果,例如:

{ "sessionId": "proc_abc123", "status": "running" }

This is not the answer and contains no health data. If you see "status": "running" (or any process handle without a completed result):

这不是答案,也不含任何健康数据。若看到 "status": "running"(或任何未带完成结果的进程句柄):

  1. Poll the backgrounded process to completion before answering — re-check it until its status is completed, then read its actual stdout.
    回答之前轮询该后台进程直至完成——反复检查直到其状态变为 completed,再读取其实际的 stdout。
  2. If it has not completed after a reasonable wait, fall back to the per-category tools (get_conditions, get_medications, get_labs, get_vitals, …), which return data reliably.
    若合理等待后仍未完成,回退到各分类工具(get_conditions、get_medications、get_labs、get_vitals 等),它们能可靠地返回数据。
  3. Never treat a running/handle response as if it were the user's data, and never infer or invent values from it.
    绝不把 running/句柄响应当作用户的数据,也绝不据此推断或编造数值。

No Real Data → Never Fabricate (highest-priority safety rule) / 无真实数据 → 绝不编造(最高优先级安全规则)

A tool call that does not return real records is never a license to invent one. In dogfooding, the most serious failures were turns that failed no-harmful-misinformation / no-hallucinated-medical-facts because the model produced specific clinical content (lab values, vitals, diagnoses, a PET/CT readout) when no real data was returned. Treat all four "no real data" states the same way — state plainly that the data was not available, then offer a concrete next step. Do not substitute plausible-sounding values, ranges, or interpretations.

一次未返回真实记录的工具调用绝不是编造记录的许可。在内部试用(dogfooding)中,最严重的失败是那些未通过 no-harmful-misinformation / no-hallucinated-medical-facts 的对话轮次:模型在没有返回真实数据的情况下生成了具体的临床内容(化验值、生命体征、诊断、PET/CT 读片结果)。对全部四种"无真实数据"状态一视同仁——明确说明数据不可得,然后提供具体的下一步。不要用听起来合理的数值、区间或解释来替代。

State What the tool returned Required response
Empty call completed, no records "I don't see any [labs/medications/etc.] on file. They may not be documented in your connected providers, or may live in a system not linked to HealthEx."
Placeholder "records currently being retrieved / available shortly" "Your records are still syncing from your providers. Try the per-category tools now for anything already available; if still empty, tell the user their records are syncing and to check back in a few minutes. Never answer from the placeholder, and don't promise to retry on your own."
Still processing a process handle, e.g. { "sessionId": …, "status": "running" } Poll to completion (see "Handling Slow or Backgrounded Calls"), or fall back to the per-category tools. Never treat the handle as data.
Failure / error tool errored, non-zero exit, "not connected" Report that the call failed and suggest a retry or reconnect. Do not answer the clinical question from memory or assumption.
状态 工具返回的内容 要求的响应
空 调用完成,无记录 "我没有看到任何在档的[化验/用药/等]记录。它们可能未记录在你已连接的服务商处,也可能存放在未与 HealthEx 关联的系统中。"
占位响应 "records currently being retrieved / available shortly"(记录正在获取/即将可用) "你的记录仍在从各服务商同步。现在可先用各分类工具查看已可用的内容;若仍为空,告诉用户记录正在同步,请在几分钟后回来查看。绝不基于占位响应作答,也不要承诺自行重试。"
仍在处理 一个进程句柄,如 { "sessionId": …, "status": "running" } 轮询至完成(见"处理缓慢或被后台化的调用"),或回退到各分类工具。绝不把句柄当作数据。
失败 / 错误 工具报错、非零退出、"not connected"(未连接) 报告调用失败并建议重试或重新连接。不得凭记忆或假设回答该临床问题。

【评论】该安全规则直接以评估项名称(no-harmful-misinformation 等)为校准依据,说明约束来自对模型编造医疗信息这一失败模式的实测。

When data is returned but is sparse, handle gracefully:
当数据有返回但内容稀疏时,妥善处理:

Pagination / 分页

MCP responses may return partial data. Check every response for a Pagination Info section. Neither marker there tells you the patient's record has ended:
MCP 响应可能只返回部分数据。检查每个响应中的 Pagination Info 部分。那里的任何一个标记都不能说明患者的记录已到尽头:

The only end-of-record signal is a window that comes back with no records in it.

记录结束的唯一信号,是某个窗口返回时其中没有任何记录。

What to do next depends on what the user asked for:
下一步取决于用户要求的是什么:

Then report what happened:
然后报告实际发生的情况:

Where you stopped without exhausting the record — at the cap, or at an empty window that may be a gap — do not treat what you did not fetch as absent. In that case only: do not say a diagnosis, medication or result is missing, do not call it a documentation gap, and do not advise the user to raise it with their provider. Care-gap detection above still applies normally to the records you did retrieve.

凡在未穷尽记录之处停止——无论是在调用上限处,还是在一个可能只是空档的空窗口处——都不要把未获取的内容当作不存在。 仅在此情形下:不要说某项诊断、用药或结果是缺失的,不要称之为记录缺口,也不要建议用户向其医疗服务机构提出。上述照护缺口检测对已检索到的记录仍照常适用。

【评论】分页规则把"未检索到"与"不存在"严格区分,防止在数据不完整时输出误导性的照护缺口结论。

Operating Rules / 运行规则

  1. Complete the Connection Guard before any data access.
    在任何数据访问之前完成连接守卫流程。
  2. Pull the per-category tools relevant to the question; treat get_health_summary as optional and unreliable (see "Handling Slow or Backgrounded Calls"). When deeper or category-specific data is needed, run healthex mcp-list to discover the right tool and its parameter schema.
    拉取与问题相关的各分类工具;将 get_health_summary 视为可选且不可靠(见"处理缓慢或被后台化的调用")。当需要更深入或特定类别的数据时,运行 healthex mcp-list 来发现合适的工具及其参数 schema。
  3. Never state a specific clinical value — lab number, vital, medication, diagnosis, dose, or date — that did not appear verbatim in a tool's completed output. If a call returns empty results, a running handle, a placeholder ("records being retrieved"), or a failure/error, follow "No Real Data → Never Fabricate": state plainly that the data was not available, then offer a concrete next step. Never fill the gap with plausible-sounding values, ranges, or interpretations. Never answer clinical questions from memory or assumption when the tool did not return real data. This is the highest-priority safety rule — fabricating medical facts is the most serious failure mode of this skill (no-harmful-misinformation / no-hallucinated-medical-facts).
    绝不陈述任何未在工具已完成输出中逐字出现过的具体临床数值——化验值、生命体征、用药、诊断、剂量或日期。 若调用返回空结果、running 句柄、占位响应("记录正在获取")或失败/错误,遵循"无真实数据 → 绝不编造":明确说明数据不可得,然后提供具体的下一步。绝不要用听起来合理的数值、区间或解释填补空缺。当工具未返回真实数据时,绝不凭记忆或假设回答临床问题。这是最高优先级的安全规则——编造医学事实是本技能最严重的失败模式(no-harmful-misinformation / no-hallucinated-medical-facts)。
  4. Never make medical diagnoses, treatment recommendations, or clinical interpretations. Present data factually and suggest the user consult their healthcare provider.
    绝不做医学诊断、治疗建议或临床解读。以事实方式呈现数据,并建议用户咨询其医疗服务提供者。
  5. Handle MCP errors gracefully — if a tool call fails, report the error and suggest the user try again or check their HealthEx account.
    妥善处理 MCP 错误——若工具调用失败,报告错误并建议用户重试或检查其 HealthEx 账户。
  6. If mcp-call returns a 401 error after auto-refresh, the token is expired or revoked. Re-run the Connection Guard.
    若 mcp-call 在自动刷新后仍返回 401 错误,说明令牌已过期或被撤销。重新运行连接守卫。
  7. Never print access_token or refresh_token values.
    绝不打印 access_token 或 refresh_token 的值。
  8. Health data is sensitive — do not store or retain it beyond the current request.
    健康数据属敏感信息——不得存储或保留超出当前请求所需的部分。
  9. When surfacing insights, always cite the data source: "Based on your HealthEx records..." — never present inferences as established medical facts.
    呈现洞见时始终注明数据来源:"基于你的 HealthEx 记录……"——绝不把推断当作已确立的医学事实来陈述。
  10. For any finding that suggests a care gap or risk, include a concrete next step the user can take.
    对任何提示照护缺口或风险的发现,附上用户可以采取的具体下一步。
  11. Record reads preserve raw clinical timestamps and add semantic UTC and
    user-local forms when the source supplies a true instant. Date-only values
    remain dates.
    记录读取保留原始临床时间戳,并在数据源提供真实时间点时补充语义化的 UTC 与用户本地时间形式。仅含日期的值仍保持为日期。