Skip to main content

Terminology Search

Try medterm4ds terminology operations right here, against a live public endpoint: the terminology-demo Space, running the native medterm4ds FHIR R4 terminology API — the same app you can self-host, not a simplified convenience layer.

Search modes​

  • Lexical matches the words you typed. Fast and exact: "heart attack" finds concepts whose names contain those words — but it cannot find "myocardial infarction" from "heart attack".
  • Semantic matches the meaning. An embedding model (SapBERT) understands that "heart attack" and "myocardial infarction" are the same thing, so it finds concepts the exact words would miss.
  • Canonical goes one step further: it groups codes from different code systems that mean the same thing (SNOMED CT, ICD-10-CM, LOINC, RxNorm…) into one anchored value-set card, with a patient-friendly name — "heart attack" resolves to one card joining all the codes for myocardial infarction.

The API also offers a hybrid mode (lexical + semantic combined) — see the CapabilityStatement.

Try the demo​

Good to know

The Space sleeps when idle; the first request after sleep can take up to ~2 minutes to wake — the form stays disabled and tells you what is happening until it is really ready. CPT is excluded from everything this demo serves, due to AMA licensing. The demo allows 30 requests/minute per IP; for anything heavier, self-host. This page calls the Space directly from your browser (this site is static) — the Space's origin allow-list decides which websites may call it, which is a courtesy filter, not authentication.

🔎 Checking the terminology server…

The demo runs your query through lexical, semantic and canonical at once so you can see the differences on your own terms (top 3 per mode, best result per mode highlighted).

Annotations​

Paste a clinical note and press Extract concepts: each identified term is highlighted in the note with its assertion status — mint for affirmed, lavender for family history (identified, but about a relative), rose with strikethrough for negated — followed inline by its resolved concept, patient-friendly name and code.

Native FHIR R4 operations​

Every call the demo makes is a standard FHIR R4 operation with a Parameters request body. The server's CapabilityStatement lists everything it serves; the demo uses:

OperationFHIR requestWhat it does
Term searchPOST /fhir/CodeSystem/$searchquery + searchMode = lexical | semantic | canonical | hybrid; returns a searchset Bundle of codings with score + match-grade on each entry
Note extractionPOST /fhir/CodeSystem/$extracttext → a Bundle of concepts found by GLiNER + medspaCy NER, each with span, type, status and canonical id
Code detailPOST /fhir/CodeSystem/$lookupsystem + code → Parameters with display, name and properties (incl. the UMLS CUI)
Code mappingPOST /fhir/ConceptMap/$translatesystem + code + targetSystem → Parameters with equivalence-rated matches
CapabilitiesGET /fhir/metadatathe CapabilityStatement

The server also carries $validate-code, $subsumes, $closure, ValueSet/$expand, batch/transaction POST /fhir, and resource-level reads — all unmodified from medterm4ds.create_fhir_app.

POST /fhir/CodeSystem/$search
{
"resourceType": "Parameters",
"parameter": [
{"name": "query", "valueString": "heart attack"},
{"name": "searchMode", "valueCode": "semantic"},
{"name": "count", "valueInteger": 3}
]
}
{
"resourceType": "Bundle",
"type": "searchset",
"total": 3,
"entry": [
{
"fullUrl": "CodeSystem/http://snomed.info/sct-22298006",
"resource": {
"system": "http://snomed.info/sct",
"code": "22298006",
"display": "Myocardial infarction"
},
"search": {
"mode": "match",
"score": 1.0,
"extension": [
{"url": "http://fhir4ds.org/fhir/StructureDefinition/match-grade",
"valueCode": "certain"}
]
}
}
]
}

Running your own​

This demo is a Docker Space wrapping medterm4ds.create_fhir_app. Everything is in the repo under deploy/hf-spaces/terminology-demo/ (Dockerfile, wrapper app, README with the deploy runbook, licence notices and access-control details). See Docker deployment for self-hosting, or use the FHIR server recipe for a FHIR-native surface.