MLLP_SEND(1)

πŸ’– MLLP_SEND(1) πŸ’–

okay bestie, sit down, because this is the manual page for mllp_send β€” she lives in the python-hl7 family and she is, lowkey, the most useful little network client you'll ever meet. πŸ¦‹

🌸 NAME 🌸

mllp_send β€” MLLP network client

python-hl7 ships with a simple network client, mllp_send, and what she does is read HL7 messages from a file or from sys.stdin and post them straight to an MLLP server. She's literally just a command-line wrapper around hl7.client.MLLPClient. ✨

So when are you pulling her out of the group chat? Two iconic scenarios: testing HL7 interfaces, or resending messages that got logged. Both. Always. πŸ‘‘

$ mllp_send --file sample.hl7 --port 6661 mirth.example.com
MSH|^~\&|LIS|Example|Hospital|Mirth|20111207105244||ACK^A01|A234244|P|2.3.1|
MSA|AA|234242|Message Received Successfully|

look at her go. πŸ’…


✨ USAGE ✨

Usage: mllp_send [options] <server>

and here are the options, no skips, no skimming, we read all of them:

  • -h, --help β€” show this help message and exit
  • -p PORT, --port=PORT β€” port to connect to
  • -f FILE, --file=FILE β€” read from FILE instead of stdin
  • -q, --quiet β€” do not print status messages to stdout
  • --loose β€” allow file to be a HL7-like object (\r\n instead of \r). Can ONLY send 1 message. Requires --file option (no stdin)

πŸŽ€ INPUT FORMAT πŸŽ€

By default, mllp_send expects the FILE or stdin input to be a properly formatted HL7 message β€” carriage returns separating segments β€” wrapped up all cozy in a MLLP stream:

<SB>message1<EB><CR><SB>message2<EB><CR>...

that's the vibe she's expecting. πŸ’–

but here's the thing, and it's so common it's basically a canon event: especially if somebody manually edited the file in certain text editors, those ASCII control characters get lost 😭 and the carriage returns get swapped out for the platform's default line endings. tragic.

and for exactly that situation, mllp_send gives you the --loose option, which attempts to take something that "looks like HL7" and convert it into a proper HL7 message. slay. BUT β€” and this is the important part β€” currently the --loose option can only handle 1 HL7 message per file (it causes mllp_send to assume the whole file is one HL7 message). so don't come for her with a multi-message file under --loose, she said one and she meant one. πŸ™ˆ


🌈 ADDITIONAL RESOURCES 🌈


πŸ’œ AUTHOR πŸ’œ

John Paulett


2011, John Paulett


okay that's the whole page, you ate that. πŸ’… no cap, go send some messages.

python-hl7, version 0.2.2, dated December 17, 2011 β€” that's the tea, bestie. bye bestie, ily, go be the main character of your HL7 interface. β­πŸ’–