MEDITECH DR Top N Analysis Factory (BETA) 

 enter list of search criteria
 
 enter search keyword to be replaced in script
 
 enter sql script, then click build script
 

 copy list of sql statements (CTRL + A, CTRL + C)