Just be there for them, that's all you can do. You cannot change things and nothing is certain in this life.
I was in a similar situation, admitted to hospital by ambulance, for a D&C, (I had only had my pregnancy confirmed the day before) but there was no bed for me. The only available bed available was in the local maternity hospital, where I had a scan. I was lying in bed distraught when a nurse held my hand and told me not to give up hope.
She was right, my DD is now 39 years old. I did spend the rest of the pregnancy in hospital.
What is meant to be will be.