Permalink
Browse files

Add notes about --loose in the documentation.

  • Loading branch information...
1 parent b2afedd commit 80487fc2eff618f893fb220dc402c989018831f2 @johnpaulett committed Dec 17, 2011
Showing with 37 additions and 18 deletions.
  1. +6 −15 docs/index.rst
  2. +31 −3 docs/mllp_send.rst
View
@@ -125,28 +125,19 @@ wrapper around :py:meth:`hl7.Message.segments` that returns the first matching
>>> h.segment('PID')[3][0]
u'555-44-4444'
-.. _mllp-send:
MLLP network client - ``mllp_send``
-----------------------------------
python-hl7 features a simple network client, ``mllp_send``, which reads HL7
messages from a file or ``sys.stdin`` and posts them to an MLLP server.
-``mllp_send`` is a command-line wrapper around
-:py:class:`hl7.client.MLLPClient`.
+``mllp_send`` is a command-line wrapper around
+:py:class:`hl7.client.MLLPClient`. ``mllp_send`` is a useful tool for
+testing HL7 interfaces or resending logged messages::
-::
+ mllp_send --file sample.hl7 --port 6661 mirth.example.com
- Usage: mllp_send [options] <server>
-
- Options:
- -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)
+See :doc:`mllp_send` for examples and usage instructions.
Contents
--------
@@ -155,7 +146,7 @@ Contents
:maxdepth: 1
api
- mllp_send man page <mllp_send>
+ mllp_send
contribute
changelog
authors
View
@@ -2,11 +2,20 @@
``mllp_send`` - MLLP network client
===================================
+
python-hl7 features a simple network client, ``mllp_send``, which reads HL7
messages from a file or ``sys.stdin`` and posts them to an MLLP server.
-``mllp_send`` is a command-line wrapper around
-:py:class:`hl7.client.MLLPClient`.
+``mllp_send`` is a command-line wrapper around
+:py:class:`hl7.client.MLLPClient`. ``mllp_send`` is a useful tool for
+testing HL7 interfaces or resending logged messages::
+
+ $ 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|
+
+Usage
+=====
::
Usage: mllp_send [options] <server>
@@ -20,4 +29,23 @@ messages from a file or ``sys.stdin`` and posts them to an MLLP server.
\r). Can ONLY send 1 message. Requires --file option
(no stdin)
-For more details, visit http://python-hl7.readthedocs.org
+Input Format
+============
+
+By default, ``mllp_send`` expects the ``FILE`` or stdin input to be a properly
+formatted HL7 message (carriage returns separating segments) wrapped in a MLLP
+stream (``<SB>message1<EB><CR><SB>message2<EB><CR>...``).
+
+However, it is common, especially if the file has been manually edited in
+certain text editors, that the ASCII control characters will be lost and the
+carriage returns will be replaced with the platform's default line endings.
+In this case, ``mllp_send`` provides the ``--loose`` option, which attempts
+to take something that "looks like HL7" and convert it into a proper HL7
+message. 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).
+
+
+Additional Resources
+====================
+
+ * http://python-hl7.readthedocs.org

0 comments on commit 80487fc

Please sign in to comment.