{
  "format": "dataset-manifest/1",
  "slug": "hospital-management-system",
  "version": 3,
  "seed": "hospital-management-system:1",
  "engine": 1,
  "engineVersion": "1.0.0",
  "spec": {
    "format": "dataset/1",
    "slug": "hospital-management-system",
    "name": "Healthcare Management Insights",
    "tagline": "Patient records, visit logs, lab results, billing details, and department information from a hospital management system.",
    "description": "A hospital operates as a complex, interconnected system where patient care is delivered through various departments and specialized staff. This dataset models key aspects of managing patient admissions, tracking lab results, coordinating surgeries, and handling billing and insurance processes. With a focus on patient interactions, the data captures routine procedures and rare cases that require detailed tracking, such as specialized surgeries or uncommon allergies. The tables include patients, visits, departments, lab_results, and billing, providing a holistic view of operations. Each table relates to others, allowing for in-depth analysis of patient journeys and care processes. It is synthetic data, enabling developers to practice SQL queries and ORM seeding without concerns over real patient information.",
    "domain": "healthcare",
    "shape": "transactional",
    "useCases": [
      "sql-practice",
      "orm-seeding"
    ],
    "keywords": [
      "healthcare",
      "hospital",
      "patient management",
      "lab results",
      "billing",
      "insurance",
      "departments",
      "surgeries"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "patients": {
        "description": "This table holds information about patients, including demographics and contact details. Each patient can have multiple visits.",
        "rows": 200,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each patient."
          },
          "first_name": {
            "kind": "firstName",
            "description": "The patient's first name."
          },
          "last_name": {
            "kind": "lastName",
            "description": "The patient's last name."
          },
          "dob": {
            "kind": "date",
            "from": "1940-01-01",
            "to": "2005-12-31",
            "description": "Date of birth of the patient.",
            "trend": "growing"
          },
          "gender": {
            "kind": "enum",
            "values": [
              "male",
              "female",
              "other"
            ],
            "description": "Gender of the patient.",
            "weights": [
              6,
              4,
              1
            ]
          },
          "contact_number": {
            "kind": "phone",
            "description": "Contact number for the patient.",
            "nullable": true,
            "when": {
              "column": "gender",
              "in": [
                "male",
                "female",
                "other"
              ]
            }
          },
          "email": {
            "kind": "email",
            "from": [
              "first_name",
              "last_name"
            ],
            "description": "Email address of the patient.",
            "nullable": true,
            "when": {
              "column": "gender",
              "in": [
                "male",
                "female",
                "other"
              ]
            }
          }
        }
      },
      "visits": {
        "description": "Records details about each patient's visit to the hospital, linking to the patient and department involved.",
        "rows": 600,
        "via": "patient_id",
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each visit."
          },
          "patient_id": {
            "kind": "fk",
            "ref": "patients.id",
            "description": "Reference to the patient who made the visit."
          },
          "department_id": {
            "kind": "fk",
            "ref": "departments.id",
            "description": "Reference to the department where the visit occurred."
          },
          "visit_date": {
            "kind": "datetime",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date and time of the visit.",
            "dayProfile": "waking",
            "trend": "seasonal"
          },
          "reason_for_visit": {
            "kind": "sentence",
            "min": 5,
            "max": 200,
            "description": "Brief description of the reason for the visit.",
            "nullable": true
          },
          "visit_duration_minutes": {
            "kind": "int",
            "min": 15,
            "max": 240,
            "distribution": "normal",
            "description": "Duration of the visit in minutes."
          },
          "follow_up_required": {
            "kind": "bool",
            "trueRate": 0.4,
            "description": "Indicates if a follow-up visit is required."
          },
          "visit_outcome": {
            "kind": "enum",
            "values": [
              "resolved",
              "ongoing",
              "refer to specialist"
            ],
            "weights": [
              50,
              30,
              20
            ],
            "description": "Outcome of the visit."
          }
        }
      },
      "departments": {
        "description": "Contains information about various hospital departments, each handling specific patient care needs.",
        "rows": 10,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each department."
          },
          "name": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "Name of the department.",
            "pool": [
              "cardiology",
              "neurology",
              "pediatrics",
              "oncology",
              "radiology",
              "orthopedics",
              "dermatology",
              "urology",
              "emergency",
              "psychiatry",
              "gastroenterology",
              "endocrinology",
              "anesthesiology",
              "pathology",
              "pulmonology",
              "internal",
              "family",
              "surgery",
              "rehabilitation",
              "nursing"
            ]
          },
          "head": {
            "kind": "fullName",
            "description": "Head of the department.",
            "nullable": true
          },
          "contact_number": {
            "kind": "phone",
            "description": "Contact number for the department.",
            "nullable": true
          }
        }
      },
      "lab_results": {
        "description": "Tracks lab tests ordered during visits, linking results to patients and visits.",
        "rows": 300,
        "via": "visit_id",
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each lab result."
          },
          "visit_id": {
            "kind": "fk",
            "ref": "visits.id",
            "description": "Reference to the visit during which the lab test was ordered."
          },
          "test_name": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "Name of the lab test.",
            "pool": [
              "blood",
              "urine",
              "xray",
              "ct",
              "mri",
              "biopsy",
              "culture",
              "panel",
              "screening",
              "test",
              "serology",
              "imaging",
              "genetic",
              "metabolic",
              "electrocardiogram",
              "echocardiogram",
              "cholesterol",
              "glucose",
              "hemoglobin",
              "thyroid",
              "liver"
            ]
          },
          "result": {
            "kind": "sentence",
            "min": 5,
            "max": 200,
            "description": "Result of the lab test.",
            "nullable": true
          },
          "result_date": {
            "kind": "datetime",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date when the lab result was generated.",
            "dayProfile": "business"
          }
        }
      },
      "billing": {
        "description": "Contains billing information related to each visit, including charges and insurance details.",
        "rows": 600,
        "via": "visit_id",
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each billing record."
          },
          "visit_id": {
            "kind": "fk",
            "ref": "visits.id",
            "description": "Reference to the visit associated with this billing."
          },
          "total_charge": {
            "kind": "decimal",
            "min": 100,
            "max": 20000,
            "scale": 2,
            "description": "Total charge for the visit.",
            "distribution": "long-tail"
          },
          "insurance_provider": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "Name of the insurance provider.",
            "nullable": true,
            "pool": [
              "medicare",
              "medicaid",
              "bluecross",
              "blueshield",
              "aetna",
              "cigna",
              "humana",
              "kelsey",
              "unitedhealth",
              "anthem",
              "wellcare",
              "healthnet",
              "tricare",
              "scripps",
              "guardian",
              "metlife",
              "liberty",
              "celtic",
              "evercare",
              "molina",
              "ambetter"
            ]
          },
          "amount_covered": {
            "kind": "decimal",
            "min": 0,
            "max": 20000,
            "scale": 2,
            "description": "Amount covered by insurance.",
            "nullable": true,
            "distribution": "long-tail"
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "categorical",
      "timestamped",
      "nullable",
      "high-cardinality"
    ],
    "analysisQuestions": [
      "What is the average charge per visit across different departments?",
      "How many lab tests are ordered per patient visit on average?",
      "What are the most common reasons for patient visits?",
      "Which department has the highest number of patient visits?",
      "How does insurance coverage affect the total billing amount?"
    ],
    "suggestedQueries": [
      {
        "title": "Join Patients and Visits",
        "sql": "SELECT patients.first_name, patients.last_name, visits.visit_date FROM patients JOIN visits ON patients.id = visits.patient_id;",
        "dialect": "postgres"
      },
      {
        "title": "Count Visits by Department",
        "sql": "SELECT departments.name, COUNT(visits.id) FROM visits JOIN departments ON visits.department_id = departments.id GROUP BY departments.name;",
        "dialect": "postgres"
      },
      {
        "title": "Average Charge per Visit",
        "sql": "SELECT AVG(billing.total_charge) FROM billing;",
        "dialect": "postgres"
      },
      {
        "title": "Lab Tests and Results per Visit",
        "sql": "SELECT visits.visit_date, COUNT(lab_results.id) FROM visits LEFT JOIN lab_results ON visits.id = lab_results.visit_id GROUP BY visits.visit_date;",
        "dialect": "postgres"
      },
      {
        "title": "Insurance Coverage Analysis",
        "sql": "SELECT billing.insurance_provider, SUM(billing.amount_covered) FROM billing GROUP BY billing.insurance_provider;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Healthcare Analytics",
        "body": "Data analysts in healthcare can utilize this dataset to derive insights about patient visits, departmental performance, and billing trends. Analyzing the data can help identify areas for operational improvement and enhance patient care strategies."
      },
      {
        "title": "Insurance Analysis",
        "body": "Insurance companies can leverage the billing data to evaluate coverage patterns and the financial implications of various treatments. Understanding the relationship between patient visits and insurance claims can help streamline claims processing and policy adjustments."
      },
      {
        "title": "Operational Efficiency",
        "body": "Hospital administrators can use this dataset to assess departmental workloads and patient flow. By examining visit frequencies and lab test orders, they can optimize staffing and resource allocation to improve patient outcomes and operational efficiency."
      },
      {
        "title": "Patient Care Improvement",
        "body": "Healthcare providers can analyze the reasons for patient visits and lab results to enhance treatment protocols. Identifying common ailments and their treatments can lead to improved patient education and preventive care measures."
      }
    ]
  },
  "counts": {
    "departments": 10,
    "patients": 200,
    "visits": 600,
    "billing": 600,
    "lab_results": 300
  },
  "stats": {
    "patients": {
      "rows": 200,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "first_name": {
          "nulls": 0,
          "distinct": 77,
          "min": "Alice",
          "max": "Zoe"
        },
        "last_name": {
          "nulls": 0,
          "distinct": 79,
          "min": "Adams",
          "max": "Zhang"
        },
        "dob": {
          "nulls": 0,
          "distinct": 199,
          "min": "1941-10-04",
          "max": "2005-09-10"
        },
        "gender": {
          "nulls": 0,
          "distinct": 3,
          "min": "female",
          "max": "other"
        },
        "contact_number": {
          "nulls": 0,
          "distinct": 192
        },
        "email": {
          "nulls": 0,
          "distinct": 199
        }
      }
    },
    "visits": {
      "rows": 600,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 600,
          "min": 1,
          "max": 600
        },
        "patient_id": {
          "nulls": 0,
          "distinct": 189,
          "min": 1,
          "max": 200
        },
        "department_id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "visit_date": {
          "nulls": 0,
          "distinct": 600,
          "min": "2020-01-01 20:53:31",
          "max": "2023-12-26 17:38:15"
        },
        "reason_for_visit": {
          "nulls": 59,
          "distinct": 536
        },
        "visit_duration_minutes": {
          "nulls": 0,
          "distinct": 142,
          "min": 31,
          "max": 218
        },
        "follow_up_required": {
          "nulls": 0,
          "distinct": 2,
          "min": "false",
          "max": "true"
        },
        "visit_outcome": {
          "nulls": 0,
          "distinct": 3,
          "min": "ongoing",
          "max": "resolved"
        }
      }
    },
    "departments": {
      "rows": 10,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "name": {
          "nulls": 0,
          "distinct": 10
        },
        "head": {
          "nulls": 1,
          "distinct": 9,
          "min": "Amir Singh",
          "max": "Victor Taylor"
        },
        "contact_number": {
          "nulls": 1,
          "distinct": 9
        }
      }
    },
    "lab_results": {
      "rows": 300,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 300,
          "min": 1,
          "max": 300
        },
        "visit_id": {
          "nulls": 0,
          "distinct": 236,
          "min": 2,
          "max": 596
        },
        "test_name": {
          "nulls": 0,
          "distinct": 212
        },
        "result": {
          "nulls": 28,
          "distinct": 272
        },
        "result_date": {
          "nulls": 0,
          "distinct": 300,
          "min": "2020-01-04 04:32:53",
          "max": "2023-12-30 12:48:27"
        }
      }
    },
    "billing": {
      "rows": 600,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 600,
          "min": 1,
          "max": 600
        },
        "visit_id": {
          "nulls": 0,
          "distinct": 396,
          "min": 1,
          "max": 600
        },
        "total_charge": {
          "nulls": 0,
          "distinct": 600,
          "min": 100,
          "max": 19998.15
        },
        "insurance_provider": {
          "nulls": 67,
          "distinct": 315
        },
        "amount_covered": {
          "nulls": 75,
          "distinct": 525,
          "min": 0,
          "max": 19906.54
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/departments.csv",
      "format": "csv",
      "table": "departments",
      "key": "datasets/hospital-management-system/v3/csv/departments.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hospital-management-system/v3/csv/departments.csv",
      "bytes": 526,
      "sha256": "6172e71751ffab24504fe3d41fcc8c28007e6c2f102ba16c32e7480a936abed7",
      "rows": 10,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/patients.csv",
      "format": "csv",
      "table": "patients",
      "key": "datasets/hospital-management-system/v3/csv/patients.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hospital-management-system/v3/csv/patients.csv",
      "bytes": 14741,
      "sha256": "e74fd40ff8d93e010cf9eb32f551e85bab62a2d98446eaf83e0d0fbfe0ad7529",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/visits.csv",
      "format": "csv",
      "table": "visits",
      "key": "datasets/hospital-management-system/v3/csv/visits.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hospital-management-system/v3/csv/visits.csv",
      "bytes": 61006,
      "sha256": "4d25dfcc60ac3d3124ce30bf2562f0f126c7c5113aeb6768ae414bb00814a4dc",
      "rows": 600,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/billing.csv",
      "format": "csv",
      "table": "billing",
      "key": "datasets/hospital-management-system/v3/csv/billing.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hospital-management-system/v3/csv/billing.csv",
      "bytes": 23032,
      "sha256": "479c1f1c27875a88ec5a245d71e446a037864f014504ce23dc651453eb745f4d",
      "rows": 600,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/lab_results.csv",
      "format": "csv",
      "table": "lab_results",
      "key": "datasets/hospital-management-system/v3/csv/lab_results.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hospital-management-system/v3/csv/lab_results.csv",
      "bytes": 29063,
      "sha256": "899d208dfcd7263c563a4c580e245d151f5eaaef7b6ce53e35f8feb0c5db3871",
      "rows": 300,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "hospital-management-system.json",
      "format": "json",
      "table": null,
      "key": "datasets/hospital-management-system/v3/hospital-management-system.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hospital-management-system/v3/hospital-management-system.json",
      "bytes": 390000,
      "sha256": "12aa8cc351387c35119ddaa00ac78fbefc724e37e168bdf389fed5d309a427a3",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/hospital-management-system/v3/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hospital-management-system/v3/sql/postgres.sql",
      "bytes": 160455,
      "sha256": "8262bfb84a0adfefb74d7a761347b6f65d29c70da7b7d4f18e9047bdbdce3d38",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/hospital-management-system/v3/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hospital-management-system/v3/sql/mysql.sql",
      "bytes": 157746,
      "sha256": "41a0810c120c0a910b98dd8d7654db674854f477a2c8c83389578cbbe525441f",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/hospital-management-system/v3/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hospital-management-system/v3/sql/mssql.sql",
      "bytes": 162455,
      "sha256": "1461a6e6931c301b7d8fe8b80a52754cb3a8cecdbaa344b74a8a7ccd4ab35854",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/hospital-management-system/v3/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hospital-management-system/v3/sql/sqlite.sql",
      "bytes": 157524,
      "sha256": "21cff4c3457ecc48281612954c5b10f9f1a0db35b28dc3f98977db8c5a473329",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/hospital-management-system/v3/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hospital-management-system/v3/prisma/seed.ts",
      "bytes": 324286,
      "sha256": "9092feace0b98ff7a3fd308ec8fbbc1988dbacb6c65fa6cde05dddd333431168",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/hospital-management-system/v3/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hospital-management-system/v3/django/fixtures.json",
      "bytes": 461544,
      "sha256": "520f145297491bf8d1687d059c8f247520f71109d191d8c14b45c510fac437b0",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788765956376,
  "updatedAt": 1789095864620
}
