Medication
prescriptionOne 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
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
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. | Patient |
encounter_id
Prescribed in
|
string |
Foreign key to the Encounter where the medication was prescribed. | Visit |
code
Coded as
|
string |
Medication code from RxNorm. | 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
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.