Temporal similarity measures for querying clinical workflows