Download app/integrations/monitoreo.py from Modulo-6/api: direct link, hf CLI and curl.
- Browser
- Download file 953 Bytes
-
https://huggingface.co/spaces/Modulo-6/api/resolve/31c8dd67e47a516206b4122c4da00a634486a247/app/integrations/monitoreo.py
- Command line
-
hf download hf://spaces/Modulo-6/api@31c8dd67e47a516206b4122c4da00a634486a247/app/integrations/monitoreo.py
-
curl -L -o monitoreo.py https://huggingface.co/spaces/Modulo-6/api/resolve/31c8dd67e47a516206b4122c4da00a634486a247/app/integrations/monitoreo.py
953 Bytes
| """ | |
| M9 Monitoreo — altas y bajas de pacientes en monitoreo. | |
| """ | |
| from datetime import datetime, timezone | |
| from app.config import settings | |
| from app.integrations._base import _post | |
| def notify_alta(paciente_id: int) -> bool: | |
| if settings.mock_external_services: | |
| return True | |
| payload = { | |
| "evento": "ALTA_MONITOREO", | |
| "paciente_id": paciente_id, | |
| "timestamp": datetime.now(timezone.utc).isoformat(), | |
| } | |
| return _post( | |
| f"{settings.m9_monitoreo_url}/api/v1/webhooks/internacion/alta-monitoreo", payload | |
| ) is not None | |
| def notify_baja(paciente_id: int) -> bool: | |
| if settings.mock_external_services: | |
| return True | |
| payload = { | |
| "evento": "BAJA_MONITOREO", | |
| "paciente_id": paciente_id, | |
| "timestamp": datetime.now(timezone.utc).isoformat(), | |
| } | |
| return _post( | |
| f"{settings.m9_monitoreo_url}/api/v1/webhooks/internacion/baja-monitoreo", payload | |
| ) is not None | |