/e-prescribing

A full-stack application that ease the process of a clinic including doctors, patients, and assistants. ⚕️

Primary LanguageTypeScriptMIT LicenseMIT

E-Prescribing

License Deployed on Vercel

E-Prescribing is a web application that allows doctors to create and send prescriptions to patients. Patients can view their prescriptions and the instructions for each prescription. Assistants can scan prescriptions and upload them to the system. The application is built using Next.js, Typescript, Tailwind CSS, MongoDB, Mongoose, Clerk and Nanonets OCR API. The application is deployed on Vercel and can be accessed here.

Table of Contents

Features

  • Doctors

    • Create prescriptions
    • Send prescriptions to patients
    • Create and manage patients
    • Add an existing patient to a prescription
    • View patients
    • Create and manage assistants
    • Add an existing assistant to their staff
    • View assistants
    • Create and manage drugs
    • View drugs
    • View pending prescriptions for assistants
    • Update and approve prescriptions for assistants
    • View profile
    • Update profile
    • Change password
    • Logout
  • Patients

    • View prescriptions
    • View instructions for each prescription
    • View associated doctors
    • View profile
    • Update profile
    • Change password
    • Logout
  • Assistants

    • Upload prescriptions
    • Scan prescriptions using OCR
    • View pending prescriptions
    • View profile
    • Update profile
    • Change password
    • Logout

Technologies

Screenshots

Home Page

home

About Page

About Page

Login Page

login

Signup Page

signup

Profile Page

profile

Doctor Dashboard

Doctor Dashboard

Create Prescription Page

Create Prescription Page

Patient Dashboard

Patient Dashboard

View Prescription Page

View Prescription Page

Assistant Dashboard

Assistant Dashboard

Getting Started

Prerequisites

Creating a MongoDB Instance

  1. Visit MongoDB Atlas Website:

  2. Sign Up / Log In:

    • Sign up for a new account or log in if you already have an account.
  3. Create a New Project:

    • Once logged in, click on "New Project".
    • Enter a project name and click "Create Project".
  4. Create a New Cluster:

    • In the project dashboard, click on "Build a Cluster".
    • Choose a cluster tier (the free tier is suitable for testing and development).
    • Select your cloud provider and region.
    • Click "Create Cluster".
  5. Configure Cluster:

    • Wait for the cluster to be created (this may take a few minutes).
  6. Add a Database User:

    • Once the cluster is ready, click on "Database Access" in the left-hand menu.
    • Click on "Add New Database User".
    • Enter a username and password. Save these credentials, as you will need them later.
    • Assign the user the role of "Read and write to any database".
  7. Whitelist IP Address:

    • Click on "Network Access" in the left-hand menu.
    • Click on "Add IP Address".
    • Add your current IP address or use 0.0.0.0/0 to allow access from anywhere (not recommended for production).
  8. Get Connection String:

    • Go back to the cluster view by clicking on "Clusters" in the left-hand menu.
    • Click on "Connect" for your cluster.
    • Choose "Connect your application".
    • Copy the connection string. It will look something like this:
      mongodb+srv://<username>:<password>@cluster0.mongodb.net/<dbname>?retryWrites=true&w=majority

Creating an Account on Nanonets

  1. Visit the Nanonets Website:

    • Go to Nanonets.
  2. Sign Up:

    • Click on the "Sign Up" button.
    • You can sign up using your Google account or provide an email and password to create an account.

Creating an OCR Workflow

  1. Login to Your Account:

    • After creating your account, log in to the Nanonets dashboard.
  2. Create a New Model:

    • On the dashboard, click on the "New Model" button.
    • Select "OCR" from the available model types.
    • Name your model and click on "Create".
  3. Upload Training Data:

    • Click on the newly created OCR model.
    • You will be prompted to upload images or documents for training your model. Upload a few samples to start.
    • Nanonets will automatically start training your model once you have uploaded enough data.
  4. Train Your Model:

    • After uploading the training data, click on "Train Model". The training process may take some time, depending on the amount of data and complexity.

Getting the Model Key and API Key

  1. Obtain the Model Key:

    • Once your model is trained, go to the model details page.
    • You will find the "Model Key" on this page. Copy this key, as you will need it to use the model.
  2. Obtain the API Key:

    • Go to the Nanonets dashboard.
    • Click on your profile icon in the top-right corner.
    • Select "API Keys" from the dropdown menu.
    • You will see your API key listed here. If there is no API key, you can generate a new one. Copy this key.

Installation

  1. Clone the repository
git clone https://github.com/ab-elhaddad/e-prescribing
  1. Install dependencies
cd e-prescribing
npm install
  1. Create a .env file in the root directory using the .env.example file as a template.

  2. Run the development server

npm run dev
  1. Open http://localhost:3000 with your browser to see the result.

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request if you have any ideas on how to improve this project.

License

This project is open source and available under the MIT License.