Visit
encounterClinical events with date, reason, attending provider, care site, diagnoses, medications, and procedures.
648,047 records · 15 data fields · 9 relationships
Source: encounters.csv → table encounter → displayed as Visit why?
This data originates from Synthea as encounters (encounters.csv), is stored in the encounter SurrealDB table, and displayed as Visit for clinical-domain familiarity.
Relationship map — Visit highlighted
Click any node to explore its schema. Highlighted relationships connect to or from Visit.
Field definitions
opens the record when pasted into search points at another record, named under Links to
| Field | Type | Description | Links to |
|---|---|---|---|
patient_id
Made by
|
string |
Foreign key to the Patient. | Patient |
provider_id
Attended by
|
string |
Foreign key to the Provider. | Provider |
organization_id
At care site
|
string |
Foreign key to the Organization. | Care site |
encounter_class
|
string |
The class of the encounter, such as ambulatory, emergency, inpatient, wellness, or urgentcare. | |
code
|
string |
Encounter code from SNOMED-CT. | |
description
|
string |
Description of the type of encounter. | |
reason_code
|
option<string> |
Diagnosis code from SNOMED-CT, only if this encounter targeted a specific condition. | |
reason_description
|
option<string> |
Description of the reason code. | |
start
|
datetime |
The date and time the encounter started. | |
stop
|
option<datetime> |
The date and time the encounter concluded. | |
payer
Billed to
|
option<string> |
Foreign key to the Payer. | Payer |
base_encounter_cost
|
option<float> |
The base cost of the encounter, not including any line item costs related to medications, immunizations, procedures, or other services. | |
total_claim_cost
|
option<float> |
The total cost of the encounter, including all line items. | |
payer_coverage
|
option<float> |
The amount of cost covered by the Payer. | |
record_id
|
string |
This encounter's source id, stored verbatim — the single value that opens this record when pasted into search. |
Referenced by
Records that hold this record’s id
-
Diagnosis
foreign key
diagnosis.encounter_idon each diagnosis -
Medication
foreign key
prescription.encounter_idon each medication -
Procedure
foreign key
procedure_record.encounter_idon each procedure -
Care plan
foreign key
careplan.encounter_idon each care plan -
Claim
foreign key
claim.encounter_idon each claim
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 visit means, not where one row came from — that question is the substance of every visit record's own Provenance page, reachable from any visit record.
Types are SurrealDB's own: option<T> means
the value may be absent. Full reference:
SurrealDB data types.
Not searchable
Visits carry no search index, by design — one row is a single dated event, and the conditions and procedures it records are already searchable at finer grain on their own tables. Reach a visit from the records browser, from the patient it belongs to, or by pasting its id into search.
Beyond text search
Answering this means walking encounter → at care site → organization. The three shipped search arms — BM25, HNSW, RRF fusion — match text inside one table, so none can.