{
  "format": "dataset-manifest/1",
  "slug": "medical-records-system",
  "version": 3,
  "seed": "medical-records-system:1",
  "spec": {
    "format": "dataset/1",
    "slug": "medical-records-system",
    "name": "Patient Care Records",
    "tagline": "Patient care records including demographics, immunizations, allergies, lab results, prescriptions, and surgeries.",
    "description": "Healthcare providers manage patient care records to ensure each individual receives comprehensive treatment throughout their medical journey. This involves the meticulous documentation of vital information, which includes patient demographics, immunization histories, laboratory results, and prescribed treatments. On the ground, healthcare professionals routinely update records as patients visit for check-ups, vaccinations, or tests, ensuring that all pertinent details are available for informed decision-making. Patterns in the data often reveal that most patients have at least a few allergies recorded, which highlights the importance of monitoring patient safety during treatment. In contrast, laboratory orders and surgeries are less frequent, reflecting a substantial focus on preventive care and routine monitoring.\n\nThe dataset consists of several interconnected tables that provide a holistic view of patient care. The 'patients' table contains individual patient information, while 'immunizations' associates each patient with their vaccination history. The 'allergies' table documents any allergies noted for each patient, contributing to safer treatment plans. 'laboratory_results' captures the outcomes of any tests ordered, allowing for a deeper understanding of a patient's health status. The 'prescriptions' table connects specific medications to patients and their conditions, while 'surgeries' records any surgical procedures performed. Each row in these tables corresponds to a unique aspect of a patient's care, with foreign keys linking them to the main patient entries.\n\nWith this dataset, developers can explore a wide range of questions, such as tracking immunization rates, analyzing allergy prevalence among patients, examining the relationship between lab results and prescriptions, and understanding the frequency of surgeries over time. This synthetic dataset serves as a valuable resource for practicing data analysis, querying, and visualization in a healthcare context, enhancing your skills in managing and interpreting medical data.",
    "domain": "healthcare",
    "shape": "transactional",
    "useCases": [
      "sql-practice",
      "orm-seeding"
    ],
    "keywords": [
      "patient",
      "healthcare",
      "medical records",
      "immunizations",
      "laboratory results",
      "prescriptions",
      "surgeries",
      "allergies"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "patients": {
        "description": "Each row represents a patient with demographic details such as name, age, and contact information.",
        "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."
          },
          "date_of_birth": {
            "kind": "date",
            "from": "1950-01-01",
            "to": "2005-01-01",
            "description": "The patient's date of birth.",
            "trend": "growing"
          },
          "email": {
            "kind": "email",
            "from": [
              "first_name",
              "last_name"
            ],
            "description": "The patient's email address.",
            "nullable": true
          },
          "phone": {
            "kind": "phone",
            "description": "The patient's contact phone number.",
            "nullable": true
          }
        }
      },
      "immunizations": {
        "description": "Records of immunizations received by each patient, linked to the patients table.",
        "rows": {
          "per": "patients",
          "via": "patient_id",
          "min": 1,
          "max": 5,
          "skew": "long-tail"
        },
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each immunization record."
          },
          "patient_id": {
            "kind": "fk",
            "ref": "patients.id",
            "description": "Reference to the patient who received the immunization."
          },
          "vaccine_name": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "Name of the vaccine administered.",
            "nullable": true,
            "pool": [
              "influenza",
              "tetanus",
              "hepatitis",
              "measles",
              "mumps",
              "rubella",
              "varicella",
              "pneumococcal",
              "diphtheria",
              "pertussis",
              "HPV",
              "shingles",
              "COVID",
              "meningococcal",
              "rotavirus",
              "typhoid",
              "cholera",
              "zoster",
              "anthrax",
              "rabies"
            ]
          },
          "date_administered": {
            "kind": "date",
            "from": "2010-01-01",
            "to": "2023-12-31",
            "description": "Date the immunization was administered.",
            "trend": "seasonal"
          }
        }
      },
      "allergies": {
        "description": "Allergies recorded for each patient, detailing substances and reactions.",
        "rows": {
          "per": "patients",
          "via": "patient_id",
          "min": 1,
          "max": 4,
          "skew": "long-tail"
        },
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each allergy record."
          },
          "patient_id": {
            "kind": "fk",
            "ref": "patients.id",
            "description": "Reference to the patient with the allergy."
          },
          "substance": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "The substance the patient is allergic to.",
            "pool": [
              "pollen",
              "peanuts",
              "latex",
              "shellfish",
              "dust",
              "mold",
              "milk",
              "eggs",
              "soy",
              "wheat",
              "bee",
              "penicillin",
              "aspirin",
              "sulfa",
              "fish",
              "tree",
              "grass",
              "ragweed",
              "citrus",
              "chocolate",
              "corn"
            ]
          },
          "reaction": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "Description of the allergic reaction.",
            "nullable": true,
            "pool": [
              "rash",
              "swelling",
              "hives",
              "nausea",
              "vomiting",
              "diarrhea",
              "anaphylaxis",
              "itching",
              "sneezing",
              "coughing",
              "shortness",
              "headache",
              "dizziness",
              "fatigue",
              "fever",
              "chills",
              "abdominal",
              "pain",
              "throat",
              "tightness"
            ]
          }
        }
      },
      "laboratory_results": {
        "description": "Results of laboratory tests ordered for patients, tied to the patients table.",
        "rows": {
          "per": "patients",
          "via": "patient_id",
          "min": 0,
          "max": 3,
          "skew": "long-tail"
        },
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each laboratory result."
          },
          "patient_id": {
            "kind": "fk",
            "ref": "patients.id",
            "description": "Reference to the patient for whom the test was conducted."
          },
          "test_name": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "Name of the laboratory test performed.",
            "pool": [
              "CBC",
              "BMP",
              "CMP",
              "Lipid",
              "Thyroid",
              "Glucose",
              "Hemoglobin",
              "Electrolytes",
              "Urinalysis",
              "Culture",
              "Sensitivity",
              "Coagulation",
              "PT",
              "INR",
              "Liver",
              "Kidney",
              "Hormone",
              "Vitamin",
              "Allergy",
              "Stool"
            ]
          },
          "result": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "The result of the laboratory test.",
            "nullable": true,
            "pool": [
              "normal",
              "elevated",
              "decreased",
              "positive",
              "negative",
              "abnormal",
              "critical",
              "borderline",
              "high",
              "low",
              "reactive",
              "non-reactive",
              "detectable",
              "undetectable",
              "stable",
              "fluctuating",
              "consistent",
              "variable",
              "significant",
              "insignificant"
            ]
          },
          "date_tested": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date the laboratory test was conducted.",
            "trend": "growing"
          }
        }
      },
      "prescriptions": {
        "description": "Medications prescribed to patients, linked to the patients table.",
        "rows": {
          "per": "patients",
          "via": "patient_id",
          "min": 1,
          "max": 6,
          "skew": "long-tail"
        },
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each prescription record."
          },
          "patient_id": {
            "kind": "fk",
            "ref": "patients.id",
            "description": "Reference to the patient receiving the prescription."
          },
          "medication_name": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "Name of the prescribed medication.",
            "pool": [
              "acetaminophen",
              "ibuprofen",
              "amoxicillin",
              "lisinopril",
              "metformin",
              "atorvastatin",
              "omeprazole",
              "levothyroxine",
              "sertraline",
              "albuterol",
              "losartan",
              "simvastatin",
              "clopidogrel",
              "gabapentin",
              "furosemide",
              "hydrochlorothiazide",
              "warfarin",
              "prednisone",
              "insulin",
              "duloxetine"
            ]
          },
          "dosage": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "Dosage information for the prescribed medication.",
            "nullable": true,
            "pool": [
              "500mg",
              "250mg",
              "10mg",
              "5mg",
              "100mg",
              "50mg",
              "1g",
              "2.5mg",
              "15mg",
              "20mg",
              "75mg",
              "300mg",
              "1.5mg",
              "200mg",
              "0.5mg",
              "0.25mg",
              "4mg",
              "8mg",
              "10ml",
              "15ml"
            ]
          },
          "date_prescribed": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date the prescription was issued.",
            "trend": "growing"
          }
        }
      },
      "surgeries": {
        "description": "Details of surgeries performed on patients, linked to the patients table.",
        "rows": {
          "per": "patients",
          "via": "patient_id",
          "min": 0,
          "max": 2,
          "skew": "long-tail"
        },
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each surgery record."
          },
          "patient_id": {
            "kind": "fk",
            "ref": "patients.id",
            "description": "Reference to the patient who underwent the surgery."
          },
          "surgery_type": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "Type of surgery performed.",
            "pool": [
              "appendectomy",
              "cholecystectomy",
              "hysterectomy",
              "bypass",
              "angioplasty",
              "knee",
              "hip",
              "hernia",
              "cataract",
              "spinal",
              "thoracotomy",
              "mastectomy",
              "craniotomy",
              "transplant",
              "laparoscopy",
              "colonoscopy",
              "thoracoscopy",
              "gastrostomy",
              "endoscopy",
              "amputation"
            ]
          },
          "date_surgery": {
            "kind": "date",
            "from": "2010-01-01",
            "to": "2023-12-31",
            "description": "Date the surgery was performed.",
            "trend": "growing"
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "categorical",
      "timestamped",
      "nullable"
    ],
    "analysisQuestions": [
      "What percentage of patients have allergies recorded?",
      "How many patients received immunizations in the last year?",
      "What types of surgeries are most common among patients?",
      "How do laboratory test results vary among different age groups?",
      "What is the average number of prescriptions per patient?"
    ],
    "suggestedQueries": [
      {
        "title": "Join Patients with Immunizations",
        "sql": "SELECT p.first_name, p.last_name, i.vaccine_name FROM patients p JOIN immunizations i ON p.id = i.patient_id;",
        "dialect": "postgres"
      },
      {
        "title": "Count of Allergies per Patient",
        "sql": "SELECT patient_id, COUNT(*) AS allergy_count FROM allergies GROUP BY patient_id;",
        "dialect": "postgres"
      },
      {
        "title": "Average Number of Laboratory Results per Patient",
        "sql": "SELECT patient_id, AVG(result_count) FROM (SELECT patient_id, COUNT(*) AS result_count FROM laboratory_results GROUP BY patient_id) AS counts GROUP BY patient_id;",
        "dialect": "postgres"
      },
      {
        "title": "Surgeries Performed Over Time",
        "sql": "SELECT date_surgery, COUNT(*) FROM surgeries GROUP BY date_surgery ORDER BY date_surgery;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Healthcare Data Analyst",
        "body": "A healthcare data analyst can use this dataset to identify trends in patient immunization rates and assess the effectiveness of vaccination campaigns over time. By analyzing the data, they can present insights to healthcare providers to improve patient outcomes."
      },
      {
        "title": "Medical Researchers",
        "body": "Medical researchers can leverage this dataset to study the relationships between allergies, immunizations, and prescription medications. They can analyze how certain allergies impact treatment plans and identify potential areas for further investigation."
      },
      {
        "title": "Healthcare Software Developers",
        "body": "Software developers working on health management systems can utilize this dataset to seed their database for testing and development purposes. It enables them to simulate real-world scenarios and enhance the functionality of their applications."
      },
      {
        "title": "Public Health Officials",
        "body": "Public health officials can analyze this dataset to monitor the incidence of allergies and the uptake of immunizations within specific demographics. This information is crucial for planning public health initiatives and improving community health outcomes."
      }
    ]
  },
  "counts": {
    "patients": 200,
    "allergies": 363,
    "immunizations": 459,
    "laboratory_results": 190,
    "prescriptions": 538,
    "surgeries": 118
  },
  "stats": {
    "patients": {
      "rows": 200,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "first_name": {
          "nulls": 0,
          "distinct": 73,
          "min": "Alice",
          "max": "Zoe"
        },
        "last_name": {
          "nulls": 0,
          "distinct": 75,
          "min": "Adams",
          "max": "Zhang"
        },
        "date_of_birth": {
          "nulls": 0,
          "distinct": 199,
          "min": "1950-03-08",
          "max": "2004-07-17"
        },
        "email": {
          "nulls": 17,
          "distinct": 183
        },
        "phone": {
          "nulls": 20,
          "distinct": 175
        }
      }
    },
    "immunizations": {
      "rows": 459,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 459,
          "min": 1,
          "max": 459
        },
        "patient_id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "vaccine_name": {
          "nulls": 53,
          "distinct": 262
        },
        "date_administered": {
          "nulls": 0,
          "distinct": 434,
          "min": "2010-01-01",
          "max": "2023-12-30"
        }
      }
    },
    "allergies": {
      "rows": 363,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 363,
          "min": 1,
          "max": 363
        },
        "patient_id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "substance": {
          "nulls": 0,
          "distinct": 244
        },
        "reaction": {
          "nulls": 29,
          "distinct": 221
        }
      }
    },
    "laboratory_results": {
      "rows": 190,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 190,
          "min": 1,
          "max": 190
        },
        "patient_id": {
          "nulls": 0,
          "distinct": 108,
          "min": 3,
          "max": 200
        },
        "test_name": {
          "nulls": 0,
          "distinct": 141
        },
        "result": {
          "nulls": 15,
          "distinct": 136
        },
        "date_tested": {
          "nulls": 0,
          "distinct": 175,
          "min": "2020-01-17",
          "max": "2023-12-24"
        }
      }
    },
    "prescriptions": {
      "rows": 538,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 538,
          "min": 1,
          "max": 538
        },
        "patient_id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "medication_name": {
          "nulls": 0,
          "distinct": 343
        },
        "dosage": {
          "nulls": 54,
          "distinct": 326
        },
        "date_prescribed": {
          "nulls": 0,
          "distinct": 452,
          "min": "2020-01-04",
          "max": "2023-12-31"
        }
      }
    },
    "surgeries": {
      "rows": 118,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 118,
          "min": 1,
          "max": 118
        },
        "patient_id": {
          "nulls": 0,
          "distinct": 81,
          "min": 1,
          "max": 195
        },
        "surgery_type": {
          "nulls": 0,
          "distinct": 85
        },
        "date_surgery": {
          "nulls": 0,
          "distinct": 115,
          "min": "2010-03-11",
          "max": "2023-12-23"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/patients.csv",
      "format": "csv",
      "table": "patients",
      "key": "datasets/medical-records-system/v3/csv/patients.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/medical-records-system/v3/csv/patients.csv",
      "bytes": 12892,
      "sha256": "bd05eec36709b11627d0574961e3c1dc963ea9db3c0567d722659066ceb68ff5",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/allergies.csv",
      "format": "csv",
      "table": "allergies",
      "key": "datasets/medical-records-system/v3/csv/allergies.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/medical-records-system/v3/csv/allergies.csv",
      "bytes": 13077,
      "sha256": "76c6ba2d74ce00d0618d12caa2586a32afac92bf9c9b2541e4c75cd41470984f",
      "rows": 363,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/immunizations.csv",
      "format": "csv",
      "table": "immunizations",
      "key": "datasets/medical-records-system/v3/csv/immunizations.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/medical-records-system/v3/csv/immunizations.csv",
      "bytes": 16002,
      "sha256": "25255332b3ad460416c038a9eddad93574d319a3505df2bf779c143eb0cc776f",
      "rows": 459,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/laboratory_results.csv",
      "format": "csv",
      "table": "laboratory_results",
      "key": "datasets/medical-records-system/v3/csv/laboratory_results.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/medical-records-system/v3/csv/laboratory_results.csv",
      "bytes": 9817,
      "sha256": "dfda2db44b392ace6f6c13397fc9d6b18eeaa4db2b619ed8acea58217472e623",
      "rows": 190,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/prescriptions.csv",
      "format": "csv",
      "table": "prescriptions",
      "key": "datasets/medical-records-system/v3/csv/prescriptions.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/medical-records-system/v3/csv/prescriptions.csv",
      "bytes": 27996,
      "sha256": "2e9708c59a646c414a2a32952954cf21704b82abdcc1a474327069b78dbf8df5",
      "rows": 538,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/surgeries.csv",
      "format": "csv",
      "table": "surgeries",
      "key": "datasets/medical-records-system/v3/csv/surgeries.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/medical-records-system/v3/csv/surgeries.csv",
      "bytes": 4579,
      "sha256": "e2a498e9fcfc09d4cffd980c00fdd7f7c2bd09c1111c85465bade07952eac366",
      "rows": 118,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "medical-records-system.json",
      "format": "json",
      "table": null,
      "key": "datasets/medical-records-system/v3/medical-records-system.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/medical-records-system/v3/medical-records-system.json",
      "bytes": 285328,
      "sha256": "a5f04b71a09c37139c8e025c35ea7401e039ee5f37564bb2a6c8edf35a388e51",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/medical-records-system/v3/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/medical-records-system/v3/sql/postgres.sql",
      "bytes": 116444,
      "sha256": "890afe66ef25ac274d27bf982ef34ab3ccc721ba6fa8eb69c88629af3e8b58b6",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/medical-records-system/v3/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/medical-records-system/v3/sql/mysql.sql",
      "bytes": 115741,
      "sha256": "3df1586ec6111bf223b1c06e64b7cbac5fff1e393ea7432f9ab0dbf75d3296ef",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/medical-records-system/v3/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/medical-records-system/v3/sql/mssql.sql",
      "bytes": 121039,
      "sha256": "c966bdd99a363d871e16074c6e26ebc7386e285e7d0f93f94520c108e7aa99a2",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/medical-records-system/v3/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/medical-records-system/v3/sql/sqlite.sql",
      "bytes": 115439,
      "sha256": "326fb1185361b686b7587adf48643e145e136171129d19a329570a83317c3f5b",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/medical-records-system/v3/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/medical-records-system/v3/prisma/seed.ts",
      "bytes": 225060,
      "sha256": "53244609388ab854016af21a5a689888b599e4f15869d1210a3df466b58a6537",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/medical-records-system/v3/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/medical-records-system/v3/django/fixtures.json",
      "bytes": 369069,
      "sha256": "6ac9b58d4a4829a19b79f33451d1aebcfd41e0c5ef7fb612c07a9bd19541ffeb",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788768230678,
  "updatedAt": 1788798096142
}
