My guess would be the position of the ITERATE variable in the address path of the COPY(s) does not match the position specified in the basis for the repetition.
So the ITERATE does walk over the repetitions but the COPY(s) point to only the first repetition.
I would need more information to be more help.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
As procedure B doesn’t have an observation, the translation will not find the observation and totally skip the COPY statement as there is no input. So in the second iteration the observation is not touched and the output remains ” Some Observation”.
Try putting a
Code:
COPY @null -> order_element.newobservation.#text
before you fill newobservation with the value. This should help.
Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands
XML translating is different from HL7 translations and I have seen this behaviour in our translations before.
You will get a @null result if the inbound XML is
Code:
1
Procedure A
Some Observation
Procedure B
or even
Code:
1
Procedure A
Some Observation
Procedure B
But if the ‘tag’ is not there, the Xlate COPY will not be performed. I guess because the field is not there, the translation can’t even perform the COPY.
Can’t test it quickly right now though.
Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands