querying-openfda-labels
Fungsinya
Skill ini mengajari agent cara mencari informasi obat resmi FDA Amerika Serikat di layanan OpenFDA yang gratis. Skill ini mencakup detail label resep, kode kemasan, dan laporan penarikan produk.
Kapan dipakai
- βSaat pengguna membutuhkan peringatan kotak hitam atau indikasi yang disetujui untuk suatu obat secara resmi.
- βSaat pengguna ingin kode kemasan atau bentuk sediaan untuk produk obat.
- βSaat pengguna ingin memeriksa apakah suatu obat memiliki penarikan yang masih terbuka.
Link skill
https://github.com/maziyarpanahi/openmed/blob/master/skills/querying-openfda-labels/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
βBisakah Anda mencari peringatan kotak hitam dan indikasi yang disetujui untuk obat yang sedang saya teliti ini?β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent mengirim pencarian ke layanan web OpenFDA publik untuk data label, kode produk, dan penarikan. Agent melaporkan bidang yang cocok sebagai fakta untuk dibaca orang.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Querying OpenFDA drug labels, NDC, and recalls
Once OpenMed has pulled a drug name out of a note, you often need authoritative product facts: the boxed warning, approved indications, dosage form / route, package NDC codes, and whether the product is under recall. The FDA's OpenFDA API exposes the Structured Product Labeling (SPL), the NDC directory, and enforcement (recall) reports β all public and free.
This skill is enrichment: it attaches regulatory facts to an extracted drug. It is not clinical decision support β a label lookup informs a human, it does not prescribe.
When to use
- You extracted a drug and need its boxed warning or indications for display, alerting, or expectedness checks.
- You need NDC package codes, dosage form, or route for a product.
- You want to know if a drug/lot is under an open recall (enforcement).
- You want to map a brand name to its generic ingredient and RxCUI via the
label's
openfdablock.
The three endpoints
| Endpoint | Use | Key fields |
|---|---|---|
https://api.fda.gov/drug/label.json |
SPL prescribing info | boxed_warning, indications_and_usage, warnings, dosage_and_administration, openfda.brand_name, openfda.generic_name, openfda.rxcui, openfda.product_ndc |
https://api.fda.gov/drug/ndc.json |
NDC directory | product_ndc, generic_name, brand_name, dosage_form, route, active_ingredients |
https://api.fda.gov/drug/enforcement.json |
Recalls | product_description, reason_for_recall, classification (Class I/II/III), recalling_firm, status, recall_initiation_date |
No key needed to try it (240 req/min, 1,000/day per IP). A free api_key= raises
the daily cap to 120,000.
Quick start (real OpenFDA queries)
import requests
def openfda(endpoint: str, search: str, limit: int = 1) -> list[dict]:
url = f"https://api.fda.gov/drug/{endpoint}.json"
r = requests.get(url, params={"search": search, "limit": limit}, timeout=30)
if r.status_code == 404: # OpenFDA returns 404 for zero matches
return []
r.raise_for_status()
return r.json().get("results", [])
# 1) Label: boxed warning + indications for a generic drug.
label = openfda("label", 'openfda.generic_name:"warfarin"')
if label:
rec = label[0]
print("Boxed warning:", rec.get("boxed_warning", ["(none)"])[0][:200])
print("Indication:", rec.get("indications_and_usage", ["(none)"])[0][:200])
print("RxCUI:", rec.get("openfda", {}).get("rxcui"))
# 2) NDC: package codes, form, route.
ndc = openfda("ndc", 'generic_name:"warfarin"', limit=5)
for rec in ndc:
print(rec["product_ndc"], rec.get("dosage_form"), rec.get("route"))
# 3) Enforcement: open recalls for a product.
recalls = openfda("enforcement",
'product_description:"warfarin"+AND+status:"Ongoing"', limit=5)
for rec in recalls:
print(rec["classification"], "-", rec["reason_for_recall"][:120])
Workflow
- Normalize the drug name first. Use
openmed.analyze_textto get the span, then prefer the RxNorm ingredient (seenormalizing-rxnorm) as your query term βopenfda.generic_nameand the NDCgeneric_nameindex on the ingredient, so a normalized name hits far more records than raw note text. - Query
/drug/labelwithopenfda.generic_name:"<ingredient>"(oropenfda.rxcui:"<rxcui>"for an exact product). Readboxed_warning,indications_and_usage,warnings_and_cautions. - Query
/drug/ndcfor package-level codes, dosage form, and route. - Query
/drug/enforcementfiltered tostatus:"Ongoing"to surface open recalls; gate alerts onclassification(Class I = most serious). - Cache results β labels change rarely; you do not need to re-query per note.
- Attach the facts to the extracted drug keyed by RxCUI/NDC for traceability.
Hand-off to / from OpenMed
OpenMed's analyze_text returns a dict; result["entities"] items carry
text, label, confidence, start, end.
- From
extracting-clinical-entities: Pharmaceutical/Chemical entities are the query seeds. Fromnormalizing-rxnorm: pass the RxCUI toopenfda.rxcui:"..."for an exact label match. - To
reporting-adverse-events: the boxed warning / indications support an expectedness judgment (is this reaction labeled?). Todetecting-pv-signals: confirm whether a disproportionality signal is already
Pertanyaan umum
Apakah OpenFDA gratis?
Ya. Skill menyebut OpenFDA sebagai publik dan gratis.
Bisakah ini mencari nama generik dari merek dagang?
Bisa. Data label mencakup nama dagang, nama generik, dan kode RxCUI.
Apakah ini nasihat medis?
Tidak. Skill menyatakan bahwa pencarian label menginformasikan orang dan tidak meresepkan pengobatan.
Detail
Deskripsi asli dari pembuat
Looks up FDA drug labels, NDC directory entries, indications, boxed warnings, and recalls/enforcement actions via the free public OpenFDA API to enrich drugs that OpenMed extracts. Use when the user wants the prescribing information for a drug, its boxed warning, approved indications, dosage forms and routes, package NDC codes, RxCUI, or whether a product has an open recall. Trigger keywords: OpenFDA, drug label, SPL, prescribing information, boxed warning, black box warning, indications, NDC, package code, recall, enforcement, Class I recall, drug enrichment. Pairs adjacent to OpenMed NER: ta
repo: maziyarpanahi/openmed
Popularitas
- Bintang GitHub
- 5.8k
- Peringkat
- #14721
- 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
gitcrawl
394kMemungkinkan agent Anda mencari arsip issue dan pull request GitHub yang tersimpan, mengelompokkan yang duplikat, dan memeriksa status terkininya di GitHub.
slacrawl
394kMemungkinkan agent Anda mencari dan menghitung pesan di arsip Slack lokal, memeriksa seberapa baru arsip itu, dan menyegarkannya bila diperlukan.
goplaces
394kMembantu agent Anda mencari tempat, mendapatkan detail dan ulasannya, serta menentukan nama tempat memakai Google Places, dengan keluaran JSON untuk skrip.