Correct Patient ID field in log.  Use null value not string
log failed queries to php log and provide stack trace in browser error message
Added Direct email address for patient and users/facilities.