Among applications that produce Result messages, there is considerable variation in the way that the individual report lines are structured. The following three methods are common:
1. Repeating OBX segments: where each OBX segment contains exactly one line of report text in the OBX-5 field.
OBX|1|FT|||FX OF LT FIBULA
OBX|2|FT
OBX|3|FT
OBX|4|FT|||Technique: Three views left ankle.
OBX|5|FT OBX|6|FT|||Findings: There is an oblique fracture of the lateral malleolus at the level
OBX|7|FT|||of the mortise. No other fractures are identified. The mortise is symmetric.
OBX|8|FT
OBX|9|FT|||Impression: Oblique fracture of the lateral malleolus at the level of the
OBX|10|FT|||mortise.
OBX|11|FT
OBX|12|FT
2. A single OBX segment with repeating OBX-5 fields: where each OBX-5 field contains exactly one line of report text
OBX|1|FT|||FX OF LT FIBULA~~~Technique: Three views left ankle.~~Findings: There is an oblique fracture of the lateral malleolus at the level~of the mortise. No other fractures are identified. The mortise is symmetric.~~Impression: Oblique fracture of the lateral malleolus at the level of the~mortise.~~
3. A single OBX segment and a single OBX-5 field: where a special character or series of characters act as the delimiter that separates individual report text lines.
OBX|1|FT|||FX OF LT FIBULA\.br\\.br\\.br\Technique: Three views left ankle. \.br\\.br\Findings: There is an oblique fracture of the lateral malleolus at the level\.br\of the mortise. No other fractures are identified. The mortise is symmetric. \.br\\.br\Impression: Oblique fracture of the lateral malleolus at the level of the\.br\mortise. \.br\\.br\
With the use of an integration engine, converting from any one of these message variations to another should be a relatively simple task.
Maintaining original report line breaks. In general, the application that produces the text of a report will structure the lines of the report in an appropriate fashion. The following report message excerpt illustrates how important the position of the original line breaks can be.
OBX|1|FT|||CONFUSION
OBX|2|FT
OBX|3|FT
OBX|4|FT|||RT CAROTID
OBX|5|FT|||ICA PSV: 92 cm/s
OBX|6|FT|||CCA PSV: 99 cm/s
OBX|7|FT|||ICA/CCA PSV RATIO: 0.9
OBX|8|FT|||ICA EDV: 34 cm/s
OBX|9|FT|||RT VERTEBRAL ARTERY FLOW: Antegrade
OBX|10|FT
OBX|11|FT
OBX|12|FT|||LT CAROTID
OBX|13|FT|||ICA PSV: 66 cm/s
OBX|14|FT|||CCA PSV: 88 cm/s
OBX|15|FT|||ICA/CCA PSV RATIO: 0.8
OBX|16|FT|||ICA EDV: 38 cm/s
OBX|17|FT|||LT VERTEBRAL ARTERY FLOW: Antegrade
OBX|18|FT
OBX|19|FT
OBX|20|FT
OBX|21|FT|||Right carotid: Color and spectral Doppler failed to show evidence of
OBX|22|FT|||significant focal measurable stenosis. There is antegrade right vertebral
OBX|23|FT|||artery flow.
OBX|24|FT
OBX|25|FT|||Left carotid: Scattered focal calcified plaque formation is present at the
OBX|26|FT|||left bifurcation. Color and spectral Doppler show mild turbulent flow in the
OBX|27|FT|||proximal left ICA. However, flow ratios and velocities remain within normal
OBX|28|FT|||limits. There is antegrade left vertebral artery flow.
OBX|29|FT
OBX|30|FT|||Impression:
OBX|31|FT|||1. Study fails to show evidence of high-grade focal stenosis either carotid.
OBX|32|FT|||2. Calcified plaque formation left bifurcation which produces a visually
OBX|33|FT|||estimated 50% diameter stenosis in the proximal left ICA. If asymptomatic for
OBX|34|FT|||left hemispheric symptoms, a follow-up carotid ultrasound is recommended in 1
OBX|35|FT|||year.
OBX|36|FT
OBX|37|FT
Special lines, such as the individual measurements with units in the initial sections and the numbered list items in the Impression section, would have severely compromised readability if the original line breaks of this report were not maintained. For this reason, when we are converting a report from one message format to another, we have very strong motivation to maintain the integrity of each line of the report as it was produced in the originating application. In general, this does not present a problem and, in fact, is the most straightforward way to perform the conversion.
Be aware of line length limits. If, however, the maximum number of characters per line in the original report may exceed the allowed character limit of a destination application, we are presented with a challenge. Even with powerful tools provided by an integration engine, the handling can become complex.
In the report above, the sections labeled “Right carotid”, “Left carotid” and “Impression” contain lines of text that may be up to 78 characters long. If a destination application with a report line character limit of 70 characters needs to receive this report, we need to modify the placement of the original line breaks.
A useful feature of an integration engine for this task is the ability to appropriately “wrap” the text of one line to the next line without splitting the text in the middle of a word. Unfortunately, we have more work to do than simply applying that feature to each line of the report. Our first problem is that if we are iterating through the lines of the report and simply inserting a new line when we encounter one that is over 70 characters, we will end up with report lines structured like this:
[…]
OBX|21|FT|||Right carotid: Color and spectral Doppler failed to show evidence of
OBX|22|FT|||significant focal measurable stenosis. There is antegrade right
OBX|23|FT|||vertebral
OBX|24|FT|||artery flow.
OBX|25|FT
OBX|26|FT|||Left carotid: Scattered focal calcified plaque formation is present
OBX|27|FT|||at the
OBX|28|FT|||left bifurcation. Color and spectral Doppler show mild turbulent
OBX|29|FT|||flow in the
OBX|30|FT|||proximal left ICA. However, flow ratios and velocities remain within
OBX|31|FT|||normal
OBX|32|FT|||limits. There is antegrade left vertebral artery flow.
[…]
This strategy maintained the original line breaks and simply added a new line break where a line over 70 characters was encountered.
Our strategy must be modified to use our word wrap feature on a block of report text that has been stripped of the original line breaks. You may recall, however, that for some special sections of the report, we must maintain the original line breaks to maintain its readability. Our strategy needs to be much more complex, such that it will apply appropriate handling to different sections of the report.
The result is that the conversion process must now begin to “pay attention” to the actual content of the report. While this can be done, it is an undesirable situation, mainly because the variation in the reports may be great enough that detecting the beginning and end of any given section is highly unreliable.
Using an integration engine that has robust message processing capabilities, this type of complex restructuring of the lines of a report is possible, but it can be a significant effort. The easiest solution to the problem, if it is possible, is to decrease the maximum line length of the application that is generating the reports to a length that all destination applications can handle.
For more information and to see the original PDF, click here.