Documentation
Platform API
Build your solution
Fetching Results

Fetching interview results

After a finished interview (when a question returns HTTP code 204) the client can call a set of endpoints that can summarize an interview and present some useful information. Those endpoints are:

Below is a breakdown of each of them:

Evidence Assessment

To be able to fetch Infermedica’s AI Assessment, the user must both complete the interview and provide evidence during the interview before calling the GET query to /api/mgp/v1/surveys/{survey_id}/evidence_assessment.

ℹ️

Remember that in order to be able to complete an interview the survey needs to be created with section dynamic.

Such a request may look like this:

Evidence Assessment

Example:

cURL
curl "https://api.infermedica.com/api/mgp/v1/surveys/{survey_id}/evidence_assessment" \
  -X "GET" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"

Response:

As you can see in the response below, there are three attributes with null values. In order to obtain a response with condition details or explanations you can use two corresponding query parameters: condition_details and explanations. Examples of requests with both of those parameters are found in the adjacent tabs.

JSON
{
  "conditions": [
    {
      "id": "c_927",
      "name": "De Quervain syndrome",
      "common_name": "De Quervain syndrome",
      "probability": 0.8589,
      "rating": "strong",
      "icd10": [
        {
          "code": "M65.4"
        }
      ],
      "condition_details": null,
      "explain": null,
      "patient_education": null
    }
  ],
  "triage": {
    "level": "self_care",
    "description": "The symptoms you have declared may not require medical evaluation and they usually resolve on their own. Sometimes they can be eased with self-care methods. If the symptoms get worse or new symptoms appear, consult a doctor.",
    "serious": []
  }
}

Response object

conditions (list)

Each response contains a conditions attribute holding a list of possible conditions sorted by their estimated probability.

Each condition in the rankings is represented by a JSON object with the following attributes: id, name, common_name, icd10, and probability.

The probability attribute is a floating point number between 0 and 1, indicating a match between the reported evidence and conditions in the model.

Please note that the condition rankings may be empty [ ] if there is no evidence or, in rare cases, where the combination of evidence isn’t associated with any specific condition.

triage (object)

  • level (str)
    • emergency – the reported evidence may indicate a serious or life-threatening condition and thus the patient may require immediate medical attention,
    • consultation – the patient may require a medical consultation when possible,
    • self_care – the declared symptoms may not require medical evaluation and they usually resolve on their own. Sometimes they can be treated with self-care methods. Patients should observe their symptoms and consult a doctor if the symptoms get worse or new ones appear.
  • serious (list) – Each listed observation has an unique ID and name. All observations returned in the serious list are alarming and require consultation with a medical professional. Each serious observation has a seriousness value of either: serious, emergency, or emergency_ambulance. Observations with emergency or emergency\_ambulance seriousness are particularly urgent and may require immediate attention.

Errors when fetching evidence assessment

Survey not found

If you try to fetch an evidence assessment for a survey that does not exist you will receive a 404 Not Found HTTP response with the following message:

JSON
{
  "detail": "Survey not found"
}

Summary

To be able to fetch the collected information from the survey, the patient must complete the interview then call the GET query to /api/mgp/v1/surveys/{survey_id}/summary.

Errors when fetching survey summary

Survey not found

If you try to fetch a summary for a survey that does not exist you will receive a 404 Not Found HTTP response with the following message:

JSON
{
  "detail": "Survey not found"
}

Specialist Recommendation

The /api/mgp/v1/surveys/{survey_id}/specialist_recommendation endpoint provides a specialist recommendation based on a user's interview responses, specifying the type of specialist to consult and the suggested channel for the consultation.

Example:

cURL
curl "https://api.infermedica.com/api/mgp/v1/surveys/{survey_id}/specialist_recommendation" \
  -X "GET" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"

Response:

JSON
{
  "recommended_specialist": "Orthopedist",
  "recommended_channel": "personal_visit"
}

Response object

The response contains the following attributes:

  • recommended_specialist – name of the recommended specialist, one of:
    • Allergologist
    • Angiologist
    • Cardiologist
    • Dentist
    • Dermatologist
    • Diabetologist
    • Endocrinologist
    • ENT doctor
    • Gastroenterologist
    • General Practitioner
    • Gynecologist
    • Hematologist
    • Infectologist
    • Internal Medicine Specialist
    • Maxillofacial Surgeon
    • Neonatologist
    • Nephrologist
    • Neurologist
    • Oncologist
    • Ophthalmologist
    • Orthopedist
    • Pediatrician
    • Psychiatrist
    • Pulmonologist
    • Rheumatologist
    • Surgeon
    • Toxicologist
    • Urologist
  • recommended_channel – a channel recommendation, one of:
    • personal_visit – In-person visit
    • video_teleconsultation – Video consultation
    • audio_teleconsultation – Telephone or any other consultation with audio only
    • text_teleconsultation – Chat

Errors when fetching specialist recommendation

Survey not found

If you try to fetch a specialist recommendation for a survey that does not exist you will receive a 404 Not Found HTTP response with the following message:

JSON
{
  "detail": "Survey not found"
}

PDF Summary

The /api/mgp/v1/surveys/{survey_id}/summary_pdf endpoint generates and returns a PDF document summarizing the patient's medical interview, encapsulating the details of the survey responses and diagnostic information. The contents of PDF documents are equivalent to those of summary endpoint, but presented in PDF format.

Example:

cURL
curl "https://api.infermedica.com/api/mgp/v1/surveys/{survey_id}/summary_pdf" \
  -X "GET" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"

Response object

A PDF document with interview summary.

Errors when fetching PDF summary

Survey not found

If you try to fetch a PDF summary for a survey that does not exist you will receive a 404 Not Found HTTP response with the following message:

JSON
{
  "detail": "Survey not found"
}