Skip to main content

Get a Diagnostic Report

The most important feature of the API integration is receiving a DiagnosticReport with the information created by the Artificial Intelligence.

We provide an endpoint to fetch a diagnostic report already present in the system. You only need the internal id of the diagnostic report in Legit.Health. This identifier is received in the JSON we send to your server every time a diagnostic report is created.

To get a diagnostic report, you must use the endpoint getDiagnosticReport.

A DiagnosticReport contains all the information related to an image uploaded for a patient and the corresponding result data generated by our AI algorithms.

Status: Preliminary

Please note that the status of the report is labelled as preliminary, as defined by the FHIR standard.

JSON Structure​

The typical JSON structure we will send to your servers is the following:

{
"id": "5194dae6-ab96-11ec-9c18-06ef9b8b6824",
"previousDiagnosticReportId": "9c511e48-fab4-11eb-9382-06ef9b8b6824",
"nextDiagnosticReportId": null,
"patient": {
"id": "054724e4-e4b5-11eb-979a-06ef9b8b6824",
"externalId": "2"
},
"encounters": [
{
"id": "054724e4-ab96-11eb-9c18-06ef9b8b6824",
"externalId": "3"
},
{
"id": "86753241-ab96-11eb-9c18-06ef9b8b6824",
"externalId": null
}
],
"condition": {
"id": 704,
"pathology": {
"name": "Psoriasis",
"code": "Psoriasis"
},
"bodySite": {
"code": "HEAD_FRONT",
"name": "Face and neck"
}
},
"originalMedia": {
"type": "Image",
"modality": "Clinical",
"diqaScore": 74,
"url": "https://legit-app-pre.s3.eu-west-3.amazonaws.com/signedPath"
},
"result": {
"id": "5194dd48-ab96-11ec-aead-06ef9b8b6824",
"metrics": {
"sensitivity": 82.69,
"specificity": 97.46
},
"preliminaryFindings": {
"isMalignantSuspicion": 0,
"hasConditionSuspicion": 100,
"isPreMalignantSuspicion": 0,
"adjustedIsPreMalignantSuspicion": null,
"needsBiopsySuspicion": 0,
"needsSpecialistsAttention": 100
},
"iaSeconds": 2.6534740924835,
"explainabilityMedia": {
"type": "Image",
"url": "https://legit-app-pre.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/2afcd009-3eef-4af1-8665-52e91cd7d4da-5178993a-ab96-11ec-84b5-06ef9b8b6824.jpg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA52A2ZCZF32OWDLDS%2F20220330%2Feu-west-3%2Fs3%2Faws4_request&X-Amz-Date=20220330T094629Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1800&X-Amz-Signature=127b72c450ab94979a467fbba8b250fc11a5e6905c1f568944635c5b6dfa9459"
},
"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": [
{
"pathology": {
"name": "Psoriasis",
"code": "Psoriasis"
},
"probability": 45.13
},
{
"pathology": {
"name": "Psoriasis inversa",
"code": "Psoriasis inversa"
},
"probability": 4.46
},
{
"pathology": {
"name": "Lichen simplex chronicus",
"code": "Lichen simplex chronicus"
},
"probability": 2.18
},
{
"pathology": {
"name": "Erythema multiforme",
"code": "Erythema multiforme"
},
"probability": 1.3
},
{
"pathology": {
"name": "Angiokeratoma",
"code": "Angiokeratoma"
},
"probability": 1.27
}
],
"scoringSystems": [
{
"scoringSystem": {
"name": "Local automatic psoriasis area and severity index",
"code": "APASI"
},
"score": 0.7,
"scoreCategory": "Moderate",
"scoreCategories": [
{
"code": "None",
"min": 0,
"max": 0,
"severity": 1,
"severityAsString": "low",
"category": "None"
},
{
"code": "Mild",
"min": 0,
"max": 2.8,
"severity": 1,
"severityAsString": "low",
"category": "Mild"
},
{
"code": "Moderate",
"min": 2.8,
"max": 6,
"severity": 2,
"bodySite": "LEG_LEFT",
"severityAsString": "moderate",
"category": "Moderate"
},
{
"code": "Severe",
"min": 6,
"max": 28.8,
"severity": 3,
"bodySite": "LEG_LEFT",
"severityAsString": "high",
"category": "Severe"
}
],
"resultScoringSystemFacets": [
{
"facet": {
"name": "Affected area",
"description": "This value corresponds to the percentage of involvement of the specific area of the body you are reporting"
},
"valueToDisplay": "10% (1)",
"rawValue": 1
},
{
"facet": {
"name": "Redness",
"description": "This value corresponds to the redness intensity of the lesion"
},
"valueToDisplay": "Moderate (3)",
"rawValue": 3
},
{
"facet": {
"name": "Induration",
"description": "This value corresponds to the hardening intensity of the lesion"
},
"valueToDisplay": "Moderate (2)",
"rawValue": 2
},
{
"facet": {
"name": "Desquamation",
"description": "This value corresponds to the shedding intensity of the outermost layer of skin of the affected zone"
},
"valueToDisplay": "Moderate (2)",
"rawValue": 2
}
],
"history": [
{
"date": "2021-07-14T15:09:38+00:00",
"score": 2.4,
"scoreCategory": "Severe"
},
{
"date": "2021-08-05T10:49:13+00:00",
"score": 1.6,
"scoreCategory": "Severe"
},
{
"date": "2021-08-11T14:58:38+00:00",
"score": 10,
"scoreCategory": "Severe"
},
{
"date": "2022-03-24T17:17:22+00:00",
"score": 0.7,
"scoreCategory": "Moderate"
}
],
"reduction": 0.70833333333333
},
{
"scoringSystem": {
"name": "Psoriatic arthritis UnclutteRed screening Evaluation",
"code": "PURE4"
},
"score": 2,
"scoreCategory": "Possible psoriatic arthritis",
"resultScoringSystemFacets": [
{
"facet": {
"name": "Have you ever had a globally swollen and painful finger or toe?",
"description": null
},
"valueToDisplay": "Yes (1)"
},
{
"facet": {
"name": "Have you ever had heel pain as soon as you stand up in the morning?",
"description": null
},
"valueToDisplay": "No (0)"
},
{
"facet": {
"name": "Have you ever had left and right buttock pain, at the same time or not?",
"description": null
},
"valueToDisplay": "Yes (1)"
},
{
"facet": {
"name": "Have you ever had a swollen and painful joint? (hands, feet, knees, or ankles, for example)",
"description": null
},
"valueToDisplay": "No (0)"
}
],
"history": [
{
"date": "2021-08-05T10:49:13+00:00",
"score": 1,
"scoreCategory": "Possible psoriatic arthritis"
},
{
"date": "2021-08-11T14:58:38+00:00",
"score": 1,
"scoreCategory": "Possible psoriatic arthritis"
},
{
"date": "2022-03-24T17:17:22+00:00",
"score": 2,
"scoreCategory": "Possible psoriatic arthritis"
}
],
"reduction": 0
}
]
},
"helpDiagnoseQuestionnaireAnswers": [
{
"question": "Do hives/welts appear with associated itching?",
"answer": "Yes",
"text": "Considera urticaria"
},
{
"question": "Do individual hives or welts disappear within 1-24 hours without leaving any marks?",
"answer": "Yes",
"text": "Consider urticaria"
},
{
"question": "Does the patient present angioedema or swelling of any part of the body (e.g., face, hands, feet...) accompanied by itch/pain that disappears within 72 hours without leaving any marks?",
"answer": "No",
"text": "Rule out angioedema associated with urticaria"
},
{
"question": "The patient has experienced these episodes more or less continuously for a period of:",
"answer": "β‰₯6 weeks",
"text": "Consider chronic Urticaria"
}
],
"isPriority": true,
"isReviewed": false,
"createdAt": "2022-03-24T17:17:22+00:00",
"presentedForm": {
"practitioner": {
"url": "https://app.legit.legit/u/patients/xxx/diagnotic-report/yyy"
},
"patient": {
"url": "https://app.legit.legit/u/diagnostic-report/xxxx"
}
}
}

