Download app/integrations/turnos.py from Modulo-6/api: direct link, hf CLI and curl.
- Browser
- Download file 838 Bytes
-
https://huggingface.co/spaces/Modulo-6/api/resolve/31c8dd67e47a516206b4122c4da00a634486a247/app/integrations/turnos.py
- Command line
-
hf download hf://spaces/Modulo-6/api@31c8dd67e47a516206b4122c4da00a634486a247/app/integrations/turnos.py
-
curl -L -o turnos.py https://huggingface.co/spaces/Modulo-6/api/resolve/31c8dd67e47a516206b4122c4da00a634486a247/app/integrations/turnos.py
838 Bytes
| """ | |
| M2 Turnos — notificación de resultado de quirófano. | |
| """ | |
| from datetime import datetime, timezone | |
| from app.config import settings | |
| from app.integrations._base import _post | |
| def notify_resultado_quirofano( | |
| turno_id: str, | |
| reserva_id: int, | |
| cama_id: int, | |
| reserva_urgente_id: int, | |
| motivo: str | None = None, | |
| ) -> bool: | |
| if settings.mock_external_services: | |
| return True | |
| payload = { | |
| "resultado": "CANCELADA", | |
| "reserva_id": reserva_id, | |
| "cama_id": cama_id, | |
| "motivo_cancelacion": "DESPLAZADA_POR_URGENCIA", | |
| "reserva_urgente_id": reserva_urgente_id, | |
| "motivo": motivo, | |
| "timestamp": datetime.now(timezone.utc).isoformat(), | |
| } | |
| return _post( | |
| f"{settings.m2_turnos_url}/api/v1/turnos/{turno_id}/resultado-quirofano", payload | |
| ) is not None | |