Page 1 of 1

Error creating QPD-3 with terser

Posted: Tue Feb 11, 2014 1:10 pm
by critex
I want to create a HL7 2.5 / QBP_Q21 message with event trigger Q22

msg := TdiQBP_Q21_25.create;
msg.Terser('/MSH-3-1').AsString := '111';
msg.Terser('/MSH-4-1').AsString := '111';
msg.Terser('/MSH-5-1').AsString := '222';
msg.Terser('/MSH-6-1').AsString := '222';
msg.Terser('/MSH-9-1').AsString := 'QBP';
msg.Terser('/MSH-9-2').AsString := 'Q22';
msg.Terser('/MSH-9-3').AsString := 'QBP_Q21';
msg.Terser('/MSH-10-1').AsString := '333';
msg.Terser('/MSH-17-1').AsString := 'GBR';
msg.Terser('/MSH-19-1').AsString := 'EN';

msg.Terser('/QPD-1').AsString := 'IHE PDQ Query';
msg.Terser('/QPD-2').AsString := 'PatientQuery';
msg.Terser('/QPD-3').AsString := '@PID.5.1^test~@PID.5.2^adam~@PID.7^19660101'; // -> Access violation at ....

even if I just assign QPD-1 and QPD-2 with terser and manually try to add
msg.asString := msg.AsString + '|'+'@PID.5.1^test~@PID.5.2^adam~@PID.7^19660101' // -> Error: Segment unknown

-> how can I do that? ... who can help me?

Re: Error creating QPD-3 with terser

Posted: Fri Feb 14, 2014 4:53 pm
by admin
Hi,

msg.QPD.UserParameters field is variable field

try this :
msg := TdiQBP_Q21_25.create;
msg.Terser('/MSH-3-1').AsString := '111';
msg.Terser('/MSH-4-1').AsString := '111';
msg.Terser('/MSH-5-1').AsString := '222';
msg.Terser('/MSH-6-1').AsString := '222';
msg.Terser('/MSH-9-1').AsString := 'QBP';
msg.Terser('/MSH-9-2').AsString := 'Q22';
msg.Terser('/MSH-9-3').AsString := 'QBP_Q21';
msg.Terser('/MSH-10-1').AsString := '333';
msg.Terser('/MSH-17-1').AsString := 'GBR';
msg.Terser('/MSH-19-1').AsString := 'EN';

msg.Terser('/QPD-1-1').AsString := 'IHE PDQ Query';
msg.Terser('/QPD-2').AsString := 'PatientQuery';
msg.QPD.UserParameters:=TdiST_25.Create;
TdiST_25(msg.QPD.UserParameters).Value:= '@PID.5.1^test~@PID.5.2^adam~@PID.7^19660101';

Re: Error creating QPD-3 with terser

Posted: Thu Feb 20, 2014 1:03 pm
by critex
hi Admin,
thx ... it works after some small changes: TdiST_25 is not populated but TdiString

Why don't you do this internally in case of Terser('/QPD-3') ?
And I think there are even more cases where terser can not be used - although it's a wonderfull funtion.

Re: Error creating QPD-3 with terser

Posted: Thu Feb 20, 2014 1:45 pm
by admin
Hi,

Thanks for feedback.
Your request has been taken to the to-do list.

www.delphihl7.com