Identifiers​

"id": "5194dae6-ab96-11ec-9c18-06ef9b8b6824",
"previousDiagnosticReportId": "9c511e48-fab4-11eb-9382-06ef9b8b6824",
"nextDiagnosticReportId": null,

The json includes 3 identifiers:

  • id. The internal identifier of the diagnostic report in Legit.Health database.

  • previousDiagnosticReportId is the identifier of the immediately previous diagnostic report for that pathology according to chronological order. It could be null if the current diagnostic report is the first.

  • nextDiagnosticReportId is the identifier of the immediately next diagnostic report for that pathology according to chronological order. It could be null if the current diagnostic report is the last.

Patient​

"patient": {
"id": "054724e4-e4b5-11eb-979a-06ef9b8b6824",
"externalId": "2"
},

We include the following information about the patient associated to the diagnostic report:

  • id. The internal identifier of the patient in Legit.Health database.
  • externalId. The identifier of the patient in your system.

Encounters​

"encounters": [
{
"id": "054724e4-ab96-11eb-9c18-06ef9b8b6824",
"externalId": "3"
},
{
"id": "86753241-ab96-11eb-9c18-06ef9b8b6824",
"externalId": null
}
],

We include the following information about the encounters associated to the diagnostic report.

It is a list because a diagnostic report can be associated with multiple encounters, for example, one created by the practitioner and another one created automatically by the follow-up algorithm. In that case, if the patient uploads an image that meets both encounters, the generated diagnostic report will be associated with that two encounters.

