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 everytime a diagnostic report is created.
To get a diagnostic report, you must use the endpoint getDiagnosticReport
.
A Diagnostic Report
contains all the information related to an image uploaded for a patient and the corresponding result data generated by our AI algorithms.
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": "Rostro y cuello"
}
},
"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"
},
"conclusions": [
{
"pathology": {
"name": "Psoriasis",
"code": "Psoriasis"
},
"probability": 45.13
},
{
"pathology": {
"name": "Psoriasis invertida",
"code": "Psoriasis inversa"
},
"probability": 4.46
},
{
"pathology": {
"name": "Liquen simple crónico",
"code": "Lichen simplex chronicus"
},
"probability": 2.18
},
{
"pathology": {
"name": "Eritema multiforme",
"code": "Erythema multiforme"
},
"probability": 1.3
},
{
"pathology": {
"name": "Angiokeratoma",
"code": "Angiokeratoma"
},
"probability": 1.27
}
],
"scoringSystems": [
{
"scoringSystem": {
"name": "APASI",
"code": "APASI"
},
"score": 0.7,
"scoreCategory": "Moderado",
"resultScoringSystemFacets": [
{
"facet": {
"name": "Area afectada",
"description": "Este valor corresponde al porcentaje de afectación de la zona concreta del cuerpo que estás reportando"
},
"valueToDisplay": "10% (1)"
},
{
"facet": {
"name": "Rojez",
"description": "Este valor corresponde a la intensidad de la rojez de la lesión"
},
"valueToDisplay": "Grave (3)"
},
{
"facet": {
"name": "Induración",
"description": "Este valor corresponde al grado de endurecimiento o durez de la lesión"
},
"valueToDisplay": "Moderado (2)"
},
{
"facet": {
"id": 4,
"name": "Descamación",
"description": "Este valor corresponde al grado de caída de capas superficiales de la piel de la zona afectada",
"allowsInputFromUser": false,
"inputAdornment": null
}
}
],
"history": [
{
"date": "2021-07-14T15:09:38+00:00",
"score": 2.4,
"scoreCategory": "Grave"
},
{
"date": "2021-08-05T10:49:13+00:00",
"score": 1.6,
"scoreCategory": "Grave"
},
{
"date": "2021-08-11T14:58:38+00:00",
"score": 10,
"scoreCategory": "Grave"
},
{
"date": "2022-03-24T17:17:22+00:00",
"score": 0.7,
"scoreCategory": "Moderado"
}
],
"reduction": 0.70833333333333
},
{
"scoringSystem": {
"name": "PURE4",
"code": "PURE4"
},
"score": 2,
"scoreCategory": "Posible artritis psoriásica",
"resultScoringSystemFacets": [
{
"facet": {
"name": "¿Ha tenido alguna vez dolor e hinchazón/inflamación que afectara a todo un dedo de la mano o del pie?",
"description": null
},
"valueToDisplay": "Sí (1)"
},
{
"facet": {
"name": "¿Ha tenido o notado alguna vez dolor en el talón al ponerse de pie por la mañana?",
"description": null
},
"valueToDisplay": "No (0)"
},
{
"facet": {
"name": "¿Ha tenido alguna vez dolor en el glúteo derecho o izquierdo, al mismo tiempo o por separado?",
"description": null
},
"valueToDisplay": "Sí (1)"
},
{
"facet": {
"name": "¿Ha tenido alguna vez hinchazón y dolor en una articulación (manos, pies, rodillas o tobillos, por ejemplo)?",
"description": null
},
"valueToDisplay": "No (0)"
}
],
"history": [
{
"date": "2021-08-05T10:49:13+00:00",
"score": 1,
"scoreCategory": "Posible artritis psoriásica"
},
{
"date": "2021-08-11T14:58:38+00:00",
"score": 1,
"scoreCategory": "Posible artritis psoriásica"
},
{
"date": "2022-03-24T17:17:22+00:00",
"score": 2,
"scoreCategory": "Posible artritis psoriásica"
}
],
"reduction": 0
}
]
},
"helpDiagnoseQuestionnaireAnswers": [
{
"question": "¿Los habones/ronchas se presentan con prurito asociado?",
"answer": "Sí",
"text": "Considerar urticaria como diagnóstico"
},
{
"question": "¿Los habones o ronchas individuales desaparecen en un plazo de 1-24h sin dejar ningún tipo de marca?",
"answer": "No",
"text": "Descartar toxicodermia (si distribución generalizada y/o simétrica), picaduras (si las lesiones se agrupan de forma lineal), eczema de contacto (si las lesiones tienen carácter artefacto), escabiosis (si predominio nocturno y/o agregación familiar) y urticaria vasculitis (si hay sintomatología sistémica asociada)"
},
{
"question": "¿Presenta el paciente angioedema o hinchazón de alguna parte del cuerpo (ej. Cara, manos, pies...) acompañado de picor/dolor que desaparece en un plazo de 72h sin dejar ningún tipo de marca?",
"answer": "No",
"text": "No. Descartar angioedema asociado a la urticaria"
},
{
"question": "El paciente ha experimentado estos episodios de forma más o menos continuada por un periodo de:",
"answer": "≥ 6 semanas",
"text": "Considerar urticaria crónica"
}
],
"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 benull
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 benull
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 to multiple encounters, for example, one created by the practitioner and another one created autommatically 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 to 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": "Rostro y cuello"
}
}
We include information related to the condition of the given diagnostic report.
In Legit.Health a condition represents a pathology of a patient located in a body syste.
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 benull
if the diagnostic report has not diagnosed yet.bodySite
. Contains the information about the body site in which the image was taken.
Original Media
"originalMedia": {
"type": "Image",
"modality": "Clinical",
"diqaScore": 74,
"url": "https://legit-app-pre.s3.eu-west-3.amazonaws.com/signedPath"
}
Since a diagnostic report is generated over an image, we include the data about the image uploaded by the user.
modality
. Our algorithms can distinguis betweenClinical
andDermatoscopic
images.diqaScore
is the dermathology score measuring the validity of the image from a clinical perspective.url
. Link to the image. Since we have a strongly system to protect access to images, this link is only valid for 5 minutes, so you have to process it before ir expires.
Result
This object contains the result emitted by our AI algorithms.
id
The internal identifier of the result in Legit.Health 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 diagnose purposes. Each field is a number representing a probability from 0 to 100.
isPreMalignantSuspicion
andisMalignantSuspicion
contains the values calculated by the algorithm related to malignancy.adjustedIsPreMalignantSuspicion
contains the value estimated by the practitioner in case he decides to overwrite the previous one.
explainabilityMedia
"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 AI algorithm. It contains extra layers indicating where are the lesions and its surface.
url
. Link to the analyzed image. Since we have a strongly system to protect access to images, this link is only valid for 5 minutes, so you have to process it before ir 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 insides the array has the following shape:
pathology
object, with the information about the detected pathology.probability
. The estimated value for that pathology.
scoringSystems
In order for the practitioner can monitor a pathology, some of them have a series of associated questionnaires known as Scoring Systems.
For example, this is the case of the PASI in psoriasis or the SCORAD in the case of dermatitis.
"scoringSystems": [
{
"scoringSystem": {
"name": "APASI",
"code": "APASI"
},
"score": 0.7,
"scoreCategory": "Moderado",
"resultScoringSystemFacets": [
{
"facet": {
"name": "Area afectada",
"description": "Este valor corresponde al porcentaje de afectación de la zona concreta del cuerpo que estás reportando"
},
"valueToDisplay": "10% (1)"
},
{
"facet": {
"name": "Rojez",
"description": "Este valor corresponde a la intensidad de la rojez de la lesión"
},
"valueToDisplay": "Grave (3)"
},
{
"facet": {
"name": "Induración",
"description": "Este valor corresponde al grado de endurecimiento o durez de la lesión"
},
"valueToDisplay": "Moderado (2)"
},
{
"facet": {
"id": 4,
"name": "Descamación",
"description": "Este valor corresponde al grado de caída de capas superficiales de la piel de la zona afectada",
"allowsInputFromUser": false,
"inputAdornment": null
}
}
],
"history": [
{
"date": "2021-07-14T15:09:38+00:00",
"score": 2.4,
"scoreCategory": "Grave"
},
{
"date": "2021-08-05T10:49:13+00:00",
"score": 1.6,
"scoreCategory": "Grave"
},
{
"date": "2021-08-11T14:58:38+00:00",
"score": 10,
"scoreCategory": "Grave"
},
{
"date": "2022-03-24T17:17:22+00:00",
"score": 0.7,
"scoreCategory": "Moderado"
}
],
"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": "¿Los habones/ronchas se presentan con prurito asociado?",
"answer": "Sí",
"text": "Considerar urticaria como diagnóstico"
},
{
"question": "¿Los habones o ronchas individuales desaparecen en un plazo de 1-24h sin dejar ningún tipo de marca?",
"answer": "No",
"text": "Descartar toxicodermia (si distribución generalizada y/o simétrica), picaduras (si las lesiones se agrupan de forma lineal), eczema de contacto (si las lesiones tienen carácter artefacto), escabiosis (si predominio nocturno y/o agregación familiar) y urticaria vasculitis (si hay sintomatología sistémica asociada)"
},
{
"question": "¿Presenta el paciente angioedema o hinchazón de alguna parte del cuerpo (ej. Cara, manos, pies...) acompañado de picor/dolor que desaparece en un plazo de 72h sin dejar ningún tipo de marca?",
"answer": "No",
"text": "No. Descartar angioedema asociado a la urticaria"
},
{
"question": "El paciente ha experimentado estos episodios de forma más o menos continuada por un periodo de:",
"answer": "≥ 6 semanas",
"text": "Considerar urticaria crónica"
}
],
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.