In DTL how to send a ROL segment in the target A08 message that contains no ROL segment in the source
Our target system requires a blank ROL segment whenever the ROL segment does not exist in an A08 from our source system. I'm not sure if this can be done with the DTL gui tools or if some sql or other code is required (coding is not in my wheelhouse). Here is what I've tried, but this does not yield the "ROL|1|" I'd like to create. Any help would be greatly appreciated.
Here is the input message that I'd like to add the ROL segment to:
MSH|^~\&|EPIC|MWH|||20250103094903||ADT^A08|175519|T|2.3
EVN|A08|20250103094903||REG_VIS_CHANGE|100503^MICHAEL^JENNIFER^J^^^^^MWHC^^^^^MWH
PID|||22600117^^^EPI^MR||VTEONE^ALLDATA^^^^^D||19450509|M|||||||||ISLAM|2001022272
PV1|1|I|MORT^5067^W^MWH|UR|||006742^SZLYK^GREGORY^R^^^^^PROVID^^^^PROVID|||General Med||||Hospital|||006742^SZLYK^GREGORY^R^^^^^PROVID^^^^PROVID||1001001073631|||||||||||||||||||||||||20180509144724
PV2|||||||||||||||||||||n|N||||||||||||||||||Acute
This is the Output result of the TEST TRANSFORM
I'd like to see the following after PV2 segment:
ROL|1|
Since there are no ROL segments in the source message, your foreach never executes.
Just check for the existence of the ROL segment in the source, and if it doesn't exist, populate any field in a ROL segment in the target:
I'm just returning from being out of office for 2 weeks. At first glance, this looks like it will work. Will try it and provide further feedback. Thank you kindly!
Create fake ROL|1| first and send ROL. If ROL in source it will override the fake one.
See following
Thank you for feedback. Ultimately, this is what I came up with and tested that worked.