Question
· 16 hr ago

Issue with Data Transformation: OML^O21 to ORM^O01

Hi All,

I am trying to build a very basic data transformation to convert messages from OML^O21 to ORM^O01. However, I'm unable to loop through multiple ORC segments.When I use the source document type 2.5: OML_O21, I am not able to loop through multiple lines of the ORC segment.Interestingly, if I use the source document type 2.3: ORM_O01, I am able to loop through multiple ORC segments successfully.I am currently using the following data transformation logic:

Product version: IRIS 2023.1
$ZV: IRIS for Windows (x86-64) 2023.1 (Build 229U) Fri Apr 14 2023 17:17:41 EDT [HealthConnect:5.1.0]
Discussion (5)2
Log in or sign up to continue

Without seeing the source message, it will be difficult to provide a definitive answer. My guess would be that there are segments in the message that would normally appear in an OBRgrp (or sub-group) but no OBR segment is present.

Also ... your screenshot indicates that the target message type/trigger event is being set to OML^O21, not ORM^O01. This differs from the description.

Thanks for pointing that out, I have fixed it and re uploaded the screenshot. Also I have pasted below a sample source  message that I have been testing with, this is a sample message, all the values in the message are fake  -


MSH|^~\&|EMR|Main Hospital|LIS|Hospital Lab|20250609140000||OML^O21^OML_O21|MSG12345|P|2.5|||||||
PID|1||123456789^^^Hospital^MR||Doe^John^A||19800515|M|||123 Main St^^Anytown^ST^12345^USA||(555)123-4567||S||12345678|123-45-6789|||||||||||
PV1|1|I|ICU^101^A|E|||12345^Smith^Jane^M^MD^|12345^Smith^Jane^M^MD^||||19|||12345^Smith^Jane^M^MD^|INP|12345||||||||||||||||||||20250609120000|||||||
ORC|NW|ORD12345|ORD12345||SC||^^^20250609140000^^R|20250609140000|||12345^Johnson^Mary^L^MD^|||||20250609140000|Hospital Lab|123 Lab St^^Anytown^ST^12345^USA|(555)555-1234|
OBR|1|ORD12345||CBC^Complete Blood Count^L|||20250609140000|||||||A|12345^Johnson^Mary^L^MD^|(555)555-1234||||||||||||||||20250609140000|
NTE|1|L|Patient has history of anemia. Please check CBC.|
ORC|NW|ORD12346|ORD12346||SC||^^^20250609140500^^R|20250609140500|||12345^Johnson^Mary^L^MD^|||||20250609140500|Hospital Lab|123 Lab St^^Anytown^ST^12345^USA|(555)555-1234|
OBR|1|ORD12346||CMP^Comprehensive Metabolic Panel^L|||20250609140500|||||||A|12345^Johnson^Mary^L^MD^|(555)555-1234||||||||||||||||20250609140500|
NTE|1|L|Patient on diuretics - monitor electrolytes.|
ORC|NW|ORD12347|ORD12347||SC||^^^20250609141000^^R|20250609141000|||12345^Johnson^Mary^L^MD^|||||20250609141000|Hospital Lab|123 Lab St^^Anytown^ST^12345^USA|(555)555-1234|
OBR|1|ORD12347||LIPID^Lipid Panel^L|||20250609141000|||||||A|12345^Johnson^Mary^L^MD^|(555)555-1234||||||||||||||||20250609141000|
NTE|1|L|Fasting sample required. Patient NPO since midnight.|
ORC|NW|ORD12348|ORD12348||SC||^^^20250609141500^^R|20250609141500|||67890^Williams^Robert^K^MD^|||||20250609141500|Hospital Lab|123 Lab St^^Anytown^ST^12345^USA|(555)555-1234|
OBR|1|ORD12348||UA^Urinalysis^L|||20250609141500|||||||A|67890^Williams^Robert^K^MD^|(555)555-1234||||||||||||||||20250609141500|
NTE|1|L|Clean catch midstream specimen.|
ORC|NW|ORD12349|ORD12349||SC||^^^20250609142000^^S|20250609142000|||12345^Johnson^Mary^L^MD^|||||20250609142000|Hospital Lab|123 Lab St^^Anytown^ST^12345^USA|(555)555-1234|
OBR|1|ORD12349||PT^Prothrombin Time^L|||20250609142000|||||||S|12345^Johnson^Mary^L^MD^|(555)555-1234||||||||||||||||20250609142000|
NTE|1|L|Patient on warfarin therapy. STAT order for bleeding.| 

When I run the message through Interoperability | Interoperate | HL7 v2.x | HL7 v2.x Message Viewer with the following options:

I get the following errors:

Segments required by the HL7 2.5 OML_O21 specification are not present and the message is failing to parse after the first ORC. You can create a custom Doc Category and DocType Structure to eliminate the required segment(s) and associate it with the OML_O21 message type (alternately, you can just assign the ORM_O01 Structure to the OML_O21 message type).

Then use that custom Doc Category as the Message Schema Category in the inbound service and Doc Category/Doc Type in your DTL.

Hi Jeffery,

Thanks for the insight.

I tired testing by filling in the required fields in the test message.

The main issue still remains which is it is unable to loop over ORC segments. It looks like there's a nested PIDgrpgrp() under ORCgrp().OBRgrp() that contains a subordinate ORCgrp(). For some reason, the system is unable to loop over the ORC group in this structure. Interestingly, when I removed the OBR(), from the message structure the system was able to successfully loop over multiple ORC segments. Also, if I remove this optional PIDgrpgrp() from the message specification, the issue appears to be resolved.

I’m not sure why that nested structure exists. Is it standard for HL7 OML^O21? If it is, Intersystems should ideally provide a clearer error message to help us troubleshoot this more effectively.