Skip to main content

Embedded Iframe Events

General Concept​

These events are fired by the iframe to help maintain synchronization between the iframe and the embedding frame.

Usage​

Using either addEventListener() or the onmessage method, the parent frame can handle these events accordingly. Since postMessage() enables cross-orgin communication, it is recommended to filter messages that have https://staging.empego.ca in the origin property of the Message. ( Refer to the official security documentation for more details).

Example:​

window.addEventListener("message", function (event) {
if (event.origin === "https://staging.empego.ca") {
// Handle the message
console.log(event.data);
}
});

Export Event​

Triggered when an export operation occurs, this event returns the PDF summary and textual summary for the consultation or follow-up.

Data​

The data property of the Message includes this information :

Consultation - Export:​

FieldValue(s)
idUnique identifier of the Consultation
createdAtUTC Timestamp
eventTypeconsultation
operation[exportInProgress, exportReady]
tenantKeyUUID

Follow up - Export :​

FieldValue(s)
idUnique identifier of the Follow-up
createdAtUTC Timestamp
dataExport in progress \ Export ready
eventTypefollowup
operation[exportInProgress, exportReady]
tenantKeyUUID

Examples :​

Data processing​

{
"eventType": "consultation",
"id": "xxx-xx-xx-xx-xxxxxxxxx",
"operation": "exportInProgress",
"tenantKey": "xxxxxxxx-xx-xx-xx-xxxxxxx",
"createdAt": 1779214387288
}

Data ready​

{
"data": {
"pdfSummary": {
"fileURL": "https://artifacts.empego-dev-staging.name/xxxxxxxxx",
"fileURLExpiry": 1779214478522,
"status": "SUCCESS"
},
"textualSummary": {
"content": "example",
"status": "SUCCESS"
}
},
"eventType": "consultation",
"id": "xxx-xx-xx-xx-xxxxxxxxx",
"operation": "exportReady",
"tenantKey": "xxxxxxxx-xx-xx-xx-xxxxxxx",
"createdAt": 1779214387288
}

Data Failed to fetch​

{
"data": {
"pdfSummary": {
"status": "FAILURE"
},
"textualSummary": {
"content": "example",
"status": "SUCCESS"
}
},
"eventType": "consultation",
"id": "xxx-xx-xx-xx-xxxxxxxxx",
"operation": "exportReady",
"tenantKey": "xxxxxxxx-xx-xx-xx-xxxxxxx",
"createdAt": 1779214387288
}

Dashboard Polling Event​

Returns the number of items in each swimlane after every dashboard polling cycle, which occurs every 30 seconds or whenever a swimlane update is detected.

Data​

The data property of the Message includes this information :

Consultation - Polling:​

FieldValue(s)
createdAtUTC Timestamp
dataDashboard polling
eventTypeconsultation
operationdashboardPolling
tenantKeyUUID

Follow up - Polling :​

FieldValue(s)
createdAtUTC Timestamp
dataDashboard polling
eventTypefollowup
operationdashboardPolling
tenantKeyUUID

Example :​

Polling Data​

{
"data": {
"toBeAnalyzedCount": 23,
"inProgressCount": 12,
"doneCount": 0
},
"eventType": "consultation",
"operation": "dashboardPolling",
"tenantKey": "xxxxxxxx-xx-xx-xx-xxxxxxx",
"createdAt": 1779214387290
}