added more logging and hl7 reading