Documentation
Platform API
Build your solution
Presenting Results to Clinicians

Presenting results to clinicians

When a doctor or nurse opens a finished interview, they need to see quickly what matters: how urgent the case is, why the patient came, and which warning signs the patient confirmed. A full list of every question and answer is hard to read and hides this information.

This page shows how to build a short, clear view for clinicians (for example a nurse view or a summary note in your system) from the Platform API results:

ℹ️

Grouping related symptoms uses the hierarchy fields of the Symptoms endpoint, available from Platform API 6.23.0.

Which data to fetch

Fetch the results once the interview is finished. The simplest trigger is the survey_finished webhook, which sends you the survey_id. By default, the result endpoints return 409 Conflict until the interview is finished (see Fetching results).

CallWhat it gives youUsed for
GET /surveys/{survey_id}/summaryPatient age and sex, present_symptoms, absent_symptoms, skipped_symptoms ("don't know" answers) and risk_factors. Each item has id, name, choice_id, source and seriousness, and duration when symptom duration is enabledReason for contact, red flags, risk factors, problems, absent and unknown
GET /surveys/{survey_id}/evidence_assessment?condition_details=true&explanations=truetriage.level, triage.serious (alarming findings) and conditions with probability and explainUrgency, alarming findings, possible conditions
GET /surveys/{survey_id}/specialist_recommendationspecialist and channelRecommended next step
GET /knowledge/symptoms with the IDs of the present symptomsparent_id, parent_relation and children for each symptomGrouping related symptoms

The name field in the summary holds the medical name of each symptom (for example Dyspnea), which is the wording clinicians expect.

Recommended layout

Show the clinician what decides the next step first, and the long tail last. Each block maps to fields from the calls above.

OrderBlockWhat the clinician seesData
1UrgencyTriage level, alarming findings, recommended specialist and channeltriage.level, triage.serious, specialist, channel
2Reason for contactThe symptoms the patient entered at the startpresent_symptoms with source: "initial"
3Red flagsWarning signs the patient confirmed, both symptoms and risk factorspresent_symptoms and risk_factors with source: "red_flags"
4Risk factorsConfirmed risk factors first, then the ones the patient said do not applyrisk_factors not already shown as red flags, split by choice_id
5ProblemsOne card per complaint, with its duration and detailspresent_symptoms, grouped by parent (see below), with duration (see below)
6Other present symptomsShort tags, not a long listThe remaining present_symptoms
7Absent and unknownWhat the patient denied, and what they answered "don't know"absent_symptoms, skipped_symptoms
8Possible conditionsFolded by default, with percentages and "Why?"conditions (see below)

Example clinician view: urgency and alarming findings at the top, then reason for contact, red flags, risk factors, one card per complaint, other symptoms, absent and unknown answers, and the possible conditions with percentages

Example clinician view built from Platform API results. The numbers match the blocks in the table above. Values are illustrative.

Picking out each block

The summary already splits answers into present, absent, unknown and risk factors, so most blocks need only one filter:

  • Reason for contact: present symptoms with source equal to "initial".
  • Red flags: items with source equal to "red_flags" in both present_symptoms and risk_factors. The red flags question can list both symptoms and risk factors, so check both lists. Only the red flags the patient confirmed appear in the summary.
  • Risk factors: filter risk_factors on choice_id, leaving out the ones already shown as red flags. Show present first, then absent. Show unknown together with the other "don't know" answers.
  • Alarming findings: triage.serious from the evidence assessment. These are the serious findings behind the triage level, taken from the whole interview, not only the answers to the red flags question. Show them in the urgency block and keep them apart from the red flags block.
TypeScript
// Called from your survey_finished webhook handler.
// api.get is your HTTP client with the Bearer token already set.
const summary = await api.get(`/surveys/${surveyId}/summary`)
const assessment = await api.get(
  `/surveys/${surveyId}/evidence_assessment?condition_details=true&explanations=true`
)
const recommendation = await api.get(`/surveys/${surveyId}/specialist_recommendation`)
 
const present = summary.present_symptoms ?? []
const riskFactors = summary.risk_factors ?? []
const reasonForContact = present.filter((e) => e.source === 'initial')
 
// Red flags can be symptoms or risk factors
const isRedFlag = (e) => e.source === 'red_flags'
const redFlags = [
  ...present.filter(isRedFlag),
  ...riskFactors.filter((e) => isRedFlag(e) && e.choice_id === 'present'),
]
 
// Risk factors shown as red flags are not repeated in the risk factors block
const otherRiskFactors = riskFactors.filter((e) => !isRedFlag(e))
const riskFactorsYes = otherRiskFactors.filter((e) => e.choice_id === 'present')
const riskFactorsNo = otherRiskFactors.filter((e) => e.choice_id === 'absent')
 
