Spaces:
Runtime error
Download documentation/integrations/M7_integration.md from MateFerreyra/Modulo-6: direct link, hf CLI and curl.
- Browser
- Download file 2.91 kB
-
https://huggingface.co/spaces/MateFerreyra/Modulo-6/resolve/main/documentation/integrations/M7_integration.md
- Command line
-
hf download hf://spaces/MateFerreyra/Modulo-6/documentation/integrations/M7_integration.md
-
curl -L -o M7_integration.md https://huggingface.co/spaces/MateFerreyra/Modulo-6/resolve/main/documentation/integrations/M7_integration.md
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:
https://modulo7-backend.onrender.com
Swagger:
https://modulo7-backend.onrender.com/swagger-ui/index.html
OpenAPI:
https://modulo7-backend.onrender.com/v3/api-docs
Para endpoints REST, la base es:
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:
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:
POST https://api.healthcare.cantero.ar/events/log
Authorization: Bearer <token>
Content-Type: application/json
Body de ejemplo:
{
"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:
{
"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:
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:
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.