VirtualService
public protocol VirtualService
Base Protocol to create, setup, cancel Virtual Visits
-
Resumes a Virtual Visit
Precondition
Must callpatientService.getPatient()before calling this methodDeclaration
Swift
func resumeVirtualVisit(visitId: String, presentingViewController: UIViewController, dexCarePatient: DexcarePatient, onCompletion: @escaping VisitCompletion, success: @escaping () -> Void, failure: @escaping (VirtualVisitFailedReason) -> Void)Parameters
visitIdAn existing VisitId that is active
presentingViewControllerA ViewController from which the DexcareSDK will present the waiting room view and eventually the virtual meeting
dexCarePatientThe DexcarePatient for this visit, loaded from a previous
patientService.getPatient()call. This patient’s display name will be used during the visit.onCompletionA closure called when a visit has been completed successfully or has ended with an error. A VisitCompletionReason is passed in as a paramter.
successA closure called when a visit is successfully resumed.
failureA closure called if any FailedReason errors are returned
-
Updates a push notification device token
Declaration
Swift
func updatePushNotificationDeviceToken(token: Data)Parameters
tokena device token that is returned by an iOS device in AppDelegate.application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
-
Submit the patient feedback questions and answers for a virtual visit.
Precondition
Must callvisitService.startVirtualVisitorvisitService.resumeVirtualVisitbefore calling this methodDeclaration
Swift
func postFeedback(feedbacks: [VirtualFeedback], success: @escaping () -> Void, failure: @escaping (FailedReason) -> Void)Parameters
feedbacksAn array of
VirtualFeedbackenums, each representing a single feedback question and answer asked to the patient.successclosure when the feedback has been posted successfully
failureclosure when the feedback posting failed
-
Cancels an existing valid virtual visit.
Declaration
Swift
func cancelVirtualVisit(visitId: String, success: @escaping () -> Void, failure: @escaping (VirtualVisitFailedReason) -> Void)Parameters
successclosure when the visit was successfully cancelled
failureclosure when the cancel visit fails. If
VirtualVisitFailedReason.virtualVisitNotFoundis returned it means the visit no longer exists. -
startVirtualVisit(presentingViewController:paymentMethod: virtualVisitInformation: catchmentArea: patientDexCarePatient: actorDexCarePatient: practiceId: onCompletion: success: failure: ) Starts a virtual visit using a Practice
Call this method to create a new virtual visit and show its full-screen user interface on the specified view controller. Before calling this method, at least one patient must be created by calling patientService.findOrCreatePatient() if the current user is the patient, patientService.findOrCreateDependentPatient() if the patient is a dependent (anyone other than the logged in user) must call.
If the patient already exists, you do not need to call the above method, but the demographic must exist in the ehrSystem you are trying to book to.
Declaration
Swift
func startVirtualVisit(presentingViewController: UIViewController, paymentMethod: PaymentMethod, virtualVisitInformation: VirtualVisitInformation, catchmentArea: CatchmentArea, patientDexCarePatient: DexcarePatient, actorDexCarePatient: DexcarePatient?, practiceId: String, onCompletion: @escaping VisitCompletion, success: @escaping (String) -> Void, failure: @escaping (VirtualVisitFailedReason) -> Void)Parameters
presentingViewControllerA view controller from which the virtual visit UI (waiting room, video call screen, feedback) will be presented.
paymentMethodAn enumeration with payment/billing information for this visit
virtualVisitInformationA struct containing information specific to this visit request
catchmentAreaA struct containing information about an EHRSystem and a department Id used to book the virtual visit. If unknown, you can call
PatientService.getCatchmentAreato get the object or create your own based on and existing EHRSystem and DepartmentIdpatientDexCarePatienta dexcare Patient object used to book the virtual visit under. When booking for a dependent, this will be the dependent patient. Note: The SDK will use the demographic that has the same EHRSystem as the catchmentArea.
actorDexCarePatienta dexcare Patient object when booking a virtual visit for a dependent. A
relationshipToPatientmust be set on the demographic in order to book. Note: The SDK will use the demographic that has the same EHRSystem as the catchmentArea.practiceIdan UUID string of the
VirtualPracticeof where the virtual visit is being scheduledonCompletionA closure called when a visit has been completed successfully or has ended with an error. A VisitCompletionReason is passed in as a paramter.
successA closure called when a visit is successfully created. The new visitId is passed back as the only parameter.
failureA closure called if any FailedReason errors are returned
-
Sets the delegate to invoke various events allowing you to capture analytics.
Note
SeeVirtualEventDelegatefor more informationDeclaration
Swift
func setVirtualEventDelegate(delegate: VirtualEventDelegate?) -
Fetches the estimated
WaitTimefor a virtual visitImportant
WaitTimeis estimated and may change. The time returned should not be used as a definitive time when a Virtual Visit will begin.Declaration
Swift
func getEstimatedWaitTime(visitId: String, success: @escaping (WaitTime) -> Void, failure: @escaping (WaitTimeFailedReason) -> Void)Parameters
visitIdA
idfrom a start or a resume virtual visit.successA closure called with a
WaitTimereturn valuefailureA closure called if any
WaitTimeFailedReasonerrors are returned -
Gets the statistics report from the OpenTok (Vonage) SDK from a virtual visit. Virtual Visit must have been started in the current app session, and the Provider must have started the visit for this method to return any results. These statistics are only stored in memory, and are cleared upon starting a new visit, calling DexCareSDK.signOut(), or by closing the app (since they’re only in memory)
Note
SeeVideoCallStatisticsfor more information on values returnedDeclaration
Swift
func getVideoCallStatistics() -> VideoCallStatistics?Return Value
An optional
VideoCallStatisticsobject containing stats about the visit -
Fetches the latest status for a virtual visit
Declaration
Swift
func getVirtualVisitStatus(visitId: String, success: @escaping (VisitStatus) -> Void, failure: @escaping (FailedReason) -> Void)Parameters
visitIdA
idfrom a start or a resume virtual visit.successA closure called with a
VisitStatusenum return valuefailureA closure called if any
FailedReasonerrors are returned
View on GitHub
Install in Dash
VirtualService Protocol Reference