Export first — that archive is yours forever. After cancellation your account moves to read-only, and files are removed after a grace period.
Export before you cancel. The ZIP and CSV you download are yours permanently, independent of any account here — that's the archive the IRS would care about.
After cancellation:
We'll email before anything is deleted. But the durable answer is the export: your medical records should not depend on any single company continuing to exist, including this one.
If you want everything gone immediately instead, see account deletion.