Overview
The consultation process begins with the creation of a consultation and concludes when it is fulfilled and a recommendation is provided by a doctor.
Consultation Flow
- Creation: Create a consultation by providing a question,
userId, and aMedium(chat,voip,video, orgsm). - Socket Connection: Use the
pusherChannelandpusherAppKeyreturned in theConsultationobject to initiate aTBISocketconnection. - Status Monitoring: Listen to the
call-statusevent to track status transitions:new: Consultation is created and waiting to be picked up.checking_medical_profile: Doctor is reviewing the user's medical history.in_progress: The consultation is live (chat started or call established).closed: The consultation has ended.
- In-Progress Handling: Depending on the medium:
- Chat: Initiate
AltibbiChatusing thechatConfig. - VOIP/Video: Initialize an OpenTok session using the
voipConfigorvideoConfig.
- Chat: Initiate
- Recommendation & Prescription: Once the status is
closedandisFulfilledis1, retrieve the medical recommendation and prescription usinggetConsultationInfoorgetPrescription.
We have already covered how to create consultations; the next step is handling the socket connection and events.