<< | Index | >>
When putting the order file onto the FTP-Server for Pickup we need to replace the GAG-Code with the new EAN-Code of the client.
Confirm the oder process
1. Login as an customer
2. Search a product
3. Select a product
4. Send the oder
5. Result
Console log
ftp.puttextfile(/tmp/bbmb.2783.0, /Spital/Temp/KD584674_1308035516.dat) ftp.rename(/Spital/Temp/KD584674_1308035516.dat, /Spital/In/KD584674_1308035516.dat)
Oder file
masa@masa ~/ftp_share/Spital/In $ ls -al insgesamt 4 drwxrwxr-x 2 masa ftp_group 8 14. Jun 09:11 . drwxr-xr-x 4 masa masa 24 1. Dez 2010 .. -rw------- 1 ftp_user ftp_group 256 14. Jun 09:11 KD584674_1308035516.dat masa@masa ~/ftp_share/Spital/In $ sudo cat KD584674_1308035516.dat Passwort: 001:7601001000681 002:ORDERX 003:220 010:KD584674_1308035516.dat 100:YWESEE 101: 201:CU 202:584674 201:BY 202:1075 231:Hatapharm AG 237:61 238:16 250:ADE 251:1308035516 300:4 301:20110614 500:1 501:7680317060176 502:26203 520:10 521:PCE 540:2 541:20110614
Consider
Experiment
def transmission_filename(user, order, flavor=BBMB::DEFAULT_FLAVOR)
case flavor
when 'astrazeneca'
"AZ#{user.value(:customer_id)}_#{order.uid}.dat1"
else
#"KD#{user.value(:customer_id)}_#{order.uid}.dat"
"KD#{user.value(:customer_ean13)}_#{order.uid}.dat"
end
end
def transmission_header(user, order)
header1 = [
"001:#{self::class::EPIN}",
"002:ORDERX",
"003:220",
"010:#{transmission_filename(user, order)}",
"100:YWESEE",
"101:#{order.reference}",
"201:CU",
#"202:#{user.value(:customer_id)}",
"202:#{user.value(:customer_ean13)}",
"201:BY",
"202:1075",
"231:#{user.value(:organisation)}",
]
Reboot
Run
masa@masa ~/ftp_share/YWESEE/Out $ cat ywskund 584674;584674;22;SD-Lie;;Hatapharm AG;;hoge hoge 11;;CH;8000;hogehoge;011 / 111 22 33;;;011 / 111 22 44;customer@ywesee.com;1234567890123;
masa@masa ~/ywesee/bbmb.ch $ bin/admin ch.bbmb.globopharm> update
Result
masa@masa ~/ftp_share/Spital/In $ ls -al insgesamt 4 drwxrwxr-x 2 masa ftp_group 8 14. Jun 10:14 . drwxr-xr-x 4 masa masa 24 1. Dez 2010 .. -rw------- 1 ftp_user ftp_group 270 14. Jun 10:14 KD1234567890123_1308039243.dat masa@masa ~/ftp_share/Spital/In $ sudo cat KD1234567890123_1308039243.dat 001:7601001000681 002:ORDERX 003:220 010:KD1234567890123_1308039243.dat 100:YWESEE 101: 201:CU 202:1234567890123 201:BY 202:1075 231:Hatapharm AG 237:61 238:16 250:ADE 251:1308039243 300:4 301:20110614 500:1 501:7680317060176 502:26203 520:10 521:PCE 540:2 541:20110614
Note
Next
def transmission_filename(user, order, flavor=BBMB::DEFAULT_FLAVOR) case flavor when 'astrazeneca' #"AZ#{user.value(:customer_id)}_#{order.uid}.dat1""AZ#{user.value(:customer_ean13) || user.value(:customer_id)}_#{order.uid}.dat1"
else #"KD#{user.value(:customer_id)}_#{order.uid}.dat""KD#{user.value(:customer_ean13) || user.value(:customer_id)}_#{order.uid}.dat"
end end
def transmission_header(user, order)
header1 = [
"001:#{self::class::EPIN}",
"002:ORDERX",
"003:220",
"010:#{transmission_filename(user, order)}",
"100:YWESEE",
"101:#{order.reference}",
"201:CU",
#"202:#{user.value(:customer_id)}",
"202:#{user.value(:customer_ean13) || user.value(:customer_id)}",
"201:BY",
"202:1075",
"231:#{user.value(:organisation)}",
]
Create a new kunde
masa@masa ~/ftp_share/YWESEE/Out $ cat ywskund 584674;584674;22;SD-Lie;;Hatapharm AG;;hoge hoge 11;;CH;8000;hogehoge;011 / 111 22 33;;;011 / 111 22 44;customer@ywesee.com;1234567890123
;584675
;584675;22;SD-Lie;;Hatakepharm AG;;hoge hoge 11;;CH;8000;hogehoge;011 / 111 22 33;;;011 / 111 22 44;customer2@ywesee.com;;
Run
Result
masa@masa ~/ftp_share/Spital/In $ sudo catKD584675
_1308040289.dat 001:7601001000681 002:ORDERX 003:220010:KD584675_1308040289.dat
100:YWESEE 101: 201:CU202:584675
201:BY 202:1075 231:Hatakepharm AG 237:61 250:ADE 251:1308040289 300:4 301:20110614 500:1 501:7680317060176 502:26203 520:1 521:PCE 540:2 541:20110614
Note
Run
masa@masa ~/ftp_share/Spital/In $ ls -al insgesamt 8 drwxrwxr-x 2 masa ftp_group 16 14. Jun 10:47 . drwxr-xr-x 4 masa masa 24 1. Dez 2010 .. -rw------- 1 ftp_user ftp_group 268 14. Jun 10:47 KD1234567890123_1308041255.dat -rw------- 1 ftp_user ftp_group 250 14. Jun 10:31 KD584675_1308040289.dat masa@masa ~/ftp_share/Spital/In $ sudo catKD1234567890123
_1308041255.dat 001:7601001000681 002:ORDERX 003:220010:KD1234567890123_1308041255.dat
100:YWESEE 101: 201:CU202:1234567890123
201:BY 202:1075 231:Hatapharm AG 237:61 238:1 250:ADE 251:1308041255 300:4 301:20110614 500:1 501:7680317060176 502:26203 520:1 521:PCE 540:2 541:20110614
Commit
Note
src/util/bbmbapp.rb#run_updater UPDATE_HOUR = 1 next_run = Time.local(today.year, today.month, today.day, UPDATE_HOUR)
How is the data transferred to bbmb.ch from globopharm.xmlconv.bbmb.ch (these are the XML orders)?
Check Process
module ODDB class SwissmedicPlugin < Plugin PREPARATIONS_COLUMNS = [ :iksnr, :seqnr, :name_base, :company, :index_therapeuticus, :atc_class, :production_science, :sequence_ikscat, :ikscat, :registration_date, :sequence_date, :expiry_date, :substances, :package_count, :package_sizes, :composition, :indication_registration, :indication_sequence ]