- Epicas documentadas - Reporte de ejecucion Sprint 6 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
251 lines
6.4 KiB
Markdown
251 lines
6.4 KiB
Markdown
# DENTAL-005: Radiografias Dentales
|
|
|
|
## Metadata
|
|
- **Codigo:** DENTAL-005
|
|
- **Modulo:** Radiografias
|
|
- **Prioridad:** P2
|
|
- **Estado:** DDL Completado
|
|
- **Fase:** 4 - Optimizacion
|
|
|
|
## Descripcion
|
|
|
|
Sistema de gestion de radiografias dentales: registro de diferentes tipos de Rx, asociacion a piezas y consultas, almacenamiento de imagenes, e interpretacion diagnostica.
|
|
|
|
## Objetivos
|
|
|
|
1. Registro de radiografias por tipo
|
|
2. Asociacion a pieza dental
|
|
3. Almacenamiento de imagenes
|
|
4. Interpretacion diagnostica
|
|
5. Historial por paciente
|
|
|
|
## Alcance
|
|
|
|
### Incluido
|
|
- Tipos: periapical, panoramica, cefalometrica, oclusal, bitewing
|
|
- Asociacion a pieza especifica (periapicales)
|
|
- Vinculo a consulta donde se tomo
|
|
- URL a imagen almacenada
|
|
- Campo de interpretacion (texto)
|
|
- Historial cronologico
|
|
|
|
### Excluido
|
|
- Captura directa desde sensor RVG
|
|
- Analisis automatico con IA
|
|
- Visor DICOM integrado
|
|
- Cefalometria digital
|
|
|
|
## Tipos de Radiografias
|
|
|
|
| Tipo | Descripcion | Uso Comun |
|
|
|------|-------------|-----------|
|
|
| periapical | Rx de 1-2 piezas | Diagnostico de caries, endodoncia |
|
|
| bitewing | Interproximal | Caries interproximales |
|
|
| oclusal | Vista oclusal | Piso de boca, paladar |
|
|
| panoramica | Ortopantomografia | Vision general, ortodoncia |
|
|
| cefalometrica | Lateral de craneo | Ortodoncia |
|
|
|
|
## Modelo de Datos
|
|
|
|
### Tabla: dental.radiografias
|
|
|
|
| Campo | Tipo | Descripcion |
|
|
|-------|------|-------------|
|
|
| id | UUID | PK |
|
|
| tenant_id | UUID | FK tenants |
|
|
| patient_id | UUID | FK patients |
|
|
| consultation_id | UUID | FK consultations (opcional) |
|
|
| tipo | VARCHAR(50) | periapical, panoramica, etc. |
|
|
| pieza_id | UUID | FK piezas_dentales (opcional) |
|
|
| fecha | DATE | Fecha de la toma |
|
|
| url_imagen | VARCHAR(255) | URL en storage |
|
|
| interpretacion | TEXT | Hallazgos |
|
|
| created_at | TIMESTAMPTZ | Timestamp creacion |
|
|
|
|
## Endpoints API
|
|
|
|
| Metodo | Endpoint | Descripcion |
|
|
|--------|----------|-------------|
|
|
| GET | /patients/:id/radiografias | Radiografias del paciente |
|
|
| GET | /radiografias/:id | Detalle de radiografia |
|
|
| POST | /radiografias | Registrar radiografia |
|
|
| PUT | /radiografias/:id | Actualizar (interpretacion) |
|
|
| DELETE | /radiografias/:id | Eliminar |
|
|
| POST | /radiografias/:id/upload | Subir imagen |
|
|
| GET | /radiografias/:id/imagen | Obtener URL imagen |
|
|
| GET | /radiografias/pieza/:piezaId | Rx de una pieza |
|
|
|
|
## Interfaz del Servicio
|
|
|
|
```typescript
|
|
interface RadiografiasService {
|
|
getByPatient(patientId: string): Promise<Radiografia[]>;
|
|
getById(id: string): Promise<Radiografia>;
|
|
create(data: CreateRadiografia): Promise<Radiografia>;
|
|
updateInterpretacion(id: string, interpretacion: string): Promise<Radiografia>;
|
|
uploadImage(id: string, file: File): Promise<string>;
|
|
getByPieza(piezaId: string): Promise<Radiografia[]>;
|
|
}
|
|
|
|
interface CreateRadiografia {
|
|
patientId: string;
|
|
consultationId?: string;
|
|
tipo: TipoRadiografia;
|
|
piezaId?: string;
|
|
fecha: Date;
|
|
interpretacion?: string;
|
|
}
|
|
|
|
interface Radiografia {
|
|
id: string;
|
|
patientId: string;
|
|
tipo: TipoRadiografia;
|
|
pieza?: PiezaDental;
|
|
fecha: Date;
|
|
urlImagen?: string;
|
|
interpretacion?: string;
|
|
createdAt: Date;
|
|
}
|
|
```
|
|
|
|
## Flujos
|
|
|
|
### Registrar Radiografia
|
|
|
|
```
|
|
1. Durante consulta, odontologo solicita Rx
|
|
2. Tecnico toma la radiografia
|
|
3. Exporta imagen del sensor/equipo
|
|
4. En sistema, crear registro de radiografia
|
|
5. Subir imagen al storage
|
|
6. Asociar a pieza (si periapical)
|
|
7. Odontologo escribe interpretacion
|
|
8. Guardar registro
|
|
```
|
|
|
|
### Consultar Historial
|
|
|
|
```
|
|
1. Odontologo abre expediente del paciente
|
|
2. Navega a seccion "Radiografias"
|
|
3. Ve listado cronologico
|
|
4. Filtra por tipo o pieza
|
|
5. Click en miniatura abre visor
|
|
6. Puede comparar con Rx anteriores
|
|
```
|
|
|
|
## Interpretacion Estructurada
|
|
|
|
```typescript
|
|
interface InterpretacionRadiografia {
|
|
hallazgos: string[]; // Lista de hallazgos
|
|
diagnostico?: string; // Diagnostico principal
|
|
recomendaciones?: string; // Tratamiento sugerido
|
|
comparativaAnterior?: string; // Cambios vs Rx previa
|
|
}
|
|
|
|
// Ejemplo:
|
|
{
|
|
hallazgos: [
|
|
"Lesion radiolucida apical en pieza 36",
|
|
"Obturacion deficiente en conducto distal",
|
|
"Ensanchamiento del ligamento periodontal"
|
|
],
|
|
diagnostico: "Periodontitis apical cronica",
|
|
recomendaciones: "Retratamiento de conductos + corona"
|
|
}
|
|
```
|
|
|
|
## Almacenamiento de Imagenes
|
|
|
|
```typescript
|
|
// Estructura de paths
|
|
// storage/
|
|
// └── {tenant_id}/
|
|
// └── radiografias/
|
|
// └── {patient_id}/
|
|
// └── {radiografia_id}.jpg
|
|
|
|
// Integracion con modulo Storage
|
|
async uploadImage(radiografiaId: string, file: File): Promise<string> {
|
|
const radiografia = await this.getById(radiografiaId);
|
|
|
|
const path = `radiografias/${radiografia.patientId}/${radiografiaId}`;
|
|
const url = await this.storageService.upload(file, path);
|
|
|
|
await this.update(radiografiaId, { urlImagen: url });
|
|
return url;
|
|
}
|
|
```
|
|
|
|
## Visor de Radiografias
|
|
|
|
```typescript
|
|
interface RadiogViewer {
|
|
// Funcionalidades basicas
|
|
zoom: (factor: number) => void;
|
|
pan: (x: number, y: number) => void;
|
|
rotate: (degrees: number) => void;
|
|
|
|
// Ajustes de imagen
|
|
brightness: (value: number) => void;
|
|
contrast: (value: number) => void;
|
|
invert: () => void;
|
|
|
|
// Herramientas
|
|
ruler: () => void; // Medir distancias
|
|
annotate: () => void; // Agregar notas
|
|
}
|
|
```
|
|
|
|
## Entregables
|
|
|
|
| Entregable | Estado | Archivo |
|
|
|------------|--------|---------|
|
|
| DDL radiografias | Completado | `database/schemas/01-dental-schema-ddl.sql` |
|
|
| radiografias.module.ts | Pendiente | `backend/modules/radiografias/` |
|
|
| radiografias.service.ts | Pendiente | `backend/services/` |
|
|
| RadiografiasGrid.tsx | Pendiente | `frontend/components/` |
|
|
| RadiogViewer.tsx | Pendiente | `frontend/components/` |
|
|
|
|
## Dependencias
|
|
|
|
### Depende de
|
|
- clinica.patients (erp-clinicas)
|
|
- clinica.consultations (erp-clinicas)
|
|
- DENTAL-001 (Odontograma - piezas)
|
|
- Storage service (para imagenes)
|
|
|
|
### Bloquea a
|
|
- Exportacion a PACS
|
|
- Analisis con IA
|
|
|
|
## Criterios de Aceptacion
|
|
|
|
- [ ] Registro de Rx por tipo
|
|
- [ ] Asociacion a pieza funciona
|
|
- [ ] Upload de imagen funciona
|
|
- [ ] Visor basico (zoom, pan)
|
|
- [ ] Interpretacion se guarda
|
|
- [ ] Historial por paciente
|
|
- [ ] Filtros funcionan
|
|
|
|
## Consideraciones
|
|
|
|
### Formatos Soportados
|
|
- JPEG (comprimido)
|
|
- PNG (sin perdida)
|
|
- DICOM (futuro)
|
|
|
|
### Tamano Maximo
|
|
- 10 MB por imagen
|
|
- Resolucion recomendada: 1024x768 min
|
|
|
|
### Retencion
|
|
- Minimo 5 anos (regulatorio)
|
|
- Backup automatico
|
|
|
|
---
|
|
|
|
**Ultima actualizacion:** 2026-01-07
|