This is PatientDataVoidhandler, it only gets invoked when you call savePatient and not an encounter, when you void a patient, this handler gets invoked and in turn voids encounter by setting the void fields not by calling voidEncounter which would have voided the related obs and orders. See the tests in PatientDataVoidHandlerTest, they are commented out and we need to fix them, but i know they would fail after this change.