A command-line utility for extracting HL7 messages from ASCOM DAS3 driver log files.
This tool parses ASCOM DAS3 driver log files to identify and extract HL7 messages, saving them to a separate output file for analysis or processing. It specifically looks for lines containing HL7 message headers (MSH|) and related message segments.
- Extracts HL7 messages from ASCOM DAS3 driver log files
- Automatically creates output file with
.hl7extension - Console output shows extracted messages in real-time
- Provides statistics on processed lines and extracted messages
- Handles multiple HL7 messages with proper separation
- .NET Framework or .NET Core runtime
- Windows operating system (designed for ASCOM driver logs)
HL7CollectFromLogs.exe "C:\Path\To\LogFile.log"HL7CollectFromLogs.exe "C:\Test\20230307_NHSWalesLaboratory__43101.log"This will create an output file: C:\Test\20230307_NHSWalesLaboratory__43101.log.hl7
- Log File Path: The full path to the ASCOM DAS3 driver log file to process
The program generates:
- A
.hl7file containing the extracted HL7 messages - Console output showing:
- Each extracted HL7 message as it's processed
- Total number of source file lines read
- Total number of HL7 messages found
The tool processes log files line by line and:
- Identifies lines containing HL7 message headers (
MSH|) - Extracts the HL7 message portion from the log line
- Identifies subsequent HL7 message segments (lines where the pipe character
|appears at position 3) - Separates multiple HL7 messages with blank lines in the output
- Validates that a log file path is provided as a command-line argument
- Checks if the specified file exists before processing
- Provides clear error messages for invalid inputs
The extracted HL7 messages are saved in standard HL7 format:
MSH|^~\&|SYSTEM|SENDER|RECEIVER|DESTINATION|20230307120000||ORU^R01|12345|P|2.4
PID|1||123456789^^^MRN||DOE^JOHN^MIDDLE||19800101|M
OBR|1||LAB123|CBC^Complete Blood Count
MSH|^~\&|SYSTEM|SENDER|RECEIVER|DESTINATION|20230307120100||ORU^R01|12346|P|2.4
PID|1||987654321^^^MRN||SMITH^JANE^||19750615|F
OBR|1||LAB124|CHEM^Basic Metabolic Panel
©2023 ASCOM UMS srl unip. - Gabriele PANCANI
Gabriele PANCANI
ASCOM UMS srl unip.