scaffolding-smart-on-fhir
Fungsinya
Skill ini mengajari agent cara membangun aplikasi web yang terbuka di dalam sistem rekam kesehatan elektronik rumah sakit. Skill ini mencakup langkah masuk yang aman dan izin yang diminta aplikasi.
Kapan dipakai
- βSaat tim ingin alat klinisi yang terbuka dari dalam Epic atau Oracle Health.
- βSaat pengembang membutuhkan urutan masuk OAuth dengan PKCE untuk peluncuran EHR.
- βSaat proyek berencana mengambil catatan klinis lewat FHIR dan memprosesnya di perangkat lokal.
Link skill
https://github.com/maziyarpanahi/openmed/blob/master/skills/scaffolding-smart-on-fhir/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBantu saya membuat aplikasi yang terbuka dari dalam bagan Epic kami dan membaca catatan klinis pasien dengan aman.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent menyiapkan permintaan peluncuran, penemuan pengaturan server, pertukaran masuk, dan cakupan izin. Setelah catatan diambil, aplikasi bisa memprosesnya secara lokal.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apakah ini juga berfungsi untuk aplikasi mandiri?
Ya. Skill mencakup peluncuran EHR dari dalam bagan dan peluncuran mandiri.
Apa itu PKCE?
Itu langkah masuk yang lebih aman, yang disebut skill wajib di SMART App Launch v2.
EHR mana yang disebutkan?
Skill menyebut Epic dan Cerner atau Oracle Health sebagai sistem target.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 5.8k
- Peringkat
- #14730
- Lisensi
- Apache-2.0
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
annotating-variants
5.8kMembantu agent Anda memperkirakan apa yang dilakukan varian genetik, mengubah nama HGVS menjadi posisi genom, dan menambahkan frekuensi populasi, dengan memakai anotator publik yang gratis.
ask-openmed
5.8kMembantu agent Anda memilih alur kerja OpenMed yang tepat untuk permintaan teks klinis, dimulai dengan pemeriksaan privasi setiap kali data pasien mungkin ada.
assembling-fhir-bundles
5.8kMengemas beberapa rekam kesehatan FHIR menjadi satu Bundle transaksi yang siap dikirim ke EHR, dengan referensi internal yang terhubung dengan benar.
auditing-deid-leakage
5.8kMemindai teks klinis yang sudah dihapus identitasnya untuk mencari pengenal yang tertinggal, seperti nomor SSN, nomor kartu, email, dan tanggal, dan memblokir rilis jika masih ada.
Skill serupa
api-connector-builder
280kMembuat agent Anda membangun koneksi API baru mengikuti pola yang sudah ada. Gunakan saat ingin menambah integrasi lagi tanpa membuat cara baru.
api-design
280kMembantu agent Anda merancang REST API sesuai praktik terbaik. Berguna untuk mengatur cara API berkomunikasi, menampilkan error, dan mengorganisasi data.
backend-patterns
280kMembantu agent Anda dengan pola arsitektur sisi server dan optimasi database. Berguna untuk membangun atau meninjau kode yang berjalan di server.