Skip to main content

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

  1. Creation: Create a consultation by providing a question, userId, and a Medium (chat, voip, video, or gsm).
  2. Socket Connection: Use the pusherChannel and pusherAppKey returned in the Consultation object to initiate a TBISocket connection.
  3. Status Monitoring: Listen to the call-status event 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.
  4. In-Progress Handling: Depending on the medium:
    • Chat: Initiate AltibbiChat using the chatConfig.
    • VOIP/Video: Initialize an OpenTok session using the voipConfig or videoConfig.
  5. Recommendation & Prescription: Once the status is closed and isFulfilled is 1, retrieve the medical recommendation and prescription using getConsultationInfo or getPrescription.

We have already covered how to create consultations; the next step is handling the socket connection and events.