Idexx price update

Hello all, just wanted to know an easy way to update the prices for Idexx.

 

We have a variable % markup

 

Would like to close off last years prices, and keep the % markup the same.

 

Ideally an easy spread sheet as this is not my area of expertise!

 

Thanks Anna

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Idexx price update

Hi Anna,

Not sure if there is a better way, but I go to Products - Export - type in %idexx in the search - Export - open with OpenOffice and the edit the spreadsheet.

You can edit the Unit cost, Unit price, Start Date which I think will be everything you need.

Greta

Re: Idexx price update

Thanks Greta,

When I do this I end the End price date, then import it, then change the Unit price and Start price date and delete the End price date and then Import the file.

But it then keeps my Unit price the same so my mark up essentially goes down?

There is no column for the markup %

Do I just have to manually work out Unit cost x mark up% to find the Unit price for each item? as we have variable mark ups depending on complexity of the tests and starting price.

Thanks Anna

Re: Idexx price update

Apologies for partial hijack of Anna's post. Greta do you have some sort of code that you use to identify the lab tests that need their prices updating? My lab tests are all down as a service which means (I think) that they don't have a supplier tab associated with them and hence no ability to record a re-order code or similar which I had been hoping to use as a reference against my lab's price list. How do you manage this or does it just go off the long name of the lab test?

Chris

Re: Idexx price update

Hi Chris,

Unfortunately I don't have any code, I just manually work through the report spreadsheet vs the price list.

Greta

Re: Idexx price update

> I just manually work through the report spreadsheet vs the price list.

Yep, me too - just finished my manual update (I read this thread with a degree of apprehension concerned that I'd missed a simple one-click solution, but no).

 

Re: Idexx price update

Thanks Greta, will give it a go....

Thought that a fairy godmother/father/person would be able to do it for me.... as got this from Idexx

Three helpful points of note:

  1. Download the pricing information from our email sent on the 29th December 2021.
  2. Contact your practice management software provider to update your pathology pricing.
  3. Review what's new in the 2022 Directory.

:)

 

Re: Idexx price update

Hi Anna,

My reason for quizzing Greta was regarding use of a unique ID for lab charges. I have created scripts for updating my product prices based on csv files from my drug wholesalers but they rely on the use of the re-order code so that there is a unique ID to act as the glue between openVPMS and the csv file.

I note that entity.LaboratoryTest contains a node 'code' that is read only. Were this able to be set by the user or if there were anther way of setting an arbitrary laboratory defined unqiue Id against a laboratory test then the scripts I use for price updates could be modified to update lab tests.

I have yet to ask the dev gods that haunt these forums for input on this matter but it would be very nice if they weighed in with their devine advice.

Chris

Re: Idexx price update

The laboratory code is there to support lab integrations such as IDEXX and Zoetis.
E.g, if you integrate IDEXX VetConnect PLUS, it will be automatically populated with the code that gets submitted to the IDEXX VetLab Station or Reference Laboratory.

In terms of identifying products, you can add an arbitrary code via the Identities tab of each product.
Medication and merchandise products also support a barcode.

 

Re: Idexx price update

Thank you very much for this Tim. I'll work through my lab products and add in the lab generated codes in this identity tab then update my price update scripts. I will post them when I am done so that other people can modify/improve them if they choose.

Chris

Re: Idexx price update

Further to my last post, I have in each of the lab products added an identity along the lines of code='unique lab code eg HIS1-3', description='LabCode=VPG'. I only use one external lab but could have many if the description was different for each eg 'LabCode=IDEXX,GRIBBLES...'

Because I am a coward I take a backup of the server database and do all of the following on my workstation.

All of the below instructions are based on my work station being linux. Windows users would have to adjust things. They may actually not need to do some of the file moves as in linux mysql has very restricted file permissions and can only read and write to certain places.

In mysql workbench import the backup of the production server database. Move the product file from the lab to:

'/var/lib/mysql-files/VPGPriceList2021.csv'

