Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
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 fromVCNetworkManager.shared()
.
Initialization
init(reasonForVisit:)
: Initializes anIntakeConfig
object with the given reason for visit.
Create intake
Create an intake with the provided configuration.
...
Parameter | Type | Description |
---|---|---|
|
| The intake configuration object. |
|
| A closure called when the intake creation is successful. It receives an |
|
| A closure called when an error occurs during the intake creation. It receives an |
Update intake
Update the current intake with the provided parameters.
...
Parameter | Type | Description |
---|---|---|
|
| The parameters to update the intake. |
|
| A closure called when the intake creation is successful. It receives an |
|
| A closure called when an error occurs during the intake creation. It receives an |
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 |
---|---|---|
|
| The intake object for the visit.. |
|
| A closure called when the visit creation is successful. It receives a |
|
| A closure called when an error occurs during the visit creation. It receives an |
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 |
---|---|---|
|
| The intake to be updated. |
|
| The consultation whose information will be used for updating the intake. |
|
| A closure to be executed upon successful update. |
|
| 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 |
---|---|---|
|
| The intake associated with the scheduled visit. |
|
| An optional provider object for the scheduled visit. |
|
| The room slot information for scheduling the visit. RoomSlot records visit start and end times, signaling availability status (booked or open). |
|
| A closure that is called when the Visit creation is successful. It takes a Visit object as a parameter, representing the created Visit. |
|
| 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 |
---|---|---|
|
| 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. |
|
| 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 |
---|---|---|
|
| 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. |
|
| 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 |
---|---|---|
|
| 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. |
|
| 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 |
---|---|---|
|
| 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 |
---|---|---|
|
| 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) |