Skip to main content

Medication concept

medication

Medication codes, each shared across patients, with the medications filed under it.

349 records · 7 data fields · 2 relationships

Explore records
Source: medications.csv → table medication → displayed as Medication concept why?

This data originates from Synthea as medications (medications.csv), folded to one row per code, is stored in the medication SurrealDB table, and displayed as Medication concept: the code that every medication prescribed with it is filed under.

Relationship map — Medication concept highlighted
Has visit Attended by At care site Recorded diagnosis Prescribed Included procedure Has care plan Addresses diagnosis Practices at Started care plan Billed as Has claim Billed to Primary Secondary Has expense year Covered by Has diagnosis Has medication Has procedure PatientDIM · ACTOR GRAIN VisitFACT · EVENT GRAIN Diagnosis conceptDIM · CODE GRAIN DiagnosisFACT · EVENT GRAIN Medication conceptDIM · CODE GRAIN MedicationFACT · EVENT GRAIN Procedure conceptDIM · CODE GRAIN ProcedureFACT · EVENT GRAIN ProviderDIM · ACTOR GRAIN Care planFACT · EVENT GRAIN Care siteDIM · ACTOR GRAIN ClaimFACT · EVENT GRAIN PayerDIM · ACTOR GRAIN Expense yearFACT · YEAR ROLLUP Coded as Coded as Coded as

Click any node to explore its schema. Highlighted relationships connect to or from Medication concept.

Field definitions

searched as a name searched as an address searched as an identifier searched as prose feeds the semantic embedding

Field Type Description
code string Medication code from RxNorm.
description folded into this row’s embedding string Description of the medication.
base_cost_median option<float> Median line-item cost across every prescription of this medication — a concept-grain summary of BASE_COST, computed at import time rather than one representative row.
base_cost_min option<float> Lowest line-item cost observed for this medication, across every prescription.
base_cost_max option<float> Highest line-item cost observed for this medication, across every prescription.
base_cost_samples option<int> The number of prescriptions the median/min/max above are computed over.
record_id string The clinical code this record represents, same value as the code column — the natural key every row sharing this code was deduplicated onto.

Referenced by

Records that hold this record’s id, or are linked through an edge table

  • Each medication concept has one or many patients; each patient has zero or many medication concepts. Patient edge table has_medication — one row per patient and medication concept
  • Each medication concept has one or many medications; each medication has exactly one medication concept. Medication code prescription.code on each medication

Semantic search

Each medication concept stores embedding: a vector of 384 numbers computed at import from description — the field marked as folded into the embedding above. Search’s Vector and Hybrid tabs match a query against it by meaning, through the index hnsw_medication.

Provenance where this row came from · 7 fields

Field Type Description
source_table string Synthea CSV this row was read from.
source_snapshot_id string Corpus generation this row belongs to.
ingest_run_id string Import run that wrote the row.
generation_run_id string Synthea run that produced the source CSV.
load_timestamp datetime When the row was written.
source_role string Role this source played for the record.
contributing_sources option<array<string>> Other rows that contributed to this record.

Collapsed here because a reader came for what medication concept means, not where one row came from — that question is the substance of every medication concept record's own Provenance page, reachable from any medication concept record.

Types are SurrealDB's own: option<T> means the value may be absent. Full reference: SurrealDB data types.

Try asking

Real values from Medication concept records. Click to search.

Beyond text search

patients prescribed both Metformin and Hydrocodone

Answering this means walking patient → has medication concept → two medication concepts. The three shipped search arms — BM25, HNSW, RRF fusion — match text inside one table, so none can.