Export the prices of interest from openVPMS by using the search function (ie 'Lab-VPG-). Save this file and move to something like:

'/var/lib/mysql-files/products-2022-02-18.csv'

Create a stored proc along the lines of:


CREATE DEFINER=`chris`@`localhost` PROCEDURE `updateLabPrices`(IN labName VARCHAR (255)

                    )

BEGIN

DECLARE whereSortName varchar(255);

Select concat('LabCode-', TRIM(labName)) into whereSortName;

    DROP TABLE IF exists temp_price_tbl;
    
    CREATE TABLE IF NOT EXISTS temp_price_tbl as (
    select e.entity_id as pid,
       e.name as product,
       ei.description,
       ei.identity as reorderCode,
       p.product_price_id as 'Unit Price Id',
       p.price as 'Unit Price',
       ppd.cost_price,  markup
from   entities e
left join entity_links r
       on e.entity_id = r.source_id and r.arch_short_name = "entityLink.productType"
left join entities pt
       on r.target_id = pt.entity_id
left join entity_identities ei on ei.entity_id = e.entity_id
left join product_prices p on p.product_id = e.entity_id
left join
                (select product_price_details.product_price_id, product_price_details.name, product_price_details.value as cost_price from product_price_details

                inner join product_prices on product_price_details.product_price_id = product_prices.product_price_id where product_price_details.name="cost") ppd

                on ppd.product_price_id=p.product_price_id

            left join

                (select product_price_details.product_price_id, product_price_details.name, product_price_details.value as markup from product_price_details

                inner join product_prices on product_price_details.product_price_id = product_prices.product_price_id where product_price_details.name="markup") ppdm

                on ppdm.product_price_id=p.product_price_id

    
where e.arch_short_name='product.service'
and e.name like '%vpg%'
and e.active=true);

DROP TABLE IF EXISTS temp_wholesaler_prices;
                    

   
    CREATE TABLE IF NOT EXISTS temp_wholesaler_prices (

        wholesaler_code VARCHAR(255) NOT NULL,

        wholesaler_name VARCHAR(255),

        wholesaler_list_price DECIMAL (10,4),

        primary key (wholesaler_code)

    );

    

    

    

END

Execute the following in a query window:


call openvpmstest.updateLabPrices('VPG');

LOAD DATA INFILE '/var/lib/mysql-files/VPGPriceList2021.csv'
        INTO TABLE temp_wholesaler_prices
        FIELDS TERMINATED BY '\t' ENCLOSED BY '"'
        LINES TERMINATED BY '\n'
        IGNORE 1 ROWS;
        
LOAD DATA INFILE '/var/lib/mysql-files/products-2022-02-18.csv'
        INTO TABLE temp_openvpms_prices
        FIELDS TERMINATED BY ','
        ENCLOSED BY '"'
        LINES TERMINATED BY '\n'
        IGNORE 1 ROWS
        (`Product Id`,
        `Product Name`,
    `Product Printed Name`,
    @FixedPriceId,
    @FixedPrice,
    @FixedCost,
    @FixedPriceMaxDiscount,
    @FixedPriceStartDate,    
    @FixedPriceEndDate,
    @DefaultFixedPrice,
    `Fixed Price Groups`,
    @UnitPriceId,    
    @UnitPrice,
    @UnitCost,
    @UnitPriceMaxDiscount,
    @UnitPriceStartDate,
    @UnitPriceEndDate,
    `Unit Price Groups`,
    `Tax Rate`,
    `Notes` )
    SET `Fixed Price Id` = nullif(@FixedPriceId,''),
    `Fixed Price`= nullif(@FixedPrice,''),
    `Fixed Cost` = nullif(@FixedCost,''),
    `Fixed Price Max Discount` = nullif(@FixedPriceMaxDiscount,''),
    `Fixed Price Start Date` = nullif(@FixedPriceStartDate,''),
    `Fixed Price End Date` = nullif(@FixedPriceEndDate,''),
    `Default Fixed Price` = nullif(@DefaultFixedPrice,''),
    `Unit Price Id` = nullif(@UnitPriceId,''),
    `Unit Price End Date` = nullif(@UnitPriceEndDate,''),
    `Unit Price` = nullif(@UnitPrice,''),
    `Unit Cost` = nullif(@UnitCost,''),
    `Unit Price Max Discount` = nullif(@UnitPriceMaxDiscount,''),
    `Unit Price Start Date` = nullif(@UnitPriceStartDate,'')
    ;
    
alter table temp_price_tbl add column new_cost_price decimal (10,3);

-- select * from temp_price_tbl inner join temp_wholesaler_prices
-- on temp_price_tbl.reorderCode = temp_wholesaler_prices.wholesaler_code
-- where
-- temp_price_tbl.cost_price < temp_wholesaler_prices.wholesaler_list_price;

update temp_price_tbl inner join temp_wholesaler_prices
on temp_price_tbl.reorderCode = temp_wholesaler_prices.wholesaler_code
set temp_price_tbl.new_cost_price = temp_wholesaler_prices.wholesaler_list_price
where
temp_price_tbl.cost_price < temp_wholesaler_prices.wholesaler_list_price;

delete temp_openvpms_prices from temp_openvpms_prices inner join temp_price_tbl on temp_price_tbl.pid = temp_openvpms_prices.`Product ID`
where temp_price_tbl.new_cost_price is null;

update temp_openvpms_prices inner join temp_price_tbl on temp_openvpms_prices.`Product ID` = temp_price_tbl.pid
set `Unit Price Start Date` = DATE(now()),
    temp_openvpms_prices.`Unit Price Id` = null,
    temp_openvpms_prices.`Unit Cost`=temp_price_tbl.new_cost_price,
    temp_openvpms_prices.`Unit Price` = round(temp_price_tbl.new_cost_price*(1+temp_price_tbl.markup/100),3);
    
select `Product Id`,
    IFNULL(`Product Name`,'')as `Product Name`,
    IFNULL(`Product Printed Name`,'')as `Product Printed Name`,
    IFNULL(`Fixed Price Id`,'') as `Fixed Price Id`,
    IFNULL(`Fixed Price`,'')as `Fixed Price`,
    IFNULL(`Fixed Cost`,'')as `Fixed Cost`,
    IFNULL(`Fixed Price Max Discount`,'')as `Fixed Price Max Discount`,
    IFNULL(`Fixed Price Start Date`,'')as `Fixed Price Start Date`,
    IFNULL(`Fixed Price End Date`,'')as `Fixed Price End Date`,
    IFNULL(`Default Fixed Price`,'')as `Default Fixed Price`,
    IFNULL(`Fixed Price Groups`,'')as `Fixed Price Groups`,
    IFNULL(`Unit Price Id`,'')as `Unit Price Id`,
    IFNULL(`Unit Price`,'')as `Unit Price`,
    IFNULL(`Unit Cost`,'')as `Unit Cost`,
    IFNULL(`Unit Price Max Discount`,'')as `Unit Price Max Discount`,
    IFNULL(`Unit Price Start Date`,'')as `Unit Price Start Date`,
    IFNULL(`Unit Price End Date`,'')as `Unit Price End Date`,    
    IFNULL(`Unit Price Groups`,'')as `Unit Price Groups`,    
    IFNULL(`Tax Rate`,'')as `Tax Rate`,    
    IFNULL(`Notes`,'')as `Notes`
    
    from temp_openvpms_prices where `Unit Price Id` is null;
    
drop table if exists temp_openvpms_prices;
drop table if exists temp_wholesaler_prices;
drop table if exists temp_price_tbl;

In the results window of mysql workbench export the results of the final select statement. Save this as a csv. Import this file using openVPMS import prices. This gives you a visual sanity check on what you are about to do. Whilst it would have been far less trouble to have the scripts directly update the prices in openVPMS I really like the visual confirmation of what is going to change in the production database.

All of the above is as rough as guts and very much tailored to my implementation. I'm a vet not a programmer so I leave it to others to improve it and make it generic if they choose.

Chris

 

 

Syndicate content