I read this novel about 20-25 years ago, and I think it was shortly after its publication.
It is definitely SF if only because medicine is more advanced in the book than it was 20 years ago when it was published (but maybe not more advanced than now, reality has a way of catching up with fiction). It is also a fantasy, there are some elements in the book that are definitely not rational.
The main character is a doctor who does research on near-death-experiences. She works in an almost dysfunctional hospital which is a maze where she has to keep running from place to place (one of the things I remember is that, though it is a page-turner, I had sometimes to put it down to recover my breath - and I am not asthmatic ).
She interviews people who had near-death experiences and many tell about remembering being in a ship. And their tales seem to have some consistency with each other. And at some point she is knifed by a madman. And she ends up on the ship.
Towards the end the reader finds out that
when people are dying and their brain suffer from lack of oxygen, they "dream" of a common fictitious ship which is in some sense the Titanic. Those who are revived remember that as a near-death experience. The others just... drown.