Author: buildbot Date: Fri Jan 9 10:22:35 2015 New Revision: 935579 Log: Production update by buildbot for camel
Modified: websites/production/camel/content/book-component-appendix.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/hl7.html Modified: websites/production/camel/content/book-component-appendix.html ============================================================================== --- websites/production/camel/content/book-component-appendix.html (original) +++ websites/production/camel/content/book-component-appendix.html Fri Jan 9 10:22:35 2015 @@ -1360,11 +1360,11 @@ template.send("direct:alias-verify& </div> </div> <p>The <strong>cxf:</strong> component provides integration with <a shape="rect" href="http://cxf.apache.org">Apache CXF</a> for connecting to JAX-WS services hosted in CXF.</p><p><style type="text/css">/*<![CDATA[*/ -div.rbtoc1420744767941 {padding: 0px;} -div.rbtoc1420744767941 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1420744767941 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1420798748751 {padding: 0px;} +div.rbtoc1420798748751 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1420798748751 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style></p><div class="toc-macro rbtoc1420744767941"> +/*]]>*/</style></p><div class="toc-macro rbtoc1420798748751"> <ul class="toc-indentation"><li><a shape="rect" href="#CXF-CXFComponent">CXF Component</a> <ul class="toc-indentation"><li><a shape="rect" href="#CXF-URIformat">URI format</a></li><li><a shape="rect" href="#CXF-Options">Options</a> <ul class="toc-indentation"><li><a shape="rect" href="#CXF-Thedescriptionsofthedataformats">The descriptions of the dataformats</a> @@ -4854,7 +4854,7 @@ hibernate:[entityClassName][?options] <h3 id="BookComponentAppendix-SeeAlso.20">See Also</h3> <ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul> <ul class="alternate"><li><a shape="rect" href="hibernate-example.html">Hibernate Example</a></li></ul> -<h2 id="BookComponentAppendix-HL7Component">HL7 Component</h2><p>The <strong>HL7</strong> component is used for working with the HL7 MLLP protocol and <a shape="rect" class="external-link" href="http://www.hl7.org/implement/standards/product_brief.cfm?product_id=185" rel="nofollow">HL7 v2 messages</a> using the <a shape="rect" class="external-link" href="http://hl7api.sourceforge.net" rel="nofollow">HAPI library</a>.</p><p>This component supports the following:</p><ul class="alternate"><li>HL7 MLLP codec for <a shape="rect" class="external-link" href="http://mina.apache.org/">Mina</a></li><li>HL7 MLLP codec for <a shape="rect" href="netty4.html">Netty4</a> from <strong>Camel 2.15</strong> onwards</li><li><a shape="rect" href="type-converter.html">Type Converter</a> from/to HAPI and String</li><li>HL7 DataFormat using the HAPI library</li><li class="confluence-link">Even more ease-of-use as it's integrated well with the <a shape="rect" href="mina2.html">camel-mina2</a> comp onent.</li></ul><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<h2 id="BookComponentAppendix-HL7Component">HL7 Component</h2><p>The <strong>HL7</strong> component is used for working with the HL7 MLLP protocol and <a shape="rect" class="external-link" href="http://www.hl7.org/implement/standards/product_brief.cfm?product_id=185" rel="nofollow">HL7 v2 messages</a> using the <a shape="rect" class="external-link" href="http://hl7api.sourceforge.net" rel="nofollow">HAPI library</a>.</p><p>This component supports the following:</p><ul class="alternate"><li>HL7 MLLP codec for <a shape="rect" href="mina2.html">Mina</a></li><li>HL7 MLLP codec for <a shape="rect" href="netty4.html">Netty4</a> from <strong>Camel 2.15</strong> onwards</li><li><a shape="rect" href="type-converter.html">Type Converter</a> from/to HAPI and String</li><li>HL7 DataFormat using the HAPI library</li><li class="confluence-link">Even more ease-of-use as it's integrated well with the <a shape="rect" href="mina2.html">camel-mina2</a> component.</li></ul><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-hl7</artifactId> @@ -4862,8 +4862,8 @@ hibernate:[entityClassName][?options] <!-- use the same version as your Camel core version --> </dependency> ]]></script> -</div></div><h3 id="BookComponentAppendix-HL7MLLPprotocol">HL7 MLLP protocol</h3><p>HL7 is often used with the HL7 MLLP protocol, which is a text based TCP socket based protocol. This component ships with a Mina and Netty4 Codec that conforms to the MLLP protocol so you can easily expose an HL7 listener accepting HL7 requests over the TCP transport layer. To expose a HL7 listener service, the <a shape="rect" href="mina2.html">camel-mina2</a> or <a shape="rect" href="netty4.html">camel-netty4</a> component is used with the <code>HL7MLLPCodec</code> (mina2) or <code>HL7MLLPConfig</code> (Netty4) as codec.</p><p>The HL7 MLLP codec has the following options:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th> </tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>startByte</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0x0b</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The start byte spanning the HL7 payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>endByte1</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0x1c</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The first end byte spanning the HL7 payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>endByte2</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0x0d</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The 2nd end byte spanning the HL7 payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>charset</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>JVM Default</p></td><td colspan="1" ro wspan="1" class="confluenceTd"><p>The encoding (a <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html" rel="nofollow">charset name</a>) to use for the codec. If not provided, Camel will use the <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html#defaultCharset()" rel="nofollow">JVM default Charset</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>produceString</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>true</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>(Camel 2.14.1)</strong> If true, the codec creates a string using the defined charset. If false, the codec sends a plain byte array into the route, so that the HL7 Data Format can determine the actual charset from the HL7 message content.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>convertLFtoCR</code></td><td colspa n="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd">Will convert <code>\n</code> to <code>\r</code> (<code>0x0d</code>, 13 decimal) as HL7 stipulates <code>\r</code> as segment terminators. The HAPI library requires the use of <code>\r</code>.</td></tr></tbody></table></div></div><h4 id="BookComponentAppendix-ExposinganHL7listenerusingMina">Exposing an HL7 listener using Mina</h4><p>In the Spring XML file, we configure a mina2 endpoint to listen for HL7 requests using TCP on port <code>8888</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <endpoint id="hl7listener" uri="mina2:tcp://localhost:8888?sync=true&amp;codec=#hl7codec"/> +</div></div><h3 id="BookComponentAppendix-HL7MLLPprotocol">HL7 MLLP protocol</h3><p>HL7 is often used with the HL7 MLLP protocol, which is a text based TCP socket based protocol. This component ships with a Mina and Netty4 Codec that conforms to the MLLP protocol so you can easily expose an HL7 listener accepting HL7 requests over the TCP transport layer. To expose a HL7 listener service, the <a shape="rect" href="mina2.html">camel-mina2</a> or <a shape="rect" href="netty4.html">camel-netty4</a> component is used with the <code>HL7MLLPCodec</code> (mina2) or <code>HL7MLLPNettyDecoder/HL7MLLPNettyEncoder</code> (Netty4).</p><p>HL7 MLLP codec can be configured as follows:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p ></th></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>startByte</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p><code>0x0b</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p>The start byte spanning the HL7 >payload.</p></td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>endByte1</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p><code>0x1c</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p>The first end byte spanning the HL7 >payload.</p></td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>endByte2</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p><code>0x0d</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p>The 2nd end byte spanning the HL7 >payload.</p></td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>charset</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p>JVM Default</p></td><td colspan= "1" rowspan="1" class="confluenceTd"><p>The encoding (a <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html" rel="nofollow">charset name</a>) to use for the codec. If not provided, Camel will use the <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html#defaultCharset()" rel="nofollow">JVM default Charset</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>produceString</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>true</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>(Camel 2.14.1)</strong> If true, the codec creates a string using the defined charset. If false, the codec sends a plain byte array into the route, so that the HL7 Data Format can determine the actual charset from the HL7 message content.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>convertLFtoCR</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd">Will convert <code>\n</code> to <code>\r</code> (<code>0x0d</code>, 13 decimal) as HL7 stipulates <code>\r</code> as segment terminators. The HAPI library requires the use of <code>\r</code>.</td></tr></tbody></table></div></div><h4 id="BookComponentAppendix-ExposinganHL7listenerusingMina">Exposing an HL7 listener using Mina</h4><p>In the Spring XML file, we configure a mina2 endpoint to listen for HL7 requests using TCP on port <code>8888</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <endpoint id="hl7MinaListener" uri="mina2:tcp://localhost:8888?sync=true&amp;codec=#hl7codec"/> ]]></script> </div></div><p><strong>sync=true</strong> indicates that this listener is synchronous and therefore will return a HL7 response to the caller. The HL7 codec is setup with <strong>codec=#hl7codec</strong>. Note that <code>hl7codec</code> is just a Spring bean ID, so it could be named <code>mygreatcodecforhl7</code> or whatever. The codec is also set up in the Spring XML file:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <bean id="hl7codec" class="org.apache.camel.component.hl7.HL7MLLPCodec"> @@ -4871,7 +4871,7 @@ hibernate:[entityClassName][?options] </bean> ]]></script> </div></div><p>The endpoint <strong>hl7listener</strong> can then be used in a route as a consumer, as this Java DSL example illustrates:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("hl7listener").beanRef("patientLookupService"); +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("hl7MinaListener").beanRef("patientLookupService"); ]]></script> </div></div><p>This is a very simple route that will listen for HL7 and route it to a service named <strong>patientLookupService</strong>. This is also Spring bean ID, configured in the Spring XML as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <bean id="patientLookupService" class="com.mycompany.healthcare.service.PatientLookupService"/> @@ -4891,6 +4891,15 @@ public class PatientLookupService { return response } ]]></script> +</div></div><h4 id="BookComponentAppendix-ExposinganHL7listenerusingNetty(availableasofCamel2.15)">Exposing an HL7 listener using Netty (available as of Camel 2.15)</h4><p>In the Spring XML file, we configure a netty4 endpoint to listen for HL7 requests using TCP on port <code>8888</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <endpoint id="hl7NettyListener" uri="netty4:tcp://localhost:8888?sync=true&amp;encoder=#hl7encoder&amp;decoder=#hl7decoder"/> +]]></script> +</div></div><p><strong>sync=true</strong> indicates that this listener is synchronous and therefore will return a HL7 response to the caller. The HL7 codec is setup with <strong>encoder=#hl7encoder </strong>and<strong> decoder=#hl7decoder</strong>. Note that <code>hl7encoder</code> and <code>hl7decoder</code> are just bean IDs, so it could be named differently. The beans can be set in the Spring XML file:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <bean id="hl7decoder" class="org.apache.camel.component.hl7.HL7MLLPNettyDecoderFactory"/> +Â <bean id="hl7encoder" class="org.apache.camel.component.hl7.HL7MLLPNettyEncoderFactory"/>]]></script> +</div></div><p>The endpoint <strong>hl7listener</strong> can then be used in a route as a consumer, as this Java DSL example illustrates:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("hl7NettyListener").beanRef("patientLookupService"); +]]></script> </div></div><h3 id="BookComponentAppendix-HL7Modelusingjava.lang.Stringorbyte[]">HL7 Model using java.lang.String or byte[]</h3><p>The HL7 MLLP codec uses plain String as its data format. Camel uses its <a shape="rect" href="type-converter.html">Type Converter</a> to convert to/from strings to the HAPI HL7 model objects, but you can use the plain String objects if you prefer, for instance if you wish to parse the data yourself.</p><p>As of Camel 2.14.1 you can also let the codec use a plain <code>byte[]</code> as its data format. The Type Converter is also capable of converting the <code>byte[]</code> to/from HAPI HL7 model objects.</p><h3 id="BookComponentAppendix-HL7v2ModelusingHAPI">HL7v2 Model using HAPI</h3><p>The HL7v2 model uses Java objects from the HAPI library. Using this library, you can encode and decode from the EDI format (ER7) that is mostly used with HL7v2.</p><p>The sample below is a request to lookup a patient with the patient ID <code>0101701234</code>.< /p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[MSH|^~\\&|MYSENDER|MYRECEIVER|MYAPPLICATION||200612211200||QRY^A19|1234|P|2.4 QRD|200612211200|R|I|GetPatient|||1^RD|0101701234|DEM|| Modified: websites/production/camel/content/book-in-one-page.html ============================================================================== --- websites/production/camel/content/book-in-one-page.html (original) +++ websites/production/camel/content/book-in-one-page.html Fri Jan 9 10:22:35 2015 @@ -4126,11 +4126,11 @@ While not actual tutorials you might fin </div> </div> <h2 id="BookInOnePage-Preface">Preface</h2><p>This tutorial aims to guide the reader through the stages of creating a project which uses Camel to facilitate the routing of messages from a JMS queue to a <a shape="rect" class="external-link" href="http://www.springramework.org" rel="nofollow">Spring</a> service. The route works in a synchronous fashion returning a response to the client.</p><p><style type="text/css">/*<![CDATA[*/ -div.rbtoc1420744826850 {padding: 0px;} -div.rbtoc1420744826850 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1420744826850 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1420798789231 {padding: 0px;} +div.rbtoc1420798789231 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1420798789231 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style></p><div class="toc-macro rbtoc1420744826850"> +/*]]>*/</style></p><div class="toc-macro rbtoc1420798789231"> <ul class="toc-indentation"><li><a shape="rect" href="#Tutorial-JmsRemoting-TutorialonSpringRemotingwithJMS">Tutorial on Spring Remoting with JMS</a></li><li><a shape="rect" href="#Tutorial-JmsRemoting-Preface">Preface</a></li><li><a shape="rect" href="#Tutorial-JmsRemoting-Prerequisites">Prerequisites</a></li><li><a shape="rect" href="#Tutorial-JmsRemoting-Distribution">Distribution</a></li><li><a shape="rect" href="#Tutorial-JmsRemoting-About">About</a></li><li><a shape="rect" href="#Tutorial-JmsRemoting-CreatetheCamelProject">Create the Camel Project</a> <ul class="toc-indentation"><li><a shape="rect" href="#Tutorial-JmsRemoting-UpdatethePOMwithDependencies">Update the POM with Dependencies</a></li></ul> </li><li><a shape="rect" href="#Tutorial-JmsRemoting-WritingtheServer">Writing the Server</a> @@ -6316,11 +6316,11 @@ So we completed the last piece in the pi <style type="text/css">/*<![CDATA[*/ -div.rbtoc1420744831590 {padding: 0px;} -div.rbtoc1420744831590 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1420744831590 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1420798791397 {padding: 0px;} +div.rbtoc1420798791397 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1420798791397 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style><div class="toc-macro rbtoc1420744831590"> +/*]]>*/</style><div class="toc-macro rbtoc1420798791397"> <ul class="toc-indentation"><li><a shape="rect" href="#Tutorial-AXIS-Camel-TutorialusingAxis1.4withApacheCamel">Tutorial using Axis 1.4 with Apache Camel</a> <ul class="toc-indentation"><li><a shape="rect" href="#Tutorial-AXIS-Camel-Prerequisites">Prerequisites</a></li><li><a shape="rect" href="#Tutorial-AXIS-Camel-Distribution">Distribution</a></li><li><a shape="rect" href="#Tutorial-AXIS-Camel-Introduction">Introduction</a></li><li><a shape="rect" href="#Tutorial-AXIS-Camel-SettinguptheprojecttorunAxis">Setting up the project to run Axis</a> <ul class="toc-indentation"><li><a shape="rect" href="#Tutorial-AXIS-Camel-Maven2">Maven 2</a></li><li><a shape="rect" href="#Tutorial-AXIS-Camel-wsdl">wsdl</a></li><li><a shape="rect" href="#Tutorial-AXIS-Camel-ConfiguringAxis">Configuring Axis</a></li><li><a shape="rect" href="#Tutorial-AXIS-Camel-RunningtheExample">Running the Example</a></li></ul> @@ -19174,11 +19174,11 @@ template.send("direct:alias-verify& </div> </div> <p>The <strong>cxf:</strong> component provides integration with <a shape="rect" href="http://cxf.apache.org">Apache CXF</a> for connecting to JAX-WS services hosted in CXF.</p><p><style type="text/css">/*<![CDATA[*/ -div.rbtoc1420744867174 {padding: 0px;} -div.rbtoc1420744867174 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1420744867174 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1420798824139 {padding: 0px;} +div.rbtoc1420798824139 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1420798824139 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style></p><div class="toc-macro rbtoc1420744867174"> +/*]]>*/</style></p><div class="toc-macro rbtoc1420798824139"> <ul class="toc-indentation"><li><a shape="rect" href="#CXF-CXFComponent">CXF Component</a> <ul class="toc-indentation"><li><a shape="rect" href="#CXF-URIformat">URI format</a></li><li><a shape="rect" href="#CXF-Options">Options</a> <ul class="toc-indentation"><li><a shape="rect" href="#CXF-Thedescriptionsofthedataformats">The descriptions of the dataformats</a> @@ -22668,7 +22668,7 @@ hibernate:[entityClassName][?options] <h3 id="BookInOnePage-SeeAlso.40">See Also</h3> <ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul> <ul class="alternate"><li><a shape="rect" href="hibernate-example.html">Hibernate Example</a></li></ul> -<h2 id="BookInOnePage-HL7Component">HL7 Component</h2><p>The <strong>HL7</strong> component is used for working with the HL7 MLLP protocol and <a shape="rect" class="external-link" href="http://www.hl7.org/implement/standards/product_brief.cfm?product_id=185" rel="nofollow">HL7 v2 messages</a> using the <a shape="rect" class="external-link" href="http://hl7api.sourceforge.net" rel="nofollow">HAPI library</a>.</p><p>This component supports the following:</p><ul class="alternate"><li>HL7 MLLP codec for <a shape="rect" class="external-link" href="http://mina.apache.org/">Mina</a></li><li>HL7 MLLP codec for <a shape="rect" href="netty4.html">Netty4</a> from <strong>Camel 2.15</strong> onwards</li><li><a shape="rect" href="type-converter.html">Type Converter</a> from/to HAPI and String</li><li>HL7 DataFormat using the HAPI library</li><li class="confluence-link">Even more ease-of-use as it's integrated well with the <a shape="rect" href="mina2.html">camel-mina2</a> component.</ li></ul><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<h2 id="BookInOnePage-HL7Component">HL7 Component</h2><p>The <strong>HL7</strong> component is used for working with the HL7 MLLP protocol and <a shape="rect" class="external-link" href="http://www.hl7.org/implement/standards/product_brief.cfm?product_id=185" rel="nofollow">HL7 v2 messages</a> using the <a shape="rect" class="external-link" href="http://hl7api.sourceforge.net" rel="nofollow">HAPI library</a>.</p><p>This component supports the following:</p><ul class="alternate"><li>HL7 MLLP codec for <a shape="rect" href="mina2.html">Mina</a></li><li>HL7 MLLP codec for <a shape="rect" href="netty4.html">Netty4</a> from <strong>Camel 2.15</strong> onwards</li><li><a shape="rect" href="type-converter.html">Type Converter</a> from/to HAPI and String</li><li>HL7 DataFormat using the HAPI library</li><li class="confluence-link">Even more ease-of-use as it's integrated well with the <a shape="rect" href="mina2.html">camel-mina2</a> component.</li></ul><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-hl7</artifactId> @@ -22676,8 +22676,8 @@ hibernate:[entityClassName][?options] <!-- use the same version as your Camel core version --> </dependency> ]]></script> -</div></div><h3 id="BookInOnePage-HL7MLLPprotocol">HL7 MLLP protocol</h3><p>HL7 is often used with the HL7 MLLP protocol, which is a text based TCP socket based protocol. This component ships with a Mina and Netty4 Codec that conforms to the MLLP protocol so you can easily expose an HL7 listener accepting HL7 requests over the TCP transport layer. To expose a HL7 listener service, the <a shape="rect" href="mina2.html">camel-mina2</a> or <a shape="rect" href="netty4.html">camel-netty4</a> component is used with the <code>HL7MLLPCodec</code> (mina2) or <code>HL7MLLPConfig</code> (Netty4) as codec.</p><p>The HL7 MLLP codec has the following options:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr ><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>startByte</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p><code>0x0b</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p>The start byte spanning the HL7 >payload.</p></td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>endByte1</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p><code>0x1c</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p>The first end byte spanning the HL7 >payload.</p></td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>endByte2</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p><code>0x0d</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p>The 2nd end byte spanning the HL7 >payload.</p></td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>charset</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p>JVM Default</p></td><td colspan="1" >rowspan="1 " class="confluenceTd"><p>The encoding (a <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html" rel="nofollow">charset name</a>) to use for the codec. If not provided, Camel will use the <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html#defaultCharset()" rel="nofollow">JVM default Charset</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>produceString</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>true</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>(Camel 2.14.1)</strong> If true, the codec creates a string using the defined charset. If false, the codec sends a plain byte array into the route, so that the HL7 Data Format can determine the actual charset from the HL7 message content.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>convertLFtoCR</code></td><td colspan="1" ro wspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd">Will convert <code>\n</code> to <code>\r</code> (<code>0x0d</code>, 13 decimal) as HL7 stipulates <code>\r</code> as segment terminators. The HAPI library requires the use of <code>\r</code>.</td></tr></tbody></table></div></div><h4 id="BookInOnePage-ExposinganHL7listenerusingMina">Exposing an HL7 listener using Mina</h4><p>In the Spring XML file, we configure a mina2 endpoint to listen for HL7 requests using TCP on port <code>8888</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <endpoint id="hl7listener" uri="mina2:tcp://localhost:8888?sync=true&amp;codec=#hl7codec"/> +</div></div><h3 id="BookInOnePage-HL7MLLPprotocol">HL7 MLLP protocol</h3><p>HL7 is often used with the HL7 MLLP protocol, which is a text based TCP socket based protocol. This component ships with a Mina and Netty4 Codec that conforms to the MLLP protocol so you can easily expose an HL7 listener accepting HL7 requests over the TCP transport layer. To expose a HL7 listener service, the <a shape="rect" href="mina2.html">camel-mina2</a> or <a shape="rect" href="netty4.html">camel-netty4</a> component is used with the <code>HL7MLLPCodec</code> (mina2) or <code>HL7MLLPNettyDecoder/HL7MLLPNettyEncoder</code> (Netty4).</p><p>HL7 MLLP codec can be configured as follows:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></ tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>startByte</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0x0b</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The start byte spanning the HL7 payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>endByte1</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0x1c</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The first end byte spanning the HL7 payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>endByte2</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0x0d</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The 2nd end byte spanning the HL7 payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>charset</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>JVM Default</p></td><td colspan="1" rows pan="1" class="confluenceTd"><p>The encoding (a <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html" rel="nofollow">charset name</a>) to use for the codec. If not provided, Camel will use the <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html#defaultCharset()" rel="nofollow">JVM default Charset</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>produceString</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>true</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>(Camel 2.14.1)</strong> If true, the codec creates a string using the defined charset. If false, the codec sends a plain byte array into the route, so that the HL7 Data Format can determine the actual charset from the HL7 message content.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>convertLFtoCR</code></td><td colspan= "1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd">Will convert <code>\n</code> to <code>\r</code> (<code>0x0d</code>, 13 decimal) as HL7 stipulates <code>\r</code> as segment terminators. The HAPI library requires the use of <code>\r</code>.</td></tr></tbody></table></div></div><h4 id="BookInOnePage-ExposinganHL7listenerusingMina">Exposing an HL7 listener using Mina</h4><p>In the Spring XML file, we configure a mina2 endpoint to listen for HL7 requests using TCP on port <code>8888</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <endpoint id="hl7MinaListener" uri="mina2:tcp://localhost:8888?sync=true&amp;codec=#hl7codec"/> ]]></script> </div></div><p><strong>sync=true</strong> indicates that this listener is synchronous and therefore will return a HL7 response to the caller. The HL7 codec is setup with <strong>codec=#hl7codec</strong>. Note that <code>hl7codec</code> is just a Spring bean ID, so it could be named <code>mygreatcodecforhl7</code> or whatever. The codec is also set up in the Spring XML file:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <bean id="hl7codec" class="org.apache.camel.component.hl7.HL7MLLPCodec"> @@ -22685,7 +22685,7 @@ hibernate:[entityClassName][?options] </bean> ]]></script> </div></div><p>The endpoint <strong>hl7listener</strong> can then be used in a route as a consumer, as this Java DSL example illustrates:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("hl7listener").beanRef("patientLookupService"); +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("hl7MinaListener").beanRef("patientLookupService"); ]]></script> </div></div><p>This is a very simple route that will listen for HL7 and route it to a service named <strong>patientLookupService</strong>. This is also Spring bean ID, configured in the Spring XML as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <bean id="patientLookupService" class="com.mycompany.healthcare.service.PatientLookupService"/> @@ -22705,6 +22705,15 @@ public class PatientLookupService { return response } ]]></script> +</div></div><h4 id="BookInOnePage-ExposinganHL7listenerusingNetty(availableasofCamel2.15)">Exposing an HL7 listener using Netty (available as of Camel 2.15)</h4><p>In the Spring XML file, we configure a netty4 endpoint to listen for HL7 requests using TCP on port <code>8888</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <endpoint id="hl7NettyListener" uri="netty4:tcp://localhost:8888?sync=true&amp;encoder=#hl7encoder&amp;decoder=#hl7decoder"/> +]]></script> +</div></div><p><strong>sync=true</strong> indicates that this listener is synchronous and therefore will return a HL7 response to the caller. The HL7 codec is setup with <strong>encoder=#hl7encoder </strong>and<strong> decoder=#hl7decoder</strong>. Note that <code>hl7encoder</code> and <code>hl7decoder</code> are just bean IDs, so it could be named differently. The beans can be set in the Spring XML file:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <bean id="hl7decoder" class="org.apache.camel.component.hl7.HL7MLLPNettyDecoderFactory"/> +Â <bean id="hl7encoder" class="org.apache.camel.component.hl7.HL7MLLPNettyEncoderFactory"/>]]></script> +</div></div><p>The endpoint <strong>hl7listener</strong> can then be used in a route as a consumer, as this Java DSL example illustrates:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("hl7NettyListener").beanRef("patientLookupService"); +]]></script> </div></div><h3 id="BookInOnePage-HL7Modelusingjava.lang.Stringorbyte[]">HL7 Model using java.lang.String or byte[]</h3><p>The HL7 MLLP codec uses plain String as its data format. Camel uses its <a shape="rect" href="type-converter.html">Type Converter</a> to convert to/from strings to the HAPI HL7 model objects, but you can use the plain String objects if you prefer, for instance if you wish to parse the data yourself.</p><p>As of Camel 2.14.1 you can also let the codec use a plain <code>byte[]</code> as its data format. The Type Converter is also capable of converting the <code>byte[]</code> to/from HAPI HL7 model objects.</p><h3 id="BookInOnePage-HL7v2ModelusingHAPI">HL7v2 Model using HAPI</h3><p>The HL7v2 model uses Java objects from the HAPI library. Using this library, you can encode and decode from the EDI format (ER7) that is mostly used with HL7v2.</p><p>The sample below is a request to lookup a patient with the patient ID <code>0101701234</code>.</p><div class="c ode panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[MSH|^~\\&|MYSENDER|MYRECEIVER|MYAPPLICATION||200612211200||QRY^A19|1234|P|2.4 QRD|200612211200|R|I|GetPatient|||1^RD|0101701234|DEM|| Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/hl7.html ============================================================================== --- websites/production/camel/content/hl7.html (original) +++ websites/production/camel/content/hl7.html Fri Jan 9 10:22:35 2015 @@ -86,7 +86,7 @@ <tbody> <tr> <td valign="top" width="100%"> -<div class="wiki-content maincontent"><h2 id="HL7-HL7Component">HL7 Component</h2><p>The <strong>HL7</strong> component is used for working with the HL7 MLLP protocol and <a shape="rect" class="external-link" href="http://www.hl7.org/implement/standards/product_brief.cfm?product_id=185" rel="nofollow">HL7 v2 messages</a> using the <a shape="rect" class="external-link" href="http://hl7api.sourceforge.net" rel="nofollow">HAPI library</a>.</p><p>This component supports the following:</p><ul class="alternate"><li>HL7 MLLP codec for <a shape="rect" class="external-link" href="http://mina.apache.org/">Mina</a></li><li>HL7 MLLP codec for <a shape="rect" href="netty4.html">Netty4</a> from <strong>Camel 2.15</strong> onwards</li><li><a shape="rect" href="type-converter.html">Type Converter</a> from/to HAPI and String</li><li>HL7 DataFormat using the HAPI library</li><li class="confluence-link">Even more ease-of-use as it's integrated well with the <a shape="rect" href="mina2.html"> camel-mina2</a> component.</li></ul><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<div class="wiki-content maincontent"><h2 id="HL7-HL7Component">HL7 Component</h2><p>The <strong>HL7</strong> component is used for working with the HL7 MLLP protocol and <a shape="rect" class="external-link" href="http://www.hl7.org/implement/standards/product_brief.cfm?product_id=185" rel="nofollow">HL7 v2 messages</a> using the <a shape="rect" class="external-link" href="http://hl7api.sourceforge.net" rel="nofollow">HAPI library</a>.</p><p>This component supports the following:</p><ul class="alternate"><li>HL7 MLLP codec for <a shape="rect" href="mina2.html">Mina</a></li><li>HL7 MLLP codec for <a shape="rect" href="netty4.html">Netty4</a> from <strong>Camel 2.15</strong> onwards</li><li><a shape="rect" href="type-converter.html">Type Converter</a> from/to HAPI and String</li><li>HL7 DataFormat using the HAPI library</li><li class="confluence-link">Even more ease-of-use as it's integrated well with the <a shape="rect" href="mina2.html">camel-mina2</a> component.</li></ul ><p>Maven users will need to add the following dependency to their ><code>pom.xml</code> for this component:</p><div class="code panel pdl" >style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-hl7</artifactId> @@ -94,8 +94,8 @@ <!-- use the same version as your Camel core version --> </dependency> ]]></script> -</div></div><h3 id="HL7-HL7MLLPprotocol">HL7 MLLP protocol</h3><p>HL7 is often used with the HL7 MLLP protocol, which is a text based TCP socket based protocol. This component ships with a Mina and Netty4 Codec that conforms to the MLLP protocol so you can easily expose an HL7 listener accepting HL7 requests over the TCP transport layer. To expose a HL7 listener service, the <a shape="rect" href="mina2.html">camel-mina2</a> or <a shape="rect" href="netty4.html">camel-netty4</a> component is used with the <code>HL7MLLPCodec</code> (mina2) or <code>HL7MLLPConfig</code> (Netty4) as codec.</p><p>The HL7 MLLP codec has the following options:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colsp an="1" rowspan="1" class="confluenceTd"><p><code>startByte</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0x0b</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The start byte spanning the HL7 payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>endByte1</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0x1c</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The first end byte spanning the HL7 payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>endByte2</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0x0d</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The 2nd end byte spanning the HL7 payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>charset</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>JVM Default</p></td><td colspan="1" rowspan="1" class="c onfluenceTd"><p>The encoding (a <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html" rel="nofollow">charset name</a>) to use for the codec. If not provided, Camel will use the <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html#defaultCharset()" rel="nofollow">JVM default Charset</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>produceString</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>true</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>(Camel 2.14.1)</strong> If true, the codec creates a string using the defined charset. If false, the codec sends a plain byte array into the route, so that the HL7 Data Format can determine the actual charset from the HL7 message content.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>convertLFtoCR</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd">Will convert <code>\n</code> to <code>\r</code> (<code>0x0d</code>, 13 decimal) as HL7 stipulates <code>\r</code> as segment terminators. The HAPI library requires the use of <code>\r</code>.</td></tr></tbody></table></div></div><h4 id="HL7-ExposinganHL7listenerusingMina">Exposing an HL7 listener using Mina</h4><p>In the Spring XML file, we configure a mina2 endpoint to listen for HL7 requests using TCP on port <code>8888</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <endpoint id="hl7listener" uri="mina2:tcp://localhost:8888?sync=true&amp;codec=#hl7codec"/> +</div></div><h3 id="HL7-HL7MLLPprotocol">HL7 MLLP protocol</h3><p>HL7 is often used with the HL7 MLLP protocol, which is a text based TCP socket based protocol. This component ships with a Mina and Netty4 Codec that conforms to the MLLP protocol so you can easily expose an HL7 listener accepting HL7 requests over the TCP transport layer. To expose a HL7 listener service, the <a shape="rect" href="mina2.html">camel-mina2</a> or <a shape="rect" href="netty4.html">camel-netty4</a> component is used with the <code>HL7MLLPCodec</code> (mina2) or <code>HL7MLLPNettyDecoder/HL7MLLPNettyEncoder</code> (Netty4).</p><p>HL7 MLLP codec can be configured as follows:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>startByte</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0x0b</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The start byte spanning the HL7 payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>endByte1</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0x1c</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The first end byte spanning the HL7 payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>endByte2</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0x0d</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The 2nd end byte spanning the HL7 payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>charset</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>JVM Default</p></td><td colspan="1" rowspan="1" cl ass="confluenceTd"><p>The encoding (a <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html" rel="nofollow">charset name</a>) to use for the codec. If not provided, Camel will use the <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html#defaultCharset()" rel="nofollow">JVM default Charset</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>produceString</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>true</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>(Camel 2.14.1)</strong> If true, the codec creates a string using the defined charset. If false, the codec sends a plain byte array into the route, so that the HL7 Data Format can determine the actual charset from the HL7 message content.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>convertLFtoCR</code></td><td colspan="1" rowspa n="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd">Will convert <code>\n</code> to <code>\r</code> (<code>0x0d</code>, 13 decimal) as HL7 stipulates <code>\r</code> as segment terminators. The HAPI library requires the use of <code>\r</code>.</td></tr></tbody></table></div></div><h4 id="HL7-ExposinganHL7listenerusingMina">Exposing an HL7 listener using Mina</h4><p>In the Spring XML file, we configure a mina2 endpoint to listen for HL7 requests using TCP on port <code>8888</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <endpoint id="hl7MinaListener" uri="mina2:tcp://localhost:8888?sync=true&amp;codec=#hl7codec"/> ]]></script> </div></div><p><strong>sync=true</strong> indicates that this listener is synchronous and therefore will return a HL7 response to the caller. The HL7 codec is setup with <strong>codec=#hl7codec</strong>. Note that <code>hl7codec</code> is just a Spring bean ID, so it could be named <code>mygreatcodecforhl7</code> or whatever. The codec is also set up in the Spring XML file:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <bean id="hl7codec" class="org.apache.camel.component.hl7.HL7MLLPCodec"> @@ -103,7 +103,7 @@ </bean> ]]></script> </div></div><p>The endpoint <strong>hl7listener</strong> can then be used in a route as a consumer, as this Java DSL example illustrates:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("hl7listener").beanRef("patientLookupService"); +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("hl7MinaListener").beanRef("patientLookupService"); ]]></script> </div></div><p>This is a very simple route that will listen for HL7 and route it to a service named <strong>patientLookupService</strong>. This is also Spring bean ID, configured in the Spring XML as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <bean id="patientLookupService" class="com.mycompany.healthcare.service.PatientLookupService"/> @@ -123,6 +123,15 @@ public class PatientLookupService { return response } ]]></script> +</div></div><h4 id="HL7-ExposinganHL7listenerusingNetty(availableasofCamel2.15)">Exposing an HL7 listener using Netty (available as of Camel 2.15)</h4><p>In the Spring XML file, we configure a netty4 endpoint to listen for HL7 requests using TCP on port <code>8888</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <endpoint id="hl7NettyListener" uri="netty4:tcp://localhost:8888?sync=true&amp;encoder=#hl7encoder&amp;decoder=#hl7decoder"/> +]]></script> +</div></div><p><strong>sync=true</strong> indicates that this listener is synchronous and therefore will return a HL7 response to the caller. The HL7 codec is setup with <strong>encoder=#hl7encoder </strong>and<strong> decoder=#hl7decoder</strong>. Note that <code>hl7encoder</code> and <code>hl7decoder</code> are just bean IDs, so it could be named differently. The beans can be set in the Spring XML file:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <bean id="hl7decoder" class="org.apache.camel.component.hl7.HL7MLLPNettyDecoderFactory"/> +Â <bean id="hl7encoder" class="org.apache.camel.component.hl7.HL7MLLPNettyEncoderFactory"/>]]></script> +</div></div><p>The endpoint <strong>hl7listener</strong> can then be used in a route as a consumer, as this Java DSL example illustrates:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("hl7NettyListener").beanRef("patientLookupService"); +]]></script> </div></div><h3 id="HL7-HL7Modelusingjava.lang.Stringorbyte[]">HL7 Model using java.lang.String or byte[]</h3><p>The HL7 MLLP codec uses plain String as its data format. Camel uses its <a shape="rect" href="type-converter.html">Type Converter</a> to convert to/from strings to the HAPI HL7 model objects, but you can use the plain String objects if you prefer, for instance if you wish to parse the data yourself.</p><p>As of Camel 2.14.1 you can also let the codec use a plain <code>byte[]</code> as its data format. The Type Converter is also capable of converting the <code>byte[]</code> to/from HAPI HL7 model objects.</p><h3 id="HL7-HL7v2ModelusingHAPI">HL7v2 Model using HAPI</h3><p>The HL7v2 model uses Java objects from the HAPI library. Using this library, you can encode and decode from the EDI format (ER7) that is mostly used with HL7v2.</p><p>The sample below is a request to lookup a patient with the patient ID <code>0101701234</code>.</p><div class="code panel pdl" style ="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[MSH|^~\\&|MYSENDER|MYRECEIVER|MYAPPLICATION||200612211200||QRY^A19|1234|P|2.4 QRD|200612211200|R|I|GetPatient|||1^RD|0101701234|DEM||