@peopl-health/nexus 5.76.10 → 5.76.11

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.
@@ -14,6 +14,9 @@ const NEGATION = /\b(sin|niega|no|ninguna?)\b/;
14
14
 
15
15
  const isDay = (value) => typeof value === 'string' && ISO_DAY.test(value) && !Number.isNaN(Date.parse(`${value}T00:00:00Z`));
16
16
  const dmy = (iso) => `${iso.slice(8, 10)}/${iso.slice(5, 7)}/${iso.slice(0, 4)}`;
17
+ // a weekday with the date: the model miscounts the day of the week from a bare date ("el viernes" for a Saturday)
18
+ const WEEKDAYS = ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'];
19
+ const weekdayDmy = (iso) => `${WEEKDAYS[new Date(`${iso}T00:00:00Z`).getUTCDay()]} ${dmy(iso)}`;
17
20
  const addDays = (iso, days) => new Date(Date.parse(`${iso}T00:00:00Z`) + days * 86400000).toISOString().slice(0, 10);
18
21
  const fold = (value) => foldAccents(String(value || '')).toLowerCase().trim();
19
22
  const text = (value) => (typeof value === 'string' ? value.trim() : '');
@@ -132,13 +135,13 @@ function chemoLines(context, today) {
132
135
  }
133
136
  if (context.proximaSesion && context.proximaSesion.fecha >= today) {
134
137
  lines.push(context.proximaSesion.tipo === 'agendada'
135
- ? `Próxima sesión de quimioterapia: ${dmy(context.proximaSesion.fecha)}${CLOCK.test(context.proximaSesion.hora) ? ` a las ${context.proximaSesion.hora}` : ''} (${['agendada', confirmation(context.proximaSesion)].filter(Boolean).join('; ')})`
136
- : `Próxima sesión de quimioterapia: ${dmy(context.proximaSesion.fecha)} (estimada; no la confirmes como cita)`);
138
+ ? `Próxima sesión de quimioterapia: ${weekdayDmy(context.proximaSesion.fecha)}${CLOCK.test(context.proximaSesion.hora) ? ` a las ${context.proximaSesion.hora}` : ''} (${['agendada', confirmation(context.proximaSesion)].filter(Boolean).join('; ')})`
139
+ : `Próxima sesión de quimioterapia: ${weekdayDmy(context.proximaSesion.fecha)} (estimada; no la confirmes como cita)`);
137
140
  }
138
141
  const support = context.proximaVisitaSoporte;
139
142
  if (support && support.fecha >= today) {
140
143
  const care = texts(support.detalle);
141
- lines.push(`Próxima visita a la unidad sin quimioterapia: ${dmy(support.fecha)} (${[care.join(', '), confirmation(support)].filter(Boolean).join('; ')})`);
144
+ lines.push(`Próxima visita a la unidad sin quimioterapia: ${weekdayDmy(support.fecha)} (${[care.join(', '), confirmation(support)].filter(Boolean).join('; ')})`);
142
145
  }
143
146
  if (context.noAplicadas.length) lines.push(`Sesiones no aplicadas en los últimos 90 días: ${context.noAplicadas.map(dmy).join(', ')}`);
144
147
  if (text(context.reaccionInfusion?.texto)) lines.push(`Reacción durante la infusión registrada: ${text(context.reaccionInfusion.texto)} (${dmy(context.reaccionInfusion.fecha)})`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "5.76.10",
3
+ "version": "5.76.11",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",