Runtime error

Discussion of open issues, suggestions and bugs regarding to (known as Delphi HL7) HL7 Components
Post Reply
Joschim
Posts: 23
Joined: Wed Sep 17, 2014 7:22 am

Runtime error

Post 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 10740 times
What's happend?
Best regard
Joschim
admin
Site Admin
Posts: 256
Joined: Sun Jun 05, 2011 8:06 pm

Re: Runtime error

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest