Help!

Alexandria
My rainbow baby, Maverick, was born 3 weeks early by medical induction due to I had polyhydramnios (excessive amniotic fluid). He was born with a heart murmur & fluid on both kidneys, bad jaundice, and not gaining weight(Has more tests at 6mths to determine what will happen next with his kidneys & heart). Ever since he was 2 weeks old he has been sick also has been in & out of hospital. He has been on a nebulizer for bronchitis which nearly cleared up everything. Here is where i need advice! The last week he has had diarrhea that i thought was finally getting better until yesterday. He woke up fine but around 10am started screaming in pain for over 1 hour straight! Gave him gas drops..no success. Gave tylenol and it helped a bit. He passed out from exhaustion and finally took a pedialyte bottle around 12pm after not having a single bottle since 6-7am. Last night he started screaming again and what i thought was him passing gas was actually diarrhea. Very very green and completely watery no solids in it at all. His doctor says as long as he drinks pedialyte dont worry but my son does not cry not even when he was very ill in the hospital. Doctors couldnt believe he was even sick due to he was such a happy & smiley baby. My question is how long would you only give your baby pedialyte until you take him in? Any other advice is welcome as I have never had this issue with my two older boys. TIA :)