Skip to main content

Visit

encounter

Clinical events with date, reason, attending provider, care site, diagnoses, medications, and procedures.

648,047 records · 15 data fields · 9 relationships

Explore records
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
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 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. Each visit has exactly one patient; each patient has one or many visits. Patient
provider_id Attended by string Foreign key to the Provider. Each visit has exactly one provider; each provider has zero or many visits. Provider
organization_id At care site string Foreign key to the Organization. Each visit has exactly one care site; each care site has zero or many visits. 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. Each visit has exactly one payer; each payer has one or many visits. 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

  • Each visit has zero or many diagnoses; each diagnosis has exactly one visit. Diagnosis foreign key diagnosis.encounter_id on each diagnosis
  • Each visit has zero or many medications; each medication has exactly one visit. Medication foreign key prescription.encounter_id on each medication
  • Each visit has zero or many procedures; each procedure has exactly one visit. Procedure foreign key procedure_record.encounter_id on each procedure
  • Each visit has zero or many care plans; each care plan has exactly one visit. Care plan foreign key careplan.encounter_id on each care plan
  • Each visit has one or many claims; each claim has exactly one visit. Claim foreign key claim.encounter_id on 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

visits at Catholic Eldercare

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.