| 1 | #!/usr/local/bin/perl | ||
| 2 | |||
| 3 | BEGIN{push @INC, "./../blib/lib/"} | ||
| 4 | |||
| 5 | use Biblio::ILL::ISO::Returned; | ||
| 6 | |||
| 7 | # | ||
| 8 | # transaction-id | ||
| 9 | # | ||
| 10 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 11 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 12 | |||
| 13 | # | ||
| 14 | # service-date-time | ||
| 15 | # | ||
| 16 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 17 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 18 | ); | ||
| 19 | |||
| 20 | # | ||
| 21 | # requester-id | ||
| 22 | # | ||
| 23 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 24 | $reqid->set_person_name("David A. Christensen"); | ||
| 25 | |||
| 26 | # | ||
| 27 | # responder-id | ||
| 28 | # | ||
| 29 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 30 | |||
| 31 | # | ||
| 32 | # date-returned | ||
| 33 | # | ||
| 34 | my $dr = new Biblio::ILL::ISO::ISODate("20030814"); | ||
| 35 | |||
| 36 | # | ||
| 37 | # returned-via | ||
| 38 | # | ||
| 39 | my $rv = new Biblio::ILL::ISO::TransportationMode("Canada Post"); | ||
| 40 | |||
| 41 | # | ||
| 42 | # insured-for | ||
| 43 | # | ||
| 44 | my $ins = new Biblio::ILL::ISO::Amount("123.45"); | ||
| 45 | |||
| 46 | # | ||
| 47 | # requester-note | ||
| 48 | # | ||
| 49 | my $rn = new Biblio::ILL::ISO::ILLString("This is a requester-note."); | ||
| 50 | |||
| 51 | |||
| 52 | #------------------------------------------------------------------------------------------- | ||
| 53 | |||
| 54 | my $msg = new Biblio::ILL::ISO::Returned(); | ||
| 55 | |||
| 56 | # Minimum required: | ||
| 57 | $msg->set_protocol_version_num("version-2"); | ||
| 58 | $msg->set_transaction_id( $tid ); | ||
| 59 | $msg->set_service_date_time( $sdt ); | ||
| 60 | $msg->set_date_returned( $dr ); | ||
| 61 | |||
| 62 | # Extra, useful info: | ||
| 63 | $msg->set_requester_id( $reqid ); | ||
| 64 | $msg->set_requester_id( $resid ); | ||
| 65 | $msg->set_returned_via( $rv ); | ||
| 66 | $msg->set_insured_for( $ins ); | ||
| 67 | $msg->set_requester_note( $rn ); | ||
| 68 | |||
| 69 | # | ||
| 70 | #print "\n-as_pretty_string------------------------------------\n"; | ||
| 71 | #print $msg->as_pretty_string(); | ||
| 72 | #print "\n-----------------------------------------------------\n"; | ||
| 73 | # | ||
| 74 | #print "\n-debug(ans->as_asn())--------------------------------\n"; | ||
| 75 | #my $href = $msg->as_asn(); | ||
| 76 | #print $msg->debug($href); | ||
| 77 | #print "\n-----------------------------------------------------\n"; | ||
| 78 | # | ||
| 79 | #$msg->encode(); | ||
| 80 | # | ||
| 81 | |||
| 82 | #print "\n-write-----------------------------------------------\n"; | ||
| 83 | $msg->write("msg_10.returned.ber"); | ||
| 84 | #print "\n-----------------------------------------------------\n"; | ||
| 85 | |||
| 86 | #print "---end---\n"; | ||
| 87 |