본문으로 건너뛰기
Skillpedia
데이터베이스5.8k · #14698

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/maziyarpanahi/openmed/blob/master/skills/extract-clinical-entities-to-fhir/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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

  1. Keep the source synthetic, or de-identify it inside the trusted boundary before extraction.
  2. Run openmed.analyze_text with the task-appropriate clinical model.
  3. Filter predictions by label and confidence; preserve offsets in a PHI-safe audit record.
  4. Map each accepted span to the correct FHIR resource type.
  5. Add terminology codes only from a user-approved mapping or terminology service. Never invent a code.
  6. Assemble resources with to_bundle and 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 CodeableConcept when 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