File size: 2,913 Bytes
8defa71 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | Buenas, ya dejamos desplegado el Módulo 7 y lista la integración para recibir el evento de Módulo 6 vía Core/RabbitMQ.
Datos generales de M7:
URL base pública:
```txt
https://modulo7-backend.onrender.com
```
Swagger:
```txt
https://modulo7-backend.onrender.com/swagger-ui/index.html
```
OpenAPI:
```txt
https://modulo7-backend.onrender.com/v3/api-docs
```
Para endpoints REST, la base es:
```txt
https://modulo7-backend.onrender.com/api
```
Para la integración M6 → M7, la forma principal va por eventos usando Core/Módulo 10.
Datos del evento creado en Core:
```txt
event_name: facturacion.internacion.cama-lista.requested
event_type_id: 19
queue: facturacion.requests
publisher_module esperado: modulo_6
```
Ustedes tienen que publicar el evento en Core usando:
```http
POST https://api.healthcare.cantero.ar/events/log
Authorization: Bearer <token>
Content-Type: application/json
```
Body de ejemplo:
```json
{
"event_type_id": 19,
"publisher_module": "modulo_6",
"payload": "{\"evento\":\"CIERRE_INTERNACION\",\"idEventoExterno\":\"M6-CIERRE-INT-000123\",\"idInternacionExterna\":\"INT-000123\",\"idEpisodioExterno\":\"700\",\"idPacienteExterno\":\"10500\",\"fechaIngreso\":\"2026-06-20T14:30:00Z\",\"fechaAlta\":\"2026-06-25T10:00:00Z\",\"tipoAlta\":\"ALTA_MEDICA\",\"timestampEvento\":\"2026-06-25T10:05:00Z\"}"
}
```
Importante: el campo `payload` tiene que viajar como string JSON, no como objeto JSON directo.
Payload interno recomendado:
```json
{
"evento": "CIERRE_INTERNACION",
"idEventoExterno": "M6-CIERRE-INT-000123",
"idInternacionExterna": "INT-000123",
"idEpisodioExterno": "700",
"idPacienteExterno": "10500",
"fechaIngreso": "2026-06-20T14:30:00Z",
"fechaAlta": "2026-06-25T10:00:00Z",
"tipoAlta": "ALTA_MEDICA",
"timestampEvento": "2026-06-25T10:05:00Z"
}
```
Campos mínimos que necesitamos para poder continuar el flujo:
```txt
idPacienteExterno
idEpisodioExterno
idInternacionExterna
fechaIngreso
fechaAlta
tipoAlta
timestampEvento
```
Con `idPacienteExterno` e `idEpisodioExterno`, M7 consulta a M1 para obtener cobertura, episodio y actos médicos. Después M7 factura usando su propio ABM de obras sociales, planes, convenios y nomenclador.
No necesitamos que M6 nos mande obra social, plan, convenio, precios, copagos ni montos. Eso lo resuelve M7.
Como fallback/manual testing, también dejamos estos endpoints REST disponibles:
```http
POST https://modulo7-backend.onrender.com/api/v1/webhooks/internacion/cama-lista
POST https://modulo7-backend.onrender.com/api/integracion/internacion/cierre-episodio
```
Pero para la integración final usemos el evento de Core con `event_type_id: 19`.
Detalle importante: si el evento viene sin `timestampEvento` o `timestamp_evento`, M7 lo rechaza porque es obligatorio por contrato.
|