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

Uploaded Source

Built Distribution

hl7lw-0.0.3-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hl7lw-0.0.3.tar.gz
  • Upload date:
  • Size: 12.2 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.3.tar.gz
Algorithm Hash digest
SHA256 b91389d57ff954e35fe40f00eaeb8d694c8a19fb01d1aaddc72c7bfb34f9bf32
MD5 cce6fe65a89f4b89655a5e55720589f2
BLAKE2b-256 cdf313581eeb7c83a6a1da6fd1914d661fae10757598432b0ca82144bad4c737

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hl7lw-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.9 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 416516455563e1691614866926846b33f3c5129c53c23fb74665bd7f4d936cb2
MD5 1d0439da1eaf05396c90500751b454f7
BLAKE2b-256 5f27faed9f9be4709dd57c6f10828679aa33c1de7708400239fe733a86695cf8

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