How Doctano reads a lab report

The hard part is not reading the page. It is deciding that two rows from two labs describe the same test.

Doctano reads the page, extracts each test with its value, unit, range, and date, then resolves the printed name to one standardized name and a LOINC code. Units are normalized to a standard unit, and the reference range is parsed so results can be compared. That is what lets one marker show a continuous history.

The worked example

Three reports, three labs, one test. A report from one lab prints SGPT. A second prints ALT (SGPT). A third prints Alanine Transaminase. A person reading them sees one number that moved. A program reading them sees three different strings unless something decides otherwise.

Three printed names, one standardized name, one code
Printed on the reportStandardized nameLOINC codeStandard unit
SGPTALT1742-6U/L
ALT (SGPT)
Alanine Transaminase
GPT
SGOTAST1920-8U/L
AST (SGOT)
Aspartate Transaminase

The rowspan is the whole argument of this page. Everything above the line is what the laboratory printed. Everything to the right is what has to be decided before the four values can be drawn as one line.

Step 1: extract the rows

The first step reads the document and pulls out the tests. For each row it needs the printed name, the result, the unit, the reference range, any flag or remark, and the report's dates. Panels and the report's own grouping come along too, because a report's sections tell you how the lab thinks about its tests.

This is where a page's layout matters most. A clean printed row is easy. A faint scan, a photo with glare, or two columns of results side by side are the cases where a value can be paired with the wrong test.

Step 2: resolve the name

The resolver maps the printed string to one standardized marker name. It is not a translation, and it is not a guess about what the test does. It answers a narrow question: does this row describe the same measurement as the marker called ALT?

This is what makes a trend possible. Without it, a person with four reports from three labs has four separate ALT rows that never meet.

Step 3: assign a LOINC code

LOINC is a standard vocabulary for laboratory observations. A code identifies what was measured, in which kind of sample, and in what kind of result. For ALT the usual code is 1742-6, and for AST it is 1920-8.

The code is what lets an app connect a value to anything else built on the same vocabulary, including the explanation of what the marker measures. Where a confident code cannot be assigned, the value still exists on the report and in the timeline; it just may not sit with the other results for that marker.

Step 4: normalize the unit

A result without a unit is not a result. Two labs can report the same measurement in different units, and a timeline that ignores that produces a jump that never happened. Doctano stores a standard unit for each marker and converts where a conversion applies.

Conversion is not comparison, though. It makes two values compatible; it does not make a change between two labs into a real change. The units guide covers which markers commonly appear in two units and what a conversion can and cannot tell you.

Step 5: parse the range

The reference range is printed per result and per lab. Sometimes it is a pair of numbers, sometimes a single bound, sometimes a phrase like "negative". Doctano parses it into something comparable where it can, and leaves the result labelled no data where it cannot, rather than inventing a range.

That decision is deliberately conservative. A missing range is a missing comparison, not a normal result.

When it cannot decide

Some rows resist all of this: an unmappable test, an ambiguous abbreviation, a range that does not parse. The behavior is to keep what is certain and mark what is not.

  • The value, unit, and dates stay with the report.
  • The result may be labelled no data rather than assigned a status.
  • A test that cannot be mapped is remembered as unmappable, so the outcome is stable instead of changing run to run.
  • The original file stays available, and View original is the final check.

What to check on your own timeline

  1. Does one marker have one history? If SGPT and ALT appear as separate markers, the name resolution did not join them.
  2. Are the units the same across the line? A mixed unit on one line makes the chart wrong even if every value is right.
  3. Does the range match the report? Open the source and compare the printed range with the one shown.

Questions

How a report is read

After extraction, a name resolver matches the printed name to one standardized marker name. SGPT, GPT, ALT, and alanine transaminase are different labels for the same measurement, so they resolve to one marker and appear in one history.

LOINC is a standard vocabulary for identifying laboratory observations. A code says what was measured, in what kind of sample, and in what kind of result, so two systems can agree that two differently named rows describe the same test.

The value is still extracted and stays on the report, but it may not join a grouped history. Unmappable tests are remembered so they are not repeatedly sent for mapping, which keeps the failure stable rather than random.

The stored value may be converted to a standard unit so results from different labs line up. The report itself is never altered, and View original always shows the file exactly as the laboratory issued it.

It is possible when names are ambiguous, which is why the source link matters. Open the report behind a value and check the printed name and unit. If a merge looks wrong, use the report as the record and tell support.

Related

Related pages

Verify the mapping. Name matching and unit conversion can be wrong. Check important values against the original report, especially when a result appears in a history it does not seem to belong to.

Start with your first report

Upload a lab report and Doctano will organize your results for you.

Upload your first report →