Diagnosis support
POST /diagnosis-support returns a ranked list of probable conditions for one or more skin images, plus risk indicators and a media-validity block per image.
Request
- Python
- JavaScript
- cURL
import requests
import base64
base_url = "<base_url>"
url = f"{base_url}/diagnosis-support"
# Encode each image you want to analyse. Multiple images can be sent in
# the same request: each image becomes a separate item in `payload[]`.
image_path = "<path_to_image>" # e.g. "lesion_image.jpg"
with open(image_path, "rb") as f:
image_data = base64.b64encode(f.read()).decode("utf-8")
json_payload = {
"payload": [
{
"contentAttachment": {
"data": image_data, # required base64-encoded image bytes
"title": "Lesion close-up", # optional free-text label for the image
"contentType": "image/jpeg" # optional defaults to image/png
}
}
# Add more {"contentAttachment": {...}} items here for additional images.
]
}
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <access_token>" # obtained from /login
}
response = requests.post(url, json=json_payload, headers=headers)
result = response.json()
const fs = require("fs");
const baseUrl = "<base_url>";
const imagePath = "<path_to_image>"; // e.g. "lesion_image.jpg"
const imageData = fs.readFileSync(imagePath).toString("base64");
const json_payload = {
payload: [
{
contentAttachment: {
data: imageData, // required base64-encoded image bytes
title: "Lesion close-up", // optional free-text label for the image
contentType: "image/jpeg", // optional defaults to image/png
},
},
// Add more entries for additional images.
],
};
const response = await fetch(`${baseUrl}/diagnosis-support`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer <access_token>",
},
body: JSON.stringify(json_payload),
});
const result = await response.json();
# Replace <base64_encoded_image_data> with the Base64-encoded contents of your image.
# Generate it locally with: base64 -i <path_to_image>
curl -X POST "<base_url>/diagnosis-support" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{
"payload": [{
"contentAttachment": {
"data": "<base64_encoded_image_data>",
"title": "Lesion close-up",
"contentType": "image/jpeg"
}
}]
}'
Request fields
payload[]array of images to analyse. At least one entry is required; multiple entries are aggregated into a single result.payload[].contentAttachment(required) image envelope; see the shared Image attachment section for fields.
The Authorization header is the standard bearer token; see Authentication header.
Response
The response follows the FHIR DiagnosticReport resource shape. The top of the response carries the aggregated result; imagingAnalysis[] carries the per-image breakdown including explainability heatmaps.
{
"resourceType": "DiagnosticReport",
"identifier": {
"use": "official",
"value": "f426f15d-fcea-4bd0-942e-7528bf163c5d"
},
"status": "preliminary",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0074",
"systemDisplay": "HL7 FHIR",
"code": "IMG",
"display": "Diagnostic Imaging"
}
],
"text": "Diagnostic imaging"
}
],
"code": {
"coding": [
{
"system": "http://loinc.org/",
"systemDisplay": "Logical Observation Identifiers Names and Codes (LOINC)",
"code": "100063-7",
"display": "Primary skin concern"
}
],
"text": "Skin condition analysis"
},
"issued": "2026-02-13T14:58:27.466367",
"analysisDuration": 1.11359,
"performanceIndicator": {
"sensitivity": 66.97074175,
"specificity": 98.58783484,
"entropy": 8.4339413
},
"clinicalIndicator": {
"hasCondition": 99.96490132,
"pigmentedLesion": 0.53779946,
"malignancy": 0.24731814,
"urgentReferral": 0.67645404,
"highPriorityReferral": 1.51389415
},
"conclusion": [
{
"code": {
"coding": [
{
"system": "https://icd.who.int/browse/2025-01/mms/en",
"systemDisplay": "ICD-11",
"version": "2025-01",
"code": "EA89",
"display": "Generalised eczematous dermatitis of unspecified type"
}
],
"text": "Eczematous dermatitis"
},
"probability": 94.89877797
},
{
"code": {
"coding": [
{
"system": "https://icd.who.int/browse/2025-01/mms/en",
"systemDisplay": "ICD-11",
"version": "2025-01",
"code": "1F28",
"display": "Dermatophytosis"
}
],
"text": "Tinea"
},
"probability": 0.15845833
}
// ... 4 more shown in production for the top 5; full array contains every supported pathology.
],
"imagingAnalysis": [
{
"mediaValidity": { /* see the "Image quality assessment" common building block */ },
"performanceIndicator": { "entropy": 8.4339413 },
"clinicalIndicator": { /* same shape as top-level clinicalIndicator */ },
"conclusion": [
{
"code": { /* same ICD-11 coding as top-level conclusion[] */ },
"probability": 94.8987782,
"explainability": {
"heatMap": { /* visual attention map for this conclusion */ }
}
}
// ...
]
}
]
}
Top-level fields
The top-level FHIR fields (resourceType, identifier, status, issued, analysisDuration) follow the shared FHIR response envelope. This endpoint also carries category and code blocks describing the type of report (Diagnostic Imaging, LOINC 100063-7 "Primary skin concern"); they are static and can be ignored in most integrations.
performanceIndicator: model performance for this prediction
"performanceIndicator": {
"sensitivity": 66.97074175,
"specificity": 98.58783484,
"entropy": 8.4339413
}
sensitivitythe model's sensitivity (true-positive rate, in percent) at the operating point used for this prediction.specificitythe model's specificity (true-negative rate, in percent) at the operating point used for this prediction.entropyShannon entropy of the predicted probability distribution. Higher values mean the model is more uncertain about which condition is present.
clinicalIndicator: risk flags
"clinicalIndicator": {
"hasCondition": 99.96490132,
"pigmentedLesion": 0.53779946,
"malignancy": 0.24731814,
"urgentReferral": 0.67645404,
"highPriorityReferral": 1.51389415
}
All values are percentages (0–100):
hasConditionlikelihood that a relevant skin condition is present in the image.pigmentedLesionlikelihood that the lesion is pigmented (relevant for melanoma triage workflows).malignancylikelihood of malignancy.urgentReferrallikelihood the case warrants urgent referral to a specialist.highPriorityReferrallikelihood the case warrants high-priority referral (less urgent thanurgentReferralbut still expedited).
conclusion[]: ranked differential diagnosis
{
"code": {
"coding": [
{
"system": "https://icd.who.int/browse/2025-01/mms/en",
"systemDisplay": "ICD-11",
"version": "2025-01",
"code": "EA89",
"display": "Generalised eczematous dermatitis of unspecified type"
}
],
"text": "Eczematous dermatitis"
},
"probability": 94.89877797
}
code.coding[].systemcoding system URL; always ICD-11 for this endpoint.code.coding[].versionICD-11 release version (e.g.2025-01).code.coding[].code/code.coding[].displayICD-11 code and its official display.code.textshort, human-readable label.probabilitypredicted probability (0–100) for this conclusion.
The array is sorted in descending probability. In production it contains every supported pathology (300+ entries); only the top entries are clinically meaningful. Filter the array to the top 5 items for display, and surface a "more" affordance if you want to expose the long tail.
imagingAnalysis[]: per-image breakdown
imagingAnalysis mirrors the top-level result for each input image individually (one entry per item in your request payload[]). Each entry contains:
mediaValidityimage-quality block; see the Image quality assessment section.performanceIndicator.entropyper-image uncertainty.clinicalIndicatorper-image risk flags (same shape as the top-level block).conclusion[]per-image ranked diagnoses; each item additionally carries anexplainability.heatMapfield with a visual attention map highlighting the regions the model used to reach that conclusion. Once decoded, the heatmap is an image overlay where warmer colours indicate the regions the model weighted most heavily:

explainability.heatMap shape
"explainability": {
"heatMap": {
"title": "Heat map showing which regions of the image the AI focuses its attention to predict this class.",
"contentType": "image/jpeg",
"data": "<base64_encoded_image_data>",
"height": 238,
"width": 284,
"colorModel": "RGB"
}
}
titlehuman-readable description of the heatmap.contentTypeMIME type of the encoded image (typicallyimage/jpeg).dataBase64-encoded image bytes. Omitted from the example above because the payload is large; decode it the same way as any other Base64 image.height/widthpixel dimensions of the decoded image.colorModelcolour space of the decoded image (e.g.RGB).