Aller au contenu principal

analysis_completed

The iframe fires analysis_completed after the image has been processed and the diagnostic report is available.

The payload contains the anonymousDiagnosticReportId you use to retrieve the full report. See the Output section, Retrieve the report.

Web​

window.parent.postMessage(
{
message: "analysis_completed",
id: "anonymousDiagnosticReportId",
},
"*"
);

Listening:

window.addEventListener("message", function (event) {
if (event.data.message !== "analysis_completed") {
return;
}
console.log(event.data.id);
});

iOS​

The iframe posts the message through the webkit bridge:

if (window.webkit?.messageHandlers?.bridge) {
window.webkit.messageHandlers.bridge.postMessage(
JSON.stringify({
message: "analysis_completed",
id: "anonymousDiagnosticReportId",
})
);
}

For the Swift code that receives this message, see the Platforms → iOS page.

Android​

The iframe posts the message through legitHealthJsObject:

if (window.legitHealthJsObject) {
window.legitHealthJsObject.postMessage(
JSON.stringify({
message: "analysis_completed",
id: diagnosticReportId,
})
);
}

For the Android embedding details, see the Platforms → Android page.