Super light weight Hl7 2.x parser
Project description
hl7lw: A Lightweight HL7 2.x Parsing Library
The hl7lw library aims to provide an extremely simple and lightweight API to read, modify, and write HL7 2.x messages. Minimal processing is done to the messages and most data access should feel very natural and pythonic.
The library also includes an MLLP implementation for both client and server.
All objects have docstrings.
import hl7lw
p = hl7lw.Hl7Parser()
m = p.parse_message(message_bytes)
if m["MSH-9.1"] == "ORU":
m["ORC-1"] = "RP"
message_bytes = p.format_message(m)
report = "\n".join([obx[5] for obx in m.get_segments('OBX') if obx[2] in ('TX', 'FT', 'ST')])
c = hl7lw.MllpClient()
c.connect(host="127.0.0.1", port="1234")
c.send(message_bytes)
ack_bytes = c.recv()
c.close()
ack_m = p.parse_message(ack_bytes)
assert ack_m["MSA-1.1"] == "AA"
assert m["MSH-10"] == ack_m["MSA-2"]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hl7lw-0.1.2.tar.gz
(22.3 kB
view details)
Built Distribution
hl7lw-0.1.2-py3-none-any.whl
(20.2 kB
view details)
File details
Details for the file hl7lw-0.1.2.tar.gz
.
File metadata
- Download URL: hl7lw-0.1.2.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62032f6e73c96e632a79f16373858e3e93800dfb879e96318b5dacd7499f89dd |
|
MD5 | d42f0c1ccdf7c06449b7317efdb6cf08 |
|
BLAKE2b-256 | 8040de1fc1ea27eadaef9e2bca77ef185888dfcb5f1429f42a851df5591b88b9 |
File details
Details for the file hl7lw-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: hl7lw-0.1.2-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72ef355524aa0620a4b9f321157f44719441606da5453274fc6087f3870983ff |
|
MD5 | 61875ab42871b4a906d71748d45a119b |
|
BLAKE2b-256 | 3a3f869402769cf08556f7685219a15a5f1ac1bc3530bea09e98bebf12eb246e |