| 1 | #!/usr/local/bin/perl | ||
| 2 | |||
| 3 | BEGIN{push @INC, "./../blib/lib/"} | ||
| 4 | |||
| 5 | use Biblio::ILL::ISO::StatusOrErrorReport; | ||
| 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 | # status-report | ||
| 33 | # | ||
| 34 | my $cs = new Biblio::ILL::ISO::CurrentState("sHIPPED"); | ||
| 35 | my $hr = new Biblio::ILL::ISO::HistoryReport("20030811", | ||
| 36 | "fORWARD", | ||
| 37 | "20030813", | ||
| 38 | new Biblio::ILL::ISO::SystemId("MBOM"), | ||
| 39 | "20030815", | ||
| 40 | "Anne Author", | ||
| 41 | "A Title", | ||
| 42 | "", | ||
| 43 | "", | ||
| 44 | "loan", | ||
| 45 | new Biblio::ILL::ISO::TransactionResults("will-supply"), | ||
| 46 | "This is a history report." | ||
| 47 | ); | ||
| 48 | my $sr = new Biblio::ILL::ISO::StatusReport($hr, $cs); | ||
| 49 | |||
| 50 | |||
| 51 | # | ||
| 52 | # note | ||
| 53 | # | ||
| 54 | my $note = new Biblio::ILL::ISO::ILLString("This is a note."); | ||
| 55 | |||
| 56 | |||
| 57 | |||
| 58 | #------------------------------------------------------------------------------------------- | ||
| 59 | |||
| 60 | my $msg = new Biblio::ILL::ISO::StatusOrErrorReport(); | ||
| 61 | |||
| 62 | # Minimum required: | ||
| 63 | $msg->set_protocol_version_num("version-2"); | ||
| 64 | $msg->set_transaction_id( $tid ); | ||
| 65 | $msg->set_service_date_time( $sdt ); | ||
| 66 | $msg->set_status_report( $sr ); | ||
| 67 | |||
| 68 | # Extra, useful info: | ||
| 69 | $msg->set_requester_id( $reqid ); | ||
| 70 | $msg->set_responder_id( $resid ); | ||
| 71 | $msg->set_note( $note ); | ||
| 72 | |||
| 73 | # | ||
| 74 | #print "\n-as_pretty_string------------------------------------\n"; | ||
| 75 | #print $msg->as_pretty_string(); | ||
| 76 | #print "\n-----------------------------------------------------\n"; | ||
| 77 | # | ||
| 78 | #print "\n-debug(ans->as_asn())--------------------------------\n"; | ||
| 79 | #my $href = $msg->as_asn(); | ||
| 80 | #print $msg->debug($href); | ||
| 81 | #print "\n-----------------------------------------------------\n"; | ||
| 82 | # | ||
| 83 | #$msg->encode(); | ||
| 84 | # | ||
| 85 | |||
| 86 | #print "\n-write-----------------------------------------------\n"; | ||
| 87 | $msg->write("msg_19.status-or-error-report.ber"); | ||
| 88 | #print "\n-----------------------------------------------------\n"; | ||
| 89 | |||
| 90 | #print "---end---\n"; | ||
| 91 |