An inquest has heard how Sophie Ward was discharged from hospital, but her condition worsened before she passed away the following day.