Specimen hierarchy migration: added null check for sql statement. on behalf on Ibrahim
changes for dashboard queries