Dose Calculation

Donate to this project

Development Project Status: Completed

Total cost estimate (ex-Tax): 
Current Percentage Funded: 
Project funding: 

You can donate money to this project by entering the amount above and clicking the 'Add to cart' button. In the Checkout process you can either choose to pay now (via Bank Transfer, Cheque or Pay Pal) or you can pledge the amount by choosing the 'Pledge a payment for a Development Project' method. If you make a pledge, then when we have 100% funding commitments, you will be notified by email and you can then action your payment. Note that development will not commence until all funds are received.

Project description: 

This project will enable add dose calculation support when invoicing medication products i.e. the quantity will be automatically calculated from the patient weight, drug concentration and rate for the patient species.

  • It will only apply to medication products that have doses configured for the patient species and weight range.
  • The medication need not have a label in order to have doses.
  • This facility will be available when charging and estimating.
  • It will not be supported:
    • when creating Medication records via Patients -> Medical Records -> Summary
    • for Counter Sales, as no patient is present.


To support doses, medication products will include a new Doses field. This may have zero or more Dose elements that contain:

  • Species - the species that the dose applies to. If unset, it applies to all species
  • Minimum Weight - the minimum patient weight the dose applies to, inclusive
  • Maximum Weight - the maximum patient weight the dose applies to, exclusive
  • Weight Units - the units the weight is specified in. One of grams, kilograms, or pounds
  • Concentration - the concentration of the dose. The concentration must be expressed in terms of the weight units.
  • Rate - the dose rate
  • Round To - the number of decimal places to round the calculated quantity to. One of 0, 1, or 2. Defaults to 2 decimal places.


For medications with doses for the patient species and weight range, the invoiced quantity is calculated as:

Quantity = round(weight * Rate / Concentration)


  • weight is the patient weight, converted to the same units as the dose
  • rounding is to the no. of units specifed by Round To

For medications with no doses for the patient species and weight range, the invoiced quantity is 0.0.


In the Medication product, Doses will be displayed as a new tab, with each dose presented in a table similar to that used for Template Includes. Doses may be moved up or down in the table, to organise them in a meaningful way.

When charged, medications that have had their quantity automatically calculated from dose information will be highlighted. This will be done by displaying the Quantity field with a blue background in both the invoice item and medication label. Note that this will only be displayed when the item is first created, not on subsequent edits.

Relationship to product templates

When a product template is used, the quantity of medications with doses will override that specified by the template. e.g. if product template A includes 3 medication B, and medication B specifies a dose of 1.5 for the patient, then 1.5 will be used.




Comment viewing options

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

Dose Calculation

Could it be set up so that when you set up the drug dialogue you choose:

On choosing your drug, the label screen appears and if you have pre configured

- Single dose - on use it automatically calculates/populates the quantity/dose field

- Dose range- on use it gives you the range and when you enter your choice it calculates and populates the quantity/dose field

- No Dose - Automatically defaults the cursor to a blank invoicing/label quantity field


For the first 2 there would also need to be a field to enter the number of days the course would be prescibed for so that the dose and quantity could be calculated


Also, as yet there is no quantity break calculation set up - this would be a good time to add it ( ie different mark ups and dispensing fees for complete bottles or packets versus split bottles/packets)





Re: Dose Calculation


Could this project please be reviewed based on the following changes...

- Dose range or single dose?

To calculate a single dose and use that to populate the quantity field.

- Injectable drugs with labels

We would be using this for injectable medication only as for tablets a duration of course would need to be given more thought. We do not currently have labels associated with injectable medication. By associating injectable medication with a label this will add a step whilst billing which we would like to avoid. I would recommend that it fills the quantity field directly into the invoice if no label is associated with the medication.

- Configurable

I would recommend that there is a background colour change in the quantity field to represent that the dose has been auto calculated. If there is no dose range for a particular product, when you invoice the background shows the regular colour and the quantity defualts to 1.00 as it currently does.

The product information would contain the following information:

For example:

Dosage for Carprofen Injectable






Minimum Weight

Maximum Weight


Dosage for Weight Range







Formulation =  Last recorded patient weight x dose rate / concentration = quantity.

This would also need to take into account for rounding to the closest decimal point to ensure we are not having doses calculated to 1.015 for example.



Re: Dose Calculation

Hi Tim,

Regarding the TODO's

Concentration Units - do not need to be displayed elsewhere

Presentation - I would include the shaded background on the medication label dialogue as well as the invoice in the instance where an injectable may have a label.

Could this please be costed?


Asha Stott.

Re: Dose Calculation

This project has been fully funded thanks to one generous donor. Thanks Asha!


Re: Dose Calculation

While this project was an awesome addition to OpenVPMS, can I suggest a slight addiition. We add a Repeat field (yet to work out what it should be called) but basically it represents the number of doses you would administer it would default to 1, meaning no change to current calculation - optionally it could be changed to say 28 dose for a 2 week course twice daily.

This is a the simple change.

I am happy to provide a patch for this

OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: benjicharlton[at]gmail[dot]com

Re: Dose Calculation

Hi Ben

I think this would work well. What would be even better is if "doses per day" was stored in the dosage information for the product and the user just had to enter the number of days course. So in your example twice daily would be entered in the dose, you would enter 14 days and the rest calculated. This could also potentially link through to the drug label instructions.



Re: Dose Calculation

My changes really do allow for this already Craig you just need to setup the product correctly to begin with...

1.Set the concentration 

2. Set the dose / kg

3. Set the # of doses (requires my patch) 

4. Set the default label  ie 'Give __ tablet  twice daily for 2 weeks'

5. At the time of sale vet selects and invoices - reviews the labelling information and enters the correct dose.  

The qty fields will be set to the default dose number for the default period.  

I think you completely automating the process means vets wont review it properly.. We need atleast some level of accountability at the veterinary level...otherwise we may as well just pay a robot :)


OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: benjicharlton[at]gmail[dot]com
Syndicate content