querying-openfda-labels
하는 일
이 스킬은 무료 OpenFDA 서비스에서 미국 FDA의 공식 약물 정보를 조회하는 방법을 에이전트에게 가르칩니다. 처방 라벨 세부 정보, 패키지 코드, 회수 보고서를 다룹니다.
사용하는 경우
- ✓약품의 공식 박스 경고나 승인된 용도가 필요할 때.
- ✓약품의 패키지 코드나 제형이 필요할 때.
- ✓약품에 진행 중인 회수가 있는지 확인하고 싶을 때.
스킬 링크
https://github.com/maziyarpanahi/openmed/blob/master/skills/querying-openfda-labels/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제가 조사 중인 이 약의 박스 경고와 승인된 용도를 조회해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 공개 OpenFDA 웹 서비스에 라벨, 제품 코드, 회수 데이터를 검색하고, 일치하는 항목을 사람이 읽을 수 있는 사실로 보고합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
OpenFDA를 무료로 쓸 수 있나요?
네. 스킬은 OpenFDA가 공개되어 있고 무료라고 설명합니다.
브랜드명의 일반명을 찾을 수 있나요?
네. 라벨 데이터에는 상품명, 일반명, RxCUI 코드가 포함되어 있습니다.
의학적 조언인가요?
아닙니다. 스킬은 라벨 조회가 사람에게 정보를 제공할 뿐 치료를 처방하지는 않는다고 설명합니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 5.8k
- 순위
- #14721
- 라이선스
- 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, 카드 번호, 이메일, 날짜 같은 식별자를 검사하고, 남은 것이 있으면 공개를 막도록 돕습니다.
비슷한 스킬
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
slacrawl
394k에이전트가 로컬 Slack 보관본에서 메시지를 검색하고 개수를 세며, 보관본이 얼마나 최신인지 확인하고 필요할 때 새로 고치도록 돕습니다.
goplaces
394k에이전트가 Google Places로 장소를 검색하고, 세부 정보와 리뷰를 가져오고, 장소 이름을 확인하며, 스크립트용 JSON을 출력하도록 돕습니다.