It looks like you have added this just fine, but it is missing a crucial part that I forgot to show in my example. The problem is that the date formatting function formats a time stamp value, it will not directly re-format a date value. So you will need to add in one more part to make the current date a timestamp like this:
echo "WAJA[".$n."][".$m."] = "."'".WA_DD_Replace(date('dS F Y', strtotime($row_child["surgery_date"])))."'".";\n";
Sorry about that, it slipped my mind that you were working with a formated date value already. Here is a link to the php page for the strtotime function, this along with the date and mktime are very powerful tools for editing dates and times.