more error checking in the hl7 processing