Skip to main content

Library that transforms HL7 messages using mapping schemes

Project description

Introduction

hl7_transform is a Python package that allows for transformation of HL7 messages using a field mapping dictionary.

Maintenance Docs build status GitHub Workflow Status PyPI license PyPI pyversions

As a standard, HL7 permits different ways of implementing message interfaces between systems. For example two systems that exchange ADT or SIU messages often pass the same information in different fields. In a hospital, an integration engine would map one type of HL7 messages to another, transforming the messages on the fly as they are passed through the interfaces. This Python package allows you to test message transformation without having an integration engine in place. You can modify your HL7 message structure freely, by using a JSON-encoded mapping of fields, then evaluate the conformance of the newly created transformed messages to the target software.

A live example of this package at work can be found in hl7_transform_web repository and online.

How to use

The easiest way to use this library is to install it from Pypi:

pip install hl7_transform

Alternatively, you can download and build this package from source:

git clone https://github.com/pdyban/hl7_transform.git
python setup.py build
python setup.py install

After installation, you can use the Python library in your own projects as well as call standalone script hl7_transform in the shell console of your choice.

hl7_transform --help

You can also build your own projects or experiment in Jupyter notebooks by importing the library in your Python code:

from hl7_transform.mapping import HL7Mapping
from hl7_transform.transform import HL7Transform
from hl7_transform.message import HL7Message

mapping = HL7Mapping.from_json('test_transform.json')
message = HL7Message.from_file('test_msg.hl7')
transform = HL7Transform(mapping)
transformed_message = transform(message)

For example code, see inside test module, in particular test_transform.py.

Documentation

This project is documented using sphinx. The documentation pages can be found in ReadTheDocs.

To understand how the package works, we suggest to start by reading the Mapping rules documentation page.

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

hl7_transform-0.1.6.tar.gz (10.7 kB view details)

Uploaded Source

File details

Details for the file hl7_transform-0.1.6.tar.gz.

File metadata

  • Download URL: hl7_transform-0.1.6.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for hl7_transform-0.1.6.tar.gz
Algorithm Hash digest
SHA256 b67f1d6a1b8bb12ef94363805fbbee661431398bee7820839c8cb08db1407e9c
MD5 37b9bb2c81342073a77b8414e99495f1
BLAKE2b-256 467b4afc1feed79fe9a065bb77d3c6bdf1dda07a12a50631a95fcf497661c211

See more details on using hashes here.

Supported by

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