WebApp shared: Plotly partial bundle, card actions, print report, export module
Plotly partial bundle (bar, scatter, box, pie, sankey, contour) replacing the cartesian dist; card-actions (published Measure definitions, settings, Volver); Descargar reporte with a print stylesheet; export module: xlsx with frozen header, autofilter, Parámetros sheet and 5,000-row cap, pdfmake documents with header/footer, allRows following next links, file names without patient identifiers; lazy-loaded export libraries. Checks on milkpc (node:22): npm ci, ng build (initial 567 kB / 134 kB transfer), ng test 7 files passed.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import type { Bundle } from 'fhir/r4';
|
||||
import { MAX_ROWS } from './xlsx';
|
||||
|
||||
export async function allRows<T>(
|
||||
first: string,
|
||||
getPage: (url: string) => Promise<Bundle>,
|
||||
max = MAX_ROWS,
|
||||
): Promise<T[]> {
|
||||
const rows: T[] = [];
|
||||
let next: string | undefined = first;
|
||||
while (next && rows.length < max) {
|
||||
const page = await getPage(next);
|
||||
for (const { resource } of page.entry ?? []) {
|
||||
if (resource) rows.push(resource as T);
|
||||
if (rows.length >= max) return rows;
|
||||
}
|
||||
next = page.link?.find(({ relation }) => relation === 'next')?.url;
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
Reference in New Issue
Block a user