File size: 706 Bytes
5f12c93
74ec534
5f12c93
 
74ec534
5f12c93
 
 
 
 
 
e6a43c8
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""
M10 Core — validación de pacientes.
"""
from app.config import settings
from app.integrations._base import _get


def validate_patient(paciente_id: int) -> dict | None:
    """Verifica existencia del paciente en M10. Retorna datos básicos o None."""
    if settings.mock_external_services:
        return {"id": paciente_id, "nombre": "Paciente", "apellido": "Mock"}
    # Los pacientes son usuarios del Core (consigna M10 §10: "Maestro de
    # Usuarios ... médicos, enfermeros, administrativos, bioquímicos y
    # pacientes"). Path real del spec (verificado contra M10_openapi.yaml):
    # GET /users/{id}, sin prefijo /api/v1.
    return _get(f"{settings.m10_core_url}/users/{paciente_id}")