extract-clinical-entities-to-fhir
하는 일
이 스킬은 합성 또는 비식별화된 텍스트에서 임상 개체를 추출하고, 이를 Condition이나 Observation 같은 FHIR R4 리소스로 매핑합니다. 승인된 출처에서만 코드를 붙여 로컬 임상 텍스트에서 구조화된 FHIR 출력이 필요한 개발자를 위한 스킬입니다.
사용하는 경우
- ✓에이전트가 임상 텍스트를 FHIR Condition이나 Observation 리소스로 바꿔야 할 때.
- ✓추출을 임상 코딩 결정과 분리해서 유지하고 싶을 때.
- ✓원본 텍스트가 합성이거나 이미 비식별화되었을 때.
스킬 링크
https://github.com/maziyarpanahi/openmed/blob/master/skills/extract-clinical-entities-to-fhir/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 합성 노트에서 진단을 추출하고, 각 진단을 Bundle 안의 FHIR Condition으로 바꿔 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 개체 추출을 실행하고, 신뢰도 기준을 넘는 승인된 라벨만 남기며, 각 개체를 리소스 유형에 매핑한 뒤 Bundle을 조립합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Extract clinical entities to FHIR
Separate extraction from clinical coding. OpenMed finds spans and supplies the mechanical FHIR builders; the application decides which resource type and status are clinically appropriate.
Procedure
- Keep the source synthetic, or de-identify it inside the trusted boundary before extraction.
- Run
openmed.analyze_textwith the task-appropriate clinical model. - Filter predictions by label and confidence; preserve offsets in a PHI-safe audit record.
- Map each accepted span to the correct FHIR resource type.
- Add terminology codes only from a user-approved mapping or terminology service. Never invent a code.
- Assemble resources with
to_bundleand validate against the target profile.
Runnable synthetic example
Install the model runtime first with python -m pip install "openmed[hf]".
import json
from openmed import analyze_text
from openmed.clinical.exporters.fhir import to_bundle
note = "Assessment: type 2 diabetes mellitus is stable on metformin."
result = analyze_text(
note,
model_name="disease_detection_superclinical",
confidence_threshold=0.5,
)
resources = [{"resourceType": "Patient", "id": "synthetic-patient"}]
for index, entity in enumerate(result.entities, start=1):
if entity.label.upper() not in {"CONDITION", "DIAGNOSIS", "DISEASE"}:
continue
resources.append(
{
"resourceType": "Condition",
"id": f"condition-{index}",
"clinicalStatus": {
"coding": [
{
"system": (
"http://terminology.hl7.org/CodeSystem/"
"condition-clinical"
),
"code": "active",
}
]
},
"verificationStatus": {
"coding": [
{
"system": (
"http://terminology.hl7.org/CodeSystem/"
"condition-ver-status"
),
"code": "confirmed",
}
]
},
# A text-only CodeableConcept is preferable to an invented code.
"code": {"text": entity.text},
"subject": {"reference": "Patient/synthetic-patient"},
}
)
if len(resources) == 1:
raise RuntimeError("No condition spans met the label and confidence rules")
bundle = to_bundle(resources, doc_id="synthetic-note-001")
print(json.dumps(bundle, indent=2))
Safety checks
- Do not put raw identifiers, source text, or reversible mappings in logs,
OperationOutcome.diagnostics, or trace metadata. - Keep a patient identity service separate from extracted clinical facts.
- Preserve negation, temporality, and experiencer context before asserting a resource as active or confirmed.
- Use a text-only
CodeableConceptwhen no approved code is available. - Validate the Bundle against the receiver's FHIR and profile requirements.
- Do not bundle restricted terminologies; use the user's licensed service.
Repository example
Read and run the redaction-to-FHIR walkthrough for an offline-friendly pipeline with deterministic extraction.
자주 묻는 질문
ICD-10 같은 코드를 스스로 붙이나요?
아니요. 코드는 사용자가 승인한 매핑이나 용어 서비스에서만 가져옵니다.
어떤 텍스트가 허용되나요?
합성 텍스트이거나, 추출 전에 신뢰 경계 안에서 비식별화된 텍스트여야 합니다.
출력을 검사하나요?
목표 프로필에 맞춰 리소스를 검증하라고 안내합니다.
상세 정보
작성자의 원본 설명
Extract clinical entities from synthetic or already de-identified text with OpenMed and map them into deterministic FHIR R4 resources and a Bundle. Use when an agent must turn local clinical NER output into Conditions, MedicationStatements, Observations, or other FHIR resources without inventing terminology codes.
repo: maziyarpanahi/openmed
인기도
- GitHub 스타
- 5.8k
- 순위
- #14698
- 라이선스
- 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, 카드 번호, 이메일, 날짜 같은 식별자를 검사하고, 남은 것이 있으면 공개를 막도록 돕습니다.
비슷한 스킬
discrawl
394k에이전트가 저장된 로컬 Discord 메시지 보관본을 검색하고 요약하며, 최신 상태를 확인하고 다이렉트 메시지를 읽도록 돕습니다.
clickhouse-io
280k에이전트가 ClickHouse 데이터베이스의 쿼리와 스키마를 최적화하도록 돕습니다. 고성능 분석 작업의 모범 사례를 적용합니다. 분석 쿼리가 느릴 때 씁니다.
scientific-db-pubmed-database
280k생의학 분야의 과학 논문을 에이전트가 검색하도록 돕습니다. 특정 의학 정보가 필요한 연구에 유용합니다.