Saltar al contenido principal

FHIR

Once the iframe finishes processing an upload and emits the analysis_completed callback with the report identifier, your backend retrieves the diagnostic report on demand from the API. To obtain it as a FHIR-compliant payload, call the endpoint with the ?format=fhir parameter; see the API Endpoint page.

The information is identical to the standard format; only the structure changes to follow the HL7 FHIR standard for interoperable healthcare data. The FHIR payload encapsulates the same layers (patient history, clinical observations, AI-based analysis and scoring systems) using FHIR resources.

API Version Requirement

The FHIR format is available only in v3 API. If using v2 API, the format parameter is only taken into account for PDF downloads; FHIR format is not available. In v2, the format parameter is not necessary; the endpoint works without it.

Example payload​

{
"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://bucket/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://bucket/diagnostic-report-medias/bbb.png"
},
"type": "Image",
"modality": "Clinical",
"diqaScore": 86.0
}
},
{
"media": {
"resourceType": "Media",
"content": {
"url": "https://bucket/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"
},
"interpretations": [
{
"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://bucket/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)”).

Examples​

Two illustrative cases in FHIR format, contrasting confident versus inconclusive diagnoses.

Case 1: Diagnostic confidence above the threshold​

Download

Download an example JSON: psoriasis (confident)

This case corresponds to three uploaded images of psoriasis on the elbow. The diagnostic-support algorithm reports psoriasis with high confidence, so the application also calculates the associated severity questionnaire (PASI).

The user uploaded three photos but the severity is calculated on one of them. Each photo can show a different perspective of the lesion (omitting or adding parts), so we choose the most representative image for the severity calculation.

The most relevant fields in the FHIR JSON are:

  • result.observations: the array of images uploaded by the user.
  • result.questionnaires: the questionnaires that capture the severity of the most probable condition.

Case 2: Diagnostic confidence below the threshold​

Download

Download an example JSON: inconclusive case

In this case the user uploaded three images but the diagnostic-support algorithm could not determine the type of lesion above the configured confidence threshold, so severity is not calculated.

In the example FHIR JSON, all images are returned under result.observations and result.questionnaires is empty.

Further reading

Please read the Instructions For Use for the canonical reference. Note that the IFU may vary by country; reach out to us for country-specific guidance.