Search code examples
pentahokettlehl7

repeated segements HL7 in pentaho kettle


I want to know how can I use HL7 input (or what step can I use) to read all segments of a message HL7 even if the segement is repeated example:

DG1|1|I10C|G30.0|Alzheimer's disease with early onset|20160406|W|||||||||
DG1|2|I10C|E87.70|Fluid overload, unspecified|20160406|W|||||||||

because in my recent transformation i got just the second segment DG1 so the first one is lost as information. my steps to extract message hl7 :enter image description here


Solution

  • I just found a solution for inserting data from multiple segments to database in pentaho kettle 6.0, I used the USER DEFINED JAVA CLASS step, Hapi project classes and methodes (Pipeparser, xmlencode(Message)) to split the message and to convert it to xml output, then i loop (using Xpath on the specific segment, in my case the DG1 segments see attached) for every fields in HL7 message.