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.

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

Uploaded Source

Built Distribution

hl7lw-0.0.4-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hl7lw-0.0.4.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for hl7lw-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7c4f09f1a7c3431686d9523a565931fa0122cf6733d65b9a9c846617464e6dfe
MD5 cfee6530f5560d914a8ed2766da54bd5
BLAKE2b-256 be405486cbd1b0148d6d14f7952b18940058f6e143af2a00902fe3618559d5a2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hl7lw-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 15.5 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.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 50dd95b1758d54c482eaa2ea2c6f946dac820580796ee1e152eba0c710c10c6d
MD5 695440689d62b76ec2f976fab4055b89
BLAKE2b-256 f883f9eda4bfbe186aeefae8fe489be20ed989a5faac20b934f2d5cbf63c8afc

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