Page 1 of 1

Runtime error

Posted: Wed Sep 17, 2014 1:30 pm
by Joschim
Hi all,
I have the following problem:
Components version 1.6.5.2 with Delphi 2009

My short function:

Code: Select all

var
  i: Integer;
  s: String;

  msg: TdiADT_A04_23;
begin
  msg := TdiADT_A04_23.Create;

  try
    [color=#FF0080]msg.AsString := 'MSH[/color]|^~\&|NES|NINTENDO|TESTSYSTEM|TESTFACILITY|20010101000000||ADT^A04|Q123456789T123456789X123456|P|2.3' + #13 +
                    'EVN|A04|20010101000000|||^KOOPA^BOWSER^^^^^^^CURRENT' + #13 +
                    'PID|1||123456789|0123456789^AA^^JP|BROS^MARIO||19850101000000|M|||123 FAKE STREET^MARIO \T\ LUIGI BROS PLACE^TOADSTOOL KINGDOM^NES^A1B2C3^JP^HOME^^1234|1234|(555)555-0123^HOME^JP:1234567|||S|MSH|12345678|||||||0|||||N' + #13 +
                    'NK1|1|PEACH^PRINCESS|SO|ANOTHER CASTLE^^TOADSTOOL KINGDOM^NES^^JP|(123)555-1234|(123)555-2345|NOK' + #13 +
                    'NK1|2|TOADSTOOL^PRINCESS|SO|YET ANOTHER CASTLE^^TOADSTOOL KINGDOM^NES^^JP|(123)555-3456|(123)555-4567|EMC' + #13 +
                    'PV1|1|O|ABCD^EFGH||||123456^DINO^YOSHI^^^^^^MSRM^CURRENT^^^NEIGHBOURHOOD DR NBR|^DOG^DUCKHUNT^^^^^^^CURRENT||CRD|||||||123456^DINO^YOSHI^^^^^^MSRM^CURRENT^^^NEIGHBOURHOOD DR NBR|AO|0123456789|1|||||||||||||||||||MSH||A|||20010101000000' + #13 +
                    'IN1|1|PAR^PARENT||||LUIGI' + #13 +
                    'IN1|2|FRI^FRIEND||||PRINCESS';

    s := csStart_Block + msg.AsString + csEnd_Block;
    for i := 0 to Server.Socket.ActiveConnections - 1 do begin
      Server.Socket.Connections[i].SendText(s);
    end;

  finally
    FreeAndNil(msg);
  end;
After the line "msg.AsString := 'MSH....." I see the following message:
DelphiHL7_AccessViolation.jpg
DelphiHL7_AccessViolation.jpg (20.02 KiB) Viewed 10738 times
What's happend?
Best regard
Joschim

Re: Runtime error

Posted: Wed Sep 17, 2014 4:45 pm
by admin
Hi,
In EVN segments 5.Field (OperatorID) is CN data type.
This type defined as :
1.IDNumber
2.FamilyName
2.GivenName
4.MiddleInitialOrName
5.Suffix
6.Prefix
7.Degree
8.SourceTable
9.AssigningAuthority

Your messages is component count is 10.,
^KOOPA^BOWSER^^^^^^^CURRENT

Best regards.