Each encounter of the list is an object with the following properties:

  • id. The internal identifier of the encounter in Legit.Health database.
  • externalId. The identifier of the encounter in your system.

Condition​

"condition": {
"id": 704,
"pathology": {
"name": "Psoriasis",
"code": "Psoriasis"
},
"bodySite": {
"code": "HEAD_FRONT",
"name": "Face and neck"
}
}

We include information related to the condition of the given diagnostic report.

In the context of our device, a condition represents a pathology of a patient located in a body site.

The condition has the following properties:

  • id. The internal identifier of the condition in Legit.Health database.

  • pathology. The pathology information for which the diagnostic report was generated. It could be null if the diagnostic report has not been diagnosed yet.

  • bodySite. Contains information about the body site in which the image was taken.

Original Media (deprecated)​

This field appears now under observations

"originalMedia": {
"type": "Image",
"modality": "Clinical",
"diqaScore": 74,
"url": "https://legit-app-pre.s3.eu-west-3.amazonaws.com/signedPath"
}

Since a diagnostic report corresponds to an image, we also include the following data about the image.

  • modality. Our algorithms can distinguis between Clinical and Dermatoscopic images.

  • diqaScore is the dermathology score measuring the validity of the image from a clinical perspective.

  • url. Link to the image. Since we have implemented a strong security system to protect access to images, this link is only valid for 5 minutes, so you have to process it before it expires.

Result​

This object contains the result emitted by our device.

id​

The internal identifier of the result in our database.

metrics​

"metrics": {
"sensitivity": 82.69,
"specificity": 97.46
},

Contains the "specificity" and "sensitivity" values of the image.

preliminaryFindings​

"preliminaryFindings": {
"hasConditionSuspicion": 100,
"isMalignantSuspicion": 0,
"isPreMalignantSuspicion": 0,
"adjustedIsPreMalignantSuspicion": null,
"needsBiopsySuspicion": 0,
"needsSpecialistsAttention": 100
},

Contains preliminary information about the image, generally useful for workflow purposes. Each field is a number representing a probability from 0 to 100.

  • isPreMalignantSuspicion and isMalignantSuspicion contains the values calculated by the algorithm related to malignancy and pre-malignancy.

  • adjustedIsPreMalignantSuspicion contains the value estimated by the practitioner in case he decides to overwrite the previous one.

explainabilityMedia (deprecated)​

This field appears now under observations

"explainabilityMedia": {
"type": "Image",
"url": "https://legit-app-pre.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/2afcd009-3eef-4af1-8665-52e91cd7d4da-5178993a-ab96-11ec-84b5-06ef9b8b6824.jpg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA52A2ZCZF32OWDLDS%2F20220330%2Feu-west-3%2Fs3%2Faws4_request&X-Amz-Date=20220330T094629Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1800&X-Amz-Signature=127b72c450ab94979a467fbba8b250fc11a5e6905c1f568944635c5b6dfa9459"
}

This is the image processed by the device. It contains extra layers of information, indicating where the lesions are located and what is the affected surface.

  • url. Link to the analyzed image. Since we have implemented a security system to protect access to images, this link is only valid for 5 minutes, so you have to process it before it expires.

conclusions​

"conclusions": [
{
"pathology": {
"name": "Psoriasis",
"code": "Psoriasis"
},
"probability": 45.13
}
]

conclusions is an array that contains a list with the different probabilities of the pathologies that the image can present. The sum total of the probabilities shown here is 100. Each object has an array with the following elements:

  • pathology: object with the information about the detected pathology.

  • probability: the estimated probability value for that pathology.

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
}
]

scoringSystems​

What is a Scoring System

In order for a practitioner to monitor a pathology, some conditions have a series of associated questionnaires known as Scoring Systems.

For example:

