Development of Template Queries and Functions for the MIMIC II Database