I am not sure about the format of the HL7 files but this will get the most latest HL7 file into env variable MyFile and then print the lines in the file that have "name" in them.
@set MyFile=
@for /F %%I in ('dir /od /b *.hl7') do set MyFile=%%I
@if defined MyFile find "name" %MyFile%
If HL7 has many different formats you may be better off writing a program that uses an HL7 library to parse your file.
I hope this helps you get started.