Anomaly detection emerges as a crucial challenge in cybersecurity, particularly within the healthcare sector where the integration of open data is expanding rapidly. The recent surge in Internet of Things (IoT) device usage in healthcare has transformed patient care and monitoring. However, this growth also introduces significant security risks to patient data and the integrity of medical networks. Traditional intrusion detection systems are, in most cases, ineffective in IoT environments, which display dynamism and distribution characteristic. In response, this paper proposes a novel intrusion detection system using an innovative Federated Learning approach with the FedAvg Transformer model, aimed at healthcare IoT devices and networks. This system leverages the collective intelligence of edge devices while ensuring data privacy, thereby bolstering the security of health- care infrastructures. The design, implementation, and efficacy of this system in mitigating a broad spectrum of security threats are also detailed.