extract-clinical-entities-to-fhir
ما الذي تفعله
تستخرج هذه المهارة الكيانات السريرية من نص اصطناعي أو مُزال الهوية، وتحوّلها إلى موارد FHIR R4 مثل Condition أو Observation. وهي موجهة للمطورين الذين يحتاجون إلى مخرجات FHIR منظمة من نص طبي محلي، مع إضافة الرموز من مصادر معتمدة فقط.
متى تستخدمها
- ✓عندما يجب أن يحوّل الوكيل النص السريري إلى موارد FHIR من نوع Condition أو Observation.
- ✓عندما تريد فصل الاستخراج عن قرارات الترميز السريري.
- ✓عندما يكون النص المصدر اصطناعياً أو سبق إزالة هويته.
رابط المهارة
https://github.com/maziyarpanahi/openmed/blob/master/skills/extract-clinical-entities-to-fhir/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“من هذه الملاحظة الاصطناعية، استخرج التشخيصات وحوّل كل تشخيص إلى مورد FHIR من نوع Condition داخل Bundle.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يشغّل وكيلك استخراج الكيانات، ويبقي التسميات المقبولة فوق عتبة ثقة، ويعيّن كل تسمية إلى نوع مورد، ثم يجمع الـ 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
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
annotating-variants
5.8kيساعد وكيلك على توقع تأثير المتغير الجيني، وتحويل أسماء HGVS إلى مواضع في الجينوم، وإضافة ترددات السكان، باستخدام أدوات تعليق عامة ومجانية.
ask-openmed
5.8kيساعد وكيلك على اختيار سير عمل OpenMed المناسب لطلب نصوص سريرية، مع البدء دائمًا بفحص الخصوصية عندما تحتمل وجود بيانات مرضى.
assembling-fhir-bundles
5.8kيجمع عدة سجلات صحية بصيغة FHIR في حزمة (Bundle) واحدة للمعاملات، جاهزة للإرسال إلى EHR، مع ربط المراجع الداخلية بشكل صحيح.
auditing-deid-leakage
5.8kيفحص النصوص السريرية التي أُزيلت هويتها بحثًا عن معرّفات متبقية، مثل أرقام الضمان الاجتماعي وأرقام البطاقات والبريد الإلكتروني والتواريخ، ويوقف النشر إذا بقي أي منها.
مهارات مشابهة
discrawl
394kيتيح لوكيلك البحث في أرشيف محلي محفوظ لرسائل Discord وتلخيصه، والتحقق من مدى حداثته، وقراءة الرسائل المباشرة.
clickhouse-io
280kيساعد وكيلك على تحسين الاستعلامات والمخططات في ClickHouse وتطبيق أفضل ممارسات التحليل عالي الأداء، ويفيد عندما تكون الاستعلامات التحليلية بطيئة.
scientific-db-pubmed-database
280kيساعد وكيلك على البحث عن المقالات العلمية في المجال الطبي الحيوي. مفيد للبحوث التي تحتاج إلى معلومات طبية محددة.