Añadir exportaciones de CaMa y conservar los filtros aplicados
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { Sheet } from '../export';
|
||||
import { STATES } from '../paciente/stages';
|
||||
import type { Row } from './follow-up';
|
||||
import type { CamaRow, Row } from './follow-up';
|
||||
import { name } from './measures';
|
||||
|
||||
const NONE = 'No disponible';
|
||||
@@ -50,3 +50,40 @@ export function followUpSheet(rows: Row[], query: [string, string][]): Sheet {
|
||||
]),
|
||||
};
|
||||
}
|
||||
|
||||
const CAMA_HEAD = [
|
||||
'Paciente',
|
||||
'CURP',
|
||||
'Grupo de edad',
|
||||
'Última mastografía (BI-RADS)',
|
||||
'Fecha de la mastografía',
|
||||
'Última biopsia',
|
||||
'Fecha de reporte de la biopsia',
|
||||
'Estatus de seguimiento',
|
||||
'Prioridad',
|
||||
];
|
||||
|
||||
/** CaMa's follow-up list as a table to save: what the page shows, a missing value said as such and
|
||||
* never filled in. */
|
||||
export function camaFollowUpSheet(
|
||||
rows: CamaRow[],
|
||||
query: [string, string][],
|
||||
priority: (code: string) => string,
|
||||
): Sheet {
|
||||
return {
|
||||
title: 'Resultados de seguimiento de cáncer de mama',
|
||||
query: [...query, ['Registros', `${rows.length}`]],
|
||||
head: CAMA_HEAD,
|
||||
rows: rows.map((r) => [
|
||||
r.name ?? r.patient.id!.slice(0, 10),
|
||||
r.curp ?? NONE,
|
||||
r.ageGroup || NONE,
|
||||
(r.mammogram.birads && name(r.mammogram.birads)) || 'Sin dato',
|
||||
r.mammogram.date || NONE,
|
||||
r.biopsy ? name(r.biopsy.histology ?? '') || 'Sin resultado' : NONE,
|
||||
r.biopsy?.date ?? NONE,
|
||||
name(r.status),
|
||||
priority(r.priority) || NONE,
|
||||
]),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user