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.
-
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
-
Visit MongoDB Atlas Website:
- Go to MongoDB Atlas.
-
Sign Up / Log In:
- Sign up for a new account or log in if you already have an account.
-
Create a New Project:
- Once logged in, click on "New Project".
- Enter a project name and click "Create Project".
-
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".
-
Configure Cluster:
- Wait for the cluster to be created (this may take a few minutes).
-
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".
-
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).
-
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
-
Visit the Nanonets Website:
- Go to Nanonets.
-
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.
-
Login to Your Account:
- After creating your account, log in to the Nanonets dashboard.
-
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".
-
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.
-
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.
-
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.
-
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.
- Clone the repository
git clone https://github.com/ab-elhaddad/e-prescribing
- Install dependencies
cd e-prescribing
npm install
-
Create a
.env
file in the root directory using the.env.example
file as a template. -
Run the development server
npm run dev
- Open http://localhost:3000 with your browser to see the result.
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.
This project is open source and available under the MIT License.