病人入口網站應用程式後端範本
傳遞檢驗結果、管理治療計劃,並啟用安全的醫生與病人訊息交流
一個生產就緒的 病人入口網站後端 在 Back4app,具備安全的檢驗結果交付、治療計劃管理、臨床醫生訊息交流、約會鏈接和集中審核記錄。包括 ER 圖、資料字典、JSON 架構、API 操作區,以及一個 AI 代理 提示以快速引導。
關鍵要點
提供一個面向患者的後端,具備安全訪問控制、實驗室版本管理、治療計劃歷史、線索消息和審計追蹤,讓您的產品團隊能專注於用戶體驗和合規性。
- 以患者為優先的數據模型 — 保持患者身份、實驗室結果、治療和消息分別建模,但相互連結以確保清晰的來源和授權。
- 安全消息 — 患者與 Provider 之間的線索消息,支持附件,並提供清晰的讀取回執和保留控制。
- 版本控制的實驗室結果 — 存儲具來源和版本元數據的實驗室結果,以便跟踪更新報告和補充資料。
- 治療計畫生命週期 — 管理治療計畫草稿、Provider的批准、病人的確認以及版本歷史。
- 符合合規的日誌記錄 — 集中式AuditLog類別記錄敏感事件以供審查、監控和合規。
什麼是病人門戶應用程序後端模板?
Back4app是一個後端即服務(BaaS),可快速交付。病人門戶應用程序後端模板是一個預建模式,用於病人檔案、實驗室結果、治療計畫、安全消息、預約和審計日誌。連接您選擇的前端(React、Flutter、Next.js等)並更快發貨。
最佳用途:
概覽
病人入口需要強大的數據邊界、可審計的變更,以及對敏感項目如實驗室結果和治療計劃的可靠傳遞。
這個模板定義了 PatientProfile、LabResult、TreatmentPlan、Message、ProviderProfile、Appointment 和 AuditLog,並設置擁有權和基於角色的規則,以便團隊能夠快速且安全地實現病人入口。
核心患者門戶功能
此中心的每個技術卡片都使用相同的病人入口後端架構,包括 PatientProfile、LabResult、TreatmentPlan、Message、ProviderProfile、Appointment 和 AuditLog。
病人資料檔案及身份驗證
PatientProfile 儲存身份、聯絡詳情和偏好,並指向已身份驗證的用戶。
版本化的實驗室結果
LabResult 儲存測試類型、原始結果有效載荷、報告時間、版本及 Provider 來源。
治療計畫生命週期
TreatmentPlan 儲存計畫內容、 Provider 批准者、狀態(草稿、活躍、已完成)和有效期限。
安全的醫生與患者訊息傳遞
訊息支持主題、附件、發件人/收件人指針,以及傳送/閱讀狀態。
預約連結
預約連結患者、 Provider、排定時間和訪問狀態。
集中式審計日誌
AuditLog 捕獲演員身份、行動類型、實體上下文和有效負載元數據以符合規範要求。
為什麼要使用 Back4app 來構建您的患者門戶應用後端?
Back4app 處理後端的基本要素——安全性、持久性、API 和實時——讓您可以專注於患者體驗、隱私工作流程和臨床整合。
- •臨床數據的安全交付: 內建的身份驗證和 ACL/CLP 模式讓您精確控制哪些用戶可以查看每個檢驗結果、治療計劃或消息。
- •審計與來源: AuditLog 會記錄誰查看、發布或修改了敏感記錄,讓您可以支持合規性和調試。
- •消息和通知: 線程消息、附件和可選的實時更新使臨床醫生與患者的對話流暢且及時。
快速部署安全的患者門戶後端,並專注於臨床工作流程而非後端管道。
核心好處
一個強調隱私、來源和快速交付的病人入口後端。
加速病人體驗
通過重用經驗證的後端合約,更快地提供實驗室結果視圖、治療計劃交付和安全消息。
強大的數據來源
版本實驗室結果和治療計劃,以便臨床變更可審計和可追溯。
細粒度權限
使用 ACL/CLP 和角色檢查來保護敏感項目,只有獲准的臨床醫生和患者才能訪問它們。
集成消息
帶有附件的線程消息和可選的實時更新改善了臨床醫生與患者之間的協作。
合規準備日誌
集中式審計日誌支持審查、事件調查和合規報告。
AI助力啟動
利用策劃的 AI 代理提示快速啟動開發,為架構、ACL 和基本集成代碼提供支架。
準備好建立安全的患者入口網站了嗎?
讓 Back4app AI 代理為您的患者入口網站後端搭建框架,並從一個提示生成患者檔案、實驗室結果、治療計畫、消息和審計日誌。
免費開始 — 每月 50 次 AI 代理提示,無需信用卡
技術堆疊
此患者入口網站後端模板中包含的所有內容。
ER 圖
對於病人入口網站後端架構的實體關係模型。
涵蓋病人檔案、Provider、實驗室結果、治療計劃、消息、約會和審計日誌的架構。
檢視圖表來源
erDiagram
PatientProfile ||--o{ LabResult : "has"
PatientProfile ||--o{ TreatmentPlan : "receives"
PatientProfile ||--o{ Message : "context for"
PatientProfile ||--o{ Appointment : "scheduled in"
_User ||--o{ Message : "sends/receives"
_User ||--o{ TreatmentPlan : "authors"
_User ||--o{ Appointment : "provides"
PatientProfile {
String objectId PK
Pointer user FK
String medicalRecordNumber
String displayName
Date dateOfBirth
String primaryClinic
Boolean isActive
Date createdAt
Date updatedAt
}
LabResult {
String objectId PK
Pointer patient FK
Pointer orderedBy FK
String testCode
String testName
String resultValue
String units
String referenceRange
String status
Date publishedAt
Array attachments
Date createdAt
Date updatedAt
}
TreatmentPlan {
String objectId PK
Pointer patient FK
Pointer createdBy FK
String summary
String details
String status
Date startDate
Date endDate
Date createdAt
Date updatedAt
}
Message {
String objectId PK
String conversationId
Pointer from FK
Pointer to FK
Pointer patient FK
String body
Array attachments
Boolean isRead
Date sentAt
Date createdAt
Date updatedAt
}
Appointment {
String objectId PK
Pointer patient FK
Pointer provider FK
Date startAt
Date endAt
String location
String status
String reason
Date createdAt
Date updatedAt
}
AuditLog {
String objectId PK
Pointer actor FK
String entityType
String entityId
String action
String summary
Object metadata
Date createdAt
Date updatedAt
}
整合流程
身份驗證、實驗室結果交付、治療計劃更新和消息傳遞的典型運行流程。
查看圖表來源
sequenceDiagram
participant Patient
participant App as Patient Portal App
participant Clinician
participant Back4app as Back4app Cloud
Patient->>App: Sign in with email or SSO
App->>Back4app: POST /login (credentials/SSO token)
Back4app-->>App: Return Session Token + Patient context
Patient->>App: Open Dashboard (profile & recent labs)
App->>Back4app: GET /classes/PatientProfile?where={"user":Pointer("_User", "u123")}
Back4app-->>App: PatientProfile object
App->>Back4app: GET /classes/LabResult?where={"patient":Pointer("PatientProfile","p123")}&order=-publishedAt
Back4app-->>App: List of LabResult (latest first)
Patient->>App: View active Treatment Plan
App->>Back4app: GET /classes/TreatmentPlan?where={"patient":Pointer("PatientProfile","p123"),"status":"active"}
Back4app-->>App: TreatmentPlan object
Patient->>App: Send secure message to clinician
App->>Back4app: POST /classes/Message (conversationId, body, to: Pointer(_User, clinicianId))
Back4app-->>App: Message objectId
Back4app-->>App: LiveQuery -> new Message or LabResult update
App-->>Patient: Real-time notification (new message / result available)
Clinician->>Back4app: Update LabResult (finalize)
Back4app-->>App: LiveQuery event -> App fetches updated LabResult
App-->>Patient: Alert: "New lab result available"數據字典
病人門戶架構中每個類的全字段級參考。
| 字段 | 類型 | 描述 | 必需 |
|---|---|---|---|
| objectId | String | Auto-generated unique identifier | 自動 |
| user | Pointer<_User> | Linked Back4app user account | |
| medicalRecordNumber | String | Unique MRN for the patient | |
| displayName | String | Patient full name shown in UI | |
| dateOfBirth | Date | Patient date of birth | — |
| primaryClinic | String | Primary clinic or provider group | — |
| isActive | Boolean | Active portal access flag | |
| createdAt | Date | Auto-generated creation timestamp | 自動 |
| updatedAt | Date | Auto-generated last-update timestamp | 自動 |
9 欄位在 PatientProfile
安全性與權限
如何使用 ACL、CLP 和加密策略來保護實驗室結果、治療計劃、訊息和審計日誌。
基於角色的訪問和擁有權
應用 ACL 以便病患可以查看自己的記錄,而 Provider 可以查看分配給病患的資料;CLP 防止未經授權的類別操作。
加密的有效負載和附件
在簽署的 URL 後面存儲敏感 blob(實驗室附件、PDF)並使用儲存級別的加密保護靜態保護。
附加式審計追蹤
從伺服器端的雲端代碼寫入審計日誌條目,以確保用戶無法篡改歷史合規記錄。
結構 (JSON)
原始 JSON 結構定義可複製至 Back4app 或作為實作參考使用。
{
"classes": [
{
"className": "PatientProfile",
"fields": {
"objectId": {
"type": "String",
"required": false
},
"user": {
"type": "Pointer",
"required": true,
"targetClass": "_User"
},
"medicalRecordNumber": {
"type": "String",
"required": true
},
"displayName": {
"type": "String",
"required": true
},
"dateOfBirth": {
"type": "Date",
"required": false
},
"primaryClinic": {
"type": "String",
"required": false
},
"isActive": {
"type": "Boolean",
"required": true
},
"createdAt": {
"type": "Date",
"required": false
},
"updatedAt": {
"type": "Date",
"required": false
}
}
},
{
"className": "LabResult",
"fields": {
"objectId": {
"type": "String",
"required": false
},
"patient": {
"type": "Pointer",
"required": true,
"targetClass": "PatientProfile"
},
"orderedBy": {
"type": "Pointer",
"required": false,
"targetClass": "_User"
},
"testCode": {
"type": "String",
"required": false
},
"testName": {
"type": "String",
"required": true
},
"resultValue": {
"type": "String",
"required": false
},
"units": {
"type": "String",
"required": false
},
"referenceRange": {
"type": "String",
"required": false
},
"status": {
"type": "String",
"required": true
},
"publishedAt": {
"type": "Date",
"required": false
},
"attachments": {
"type": "Array",
"required": false
},
"createdAt": {
"type": "Date",
"required": false
},
"updatedAt": {
"type": "Date",
"required": false
}
}
},
{
"className": "TreatmentPlan",
"fields": {
"objectId": {
"type": "String",
"required": false
},
"patient": {
"type": "Pointer",
"required": true,
"targetClass": "PatientProfile"
},
"createdBy": {
"type": "Pointer",
"required": true,
"targetClass": "_User"
},
"summary": {
"type": "String",
"required": true
},
"details": {
"type": "String",
"required": false
},
"status": {
"type": "String",
"required": true
},
"startDate": {
"type": "Date",
"required": false
},
"endDate": {
"type": "Date",
"required": false
},
"createdAt": {
"type": "Date",
"required": false
},
"updatedAt": {
"type": "Date",
"required": false
}
}
},
{
"className": "Message",
"fields": {
"objectId": {
"type": "String",
"required": false
},
"conversationId": {
"type": "String",
"required": true
},
"from": {
"type": "Pointer",
"required": true,
"targetClass": "_User"
},
"to": {
"type": "Pointer",
"required": true,
"targetClass": "_User"
},
"patient": {
"type": "Pointer",
"required": true,
"targetClass": "PatientProfile"
},
"body": {
"type": "String",
"required": true
},
"attachments": {
"type": "Array",
"required": false
},
"isRead": {
"type": "Boolean",
"required": true
},
"sentAt": {
"type": "Date",
"required": false
},
"createdAt": {
"type": "Date",
"required": false
},
"updatedAt": {
"type": "Date",
"required": false
}
}
},
{
"className": "Appointment",
"fields": {
"objectId": {
"type": "String",
"required": false
},
"patient": {
"type": "Pointer",
"required": true,
"targetClass": "PatientProfile"
},
"provider": {
"type": "Pointer",
"required": true,
"targetClass": "_User"
},
"startAt": {
"type": "Date",
"required": true
},
"endAt": {
"type": "Date",
"required": true
},
"location": {
"type": "String",
"required": false
},
"status": {
"type": "String",
"required": true
},
"reason": {
"type": "String",
"required": false
},
"createdAt": {
"type": "Date",
"required": false
},
"updatedAt": {
"type": "Date",
"required": false
}
}
},
{
"className": "AuditLog",
"fields": {
"objectId": {
"type": "String",
"required": false
},
"actor": {
"type": "Pointer",
"required": true,
"targetClass": "_User"
},
"entityType": {
"type": "String",
"required": true
},
"entityId": {
"type": "String",
"required": true
},
"action": {
"type": "String",
"required": true
},
"summary": {
"type": "String",
"required": true
},
"metadata": {
"type": "Object",
"required": false
},
"createdAt": {
"type": "Date",
"required": false
},
"updatedAt": {
"type": "Date",
"required": false
}
}
}
]
}使用 AI 代理建構
使用 Back4app AI 代理從此模板生成一個病人入口網站應用,包括後端結構、ACL 和啟動前端整合。
在 Back4app 上使用此精確結構和行為建立病人入口網站後端。 結構: 1. 病人資料: 用戶 (指向用戶的指標,必填),全名 (字符串,必填),出生日期 (日期,可選),聯絡 (對象),醫療記錄號碼 (字符串,必填,唯一); objectId, createdAt, updatedAt。 2. Provider 檔案: 用戶 (指向用戶的指標,必填),專科 (字符串),診所 (字符串),聯絡 (對象); objectId, createdAt, updatedAt。 3. 實驗室結果: 病人 (指向病人資料的指標,必填),Provider (指向 Provider 檔案的指標,必填),報告類型 (字符串),結果數據 (對象),報告時間 (日期,必填),版本 (數字,默認為 1),附件 (文件數組),可見性 (字符串: 僅限病人,Provider-僅限,共享); objectId, createdAt, updatedAt。 4. 治療計劃: 病人 (指向病人資料的指標,必填),Provider (指向 Provider 檔案的指標,必填),摘要 (字符串),詳細資訊 (對象),狀態 (字符串: 草稿,啟用,已完成),從 (日期),到 (日期),版本 (數字); objectId, createdAt, updatedAt。 5. 消息: 發件人 (指向用戶的指標,必填),收件人 (指向用戶的指標,必填),線程 ID (字符串,必填),內容 (字符串),附件 (文件數組),狀態 (字符串: 已發送,已送達,已讀),發送時間 (日期); objectId, createdAt, updatedAt。 6. 預約: 病人 (指向病人資料的指標,必填),Provider (指向 Provider 檔案的指標,必填),預定時間 (日期,必填),狀態 (字符串: 已預定,已取消,已完成),地點 (字符串); objectId, createdAt, updatedAt。 7. 審計日誌: 行動者 (指向用戶的指標,必填),行動 (字符串,必填),實體類型 (字符串,必填),實體 ID (字符串,必填),有效負載 (對象,可選),創建時間 (日期); objectId, createdAt, updatedAt。 安全性: - 強制執行 ACL,以便病人只能讀取他們的實驗室結果和治療計劃紀錄。 Provider 可查看分配的病人。使用雲代碼進行敏感的轉換並在伺服器端寫入審計日誌條目。使用簽名 URL 和存儲加密保護附件。 身份驗證: - 支持病人和 Provider 的註冊;角色分配;安全登錄和會話管理。 行為: - 病人登錄,獲取最新的實驗室結果版本和治療計劃,向 Provider 線程發送消息,並接收通知。 Provider 發佈實驗室結果和治療計劃;系統為發佈行動寫入審計日誌條目。 交付: - 包含結構、CLP、ACL、雲代碼鉤子的 Back4app 應用,用於發佈和審計日誌,以及病人和 Provider 檢視的起始前端整合。
按下下面的按鈕以用此模板提示預填來開啟代理。
這是沒有技術後綴的基礎提示。您可以在此後調整生成的前端堆棧。
API 遊樂場
在患者門戶架構中嘗試 REST 和 GraphQL 端點。回應使用模擬數據,無需 Back4app 帳戶。
使用與此模板相同的架構。
選擇你的技術
展開每個卡片以獲取整合步驟、狀態模式、數據模型範例和離線筆記。
Flutter 病人入口網站後端
React 病人入口網站後端
React 原生 病人入口網站後端
Next.js 病人入口網站後端
JavaScript 病人入口網站後端
Android 病人入口網站後端
iOS 病人入口網站後端
Vue 病人入口網站後端
Angular 病人入口網站後端
GraphQL 病人入口網站後端
REST API 病人入口網站後端
PHP 病人入口網站後端
.NET 病人入口網站後端
您每個技術獲得的內容
每個堆疊使用相同的患者入口網站後端架構和 API 合約。
統一的患者數據結構
輕鬆管理和訪問所有患者信息於同一結構中。
為 患者入口 提供安全消息傳遞
促進患者和醫療 Provider 之間的安全交流。
實時預約安排
允許患者無縫預訂和管理預約。
全面的實驗室結果跟踪
使用戶能夠安全地查看和跟踪他們的實驗室結果。
敏感數據的訪問控制
確保只有授權人員能查看患者記錄。
REST/GraphQL API 用於 患者入口
使用靈活的 API 與各種前端輕鬆集成。
患者入口框架比較
比較所有支持的技術的設置速度、SDK 風格和 AI 支持。
| 框架 | 設置時間 | 患者入口好處 | SDK 類型 | AI 支援 |
|---|---|---|---|---|
| 快速(5 分鐘)設置 | 移動和網頁上的患者入口單一代碼庫。 | Typed SDK | 完整 | |
| ~5 分鐘 | 患者入口的快速網頁儀表板。 | Typed SDK | 完整 | |
| 大約 5 分鐘 | 患者入口的跨平台移動應用程式。 | Typed SDK | 完整 | |
| 少於 5 分鐘 | 患者入口的伺服器渲染網頁應用程式。 | Typed SDK | 完整 | |
| ~3 分鐘 | 輕量級的患者入口網頁集成。 | Typed SDK | 完整 | |
| 快速(5 分鐘)設置 | 患者入口的原生 Android 應用程式。 | Typed SDK | 完整 | |
| ~5 分鐘 | 患者入口的原生 iOS 應用程式。 | Typed SDK | 完整 | |
| 大約 5 分鐘 | React 的患者入口網頁 UI。 | Typed SDK | 完整 | |
| 少於 5 分鐘 | 企業版的患者入口網頁應用程式。 | Typed SDK | 完整 | |
| 快速(2 分鐘)設置 | 靈活的 GraphQL API 用於患者入口。 | GraphQL API | 完整 | |
| ~2 分鐘 | REST API 集成用於患者入口。 | REST API | 完整 | |
| 少於 5 分鐘 | 用於患者入口的伺服器端 PHP 後端。 | REST API | 完整 | |
| 大約 5 分鐘 | .NET 用於患者入口的後端。 | Typed SDK | 完整 |
設置時間反映從項目啟動到第一位病人登錄及使用此模板架構查詢實驗室結果的預期持續時間。
常見問題
有關使用此模板構建患者入口網站後端的常見問題。