ClinicKit Mobile SDK / Mobile flows

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

  1. User login: the app starts the login by calling userLogin with 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.
    }

    Login
  2. User authentication: the userLogin API authenticates the user with the backend server.
  3. Login success: if authentication succeeds, the success closure passed to userLogin runs, and the user is logged in.
    Login success
  4. Login failure: if authentication fails because of wrong credentials or any other reason, the failure closure runs with an Error object, so the app can handle the failure gracefully.
    Login failure
  5. Initialize intake information: after login, the app creates an IntakeConfig with the reason for the visit.
    let intakeConfig = IntakeConfig(reasonForVisit: "Routine check-up")

    Intake
  6. Start the visit in the native view (VSeeKit): the app starts the visit in the VSeeKit native view by calling startVisitByNativeView with 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.
    })
  7. Start the visit in a web browser: alternatively, the app can start the visit in a web browser by calling startVisitByBrowser with 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.
    })

    Start visit

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

  1. Initialize the guest user: the app calls guestLogin with the guest's first name, last name, and date of birth.
    Guest details
    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.
    }

    Guest login
  2. Initialize intake information: after the guest user is initialized, the app creates an IntakeConfig with 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)

    Intake
  3. Start the visit in the native view (VSeeKit): the app starts the visit in the VSeeKit native view by calling startVisitByNativeView with 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.
    })
  4. Start the visit in a web browser: alternatively, the app can start the visit in a web browser by calling startVisitByBrowser with 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.
    })

    Start visit

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.