Enter Waiting Room Flow
These flows use the VSeeClinicCore framework (iOS). For Android, see the Android Enter Waiting Room Flow.
For patients
A user logs in and, once logged in, enters the waiting room.
Preconditions
- The user has a valid username and password.
- The user must be logged in to enter the waiting room.
Use case steps
- User login: the app starts the login by calling
userLoginwith the user's username and password.public func userLogin(userName: String, password: String, success: @escaping() -> Void, failure: @escaping (Error) -> Void) { // Perform the login process with the provided username and password. }
- User authentication: the
userLoginAPI authenticates the user with the backend server. - Login success: if authentication succeeds, the
successclosure passed touserLoginruns, and the user is logged in.
- Login failure: if authentication fails because of wrong credentials or any other reason, the
failureclosure runs with anErrorobject, so the app can handle the failure gracefully.
- Initialize intake information: after login, the app creates an
IntakeConfigwith the reason for the visit.let intakeConfig = IntakeConfig(reasonForVisit: "Routine check-up")
- Start the visit in the native view (VSeeKit): the app starts the visit in the VSeeKit native view by calling
startVisitByNativeViewwith the intake configuration.VSeeKit.shared.startVisitByNativeView(with: intakeConfig, success: { // Handle successful start of the visit using VSeeKit native view. }, failure: { error in // Handle the failure to start the visit using VSeeKit native view. }) - Start the visit in a web browser: alternatively, the app can start the visit in a web browser by calling
startVisitByBrowserwith the intake configuration.VSeeKit.shared.startVisitByBrowser(with: intakeConfig, success: { // Handle successful start of the visit using the web browser. }, failure: { error in // Handle the failure to start the visit using the web browser. })
Error handling
If login fails, inspect the Error object passed to the failure closure of userLogin. Likewise, failures when starting the visit with VSeeKit or the web browser are passed to the failure closure of those functions.
Show a suitable error message or take action based on the type of error.
Conclusion
This flow shows VSeeClinicCore integrated into an app: follow the steps and handle errors, and logged-in users can enter the waiting room and start their visit smoothly.
For guest patients
A guest user enters the waiting room without logging in. Instead, the guest gives their first name, last name, and date of birth (DOB). The flow initializes the guest user, collects their details, and starts the visit with VSeeClinicCore.
Use case steps
- Initialize the guest user: the app calls
guestLoginwith the guest's first name, last name, and date of birth.
public func guestLogin(_ firstName: String, lastName: String, dob: String, success: @escaping() -> Void, failure: @escaping (Error) -> Void) { // Initialize the guest user with the provided first name, last name, and DOB. }
- Initialize intake information: after the guest user is initialized, the app creates an
IntakeConfigwith the reason for the visit and the guest's first name, last name, and date of birth.let intakeConfig = IntakeConfig(reasonForVisit: "Routine check-up", firstName: firstName, lastName: lastName, dob: dob)
- Start the visit in the native view (VSeeKit): the app starts the visit in the VSeeKit native view by calling
startVisitByNativeViewwith the intake configuration.VSeeKit.shared.startVisitByNativeView(with: intakeConfig, success: { // Handle successful start of the visit using VSeeKit native view. }, failure: { error in // Handle the failure to start the visit using VSeeKit native view. }) - Start the visit in a web browser: alternatively, the app can start the visit in a web browser by calling
startVisitByBrowserwith the intake configuration.VSeeKit.shared.startVisitByBrowser(with: intakeConfig, success: { // Handle successful start of the visit using the web browser. }, failure: { error in // Handle the failure to start the visit using the web browser. })
Error handling
If guest initialization or starting the visit fails, handle the Error object: show an error message or take action based on the type of error.
Conclusion
This flow lets guest users enter the waiting room and start their visit without logging in.
Try the API calls interactively
The Video Session use case walks through the same flow with live API calls.