Within the framework of the NIMMS (Next Ion Medical Machine Study) initiative at CERN, a comprehensive study is being performed for the Helium Light Ion Compact Synchrotron (HeLICS), a compact accelerator for hadron therapy. A key component of this facility is the radiofrequency (RF) cavity. Its proposed design is based on the wideband technology successfully implemented in the CERN PS Booster. It comprises four cells filled with Finemet material that enable the acceleration of protons and 4He2+ over a broad energy range. The cavity, designed to deliver a peak voltage of up to 2 kV within a frequency range from 0.88 to 10 MHz, features a compact design to meet the stringent requirements of the medical accelerator. It operates in double-harmonic mode, to effectively reduce longitudinal line density of the beam bunch and mitigate space-charge effects at low energy. The combination of compactness and operational flexibility positions this RF cavity as an optimal solution for compact synchrotrons, enabling more efficient, precise, and accessible hadron therapy for cancer treatment.