scaffolding-smart-on-fhir
하는 일
이 스킬은 병원 전자의무기록 안에서 열리는 웹 앱을 설정하는 방법을 에이전트에게 가르칩니다. 안전한 로그인 단계와 앱이 요청하는 권한을 다룹니다.
사용하는 경우
- ✓Epic이나 Oracle Health 안에서 열리는 임상의 도구를 만들려고 할 때.
- ✓EHR 실행을 위해 PKCE가 포함된 OAuth 로그인 순서가 필요할 때.
- ✓FHIR을 통해 임상 노트를 가져오고 로컬 기기에서 처리하려는 프로젝트일 때.
스킬 링크
https://github.com/maziyarpanahi/openmed/blob/master/skills/scaffolding-smart-on-fhir/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“우리 Epic 차트 안에서 열리고 환자의 임상 노트를 안전하게 읽는 앱을 설정하도록 도와주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 실행 요청, 서버 설정 탐색, 로그인 교환, 범위를 설정합니다. 노트를 가져온 뒤에는 앱이 로컬에서 처리할 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Scaffolding SMART on FHIR
To put an OpenMed-powered tool inside a clinician's EHR (Epic, Cerner/Oracle Health), you build a SMART on FHIR app: a web app the EHR launches with an OAuth2 flow, granting scoped, time-limited access to the patient's FHIR data. The app fetches the clinical notes, then runs OpenMed on-device (de-id + NER) — so PHI is processed locally and only de-identified output, if anything, leaves the browser/host.
When to use
Reach for this when the deliverable is a clinician-facing app embedded in an
EHR, or a standalone app authorizing against an EHR's FHIR endpoint. Triggers:
"SMART on FHIR", "EHR launch", "OAuth2 scopes", "Epic/Cerner app",
"embed OpenMed in the chart". For pulling notes at cohort scale (no UI), use
exporting-bulk-fhir instead.
Two launch flows
- EHR launch — clinician clicks your app in the chart. The EHR opens your
launch_uri?iss=<fhir-base>&launch=<opaque>; you complete OAuth2 and inherit the current patient/encounter context. - Standalone launch — user opens your app directly; it discovers the FHIR server and runs OAuth2, and the user/EHR picks the patient.
Both use SMART App Launch v2: OAuth2 authorization code flow with PKCE
(required in v2), discovered via .well-known/smart-configuration.
Quick start: the launch sequence
1. EHR launch URL:
GET https://app.example/launch?iss=https://ehr.example/fhir&launch=abc123
2. Discover endpoints:
GET https://ehr.example/fhir/.well-known/smart-configuration
-> { "authorization_endpoint": ".../authorize",
"token_endpoint": ".../token",
"code_challenge_methods_supported": ["S256"],
"capabilities": ["launch-ehr","client-public","context-ehr-patient", ...] }
3. Redirect the browser to authorize (PKCE + the launch token):
GET .../authorize?
response_type=code&
client_id=YOUR_CLIENT_ID&
redirect_uri=https://app.example/callback&
scope=launch openid fhirUser patient/DocumentReference.rs patient/Patient.r&
state=RANDOM&
aud=https://ehr.example/fhir&
launch=abc123&
code_challenge=BASE64URL(SHA256(verifier))&
code_challenge_method=S256
4. Callback -> exchange code for token:
POST .../token
grant_type=authorization_code&code=...&redirect_uri=...&
client_id=...&code_verifier=ORIGINAL_VERIFIER
-> { "access_token": "...", "token_type": "Bearer", "expires_in": 3600,
"scope": "patient/DocumentReference.rs ...",
"patient": "Patient-123", "encounter": "Encounter-9",
"id_token": "..." }
5. Call FHIR with the token:
GET https://ehr.example/fhir/DocumentReference?patient=Patient-123&type=clinical-note
Authorization: Bearer <access_token>
The token response carries the launch context (patient, sometimes
encounter, and in v2 a fhirContext array). Use patient to scope every
subsequent query.
Scopes you actually need
SMART v2 scopes are <level>/<Resource>.<permissions> where permissions are a
subset of c r u d s (create/read/update/delete/search) — .rs = read +
search. Request the minimum:
| Scope | Why |
|---|---|
launch |
EHR launch context (omit for standalone; use launch/patient) |
openid fhirUser |
Identify the launching user |
patient/Patient.r |
The in-context patient demographics |
patient/DocumentReference.rs |
Read + search the patient's clinical notes |
patient/Condition.rs |
(optional) reconcile against existing problems |
offline_access |
(optional) refresh token for background work |
Prefer patient/… (current-patient) over user/… (everything the user can see)
to keep the blast radius small. Granular v2 scopes (.rs) are stricter than the
v1 .read/.write forms — use them.
Where OpenMed runs
Notes arrive as DocumentReference → content.attachment (often base64 or a
url to a Binary). Decode, then process locally:
import base64, openmed
note_b64 = document_reference["content"][0]["attachment"]["data"]
note = base64.b64decode(note_b64).decode("utf-8")
# De-identify on-device before anything else touches it
deid = openmed.deidentify(note, method="replace", policy="hipaa_safe_harbor")
# Clinical NER on the (de-identified or raw, per your IRB) text
entities = openmed.analyze_text(deid.text, model_name="disease_detection_superclinical")
# -> render highlights in the SMART app UI, or export FHIR (exporting-to-fhir)
OpenMed models run on
자주 묻는 질문
독립형 앱에도 쓸 수 있나요?
네. 차트에서 하는 EHR 실행과 독립 실행을 모두 다룹니다.
PKCE는 무엇인가요?
SMART App Launch v2에서 필요하다고 스킬이 설명하는 더 안전한 로그인 단계입니다.
어떤 EHR을 언급하나요?
대상 시스템으로 Epic과 Cerner 또는 Oracle Health를 언급합니다.
상세 정보
작성자의 원본 설명
Scaffold a SMART-on-FHIR app (SMART App Launch v2 — EHR launch and standalone launch, OAuth2 PKCE, scopes, token handling, fhirContext) so an OpenMed-powered tool can run inside Epic or Cerner/Oracle Health. Covers the .well-known/smart-configuration discovery, authorize/token sequence, scopes like patient/DocumentReference.rs and launch/patient, and fetching clinical notes the app then de-identifies and runs NER on locally with OpenMed. Use when the user wants to embed OpenMed inside an EHR, mentions SMART on FHIR, OAuth2 launch, scopes, Epic/Cerner app, or clinician-facing FHIR app. Pairs ad
repo: maziyarpanahi/openmed
인기도
- GitHub 스타
- 5.8k
- 순위
- #14730
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
annotating-variants
5.8k에이전트가 유전 변이의 효과를 예측하고, HGVS 이름을 게놈 위치로 바꾸고, 무료 공개 주석 도구를 사용해 인구 빈도를 붙이도록 돕습니다.
ask-openmed
5.8k에이전트가 임상 텍스트 요청에 맞는 OpenMed 워크플로를 고르도록 돕되, 환자 데이터가 있을 수 있으면 먼저 개인 정보 확인을 거치게 합니다.
assembling-fhir-bundles
5.8k여러 FHIR 건강 기록을 EHR로 보낼 수 있도록 하나의 트랜잭션 Bundle로 묶고, 내부 참조를 올바르게 연결하도록 에이전트를 돕습니다.
auditing-deid-leakage
5.8k비식별화된 임상 텍스트에 남은 SSN, 카드 번호, 이메일, 날짜 같은 식별자를 검사하고, 남은 것이 있으면 공개를 막도록 돕습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.