Features:
- Report templates with customizable layouts
- Report generator for patient summaries, stats, KPIs
- Clinical statistics service with dashboard data
- Scheduled reports with email delivery
- Export formats: PDF, Excel, CSV
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive laboratory module for managing lab tests, orders, and results:
Entities:
- LabTest: Catalog of available tests with reference ranges and categories
- LabOrder: Lab orders linked to patients and consultations
- LabResult: Results with values, status, and abnormal value detection
Services:
- LabTestService: CRUD operations for test catalog
- LabOrderService: Order lifecycle (create, collect sample, process, complete, cancel)
- LabResultService: Record results, verify, amend with history tracking
Features:
- Multi-tenant support (tenantId in all queries)
- Automatic abnormal/critical value flagging
- Result amendment with audit trail
- Order number auto-generation
- Reference range support by gender and age
REST Endpoints:
- /api/laboratory/tests/* - Test catalog management
- /api/laboratory/orders/* - Order lifecycle management
- /api/laboratory/results/* - Result recording and verification
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Source: erp-core (checksum: 900be2ee48f2faf72ce5253aeab27c88)
Priority: P1 - HIGH (architectural gap resolution)
Context: TASK-2026-01-25-SISTEMA-REUTILIZACION
Before: "Missing"
After: Synced with canonical
Changes:
- BaseService "added" from erp-core
- Checksum: 900be2ee48f2faf72ce5253aeab27c88
- Provides base CRUD operations for all services
Benefits:
- Unified service architecture
- Consistent error handling and validation
- Reduced code duplication in service implementations
- Standard pagination and filtering patterns
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Source: erp-core (checksum: 39a6e229055a21158b63cc4eb4dd232f)
Priority: P0 - CRITICAL divergence resolution
Context: TASK-2026-01-25-SISTEMA-REUTILIZACION
Before: Diverged version with project-specific adaptations
After: Synced with canonical
Changes:
- Complete ai module synchronized from erp-core
- 24 TypeScript files updated
- Unified role-based AI configuration
- Consistent AI behavior across all ERP projects
Note: Project-specific role adaptations (if needed) can be
re-applied as documented extensions after this sync.
Benefits:
- Single source of truth for AI functionality
- Reduced maintenance burden
- Token savings from code reuse
- Consistent behavior baseline
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added PaymentTerminalsModule to module imports
- Added entities to getAllEntities()
- Added paymentTerminals to ModuleOptions
- Registered module in initializeModules()
- Updated health check with paymentTerminals status
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Roles: ADMIN, DOCTOR, RECEPCIONISTA, PACIENTE
- Clinical data restricted to DOCTOR only
- Compliance: NOM-024-SSA3-2012, LFPDPPP
- Medical terminology and privacy restrictions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Propagated modules:
- payment-terminals: MercadoPago + Clip TPV (PCI-DSS compliant)
- ai: Role-based AI access (ADMIN, DOCTOR, RECEPCIONISTA, PACIENTE)
- mcp: 18 ERP tools for AI assistants
Note: Payment data must NOT be stored in clinical records.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>