Page 1 of 1

Reading multiple OBX segments

Posted: Mon Jul 16, 2012 7:39 am
by hj.frei
Hi,
I'm currently evaluating Delphi7 and encountered following "Problem":
How can I read the two OBX segments? I'm using Delphi6...

Below the simple example which I used:

Code: Select all

MSH|^~\&|TEST|TEST|EMR|Hospital|20120715172422||ADT^A01|MSG00001|P|2.4||||||WINDOWS-1252
EVN|A01|20110813155112
PID|||24313||Frei^Hans||19690609172545|M||2106-3||||||||||||H
PV1||O|||||||||||||||||v89283982
OBX|1||^BODY_WEIGHT||78|kg|||||O
OBX|2||^BODY_HEIGHT||1.88|m|||||O

Re: Reading multiple OBX segments

Posted: Mon Jul 16, 2012 8:37 pm
by admin
Hi,

Code: Select all

uses diHL724, diHL7DT24, diHL7Grp24;

procedure TForm1.bAdtA01Click(Sender: TObject);
var
    msg : TdiADT_A01_24;
    msgstr: string;
begin
    msg := TdiADT_A01_24.Create;
    msgstr:='MSH|^~\&|TEST|TEST|EMR|Hospital|20120715172422||ADT^A01|MSG00001|P|2.4||||||WINDOWS-1252'+#13+
    'EVN|A01|20110813155112'+#13+
    'PID|||24313||Frei^Hans||19690609172545|M||2106-3||||||||||||H'+#13+
    'PV1||O|||||||||||||||||v89283982'+#13+
    'OBX|1||^BODY_WEIGHT||78|kg|||||O'+#13+
    'OBX|2||^BODY_HEIGHT||1.88|m|||||O'+#13;

    msg.AsString:=msgstr;
    //Read first OBX's SetIDOBX field.
    ShowMessage(msg.OBX[0].SetIDOBX.AsString);

    FreeAndNil(msg);

end;
Best regards.

Re: Reading multiple OBX segments

Posted: Tue Jul 17, 2012 11:34 am
by hj.frei
Hi,
thanks. I actually had somewhere a TrimTrail which causes the problem.
Is it also possible to read the total number of OBX segments?

thanks

Re: Reading multiple OBX segments

Posted: Tue Jul 17, 2012 5:16 pm
by admin
Hi,

Thanks for your feedback.

Please download setup again and you can see OBXRepCount function.
I actually had somewhere a TrimTrail which causes the problem.
You can explain more clearly?
We would like to solve the problem.
Please write to us.

Best regards.