Updating Inventory Quantities Using A File

Rx-Universe support updates of inventory quantities using a file.  This would typically be used when a lab has a third-party system which tracks inventory levels, and wants to update Rx-Universe's inventory quantities.

All inventory quantity updates using a file are done using the OPC of the lens, so the third-party system must support OPCs for lenses.

Prerequisites for this function are that Rx-Universe must have the Rx-Inventory and Rx-Connect modules installed.

To update inventory quantities, the third-party system must create a file and place that file into the folder used for electronic jobs.  While this is usually OMICSTX, under the base Rx-Universe folder, it can be changed on the "Remote Order Parameters" screen:

The file created must have an extension of ".QTY", but the basename can be anything.  Since Rx-Universe will archive any quantity files submitted (in the ARCHIVE folder), it is suggested that the basename could be based on the date and time of the update.  For example, an inventory update on November 20, 2014, at 2pm, might be named 201411201400.QTY.  That makes tracking history of quantity updates much easier.

When a third-party system sends quantities, it should sent the quantity available to be used for the product.  Rx-Universe tracks all inventory in the lab, divided into 3 categories:

  • Total quantity of lenses - the total number of lenses in the lab, whether on the shelf or in production
  • Quantity allocated - the number of lenses allocated for jobs, but not yet physically removed from the shelf and placed in the tray
  • Quantity in process - the number of lenses actually in trays and therefore in production in the lab

The quantity available for a lens is the total number less the quantity allocated, less the quantity in process. 

Any inventory updates applied to Rx-Universe inventory items using a file are tracked as an inventory transaction, just as if they had been entered manually.


Record format:

OPC=Qty;[Type]

OPC – is the 10-digit OPC number of the lens blank
Qty – is an integer value, the number of lenses for this OPC code
Type – an optional field, is “A” for adjustment, a missing value or any other value is interpreted as a quantity update.

A type “A” record will cause the inventory in Rx-Universe to be “adjusted” by the quantity given.  So, if a stock order is entered in third-party software, for example, which sells 20 of OPC 2345678901, a file could be sent to Rx-Universe containing:
2345678901=-20;A

This would tell Rx-Universe to adjust the quantity on the shelf for OPC 2345678901 by -20 (removing 20 lenses from the inventory). This allows a third-party system to update Rx-Universe for large transactions without having to calculate total quantity, and without concern that the quantities might get out of sync due to timing of relieving inventory in the two systems.

 

Error File:

After processing, if there were any errors (OPC codes not found in Rx-Universe, or inventory products not activated), a file will be created in the ERRORS folder, with the same basename as the quantity file, and an extension of .ERR.

For example, if file 201411201400.QTY is submitted to the OMICSTX folder, an error file OMICSTX\ERRORS\201411201400.ERR will be created indicating any errors that occurred.

 

Example 1:

File containing a complete inventory update for all lenses, using date and time as the base filename:

File 201411191221.QTY – placed into the OMICSTX folder.

Contents:
0100780295=11.0                                               167 Easy 1-base 75-add right eye only
0100780287=10                                                  167 Easy 1-base 75-add left eye only
     . . .
0202773586=26.0                                               CR39 Silor SV 725-base – one record, since sample OPC L/R

Note that there is no “type” flag, so quantities will REPLACE quantities in Rx-Universe.

The 167 Easy has two records, one for each eye – quantities are given in lenses (not pairs).
The CR39 SV lens has only one record, since this is not a L/R type of lens.  Again, the quantity is given in lenses, not pairs.


Example 2:

File containing just one product (0202773586) sold 15 lenses on a stock order in DiSoft – DiSoft wants to decrement the inventory in Rx-Universe for the stock order just made (not replacing the quantities).  The filename is generated as a sequential number (has no specific meaning):

File 100002.QTY placed into the OMICSTX folder

Contents:
0202773586=-15.0;A

The inventory in Rx-Universe will reduced by 15 lenses for this OPC, because of the “A” type in the record.


Example 3:

A group of lenses were just received into DiSoft; the goal is to advise Rx-Universe that these lenses are available without waiting for the next full quantity update.  A file with a fixed name is used:

File QUANTITY.QTY is placed into the OMICSTX folder.

Contents:
0202773586=100.0;A
0202773595=50.0;A
     . . .
0202773574=75.0;A

The quantities available for each of the OPCs will be incremented by the quantity specified.  For example, the quantity available in Rx-Universe for OPC 0202773595 will be increased by 50 lenses (not pairs).