GC algorithm integrated with  patients controller

Algorithm works with  inserted visit in database.