Skip to main content

Super light weight Hl7 2.x parser

Project description

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

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.1.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

hl7lw-0.1.1-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file hl7lw-0.1.1.tar.gz.

File metadata

  • Download URL: hl7lw-0.1.1.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

Hashes for hl7lw-0.1.1.tar.gz
Algorithm Hash digest
SHA256 984a81afba4d58b71124ffd939047c5440b79adbd6d0c9c04c4b605537cf3912
MD5 6985db0925e2d8fa3342e463bf48c740
BLAKE2b-256 1cdd0864668f9f78e92b636a3b7f5cb59cf066a25826618b3d5a9e444bea66e9

See more details on using hashes here.

File details

Details for the file hl7lw-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hl7lw-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for hl7lw-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c8e71b89412ff5e1d23af3ddffcf9de0f8fd1d579e05475e7089271d96d738ef
MD5 e98a57d2eff72772aece0bec5e657f85
BLAKE2b-256 57d2fd54961a6c85306d58c75839cdeea04d98fefa4ce819984e008ee2bd92dd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page