mapping-loinc
ما الذي تفعله
تربط هذه المهارة أسماء الفحوص المخبرية والملاحظات، مثل بوتاسيوم المصل أو ضغط الدم، بأكواد LOINC، وهي الأكواد القياسية لما جرى قياسه. وتستخدم خدمات مصطلحات عامة مجانية. وهي موجهة للفرق التي ترمّز نتائج المختبر لقابلية التشغيل البيني.
متى تستخدمها
- ✓عندما تحتاج أسماء الفحوص أو علامات الحياة في الملاحظات إلى كود LOINC قياسي.
- ✓عندما يجب تحديد العينة أو الطريقة للفحص لاختيار كود LOINC الصحيح.
- ✓عندما يجب بناء ملاحظة مختبرية من US Core مع فحص مرمّز.
رابط المهارة
https://github.com/maziyarpanahi/openmed/blob/master/skills/mapping-loinc/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“اربط أسماء الفحوص في هذا التقرير بأكواد LOINC، بما في ذلك العينة، وأضف وحدات UCUM.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يبحث وكيلك عن كل اسم في خدمة مصطلحات FHIR عامة، ويتحقق من المكوّن والعينة والطريقة، ثم يعيد كود LOINC المطابق مع وحداته.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Mapping lab/observation names to LOINC
Ground free-text lab and observation names that OpenMed surfaces to LOINC (Logical Observation Identifiers Names and Codes), the universal standard for identifying what was measured. A LOINC code is a fully specified observation — not just an analyte but the full six-axis model: Component, Property, Time, System (specimen), Scale, Method.
LOINC is free to use. It is published by the Regenstrief Institute under the
LOINC license: you accept terms-of-use (and register to download the table), but
there is no fee and no per-use restriction. The standard, public path for
license-clean mapping is a FHIR terminology server exposing LOINC via
$lookup / $validate-code, or Regenstrief's hosted fhir.loinc.org.
When to use
- A note or report contains lab/observation names ("serum potassium", "hemoglobin A1c", "blood pressure") and you need a stable LOINC code each.
- You must disambiguate by specimen/system ("glucose in serum" vs "glucose in urine") or method ("HbA1c by HPLC").
- You need UCUM units to pair with the result value, or a US Core
Observation(Laboratory Result) coded with LOINC. - You are mapping a panel (e.g. CBC, BMP) vs its individual analytes.
For diagnoses/procedures use coding-icd10; for drugs use normalizing-rxnorm;
LOINC is for observations and measurements.
Quick start (real LOINC / FHIR terminology calls)
Regenstrief hosts a public FHIR terminology endpoint at https://fhir.loinc.org
(HTTP Basic auth with your free LOINC account). Many sites instead point at their
own server (HAPI, Ontoserver, Snowstorm-with-LOINC). The operations are the same.
import requests
from requests.auth import HTTPBasicAuth
FHIR = "https://fhir.loinc.org"
AUTH = HTTPBasicAuth("YOUR_LOINC_USER", "YOUR_LOINC_PASSWORD") # free account
LOINC_SYSTEM = "http://loinc.org"
def lookup(code: str) -> dict:
"""$lookup: return the fully specified name + axes for a LOINC code."""
r = requests.get(
f"{FHIR}/CodeSystem/$lookup",
params={"system": LOINC_SYSTEM, "code": code},
auth=AUTH, headers={"Accept": "application/fhir+json"}, timeout=15,
)
r.raise_for_status()
return r.json()
def validate(code: str, display: str) -> bool:
r = requests.get(
f"{FHIR}/CodeSystem/$validate-code",
params={"url": LOINC_SYSTEM, "code": code, "display": display},
auth=AUTH, headers={"Accept": "application/fhir+json"}, timeout=15,
)
r.raise_for_status()
params = {p["name"]: p.get("valueBoolean") for p in r.json().get("parameter", [])}
return bool(params.get("result"))
print(lookup("2823-3")) # Potassium [Moles/volume] in Serum or Plasma
Search candidate LOINC codes from a text name with the Regenstrief search API
(https://loinc.org/search/) or a ValueSet/$expand filter on your server:
def expand_filter(text: str, count: int = 10) -> list[dict]:
"""Text-filter the LOINC code system to candidate concepts."""
r = requests.get(
f"{FHIR}/ValueSet/$expand",
params={"url": "http://loinc.org/vs", "filter": text, "count": count},
auth=AUTH, headers={"Accept": "application/fhir+json"}, timeout=20,
)
r.raise_for_status()
return r.json().get("expansion", {}).get("contains", [])
Workflow
- Extract observation/analyte mentions with OpenMed.
- Assemble the axes you have from surrounding text: component (what), specimen/system (serum, urine, blood), method (HPLC, immunoassay), and scale (quantitative vs ordinal). More axes → a more specific, correct LOINC.
- Search candidates via
$expand?filter=(or Regenstrief search). - Disambiguate by matching specimen and property. "Glucose" alone is ambiguous; "glucose, serum, mass/volume" resolves to one code.
- Validate the chosen code with
$validate-code, then$lookupto pull the long common name and the canonical UCUM example unit. - Emit
{system: "http://loinc.org", code, display}plus the UCUM unit for the result value, into a US Core Observation.
Hand-off from OpenMed
openmed.analyze_text(..., output_format="dict") returns entities, each a dict
with text, label, confidence, start, end. Lab analytes often surface
under Chemical/Disease models; run the relevant model and feed the spans in:
import openmed
note = "Labs: serum potassium 5.1 mmol/L, hemoglobin A1c 7.8
الأسئلة الشائعة
هل LOINC مجاني؟
نعم. يمكن استخدامه مجاناً وفق شروط ترخيصه، دون رسوم.
هل يرمّز التشخيصات أيضاً؟
لا. تستخدم التشخيصات مهارة ICD-10، وتستخدم الأدوية مهارة RxNorm.
أي وحدات يرفقها؟
يرفق وحدات UCUM لتقترن بقيمة كل نتيجة.
التفاصيل
الوصف الأصلي من المؤلف
Maps laboratory and clinical observation names extracted by OpenMed to LOINC codes using the public Regenstrief LOINC and FHIR terminology APIs. Use when the user wants to code lab tests, vital signs, or observations to LOINC, resolve a test name plus specimen and method to the correct LOINC part-model code, attach UCUM units, or build a US Core Laboratory Result Observation. Trigger keywords: LOINC, lab coding, observation code, UCUM units, specimen, method, US Core lab, FHIR Observation, lab result mapping, panel vs analyte. Pairs after OpenMed NER: consume Disease/Chemical/lab-name entities
repo: maziyarpanahi/openmed
الشعبية
- نجوم GitHub
- 5.8k
- الترتيب
- #14711
- الترخيص
- 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يساعد وكيلك على البحث عن المقالات العلمية في المجال الطبي الحيوي. مفيد للبحوث التي تحتاج إلى معلومات طبية محددة.