Menu

#3 Problem with toString

open
nobody
7
2012-10-06
2012-10-06
vinceroi
No

Hi

I am trying to use the Perl HL7 toolkit to parse a HL7 message on a SPARC server (Solaris 10) with Perl 5.8.4 but I am getting the error described below.
Could you help me?

===> CODE
#!/usr/bin/perl -w

use strict;
use Net::HL7;
use Net::HL7::Segment;
use Net::HL7::Message;

# create object "Message"
my $str = qq(MSH|^~\\&|MEDICALVISIT|GH^101^General Hospital|MEDICALSOLUTION|DDC|20111231104448|0|SIU^S12|MPI-12927088|P|2.3|||||||\013);
$str .= qq(SCH|2011A10483931^3991^GH-VE-EPLAB^GH-Electrophysiology lab-Dr.V.Ectebag|||||""^""^""||7563^SD-EPS-AB^Same day patient- EPS Ablation|60||^^^201110310700|""^M. Thornton^""|||0^^^333&HOME&Home|||||SYSMAN|||0||\013);

my $msg = new Net::HL7::Message($str);

print $msg->toString(1);
print "\n";

===> ERROR:
Use of uninitialized value in concatenation (.) or string at /usr/perl5/site_perl/5.8.4/Net/HL7/Segment.pm line 177.
Use of uninitialized value in concatenation (.) or string at /usr/perl5/site_perl/5.8.4/Net/HL7/Segment.pm line 177.
Use of uninitialized value in concatenation (.) or string at /usr/perl5/site_perl/5.8.4/Net/HL7/Segment.pm line 177.
Use of uninitialized value in concatenation (.) or string at /usr/perl5/site_perl/5.8.4/Net/HL7/Segment.pm line 177.
Use of uninitialized value in concatenation (.) or string at /usr/perl5/site_perl/5.8.4/Net/HL7/Segment.pm line 177.
MSH|^~\&|MEDICALVISIT|GH^101^General Hospital|MEDICALSOLUTION|DDC|20111231104448||SIU^S12|MPI-012927088|P|2.3|
SCH|2011A10483931^3991^GH-VE-EPLAB^GH-Electrophysiology lab-Dr.V.Ectebag|||||""^""^""||7563^SD-EPS-AB^Same day patient- EPS Ablation|60||^^^201110310700|""^M. Thornton^""|||0^^^333&HOME&Home|||||SYSMAN||||

PROBLEMS:
1- For some reason the concatenation errors go away if I remove the last 8 hat character (^) in the SCH segment.
2- the result of function tostring() truncate the last 0

Thanks,
Vince

Discussion

  • vinceroi

    vinceroi - 2012-10-06
    • priority: 5 --> 7
     
  • vinceroi

    vinceroi - 2012-10-06
    • summary: Pb with toString --> Problem with toString
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.