臺灣中醫實作指引
0.1.0 - ci-build
臺灣中醫實作指引, published by 衛生福利部國家中醫藥研究所. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/nricmig/Nricm_TWCMIG/ and changes regularly. See the Directory of published versions
SMART App Launch實作指引定義了一套基於OAuth 2.0的授權與驗證模式,讓應用程式能與FHIR系統安全地整合。本章節說明依循臺灣中醫實作指引(TWCM IG)之伺服端在支援前端應用程式(User-Facing Applications)與後端服務(Backend Services)時,所需遵循的SMART on FHIR規範要求與支援能力。
為了促進互通性,SMART on FHIR定義了一組核心能力。伺服器需公開支援的能力,並組合成「能力集合(Capability Set)」,以因應特定使用情境。
若伺服端需支援前端應用程式(例如醫院中醫部門或中醫診所之應用程式),建議應該(SHOULD)支援下列能力集合:
若伺服端需支援後端服務(例如醫療機構資訊系統自動上傳中醫門診單Bundle至FHIR Server),則必須(SHALL)支援下列能力:
client-confidential-asymmetricpermission-v2伺服端必須(SHALL)支援SMART App Launch IG中所定義的存取權限檢驗 (Token Introspection)。
<patient|user|system>/<fhir-resource>.<c|r|u|d|s>[?param=value]
patient = 以病人身分存取病人的資料user = 以使用者(如中醫師)身分情境存取病人資料(例如中醫師於院內系統查詢病人之中醫門診紀錄)system = 系統對系統之間存取資料(例如醫療機構資訊系統批次上傳中醫門診單Bundle)c = 新增(create)r = 讀取(read)u = 更新(update)d = 刪除(delete)s = 查詢(search)下列存取範圍係依據臺灣中醫實作指引-伺服端(TWCM Server)能力聲明所定義之互動(interaction)及查詢參數(search parameter)訂定。
| Resource型別 | 存取範圍 |
|---|---|
| Bundle | system/Bundle.cru |
| Resource型別 | 存取範圍 |
|---|---|
| Bundle | system/Bundle.s |
| Patient | system/Patient.crus |
| Composition | system/Composition.crus |
| AllergyIntolerance | system/AllergyIntolerance.cru |
| CarePlan | system/CarePlan.cru |
| ClinicalImpression | system/ClinicalImpression.cru |
| Condition | system/Condition.cru |
| DiagnosticReport | system/DiagnosticReport.cru |
| DocumentReference | system/DocumentReference.cru |
| Encounter | system/Encounter.cru |
| FamilyMemberHistory | system/FamilyMemberHistory.cru |
| Medication | system/Medication.cru |
| MedicationRequest | system/MedicationRequest.cru |
| Observation | system/Observation.cru |
| Organization | system/Organization.cru |
| Practitioner | system/Practitioner.cru |
| Procedure | system/Procedure.cru |
| Provenance | system/Provenance.cru |
| ServiceRequest | system/ServiceRequest.cru |
前端應用程式若以使用者或病人身分存取資料,可以(MAY)將上述存取範圍之主體替換為user或patient(例如user/Bundle.rs、patient/Composition.rs),並依其實際授權情境限縮可執行之操作類型。
/.well-known/smart-configuration功能除了在伺服端之能力聲明所定義的能力外,伺服端必須(SHALL)於Well-Known Uniform Resource Identifiers (URIs)的JSON檔中,描述其SMART能力。
依據SMART App Launch指引,以下為必要欄位:
issuer (conditional)jwks_uri (conditional)authorization_endpoint (conditional)grant_types_supportedtoken_endpointcapabilitiescode_challenge_methods_supportedscopes_supportedintrospection_endpoint/.well-known/smart-configuration範例下列範例中之網址皆為示意用途,實作者應依其實際部署之授權伺服器網址填寫。
HTTP/1.1 200 OK
Content-Type: application/json
{
"issuer": "https://fhir.example.org",
"jwks_uri": "https://fhir.example.org/.well-known/jwks.json",
"authorization_endpoint": "https://fhir.example.org/auth/authorize",
"token_endpoint": "https://fhir.example.org/auth/token",
"token_endpoint_auth_methods_supported": [
"client_secret_basic",
"private_key_jwt"
],
"grant_types_supported": [
"authorization_code",
"client_credentials"
],
"registration_endpoint": "https://fhir.example.org/auth/register",
"introspection_endpoint": "https://fhir.example.org/auth/introspect",
"scopes_supported": [
"openid",
"fhirUser",
"launch",
"launch/patient",
"offline_access",
"system/Bundle.cru",
"system/Bundle.s",
"system/Patient.crus",
"system/Composition.crus"
],
"response_types_supported": ["code"],
"management_endpoint": "https://fhir.example.org/user/manage",
"revocation_endpoint": "https://fhir.example.org/user/revoke",
"code_challenge_methods_supported": ["S256"],
"capabilities": [
"launch-ehr",
"launch-standalone",
"permission-patient",
"permission-user",
"permission-v2",
"client-public",
"client-confidential-symmetric",
"client-confidential-asymmetric",
"context-ehr-patient",
"context-standalone-patient",
"sso-openid-connect"
]
}