Invalid message and other bugs

Discussion of open issues, suggestions and bugs regarding to (known as Delphi HL7) HL7 Components
Post Reply
mariusz.stefaniak
Posts: 8
Joined: Sat May 11, 2013 10:30 pm
Contact:

Invalid message and other bugs

Post by mariusz.stefaniak »

Hello everyone...

I just bought your components (2.3.1) and in comparison to the version which I used as a trial 1.6.3, the newest one contain a very strange and basic bugs. I use delphi 7.

1. I can not SaveToFile. The folowing code does absolutely nothing

Code: Select all

var msg : TdiORM_O01_231;
begin
  msg := TdiORM_O01_231.Create;

  msh(msg);
  orc_zlec(msg);
  obr_zlec(msg);
  nte(msg);

  msg.SaveToFile('c:\1.hl7');
  msg.Free;
As a workaround I do

Code: Select all

StrLst.Text := msg.asString; 
StrLst.SaveToFile('c:\1.hl7');
it works, but...

2. Later on, your components claims that this message is invalid (Invalid message, must be start with 'MSH')
I have that c:\1.hl7 on my HDD and I try to get it with following code

Code: Select all

var t : TStringList;
    m : TdiMessageInfo;
    msg : TdiORM_O01_231;
begin
  if dlg_2.Execute then
  begin
    t := TStringList.create;
    t.LoadFromFile(dlg_2.FileName);
    m := GetMessageInfo(t.Text);


    if (m.MessageType ='ORM^O01') and (m.Version = '2.3.1') then
    begin
      msg := TdiORM_O01_231.Create;
      msg.LoadFromFile(dlg_2.FileName);
      ShowMessage('Sukces');
    end;
    t.Free;
  end;
Is there anything wrong with my code?

Here you have my c:\1.hl7 file

Code: Select all

MSH|^~\&|^Patomorfolog|^HIS|^ELAB|^HL7|20140803185020||ORM^O01|20140803185050|T|2.3.1|||AL|AL|POL|CP1250|PL
NTE||teścik
PID|1|75032107218^^^^PESEL|123456^PAT||Piekarz-Test^Marcin||19810612000000|M|||ul. Kracowa^^Tulce^^63-004||607288724
ORC|NW|6538^HIS|4567896500^ELAB|548^HIS|||^^^^^R||20111114091040|||589^Jaroszewicz^Boguslaw^^9716821^lek. med.^HIS|||||954^Poradnia chir.^HIS
OBR|1|6538^HIS||H^Badanie ogolne moczu^ELAB^MOCZ||||||654^Kowalska^Anna^^^piel.^HIS||||20111114091230|^^^^^^4567896502
NTE|1|P|Pacjent przyjmuje leki przeciwzakrzepowe
OBR|2|6539^CYT||C^Biopsja cienkoigłowa^ELAB^BAC||||||654^Kowalska^Anna^^^piel.^HIS||||20111114091230|^^^^^^4567896503
And at the end, one question... HL7 2.3 and above has as standard some escape replacements. For example... we should use \.br\ instead of new line character. I found that your component does not support it at all. Neither on write message, neither on read from a message. Do I miss something?

I'm looking forward hearing from you,
Mario
mariusz.stefaniak
Posts: 8
Joined: Sat May 11, 2013 10:30 pm
Contact:

Re: Invalid message and other bugs

Post by mariusz.stefaniak »

Anyone here? Does this forum works?
admin
Site Admin
Posts: 256
Joined: Sun Jun 05, 2011 8:06 pm

Re: Invalid message and other bugs

Post by admin »

Hi,

We are checking your code.
please pateint.
admin
Site Admin
Posts: 256
Joined: Sun Jun 05, 2011 8:06 pm

Re: Invalid message and other bugs

Post by admin »

Hi,
For resolve your problem, you can try this :

msg := TdiORM_O01_231.Create;
msg.AsString:=t.Text;// LoadFromFile(dlg_2.FileName);
ShowMessage('Sukces');

We need to more test with LoadFromFile, may be bug.

Thanks for contact.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest