Written by

Question Will · May 2, 2024

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
  6  * AL1
| ~ 2 | FA ~  · | ~ OFOOD ^ OTHER (FOOD) ^ EXTELG |  · | ~ Dermatitis
  7  * 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

Comments

Enrico Parisi · May 3, 2024

In all set actions remove k1 from the Key (last column in the screenshot) and put "" (not empty) instead (that's the default when you insert a set action).

Then try again.

0
Will  May 3, 2024 to Enrico Parisi

Thanks Enrico, it worked!

Do you know why the output AL1 segments have an asterisk at the front in the TEST TRANSFORMATION output message box?

Regards,

Wai

0
Enrico Parisi  May 4, 2024 to Will

I think it means that that particular segment has been modified

0