Hospital sample database — MongoDB, embedded (287,518 rows)

Tables that belong to another are folded into it as arrays, so the documents read the way the application uses them. The rest are collections of their own, joined by key as in the flat version.

Load it:
  sh import.sh                    (into mongodb://localhost:27017)
  sh import.sh "<connection string>"

Or one collection at a time: mongoimport --db hospital --collection <name> --file <name>.ndjson

Collections:
  admissions — 2,000 documents
  allergies — 20 documents
  appointments — 100,000 documents
  beds — 600 documents
  billing — 20,000 documents, each with its billing_items
  departments — 12 documents
  doctors — 80 documents
  insurance_policies — 4,000 documents
  insurance_providers — 10 documents
  inventory_categories — 8 documents
  inventory_items — 150 documents
  lab_requests — 12,000 documents
  lab_results — 11,000 documents
  lab_tests — 40 documents
  medical_records — 25,000 documents
  medications — 120 documents
  patients — 8,000 documents, each with its patient_allergies
  payments — 18,000 documents
  prescriptions — 15,000 documents, each with its prescription_items
  purchase_orders — 100 documents, each with its purchase_order_items
  rooms — 200 documents
  schedules — 2,000 documents
  staff — 200 documents
  staff_roles — 8 documents
  surgeries — 30 documents
  surgical_procedures — 400 documents
  vendors — 20 documents
  visitors — 3,000 documents
  wards — 20 documents

Folded in (no collection of their own):
  billing_items — 40,000 rows, as the "billing_items" array on billing (its billing_id is the parent's _id)
  patient_allergies — 3,000 rows, as the "patient_allergies" array on patients (its patient_id is the parent's _id)
  prescription_items — 22,000 rows, as the "prescription_items" array on prescriptions (its prescription_id is the parent's _id)
  purchase_order_items — 500 rows, as the "purchase_order_items" array on purchase_orders (its purchase_order_id is the parent's _id)

Types: numeric columns are Decimal128, so totals stay exact; dates and timestamps are
Date values read as UTC (the data has no time zone); times and UUIDs are strings;
JSON columns are embedded objects.

Synthetic data, CC0-1.0, from databasesample.com. The same rows as the SQL and CSV files.
