HL7 DataFormat
The HL7 component ships with a HL7 data format that can be used to format between String
and HL7 model objects.
...
Code Block | ||||
---|---|---|---|---|
| ||||
from("direct:hl7in").marshal().hl7().to("jms:queue:hl7out"); from("jms:queue:hl7out").unmarshal().hl7().to("patientLookupService"); |
Message Headers
The unmarshal operation adds these MSH fields as headers on the Camel message:
Camel 1.x
Key | MSH field | Example |
---|---|---|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
Camel 2.0
Key | MSH field | Example |
---|---|---|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
All headers are String
types. If a header value is missing, its value is null
.
Options
The HL7 Data Format supports the following options:
Option | Default | Description |
---|---|---|
validate | true | Camel 2.0: Whether the HAPI Parser should validate. |
Dependencies
To use HL7 in your camel routes you need to add a dependency on camel-hl7, which implements this data format.
If you use Maven, you could just add the following to your pom.xml
, substituting the version number for the latest & greatest release (see the download page for the latest versions).
Code Block |
---|
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-hl7</artifactId>
<version>2.2.0</version>
</dependency>
|
Camel 2.3: Since HAPI 0.6, the library has been split into a base library and several structures libraries, one for each HL7v2 message version:
- v2.1 structures library
- v2.2 structures library
- v2.3 structures library
- v2.3.1 structures library
- v2.4 structures library
- v2.5 structures library
- v2.5.1 structures library
- v2.6 structures library
By default camel-hl7
only references the HAPI base library. Applications are responsible for including structures libraries themselves. For example, if a application works with HL7v2 message versions 2.4 and 2.5 then the following dependencies must be added:
Code Block |
---|
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v24</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v25</artifactId>
<version>1.0</version>
</dependency>
|
OSGi
Work in progress (see also this thread on the HAPI mailing list).