Med chat

Realtime Instant Chat Messages plays a vital roles in Doctors, Patients and Caregivers Communications.

Med Chat is an interactive Web applications system that facilitate One to One(Private) Realtime Chat Messages, Voice/Audio Messages and Files Sharing between Doctors and their Patients Powered by Dr. Chrono API & IBM Watson.

Med-Chat as an Interactive Web Chat application, it facilitates and ensures patient clinical information management and exchange, Medi-Care communication and collaboration, between Doctors and his Patients.

Med Chat Realtime Features includes:

1.) Ability to send Chat text messages one to one between Doctors and Patients in realtime.
2.) Ability to Share Files, Documents, Lab results, Pdf, Videos etc. between Doctors and Patients in realtime.
3.) Ability to Convert Text Messages to Voice/Audio to help patients with impared vision powered by IBM Watson Text to Speech Synthesis
4.) Ability to send and share Youtube Education Videos one to one in chats between Doctors and Patients in realtime.
5.) Displaying Typing Notifications during chat between Doctors and Patients.
6.) Displaying Online Presence between communicating Doctors and Patients in realtime.
7.) Triggers realtime alert Sound Notifications on Message arrivals and receptions etc.

Additional Features outside Realtime Chat:

1.) Abitlity to send Email Messages between Doctors and its Patients.
2.) Ability to send SMS Messages between Doctors and its Patients.
3.) Ability to facilitate Whatsapp Chat Collaborations between Doctors and its Patients.

The User Experience

The application has two Interface one for Doctors Signup and Login and the other for Patients Signup and Login

Doctors signup by entering their Dr. Chrono ClientID, Client Secrets and any email address and password that we can use to identify him in the database. once signup is successful, Doctors can now signin.

After Doctors signing in via Dr. Chrono API Authentication calls, an Access Token is generated which is updated in our database with the authenticating Doctors Email ID.

From Doctors End

The applications dispalys lists of all the patients in the doctors contact list by querying Dr. Chrono Patients API(/api/patients).

This API Call automatically displays all the Patients under the Doctor list from the Dr. Chrono System. If a New Patients is added by the Doctor from Dr. Chrono System/Server, the Patient, will automatically reflect on our App via the API Call.

The applications automatically allow Doctors to do all the followings via Dr. Chrono API listed Patients Contacts List:

1.)Allow Doctors to invite his Patients to collaborate with him via sending Invitation Mail to Patients Email Address or by manually copy and send the Patients signup Inviation links to the Patients.
2.) Edit Patients Data like Email, Gender and Phone Number and update it back to Dr chrono Sever via Dr. chrono Patients API (/api/patients).
3.) Allow Doctors to Chat with Patients one to one to send, share and exchange messages, clinical informations, Medical files, pdfs, videos, Voice calls, Youtube video sharing.
4.)Allow Doctors to Send Email Messages to its Patients.
5.)Allow Doctors to Send SMS Messages to its Patients.
6.) Connect Doctors and Patients via their Cell_phone to chat on Whatsapp

From Patients End

The application allows the Patients to signup by following the Invitation Link sent to his Email Address by his Doctors or by following a manual signup Invitation link sent to him by his Doctor through any other means.

The Patients Enters Email Address and a Password used to identify him and our applications automatically link him up to his doctor via Doctors ID coming from Doctor Chrono API Call(/api/doctors).

After Patients signing in, Patients is automatically connected to his Doctors Via Doctors ID from Dr.Chrono API and Access Token which is generated by the Doctor during 3-legged Dr.chrono API Authentication is automatically leverage by his Patients

to display his connected doctors list via Doctor Chrono API Call(/api/doctors).

Patients can now do the followings with his Doctors List from Dr. Chrono API Call:

1.) Allow Patients to Chat with Doctors one to one to send, share and exchange messages, clinical informations, Medical files, pdfs, videos, Voice calls, Youtube video sharing.
2.)Allow Patients to send Email Messages to its Doctors.
3.)Allow Patients to Send SMS Messages to its Doctors.
4.) Connect Patients and Doctors via their Cell_phone to chat on Whatsapp

How We Built it

The application was built using PHP, Curl, Mysql, Ajax/Jquery, Bootstraps etc.

For Real Time Chat System, I leverage Nodejs and Socket.IO This is because it offers full duplex communications. Instructions on how to run the Nodejs Server can be found in the readme.txt file in the uploaded source Code
Realistically, The nodejs Server will be running at Port 8080. and it can be set or seen at Chat.php file.

// set chat Url

var url_chat ="http://localhost:8080";

If you are using notepad++, the line of code above should be seen at 1328 code line

Dr. Chrono Technology Leveraged includes:

Doctor Chrono Authorizaton/Authentication API,

Patients API(/api/patients),

Doctors API(/api/doctors).

IBM Watson Text to Speech Technology were also leveraged to convert Chat text Messages to Audio/Voice to help Patients with Impaired visions.

Only Chat Messages are sent to Mysql Database.

Very Important:

Our Uploaded zipped Source Code containsReadme.txt file. Please read that file to get instructions on how to run our applications Locally.

To run PHP, you will need to have XAMPP Server Installed and ensured that Apache and Mysql server is also running as well.

Challenges I ran into

Dr. Chrono API is very simple but my issue is that it does not Provides Examples in PHP, so I have to find my own way to write the API Call in PHP/Curl and its working fine. Honestly, I really spend alot of time on this. Am glad its working great.

How is it Possible that a Patient can Connect to its Doctor at Dr. Chrono API Level.

This Possible via access token. I have stated this above before. When a Doctor successfully signed in via Dr. Chrono Authorization/Authentication API, an access token is generated and save in the database along with authenticating Doctors ID and registered Email Address.

When a Patients successful signed from invitation link sent to him by his Doctor, Doctors ID from Dr. chrono API Call (/api/doctors) is assigned to its Patients along with the registered Doctors Email Address.

The Patients automatically leverage the his Doctors access token based on the connecting Doctors ID and Email Address to connect and interacts with its Doctors at API Level

In production, since Dr. Chrono Access token expires every 48 hours, someone can set up a Cron Jobs that that can run once every 24 hours.

The Cron-jobs leverages the authenticated refresh token in the database for the said doctors and make an API Call to Dr. Chrono Authorization/Authentication API to get new access token and then updates the database. This can be done once every 24 hours.

This cronjobs will ensure perpertual API Authorization connections of Patients to their Doctors

Please see cron_jobs.php file in the zip files uploaded in the submission.

Testing the applications.

I have included how to test our applications in the Form submission that says

" Please list the technologies and data sets used with a brief explanation of how they were used."

What's next for Medchat

coming soon

Built With

Share this project: