Skip to main content

Iframe integration

Introduction

We call iframe the situation wherein customers decide to develop an integration that sends us a minimal amount of data, and shows the output on a very small pre-designed interface that is embedded into their system and that can be easily personalised.

This document outlines the steps required to integrate our iFrame within a native iOS application. It includes a demonstration video which exhibits the functionality of our iFrame within an application and provides evidence of successful camera integration.

Access

To integrate our iFrame into your application, you should embed the following URL: https://iframe.legit.health.

The URL supports the following parameters:

  • company - This is an identifier that we provide for you to use our integration.
  • companyCallbackUrl - This parameter allows overriding the client callback URL to which the diagnostic report will be sent.
  • extraData - This parameter supports a string with additional values that you would like to be recorded in the report (for example, patient identifiers). This value is not visible to the user.
  • primary and secondary - These parameters accept hexadecimal colors to customize the interface.
  • fontFamily- This paramater allows to set the font family used. Supported values are: Roboto and Montserrat.
  • isResultEnabled - This parameter allows the activation or deactivation of the result display for the user.
  • isForPatient - This parameter simplifies questionnaire text for patient-friendly use.
  • locale- This paramater allows to set the locale of the application. Supported values are: en and es.
  • showQuestionnaireTitle - This parameter allows to show / hide the title above questionnaire form. Its default value is 1
  • disableCallbackOnConclusive - When a provided set of images has a conclusive diagnostic, severity assessment can be calculated. This parameter allows to skip sending a callback with the diagnosis support result, so only a callback with the diagnosis support and severity assessment is sent.
  • enableAnamnesis: This parameter allows to show / hide the anamnesis form. Its default value is 0
  • Activate the camera component. Certain frameworks, including Ionic, restrict camera access in iframe contexts when using a file input type. To override this, configure the following parameters:
    • enableCamera=1 - Enables the camera component, which is off by default (0).
    • enableCameraForAndroid=1 - Specifically activates the camera for Android devices, where it is also disabled by default (0).

How to get a company identifier

In case you want to generate application keys for your company with a given expiration date, you can use this endpoint of our Deep Link API to generate one before showing the iFrame:

Create Company App Key

AI Output

For a complete understanding of the AI output, you can visit the sections of our documentation where you can see the values we compute depending on the use case: diagnostic support or severity measurement.

Further reading

Please read the Output section of the documentation for more info.

Further, the information we will send from our server to yours can be found at the following link:

Patient Input

As shown in the linked video, the patient only needs to fill in the body area and add the image. If our AI detects with high probability the presence of a particular pathology, an additional screen with the clinical questionnaires associated with it is presented.

For example, if the lesion appears to be Psoriasis with a 98% probability, the patient will need to fill out the questions related to the APASI to obtain additional information in the report, such as the severity measurement of the lesion.

Customizations

Patient use

When the primary users of the iFrame are patients, you can utilize the isForPatient=1 parameter within the URL. Activating this option will modify the text within the questionnaires to make them more user-friendly.

For instance, instead of displaying the basic label Itchiness for the itchiness question, the text will be transformed into a more straightforward query: How would you describe how itchy you feel? This enhancement aims to improve the questionnaire's accessibility and ease of completion for patients.

Visibility of the results

The results can be shown or hidden to users depending on the param isResultEnabled. The default behavior is showing the results to the user after he or she has uploaded the photo, but you can pass isResultEnabled=0 to show only a message.

Colors and font family

Primary and secondary colors can be customized using the params primary and secondary in the URL.

You can also select which font family you want to use. Currently we support Roboto and Montserrat.

Language

The language of the iFrame can be customized using the param locale and providing the values es or en.

Extra data

Given that you have available the extraData field that accepts any string, you can pass any additional value you need to be attached to the report. For example, if you need to pass patient and insurance provider information, you would do it as follows:

const data = toBase64(
JSON.stringify({ patient: "XXX", insuranceProvider: "YYY" })
);

Anamnesis questionnaire

The parameter enableAnamnesis allows to show / hide the anamnesis form. The default value is 0 so you need to pass enableAnamnesis=1 to show the anamnesis form.

The anamnesis questionnaire is a set of questions that are asked to the patient to gather information about the patient's medical history:

  1. What is the reason for the consultation? How did the problem start? Describe the origin.
  2. Do you have any allergies, especially to medications? If yes, list allergies.
  3. Are you taking any medication or treatment? If yes, explain what treatment you are taking.
  4. Do you have any major illness? Have you had anything operated on?
  5. Is there a history of any major illness in your family?

Questionnaires

The parameter showQuestionnaireTitle allows to show / hide the title above the questionnaires, the one that shows the text "Medical questionnaire" / "Cuestionario clínico".

Enable camera component

Frameworks such as Ionic are pivotal in developing cross-platform mobile and web applications. They, however, present certain limitations concerning hardware access—camera access, in particular—especially when operating within an iframe. Typically, Ionic and frameworks alike restrict camera access when a file type input element is utilized within an iframe. This limitation can significantly impede the functionality of solutions that depend on immediate camera access.

info

Based on our experience, this issue predominantly affects Android devices displaying our solution within an iframe in an Ionic-developed application. Therefore, you might only need to use the enableCameraForAndroid parameter.

To circumvent these limitations, we've engineered a bespoke component that facilitates camera access within the iframe. This component can be activated by appending the following parameters to the URL:

  • enableCamera=1: Activating this parameter (1) enables the camera component inside the iframe. By default, this component is deactivated (enableCamera=0), as a "file" type input typically suffices in most scenarios.

  • enableCameraForAndroid=1: Acknowledging the diverse capabilities and operating systems of devices, this parameter is explicitly designed for Android devices, enabling the camera component on these platforms. The camera component remains disabled for Android devices by default (enableCameraForAndroid=0).

This approach ensures that our solution remains versatile and user-friendly, adapting to the specific needs and configurations of various devices and operating systems while overcoming the inherent limitations of using iframe in frameworks like Ionic.

Messages posted from iFrame

Integration instructions

iOS

The iFrame will send messages via the webkit bridge. You can listen for this messages to close the iFrame or direct the user elsewhere in your application.

Below is the corresponding Swift code that allows you to display the iFrame in your app and respond to the events posted.

struct WebView: UIViewRepresentable {
@Binding var path: NavigationPath

class Coordinator: NSObject, WKNavigationDelegate, WKScriptMessageHandler {
var webView: WKWebView?
var onMessageReceived: (Any) -> Void

required init(onMessageReceived: @escaping (Any) -> Void) {
self.onMessageReceived = onMessageReceived
super.init()
}

func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
self.webView = webView
}

// Receive message from WKWebView
func userContentController(
_ userContentController: WKUserContentController,
didReceive message: WKScriptMessage
) {
print(message.body)
self.onMessageReceived(message.body)
}

}

func onMessageReceived(body: Any) -> Void {
DispatchQueue.main.async {
path.append(body as! String)
}
}

func makeCoordinator() -> Coordinator {
return Coordinator(onMessageReceived: onMessageReceived)
}

func makeUIView(context: Context) -> WKWebView {
let coordinator = makeCoordinator()
let userContentController = WKUserContentController()
userContentController.add(coordinator, name: "bridge")

let configuration = WKWebViewConfiguration()
configuration.userContentController = userContentController

let _wkwebview = WKWebView(frame: .zero, configuration: configuration)
_wkwebview.navigationDelegate = coordinator

return _wkwebview
}

func updateUIView(_ webView: WKWebView, context: Context) {
let companyIdentifier = AppConfig.companyIdentifier
let request = URLRequest(url: URL(string: "https://iframe.legit.health/?company=" + companyIdentifier)!)

webView.load(request)
}
}

This Swift code creates a WebView struct that conforms to UIViewRepresentable, allowing for communication between your web content and native app through the bridge message handler. The WebView's Coordinator class listens for events rom the iFrame and respond to them accordingly.

Android

In case you are developing an Android application, you should pass an object called legitHealthJsObject to our iframe using WebViewCompat

Analysis Completed Message

When the analysis of the image has been completed and the result is available, the iFrame will post a message through three different channels depending on the type of the integration.

The posted messaged contains the anonymousDiagnosticReportId, which is the identifier of the generated diagnostic report. You can use it to retrieve the complete report by consumming the endpoint described here: getting an Anonymous Diagnostic Report

Web

In case you are embedding our iFrame in a web based application, the iFrame will send a message via the postMessage after the image is processed.

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

You can listen this message with a regular event listener:

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

iOS

The iFrame will send a message via the webkit bridge after the image is processed.

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

Android

The iFrame will send a message via the legitHealthJsObject after the image is processed.

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

Invalid Company Key

When then iFrame cannot be loaded because of an invalidad company key, the iFrame will post a message through three different channels depending on the type of the integration.

Web

In case you are embedding our iFrame in a web based application, the iFrame will send a message via the postMessage if the company key is invalid.

window.parent.postMessage(
{
message: "invalid_company_key",
id: companyKey,
},
"*"
);

iOS

The iFrame will send a message via the webkit bridge if the company key is invalid.

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

Android

The iFrame will send a message via the legitHealthJsObject if the company key is invalid.

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

Callbacks

Callback URL

Upon the successful processing of each uploaded image, our server dispatches a JSON payload containing detailed information about the diagnostic process to the configured endpoint. This JSON payload encapsulates multiple layers of diagnostic data and metrics. Here's an example of what you can expect:

{
"id": "0189bafa-0610-7349-a0ab-eb53695b27fd",
"url": "https://iframe.legit.health?companyId=XXXX&diagnosticReportId=signedId",
"pdf": "https://back-{pre}.legit.health/s2s-api/v2/anonymous-diagnostic-reports/encryptedId?format=pdf",
"extraData": "some extra data",
"patientIdentifier": "patient identifier",
"visitIdentifier": "visit identifier",
"anamnesisQuestions": [
{
"question": "What is the reason for the consultation? How did the problem start? Describe the origin.",
"answer": "I have acne on my face and neck. It started 2 months ago."
},
{
"question": "Do you have any allergies, especially to medications? If yes, list allergies."
"answer": "No"
},
{
"question": "Are you taking any medication or treatment? If yes, explain what treatment you are taking.",
"answer": "No"
},{

"question": "Do you have any major illness? Have you had anything operated on?",
"answer": "No"
},
{
"question": "Is there a history of any major illness in your family?",
"answer": "No"
}
],
"pathology": {
"name": "Acne",
"code": "Acne"
},
"bodySite": {
"code": "HEAD_FRONT",
"name": "Face and neck"
},
"createdAt": "2023-08-03T12:38:10+02:00",
"supportingInfo": [
{
"type": "DiagnosticReport",
"subtype": "DiagnosisSupport",
"reference": {
"id": "018cceda-771d-7b9d-918a-f1171443fd6c",
"observations": [
{
"originalMedia": {
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/foo.jpg",
"type": "Image",
"modality": "Clinical",
"diqaScore": 85.0
},
"explainabilityMedia": null
},
{
"originalMedia": {
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/bar.jpg",
"type": "Image",
"modality": "Clinical",
"diqaScore": 89.0
},
"explainabilityMedia": null
}
]
}
}
],
"result": {
"id": "0189bafa-0610-7349-a0ab-eb536a2185f6",
"metrics": {
"sensitivity": 83.31,
"specificity": 99.53
},
"preliminaryFindings": {
"hasConditionSuspicion": 100,
"isPreMalignantSuspicion": 0.02,
"isMalignantSuspicion": 0,
"needsBiopsySuspicion": 0,
"needsSpecialistsAttention": 100
},
"iaSeconds": 0.88273024559021,
"observations": [
{
"originalMedia": {
"type": "Image",
"modality": "Clinical",
"diqaScore": 86,
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/bbb.png"
},
"explainabilityMedia": {
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/ccc.png"
}
},
{
"originalMedia": {
"type": "Image",
"modality": "Clinical",
"diqaScore": 86,
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/bbb.png"
},
"explainabilityMedia": null
}
],
"conclusions": [
{
"probability": 99.65,
"pathology": {
"name": "Acne",
"code": "Acne"
}
},
{
"probability": 0.06,
"pathology": {
"name": "Varicella",
"code": "Varicella"
}
},
{
"probability": 0.05,
"pathology": {
"name": "Impetigo",
"code": "Impetigo"
}
},
{
"probability": 0.03,
"pathology": {
"name": "Rosacea",
"code": "Rosacea"
}
},
{
"probability": 0.02,
"pathology": {
"name": "Dermatitis",
"code": "Dermatitis"
}
}
],
"scoringSystems": [
{
"scoringSystem": {
"name": "Acne lesion estimation grading index",
"code": "ALEGI"
},
"score": 8,
"scoreCategorySeverity": 1,
"scoreCategories": [
{
"code": "None",
"category": "None",
"min": 0.0,
"max": 0.0,
"severity": 1,
"severityAsString": "low"
},
{
"code": "Grade 1",
"category": "Grade 1",
"min": 0.0,
"max": 10.0,
"severity": 1,
"severityAsString": "low"
},
{
"code": "Grade 2",
"category": "Grade 2",
"min": 10.0,
"max": 20.0,
"severity": 1,
"severityAsString": "low"
},
{
"code": "Grade 3",
"category": "Grade 3",
"min": 20.0,
"max": 30.0,
"severity": 2,
"severityAsString": "moderate"
},
{
"code": "Grade 4",
"category": "Grade 4",
"min": 30.0,
"max": 40.0,
"severity": 2,
"severityAsString": "moderate"
},
{
"code": "Grade 4",
"category": "Grade 4",
"min": 40.0,
"max": 50.0,
"severity": 2,
"severityAsString": "moderate"
},
{
"code": "Grade 5",
"category": "Grade 5",
"min": 50.0,
"max": 60.0,
"severity": 2,
"severityAsString": "moderate"
},
{
"code": "Grade 6",
"category": "Grade 6",
"min": 60.0,
"max": 70.0,
"severity": 3,
"severityAsString": "high"
},
{
"code": "Grade 7",
"category": "Grade 7",
"min": 70.0,
"max": 80.0,
"severity": 3,
"severityAsString": "high"
},
{
"code": "Grade 8",
"category": "Grade 8",
"min": 80.0,
"max": 90.0,
"severity": 3,
"severityAsString": "high"
},
{
"code": "Grade 9",
"category": "Grade 9",
"min": 90.0,
"max": 100.0,
"severity": 3,
"severityAsString": "high"
}
],
"resultScoringSystemFacets": [
{
"facet": {
"name": "Acne lesion density",
"description": ""
},
"valueToDisplay": "None (0)",
"rawValue": 0
},
{
"facet": {
"name": "Number of lesions",
"description": ""
},
"valueToDisplay": "Mild (0-10)",
"rawValue": 5
}
]
}
]
}
}

Fundamental fields

  • id: A unique identifier of the Diagnostic Report.
  • url: link to visualize the diagnostic report inside Legit.Health's interface.
  • extraData: A string value passed as a query parameter when you loaded the iFrame.
  • patientIdentifier: A user identifier in your system, passed as a query parameter when you loaded the iFrame.
  • createdAt: Timestamp indicating the time of creation for this diagnostic report.

Supporting info

In our iFrame integration, the application can initiate two types of requests:

  1. Diagnosis Support Request: This request utilizes multiple images to estimate the most probable pathology.

  2. Severity Assessment Request: This request involves the use of the most representative image from the previous set if the confidence of the Diagnosis Support Request surpasses a specific threshold.

For the callback related to the Severity Assessment, we provide a set of images used in the Diagnosis Support Request under the property SupportingInfo. The type and subtype of the object indicate that it is associated with the diagnostic report generated to calculate the most likely pathology.

"supportingInfo": [
{
"type": "DiagnosticReport",
"subtype": "DiagnosisSupport",
"reference": {
"id": "018cceda-771d-7b9d-918a-f1171443fd6c",
"observations": [
{
"originalMedia": {
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/foo.jpg",
"type": "Image",
"modality": "Clinical",
"diqaScore": 85.0
},
"explainabilityMedia": null
},
{
"originalMedia": {
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/bar.jpg",
"type": "Image",
"modality": "Clinical",
"diqaScore": 89.0
},
"explainabilityMedia": null
}
]
}
}
]

For a comprehensive understanding of the callback flow, please refer to this link: iFrame's callback mechanism.

Body site and pathology

These fields contain information about the location (bodySite) and type (pathology) of the lesion captured in the image. These fields are populated when the likelihood of the most probable conclusion surpasses a predetermined threshold or if it was set during image submission.

"bodySite": {
"code": "HEAD_FRONT",
"name": "Face and neck"
},
"pathology": {
"name": "Acne",
"code": "Acne"
}

Anamnesis questions

The anamnesisQuestions field is an array of questions and their corresponding answers. These questions are asked to the patient before the image is submitted for analysis and their objetive is to gather information about the patient's medical history:

"anamnesisQuestions": [
{
"question": "What is the reason for the consultation? How did the problem start? Describe the origin.",
"answer": "I have acne on my face and neck. It started 2 months ago."
},
{
"question": "Do you have any allergies, especially to medications? If yes, list allergies."
"answer": "No"
},
{
"question": "Are you taking any medication or treatment? If yes, explain what treatment you are taking.",
"answer": "No"
},{

"question": "Do you have any major illness? Have you had anything operated on?",
"answer": "No"
},
{
"question": "Is there a history of any major illness in your family?",
"answer": "No"
}
]

Diagnostic result

The result field encapsulates the comprehensive results of the diagnostic process. This includes:

  • metrics: Measures of sensitivity and specificity of the diagnostic process.
"metrics": {
"sensitivity": 83.31,
"specificity": 99.53
}
  • preliminaryFindings: An array of preliminary suspicions and their likelihoods, including the probability of malignancy and the requirement for a biopsy.
"preliminaryFindings": {
"hasConditionSuspicion": 100,
"isPreMalignantSuspicion": 0.02,
"isMalignantSuspicion": 0,
"needsBiopsySuspicion": 0,
"needsSpecialistsAttention": 100
}
  • iaSeconds: The processing time consumed by the AI for image analysis.

Observations

The observations field is an array of medias, each containing two fields: originalMedia and explainabilityMedia.

originalMedia: the media sent to the algorithm to be analyzed. It includes:

  • type: The format of the image.
  • modality: The context or manner of the image capture.
  • diqaScore: The Dermatology Image Quality Assessment (DIQA) score.
  • url: The direct S3 URL to the image. It is a time-limited signed URL; download it within 30 minutes of generation if you plan to use it later.

explainabilityMedia: the processed image highlighting the area of the lesion analyzed by the AI. Like the original image, this is also a time-limited S3 URL, so remember to download it within 30 minutes if needed. The explainabilityMedia contains either null or the URL of an image that demonstrates what their severity estimation algorithms have "seen". Here's a detailed explanation:

  • If there's no conclusive diagnosis for the analyzed image, this field is set to null.
  • If there is a conclusive diagnosis for the analyzed image, but it belongs to a group of pathologies for which severity is not yet measured, this field is again null.
  • Finally, if there is a conclusive diagnosis for the analyzed image and a trained algorithm to measure severity, this field contains the URL to an image that shows the analyzed signs.
"observations": [
{
"originalMedia": {
"type": "Image",
"modality": "Clinical",
"diqaScore": 86,
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/bbb.png"
},
"explainabilityMedia": {
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/ccc.png"
}
},
{
"originalMedia": {
"type": "Image",
"modality": "Clinical",
"diqaScore": 86,
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/bbb.png"
},
"explainabilityMedia": null
}
]

Diagnostic conclusions

The conclusions field is an array of diagnostic outcomes, each containing a pathology type and its associated probability.

"conclusions": [
{
"probability": 99.65,
"pathology": {
"name": "Acne",
"code": "Acne"
}
},
{
"probability": 0.06,
"pathology": {
"name": "Varicella",
"code": "Varicella"
}
},
{
"probability": 0.05,
"pathology": {
"name": "Impetigo",
"code": "Impetigo"
}
},
{
"probability": 0.03,
"pathology": {
"name": "Rosacea",
"code": "Rosacea"
}
},
{
"probability": 0.02,
"pathology": {
"name": "Dermatitis",
"code": "Dermatitis"
}
}
]

Scoring systems

The scoringSystems field houses one or more scoring models for the identified pathology. These models come into play when the likelihood of the most probable conclusion surpasses a certain threshold.

"scoringSystems": [
{
"scoringSystem": {
"name": "Acne lesion estimation grading index",
"code": "ALEGI"
},
"score": 8,
"scoreCategorySeverity": 1,
"scoreCategories": [
{
"code": "None",
"category": "None",
"min": 0.0,
"max": 0.0,
"severity": 1,
"severityAsString": "low"
},
{
"code": "Grade 1",
"category": "Grade 1",
"min": 0.0,
"max": 10.0,
"severity": 1,
"severityAsString": "low"
},
{
"code": "Grade 2",
"category": "Grade 2",
"min": 10.0,
"max": 20.0,
"severity": 1,
"severityAsString": "low"
},
{
"code": "Grade 3",
"category": "Grade 3",
"min": 20.0,
"max": 30.0,
"severity": 2,
"severityAsString": "moderate"
},
{
"code": "Grade 4",
"category": "Grade 4",
"min": 30.0,
"max": 40.0,
"severity": 2,
"severityAsString": "moderate"
},
{
"code": "Grade 4",
"category": "Grade 4",
"min": 40.0,
"max": 50.0,
"severity": 2,
"severityAsString": "moderate"
},
{
"code": "Grade 5",
"category": "Grade 5",
"min": 50.0,
"max": 60.0,
"severity": 2,
"severityAsString": "moderate"
},
{
"code": "Grade 6",
"category": "Grade 6",
"min": 60.0,
"max": 70.0,
"severity": 3,
"severityAsString": "high"
},
{
"code": "Grade 7",
"category": "Grade 7",
"min": 70.0,
"max": 80.0,
"severity": 3,
"severityAsString": "high"
},
{
"code": "Grade 8",
"category": "Grade 8",
"min": 80.0,
"max": 90.0,
"severity": 3,
"severityAsString": "high"
},
{
"code": "Grade 9",
"category": "Grade 9",
"min": 90.0,
"max": 100.0,
"severity": 3,
"severityAsString": "high"
}
],
"resultScoringSystemFacets": [
{
"facet": {
"name": "Acne lesion density",
"description": ""
},
"valueToDisplay": "None (0)",
"rawValue": 0
},
{
"facet": {
"id": 108,
"inputAdornment": null,
"allowsInputFromUser": false,
"name": "Number of lesions",
"description": ""
},
"valueToDisplay": "Mild (0-10)",
"rawValue": 5
}
]
}
]

In each scoring system:

  • scoringSystem includes the name and code of the scoring methodology.
  • score indicates the calculated score according to the system's rules.
  • scoreCategorySeverity signifies the severity associated with the computed score. It has three possible values:
    • 1: low
    • 2: moderate
    • 3: high
  • resultScoringSystemFacets is an array of facets used in score calculation, with each object containing the facet's information and the corresponding raw and displayed values.

Comprehensive scoring systems information

For an exhaustive understanding of scoring systems, their identifiers, and facets, you can download the detailed documentation:

Overwriting callback URL

During the configuration process, the integrator must provide a callback URL to which to send the diagnostic reports. This URL can be customized at iFrame level through the paramater companyCallbackUrl, for example:

https://iframe.legit.health/?company=XXX&companyCallbackUrl=http://someserver.dev

Disable Callback On Conclusive

This is the iFrame workflow:

  • Initial Request: Upon receiving a set of images from the user, our system initiates a diagnostic support request, processed by our AI algorithms.
  • Confidence Assessment: If the confidence level of the AI analysis exceeds a predetermined threshold, the iFrame triggers a second request. This request is specifically for conducting a severity assessment, focusing on the most suitable image from the provided set.
  • Report Finalization: In scenarios where the AI's confidence does not meet the threshold, the diagnostic process is considered complete at this stage.

Two-Stage Diagnostic Reporting

Our system generates two types of diagnostic reports based on the AI's confidence assessment:

  1. Intermediate Report: This includes the initial diagnostic support result. It is generated when the AI's confidence is below the threshold or when the severity assessment is pending.
  2. Final Report: This comprehensive report encompasses both the initial diagnostic support and the severity assessment results. It is produced when the AI's confidence is high enough to proceed with the severity assessment.

Callback Mechanism

Both diagnostic reports are sent to the callback URL provided by you. This ensures you receive all relevant analysis data. However, there may be scenarios where receiving only the final report is more beneficial, especially to avoid processing intermediate results.

flowchart TD A[Complete the form] --> B[Send diagnostic support request] B --> C{Is AI confidence above threshold?} C -- Yes --> D{is disableCallbackOnConclusive set to 1?} C -- No --> E[Generate diagnosis support report] E --> F[Send callback] D -- No --> G[Send callback with intermediate report] D -- Yes --> H[Skip send callback with intermediate report] G --> I[Choose most representative image] H --> I[Choose most representative image] I --> J[Send severity assessment request for most representative image] J --> K[Generate severity assessment report] K --> L[Send Callback]

disableCallbackOnConclusive parameter

This is where the disableCallbackOnConclusive parameter becomes crucial:

  • Parameter Value 0 (Default): The callback mechanism operates in its default mode, sending both the intermediate and final diagnostic reports to your specified callback URL.
  • Parameter Value 1: Activating this mode (disableCallbackOnConclusive=1) modifies the callback behavior. In this scenario, if the initial set of images results in a conclusive diagnosis (i.e., high AI confidence), the intermediate diagnostic report is not sent to your callback. Instead, only the final report, inclusive of both diagnostic support and severity assessment, is transmitted.
Purpose of disableCallbackOnConclusive

This parameter provides a crucial customization option, enabling you to streamline the diagnostic reporting process. By setting disableCallbackOnConclusive=1, you effectively reduce the data processing load, focusing only on the comprehensive final reports, which might be more pertinent for conclusive diagnostic scenarios.

Implementation Guidance:

  • URL Integration: Ensure that the disableCallbackOnConclusive parameter is correctly embedded in the URL used for the iFrame request.
  • Testing: It's important to test both settings of the parameter (0 and 1) to confirm that the callback behavior aligns with your operational preferences and requirements.

This parameter is designed to offer you flexibility and control over the diagnostic information flow, ensuring that you receive the data most relevant to your needs.

PDF Generation

For details on how to generate a PDF report, please refer to the following endpoint: Get Anonymous Diagnostic Report