Zum Hauptinhalt springen

Get an Anonymous Diagnostic Report

Besides getting the DiagnosticReports linked to patients between your system and our, you can also fetch the AnonymousDiagnosticReports that you had sent, ie, those which are not linked to any patient.

We provide an endpoint to fetch an anonymous diagnostic report already present in the system. You only need the encrypted id of the diagnostic report in Legit.Health. This identifier is received from the message posted by our Iframe to your app.

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

A Anonymous Diagnostic Report contains all the information related to an image uploaded for a not-linked patient and the corresponding result data generated by our AI algorithms.

JSON Structure

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

Raw

/anonymous-diagnostic-reports/{encryptedId}?format=raw
{
"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",
"visitIdentifier": "visit identifier",
"anamnesisGeneral": [
{
"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",
"icd11": "ED80"
},
"bodySite": {
"code": "HEAD_FRONT",
"name": "Face and neck"
},
"createdAt": "2023-08-03T12:38:10+02:00",
"result": {
"id": "0189bafa-0610-7349-a0ab-eb536a2185f6",
"metrics": {
"sensitivity": 83.31,
"specificity": 99.53,
"entropy": null
},
"preliminaryFindings": {
"hasCondition": 100,
"malignancy": 0.02,
"adjustedMalignancy": null,
"pigmentedLesion": 0,
"urgentReferral": 100,
"highPriorityReferral": 100
},
"iaSeconds": 0.88,
"observations": [
{
"media": {
"type": "Image",
"modality": "Clinical",
"diqaScore": 86,
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/bbb.png"
}
}
],
"conclusions": [
{
"probability": 99.65,
"pathology": {
"name": "Acne",
"code": "Acne",
"icd11": "ED80"
}
},
{
"probability": 0.06,
"pathology": {
"name": "Varicella",
"code": "Varicella",
"icd11": "1E90"
}
}
],
"scoringSystems": [
{
"scoringSystem": {
"name": "Acne lesion estimation grading index",
"code": "ALEGI"
},
"score": {
"value": 8,
"severity": {
"value": 1,
"categories": [
{
"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"
}
],
}
},
"facets": [
{
"facet": {
"name": "Acne lesion density",
"description": ""
},
"value": {
"text": "None (0)",
"raw": 0
}
},
{
"facet": {
"name": "Number of lesions",
"description": ""
},
"value": {
"text": "Mild (0-10)",
"raw": 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.
  • createdAt: Timestamp indicating the time of creation for this diagnostic report.

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",
"icde11": "E90"
}

Anamnesis general

The anamnesisGeneral 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:

"anamnesisGeneral": [
{
"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."
},
...
]

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,
"entropy": null
}
  • preliminaryFindings: An array of preliminary suspicions and their likelihoods, including the probability of malignancy and the requirement for a biopsy.
"preliminaryFindings": {
"hasCondition": 100,
"malignancy": 0.02,
"adjustedMalignancy": null,
"pigmentedLesion": 0,
"urgentReferral": 100,
"highPriorityReferral": 100
}
  • iaSeconds: The processing time consumed by the AI for image analysis.

Observations

The observations field is an array of medias, each containing one field: media.

media: 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.
"observations": [
{
"media": {
"type": "Image",
"modality": "Clinical",
"diqaScore": 86,
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/bbb.png"
}
},
...
]

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",
"icd11": "ED80"
}
},
...
],

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. They are used to estimate the severity of the most probable condition:

    "scoringSystems": [
{
"scoringSystem": {
"name": "Acne lesion estimation grading index",
"code": "ALEGI"
},
"score": {
"value": 8,
"severity": {
"value": 1,
"categories": [
{
"code": "None",
"category": "None",
"min": 0.0,
"max": 0.0,
"severity": 1,
"severityAsString": "low"
},
...
],
}
},
"facets": [
{
"facet": {
"name": "Acne lesion density",
"description": ""
},
"value": {
"text": "None (0)",
"raw": 0
}
},
...
]
}
]

In each scoring system:

  • scoringSystem includes the name and code of the scoring methodology.
  • score.value indicates the calculated score according to the system's rules.
  • score.severity signifies the severity associated with the computed score. It has three possible values:
    • 1: low
    • 2: moderate
    • 3: high
  • facets 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:

FHIR

/anonymous-diagnostic-reports/{encryptedId}?format=fhir
{
"success": true,
"message": "Diagnostic report <0194b1e2-d73e-71ba-9360-7b7a0ffa551b>",
"data": {
"resourceType": "DiagnosticReport",
"id": "cUVHY3lUcEFSdzdhVklrMXFKS2k5ZzBxaHBYWXNERTNFWjBqR0Rwd3AxeXkrc2hqNDNCdC8rM1NtUVhobEk0eQ==",
"presentedForm": {
"practitioner": {
"url": "https://iframe.legit.health?companyId=XXXX&diagnosticReportId=signedId",
"pdf": "https://back-{pre}.legit.health/s2s-api/v2/anonymous-diagnostic-reports/encryptedId?format=pdf",
},
"patient": {
"url": null,
"pdf": null
}
},
"encounter": {
"identifier": {
"value": "XYZ"
}
},
"issued": "2025-01-29T12:46:57+01:00",
"condition": {
"pathology": null,
"bodySite": {
"coding": [
{
"system": "https:\/\/legit.health\/integration\/json-only\/codes\/body-sites",
"code": "TRUNK_FRONT",
"display": "Chest and belly"
}
]
}
},
"extraData": "some payload",
"anamnesisGeneral": {
"resourceType": "QuestionnaireResponse",
"status": "completed",
"item": [
{
"linkId": 1,
"text": "Question one",
"answer": [
{
"valueString": "answer"
}
]
}
]
},
"macroscopicMedia": {
"resourceType": "Media",
"content": {
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/bbb.png"
},
"type": "Image",
"annotations": null
},
"result": {
"id": "0194b1e2-d740-70d6-9435-a3606f0fa491",
"performanceIndicators": {
"resourceType": "Observation",
"component": [
{
"code": {
"coding": [
{
"code": "sensitivity",
"display": "Sensitivity"
}
]
},
"valueQuantity": {
"value": 91.16,
"unit": "%"
}
},
{
"code": {
"coding": [
{
"code": "specificity",
"display": "Specificity"
}
]
},
"valueQuantity": {
"value": 96.58,
"unit": "%"
}
},
{
"code": {
"coding": [
{
"code": "entropy",
"display": "Entropy"
}
]
},
"valueQuantity": {
"value": null,
"unit": "%"
}
}
]
},
"clinicalIndicators": {
"resourceType": "Observation",
"component": [
{
"code": {
"coding": [
{
"code": "hasCondition",
"display": "Has condition"
}
]
},
"valueQuantity": {
"value": 100.0,
"unit": "%"
}
},
{
"code": {
"coding": [
{
"code": "malignancy",
"display": "Malignancy"
}
]
},
"valueQuantity": {
"value": 0.0,
"unit": "%"
}
},
{
"code": {
"coding": [
{
"code": "adjustedMalignancy",
"display": "Adjusted malignancy"
}
]
},
"valueQuantity": {
"value": null,
"unit": "%"
}
},
{
"code": {
"coding": [
{
"code": "pigmentedLesion",
"display": "Pigmented lesion"
}
]
},
"valueQuantity": {
"value": null,
"unit": "%"
}
},
{
"code": {
"coding": [
{
"code": "urgentReferral",
"display": "Urgent referral"
}
]
},
"valueQuantity": {
"value": null,
"unit": "%"
}
},
{
"code": {
"coding": [
{
"code": "highPriorityReferral",
"display": "High priority referral"
}
]
},
"valueQuantity": {
"value": null,
"unit": "%"
}
}
]
},
"analysisDuration": 0.91670727729797,
"observations": [
{
"media": {
"resourceType": "Media",
"content": {
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/bbb.png"
},
"type": "Image",
"modality": "Clinical",
"diqaScore": 86.0
}
},
{
"media": {
"resourceType": "Media",
"content": {
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/bbb.png"
},
"type": "Image",
"modality": "Clinical",
"diqaScore": 92.0
}
}
],
"conclusions": [
{
"pathology": {
"coding": [
{
"code": "Psoriasis",
"display": "Psoriasis",
"system": "https:\/\/legit.health\/integration\/json-only\/codes\/conditions"
},
{
"code": "EA90",
"display": "Psoriasis",
"system": "ICD11"
}
]
},
"probability": 80.0
},
{
"pathology": {
"coding": [
{
"code": "Palmoplantar psoriasis",
"display": "Palmoplantar psoriasis",
"system": "https:\/\/legit.health\/integration\/json-only\/codes\/conditions"
},
{
"code": "EA90.42, EA90.5Y",
"display": "Palmoplantar psoriasis",
"system": "ICD11"
}
]
},
"probability": 20.0
}
],
"questionnaires": [
{
"resourceType": "QuestionnaireResponse",
"questionnaire": "APASI_LOCAL",
"scoringSystem": {
"text": "Local automatic psoriasis area and severity index",
"coding": [
{
"code": "APASI_LOCAL",
"display": "Local automatic psoriasis area and severity index"
}
]
},
"score": {
"valueQuantity": {
"value": 6.3
},
"system": "http:\/\/unitsofmeasure.org",
"unit": "points",
"interpretation": {
"coding": [
{
"code": 3,
"display": "Severe"
}
],
"text": "Severe"
},
"interpretationCategories": [
{
"min": 0.0,
"max": 0.0,
"text": "None",
"coding": [
{
"code": 1,
"display": "low"
}
]
},
{
"min": 0.0,
"max": 2.1,
"text": "Mild",
"coding": [
{
"code": 1,
"display": "low"
}
]
},
{
"min": 2.1,
"max": 4.5,
"text": "Moderate",
"coding": [
{
"code": 2,
"display": "moderate"
}
]
},
{
"min": 4.5,
"max": 21.6,
"text": "Severe",
"coding": [
{
"code": 3,
"display": "high"
}
]
}
]
},
"explainabilityMedia": {
"resourceType": "Media",
"content": {
"url": "https://legit-dev.s3.eu-west-3.amazonaws.com/diagnostic-report-medias/bbb.png"
},
"annotations": [],
"type": "Image"
},
"item": [
{
"linkId": 30,
"text": "This value corresponds to the shedding intensity of the outermost layer of skin of the affected zone",
"code": [
{
"code": "Scaling",
"display": "Scaling"
}
],
"answer": [
{
"valueCoding": {
"code": 2.0,
"display": "Moderate (2)"
}
}
]
},
{
"linkId": 27,
"text": "This value corresponds to the redness intensity of the lesion",
"code": [
{
"code": "Erythema",
"display": "Erythema"
}
],
"answer": [
{
"valueCoding": {
"code": 3.0,
"display": "Severe (3)"
}
}
]
},
{
"linkId": 29,
"text": "This value corresponds to the hardening intensity of the lesion",
"code": [
{
"code": "Induration",
"display": "Induration"
}
],
"answer": [
{
"valueCoding": {
"code": 2.0,
"display": "Moderate (2)"
}
}
]
},
{
"linkId": 52,
"text": "This value corresponds to the percentage of involvement of the specific area of the body you are reporting",
"code": [
{
"code": "Affected area",
"display": "Affected area"
}
],
"answer": [
{
"valueCoding": {
"code": 3.0,
"display": "50% (3)"
}
}
]
}
]
}
]
}
},
"errorCode": null
}

Top-level fields

The response begins with three fundamental fields that indicate the request’s outcome and location of data:

{
"success": true,
"message": "Diagnostic report <id>",
"data": { ... },
"errorCode": null
}
  • success: Indicates whether the request was successfully processed.
  • message: A short text message describing the action performed. Often includes the diagnostic report’s internal identifier.
  • data: Holds the main content of the diagnostic report in FHIR format.
  • errorCode: Used to return an error code if something fails.

data object

Within "data", the diagnostic report follows the FHIR specification. It encloses all information about the patient’s encounter, clinical findings, images, and conclusions.

"data": {
"resourceType": "DiagnosticReport",
"id": "cUVHY3lUcEFSdzdhVklrMXFKS2k5ZzBxaHBYWXNERTNFWjBqR0Rwd3AxeXkrc2hqNDNCdC8rM1NtUVhobEk0eQ==",
"presentedForm": { ... },
"encounter": { ... },
"issued": "2025-01-29T12:46:57+01:00",
"condition": { ... },
"extraData": null,
"anamnesisGeneral": { ... },
"macroscopicMedia": { ... },
"result": { ... }
}

Below is a breakdown of its main sections:

  • resourceType: Specifies the FHIR resource type, which is "DiagnosticReport".
  • id: A unique, encoded identifier for this Diagnostic Report.
  • presentedForm: Contains links that allow viewing the diagnostic report in different forms (browser or PDF). Typically includes:
    • practitioner.url: A link where a practitioner can view the diagnostic report.
    • practitioner.pdf: A link to obtain a PDF of the report.
    • patient.url / patient.pdf: If relevant to the patient, these fields may provide them with URLs for viewing or downloading their report. If unused, they may remain null.
"presentedForm": {
"practitioner": {
"url": "...",
"pdf": "..."
},
"patient": {
"url": null,
"pdf": null
}
}
  • encounter: Contains the identifier that links this diagnostic report to a particular healthcare encounter or visit. The value stores the encounter’s unique string identifier.
"encounter": {
"identifier": {
"value": "some-unique-encounter-id"
}
}
  • issued: A timestamp indicating when the diagnostic report was issued or finalized.
  • condition: Describes the suspected or most likely condition and the body site:
    • pathology: May contain the name or code for a confirmed condition. Here it is null, but when present, it typically includes additional details like coding systems or official terminology.
    • bodySite: Provides standardized information about the anatomical location using code, display, and a system that references a coding standard.
"condition": {
"pathology": null,
"bodySite": {
"coding": [
{
"system": "https://legit.health/integration/json-only/codes/body-sites",
"code": "TRUNK_FRONT",
"display": "Chest and belly"
}
]
}
}
  • extraData: An optional string field for any additional that the client has passed to load the iFrame.
  • anamnesisGeneral: Stores general Q&A information about the patient’s history in FHIR’s QuestionnaireResponse format. It can contain items representing the questions and their answers.
"anamnesisGeneral": {
"resourceType": "QuestionnaireResponse",
"status": "completed",
"item": [
{
"linkId": 1,
"text": "Question one?",
"answer": [
{
"valueString": "answer"
}
]
},
...
]
}
  • resourceType: Always "QuestionnaireResponse".
  • status: Indicates the status of the questionnaire (e.g. "completed").
  • item: An array of question-answer pairs. Here it’s empty, but it could hold multiple objects each describing a question via linkId, text, and an answer.
  • macroscopicMedia: Details an image or other media of the lesion or body part. Here, it references a resource of type "Media":
    • resourceType: Always "Media".
    • content.url: A direct URL to access the uploaded file, typically a signed URL valid for a limited time.
    • type: The type of media, often "Image".
    • annotations: An optional field; it can be null or contain relevant metadata about image findings.
"macroscopicMedia": {
"resourceType": "Media",
"content": {
"url": "https://...jpg"
},
"type": "Image",
"annotations": null
}

result

The core field that captures the diagnostic process output. It includes identifiers, metrics, conclusions, and any scoring systems or questionnaires used to evaluate the condition.

"result": {
"id": "0194b1e2-d740-70d6-9435-a3606f0fa491",
"performanceIndicators": { ... },
"clinicalIndicators": { ... },
"analysisDuration": 0.916,
"observations": [ ... ],
"conclusions": [ ... ],
"questionnaires": [ ... ]
}

Below are its main subfields:

  • id Another unique identifier pertaining to the diagnostic result.
  • performanceIndicators: A FHIR Observation that shows performance metrics such as sensitivity and specificity:
    • code.coding: An array containing the codes that describe the metric name (e.g. "sensitivity", "specificity").
    • valueQuantity.value: The numeric value of the metric.
    • valueQuantity.unit: Usually "%" or other relevant units.
"performanceIndicators": {
"resourceType": "Observation",
"component": [
{
"code": {
"coding": [
{
"code": "sensitivity",
"display": "Sensitivity"
}
]
},
"valueQuantity": {
"value": 91.16,
"unit": "%"
}
},
...
]
}
  • clinicalIndicators: Another FHIR Observation describing clinical aspects such as the probability of having the condition or malignancy suspicion. Each component focuses on a specific clinical clue:
    • hasCondition: Likelihood that a condition is present.
    • malignancy: Likelihood that the condition is malignant.
    • Other properties (e.g. "urgentReferral", "pigmentedLesion") might also appear.
"clinicalIndicators": {
"resourceType": "Observation",
"component": [
{
"code": {
"coding": [
{
"code": "hasCondition",
"display": "Has condition"
}
]
},
"valueQuantity": {
"value": 100.0,
"unit": "%"
}
},
...
]
}
  • analysisDuration: A numeric value in seconds showing how long the system took to analyze the images.
  • observations: An array of observations that reference each media file examined:
    • media.resourceType: Always "Media".
    • media.content.url: Points to the specific image or file.
    • media.modality: For example, "Clinical".
    • media.diqaScore: The Dermatology Image Quality Assessment (DIQA) score for the image.
"observations": [
{
"media": {
"resourceType": "Media",
"content": { "url": "..." },
"type": "Image",
"modality": "Clinical",
"diqaScore": 86.0
}
},
...
]
  • conclusions: Represents the list of possible conditions identified, each with a probability and standardized coding:
"conclusions": [
{
"pathology": {
"coding": [
{
"code": "Psoriasis",
"display": "Psoriasis",
"system": "https://legit.health/integration/json-only/codes/conditions"
},
{
"code": "EA90",
"display": "Psoriasis",
"system": "ICD11"
}
]
},
"probability": 100.0
},
...
]
  • pathology.coding[0].code: The code that identifies the condition (e.g. "Psoriasis").
  • pathology.coding[0].display: Human-friendly label for the condition (e.g. "Psoriasis").
  • probability: The likelihood of this condition being correct, expressed as a percentage.

questionnaires

An array of QuestionnaireResponse objects, each containing details about a scoring system applied to the images:

"questionnaires": [
{
"resourceType": "QuestionnaireResponse",
"questionnaire": "APASI_LOCAL",
"scoringSystem": {
"text": "Local automatic psoriasis area and severity index",
"coding": [
{ "code": "APASI_LOCAL", "display": "Local automatic psoriasis area and severity index" }
]
},
"score": { ... },
"explainabilityMedia": { ... },
"item": [ ... ]
}
]
  • resourceType: Always "QuestionnaireResponse".
  • questionnaire: The internal code/name of the scoring system (e.g., "APASI_LOCAL").
  • scoringSystem: Contains the name and code for the scoring methodology.
  • score: The numeric outcome of the scoring system along with its severity interpretation.
  • explainabilityMedia: An optional annotated image that highlights how the score was determined.
  • item: An array of question-answer objects relevant to the scoring, each containing:
    • linkId or code: A reference to the specific question or assessment factor.
    • answer: The recorded response, often including a numeric level (e.g., “Moderate (2)”).

Obtaining a PDF

You can generate a PDF with the contents of anonymous diagnostic report by calling the endpoint getAnonymousDiagnosticReport with the query param format=pdf:

/anonymous-diagnostic-reports/{encryptedId}?format=pdf