{
  "format": "dataset-manifest/1",
  "slug": "pharmacy-transaction-insights",
  "version": 3,
  "seed": "pharmacy-transaction-insights:1",
  "engine": 1,
  "engineVersion": "1.0.0",
  "spec": {
    "format": "dataset/1",
    "slug": "pharmacy-transaction-insights",
    "name": "Pharmacy Transaction Insights",
    "tagline": "Pharmacy transactions including patients, medications, prescriptions, and doctor interactions.",
    "description": "A pharmacy manages the dispensing of medications and oversees patient prescriptions, acting as a vital link in the healthcare system. Within this operation, patients visit to fill prescriptions written by their doctors, and medications are tracked for inventory management as well as regulatory compliance. The interaction between these elements generates a wealth of data that reflects the dynamics of medication usage, renewal patterns, and the relationships between patients and healthcare providers.\n\nThe dataset is structured around several interconnected tables. The 'patients' table holds individual patient records, detailing demographics and medical history. The 'medications' table lists various drugs available, spanning from common prescriptions to unique entries. Each entry in the 'prescriptions' table corresponds to a specific medication prescribed to a patient, linking the patient ID to the medication ID. The 'doctors' table contains information about healthcare providers who issue prescriptions, while the 'interactions' table captures noteworthy events, including consultations that might impact medication choices or prescription adjustments. Together, these tables can be joined to answer complex queries about patient behaviors, prescription trends, and the effectiveness of treatment plans.\n\nThis data proves useful for practitioners looking to analyze prescription data in a real-world context. Questions such as, \"What medications are most frequently prescribed to specific demographics?\" or \"How do doctor-patient interactions influence prescription renewals?\" can be explored. The dataset allows for practice in data analysis, enabling users to understand medication trends, manage pharmaceutical inventories, and evaluate patient outcomes. Importantly, all the data within this dataset is synthetic, generated to simulate real-world pharmacy operations and facilitate learning.",
    "domain": "pharmacy",
    "shape": "transactional",
    "useCases": [
      "sql-practice",
      "orm-seeding"
    ],
    "keywords": [
      "pharmacy",
      "prescriptions",
      "medications",
      "transactions",
      "healthcare",
      "data-analysis"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "patients": {
        "description": "This table contains records of patients, linking them to their prescriptions and interactions with the pharmacy.",
        "rows": 200,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each patient."
          },
          "full_name": {
            "kind": "fullName",
            "description": "The full name of the patient."
          },
          "email": {
            "kind": "email",
            "from": "full_name",
            "description": "Patient's email address for communication.",
            "nullable": true
          },
          "date_of_birth": {
            "kind": "date",
            "from": "1900-01-01",
            "to": "2023-01-01",
            "description": "Patient's date of birth.",
            "nullable": true,
            "when": {
              "column": "gender",
              "in": [
                "other"
              ]
            },
            "trend": "growing"
          },
          "gender": {
            "kind": "enum",
            "values": [
              "male",
              "female",
              "other"
            ],
            "description": "Gender of the patient.",
            "weights": [
              6,
              3,
              1
            ]
          }
        }
      },
      "medications": {
        "description": "This table lists the medications available in the pharmacy, detailing their properties and availability.",
        "rows": 150,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each medication."
          },
          "name": {
            "kind": "productName",
            "description": "Name of the medication."
          },
          "category": {
            "kind": "enum",
            "values": [
              "antibiotic",
              "antidepressant",
              "pain reliever",
              "other"
            ],
            "description": "Category of the medication.",
            "weights": [
              5,
              4,
              3,
              2
            ]
          },
          "stock_quantity": {
            "kind": "int",
            "min": 0,
            "max": 100,
            "description": "Number of units available in stock.",
            "nullable": true,
            "when": {
              "column": "category",
              "in": [
                "other"
              ]
            }
          },
          "price": {
            "kind": "decimal",
            "min": 1,
            "max": 500,
            "scale": 2,
            "description": "Price of the medication.",
            "nullable": true,
            "distribution": "long-tail"
          }
        }
      },
      "prescriptions": {
        "description": "This table records the prescriptions issued to patients, linking them to the respective medications and doctors.",
        "rows": 300,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each prescription."
          },
          "patient_id": {
            "kind": "fk",
            "ref": "patients.id",
            "description": "Reference to the patient who received the prescription."
          },
          "medication_id": {
            "kind": "fk",
            "ref": "medications.id",
            "description": "Reference to the prescribed medication."
          },
          "issue_date": {
            "kind": "date",
            "from": "2022-01-01",
            "to": "2023-12-31",
            "description": "Date the prescription was issued.",
            "trend": "seasonal"
          },
          "renewal_count": {
            "kind": "int",
            "min": 0,
            "max": 5,
            "description": "Number of times the prescription has been renewed.",
            "distribution": "long-tail"
          },
          "dosage": {
            "kind": "decimal",
            "min": 1,
            "max": 500,
            "scale": 1,
            "distribution": "normal",
            "description": "Dosage of the medication in milligrams."
          },
          "refill_date": {
            "kind": "date",
            "after": "issue_date",
            "withinDays": 30,
            "description": "Date when the prescription can be refilled."
          }
        }
      },
      "doctors": {
        "description": "This table includes information about doctors who prescribe medications to patients.",
        "rows": 50,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each doctor."
          },
          "full_name": {
            "kind": "fullName",
            "description": "The full name of the doctor."
          },
          "specialty": {
            "kind": "enum",
            "values": [
              "general practitioner",
              "psychiatrist",
              "surgeon",
              "other"
            ],
            "description": "Doctor's area of specialization."
          },
          "contact_number": {
            "kind": "phone",
            "description": "Contact number of the doctor.",
            "nullable": true,
            "when": {
              "column": "specialty",
              "in": [
                "other"
              ]
            }
          }
        }
      },
      "interactions": {
        "description": "This table captures interactions between patients and doctors regarding prescriptions.",
        "rows": 250,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each interaction."
          },
          "patient_id": {
            "kind": "fk",
            "ref": "patients.id",
            "description": "Reference to the patient involved in the interaction."
          },
          "doctor_id": {
            "kind": "fk",
            "ref": "doctors.id",
            "description": "Reference to the doctor involved in the interaction."
          },
          "interaction_date": {
            "kind": "date",
            "from": "2022-01-01",
            "to": "2023-12-31",
            "description": "Date of the interaction."
          },
          "notes": {
            "kind": "sentence",
            "min": 10,
            "max": 200,
            "description": "Notes or details from the interaction.",
            "nullable": true
          },
          "interaction_type": {
            "kind": "enum",
            "values": [
              "consultation",
              "follow-up",
              "emergency"
            ],
            "weights": [
              50,
              30,
              20
            ],
            "description": "Type of interaction between patient and doctor."
          },
          "duration_minutes": {
            "kind": "int",
            "min": 5,
            "max": 60,
            "distribution": "normal",
            "description": "Duration of the interaction in minutes."
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "categorical",
      "timestamped",
      "nullable"
    ],
    "analysisQuestions": [
      "What are the most frequently prescribed medications?",
      "How many prescriptions are renewed on average per patient?",
      "What trends can be observed in medication stock levels over time?",
      "Which doctors have the highest number of interactions with patients?",
      "Are there any notable differences in prescription patterns across different demographics?"
    ],
    "suggestedQueries": [
      {
        "title": "Join Patients and Prescriptions",
        "sql": "SELECT p.full_name, pr.issue_date FROM patients p JOIN prescriptions pr ON p.id = pr.patient_id;",
        "dialect": "postgres"
      },
      {
        "title": "Count Medications per Prescription",
        "sql": "SELECT pr.id, COUNT(pr.medication_id) as medication_count FROM prescriptions pr GROUP BY pr.id;",
        "dialect": "postgres"
      },
      {
        "title": "Average Renewals per Patient",
        "sql": "SELECT p.full_name, AVG(pr.renewal_count) FROM patients p JOIN prescriptions pr ON p.id = pr.patient_id GROUP BY p.full_name;",
        "dialect": "postgres"
      },
      {
        "title": "Interactions by Doctor Specialty",
        "sql": "SELECT d.specialty, COUNT(i.id) as interaction_count FROM interactions i JOIN doctors d ON i.doctor_id = d.id GROUP BY d.specialty;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Educational Institutions",
        "body": "Universities offering healthcare management courses can utilize this dataset to teach students about pharmacy operations, prescription management, and the interplay between healthcare providers and pharmacies. By analyzing this data, students can gain practical insights into real-world pharmacy challenges."
      },
      {
        "title": "Pharmacy Management Software Developers",
        "body": "Developers creating pharmacy management systems can use this dataset to seed their databases during development. It allows them to simulate real-world scenarios, ensuring that their software can handle various pharmacy transactions, track medication inventories, and manage patient prescriptions effectively."
      },
      {
        "title": "Healthcare Analysts",
        "body": "Healthcare analysts can leverage this dataset to study prescription trends, identify commonly prescribed medications, and assess the impact of renewals on patient health outcomes. This information is critical for making informed decisions about inventory management and patient care strategies."
      },
      {
        "title": "Data Scientists in Healthcare",
        "body": "Data scientists can explore this dataset to develop predictive models that forecast medication demand, analyze patient demographics, and assess the relationships between doctors and their patients. Insights gleaned from this data can help improve pharmacy services and patient satisfaction."
      }
    ]
  },
  "counts": {
    "doctors": 50,
    "medications": 150,
    "patients": 200,
    "interactions": 250,
    "prescriptions": 300
  },
  "stats": {
    "patients": {
      "rows": 200,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "full_name": {
          "nulls": 0,
          "distinct": 197,
          "min": "Alice Ali",
          "max": "Zoe Nakamura"
        },
        "email": {
          "nulls": 19,
          "distinct": 181
        },
        "date_of_birth": {
          "nulls": 184,
          "distinct": 16,
          "min": "1913-09-08",
          "max": "2014-01-08"
        },
        "gender": {
          "nulls": 0,
          "distinct": 3,
          "min": "female",
          "max": "other"
        }
      }
    },
    "medications": {
      "rows": 150,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 150,
          "min": 1,
          "max": 150
        },
        "name": {
          "nulls": 0,
          "distinct": 132,
          "min": "Classic Headphones",
          "max": "Wireless Umbrella"
        },
        "category": {
          "nulls": 0,
          "distinct": 4,
          "min": "antibiotic",
          "max": "pain reliever"
        },
        "stock_quantity": {
          "nulls": 129,
          "distinct": 20,
          "min": 0,
          "max": 99
        },
        "price": {
          "nulls": 14,
          "distinct": 135,
          "min": 1.03,
          "max": 499.88
        }
      }
    },
    "prescriptions": {
      "rows": 300,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 300,
          "min": 1,
          "max": 300
        },
        "patient_id": {
          "nulls": 0,
          "distinct": 160,
          "min": 2,
          "max": 200
        },
        "medication_id": {
          "nulls": 0,
          "distinct": 129,
          "min": 1,
          "max": 150
        },
        "issue_date": {
          "nulls": 0,
          "distinct": 237,
          "min": "2022-01-05",
          "max": "2023-12-29"
        },
        "renewal_count": {
          "nulls": 0,
          "distinct": 6,
          "min": 0,
          "max": 5
        },
        "dosage": {
          "nulls": 0,
          "distinct": 281,
          "min": 37,
          "max": 438.2
        },
        "refill_date": {
          "nulls": 0,
          "distinct": 242,
          "min": "2022-01-06",
          "max": "2024-01-27"
        }
      }
    },
    "doctors": {
      "rows": 50,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 50,
          "min": 1,
          "max": 50
        },
        "full_name": {
          "nulls": 0,
          "distinct": 50,
          "min": "Amir Diaz",
          "max": "Wei Murphy"
        },
        "specialty": {
          "nulls": 0,
          "distinct": 4,
          "min": "general practitioner",
          "max": "surgeon"
        },
        "contact_number": {
          "nulls": 38,
          "distinct": 12
        }
      }
    },
    "interactions": {
      "rows": 250,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 250,
          "min": 1,
          "max": 250
        },
        "patient_id": {
          "nulls": 0,
          "distinct": 144,
          "min": 1,
          "max": 200
        },
        "doctor_id": {
          "nulls": 0,
          "distinct": 50,
          "min": 1,
          "max": 50
        },
        "interaction_date": {
          "nulls": 0,
          "distinct": 204,
          "min": "2022-01-03",
          "max": "2023-12-27"
        },
        "notes": {
          "nulls": 21,
          "distinct": 227
        },
        "interaction_type": {
          "nulls": 0,
          "distinct": 3,
          "min": "consultation",
          "max": "follow-up"
        },
        "duration_minutes": {
          "nulls": 0,
          "distinct": 37,
          "min": 12,
          "max": 53
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/doctors.csv",
      "format": "csv",
      "table": "doctors",
      "key": "datasets/pharmacy-transaction-insights/v3/csv/doctors.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy-transaction-insights/v3/csv/doctors.csv",
      "bytes": 1693,
      "sha256": "04970f8f83121fa22c23fc543db459393a90a1af6159fe4e3e2f2cf09311cfba",
      "rows": 50,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/medications.csv",
      "format": "csv",
      "table": "medications",
      "key": "datasets/pharmacy-transaction-insights/v3/csv/medications.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy-transaction-insights/v3/csv/medications.csv",
      "bytes": 5777,
      "sha256": "92cc6521faac31a3ea78b7430240a85320796183bfab83007e6e90115ea129e1",
      "rows": 150,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/patients.csv",
      "format": "csv",
      "table": "patients",
      "key": "datasets/pharmacy-transaction-insights/v3/csv/patients.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy-transaction-insights/v3/csv/patients.csv",
      "bytes": 9235,
      "sha256": "09d34004f985e885e06753a12e636ecaef2c659349e6b4f1856b3f9e8b11a49a",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/interactions.csv",
      "format": "csv",
      "table": "interactions",
      "key": "datasets/pharmacy-transaction-insights/v3/csv/interactions.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy-transaction-insights/v3/csv/interactions.csv",
      "bytes": 23732,
      "sha256": "d324bf9e1e6bd352e6e0c13e1cad6757e8b3266c3815639465ce2dd3248b6940",
      "rows": 250,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/prescriptions.csv",
      "format": "csv",
      "table": "prescriptions",
      "key": "datasets/pharmacy-transaction-insights/v3/csv/prescriptions.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy-transaction-insights/v3/csv/prescriptions.csv",
      "bytes": 12466,
      "sha256": "94b2fc976f245be6091124e7ebe6fd2b8cda93c236d45795eb3e8da9f03a2aa5",
      "rows": 300,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "pharmacy-transaction-insights.json",
      "format": "json",
      "table": null,
      "key": "datasets/pharmacy-transaction-insights/v3/pharmacy-transaction-insights.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy-transaction-insights/v3/pharmacy-transaction-insights.json",
      "bytes": 184657,
      "sha256": "a4d2c03d2772468c6e023a2d96a8763dc6a0e529a8df8204bc146aa807f2dc4f",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/pharmacy-transaction-insights/v3/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy-transaction-insights/v3/sql/postgres.sql",
      "bytes": 72655,
      "sha256": "3277c5a262a5675f96131d3fc441414ccedca16ac8125c62f69af96403de7db5",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/pharmacy-transaction-insights/v3/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy-transaction-insights/v3/sql/mysql.sql",
      "bytes": 72074,
      "sha256": "cd52c4e3261c43d8eaba4558925c95a9b2819e1a26f7cd7f67a0a9095455036e",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/pharmacy-transaction-insights/v3/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy-transaction-insights/v3/sql/mssql.sql",
      "bytes": 74757,
      "sha256": "37138c9201eb56e75d8bf8bf6bd8127576b06b7bc3917c294745e857775cf42f",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/pharmacy-transaction-insights/v3/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy-transaction-insights/v3/sql/sqlite.sql",
      "bytes": 71841,
      "sha256": "2779eae79a14dc7179efea1dc79c569c6fdfcaa153ada6be17c16a6b9189b1c7",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/pharmacy-transaction-insights/v3/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy-transaction-insights/v3/prisma/seed.ts",
      "bytes": 143955,
      "sha256": "d62b81ade87af4e0e974cbf0f0f3ea8f58f53c8a0e46c4477adfac2697617e13",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/pharmacy-transaction-insights/v3/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy-transaction-insights/v3/django/fixtures.json",
      "bytes": 226902,
      "sha256": "e4c61a48dc1dd96865f82dfdd09f9a6cbd3b9cc6c994fce9523c2f6d4fc56937",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788766060228,
  "updatedAt": 1789095970802
}
