I'm working with the Google Healthcare API and there's a step in the walk through that uses netcat to send an HL7 message to the MLLP adapter.
(I used nmap to download ncat for Windows)
I have the adapter running locally but the command they provide is written for Mac/Nix users and I'm on Windows.
echo -n -e "\x0b$(cat hl7.txt)\x1c\x0d" | nc -q1 localhost 2575 | less
So I tried rewriting this for windows powershell:
$hl7 = type hl7.txt
Write-Output "-n -e \x0b" $hl7 "\x1c\x0d" | ncat -q1 localhost 2575 | less
When I try this, I get an error that "less" is invalid and also -q1 is also an invalid command.
If I remove -q1
and | less
the command executes with no output or error message.
I'm wondering if I'm using ncat incorrectly here or the write-output incorrectly?
What is the -q1 parameter?
It doesn't seem to be a valid ncat parameter from what I've researched.
I've been following this walkthrough: https://cloud.google.com/healthcare/docs/how-tos/mllp-adapter#connection_refused_error_when_running_locally
We're really converting the echo command, not the ncat command. The syntax for ascii codes is different in powershell.
in ascii: 0b vertical tab, 1c file seperator, 0d carriage return http://www.asciitable.com
Or this. `v is 0b and `r is 0d
If you want it this way, it's the same thing. All three ways end up being the same.