[iOS] Intake & Visit API
- 1 Intake
- 1.1 Intake Configuration
- 1.1.1 Properties
- 1.2 Initialization
- 1.3 Create intake
- 1.4 Update intake
- 1.1 Intake Configuration
- 2 Visit
- 2.1.1 Create visit from intake
- 2.1.2 Schedule a visit
- 2.1.2.1 Get consultation list
- 2.1.2.2 Example Usage
- 2.1.2.3 Update intake with consultation
- 2.1.2.4 Example Usage
- 2.1.2.5 Schedule visit with provided intake
- 2.1.2.6 Example Usage
- 2.1.3 Get current visit
- 2.1.3.1 Example Usage
- 2.1.4 Get Upcoming Visits
- 2.1.4.1 Example Usage
- 2.1.5 Get Past Visits
- 2.1.5.1 Example Usage
- 2.2 Enter waiting room
- 2.2.1 Enter waiting room by native
- 2.2.1.1 Example Usage
- 2.2.2 Enter waiting room by browser
- 2.2.2.1 Example Usage
- 2.2.1 Enter waiting room by native
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.
Â
public func createIntake(with config: IntakeConfig,
sucesss: @escaping (Intake) -> Void,
failure: @escaping (Error) -> Void)
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.
public func updateIntake(with params: [String: Any],
sucesss: @escaping () -> Void,
failure: @escaping (Error) -> Void)
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.
public func createVisitWithIntake(_ intake: Intake,
success: @escaping (Visit) -> Void,
failure: @escaping (Error) -> Void)
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.
Throws: A `ClinicError` if the current room is unavailable or if there is an issue retrieving valid consultations.
Returns: An optional array of `Consultation` objects that are visible to the patient. Returns `nil` if no valid consultations are found.
   This function fetches the current room from `VCNetworkManager`, retrieves the list of consultations associated with the room, and filters out consultations that are not visible to the patient. If successful, it returns an array of visible consultations; otherwise, it throws a `ClinicError` with a corresponding error message.
Example Usage
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
Â
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
Â
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
Â
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
Â
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
Â
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
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. |