If we are thinking about the play as a whole, Dr. Rank is an interesting character who supports the idea presented through the Helmer family that there is always retribution for past deeds. Notice how in Act 2, when he confesses his love for Nora but also his illness of which he is dying, he says:
In every single family, in one way or another, the same merciless law of retribution is at work.
This is of course true for Dr. Rank - he has been impacted tremendously by his father's legacy of corruption and deviance, even to the point of inheriting his syphilis, and is now slowly and painfully dying. But also this is true for the Helmer family, because Nora's borrowing money secretly without her husband knowing and her forgery are threatening the very foundations of her marriage.
The death of Dr. Rank therefore suggests that there is no escape from the consequences of such actions - there must be a price to pay somewhere along the line. Nora cannot go through life thinking that her problems will magically disappear without those consequences. It is therefore highly symbolic that the letter from Dr. Rank telling Nora he is near death arrives at the same time as Krogstad's letter.