Pantalla: Alerta de Emergencia
Identificador: SCR-ALT-005
Modulo: MTS-ALT-001 - Alertas y Notificaciones
Version: 1.0.0
Fecha: 2025-12-05
Autor: MobileUxUiDrone (Eight of Eight)
Estado: Especificado
| Atributo |
Valor |
| Nombre |
Alerta de Emergencia |
| Proposito |
Pantalla de panico que permite enviar alertas a contactos de emergencia |
| Tipo |
Full Screen (modal critico) |
| Acceso |
Boton de panico, Shake gesture, Widget, Alerta critica |
| Prioridad |
Critica |
2. Wireframe ASCII
2.1. Estado: Countdown de Confirmacion
+------------------------------------------+
| |
| |
| |
| +------------------+ |
| | | |
| | !! | | <- Warning icon 96dp
| | | |
| +------------------+ |
| |
| ALERTA DE EMERGENCIA | <- Title 28sp
| |
| Se enviara alerta a tus contactos | <- Subtitle
| de emergencia en: |
| |
| +------------------+ |
| | | |
| | 5 | | <- Countdown 72sp
| | | |
| +------------------+ |
| |
| Contactos a notificar: |
| - Maria Garcia (Hija) |
| - Dr. Rodriguez |
| |
| |
| +------------------------------------+ |
| | | |
| | CANCELAR | | <- Cancel button 64dp
| | | |
| +------------------------------------+ |
| |
| Tap el boton para cancelar la alerta | <- Helper text
| |
+------------------------------------------+
2.2. Estado: Enviando Alerta
+------------------------------------------+
| |
| |
| |
| +------------------+ |
| | | |
| | [Spinner] | | <- Loading 64dp
| | | |
| +------------------+ |
| |
| ENVIANDO ALERTAS |
| |
| Notificando a tus contactos... |
| |
| +--------------------------------+ |
| | [v] Maria Garcia - Enviado | | <- Progress list
| +--------------------------------+ |
| | [~] Dr. Rodriguez - Enviando | |
| +--------------------------------+ |
| |
| |
| |
| |
| |
| |
| |
+------------------------------------------+
2.3. Estado: Alerta Enviada
+------------------------------------------+
| |
| |
| |
| +------------------+ |
| | | |
| | [v] | | <- Success icon 96dp
| | | |
| +------------------+ |
| |
| ALERTA ENVIADA |
| |
| Tus contactos han sido notificados |
| |
| +--------------------------------+ |
| | [v] Maria Garcia | |
| | SMS enviado | |
| +--------------------------------+ |
| | [v] Dr. Rodriguez | |
| | Push enviado | |
| +--------------------------------+ |
| |
| +------------------------------------+ |
| | Llamar al 911 | | <- Emergency call
| +------------------------------------+ |
| |
| +------------------------------------+ |
| | Cerrar | |
| +------------------------------------+ |
| |
+------------------------------------------+
2.4. Estado: Error Parcial
+------------------------------------------+
| |
| +------------------+ |
| | [!] | | <- Warning icon
| +------------------+ |
| |
| ALGUNAS ALERTAS FALLARON |
| |
| +--------------------------------+ |
| | [v] Maria Garcia - OK | |
| +--------------------------------+ |
| | [X] Dr. Rodriguez - Error | |
| | Numero invalido | |
| +--------------------------------+ |
| |
| +------------------------------------+ |
| | Reintentar fallidos | |
| +------------------------------------+ |
| |
| +------------------------------------+ |
| | Llamar al 911 | |
| +------------------------------------+ |
| |
| +------------------------------------+ |
| | Cerrar | |
| +------------------------------------+ |
| |
+------------------------------------------+
2.5. Estado: Tier Free (SMS Nativo)
+------------------------------------------+
| |
| +------------------+ |
| | !! | |
| +------------------+ |
| |
| ALERTA DE EMERGENCIA |
| |
| Como usuario Free, se abrira la |
| app de SMS de tu telefono. |
| |
| El mensaje esta pre-llenado para: |
| - Maria Garcia |
| |
| Nota: El costo del SMS es segun |
| tu plan telefonico. |
| |
| +------------------------------------+ |
| | | |
| | ABRIR MENSAJES | | <- Opens SMS app
| | | |
| +------------------------------------+ |
| |
| +------------------------------------+ |
| | Cancelar | |
| +------------------------------------+ |
| |
+------------------------------------------+
3. Componentes UI
3.1. Emergency Icon
| Propiedad |
Valor |
| Componente |
CMP-ICN-001 (Icon) |
| Variante |
emergency |
| Size |
96x96dp |
| Color |
error.main (rojo #D32F2F) |
| Animacion |
Pulse suave |
3.2. Countdown Display
| Propiedad |
Valor |
| Componente |
CMP-TYP-004 (Display Text) |
| Size |
72sp |
| Font |
Bold, monospace |
| Color |
error.main |
| Animacion |
Scale down cada segundo |
| Propiedad |
Valor |
| Componente |
CMP-BTN-001 (Primary Button) |
| Variante |
destructive |
| Size |
Full width, 64dp height |
| Color |
neutral.900 sobre blanco |
| Touch target |
Enorme para facil acceso |
| Propiedad |
Valor |
| Componente |
CMP-LST-003 (Status List) |
| Item height |
56dp |
| Status icons |
Checkmark (verde), Spinner, X (rojo) |
| Propiedad |
Valor |
| Componente |
CMP-BTN-001 (Primary Button) |
| Variante |
emergency |
| Color |
error.main |
| Icono |
Phone |
| Label |
"Llamar al 911" |
4. Comportamientos
4.1. Activacion del Boton de Panico
| Metodo |
Comportamiento |
| Shake x3 |
Requiere app en foreground/recent background |
| Widget |
Un tap abre countdown |
| Menu app |
Configuracion > Emergencia > Activar |
| Alerta critica |
Boton "Necesito ayuda" |
4.2. Flujo de Countdown
flowchart TD
A[Activar emergencia] --> B[Mostrar countdown 5s]
B --> C{Usuario cancela?}
C -->|Si| D[Registrar cancelacion]
D --> E[Cerrar pantalla]
C -->|No, timeout| F{Tier del usuario?}
F -->|Free| G[Abrir app SMS nativa]
F -->|Pro/Perfect| H[Enviar via servidor]
G --> I[Usuario envia manualmente]
H --> J[Mostrar progreso]
J --> K{Todas enviadas?}
K -->|Si| L[Mostrar exito]
K -->|Parcial| M[Mostrar errores + retry]
K -->|Todas fallaron| N[Mostrar alternativas]
L --> O[Ofrecer llamar 911]
M --> O
N --> O
4.3. Mensaje de Emergencia
Template (personalizable):
ALERTA DE MEDTIME
[Nombre del paciente] necesita asistencia.
Ultima actividad: [fecha/hora]
Ubicacion aproximada: [ciudad] (si habilitado)
Por favor contactar urgente.
---
Este mensaje fue enviado desde MedTime.
4.4. Canales por Tier
| Tier |
Canales disponibles |
| Free |
SMS nativo (usuario paga) |
| Pro |
Push, SMS (3/mes), Email |
| Perfect |
Push, SMS (10/mes), Email, Llamada automatica |
5. Estados y Transiciones
5.1. Diagrama de Estados
stateDiagram-v2
[*] --> Countdown: Activar emergencia
Countdown --> Cancelled: Usuario cancela
Countdown --> Sending: Timeout 5s
Sending --> Success: Todos OK
Sending --> PartialError: Algunos fallaron
Sending --> TotalError: Todos fallaron
Cancelled --> [*]
Success --> Closed: Cerrar
PartialError --> Sending: Reintentar
PartialError --> Closed: Cerrar
TotalError --> Closed: Cerrar
Closed --> [*]
6. Datos Requeridos
interface EmergencyAlertData {
trigger_source: 'SHAKE' | 'WIDGET' | 'MENU' | 'CRITICAL_ALERT';
patient_id: string;
patient_name: string;
last_activity: Date;
location?: { city: string; country: string }; // Si habilitado
emergency_contacts: EmergencyContact[];
user_tier: 'FREE' | 'PRO' | 'PERFECT';
custom_message?: string;
}
interface EmergencyContact {
id: string;
name: string;
relationship: string;
phone: string;
email?: string;
priority: number;
channels: ('SMS' | 'PUSH' | 'EMAIL' | 'CALL')[];
}
6.2. Output Events
| Evento |
Payload |
Destino |
| onCancel |
trigger_source, seconds_remaining |
Log |
| onSend |
contacts[], channels[] |
API / SMS app |
| onRetry |
failed_contact_ids[] |
API |
| onCall911 |
- |
Phone dialer |
| onClose |
was_successful |
Navigation |
7. Accesibilidad
7.1. Consideraciones Especiales
Esta pantalla es critica para la vida y debe ser extremadamente accesible:
| Requisito |
Implementacion |
| Alto contraste |
Fondo blanco, texto negro, iconos rojos |
| Texto grande |
Minimo 20sp para todo el texto |
| Touch target enorme |
Boton cancelar minimo 64dp altura |
| VoiceOver/TalkBack |
Anuncios automaticos del countdown |
| Sin gestos complejos |
Todo accesible con un tap |
| Feedback multimodal |
Visual + Auditivo + Haptico |
7.2. Labels y Hints
| Elemento |
accessibilityLabel |
accessibilityHint |
| Pantalla |
"Alerta de emergencia. Enviando en {N} segundos" |
- |
| Countdown |
"{N} segundos restantes" |
- |
| Cancel button |
"Cancelar alerta de emergencia" |
"Toca para detener el envio" |
| Contact item |
"{nombre}, {estado}" |
- |
| Call 911 |
"Llamar a emergencias" |
"Abre el marcador con 911" |
7.3. Screen Reader Announcements
| Evento |
Anuncio |
| Pantalla abierta |
"Alerta de emergencia activada. Se enviara en 5 segundos. Toca cancelar para detener." |
| Cada segundo |
"{N}" |
| Enviando |
"Enviando alertas a {N} contactos" |
| Exito |
"Alertas enviadas correctamente a todos los contactos" |
| Error |
"Error enviando a {nombre}. {razon}" |
| Cancelado |
"Alerta cancelada" |
7.4. Contraste y Tamanos (AAA)
| Elemento |
Min Size |
Contraste |
| Icon |
96x96dp |
- |
| Title |
28sp |
7:1 (AAA) |
| Countdown |
72sp |
7:1 (AAA) |
| Body text |
18sp |
7:1 (AAA) |
| Buttons |
64dp height |
7:1 (AAA) |
| Touch target |
64x64dp |
- |
8. Seguridad y Prevencion de Falsas Alarmas
8.1. Medidas de Seguridad
| Medida |
Descripcion |
| Countdown 5s |
Tiempo para cancelar accidentales |
| Confirmacion opcional |
Configurable en settings |
| Registro de activaciones |
Todas las activaciones se logean |
| Cooldown 5 min |
No se puede activar de nuevo inmediatamente |
| Limite diario |
Maximo 3 activaciones por dia (configurable) |
8.2. Registro de Emergencia
Cada activacion registra:
- Timestamp
- Trigger source
- Fue cancelada o completada
- Contactos notificados
- Canales usados
- Errores ocurridos
9.1. Android
- Mantener pantalla encendida (
FLAG_KEEP_SCREEN_ON)
- Wakelock durante envio
- Foreground service para garantizar entrega
- Intent para app SMS con mensaje pre-llenado
9.2. iOS
- Modo "Do Not Disturb" bypass (si es posible)
- Background execution para envio
MFMessageComposeViewController para SMS (Free)
- Critical alerts (si tiene entitlement)
10. Metricas
10.1. Analytics Events
| Evento |
Parametros |
| emergency_activated |
trigger_source |
| emergency_cancelled |
seconds_remaining |
| emergency_sent |
contact_count, success_count |
| emergency_error |
contact_id, error_type |
| emergency_911_call |
- |
11. Referencias
Documento generado por MobileUxUiDrone (Eight of Eight)
"En emergencias, cada segundo cuenta. Esta pantalla debe ser perfecta."