manaschubby / MediLink-Pro

ElectronJS and MongoDB-based patient data management system. Store, search, and analyze patient photos and data efficiently. Streamline medical care and research. Digitize patient data, enhance accessibility, optimize healthcare workflows.
MIT License
14 stars 10 forks source link

Add Medication component should be linked to backend #32

Open manaschubby opened 1 year ago

manaschubby commented 1 year ago

Add Medication functionality to be implemented by connecting the main process using IPC communication. Either new medicine should be created or if pre-existing exists it should directly create a medication for the patient.

TreLynnnn commented 1 year ago

I'd love to help out with this project, if possible!

manaschubby commented 1 year ago

@TreLynnnn Thank you for reaching out! We would love to have you on board with MediLink Pro.

Clone the repo and start the app on your machine. Add a patient and then click on the patient in the Patient Table to open his/her individual page. You'll find that the Add Appointment and Add Diagnosis pop ups are functional, but Add Medication are not. We need to make that functional too. Using IPC Communication the data needs to be send to the main process and added into the database.

Do you want me to assign the issue to you?

TreLynnnn commented 1 year ago

Yes, please! Glad I can help.

manaschubby commented 1 year ago

Awesome! I have assigned the issue to you.

When you have finished resolving the issue, please fork the repo and open a Pull request. If possible, describe the changes that you have made to resolve the issue. Request a review from @Shlokkzz or @manaschubby.

Thank you for contributing.

manaschubby commented 1 year ago

Please reach out if you are facing any issues in understanding the code or setting up the development environment on your machine. We are here to help!

TreLynnnn commented 1 year ago

When adding a new patient, clicking the “+” opens a new dashboard window but doesn’t allow the user to add the new patient info. Opens a new window each time. — Getting an error of Unhandled Promise rejection. This prevents me from viewing the patient table.

manaschubby commented 1 year ago

@TreLynnnn You are right. We are facing this issue because of our migration to HashRouter from BrowserRouter. I shall resolve this issue and update the branch. Till then in the main.js file, in the ipcMain.on("add-patient", (e, arg) => { function change the addPatientWindow.loadURL("http://localhost:3000/add-patient"); to addPatientWindow.loadURL("http://localhost:3000#/add-patient");. This should let you open the add-patient window properly.

manaschubby commented 1 year ago

Hi @TreLynnnn Please sync your fork, there are some changes regarding our migration from BrowserRouter to HashRouter. You'll be able to open the AddPatient window properly now

manaschubby commented 1 year ago

Was your issue resolved?

TreLynnnn commented 1 year ago

I've synced and the window now opens for user to input patient info, but once "add patient" is clicked it loads indefinitely. I'm getting a mongoose timeout error. I've added my own connection string with no luck. Here's my terminal. Screen Shot 2023-07-06 at 7 04 43 PM

manaschubby commented 1 year ago

Please duplicate the .env.example file and rename it to .env.

That will connect it to your local mongodb server. If you plan to use Atlas. Add the URI to the .env.

TreLynnnn commented 1 year ago

I did. Here's what I have. image

manaschubby commented 1 year ago

Can you try finding whether Mongoose has been connected successfully? It should be logged somewhere near the start of the electron app in the terminal. Please let us know if you find it.

manaschubby commented 1 year ago

Also, I suggest add a /MediLinkPro at the end of your URI, so that your database is segregated properly.

TreLynnnn commented 1 year ago

Alright, I fixed the connection string and restarted the server. No error message about the db connection nor does it say it's been successfully connected. I only have this error...

--> (node:7998) UnhandledPromiseRejectionWarning: MongooseError: Operation patients.find() buffering timed out after 10000ms [1] at Timeout. (/Users/fcp339/Projects/MediLink-Pro/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:185:23) [1] at listOnTimeout (node:internal/timers:569:17) [1] at process.processTimers (node:internal/timers:512:7)

manaschubby commented 1 year ago

This is most likely due to a failed or problematic connection to MongoDB. Can you check whether collections were made in your Database? Also, check whether you have added your IP address in the Database Access section of MongoDB Atlas.

manaschubby commented 1 year ago

Screenshot 2023-07-07 at 9 00 47 AM

A message like this Connected to MongoDB Atlas should be displayed. You don't need to use Atlas. You can also use your Local Mongo for the same.

TreLynnnn commented 1 year ago

Okay I'll try that now

manaschubby commented 1 year ago

Were you successful?

manaschubby commented 1 year ago

Hi @TreLynnnn, if you are facing any issues please let us know!

TreLynnnn commented 1 year ago

Still working through it. I've already checked my cluster, updated the password and connection string. I got a failed to connect to DB message earlier, but fixed it. Still getting the same error from above. I'll work through it a bit more and see if I can make some progress. I'll update you all in a few hours. Thanks so much for your patience!

TreLynnnn commented 1 year ago

Finally got it fixed! 🤗 I can start working out the issue now.

manaschubby commented 1 year ago

That's awesome. I am glad you were able to resolve the problems. Do let us know if we can assist in any way.

manaschubby commented 1 year ago

Hi @TreLynnnn Were you able to make progress in regards to the issue?