Integrating with Epic

This article details the process of integrating your application with Epic using Vidyo SDK. This integration enables launching video calls directly from the Epic workflow. A critical component is the proper handling of Epic's context data (extData) to ensure seamless data flow.

Prerequisites

  • Connector SDK integrated into your application.

  • Access to an Epic environment configured on your VidyoPortal

Integration Steps

Obtain Epic data from VidyoPortal

At this step you acquire the room key and display name by making an https request to the VidyoPortal, passing it the Epic encrypted data.

NSString *url = [NSString stringWithFormat:@"%@/join/?extDataType=1&extData=%@", [portal text], [encryptedData text]];
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]
                                                             cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
                                                             timeoutInterval:10];
[urlRequest setHTTPMethod: @"GET"];
...
  • portal: The base URL of the video conferencing service.

  • extDataType=1: A parameter indicating the type of external data (should be 1).

  • extData: The encrypted data received from Epic (crucially included in the request).

Now you parse the response to construct the protocol handler URL, get actual room key and your display name for connecting.

NSRange r1 = [urlResponseStr rangeOfString:@"vidyo://join?"];
NSString *substr = [urlResponseStr substringFromIndex:r1.location];
NSRange r2 = [substr rangeOfString:@"\";"];
NSString *protocolHandlerURL = [substr substringToIndex:r2.location];

NSURLComponents *urlComponents = [NSURLComponents componentsWithString:protocolHandlerURL];
NSArray *queryItems = urlComponents.queryItems;
NSString *portal = [self valueForKey:@"portal" fromQueryItems:queryItems];
NSString *roomKey = [self valueForKey:@"roomKey" fromQueryItems:queryItems];
NSString *displayName = [self valueForKey:@"dispName" fromQueryItems:queryItems];
NSString *extData = [self valueForKey:@"extData" fromQueryItems:queryItems]; // Extract extData

Parameters being extracted:

  • portal: The VidyoPortal service URL.

  • roomKey: The unique identifier for the video call.

  • displayName: The name of the user joining the call.

  • extData: Epic's context data.

Set Epic context into Connector SDK

Before connecting to the call, use the setAdvancedOptions() API of the Video Conferencing SDK to provide the extData. This step is essential for the Epic integration, as it passes context about the patient into the call.

NSString *advancedOptions = [NSString stringWithFormat:@"{ \"extDataType\": \"1\", \"extData\": \"%@\" }", [encryptedData text]]; // Use original Epic encryptedData
[vc setAdvancedOptions:[advancedOptions UTF8String]];

Connect to the Call

Finally, use the connectToRoomAsGuest() API of the Connector SDK to establish the video call connection using the extracted parameters.

[vc connectToRoomAsGuest:[[portal text] UTF8String]
                        DisplayName:[[displayName text] UTF8String]
                            RoomKey:[[roomKey text] UTF8String]
                            RoomPin:@""
                  ConnectorIConnect:self];

Last updated