Skip to main content

Lab Result Report

A final CBC pathology report from a diagnostic laboratory with editorial masthead, half-open page chrome, and highlighted abnormal results.

  • Vector status chip and meta block. The chip comes with a three-column meta block with Code128 accession barcode.
  • At a glance. Four tiles counting the tests reported and how many fell within, above and below their ranges.
  • Results table. The abnormal values and their flags are set on oxblood and amber cell backgrounds, with a range bar per test: the reference range as a band, the result as a dot where it falls.
  • Trends. The two flagged results over the last four visits, each a small chart with its reference range shaded and the latest value in its flag's colour.
  • Multi-page flow. Results, trends, methodology and disclaimers, with director signature + QR portal link.

Features used: PDF/A-3b conformance, watermarks, columns, tables, lists, rules, SVG, barcodes (code128, qrcode), data binding, headers and footers

How it's built​

The patient, specimen, provider, laboratory and accession come from the data file ($data.patient.name, $data.specimen.collectedAt, $data.accession.number and so on). The results, the tiles and the trend charts are written in the document itself.

A flagged result and its range bar​

Each result row is written out cell by cell. An abnormal value and its flag take a style with a background: tdHighValue and tdHighFlag on oxblood, tdLowValue and tdLowFlag on amber; a value in range takes tdMono and its flag cell a dash in tdCenter. The "Where it falls" cell is an svg with the same 84 × 12 viewBox in every row: a grey track, the reference range as a band from 21 to 63, and a dot where the result falls, styled dotHigh, dotLow or dotNormal. Its title says the same thing in words for a screen reader.

{
"svg": {
"title": "White Blood Cell Count (WBC): 12.8, above the reference range 4 to 11",
"viewBox": [84, 12],
"style": "tdBar",
"children": [
{ "rect": { "x": 0, "y": 4, "width": 84, "height": 4, "rx": 2, "style": "barTrack" } },
{ "rect": { "x": 21.0, "y": 4, "width": 42.0, "height": 4, "style": "barBand" } },
{ "circle": { "cx": 73.8, "cy": 6, "r": 3.6, "style": "dotHigh" } }
]
}
}

The two trend charts follow the same idea at a larger size: a rect styled chartBand for the reference range, a path through the four visits, and the latest point drawn with dotHigh or dotLow. Their desc lists the four values and the range.

Page chrome and the edge barcode​

The header ends in an svg of two lines, a short stroke down at the left and a rule across; the footer opens with the mirror image, a rule across and a short stroke at the right. Together they make the half-open frame around each page's content.

The accession number runs up the right edge of every page as three watermarks turned with angle 90: a hairline, the Code 128 and the number in text, each with repeat true and its own spacing. A fourth, VHIPAA PROTECTED, is placed once across the middle at -28 degrees, faded by the opacity of its style centerWatermark (Watermarks).

{
"watermarks": [
{
"content": { "p": "[barcode,code128,$data.accession.number,180|14]" },
"angle": 90,
"repeat": true,
"spacing": [1180, 792],
"style": "edgeBarcode"
},
{
"content": { "p": "$data.accession.number" },
"angle": 90,
"repeat": true,
"spacing": [1155, 792],
"style": "edgeBarcodeLabel"
}
]
}