Fixup NCIP::ILS::make_header.
authorJason Stephenson <jason@sigio.com>
Thu, 7 Aug 2014 11:42:24 +0000 (07:42 -0400)
committerJason Stephenson <jason@sigio.com>
Thu, 7 Aug 2014 11:44:09 +0000 (07:44 -0400)
Change it to take the whole NCIP request as its argument.

Signed-off-by: Jason Stephenson <jason@sigio.com>
lib/NCIP/ILS.pm

index 34f8f91..581b009 100644 (file)
@@ -50,6 +50,8 @@ sub requestitem {
 
 # Other methods, just because.
 
+# Handle a LookupVersion Request.  You probably want to just call this
+# one from your subclasses rather than reimplement it.
 sub lookupversion {
 }
 
@@ -62,10 +64,18 @@ sub lookupversion {
 # NCIP::Header.
 sub make_header {
     my $self = shift;
-    my $initheader = shfit;
+    my $request = shift;
 
+    my $initheader;
     my $header;
 
+    for my $key (keys %$request) {
+        if ($request->{$key}->{InitiationHeader}) {
+            $initheader = $request->{$key}->{InitiationHeader};
+            last;
+        }
+    }
+
     if ($initheader && $initheader->{FromAgencyId}
             && $initheader->{ToAgencyId}) {
         $header = NCIP::Header->new(