@alfadocs/ui-kit 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{actions-cell-renderer-ClGCSQnA.js → actions-cell-renderer-Ceah0ywE.js} +2 -2
- package/dist/_chunks/anamnesis-i18n-DGRdwc0i.js +8720 -0
- package/dist/_chunks/arrow-up-BYvcvTkB.js +26 -0
- package/dist/_chunks/{editable-currency-cell-renderer-Dus_sBvX.js → editable-currency-cell-renderer-Uhzkd0ZP.js} +68 -88
- package/dist/_chunks/{exceljs.min-DUJ-5CGx.js → exceljs.min-D2MHbJsF.js} +10 -9
- package/dist/_chunks/{face-scheme-Cou2efl7.js → face-scheme-C00IvkUA.js} +237 -243
- package/dist/_chunks/{file-manager-CNSLiuLo.js → file-manager-lNjcSXoD.js} +174 -186
- package/dist/_chunks/minus-BQDHq1c1.js +12 -0
- package/dist/_chunks/notebook-pen-CO7HoM-W.js +25 -0
- package/dist/_chunks/{notes-panel-CCz0J140.js → notes-panel-DPsgB4Mv.js} +73 -92
- package/dist/_chunks/{patient-table-DXk0wW8Q.js → patient-table-C7QHFC63.js} +2 -2
- package/dist/_chunks/share-2-B49jcW2I.js +18 -0
- package/dist/_chunks/{sparkline-DJtZBe7O.js → sparkline-BTY4B5tv.js} +153 -145
- package/dist/agent-catalog.json +1 -1
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/notes-panel/index.d.ts +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/sparkline/sparkline.d.ts +5 -4
- package/dist/index.js +132 -109
- package/dist/patterns/_shared/target-tile.d.ts +31 -0
- package/dist/patterns/anamnesis/anamnesis-catalogue.d.ts +23 -0
- package/dist/patterns/anamnesis/anamnesis-compare-panel.d.ts +82 -0
- package/dist/patterns/anamnesis/anamnesis-compile-blocks.d.ts +46 -0
- package/dist/patterns/anamnesis/anamnesis-compile.d.ts +48 -0
- package/dist/patterns/anamnesis/anamnesis-config-editor.d.ts +26 -0
- package/dist/patterns/anamnesis/anamnesis-config.d.ts +62 -0
- package/dist/patterns/anamnesis/anamnesis-derive.d.ts +194 -0
- package/dist/patterns/anamnesis/anamnesis-digest.d.ts +84 -0
- package/dist/patterns/anamnesis/anamnesis-disclosure.d.ts +19 -0
- package/dist/patterns/anamnesis/anamnesis-event-bar.d.ts +12 -0
- package/dist/patterns/anamnesis/anamnesis-events.d.ts +60 -0
- package/dist/patterns/anamnesis/anamnesis-evolution-grid.d.ts +48 -0
- package/dist/patterns/anamnesis/anamnesis-evolution.d.ts +37 -0
- package/dist/patterns/anamnesis/anamnesis-export-download.d.ts +10 -0
- package/dist/patterns/anamnesis/anamnesis-export-menu.d.ts +23 -0
- package/dist/patterns/anamnesis/anamnesis-export-pdf.d.ts +36 -0
- package/dist/patterns/anamnesis/anamnesis-export.d.ts +143 -0
- package/dist/patterns/anamnesis/anamnesis-field.d.ts +14 -0
- package/dist/patterns/anamnesis/anamnesis-format.d.ts +67 -0
- package/dist/patterns/anamnesis/anamnesis-i18n.d.ts +6 -0
- package/dist/patterns/anamnesis/anamnesis-indicators.d.ts +53 -0
- package/dist/patterns/anamnesis/anamnesis-intake.d.ts +16 -0
- package/dist/patterns/anamnesis/anamnesis-matrix.d.ts +91 -0
- package/dist/patterns/anamnesis/anamnesis-notes.d.ts +19 -0
- package/dist/patterns/anamnesis/anamnesis-readonly.d.ts +17 -0
- package/dist/patterns/anamnesis/anamnesis-summary.d.ts +35 -0
- package/dist/patterns/anamnesis/anamnesis-target-editor.d.ts +18 -0
- package/dist/patterns/anamnesis/anamnesis-target-strip.d.ts +14 -0
- package/dist/patterns/anamnesis/anamnesis-targets.d.ts +58 -0
- package/dist/patterns/anamnesis/anamnesis-types.d.ts +336 -0
- package/dist/patterns/anamnesis/anamnesis-visit-note.d.ts +35 -0
- package/dist/patterns/anamnesis/anamnesis-window.d.ts +37 -0
- package/dist/patterns/anamnesis/anamnesis.d.ts +48 -0
- package/dist/patterns/anamnesis/index.d.ts +8 -0
- package/dist/patterns/anamnesis/index.js +26 -0
- package/dist/tokens.css +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import type { MarkerShape } from '../../components/annotation-marker';
|
|
3
|
+
import type { SparklineAnnotation, SparklineAnnotationTone } from '../../components/sparkline';
|
|
4
|
+
import type { ClinicalEvent, ClinicalEventCategory, Visit } from './anamnesis-types';
|
|
5
|
+
/**
|
|
6
|
+
* ONE shape per category, and that is the whole vocabulary — five distinct
|
|
7
|
+
* glyphs, no per-category hue.
|
|
8
|
+
*
|
|
9
|
+
* Five saturated semantic tones (error / success / accent / warning / info)
|
|
10
|
+
* used to ride these shapes. Three or four events picked at once put four
|
|
11
|
+
* competing hues across a 32px-tall sparkline, nineteen rows deep, and the
|
|
12
|
+
* annotations then out-shouted the trend line they exist to annotate. Shape
|
|
13
|
+
* is already the accessible channel here (WCAG 1.4.1, and the kit's rule in
|
|
14
|
+
* `src/components/annotation-marker/`), so the hue was reinforcement the
|
|
15
|
+
* reader was paying for in noise.
|
|
16
|
+
*/
|
|
17
|
+
export declare const EVENT_SHAPE: Record<ClinicalEventCategory, MarkerShape>;
|
|
18
|
+
/**
|
|
19
|
+
* The single restrained tone every annotation wears, chip and line alike.
|
|
20
|
+
*
|
|
21
|
+
* `neutral` resolves to `--muted-foreground`, the only hueless token that
|
|
22
|
+
* clears WCAG 1.4.11's 3:1 for a non-text graphic in all four themes
|
|
23
|
+
* (measured 6.9:1 light, 7.5:1 dark, 18.4:1 / 13.9:1 accessible, against
|
|
24
|
+
* `--card`). Hueless is the point: the trend line is tinted by VALENCE —
|
|
25
|
+
* green improving, red worsening — and an annotation with a hue of its own
|
|
26
|
+
* competes with that read.
|
|
27
|
+
*/
|
|
28
|
+
export declare const EVENT_TONE: SparklineAnnotationTone;
|
|
29
|
+
/** An event that HAS a place on the plot, with the fraction it sits at. */
|
|
30
|
+
export interface EventMark {
|
|
31
|
+
event: ClinicalEvent;
|
|
32
|
+
/** Fraction of the shared x domain: 0 = first visit, 1 = latest. */
|
|
33
|
+
position: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Where an event sits on the domain every row shares, or `null` when it has
|
|
37
|
+
* no place on the plot.
|
|
38
|
+
*
|
|
39
|
+
* `null` — rather than a clamp to 0 or 1 — for an event outside the visit
|
|
40
|
+
* span: the plot covers first visit → latest, and pinning an event that
|
|
41
|
+
* predates the record to the left edge would invent a correlation with a
|
|
42
|
+
* measurement taken before it happened. Also `null` below two visits (no
|
|
43
|
+
* extent to sit on) and on any unreadable date.
|
|
44
|
+
*
|
|
45
|
+
* `visits` is read in ARRAY ORDER, and chronological order is an UNCHECKED
|
|
46
|
+
* precondition: an out-of-order array can bracket the event on a span that
|
|
47
|
+
* runs backwards and place the marker accordingly.
|
|
48
|
+
*/
|
|
49
|
+
export declare function eventPosition(event: ClinicalEvent, visits: readonly Visit[]): number | null;
|
|
50
|
+
/** The events that can be drawn, in the order they happened. */
|
|
51
|
+
export declare function eventMarks(events: readonly ClinicalEvent[] | undefined, visits: readonly Visit[]): EventMark[];
|
|
52
|
+
/** "Chemotherapy started · 2 Sep 2024" — what the chip says. */
|
|
53
|
+
export declare function eventLabel(event: ClinicalEvent, t: TFunction): string;
|
|
54
|
+
/** Rides the chip as its accessible description: what kind of thing this was,
|
|
55
|
+
* and — when it was not this practice's own decision — who recorded it. */
|
|
56
|
+
export declare function eventDetail(event: ClinicalEvent, t: TFunction): string;
|
|
57
|
+
/** The picked events as sparkline annotations. Every row of the grid is given
|
|
58
|
+
* this SAME array, which is what pins one event to one x down the column. */
|
|
59
|
+
export declare function eventAnnotations(marks: readonly EventMark[], activeIds: ReadonlySet<string>, t: TFunction): SparklineAnnotation[];
|
|
60
|
+
//# sourceMappingURL=anamnesis-events.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import type { SparklineAnnotation } from '../../components/sparkline';
|
|
3
|
+
import { type VisitColumn } from './anamnesis-window';
|
|
4
|
+
import type { AnamnesisRecord, NumericParameterDef, OpenAnamnesisNote, Visit } from './anamnesis-types';
|
|
5
|
+
export interface AnamnesisEvolutionGridProps {
|
|
6
|
+
record: AnamnesisRecord;
|
|
7
|
+
defs: NumericParameterDef[];
|
|
8
|
+
t: TFunction;
|
|
9
|
+
/** Make the newest visit column editable (compile mode). */
|
|
10
|
+
editable?: boolean;
|
|
11
|
+
onCellChange?: (visit: Visit, def: NumericParameterDef, value: number | null) => void;
|
|
12
|
+
/** Compare mode: the visit ids under comparison (two or more) + the CELLS
|
|
13
|
+
* that differ from the compared column before them, keyed
|
|
14
|
+
* `<visitId>:<parameterKey>`. Per cell, never per parameter: at three or
|
|
15
|
+
* more compared visits a column equal to its predecessor did not change. */
|
|
16
|
+
compare?: {
|
|
17
|
+
visitIds: ReadonlySet<string>;
|
|
18
|
+
changedCells: ReadonlySet<string>;
|
|
19
|
+
} | null;
|
|
20
|
+
/** Draw the outer border + surface (standalone use). Set `false` when the
|
|
21
|
+
* grid already sits inside a card, to avoid a box-in-a-box. */
|
|
22
|
+
framed?: boolean;
|
|
23
|
+
/** Mount this visit's note popover already open. Demo/story hook only —
|
|
24
|
+
* Chromatic skips play functions, so a click-opened popover is never
|
|
25
|
+
* snapshotted. Ignored once `onOpenNote` is wired. */
|
|
26
|
+
defaultOpenNoteVisitId?: string;
|
|
27
|
+
/** Route a visit's note to the host's side panel instead of opening it in
|
|
28
|
+
* place. Omitted = read in place, which is all a standalone grid can do. */
|
|
29
|
+
onOpenNote?: OpenAnamnesisNote;
|
|
30
|
+
/** Which columns render, from the visit window. Omitted = every visit.
|
|
31
|
+
* Column order and `index` always follow `record.visits`; the window
|
|
32
|
+
* changes what is SHOWN, never what was computed. */
|
|
33
|
+
visitColumns?: readonly VisitColumn[];
|
|
34
|
+
/** Keys the practice still captures. A key outside this set renders its
|
|
35
|
+
* history read-only: archiving stops capture, it never erases the record.
|
|
36
|
+
* Omitted = every def is capturable. */
|
|
37
|
+
capturableKeys?: ReadonlySet<string>;
|
|
38
|
+
/** Event reference lines, positioned as a fraction of the record's visit
|
|
39
|
+
* span. Every row gets this SAME array, which is what makes one event one
|
|
40
|
+
* vertical line down the whole grid rather than one line per row. */
|
|
41
|
+
annotations?: readonly SparklineAnnotation[];
|
|
42
|
+
/** Make those lines pointer-selectable — pressing one is pressing the
|
|
43
|
+
* event's chip in the bar above. Omitted = the lines stay decorative, which
|
|
44
|
+
* is all a grid with no event bar above it can honestly offer. */
|
|
45
|
+
onSelectAnnotation?: (eventId: string) => void;
|
|
46
|
+
}
|
|
47
|
+
export declare function AnamnesisEvolutionGrid({ record, defs, t, editable, onCellChange, compare, framed, defaultOpenNoteVisitId, onOpenNote, visitColumns, capturableKeys, annotations, onSelectAnnotation, }: AnamnesisEvolutionGridProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
//# sourceMappingURL=anamnesis-evolution-grid.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import { type PracticeAnamnesisConfig } from './anamnesis-config';
|
|
3
|
+
import type { AnamnesisRecord, NumericParameterDef, OpenAnamnesisNote, Visit } from './anamnesis-types';
|
|
4
|
+
export interface AnamnesisEvolutionProps {
|
|
5
|
+
record: AnamnesisRecord;
|
|
6
|
+
t: TFunction;
|
|
7
|
+
editable?: boolean;
|
|
8
|
+
onCellChange?: (visit: Visit, def: NumericParameterDef, value: number | null) => void;
|
|
9
|
+
/** Draw the grid's own border/surface. `false` when this sits inside a card. */
|
|
10
|
+
framed?: boolean;
|
|
11
|
+
/** The practice's configured vocabulary. Omitted = the kit-seeded default. */
|
|
12
|
+
config?: PracticeAnamnesisConfig;
|
|
13
|
+
/** Mount with the compare panel already open. Demo/story hook only —
|
|
14
|
+
* Chromatic skips play functions, so a click-opened panel is never
|
|
15
|
+
* snapshotted. */
|
|
16
|
+
defaultCompareOpen?: boolean;
|
|
17
|
+
/** Mount with this visit selection instead of first + latest. Demo/story
|
|
18
|
+
* hook only, for the same Chromatic reason. */
|
|
19
|
+
defaultVisitIds?: readonly string[];
|
|
20
|
+
/** Mount the compare panel on this set of visits instead of first + latest.
|
|
21
|
+
* Demo/story hook only, for the same Chromatic reason. */
|
|
22
|
+
defaultCompareVisitIds?: readonly string[];
|
|
23
|
+
/** Mount with these events already drawn. Demo/story hook only — the
|
|
24
|
+
* arrival state picks none, and Chromatic skips play functions. */
|
|
25
|
+
defaultEventIds?: readonly string[];
|
|
26
|
+
/** The picker's live selection, whenever it changes (and once on mount).
|
|
27
|
+
* The Diagnosis surface's one export control needs to know which visit
|
|
28
|
+
* columns are on screen — the file must be the view that was asked for. */
|
|
29
|
+
onVisitSelectionChange?: (visitIds: readonly string[]) => void;
|
|
30
|
+
/** The host's side panel. Wired ⇒ a visit's note trigger routes there
|
|
31
|
+
* instead of opening a popover, and turning an event chip on navigates the
|
|
32
|
+
* panel to that event. Omitted ⇒ the note opens in place and the chip only
|
|
33
|
+
* draws its line, which is all a standalone surface can do. */
|
|
34
|
+
onOpenNote?: OpenAnamnesisNote;
|
|
35
|
+
}
|
|
36
|
+
export declare function AnamnesisEvolution({ record, t, editable, onCellChange, framed, config, defaultCompareOpen, defaultVisitIds, defaultCompareVisitIds, defaultEventIds, onVisitSelectionChange, onOpenNote, }: AnamnesisEvolutionProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
//# sourceMappingURL=anamnesis-evolution.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CsvDialect, type ExportDocument } from './anamnesis-export';
|
|
2
|
+
/** Hand a Blob to the browser as a download. Returns `false` where there is no
|
|
3
|
+
* DOM to hand it to (SSR, a node test), so callers can fall back rather than
|
|
4
|
+
* throw. */
|
|
5
|
+
export declare function downloadBlob(blob: Blob, filename: string): boolean;
|
|
6
|
+
/** Download the document as a `.csv` in the dialect its locale calls for. */
|
|
7
|
+
export declare function downloadCsv(doc: ExportDocument, dialect?: CsvDialect): boolean;
|
|
8
|
+
/** Download the document as an `.xlsx`. Async: exceljs is dynamic-imported. */
|
|
9
|
+
export declare function downloadXlsx(doc: ExportDocument): Promise<boolean>;
|
|
10
|
+
//# sourceMappingURL=anamnesis-export-download.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import type { PracticeAnamnesisConfig } from './anamnesis-config';
|
|
3
|
+
import type { DisclosureAudience } from './anamnesis-disclosure';
|
|
4
|
+
import { type AnamnesisExportTab } from './anamnesis-export';
|
|
5
|
+
import type { AnamnesisRecord } from './anamnesis-types';
|
|
6
|
+
export interface AnamnesisExportMenuProps {
|
|
7
|
+
/** The tab the surface is showing. The control acts on THIS view. */
|
|
8
|
+
tab: AnamnesisExportTab;
|
|
9
|
+
record: AnamnesisRecord;
|
|
10
|
+
t: TFunction;
|
|
11
|
+
config?: PracticeAnamnesisConfig;
|
|
12
|
+
/** Evolution only: the visit columns the grid is currently showing. */
|
|
13
|
+
shownVisitIds?: readonly string[];
|
|
14
|
+
/** Mount with the menu open. Demo/story hook only — Chromatic skips play
|
|
15
|
+
* functions, so a click-opened menu is never snapshotted. */
|
|
16
|
+
defaultOpen?: boolean;
|
|
17
|
+
/** Mount with the share preview open. Demo/story hook, same reason. */
|
|
18
|
+
defaultShareOpen?: boolean;
|
|
19
|
+
/** Mount on this audience instead of the practice copy. Demo/story hook. */
|
|
20
|
+
defaultAudience?: DisclosureAudience;
|
|
21
|
+
}
|
|
22
|
+
export declare function AnamnesisExportMenu({ tab, record, t, config, shownVisitIds, defaultOpen, defaultShareOpen, defaultAudience, }: AnamnesisExportMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=anamnesis-export-menu.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ExportDocument } from './anamnesis-export';
|
|
2
|
+
export declare const PDF_MIME = "application/pdf";
|
|
3
|
+
export type PdfRgb = [number, number, number];
|
|
4
|
+
export interface PdfPalette {
|
|
5
|
+
headerFill: PdfRgb;
|
|
6
|
+
headerText: PdfRgb;
|
|
7
|
+
bodyText: PdfRgb;
|
|
8
|
+
mutedText: PdfRgb;
|
|
9
|
+
zebraFill: PdfRgb;
|
|
10
|
+
sectionFill: PdfRgb;
|
|
11
|
+
}
|
|
12
|
+
/** The document palette for the theme `scope` is rendered in. Pass the pattern
|
|
13
|
+
* root; omit it and the fallback greys are used. */
|
|
14
|
+
export declare function pdfPalette(scope?: Element | null): PdfPalette;
|
|
15
|
+
/** True when jsPDF can draw `text` with a built-in face — i.e. it will not be
|
|
16
|
+
* silently re-encoded as UTF-16. */
|
|
17
|
+
export declare function isWinAnsiSafe(text: string): boolean;
|
|
18
|
+
/** Respell the symbols a standard-14 face cannot draw. Applied at the writer
|
|
19
|
+
* boundary, so the arrow survives on screen and in the spreadsheet. */
|
|
20
|
+
export declare function pdfSafeText(text: string): string;
|
|
21
|
+
export interface PdfOptions {
|
|
22
|
+
palette?: PdfPalette;
|
|
23
|
+
/** Set the PDF's own open action so the viewer raises the print dialog.
|
|
24
|
+
* This is what the Print item uses; a downloaded PDF leaves it off. */
|
|
25
|
+
autoPrint?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** The document as a paged PDF. jspdf + jspdf-autotable are dynamic-imported,
|
|
28
|
+
* so neither ships to a consumer who never exports. */
|
|
29
|
+
export declare function toPdfBlob(document: ExportDocument, options?: PdfOptions): Promise<Blob>;
|
|
30
|
+
/** Download the document as a `.pdf`. */
|
|
31
|
+
export declare function downloadPdf(document: ExportDocument, options?: PdfOptions): Promise<boolean>;
|
|
32
|
+
/** Point an off-screen frame at the document with the print action armed, and
|
|
33
|
+
* hand the object URL back so the caller can revoke it. `null` means there was
|
|
34
|
+
* no frame or no `URL.createObjectURL` to build one with. */
|
|
35
|
+
export declare function printPdf(document: ExportDocument, frame: HTMLIFrameElement | null, options?: PdfOptions): Promise<string | null>;
|
|
36
|
+
//# sourceMappingURL=anamnesis-export-pdf.d.ts.map
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import { type PracticeAnamnesisConfig } from './anamnesis-config';
|
|
3
|
+
import { type DisclosureAudience } from './anamnesis-disclosure';
|
|
4
|
+
import type { AnamnesisRecord, NumericParameterDef } from './anamnesis-types';
|
|
5
|
+
/** A cell. `null` is ABSENT and every writer renders it as an empty cell —
|
|
6
|
+
* never the em dash the screen uses, which a spreadsheet cannot compute on. */
|
|
7
|
+
export type ExportValue = string | number | null;
|
|
8
|
+
export interface ExportColumn {
|
|
9
|
+
/** Stable key — the Excel column key, never rendered. */
|
|
10
|
+
key: string;
|
|
11
|
+
/** Translated header text. */
|
|
12
|
+
header: string;
|
|
13
|
+
/** Numbers land in this column: right-aligned and number-formatted. */
|
|
14
|
+
numeric?: boolean;
|
|
15
|
+
/** Decimal places for numeric cells, when the whole column shares one. */
|
|
16
|
+
precision?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ExportRow {
|
|
19
|
+
/** `section` is a group banner: cell 0 carries the label, the rest is blank. */
|
|
20
|
+
kind?: 'data' | 'section';
|
|
21
|
+
/** Aligned to `columns` by index; short rows are padded by the writer. */
|
|
22
|
+
cells: ExportValue[];
|
|
23
|
+
/** Decimal places for THIS row's numeric cells — a parameter row carries its
|
|
24
|
+
* own precision, and the column cannot know it. Wins over the column. */
|
|
25
|
+
precision?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ExportTable {
|
|
28
|
+
/** Stable id — the worksheet key and the PDF anchor. */
|
|
29
|
+
id: string;
|
|
30
|
+
title: string;
|
|
31
|
+
columns: ExportColumn[];
|
|
32
|
+
rows: ExportRow[];
|
|
33
|
+
/** Rendered in place of the rows when there are none. */
|
|
34
|
+
emptyText?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ExportMetaEntry {
|
|
37
|
+
label: string;
|
|
38
|
+
value: string;
|
|
39
|
+
}
|
|
40
|
+
/** Which tab was exported. */
|
|
41
|
+
export type AnamnesisExportTab = 'summary' | 'compile' | 'evolution';
|
|
42
|
+
export interface ExportDocument {
|
|
43
|
+
tab: AnamnesisExportTab;
|
|
44
|
+
audience: DisclosureAudience;
|
|
45
|
+
/** Filename without an extension — see `exportFileName`. */
|
|
46
|
+
fileStem: string;
|
|
47
|
+
title: string;
|
|
48
|
+
/** Who the copy names, or `null` when identity is not disclosed to this
|
|
49
|
+
* audience. Lifted out of `meta` so a writer can stamp every page with it. */
|
|
50
|
+
patientName: string | null;
|
|
51
|
+
/** The audience, translated — the "Copy for" value, in one place. */
|
|
52
|
+
audienceLabel: string;
|
|
53
|
+
meta: ExportMetaEntry[];
|
|
54
|
+
tables: ExportTable[];
|
|
55
|
+
/** Translated notes rendered under the tables. */
|
|
56
|
+
footnotes: string[];
|
|
57
|
+
/** Disclosure concept IDS held back from this document. Metadata for the UI
|
|
58
|
+
* and the tests — writers never print it, because an id is not a value. */
|
|
59
|
+
withheld: string[];
|
|
60
|
+
/** App locale, resolved from `t`. Drives the CSV dialect. */
|
|
61
|
+
locale?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface AnamnesisExportOptions {
|
|
64
|
+
record: AnamnesisRecord;
|
|
65
|
+
/** Who the file is for. Filters every table through `disclosedTo`. */
|
|
66
|
+
audience: DisclosureAudience;
|
|
67
|
+
t: TFunction;
|
|
68
|
+
config?: PracticeAnamnesisConfig;
|
|
69
|
+
/** Generation instant. Defaults to now — pass one to keep a test stable. */
|
|
70
|
+
generatedAtIso?: string;
|
|
71
|
+
}
|
|
72
|
+
/** `selected` exports the columns the picker is showing; `all` exports every
|
|
73
|
+
* visit. Defaults to `selected`: exporting thirteen visits from a screen
|
|
74
|
+
* showing three is a different document from the one that was asked for. */
|
|
75
|
+
export type EvolutionExportScope = 'selected' | 'all';
|
|
76
|
+
export interface EvolutionExportOptions extends AnamnesisExportOptions {
|
|
77
|
+
/** The picker's current selection. Omitted = the picker's own default
|
|
78
|
+
* (first visit + latest), never "everything". */
|
|
79
|
+
selectedVisitIds?: Iterable<string>;
|
|
80
|
+
scope?: EvolutionExportScope;
|
|
81
|
+
}
|
|
82
|
+
/** A parameter's disclosure concept, from its DISPLAY group — not from
|
|
83
|
+
* `parameterStorage`, which routes a practice-added anthropometric through the
|
|
84
|
+
* `labs` array and would classify it as a lab value. */
|
|
85
|
+
export declare function parameterConcept(def: NumericParameterDef): string;
|
|
86
|
+
/** The Summary tab: the patient's own questionnaire, one row per answered
|
|
87
|
+
* question, grouped by section, with who authored each answer. */
|
|
88
|
+
export declare function buildSummaryExport(options: AnamnesisExportOptions): ExportDocument;
|
|
89
|
+
/** The Compile tab: the visit being recorded, block by block, in the order the
|
|
90
|
+
* form presents them. Each block is gated on its own disclosure concept. */
|
|
91
|
+
export declare function buildCompileExport(options: AnamnesisExportOptions): ExportDocument;
|
|
92
|
+
/** The Evolution tab: parameters as rows, the SHOWN visits as columns, plus
|
|
93
|
+
* target, window change and which visits fell out of range. */
|
|
94
|
+
export declare function buildEvolutionExport(options: EvolutionExportOptions): ExportDocument;
|
|
95
|
+
/** One entry point for a tab id — the UI stage switches on the active tab. */
|
|
96
|
+
export declare function buildAnamnesisExport(tab: AnamnesisExportTab, options: EvolutionExportOptions): ExportDocument;
|
|
97
|
+
/** A withheld concept's translated name. The id carries dots and i18next reads
|
|
98
|
+
* a dot as a level, so the key flattens them — `lab.values` reads
|
|
99
|
+
* `anamnesis.export.concept.lab_values`. An id with no key falls back to the
|
|
100
|
+
* id rather than to a blank, so a rule nobody has named still shows up. */
|
|
101
|
+
export declare function conceptLabel(conceptId: string, t: TFunction): string;
|
|
102
|
+
export interface DocumentDisclosure {
|
|
103
|
+
/** Table titles the document actually carries, in document order. */
|
|
104
|
+
included: string[];
|
|
105
|
+
/** Translated names of the concepts held back, alphabetical. */
|
|
106
|
+
excluded: string[];
|
|
107
|
+
}
|
|
108
|
+
/** What this document gives the audience and what it holds back — the share
|
|
109
|
+
* dialog's whole content, and the menu's exclusion line. Reads the built
|
|
110
|
+
* document rather than re-deriving the rules, so the preview cannot disagree
|
|
111
|
+
* with the file. */
|
|
112
|
+
export declare function documentDisclosure(document: ExportDocument, t: TFunction): DocumentDisclosure;
|
|
113
|
+
export declare const CSV_MIME = "text/csv;charset=utf-8";
|
|
114
|
+
export declare const XLSX_MIME = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
115
|
+
export interface CsvDialect {
|
|
116
|
+
/** Field separator. `;` wherever the decimal mark is a comma. */
|
|
117
|
+
delimiter: ',' | ';';
|
|
118
|
+
decimal: '.' | ',';
|
|
119
|
+
eol: string;
|
|
120
|
+
/** Emit a UTF-8 BOM so Excel detects the encoding instead of guessing. */
|
|
121
|
+
bom: boolean;
|
|
122
|
+
}
|
|
123
|
+
/** The CSV convention Excel expects for a locale. Italian (and every other
|
|
124
|
+
* decimal-comma locale) gets `;` + `,`; English gets `,` + `.`. A locale whose
|
|
125
|
+
* decimal mark is neither — Arabic's `٫` — takes the point convention, because
|
|
126
|
+
* the numbers written here are Latin digits either way. */
|
|
127
|
+
export declare function csvDialectFor(locale?: string): CsvDialect;
|
|
128
|
+
/** One cell, escaped. Exported for the tests that pin the escaping rules. */
|
|
129
|
+
export declare function csvCell(value: ExportValue, dialect: CsvDialect, precision?: number): string;
|
|
130
|
+
/** The document as one CSV. Tables run in order, each behind its own title
|
|
131
|
+
* row and separated by a blank line — the report shape every spreadsheet
|
|
132
|
+
* reader already understands. */
|
|
133
|
+
export declare function toCsv(document: ExportDocument, dialect?: CsvDialect): string;
|
|
134
|
+
export declare function toCsvBlob(document: ExportDocument, dialect?: CsvDialect): Blob;
|
|
135
|
+
/** The document as an `.xlsx` — the info block on its own sheet, then one
|
|
136
|
+
* sheet per table. No colour: the kit's tokens are CSS custom properties that
|
|
137
|
+
* only resolve against a live DOM, and this module has none. Weight and
|
|
138
|
+
* freeze-panes carry the hierarchy instead. */
|
|
139
|
+
export declare function toXlsxBlob(document: ExportDocument): Promise<Blob>;
|
|
140
|
+
export type ExportFormat = 'csv' | 'xlsx' | 'pdf';
|
|
141
|
+
/** Deterministic, meaningful, and free of anything a filesystem rejects. */
|
|
142
|
+
export declare function exportFileName(document: ExportDocument, format: ExportFormat): string;
|
|
143
|
+
//# sourceMappingURL=anamnesis-export.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import type { AnswerOrigin, IntakeAnswer, IntakeFieldDef } from './anamnesis-types';
|
|
3
|
+
export interface AnamnesisFieldProps {
|
|
4
|
+
def: IntakeFieldDef;
|
|
5
|
+
answer?: IntakeAnswer;
|
|
6
|
+
onChange: (answer: IntakeAnswer) => void;
|
|
7
|
+
/** Show the "from patient" marker when the value still carries patient origin
|
|
8
|
+
* (compile mode). Intake mode leaves this off — the patient owns the form. */
|
|
9
|
+
showOrigin?: boolean;
|
|
10
|
+
origin?: AnswerOrigin;
|
|
11
|
+
t: TFunction;
|
|
12
|
+
}
|
|
13
|
+
export declare function AnamnesisField({ def, answer, onChange, showOrigin, origin, t, }: AnamnesisFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=anamnesis-field.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import type { AnamnesisRecord, IntakeAnswer, IntakeFieldDef, IntakeSectionDef, NumericParameterDef, PathologyCode, PatientSex, Visit } from './anamnesis-types';
|
|
3
|
+
/** Only show a field when it is relevant to the patient's recorded sex.
|
|
4
|
+
* Single definition — this previously existed three times (intake, compile,
|
|
5
|
+
* read-only) and drifting copies are a correctness risk, not just noise. */
|
|
6
|
+
export declare function fieldVisible(def: IntakeFieldDef, sex: PatientSex): boolean;
|
|
7
|
+
/** The locale a `t` is fixed to. Both `useTranslation()` and a locale-pinned
|
|
8
|
+
* `getFixedT(lng, ns)` set it, so this is the app language on every surface. */
|
|
9
|
+
export declare function localeOf(t: TFunction): string | undefined;
|
|
10
|
+
/** Every stored date rendered outside a JSX `<Timestamp>`. Pins UTC AND the
|
|
11
|
+
* app locale, so one visit cannot render two ways on one screen. */
|
|
12
|
+
export declare function visitDateLabel(iso: string, t: TFunction): string;
|
|
13
|
+
/** A stored `YYYY-MM-DD` as a LOCAL calendar date. `new Date(iso)` would parse
|
|
14
|
+
* it as UTC midnight and render the previous day west of Greenwich — the
|
|
15
|
+
* off-by-one this pattern has already had to fix once. */
|
|
16
|
+
export declare function parseCalendarDate(iso: string): Date | undefined;
|
|
17
|
+
/** A local calendar date back to `YYYY-MM-DD`. `toISOString()` would convert to
|
|
18
|
+
* UTC first and can land on the wrong day; these are the local components. */
|
|
19
|
+
export declare function toCalendarIso(date: Date): string;
|
|
20
|
+
/** One visit as an option label. The ordinal disambiguates two visits recorded
|
|
21
|
+
* on the same calendar day, which would otherwise read identically.
|
|
22
|
+
*
|
|
23
|
+
* `hasNote` marks a visit whose note is only readable once that visit is a
|
|
24
|
+
* column — without it the picker gives the reader no reason to pick it, and
|
|
25
|
+
* the note is unreachable in practice rather than one tick away. */
|
|
26
|
+
export declare function visitOptionLabel(visit: Visit, index: number, t: TFunction, hasNote?: boolean): string;
|
|
27
|
+
/** Age at an EXPLICIT reference instant. An unreadable date of birth or
|
|
28
|
+
* reference date renders the em dash — the same absence marker every other
|
|
29
|
+
* unknown uses, and never the "NaN years" the raw subtraction used to print.
|
|
30
|
+
* Surfaces call `patientAgeLabel`; this stays for a caller that genuinely has
|
|
31
|
+
* its own reference date. */
|
|
32
|
+
export declare function ageLabel(dateOfBirthIso: string, referenceIso: string, t: TFunction): string;
|
|
33
|
+
/** The patient header's age line, on every surface. Takes the RECORD rather
|
|
34
|
+
* than a date, so no call site can pick its own reference visit — picking one
|
|
35
|
+
* per surface is exactly how intake and compile came to print two different
|
|
36
|
+
* ages for the same patient. A record with no visit has no age to state. */
|
|
37
|
+
export declare function patientAgeLabel(record: AnamnesisRecord, t: TFunction): string;
|
|
38
|
+
/** Numeric parameter label — practice wording, else `anamnesis.param.<key>`. */
|
|
39
|
+
export declare function parameterLabel(def: NumericParameterDef, t: TFunction): string;
|
|
40
|
+
/** Parameter label with its unit appended, as the form fields render it. Unit
|
|
41
|
+
* symbols (kg, mg/dL) are locale-invariant scientific notation. */
|
|
42
|
+
export declare function parameterLabelWithUnit(def: NumericParameterDef, t: TFunction): string;
|
|
43
|
+
/** Intake field label — practice wording, else `anamnesis.field.<key>.label`. */
|
|
44
|
+
export declare function intakeFieldLabel(def: IntakeFieldDef, t: TFunction): string;
|
|
45
|
+
/** Optional help text under an intake field. Practice help text wins; the kit
|
|
46
|
+
* key is optional and resolves to `undefined` when unset. */
|
|
47
|
+
export declare function intakeFieldHelp(def: IntakeFieldDef, t: TFunction): string | undefined;
|
|
48
|
+
/** Section heading — practice wording, else `anamnesis.section.<key>`. */
|
|
49
|
+
export declare function sectionLabel(section: IntakeSectionDef, t: TFunction): string;
|
|
50
|
+
/** Pathology description. The code itself is never translated; the entry may
|
|
51
|
+
* be absent from the taxonomy entirely, in which case the code stands alone.
|
|
52
|
+
* `pathologyLabelKey` sanitises the dot — i18next reads `.` as a separator, so
|
|
53
|
+
* `E66.0` must never be concatenated into a key by hand. */
|
|
54
|
+
export declare function pathologyLabel(code: string, t: TFunction, entry?: PathologyCode): string;
|
|
55
|
+
/** `E66.0 — Obesity due to excess calories`, the form the pickers and badges
|
|
56
|
+
* render. Falls back to the bare code when nothing describes it. */
|
|
57
|
+
export declare function pathologyCodeWithLabel(code: string, t: TFunction, entry?: PathologyCode): string;
|
|
58
|
+
/** Whether an answer carries a real response. Shared by the progress meter,
|
|
59
|
+
* the digest and the mandatory-answer check, so all three agree. "Not sure"
|
|
60
|
+
* counts as UNANSWERED — provisional, pending the customer's own rule. Zero is
|
|
61
|
+
* a value: every numeric branch is `!= null`, never a truthiness test. */
|
|
62
|
+
export declare function isIntakeAnswered(answer: IntakeAnswer | undefined): boolean;
|
|
63
|
+
/** One intake answer as a read-only string. Absent values render an em dash —
|
|
64
|
+
* never "undefined", never a bare hyphen. Zero is a value: every check here is
|
|
65
|
+
* `!= null`, never a truthiness test on a number. */
|
|
66
|
+
export declare function formatIntakeAnswer(answer: IntakeAnswer, def: IntakeFieldDef, t: TFunction): string;
|
|
67
|
+
//# sourceMappingURL=anamnesis-format.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { i18n as I18nInstance } from 'i18next';
|
|
2
|
+
export declare const PATTERN_NS = "patterns";
|
|
3
|
+
/** Register the story-local bundles onto the shared singleton (deep-merge,
|
|
4
|
+
* never overwrite; never init). Idempotent across HMR reloads. */
|
|
5
|
+
export declare function registerAnamnesisBundles(i18n: I18nInstance): void;
|
|
6
|
+
//# sourceMappingURL=anamnesis-i18n.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import { type SparklineAnnotation } from '../../components/sparkline';
|
|
3
|
+
import { type DeltaInfo, type RangeFlag } from './anamnesis-derive';
|
|
4
|
+
import type { NumericParameterDef } from './anamnesis-types';
|
|
5
|
+
export interface DeltaIndicatorProps {
|
|
6
|
+
/** The derived change vs the previous visit; `null` renders nothing (first
|
|
7
|
+
* visit has no delta — never render a broken arrow). */
|
|
8
|
+
delta: DeltaInfo | null;
|
|
9
|
+
def: NumericParameterDef;
|
|
10
|
+
t: TFunction;
|
|
11
|
+
}
|
|
12
|
+
/** Arrow + signed change vs the previous visit, coloured by whether the change
|
|
13
|
+
* is an improvement for THIS parameter. */
|
|
14
|
+
export declare function DeltaIndicator({ delta, def, t }: DeltaIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
export interface OriginMarkerProps {
|
|
16
|
+
t: TFunction;
|
|
17
|
+
}
|
|
18
|
+
/** "From patient" badge shown against a value the patient submitted and the
|
|
19
|
+
* clinician has not yet confirmed or edited. Uses the info family (calm,
|
|
20
|
+
* informational — distinct from the clinical status colours). */
|
|
21
|
+
export declare function OriginMarker({ t }: OriginMarkerProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export interface OutOfRangeBadgeProps {
|
|
23
|
+
flag: RangeFlag;
|
|
24
|
+
t: TFunction;
|
|
25
|
+
/** Icon-only chip for dense grid cells; otherwise shows a short label. */
|
|
26
|
+
compact?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** H/L flag for a lab value outside its reference range. Warning tone +
|
|
29
|
+
* direction glyph + colour-blind dot; the accessible name says above/below. */
|
|
30
|
+
export declare function OutOfRangeBadge({ flag, t, compact, }: OutOfRangeBadgeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
31
|
+
export interface TrendSparklineProps {
|
|
32
|
+
/** ONE ENTRY PER RECORD VISIT, in visit order. `null` is a visit where this
|
|
33
|
+
* parameter was not measured, and it HOLDS its place on the x extent —
|
|
34
|
+
* that is what keeps a lab drawn four times over a thirteen-visit history
|
|
35
|
+
* on the same x scale as a weight drawn thirteen times, so an event
|
|
36
|
+
* annotation lands on the same date in both. */
|
|
37
|
+
series: (number | null)[];
|
|
38
|
+
def: NumericParameterDef;
|
|
39
|
+
t: TFunction;
|
|
40
|
+
/** Event reference lines. The SAME array is handed to every row, so one
|
|
41
|
+
* event is one vertical line down the whole grid. */
|
|
42
|
+
annotations?: readonly SparklineAnnotation[];
|
|
43
|
+
/** Make those lines pointer-selectable. Supplied ⇒ pressing one does what
|
|
44
|
+
* pressing its chip in the bar above does. The chip bar is the keyboard
|
|
45
|
+
* route and stays the only one — the lines live inside a `role="img"`. */
|
|
46
|
+
onSelectAnnotation?: (eventId: string) => void;
|
|
47
|
+
}
|
|
48
|
+
/** Compact inline trend across all visits, tinted by the overall valence
|
|
49
|
+
* (first → last measurement) for the parameter. Reduced motion is honoured by
|
|
50
|
+
* Sparkline internally. Renders nothing below two measurements (no trend to
|
|
51
|
+
* draw) — the gaps do not count towards that. */
|
|
52
|
+
export declare function TrendSparkline({ series, def, t, annotations, onSelectAnnotation, }: TrendSparklineProps): import("react/jsx-runtime").JSX.Element | null;
|
|
53
|
+
//# sourceMappingURL=anamnesis-indicators.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import { type PracticeAnamnesisConfig } from './anamnesis-config';
|
|
3
|
+
import type { AnamnesisRecord } from './anamnesis-types';
|
|
4
|
+
export interface AnamnesisIntakeProps {
|
|
5
|
+
record: AnamnesisRecord;
|
|
6
|
+
t: TFunction;
|
|
7
|
+
/** Mount flush inside a host section tab (drops the full-page chrome + own
|
|
8
|
+
* page title). */
|
|
9
|
+
embedded?: boolean;
|
|
10
|
+
/** The practice's configured questionnaire. Omitted = the kit-seeded form. */
|
|
11
|
+
config?: PracticeAnamnesisConfig;
|
|
12
|
+
/** Demo/story hook: which section is open on mount. Defaults to the first. */
|
|
13
|
+
defaultOpenSection?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function AnamnesisIntake({ record, t, embedded, config, defaultOpenSection, }: AnamnesisIntakeProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=anamnesis-intake.d.ts.map
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { TFunction } from 'i18next';
|
|
3
|
+
import type { OpenAnamnesisNote } from './anamnesis-types';
|
|
4
|
+
import type { VisitColumn } from './anamnesis-window';
|
|
5
|
+
/** Static class literals — Tailwind has to see every arbitrary value at build
|
|
6
|
+
* time, and a class built by interpolation emits no CSS at all. */
|
|
7
|
+
/** Floored at the longest parameter label + its unit and reference range on
|
|
8
|
+
* ONE line — measured across en / ar / ja under `.theme-accessible`, whose
|
|
9
|
+
* larger type is the widest case (ja "HDLコレステロール", 147px + 16px of cell
|
|
10
|
+
* padding). Below that the label wraps and the cell goes to three lines. */
|
|
11
|
+
export declare const MATRIX_IDENTITY_CLASS = "ds:min-w-[11rem]";
|
|
12
|
+
/** Floored by the editable cell, not by the number it shows: `NumberInput`
|
|
13
|
+
* spends 56px on its two spinners and 16px on input padding before a digit is
|
|
14
|
+
* drawn, so 128px of column is 40px of readable value. It cannot go lower. */
|
|
15
|
+
export declare const MATRIX_VISIT_COLUMN_CLASS = "ds:min-w-[8rem]";
|
|
16
|
+
/**
|
|
17
|
+
* A PERCENTAGE, not a rem cap — that is what redirects the spare pixels.
|
|
18
|
+
*
|
|
19
|
+
* Under `table-layout: auto` the spare width of a table narrower than its
|
|
20
|
+
* container goes to whichever columns declare no width, and `max-width` on a
|
|
21
|
+
* table cell is only honoured while some other column is left to absorb. The
|
|
22
|
+
* old `w-[9rem] max-w-[10rem]` therefore pinned the trend at 160px and handed
|
|
23
|
+
* everything else to the identity and value columns — 325px and 443px of
|
|
24
|
+
* mostly whitespace at 1440px wide. Claiming a share instead inverts that.
|
|
25
|
+
* When the table DOES overflow, the percentage stops applying and the
|
|
26
|
+
* min-width is what the trend gets.
|
|
27
|
+
*/
|
|
28
|
+
export declare const MATRIX_TREND_COLUMN_CLASS = "ds:w-[40%] ds:min-w-[14rem]";
|
|
29
|
+
/** Apply to every `<td>` a surface hands to `trailing`, so the column sticks
|
|
30
|
+
* as one piece rather than only in its header. */
|
|
31
|
+
export declare const MATRIX_TRAILING_CELL_CLASS = "ds:sticky ds:end-0 ds:z-[1] ds:bg-[color:var(--card)] ds:shadow-[var(--shadow-chrome-start)]";
|
|
32
|
+
/** Every body cell in a value column. Exported so both surfaces open from the
|
|
33
|
+
* same padding / alignment rather than each picking its own. */
|
|
34
|
+
export declare const MATRIX_CELL_CLASS = "ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:align-top";
|
|
35
|
+
export interface MatrixVisitHeaderProps {
|
|
36
|
+
column: VisitColumn;
|
|
37
|
+
t: TFunction;
|
|
38
|
+
/** Muted fill — the column is one of the compared pair/set. */
|
|
39
|
+
emphasised?: boolean;
|
|
40
|
+
/** Adds the "Editable" chip; compile mode's newest column only. */
|
|
41
|
+
editable?: boolean;
|
|
42
|
+
/** Render this visit's note popover already open (demo hook). */
|
|
43
|
+
defaultOpenNoteVisitId?: string;
|
|
44
|
+
/** Offer the note affordance. The compare panel sets this `false`: its
|
|
45
|
+
* columns repeat the grid's, and two note triggers with the same accessible
|
|
46
|
+
* name on one screen is a control the reader has to disambiguate. */
|
|
47
|
+
withNote?: boolean;
|
|
48
|
+
/** Route the note to the host's side panel instead of opening it in place. */
|
|
49
|
+
onOpenNote?: OpenAnamnesisNote;
|
|
50
|
+
}
|
|
51
|
+
/** One visit's `<th scope="col">`, identical wherever the visit is a column. */
|
|
52
|
+
export declare function MatrixVisitHeader({ column, t, emphasised, editable, defaultOpenNoteVisitId, withNote, onOpenNote, }: MatrixVisitHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export interface MatrixRowSpec {
|
|
54
|
+
key: string;
|
|
55
|
+
/** Full-width group banner. When set, every other field is ignored. */
|
|
56
|
+
banner?: string;
|
|
57
|
+
/** The row's `<th scope="row">` element. */
|
|
58
|
+
header?: ReactNode;
|
|
59
|
+
/** One `<td>` per visit column, in column order. */
|
|
60
|
+
cells?: readonly ReactNode[];
|
|
61
|
+
/** The `<td>` under the trend column. */
|
|
62
|
+
trend?: ReactNode;
|
|
63
|
+
/** The `<td>` under the trailing column, where the table declares one. */
|
|
64
|
+
trailing?: ReactNode;
|
|
65
|
+
}
|
|
66
|
+
export interface AnamnesisMatrixProps {
|
|
67
|
+
captionId: string;
|
|
68
|
+
/** Screen-reader caption naming what the table holds. */
|
|
69
|
+
caption: string;
|
|
70
|
+
/** Header of the sticky identity column. */
|
|
71
|
+
identityLabel: string;
|
|
72
|
+
/** Header of the trend column. */
|
|
73
|
+
trendLabel: string;
|
|
74
|
+
/** Test hook on the trend header. Only one matrix on screen may claim it,
|
|
75
|
+
* so the grid takes it and the compare panel below goes without. */
|
|
76
|
+
trendTestId?: string;
|
|
77
|
+
/** One `<th scope="col">` per visit column — build them with
|
|
78
|
+
* `MatrixVisitHeader` so the two surfaces cannot disagree. */
|
|
79
|
+
visitHeaders: readonly ReactNode[];
|
|
80
|
+
/** Header of a column rendered after every visit. Omitted = no such column. */
|
|
81
|
+
trailingLabel?: string;
|
|
82
|
+
/** Test hook on the trailing header — the surface names it, not the shell. */
|
|
83
|
+
trailingTestId?: string;
|
|
84
|
+
rows: readonly MatrixRowSpec[];
|
|
85
|
+
/** Draw the outer border + surface. `false` inside a card, to avoid a
|
|
86
|
+
* box-in-a-box. */
|
|
87
|
+
framed?: boolean;
|
|
88
|
+
testId?: string;
|
|
89
|
+
}
|
|
90
|
+
export declare function AnamnesisMatrix({ captionId, caption, identityLabel, trendLabel, trendTestId, visitHeaders, trailingLabel, trailingTestId, rows, framed, testId, }: AnamnesisMatrixProps): import("react/jsx-runtime").JSX.Element;
|
|
91
|
+
//# sourceMappingURL=anamnesis-matrix.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import type { NotesPanelNote } from '../../components/notes-panel';
|
|
3
|
+
import type { AnamnesisNoteTarget, AnamnesisRecord } from './anamnesis-types';
|
|
4
|
+
/**
|
|
5
|
+
* The note id a target addresses. The host hands this to `NotesPanel`'s
|
|
6
|
+
* `currentNoteId`; the panel marks, scrolls to and focuses that note. Namespaced
|
|
7
|
+
* so anamnesis notes can share a timeline with the host's own without a
|
|
8
|
+
* collision.
|
|
9
|
+
*/
|
|
10
|
+
export declare function anamnesisNoteId(target: AnamnesisNoteTarget): string;
|
|
11
|
+
/**
|
|
12
|
+
* The record's notes and events as one timeline, newest first — the order
|
|
13
|
+
* `NotesPanel` documents for `notes` (it re-sorts only to lead with pinned).
|
|
14
|
+
*
|
|
15
|
+
* A host with notes of its own concatenates and re-sorts by `dateIso`: this is
|
|
16
|
+
* a contribution to the patient's timeline, not a replacement for it.
|
|
17
|
+
*/
|
|
18
|
+
export declare function anamnesisNotes(record: AnamnesisRecord, t: TFunction): NotesPanelNote[];
|
|
19
|
+
//# sourceMappingURL=anamnesis-notes.d.ts.map
|