User bio
404 bio not found
Member since Feb 17, 2023
Replies:

I did something similar by saving OBX segments in %Library.ListOfObjects 

%Library.ListOfObjects - InterSystems Supply Chain Orchestrator 2024.1 - including private class members
 

I would say:

  1. Create an empty OBX segment object
  2. Use iterator "i" to Iterate over all the OBXs in the source message OBX group while checking if OBX:5 contains "Total" string,
    1. If yes, save an index of this OBX in a list/array %ArrayOfDataTypes  = IndexList, and increase the iterator "i" by 1
    2. At the same time copy each OBX segment from a source message as a segment object in a list of objects, use %Library.ListOfObjects = ObjectsList at the index "i".
  3. When all OBXes are copied across,  then use InsertAt() to insert empty OBX segments into ObjectsList, where index matches the index fromIndexList. Keep in mind the index "i" shifted by one each time "Total" string was found
  4. Create an empty target message, copy PID, ORC, OBR segments across from the source message
  5. Iterate over %Library.ListOfObjects , extracting OBX segments and copying them to the new target messgae.

Let me know how it went. :)

Certifications & Credly badges:
Lukasz has no Certifications & Credly badges yet.
Global Masters badges:
Lukasz has no Global Masters badges yet.
Followers:
Lukasz has no followers yet.
Following:
Lukasz has not followed anybody yet.