querying-openfda-labels
Skill này làm gì
Skill này dạy agent cách tra cứu thông tin thuốc chính thức của FDA Hoa Kỳ trong dịch vụ OpenFDA miễn phí. Nó bao quát chi tiết nhãn kê đơn, mã gói và các báo cáo thu hồi.
Khi nào nên dùng
- ✓Khi người dùng cần cảnh báo khung đen chính thức hoặc các chỉ định đã được phê duyệt của một loại thuốc.
- ✓Khi người dùng muốn mã gói hoặc dạng bào chế của một sản phẩm thuốc.
- ✓Khi người dùng muốn kiểm tra xem một thuốc có đang bị thu hồi hay không.
Liên kết skill
https://github.com/maziyarpanahi/openmed/blob/master/skills/querying-openfda-labels/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể tra cứu cảnh báo khung đen và các chỉ định đã được phê duyệt của loại thuốc tôi đang nghiên cứu không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent gửi tìm kiếm tới dịch vụ web OpenFDA công khai để lấy dữ liệu nhãn, mã sản phẩm và thu hồi. Nó báo cáo các trường khớp như sự kiện để người đọc xem xét.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
OpenFDA có miễn phí không?
Có. Skill mô tả OpenFDA là công khai và miễn phí.
Nó có tìm được tên gốc của một thương hiệu không?
Có. Dữ liệu nhãn bao gồm tên thương hiệu, tên gốc và mã RxCUI.
Đây có phải lời khuyên y tế không?
Không. Skill nói rằng tra cứu nhãn chỉ cung cấp thông tin cho người đọc và không kê đơn điều trị.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 5.8k
- Vị trí xếp hạng
- #14721
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
annotating-variants
5.8kGiúp agent dự đoán tác động của biến thể di truyền, đổi tên HGVS sang vị trí bộ gen và gắn tần suất quần thể bằng công cụ chú giải miễn phí.
ask-openmed
5.8kGiúp agent chọn đúng quy trình OpenMed cho yêu cầu về văn bản lâm sàng, luôn kiểm tra quyền riêng tư trước khi có thể có dữ liệu bệnh nhân.
assembling-fhir-bundles
5.8kGói nhiều bản ghi y tế FHIR thành một Bundle giao dịch để gửi tới EHR, với các tham chiếu nội bộ được liên kết đúng.
auditing-deid-leakage
5.8kQuét văn bản lâm sàng đã khử nhận dạng để tìm định danh còn sót như SSN, số thẻ, email và ngày tháng, và chặn phát hành nếu còn sót.
Skill tương tự
gitcrawl
394kCho phép agent của bạn tìm trong kho lưu trữ issue và pull request GitHub, gom các mục trùng lặp và kiểm tra trạng thái hiện tại trên GitHub.
slacrawl
394kCho phép agent của bạn tìm và đếm tin nhắn trong kho lưu trữ Slack cục bộ, kiểm tra kho đó mới đến mức nào và làm mới khi cần.
goplaces
394kGiúp agent của bạn tìm địa điểm, lấy chi tiết và đánh giá, và xác định tên địa điểm bằng Google Places, với đầu ra JSON cho script.