agentsclimarketplace

Medical ontology code mapping

Skill rbr7/MedClawMini/skills/medical-ontology-code-mapping

A focused, production-minded library of 197 clinical-AI and healthcare data-science skills for the OpenClaw agent platform featuring data quality, clinical NLP, big-data ML, explainable AI, drug safety, and regulatory.

Install
npx -y skills add rbr7/MedClawMini --skill medical-ontology-code-mapping

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Normalize and map free-text or inconsistently coded medical data to standard healthcare ontologies and code systems ICD-10-CM/PCS, CPT/HCPCS, SNOMED CT, RxNorm, NDC, LOINC, and UMLS CUIs. Provides text-to-code normalization, code-to-code crosswalks (e.g., NDC↔RxNorm, ICD-9↔ICD-10, SNOMED↔ICD-10), validity checking, and ontology-graph navigation (hierarchy, synonyms, relationships). Use to standardize dirty diagnosis/procedure/drug fields, harmonize vocabularies across sources, or build a healthcare business ontology layer.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

5.0 KB, as published. Nobody here has run it

Medical Ontology & Code Mapping

Overview

Healthcare data is only as interoperable as its vocabularies. The same condition may be a free-text string in one feed, an ICD-9 code in another, and a SNOMED CT concept in a third. This skill builds the terminology normalization layer mapping messy inputs to canonical concepts and crosswalking between code systems so that records become joinable, groupable, and analyzable. It is the "healthcare-specific business ontology" backbone for data-quality and analytics work.

When to Use This Skill

  • Standardizing dirty diagnosis, procedure, or drug free-text into coded concepts.
  • Crosswalking between vocabularies: NDC↔RxNorm, ICD-9↔ICD-10, SNOMED↔ICD-10, local codes → standard codes.
  • Validating that codes exist, are billable/active, and are used in the right context.
  • Grouping codes into clinical categories (CCSR, ATC drug classes, value sets).
  • Navigating an ontology graph parents, children, synonyms, relationships.

Code Systems Covered

SystemDomainTypical use
ICD-10-CM / PCSDiagnoses / inpatient proceduresClaims, risk adjustment
CPT / HCPCSProfessional procedures / suppliesClaims
SNOMED CTClinical concepts (broad)EHR, interoperability
RxNormNormalized drug namesMedication reconciliation
NDCPackaged drug productsPharmacy claims
LOINCLabs & observationsResults data
UMLS CUICross-vocabulary concept hubMapping across systems

Workflow

  1. Detect the field type (dx vs. procedure vs. drug vs. lab) and current state (free-text vs. coded, which system).
  2. Normalize text lowercase, expand abbreviations, strip dose/route noise; for drugs parse ingredient/strength/form.
  3. Map to canonical concepts: exact/synonym lookup first, then fuzzy/lexical match (e.g., RxNorm approximateTerm, UMLS MetaMap-style), keeping a confidence score.
  4. Crosswalk via UMLS CUI or official maps (GEMs for ICD-9↔10, RxNorm relations for NDC↔ingredient, SNOMED→ICD-10 map).
  5. Validate code exists, is active for the service date, billable, and context- appropriate; flag retired or non-billable codes.
  6. Group into analytic categories (CCSR, ATC, custom value sets) for rollups.

Example

# RxNorm + ICD via public APIs (no key required for RxNav / Clinical Tables)
import requests

def ndc_to_rxnorm(ndc):
    r = requests.get(f"https://rxnav.nlm.nih.gov/REST/ndcstatus.json?ndc={ndc}").json()
    return r.get("ndcStatus", {}).get("rxcui")

def normalize_drug(text):
    r = requests.get("https://rxnav.nlm.nih.gov/REST/approximateTerm.json",
                     params={"term": text, "maxEntries": 1}).json()
    cand = r["approximateGroup"]["candidate"][0]
    return cand["rxcui"], cand["score"]

def search_icd10(query):  # NLM Clinical Tables typeahead
    r = requests.get("https://clinicaltables.nlm.nih.gov/api/icd10cm/v3/search",
                     params={"sf": "code,name", "terms": query}).json()
    return r[3]      # [[code, name], ...]

rxcui, conf = normalize_drug("lipitor 20 mg tab")   # -> ('617312', 95)
codes = search_icd10("type 2 diabetes")             # -> [['E11.9','Type 2 diabetes...'], ...]

Outputs

  • mapped_codes.parquet input value → canonical code, system, display, confidence.
  • crosswalk.parquet source code/system → target code/system with map provenance.
  • unmapped_review.csv low-confidence or unresolved inputs for clerical review.
  • mapping_report.md coverage %, confidence distribution, top unmapped terms.

Healthcare Context

This is the vocabulary layer that makes claims/EHR data trustworthy and joinable. It feeds healthcare-data-quality-profiling (validity rules), patient-record-entity- resolution (standardized coded fields), and downstream modeling. Map confidence should be retained end-to-end so low-confidence mappings can be audited.

References

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.