48 lines
3.1 KiB
TypeScript
48 lines
3.1 KiB
TypeScript
// How CaMa's FHIR measures map onto what the indicator page reads: the page's id of each measure, the name of a
|
|
// proportion's primary group and the categories a composition publishes beyond its declared ones.
|
|
//
|
|
// The WebApi names a measure `CAMA-BIRADS456-PACIENTE`; the page, its history and its cards use
|
|
// `cama_birads_456_paciente`. A rule can't derive one from the other (`BIRADS456` splits into `birads_456`), so the
|
|
// correspondence is explicit and a measure outside it keeps the generic rule.
|
|
export const CAMA_MEASURE_IDS: Readonly<Record<string, string>> = {
|
|
'CAMA-BIOPSIAS': 'cama_biopsias',
|
|
'CAMA-BIRADS': 'cama_birads',
|
|
'CAMA-BIRADS-CANCER-INVASOR': 'cama_birads_cancer_invasor',
|
|
'CAMA-BIRADS456-MASTOGRAFIA': 'cama_birads_456_mastografia',
|
|
'CAMA-BIRADS456-PACIENTE': 'cama_birads_456_paciente',
|
|
'CAMA-CONFIRMACION-BIRADS45': 'cama_confirmacion_birads45',
|
|
'CAMA-DIAS-RESULTADO-DIAGNOSTICO': 'cama_dias_resultado_diagnostico',
|
|
'CAMA-DIAS-TOMA-DIAGNOSTICO': 'cama_dias_toma_diagnostico',
|
|
'CAMA-EU38A': 'cama_eu38a',
|
|
'CAMA-HISTOPATOLOGIA-BIRADS': 'cama_histopatologia_birads',
|
|
'CAMA-TASA-DETECCION-HISTOPATOLOGICA': 'cama_tasa_deteccion_histopatologica',
|
|
};
|
|
|
|
export const esMedidaCama = (measureId: string | undefined): boolean =>
|
|
measureId !== undefined && Object.hasOwn(CAMA_MEASURE_IDS, measureId);
|
|
|
|
// A proportion's primary group is `principal` in the WebApi; CaMa's page names it `total`.
|
|
export const GRUPO_PRINCIPAL_PAGINA = 'total';
|
|
export const GRUPO_PRINCIPAL_FHIR = 'principal';
|
|
|
|
// A category a report counts that its Measure doesn't declare (a BI-RADS 4 without subcategory arrives as `B4`) is
|
|
// shown after the declared ones under the caption the Core catalog gives it.
|
|
export const ETIQUETA_CATEGORIA_NO_DECLARADA: Readonly<Record<string, string>> = { B4: 'BI-RADS 4 (sin subcategoría)' };
|
|
|
|
// The histopathological result by BI-RADS (`CAMA-HISTOPATOLOGIA-BIRADS`) publishes the cross of two stratifiers, the
|
|
// BI-RADS of the mammogram and the grade of its biopsy, as FHIR codes (`B4A`, `CARCINOMA_IN_SITU`); the view that
|
|
// draws it reads the page's codes. The correspondence is explicit, one table per axis, so a code outside it is an error
|
|
// and never a silent zero. A grade is benign or malignant as the parameter `cama.biopsia_cancer` says; no biopsy and
|
|
// no grade belong to no group.
|
|
export const ESTRATO_BIRADS_PAGINA: Readonly<Record<string, string>> = {
|
|
B4: 'BIRADS_4', B4A: 'BIRADS_4A', B4B: 'BIRADS_4B', B4C: 'BIRADS_4C', B5: 'BIRADS_5', B6: 'BIRADS_6',
|
|
};
|
|
export const CATEGORIA_HISTOPATOLOGIA_PAGINA: Readonly<Record<string, { id: string; grupo: string | null; gravedad: number | null }>> = {
|
|
BENIGNO: { id: 'BENIGNO', grupo: 'NO_MALIGNO', gravedad: 1 },
|
|
CARCINOMA_IN_SITU: { id: 'IN_SITU', grupo: 'MALIGNO', gravedad: 3 },
|
|
CARCINOMA_INVASOR: { id: 'INVASOR', grupo: 'MALIGNO', gravedad: 4 },
|
|
SIN_BIOPSIA: { id: 'SIN_BIOPSIA', grupo: null, gravedad: null },
|
|
SIN_DATO: { id: 'SIN_DATO', grupo: 'SIN_DATO', gravedad: null },
|
|
};
|
|
export const GRUPOS_HISTOPATOLOGIA_PAGINA: Readonly<Record<string, string>> = { NO_MALIGNO: 'No maligno', MALIGNO: 'Maligno', SIN_DATO: 'Sin dato' };
|