const absent = summary.absent_symptoms ?? []
const unknown = [
  ...(summary.skipped_symptoms ?? []),
  ...riskFactors.filter((e) => e.choice_id === 'unknown'),
]
 
const urgency = {
  level: assessment.triage.level,
  alarming: assessment.triage.serious,
  specialist: recommendation.specialist,
  channel: recommendation.channel,
}
 
// Red flags have their own block; everything else feeds the problem cards
const redFlagIds = new Set(redFlags.map((e) => e.id))
const forProblems = present.filter((e) => !redFlagIds.has(e.id))

The symptoms in Reason for contact also feed the problem cards on purpose: Cough entered at the start is the parent that Cough, dry and Cough, productive are grouped under.

Grouping related symptoms

During the interview, the patient is asked about the details of each complaint. Every detail is a separate symptom in the summary, so a flat list repeats the same complaint many times. In the knowledge base, each detail is linked to its parent symptom through parent_id. Use that link to build one card per complaint.

In this real test interview, the summary lists these as separate items:

Separate items in present_symptomsOne card in the clinician view
Cough · Cough, dry · Cough, productive · Cough, lasting less than 3 weeksCough: dry, productive, lasting less than 3 weeks
Dyspnea · Dyspnea, lasting 1 to 24 hours · Dyspnea, without exertion · Dyspnea, during daily activitiesDyspnea: lasting 1 to 24 hours, without exertion, during daily activities
Fever · Fever, between 38°C and 40°C · Fever, lasting less than 3 daysFever: between 38°C and 40°C, lasting less than 3 days

How to group

  1. Take the IDs of the present symptoms that feed the problem cards.
  2. Call GET /api/mgp/v1/knowledge/symptoms with those IDs (repeat the id parameter), the patient's sex and age, and the interview language. Send at most 50 IDs per request (limit=50).
  3. For each symptom, follow parent_id upwards as long as the parent is also in the summary. The highest symptom you reach is the card the item belongs to.
  4. A symptom whose parent is not in the summary, or which has no parent, is shown as a top-level item.
cURL
curl -G "https://api.infermedica.com/api/mgp/v1/knowledge/symptoms" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  --data-urlencode "sex=male" \
  --data-urlencode "language=en" \
  --data-urlencode "age.value=47" \
  --data-urlencode "age.unit=year" \
  --data-urlencode "limit=50" \
  --data-urlencode "id=s_962" \
  --data-urlencode "id=s_1779"

The response holds one item per ID with parent_id, parent_relation and children (see Symptom hierarchy). Here s_1779 has parent_id: "s_962" (Dysphagia) with parent_relation: "location", so both go on one card under Dysphagia.

TypeScript
type Item = { id: string; name: string; choice_id?: string; source?: string }
type Hierarchy = { id: string; parent_id: string | null; parent_relation: string | null }
 
// Step 2: fetch the hierarchy, 50 IDs per request
async function fetchHierarchy(ids: string[], patient, language: string) {
  const hierarchy = new Map<string, Hierarchy>()
  for (let i = 0; i < ids.length; i += 50) {
    const params = new URLSearchParams({
      sex: patient.sex,
      language,
      'age.value': String(patient.age.value),
      'age.unit': patient.age.unit,
      limit: '50',
    })
    ids.slice(i, i + 50).forEach((id) => params.append('id', id))
    const page = await api.get(`/knowledge/symptoms?${params}`)
    page.items.forEach((item: Hierarchy) => hierarchy.set(item.id, item))
  }
  return hierarchy
}
 
// Steps 3 and 4: one card per complaint
function groupByParent(items: Item[], hierarchy: Map<string, Hierarchy>) {
  // Show each symptom once (a follow-up summary can list the same symptom more than once)
  const unique = [...new Map(items.map((e) => [e.id, e])).values()]
  const byId = new Map(unique.map((e) => [e.id, e]))
 
  // Follow parent_id upwards while the parent is also in the summary
  const topOf = (id: string) => {
    let current = id
    const visited = new Set([current])
    let parent = hierarchy.get(current)?.parent_id
    while (parent && byId.has(parent) && !visited.has(parent)) {
      visited.add(parent)
      current = parent
      parent = hierarchy.get(current)?.parent_id
    }
    return current
  }
 
  const cards = new Map<string, { parent: Item; details: Item[] }>()
  for (const e of unique) {
    const top = topOf(e.id)
    const card = cards.get(top) ?? { parent: byId.get(top)!, details: [] }
    if (e.id !== top) card.details.push(e)
    cards.set(top, card)
  }
 
  // Cards with details go to "Problems", single symptoms to "Other present symptoms"
  const problems = [...cards.values()].filter((c) => c.details.length > 0)
  const other = [...cards.values()].filter((c) => c.details.length === 0).map((c) => c.parent)
  return { problems, other }
}
 
