Updated EmergencaCase and some db functions