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.
| Printed on the report | Standardized name | LOINC code | Standard unit |
|---|---|---|---|
| SGPT | ALT | 1742-6 | U/L |
| ALT (SGPT) | |||
| Alanine Transaminase | |||
| GPT | |||
| SGOT | AST | 1920-8 | U/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
- Does one marker have one history? If SGPT and ALT appear as separate markers, the name resolution did not join them.
- Are the units the same across the line? A mixed unit on one line makes the chart wrong even if every value is right.
- Does the range match the report? Open the source and compare the printed range with the one shown.