const hierarchy = await fetchHierarchy(forProblems.map((e) => e.id), summary.patient, 'en')
const { problems, other } = groupByParent(forProblems, hierarchy)

Things to keep in mind

  • Keep the names exactly as received. Grouping only changes where items sit, not what they say. Which detail goes on which card comes from parent_id alone, never from the text of the name. Do not rename, reword or translate the names.
  • Optional: hide the repeated parent name. To keep cards short, you may show a detail without the parent name at its start (show Cough, dry as dry under Cough). This is only a display shortcut: parent_id tells you that the detail belongs under its parent, but the API does not return a separate short label for the detail. Use it only when the detail name starts with exactly the parent name followed by a comma, and show the full name in every other case. Not every detail name starts with its parent's name, and the pattern can differ between languages.
  • Use parent_relation to order details if you want the same order on every card, for example location, character, severity, radiation, exacerbating and diminishing factors, then duration.
  • Not every related item has a parent link. Such items stay as separate entries. Nothing is lost, they are just not grouped.
  • Do not group by the text of the name. Splitting names on the first comma works for many details, but not for all of them, and the pattern may differ between languages. parent_id is the reliable link.
  • Risk factors have no hierarchy. Items with a p_ ID always return parent_id: null.

Symptom duration

How long a complaint has lasted often decides what the clinician does next, so show it on the problem card.

If symptom duration is enabled for your account (the SYMPTOM_DURATION setting), the interview also asks how long the patient has had a symptom. The answer is stored on that symptom in the summary as a duration object with a value and a unit (week, day, hour or minute), for example { "value": 5, "unit": "day" }.

When the setting is off, duration is empty. Duration then appears only as part of a symptom name, for example Cough, lasting less than 3 weeks, and it goes onto the card like any other detail (see Grouping related symptoms).

  • Show the duration next to the symptom it belongs to. When that symptom is the top of a card, put the duration in the card title, for example Cough · 5 days.
  • Show the value and unit as received. You may translate the unit word into the clinician's language. Do not round or convert the value (36 hours stays 36 hours), and do not turn it into a start date.
  • Show when the interview was finished. The duration counts back from the moment the patient answered, and a clinician may open the case hours or days later. Show the time you received the survey_finished webhook at the top of the view, so the clinician knows the reference point.
TypeScript
type Duration = { value: number; unit: 'week' | 'day' | 'hour' | 'minute' }
 
// duration is empty unless symptom duration is enabled for your account
const durationLabel = (d?: Duration | null) =>
  d ? `${d.value} ${d.unit}${d.value === 1 ? '' : 's'}` : null
 
// Card title, for example "Cough · 5 days"
const cardTitle = (card: { parent: Item & { duration?: Duration | null } }) =>
  [card.parent.name, durationLabel(card.parent.duration)].filter(Boolean).join(' · ')

Possible conditions

The evidence assessment already gives what clinicians usually ask for: a probability for each condition and the reasons behind it.

  • Show probability as a whole-number percentage (0.61 shown as "61%"), not as a strength label. The rating labels such as "strong" are written for patients; a clinician reads "moderate evidence" very differently from "15%".
  • Keep the order the API returns, highest probability first.
  • Add a "Why?" for each condition from explain (filled only when you call with explanations=true): supporting_evidence (for), conflicting_evidence (against) and unconfirmed_evidence (not yet confirmed). The last group tells the clinician which questions would confirm or rule out the condition. See Explain for details.
  • Fold the list by default and label it "Possible conditions, not a diagnosis". Urgency and the complaints come first.
  • Show the full list as received. Do not hide low percentages behind a threshold. Show several conditions or none, never a single one.
TypeScript
const conditions = assessment.conditions.map((c) => ({
  name: c.name,
  percent: `${Math.round(c.probability * 100)}%`,
  why: {
    for: c.explain?.supporting_evidence?.map((e) => e.name) ?? [],
    against: c.explain?.conflicting_evidence?.map((e) => e.name) ?? [],
    notConfirmed: c.explain?.unconfirmed_evidence?.map((e) => e.name) ?? [],
  },
}))

Percentages do not add up to 100%. Each one is the likelihood of that condition on its own, and several conditions can be likely at the same time.

Rules for showing results

The clinician view is your own screen built on data from the Platform API. To keep the results valid under the MDR certification:

  • Allowed: re-ordering, grouping, folding and styling of the results.
  • Not allowed: rewording names, triage levels or percentages, removing items, or lowering the urgency.
  • Conditions: show several or none, never a single one.
  • Your own content: keep your own questions and notes visibly separate from the Infermedica results.

Every Platform API implementation must also meet the MDR compliance requirements. If you are not sure whether a change to the presentation is allowed, contact our team before you go live.

Was this page helpful?