prescription.document

Prescription Document Model

Intermediate representation that decouples section data collection from rendering. Sections write only to this model; renderers read only from this model.

Kramer Harrison, 2026

Classes

Document(title, generated_at, sections)

Top-level document model.

KeyValueBlock(rows[, title])

A sequence of key-value pairs.

Section(title, blocks)

One labelled section of the document.

SeparatorBlock()

Visual separator (horizontal rule / blank line).

TableBlock(headers, rows[, title])

A structured table with pre-formatted string cells.

TextBlock(text)

A free-form paragraph or note.

class Document(title: str, generated_at: str, sections: list[~prescription.document.Section] = <factory>)[source]

Top-level document model.

generated_at: str
sections: list[Section]
title: str
class KeyValueBlock(rows: list[tuple[str, str]], title: str | None = None)[source]

A sequence of key-value pairs.

rows: list[tuple[str, str]]
title: str | None = None
class Section(title: str, blocks: list[~prescription.document.KeyValueBlock | ~prescription.document.TableBlock | ~prescription.document.TextBlock | ~prescription.document.SeparatorBlock] = <factory>)[source]

One labelled section of the document.

blocks: list[KeyValueBlock | TableBlock | TextBlock | SeparatorBlock]
title: str
class SeparatorBlock[source]

Visual separator (horizontal rule / blank line).

class TableBlock(headers: list[str], rows: list[list[str]], title: str | None = None)[source]

A structured table with pre-formatted string cells.

headers: list[str]
rows: list[list[str]]
title: str | None = None
class TextBlock(text: str)[source]

A free-form paragraph or note.

text: str