File: mllp_send.rst

package info (click to toggle)
python-hl7 0.4.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 508 kB
  • sloc: python: 3,833; makefile: 160
file content (53 lines) | stat: -rw-r--r-- 1,942 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
.. _mllp-send:

===================================
``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 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>

    Options:
      -h, --help            show this help message and exit
      --version             print current version 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). Requires that messages start with "MSH|^~\&|".
                            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 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..


Additional Resources
====================

 * http://python-hl7.readthedocs.org