Skip to main content

hl7lw: A Lightweight HL7 2.x Parsing Library

pypi Test-Status

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"]

Metadata

Release files for hl7lw 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hl7lw 0.1.2
File Size Uploaded
hl7lw-0.1.2.tar.gz 22.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hl7lw 0.1.2
File Interpreter ABI Platform
hl7lw-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 42.5 kB

Release files / hl7lw-0.1.2.tar.gz

Download URL hl7lw-0.1.2.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
62032f6e73c96e632a79f16373858e3e93800dfb879e96318b5dacd7499f89dd
BLAKE2b-256 checksum
How to use checksums
8040de1fc1ea27eadaef9e2bca77ef185888dfcb5f1429f42a851df5591b88b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / hl7lw-0.1.2-py3-none-any.whl

Download URL hl7lw-0.1.2-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72ef355524aa0620a4b9f321157f44719441606da5453274fc6087f3870983ff
BLAKE2b-256 checksum
How to use checksums
3a3f869402769cf08556f7685219a15a5f1ac1bc3530bea09e98bebf12eb246e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page