ConditionScoring system
PsoriasisPASI
Atopic dermatitisSCORAD
UrticariaUAS
Hidradenitis suppurativaISH4

For further information, visit:

"scoringSystems": [
{
"scoringSystem": {
"name": "Local automatic psoriasis area and severity index",
"code": "APASI"
},
"score": 0.7,
"scoreCategory": "Moderate",
"scoreCategories": [
{
"code": "None",
"min": 0,
"max": 0,
"severity": 1,
"severityAsString": "low",
"category": "None"
},
{
"code": "Mild",
"min": 0,
"max": 2.8,
"severity": 1,
"severityAsString": "low",
"category": "Mild"
},
{
"code": "Moderate",
"min": 2.8,
"max": 6,
"severity": 2,
"bodySite": "LEG_LEFT",
"severityAsString": "moderate",
"category": "Moderate"
},
{
"code": "Severe",
"min": 6,
"max": 28.8,
"severity": 3,
"bodySite": "LEG_LEFT",
"severityAsString": "high",
"category": "Severe"
}
],
"resultScoringSystemFacets": [
{
"facet": {
"name": "Affected area",
"description": "This value corresponds to the percentage of involvement of the specific area of the body you are reporting"
},
"valueToDisplay": "10% (1)",
"rawValue": 1
},
{
"facet": {
"name": "Redness",
"description": "This value corresponds to the redness intensity of the lesion"
},
"valueToDisplay": "Moderate (3)",
"rawValue": 3
},
{
"facet": {
"name": "Induration",
"description": "This value corresponds to the hardening intensity of the lesion"
},
"valueToDisplay": "Moderate (2)",
"rawValue": 2
},
{
"facet": {
"name": "Desquamation",
"description": "This value corresponds to the shedding intensity of the outermost layer of skin of the affected zone"
},
"valueToDisplay": "Moderate (2)",
"rawValue": 2
}
],
"history": [
{
"date": "2021-07-14T15:09:38+00:00",
"score": 2.4,
"scoreCategory": "Severe"
},
{
"date": "2021-08-05T10:49:13+00:00",
"score": 1.6,
"scoreCategory": "Severe"
},
{
"date": "2021-08-11T14:58:38+00:00",
"score": 10,
"scoreCategory": "Severe"
},
{
"date": "2022-03-24T17:17:22+00:00",
"score": 0.7,
"scoreCategory": "Moderate"
}
],
"reduction": 0.70833333333333
}

scoringSystems. The questionnaires filled for the image are included in this array. Each item of this list has the following properties.

  • resultScoringSystemFacets contains the answers to each question of the scoring system. Each item of this list contains the following information:

    • facet, which is a question of the scoring system.

    • valueToDisplay, the answer to the question.

  • score is the calculated score of the scoring system based on the answers.

  • scoreCategory is the severity according to the score obtained.

  • history is the historical data for the scoring system.

  • reduction represents how much the value of the scoring system has reduced since the last image. It is a value between 0 and 1.

  • iaSeconds is the time consumed by the algorithm to analyze the image.

Diagnose Questionnaire​

"helpDiagnoseQuestionnaireAnswers": [
{
"question": "Do hives/welts appear with associated itching?",
"answer": "Yes",
"text": "Considera urticaria"
},
{
"question": "Do individual hives or welts disappear within 1-24 hours without leaving any marks?",
"answer": "Yes",
"text": "Consider urticaria"
},
{
"question": "Does the patient present angioedema or swelling of any part of the body (e.g., face, hands, feet...) accompanied by itch/pain that disappears within 72 hours without leaving any marks?",
"answer": "No",
"text": "Rule out angioedema associated with urticaria"
},
{
"question": "The patient has experienced these episodes more or less continuously for a period of:",
"answer": "β‰₯6 weeks",
"text": "Consider chronic Urticaria"
}
],

During the diagnosis of some pathologies, such as "melanoma", the practitioner can use a validated auxiliary questionnaire to help him during this process.

In the case of having completed it, that questionnaire will appear within this property in a "question - answer" format.

presentedForm​

This property contains two direct links to the diagnostic report inside the application, one for patients and other for practitioners.

Other information​

"isPriority": true,
"isReviewed": false,
"createdAt": "2022-03-24T17:17:22+00:00"

The JSON also contains the following properties:

  • isPriority, indicating if the diagnostic report was marked as priority. This can happen becauase of a high malignant suspicious or a score of a scoring being greater than an established threshold.

  • isReviewed if the practitioner has reviewed the diagnostic report.

  • createdAt. Date of the diagnostic report.