Overview
The consultation process begins with creating a request and concludes once it is fulfilled and answered by a healthcare professional.
Detailed Lifecycle Flow
- Creation: Initiate the consultation using
apiService.createConsultation. You must provide a question, the user ID, and the preferred medium (chat,voip,video, orgsm). - Socket Connection: Once created, use the
Pusherservice to connect to the consultation's real-time updates. This allows your app to react instantly when a doctor accepts the request. - Status Monitoring: Monitor the consultation status via socket events. Common statuses include:
new: Request is pending.checking_medical_profile: The doctor is reviewing patient data.in_progress: The consultation is live.
- In-Progress Session:
- Chat: Use the
AltibbiChatservice to manage real-time messaging. - VoIP/Video: Use the
VideoControllerandVideoViewto manage the call session.
- Chat: Use the
- Completion: Once the consultation is finished, the doctor will provide a medical recommendation.
- Recommendation & Prescription: Retrieve the finalized
Recommendationdata and download the official prescription PDF usingapiService.getPrescription.
We have already covered how to create a consultation; the next step is to configure the socket connection to handle real-time status transitions.