It is narrated from Sayyidah Umm Salamah (may Allah be pleased with her) that in the time of the Messenger of Allah (peace and blessings be upon him) there was a woman who suffered from continuous bleeding, so Umm Salamah (may Allah be pleased with her) asked the Messenger of Allah (peace and blessings be upon him) for a ruling on her behalf. He (peace and blessings be upon him) said: "Let her consider the number of nights and days on which she used to menstruate each month before this illness befell her, and let her leave the prayer for that many days of the month. Then when those days have passed, let her take a ritual bath (ghusl), then bind herself with a cloth, then pray."
Hadith Referenceالمعجم الكبير للطبراني / مسند النساء / 19887