Fixed error adding new visits
Added code to make sure lookup lists get updated
Fixes to make sure appointments get attached to patient
Added logic to delete purchase to adjust locations