Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel6
outlinefalse
typelist
printablefalse

Intake

Intake represents the initial registration information collected from a patient during their visit to a healthcare facility.

Intake Configuration

Use for creating intake information.

Properties

  • type: The type of intake, default value is .walkin.

  • reasonForVisit: The reason for the visit.

  • room: The room associated with the intake, default value is the default room obtained from VCNetworkManager.shared().

Initialization

  • init(reasonForVisit:): Initializes an IntakeConfig object with the given reason for visit.

Create intake

Create an intake with the provided configuration.

...

Parameter

Type

Description

config

IntakeConfig

The intake configuration object.

success

Closure

A closure called when the intake creation is successful. It receives an Intake object as a parameter.

failure

Closure

A closure called when an error occurs during the intake creation. It receives an Error as a parameter.

Update intake

Update the current intake with the provided parameters.

...

Parameter

Type

Description

params

[String: Any]

The parameters to update the intake.

success

Closure

A closure called when the intake creation is successful. It receives an Intake object as a parameter.

failure

Closure

A closure called when an error occurs during the intake creation. It receives an Error as a parameter.

Visit

Visit refers to an appointment or session of patient care at a healthcare facility, storing relevant details such as appointment time, healthcare provider, and associated intake information.

Create visit from intake

Create a visit with a given intake.

...

Parameter

Type

Description

intake

Intake

The intake object for the visit..

success

Closure

A closure called when the visit creation is successful. It receives a Visit object as a parameter.

failure

Closure

A closure called when an error occurs during the visit creation. It receives an Error object as a parameter.

Schedule a visit

Get consultation list

     Retrieves a list of consultations that are visible to the patient.

...

Code Block
public func getConsultationList() throws -> [Consultation]?

Example Usage

Code Block
let visibleConsultations = VisitService.shared.getConsultationList()

Update intake with consultation

     Updates the given intake on the server with information from the provided consultation.

...

Parameter

Type

Description

intake

Intake

The intake to be updated.

consultation

Consultation

The consultation whose information will be used for updating the intake.

success

Closure

A closure to be executed upon successful update.

failure

Closure

A closure to be executed in case of failure, providing an `Error` object with details about the failure.

Example Usage

Code Block
let intake = Intake.createOnServer(with: config) // The given intake
let selectedConsultation = // the selected consultation
VisitService.shared.updateIntakeWithConsultation(intake: intake,
consultation: selectedConsultation, success: { in
    // Handle successful Visit creation
    print("Intake update sucessfully")
}, failure: { error in
    // Handle error during Visit creation
    print("Failed to update intake: \(error)")
})

Schedule visit with provided intake

Schedules a visit using the provided intake, optional provider, and room slot information.

...

Parameter

Type

Description

intake

Intake

The intake associated with the scheduled visit.

provider

Provider

An optional provider object for the scheduled visit.

slot

RoomSlot

The room slot information for scheduling the visit. RoomSlot records visit start and end times, signaling availability status (booked or open).

success

Closure

A closure that is called when the Visit creation is successful. It takes a Visit object as a parameter, representing the created Visit.

failure

Closure

A closure that is called when an error occurs during Visit creation. It takes an Error as a parameter, indicating the cause of the failure.

Example Usage

Code Block
let intake = Intake.createOnServer(with: config)
let selectedProvider = Provider() // select provider from the list
let selectedSlot = RoomSlot() // selected slot from available room slots


VisitService.shared.scheduleVisit(intake: intake,
 provider: selectedProvider,
  slot: selectedSlot, success: { visit in
    // Schedule visit successfully
}, failure: { error in
    // Handle error during Visit creation
})

Get current visit

Retrieves the current in-progress Visit.

Parameter

Type

Description

success

Closure

A closure that is called when the retrieval of the current Visit is successful. It takes a Visit object as a parameter, representing the current in-progress Visit.

failure

Closure

A closure that is called when an error occurs during the retrieval of the current Visit. It takes an Error object as a parameter, indicating the cause of the failure.

Example Usage

Code Block
VisitService.shared.getCurrentVisit(success: { visit in
    // Handle successful retrieval of the current Visit
    print("Current Visit: \(visit)")
}, failure: { error in
    // Handle error during retrieval of the current Visit
    print("Failed to retrieve current Visit with error: \(error)")
})

Get Upcoming Visits

Retrieves the list of upcoming Visits.

Parameter

Type

Description

success

Closure

A closure that is called when the retrieval of the upcoming Visits is successful. It takes an array of Visit objects as a parameter, representing the list of upcoming Visits.

failure

Closure

A closure that is called when an error occurs during the retrieval of the upcoming Visits. It takes an Error as a parameter, indicating the cause of the failure.

Example Usage

Code Block
VisitService.shared.getUpcomingVisit(success: { visits in
    // Handle successful retrieval of the upcoming Visits
    print("Upcoming Visits: \(visits)")
}, failure: { error in
    // Handle error during retrieval of the upcoming Visits
    print("Failed to retrieve upcoming Visits with error: \(error)")
})

Get Past Visits

Retrieves the list of upcoming Visits.

Parameter

Type

Description

success

Closure

A closure that is called when the retrieval of the past Visits is successful. It takes an array of Visit objects as a parameter, representing the list of upcoming Visits.

failure

Closure

A closure that is called when an error occurs during the retrieval of the past Visits. It takes an Error as a parameter, indicating the cause of the failure.

Example Usage

Code Block
VisitService.shared.getPastVisit(success: { visits in
    // Handle successful retrieval of the past Visits
    print("Upcoming Visits: \(visits)")
}, failure: { error in
    // Handle error during retrieval of the past Visits
    print("Failed to retrieve upcoming Visits with error: \(error)")
})

Enter waiting room

Enter waiting room by native

Starts a Visit by using a native view with the provided visit.

...

Parameter

Type

Description

visit

Visit

The given visit for which to enter the waiting room.

Example Usage

Code Block
let visit = // Provide the Visit object with the desired configuration

// Call the method to start the Visit and navigate to the waiting room
VisitService.shared.enterWaitingRoomByNativeViewWithVisit(visit)

Enter waiting room by browser

Starts a Visit by initiating a browser call with the provided visit.

...

Parameter

Type

Description

visit

Visit

The given visit for which to enter the waiting room.

Example Usage

Code Block
let visit = // Provide the Visit object with the desired configuration

// Call the method to start the Visit and navigate to the waiting room
VisitService.shared.enterWaitingRoomByBrowserCallWithVisit(visit)