|
Download documentation/integrations/M7_integration.md from Modulo-6/api: direct link, hf CLI and curl.
- Browser
- Download file 2.91 kB
-
https://huggingface.co/spaces/Modulo-6/api/resolve/103258c8c38fd4100cd7bdb3de92a75e82b20ddc/documentation/integrations/M7_integration.md
- Command line
-
hf download hf://spaces/Modulo-6/api@103258c8c38fd4100cd7bdb3de92a75e82b20ddc/documentation/integrations/M7_integration.md
-
curl -L -o M7_integration.md https://huggingface.co/spaces/Modulo-6/api/resolve/103258c8c38fd4100cd7bdb3de92a75e82b20ddc/documentation/integrations/M7_integration.md
2.91 kB
| 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. | |