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.
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.0.tar.gz
(18.7 kB
view details)
Built Distribution
hl7lw-0.1.0-py3-none-any.whl
(17.5 kB
view details)
File details
Details for the file hl7lw-0.1.0.tar.gz
.
File metadata
- Download URL: hl7lw-0.1.0.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3085a54fccb31052cb215e7f172840b1ae583924d8e00df500ef90e005d0dc6f |
|
MD5 | 18f467fc4cae8e56c63ea968781f21a5 |
|
BLAKE2b-256 | 3f08546695b28ff11e169c1070acc6cd639a17b650c0903071d568a3068b2a16 |
File details
Details for the file hl7lw-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: hl7lw-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.5 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 | 9f2623b1f0782401404a4cf72c382680debb018530e58640679fbeb94aca6ad4 |
|
MD5 | 3241820a4fbc31c86117f633381e4804 |
|
BLAKE2b-256 | a14ea01d99d4d75513ec91e6c392395482a625d5231d3284e8f1b2a8f7877d2f |