Question
· May 2

help with HL7 Transformation

Hi, 

I'm new to IS and the HL7 transformations using the DTL.  I need some clarification on the foreach action.

I want to iterate over IN1 segments, and output only segments that contain certain allergy types in IN1-2 with foreach.  Inside the foreach block, I check for allergy type "FA" in IN1-2 and, if found, send the segment with only the required fields (fields #1, #2, #3, and #5 to be exact).  Please see the foreach block below:

 

I'm puzzled how come I'm getting field repetitions in the fields I populate within the foreach block  Here are the AL1 segments in the source message

AL1|1|DA~FA|NOCHOC^CHOCOLATE FLAVOR^FOODELG|Low|Itching|20220126|||Allergy
AL1|2|FA|OFOOD^OTHER (FOOD)^EXTELG|Low|Dermatitis|20220316
AL1|3|EA~DA|NOBANA^OTHER^EX|Hi|Dermatitis|20230316
AL1|4|EA~FA|NOBANA^OTHER^EX|Hi|Dermatitis|20240316

and here are the AL1 segments in the target message

  * AL1
| 1 | FA | NOCHOC ^ CHOCOLATE FLAVOR ^ FOODELG |  · | Itching
  * AL1
| ~ 2 | FA ~  · | ~ OFOOD ^ OTHER (FOOD) ^ EXTELG |  · | ~ Dermatitis
  * AL1
| ~ ~ ~ 4 | FA ~ ~ ~  · | ~ ~ ~ NOBANA ^ OTHER ^ EX |  · | ~ ~ ~ Dermatitis

I do not expect to have repeated field values in field #1, #2, #3 and #5, and it is strange that the number of field repetitions increasing progressively. 

Wai

Product version: IRIS 2023.1
$ZV: 2023.1.3 IRIS for unix
Discussion (3)2
Log in or sign up to continue