API 參考
UnicareOS 與各應用通過 HTTPS 提供 REST 接口,請求與返回均為 JSON。
示例內容
接口正在整理中。本頁的地址、參數與返回結構均為示例,以正式發佈為準。
- Base URL
https://api.unicaremind.com/v1- 格式
- JSON,UTF-8
- 鑑權
- Bearer API Key
https://api.unicaremind.com/v1鑑權
在請求頭中攜帶 API Key。Key 在控制台的 設置 → API Keys 中創建,請只在服務端使用。
所有調用都會以 Key 所屬的工作空間身份寫入審計記錄。
Authorization: Bearer $UNICARE_API_KEY錯誤碼
出錯時返回對應的 HTTP 狀態碼,以及包含 code 和 message 的 JSON。
| 狀態碼 | code | 説明 |
|---|---|---|
| 400 | invalid_request | 參數缺失或格式錯誤。 |
| 401 | unauthorized | API Key 無效或已撤銷。 |
| 403 | policy_denied | 策略門控拒絕了本次調用。 |
| 422 | validation_failed | 輸出未通過校驗,且策略要求阻斷。 |
| 429 | rate_limited | 請求過於頻繁。 |
| 500 | internal_error | 服務端錯誤,請攜帶 trace_id 聯繫我們。 |
{
"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": "出院醫囑:繼續口服藥物治療,門診隨訪。" }
}'
resp = requests.post(
f"{BASE_URL}/governance/check",
headers=HEADERS,
json={
"scene": "discharge_summary",
"output": {"text": "出院醫囑:繼續口服藥物治療,門診隨訪。"},
},
)
{
"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 https://api.unicaremind.com/v1/audit/records/uc-7f3a-e19c-42b0 \
-H "Authorization: Bearer $UNICARE_API_KEY"{
"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費用明細,用於費用結構分析。
{
"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"]。
{
"score": 91,
"issues": [
{ "type": "format", "section": "progress_note",
"message": "首次病程記錄超出 8 小時時限" },
{ "type": "content", "section": "discharge_orders",
"message": "出院醫囑缺少複診時間" }
]
}