As Steward Health Care struggled to provide services and pay vendors in many of its three dozen or so hospitals in Massachusetts and across the country, its executives spent millions on intelligence firms, according to corporate records, videos, and other files obtained by the global journalism outlet the Organized Crime and Corruption Reporting Project and shared with the Boston Globe Spotlight Team.

In all, senior Steward executives authorized and spent over $7 million from 2018 to 2023 on firms that provide research, intelligence-gathering, and surveillance services, according to emails, encrypted messages, and financial records reviewed by the Spotlight Team.

In the US, Steward is currently mired in bankruptcy, the fate of its network hazy, while its Massachusetts properties head for the auction block. In recent years, crippling staff shortages at Steward hospitals have put patients at risk, records show. Dozens of lawsuits from unpaid vendors — from elevator companies to orthopedic suppliers — have piled up in court.

Records show that Steward executives prioritized intelligence-gathering over most everything else. Monthly bills ran as high as $440,000. They were to be paid on time and in full.

While much of this investigative intelligence work was taking place across the globe, Steward’s hospitals in the United States were struggling under the weight of the coronavirus. From 2020 to 2021, Steward hired hundreds of temporary staff to meet the need. But by March 2021, Steward was disputing 3,400 invoices and withholding over $42 million from one staffing agency, who eventually pulled their staff from Steward hospitals, court documents show.

On one night in fall 2021, there were 101 patients in the emergency department with only six nurses to care for them, creating a 14-hour wait for some patients in the waiting room, the memo noted. On another, seven full ambulances idled outside the hospital as 11 nurses juggled 71 patients in the emergency room.

A day after Thanksgiving, 11 nurses were assigned to 95 patients and a patient with acute renal failure was left unattended.

That patient was later found dead in the hallway.