API 参考

UnicareOS 与各应用通过 HTTPS 提供 REST 接口,请求与返回均为 JSON。

示例内容

接口正在整理中。本页的地址、参数与返回结构均为示例,以正式发布为准。

Base URL
https://api.unicaremind.com/v1
格式
JSON,UTF-8
鉴权
Bearer API Key
Base URL
https://api.unicaremind.com/v1

鉴权

在请求头中携带 API Key。Key 在控制台的 设置 → API Keys 中创建,请只在服务端使用。

所有调用都会以 Key 所属的工作空间身份写入审计记录。

Header
Authorization: Bearer $UNICARE_API_KEY

错误码

出错时返回对应的 HTTP 状态码,以及包含 code 和 message 的 JSON。

状态码code说明
400invalid_request参数缺失或格式错误。
401unauthorizedAPI Key 无效或已撤销。
403policy_denied策略门控拒绝了本次调用。
422validation_failed输出未通过校验,且策略要求阻断。
429rate_limited请求过于频繁。
500internal_error服务端错误,请携带 trace_id 联系我们。
403 Forbidden
{
  "code": "policy_denied",
  "message": "当前场景未授权调用该模型",
  "trace_id": "uc-51c0-9a2e-03fd"
}

POST/governance/check

治理校验

对一段 AI 生成的内容执行策略门控、依据溯源与输出校验,返回决策与可追溯的 trace_id。

请求参数

  • scenestring · 必填

    业务场景,例如 discharge_summary、prescription。

  • outputobject · 必填

    待校验的输出,至少包含 text。

  • inputobject

    生成时使用的输入引用,用于依据溯源。

  • sourcesarray

    额外的依据文档编号。

curl https://api.unicaremind.com/v1/governance/check \
  -H "Authorization: Bearer $UNICARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "scene": "discharge_summary",
    "output": { "text": "出院医嘱:继续口服药物治疗,门诊随访。" }
  }'
200 OK
{
  "trace_id": "uc-7f3a-e19c-42b0",
  "decision": "needs_review",
  "checks": [
    { "gate": "policy", "status": "passed" },
    { "gate": "validation", "status": "flagged",
      "message": "出院医嘱未注明复诊时间" }
  ]
}

GET/audit/records/{trace_id}

审计记录

按 trace_id 查询一次调用的完整记录:场景、策略版本、依据、校验结果与确认人。

路径参数

  • trace_idstring · 必填

    治理校验返回的追踪编号。

cURL
curl https://api.unicaremind.com/v1/audit/records/uc-7f3a-e19c-42b0 \
  -H "Authorization: Bearer $UNICARE_API_KEY"
200 OK
{
  "trace_id": "uc-7f3a-e19c-42b0",
  "scene": "discharge_summary",
  "policy_version": "2.3",
  "sources": ["clinic_note", "imaging", "orders"],
  "confirmed_by": "attending",
  "confirmed_at": "2026-11-06T09:42:00+08:00",
  "digest": "sha256:9c41...e07b"
}

POST/apps/drg/pre-audit

DRG 质控预审

在病案上传医保前做一次预审:首页校验、入组预测与费用偏离分析。

请求参数

  • case_idstring · 必填

    院内住院号或病案编号。

  • front_pageobject · 必填

    病案首页字段,含主要诊断、其他诊断与手术操作。

  • feesarray

    费用明细,用于费用结构分析。

200 OK
{
  "case_id": "2381",
  "score": 86,
  "group": { "status": "grouped", "weight": "normal" },
  "cost_deviation": 0.084,
  "issues": [
    { "level": "high", "message": "其他诊断漏填,可能影响并发症判定" },
    { "level": "medium", "message": "主要诊断与主要手术部位不一致" }
  ]
}

POST/apps/emr-qc/check

病历质控

对一份病历执行形式质控与内涵质控,问题定位到段落。该能力已在 GitHub 开源。

请求参数

  • document_typestring · 必填

    文书类型,例如 discharge_summary。

  • contentobject · 必填

    按段落组织的病历内容。

  • rulesarray

    启用的规则集,默认 ["format", "content"]。

200 OK
{
  "score": 91,
  "issues": [
    { "type": "format", "section": "progress_note",
      "message": "首次病程记录超出 8 小时时限" },
    { "type": "content", "section": "discharge_orders",
      "message": "出院医嘱缺少复诊时间" }
  ]
}