Anpheros 健康後端
Anpheros 將每個人的健康記錄儲存為標準的 HL7 FHIR R4 資源,並透過簡單的 REST API(/v1)和嚴格的 FHIR API(/fhir/R4)公開相同的資料。兩者的 ID 完全一致。
- 基礎網址:
https://platform.anpheros.com(金鑰決定是沙箱或正式環境) - 指南:https://developers.anpheros.com/guides/ — OpenAPI:
/docs— CapabilityStatement:/fhir/R4/metadata - 文件 MCP 伺服器(無需帳號,唯讀):
https://platform.anpheros.com/mcp/docs - SDK:
npm install @anpheros/sdk(TypeScript)、anpheros_sdk(Dart/Flutter)
規則(務必遵守)
- 先使用沙箱。 請使用
sk_test_金鑰:它只會看到專案的模擬病人。絕不可將真實病人資料放入沙箱,也不可將sk_live_金鑰寫入程式碼、範例或提交內容;請從環境變數(ANPHEROS_KEY)讀取金鑰。 - 絕不擅自偽造代碼。 LOINC、SNOMED CT、ICD-10、ICD-11、ATC 和 RxNorm 代碼必須來自官方代碼系統或術語搜尋(
GET /v1/search?q=…、GET /v1/search/{id})。如果某個代碼未知,請將其省略。單位使用 UCUM(mg/dL、mmHg、kg)。 - 同意授權是強制性的。 API 金鑰只能看到其專案建立的病人。若要存取某人既有的記錄,必須透過同意流程(下列第 4 步)取得其授權。收到
403表示「超出同意範圍」:應請求更多權限,而非繞過限制。收到401表示授權已被撤銷,存取權限已終止。 - 標明資料來源。 每次寫入都必須攜帶
author_type(patient、practitioner、device、import、ai)。由模型寫入的資料使用author_type: "ai"(HL7 AI 透明度標籤由平台自動附加)。 - 不得提供診斷或治療建議。 應用程式可以顯示記錄、趨勢和模式,但不得告知使用者他們患有何種疾病或應該服用哪種藥物。
- 在可能重試的寫入請求中,請傳送
Idempotency-Key標頭。
工作流程
- 取得金鑰。 開發者在 https://platform.anpheros.com/dashboard/ 登入,然後按下「取得沙箱金鑰」。
- 讀取資料。
curl $BASE/v1/patients -H "Authorization: Bearer $ANPHEROS_KEY" curl "$BASE/v1/patients/$PID/observations?category=laboratory&limit=10" -H "Authorization: Bearer $ANPHEROS_KEY" curl "$BASE/v1/patients/$PID/timeline?from=2026-06-01" -H "Authorization: Bearer $ANPHEROS_KEY" - 寫入資料。
使用 SDK:curl -X POST "$BASE/v1/patients/$PID/observations" -H "Authorization: Bearer $ANPHEROS_KEY" \ -H 'content-type: application/json' -H "Idempotency-Key: $(uuidgen)" -d '{ "code": "2339-0", "display": "Glucose", "category": "laboratory", "value": 112, "unit": "mg/dL", "effective_at": "2026-09-19T08:10:00Z", "author_type": "device"}'import { Anpheros, apiKey } from '@anpheros/sdk'; const anpheros = new Anpheros({ auth: apiKey(process.env.ANPHEROS_KEY!) }); const patient = await anpheros.patients.create({ given: 'Ana', family: 'Example', birth_date: '1980-05-17', gender: 'female' }); - 同意授權(SMART on FHIR、OAuth 2.1 + PKCE)。 註冊應用程式
(
POST /admin/projects/{id}/applications),將使用者導向GET /oauth/authorize?…&scope=patient/Observation.rs offline_access&purpose=treatment, 在POST /oauth/token交換授權碼,然後使用Authorization: Bearer at_…呼叫 API。 探索端點:/.well-known/smart-configuration。指南:https://developers.anpheros.com/guides/healthcare-api-patient-consent - AI 情境。
POST /v1/context會根據提示回傳記錄中相關的部分,並附帶來源追蹤,避免直接將原始資源傾倒給模型。 - 實驗室資料匯入。 HL7 v2 ORU 和 CSV 檢驗報告:https://developers.anpheros.com/guides/import-lab-results-fhir
在針對此處未涵蓋的主題撰寫程式碼之前,請先搜尋指南(使用文件 MCP 伺服器的 search_docs 或指南索引),而不是自行猜測端點。