This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit c90be5b383748de91d4431bcc67283632ed2b1c9 Author: Otavio Rodolfo Piske <[email protected]> AuthorDate: Tue Feb 20 18:15:40 2024 +0100 CAMEL-20410: documentation fixes for camel-hl7 - Fixed samples - Fixed grammar and typos - Fixed punctuation - Added and/or fixed links - Converted to use tabs --- .../camel-hl7/src/main/docs/hl7-dataformat.adoc | 24 +++++++++++----------- .../src/main/docs/hl7terser-language.adoc | 15 +++++++------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/components/camel-hl7/src/main/docs/hl7-dataformat.adoc b/components/camel-hl7/src/main/docs/hl7-dataformat.adoc index e737d1e4658..c7b951c938d 100644 --- a/components/camel-hl7/src/main/docs/hl7-dataformat.adoc +++ b/components/camel-hl7/src/main/docs/hl7-dataformat.adoc @@ -37,9 +37,9 @@ for this component: == HL7 MLLP protocol -HL7 is often used with the HL7 MLLP protocol, which is a text based TCP +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 Netty Codec -that conforms to the MLLP protocol so you can easily expose an HL7 +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 xref:ROOT:mina-component.adoc[camel-mina] or xref:ROOT:netty-component.adoc[camel-netty] component is used with the @@ -84,7 +84,7 @@ requests using TCP on port `8888`: ---- *sync=true* indicates that this listener is synchronous and therefore -will return a HL7 response to the caller. The HL7 codec is setup with +will return a HL7 response to the caller. The HL7 codec is set up with *codec=#hl7codec*. Note that `hl7codec` is just a Spring bean ID, so it could be named `mygreatcodecforhl7` or whatever. The codec is also set up in the Spring XML file: @@ -105,7 +105,7 @@ from("hl7MinaListener") .bean("patientLookupService"); ---- -This is a very simple route that will listen for HL7 and route it to a +This is a basic route that will listen for HL7 and route it to a service named *patientLookupService*. This is also Spring bean ID, configured in the Spring XML as: @@ -145,7 +145,7 @@ requests using TCP on port `8888`: ---- *sync=true* indicates that this listener is synchronous and therefore -will return a HL7 response to the caller. The HL7 codec is setup with +will return a HL7 response to the caller. The HL7 codec is set up with *encoders=#hl7encoder*and*decoders=#hl7decoder*. Note that `hl7encoder` and `hl7decoder` are just bean IDs, so they could be named differently. The beans can be set in the Spring XML file: @@ -170,7 +170,7 @@ from("hl7NettyListener") The HL7 MLLP codec uses plain String as its data format. Camel uses its Type Converter 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. +you prefer, for instance, if you wish to parse the data yourself. You can also let both the Mina and Netty codecs use a plain `byte[]` as its data format by setting the `produceString` @@ -183,7 +183,7 @@ 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. -The sample below is a request to lookup a patient with the patient ID +The sample below is a request to look up a patient with the patient ID `0101701234`. [source,text] @@ -192,8 +192,8 @@ MSH|^~\\&|MYSENDER|MYRECEIVER|MYAPPLICATION||200612211200||QRY^A19|1234|P|2.4 QRD|200612211200|R|I|GetPatient|||1^RD|0101701234|DEM|| ---- -Using the HL7 model you can work with a `ca.uhn.hl7v2.model.Message` -object, e.g. to retrieve a patient ID: +Using the HL7 model, you can work with a `ca.uhn.hl7v2.model.Message` +object, e.g., to retrieve a patient ID: [source,java] ---- @@ -268,7 +268,7 @@ separators anymore by converting `\n` to `\r`. If you + === Charset Both `marshal and unmarshal` evaluate the charset -provided in the field `MSH-18`. If this field is empty, by default the +provided in the field `MSH-18`. If this field is empty, by default, the charset contained in the corresponding Camel charset property/header is assumed. You can even change this default behavior by overriding the `guessCharsetName` method when inheriting from the `HL7DataFormat` @@ -334,7 +334,7 @@ value is missing, its value is `null`. == Dependencies -To use HL7 in your Camel routes you'll need to add a dependency on +To use HL7 in your Camel routes, you'll need to add a dependency on *camel-hl7* listed above, which implements this data format. The HAPI library is split into a @@ -362,7 +362,7 @@ By default `camel-hl7` only references the HAPI https://repo1.maven.org/maven2/ca/uhn/hapi/hapi-base[base library]. Applications are responsible for including structure libraries themselves. For example, if an application works with HL7v2 message -versions 2.4 and 2.5 then the following dependencies must be added: +versions 2.4 and 2.5, then the following dependencies must be added: [source,xml] ---- diff --git a/components/camel-hl7/src/main/docs/hl7terser-language.adoc b/components/camel-hl7/src/main/docs/hl7terser-language.adoc index 2d8639cc54c..c835d2456f6 100644 --- a/components/camel-hl7/src/main/docs/hl7terser-language.adoc +++ b/components/camel-hl7/src/main/docs/hl7terser-language.adoc @@ -14,9 +14,10 @@ https://hapifhir.github.io/hapi-hl7v2/[HAPI] provides a https://hapifhir.github.io/hapi-hl7v2/base/apidocs/ca/uhn/hl7v2/util/Terser.html[Terser] class that provides access to fields using a commonly used terse -location specification syntax. The HL7 Terser language allows to use this +location specification syntax. +The HL7 Terser language allows using this syntax to extract values from HL7 messages and to use them as expressions -and predicates for filtering, content-based routing etc. +and predicates for filtering, content-based routing, etc. == HL7 Terser Language options @@ -27,7 +28,7 @@ include::partial$language-options.adoc[] == Example -In the example below we want to set a header with the patent id +In the example below, we want to set a header with the patent id from field QRD-8 in the QRY_A19 message: [source,java] @@ -62,7 +63,7 @@ import ca.uhn.hl7v2.validation.impl.DefaultValidation; // Use standard or define your own validation rules ValidationContext defaultContext = new DefaultValidation(); -// Throws PredicateValidationException if message does not validate +// Throws PredicateValidationException if a message does not validate from("direct:test1") .validate(messageConformsTo(defaultContext)) .to("mock:test1"); @@ -87,7 +88,7 @@ import static org.apache.camel.component.hl7.HL7.messageConforms; HapiContext hapiContext = new DefaultHapiContext(); hapiContext.getParserConfiguration().setValidating(false); // don't validate during parsing -// customize HapiContext some more ... e.g. enforce that PID-8 in ADT_A01 messages of version 2.4 is not empty +// customize HapiContext some more ... e.g., enforce that PID-8 in ADT_A01 messages of version 2.4 is not empty ValidationRuleBuilder builder = new ValidationRuleBuilder() { @Override protected void configure() { @@ -111,7 +112,7 @@ from("direct:test1") == HL7 Acknowledgement expression A common task in HL7v2 processing is to generate an acknowledgement -message as response to an incoming HL7v2 message, e.g. based on a +message as a response to an incoming HL7v2 message, e.g., based on a validation result. The `ack` expression lets us accomplish this very elegantly: @@ -138,7 +139,7 @@ from("direct:test1") === Custom Acknowledgement for MLLP -In special situations you may want to set a custom acknowledgement without using Exceptions. +In special situations, you may want to set a custom acknowledgement without using Exceptions. This can be achieved using the `ack` expression: [source,java]
