Skip to main content

Medication

prescription

One medication prescribed at one visit: the drug's code, when it started and stopped, what it cost, and the reason recorded for it.

483,475 records · 13 data fields · 3 relationships

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

This data originates from Synthea as medications (medications.csv), one row per row, is stored in the prescription SurrealDB table, and displayed as Medication for clinical-domain familiarity.

Relationship map — Medication 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.

Field definitions

opens the record when pasted into search points at another record, named under Links to

Field Type Description Links to
patient_id Medication of string Foreign key to the Patient. Each medication has exactly one patient; each patient has zero or many medications. Patient
encounter_id Prescribed in string Foreign key to the Encounter where the medication was prescribed. Each medication has exactly one visit; each visit has zero or many medications. Visit
code Coded as string Medication code from RxNorm. Each medication has exactly one medication concept; each medication concept has one or many medications. Medication concept Pages only
description string Description of the medication.
start datetime The date and time the medication was prescribed.
stop option<datetime> The date and time the prescription ended, if applicable.
reason_code option<string> Diagnosis code from SNOMED-CT specifying why this medication was prescribed.
reason_description option<string> Description of the reason code.
base_cost option<float> The line item cost of the medication.
dispenses option<int> The number of times the prescription was filled.
total_cost option<float> The total cost of the prescription, including all dispenses.
payer_coverage option<float> The amount covered or reimbursed by the Payer.
record_id string This medication's identity, built at import from its visit's id, its code and its start and stop times — the source export gives the row no id of its own.

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 means, not where one row came from — that question is the substance of every medication record's own Provenance page, reachable from any medication record.

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

Not searchable

A medication is reached from its visit, its patient or its medication concept, or by pasting its id; search finds the concept.

Beyond text search

what else happened at this medication's visit

Answering this means walking medication → prescribed in → visit. The three shipped search arms — BM25, HNSW, RRF fusion — match text inside one table, so none can.