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.
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.
Full example
A complete FHIR response for a confident psoriasis case. The same shape is broken down field-by-field across the subpages of this section.
{
"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://utils.legit.health/pdf/anonymous-diagnostic-report?diagnosticReportIdEncrypted=<encryptedId>&apiKey=<apiKey>&authKey=<authKey>&locale=en"
},
"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": "trunkFront",
"display": "Chest and belly"
}
]
}
},
"extraData": {
"externalCaseId": "CASE-123",
"referrer": "telemedicine-portal"
},
"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.916,
"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": "ICD-11" }
]
},
"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": "ICD-11" }
]
},
"probability": 20.0
}
],
"questionnaires": [
{
"resourceType": "QuestionnaireResponse",
"questionnaire": "apasiLocal",
"scoringSystem": {
"text": "Local automatic psoriasis area and severity index",
"coding": [
{ "code": "apasiLocal", "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, "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, "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, "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, "display": "50% (3)" } }]
}
],
"reduction": null,
"history": null
}
]
},
"patient": null,
"previousDiagnosticReportId": null,
"nextDiagnosticReportId": null,
"helpDiagnoseQuestionnaireAnswers": null,
"isPriority": null,
"isReviewed": null,
"patientVisibility": null
},
"errorCode": null
}
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": { ... },
"patient": null,
"previousDiagnosticReportId": null,
"nextDiagnosticReportId": null,
"helpDiagnoseQuestionnaireAnswers": null,
"isPriority": null,
"isReviewed": null,
"patientVisibility": null
}
Below is a breakdown of its main sections:
resourceType: Specifies the FHIR resource type, which is"DiagnosticReport".id: An encrypted, URL-safe identifier for this Diagnostic Report. This is the same opaqueencryptedIdvalue used in the API path; treat it as an opaque string.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.nullif the company does not have a valid iframe app key configured.practitioner.pdf: A link to download the PDF of the report. Calling the API endpoint with?format=pdfissues an HTTP 302 redirect to this same URL; most HTTP clients follow it automatically and receive the PDF. Treat the URL as opaque and refetch the diagnostic report if it stops working.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 remainnull.
"presentedForm": {
"practitioner": {
"url": "...",
"pdf": "..."
},
"patient": {
"url": null,
"pdf": null
}
}
encounter: Contains theidentifierthat links this diagnostic report to a particular healthcare encounter or visit.valueis the visit/encounter identifier passed in when the diagnostic report was created.nullif no visit identifier was provided.
"encounter": {
"identifier": {
"value": "some-unique-encounter-id"
}
}
issued: ISO-8601 timestamp (with timezone offset) indicating when the diagnostic report was issued or finalized, e.g.2025-01-29T12:46:57+01:00.extraData: An optional free-form JSON object (ornull) that the client passed in when loading the iframe. Whatever structure was set on the source side is echoed back verbatim.
Reserved fields
After result, the FHIR response always emits a set of sibling keys at the top of data that are currently always null for v3 anonymous diagnostic reports. They are reserved for future authenticated flows; integrators should ignore them, but parsers must tolerate them.
"patient": null,
"previousDiagnosticReportId": null,
"nextDiagnosticReportId": null,
"helpDiagnoseQuestionnaireAnswers": null,
"isPriority": null,
"isReviewed": null,
"patientVisibility": null
patientpreviousDiagnosticReportIdnextDiagnosticReportIdhelpDiagnoseQuestionnaireAnswersisPriorityisReviewedpatientVisibility
Examples
Two illustrative cases in FHIR format, contrasting high-confidence versus inconclusive diagnostic-support outputs.
Case 1: Diagnostic confidence above the threshold
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 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.
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.