The HL7 v2 pipeline is the next step in HL7v2 Aidbox integration, which uses new versions of the HL7 v2 parser and mapper driven by zen/lang configurations. The HL7 v2 pipeline is fully configurable API and is robust against mismatches with HL7 v2 specification.
Quick start
About HL7 v2 parser
The HL7 v2 pipeline uses a new version of the HL7 v2 parser, transforming the message into an intermediate format between FHIR and HL7 v2. This is necessary to preserve the original HL7 v2 fields, while allowing you to write the mapping from a structure close to FHIR.
Now only the default configuration is available, but in future versions of the HL7 v2 pipeline it is expected to be possible to configure the transformation of Z segments and unusual message structures.
Mapping configuration
To convert from an intermediate format to FHIR Bundle or Aidbox Bundle, you need to define mapping, which should be tagged as lisp/mapping and contain the :mapping key. The :mapping value confirms as lisp/expr so you may use Lisp expressions to define which intermediate format properties should be included in the Bundle resource.
Null values and empty arrays will be truncated automatically in the resulted structure.
The HL7 v2 pipeline is primarily a user-configurable API that allows you to describe REST endpoints for different message types and operations for them. HL7 v2 pipeline operations must use hl7v2.api/in-op engine, as well as contain previously defined mapping and parser-config.
For example, you need to define an API with an operation to process an ADT message and then write it to the database.
Each declared endpoint accepts a HL7 v2 message under the "message" key. It can be invoked directly through a REST request or through the HL7 v2 UI on the corresponding tab in the Aidbox UI.
Also, each endpoint accepts a boolean query argument debug, which allows you to return a response instead of writing data to the database.
POST /hl7in/ADT?debug=truecontent-type:application/jsonaccept:application/json{"message":"MSH|^~\\&|App|Facility|||20190423113910||ADT^A08|8899-39|P|2.3||| PID|1||151||Bond^Tiny||19990723|M|||8388 Secret Agent Way^^Raleigh^NC^27677|||||||151||||||||||||N"}