Kleinzeit by Russell Hoban.
Kleinzeit is an advertising copywriter; or at least he is for the first couple of pages until he gets sacked for proposing an off-the-wall advertising campaign for Bonzo toothpaste (one that is about as well-received as Reggie Perrin's idea for strawberry lychee ripple ice cream). Thereafter he is afflicted with a series of sudden shooting pains that land him in hospital.
The doctors recommend a series of tests on Kleinzeit's hypotenuse, which are soon extended to his asymptotes and his stretto. Here is our first indication that things are not as they seem, or perhaps just that none of this is meant to be taken too literally or seriously. Soon Kleinzeit is falling in love with a sexy night sister from his ward, making regular escapes to lurk round the London Underground, write cryptic things on yellow paper (a recurring theme), busk with a glockenspiel and then return to hospital to be reunited with the strange characters from the ward. All the time he is conducting an internal dialogue with various portentously-named entities like Hospital, Word, Action and Death, and also reading excerpts from Thucydides' History of the Peloponnesian War and reflecting on the relevance of certain episodes to his own life, while conducting a discreet affair with the ward sister and having occasional relapses which result in his readmittance to hospital. Eventually, having resisted the medical staff's efforts to get him to agree to the surgical removal of various fictional organs, he leaves hospital permanently, seemingly cured, though still having occasional conversations with Death just to remind him of the transience of all things, or something like that.
That makes it all sound very silly, and in a way it is, but in a purposeful way. It's clear very early on that this is a comic fantasy and that we shouldn't expect cause to follow effect or for any of the normal rules to apply. Because that's made so clear early doors, the subsequent authorial intervention and metafictional dicking about is not an unpleasant surprise. In that sense it's very much like Invisible Cities, though less episodic and fragmented. I enjoyed it very much, anyway.
Hoban is an interesting character: an expatriate American, he's lived in London since the late 1960s. He started off writing (and illustrating) children's books, but later moved on to writing adult fiction, something surprisingly few authors have done successfully - Penelope Lively is the other obvious example that springs to mind. Hoban also seems to inspire extraordinary devotion and loyalty among his fans, to a frankly slightly scary degree.