Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jcomellas/hl7parser

HL7 parser with segment code generators in C
https://github.com/jcomellas/hl7parser

Last synced: about 2 months ago
JSON representation

HL7 parser with segment code generators in C

Awesome Lists containing this project

README

        

# HL7 Parser

## Overview

The parser is divided into two parts:

1. Low-level functions that implement a tokenizer, lexer, parser,
callback (SAX-like) parser for the [HL7](http://www.hl7.org/) protocol.
2. Custom segment accessors (code-generated by `hl7segdef.py`).

This HL7 parser was designed for a memory-constrained hardware environment
and thus avoids allocating memory as much as possible. This makes its
interface weird at times, and care must be taken to avoid overwriting memory
that is in use by a message (e.g. modifying a parsed buffer while the
resulting message is still in use).

## Requirements

The HL7 parser has no runtime dependency other than the standard C library,
but it requires [qmake](http://qt-project.org/wiki/Category:Tools::qmake)
from the [Qt project](http://www.qt-project.org/) to generate its makefiles.

## Installation

To install qmake in Ubuntu/Debian you can run:
```
apt-get install libt4-dev qt4-qmake
```
Then run:
```
cd hl7parser
./configure
make
sudo make install
sudo ldconfig
```
This will install the dynamic libraries and headers for the project in
`/usr/local`. You can test the behavior of the library by using the
following programs:
```
bin/test_lexer
bin/test_cbparser
bin/test_parser
bin/test_segment
```

## Custom segments

The segment accessors are defined in an XML file (`hl7segdef.xml`) and are
auto-generated by a Python script (`hl7segdef.py`). The code used to access
the segments is already included in the project (see the `src/seg_*.c` and
the `include/hl7parser/seg_*.h` files). If you need to modify the segment
definitions, just remove these files, modify the XML file and run the script
like this:
```
python ./hl7segdef.py
```