As I read this, first David had her brought to the palace, then bedded her, then she cleansed herself per Leviticus 15:18, then she went to her house.
And David sent messengers, and he took her; and he entered to her, and went to bed with her. And she was purified from her uncleanness, and she...