Translate between MLLP and HTTP
Project description
MLLP <-> HTTP
Convert MLLP to HTTP and vice versa.
Keywords: MLLP, HTTP, HL7
Overview
The http2mllp
program is an HTTP server that converts requests to MLLP.
The mllp2http
program is an MLLP server that converts messages to HTTP
requests.
Implements MLLP release 1 and HTTP/1.1. Each MLLP message is assumed to have a corresponding response content (e.g. HL7 acknoledgment).
Roughly compatible with HL7 over HTTP.
Note that this is only MLLP; it does not process HL7v2/HL7v3 messages themselves. Notably, when used for HL7, the HTTP participant must be able to read/generate acknowledgements.
Install
Pip
pip install mllp-http
Run as
http2mllp mllp://localhost:2575
mllp2http http://localhost:8000
Docker
docker pull rivethealth/mllp-http
Run as
docker run -it -p 2575:2575 rivethealth/mllp-http http2mllp mllp://localhost:2575
docker run -it -p 2575:2575 rivethealth/mllp-http mllp2http http://localhost:8000
Usage
http2mllp
usage: http2mllp [-h] [-H HOST] [-p PORT] [--keep-alive KEEP_ALIVE] [--log-level {error,warn,info}] [--mllp-max-messages MLLP_MAX_MESSAGES] [--mllp-release {1}]
[--timeout TIMEOUT] [-v]
mllp_url
HTTP server that proxies an MLLP server.
Expects an MLLP response message and uses it as the HTTP response.
positional arguments:
mllp_url MLLP URL, e.g. mllp://hostname:port
optional arguments:
-h, --help show this help message and exit
-H HOST, --host HOST HTTP host (default: 0.0.0.0)
-p PORT, --port PORT HTTP port (default: 8000)
--keep-alive KEEP_ALIVE
keep-alive in milliseconds, or unlimited if -1. (default: 0)
--log-level {error,warn,info}
--mllp-max-messages MLLP_MAX_MESSAGES
maximum number of messages per connection, or unlimited if -1. (default: -1)
--mllp-release {1} MLLP release version (default: 1)
--timeout TIMEOUT socket timeout, in milliseconds, or unlimited if 0. (default: 10000)
-v, --version show program's version number and exit
mllp2http
usage: mllp2http [-h] [-H HOST] [-p PORT] [--content-type CONTENT_TYPE] [--log-level {error,warn,info}] [--mllp-release {1}]
[--timeout TIMEOUT] [-v]
http_url
MLLP server that proxies an HTTP server. Sends back the HTTP response.
positional arguments:
http_url HTTP URL
optional arguments:
-h, --help show this help message and exit
-H HOST, --host HOST MLLP host (default: 0.0.0.0)
-p PORT, --port PORT MLLP port (default: 2575)
--content-type CONTENT_TYPE
HTTP Content-Type header (default: x-application/hl7-v2+er7)
--log-level {error,warn,info}
--mllp-release {1} MLLP release version (default: 1)
--timeout TIMEOUT timeout in milliseconds (default: 10000)
-v, --version show program's version number and exit
environment variables:
HTTP_AUTHORIZATION - HTTP Authorization header
Examples
mllp2http
Run the HTTP server:
docker run -p 8000:80 kennethreitz/httpbin
Run the MLLP connector:
mllp2http http://localhost:8000/post
Send an MLLP message:
printf '\x0bMESSAGE\x1c\x0d' | socat - TCP:localhost:2575
and see the HTTP server's response, which describes the HTTP request:
{
"args": {},
"data": "MESSAGE",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"Content-Length": "7",
"Content-Type": "x-application/hl7-v2+er7",
"Forwarded": "by=127.0.0.1:2575;for=127.0.0.1:54572;proto=mllp",
"Host": "localhost:8000",
"User-Agent": "mllp2http/1.0.2"
},
"json": null,
"origin": "127.0.0.1:54572",
"url": "mllp://localhost:8000/post"
}
Developing
To install:
make install
Before committing, format:
make format
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mllp_http-1.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f1606b3cff894e143749904913f2f8e9b69b73d401400638451438acc5245a9 |
|
MD5 | c715a7b6a30403be51dd6ccf4f3ca53f |
|
BLAKE2b-256 | 80c5996a8a4282b12a86ec1579f7de68ed637f5caac35b0d2d44d7267c211512 |