How to splice a segment with a DTL? (in a BPL)
Hi,
I want to splice a PID segement returned from a query, so I can use it in a DTL:
I need to set the value of 'context.pidSegment' to something I can use in the DTL objectscript expression
but I'm not sure what method (or property) to use to get the class EnsLib.HL7.Segment segment into a datatype that can be used in the DTL?
I've tried the following to no avail;
- context.K21response.GetSegmentAt("PIDgrp.PID")
- context.K21response.FindSegment("PIDgrp.PID")
- context.K21response.GetSegmentAt("PIDgrp.PID").RawContent
- context.K21response.FindSegment("PIDgrp.PID").RawContent
(using <assign> to set context.pidSegment)
What method should I use?
Kind regards,
Stephen
Suriya at WRC solved this for me
Where I went wrong:
The right way to copy a segment from one message to another is;
Thanks go to Suriya at WRC
Stephen