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:
weight is the patient weight, converted to the same units as the dose
rounding is to the no. of units specified by Round To
For medications with no doses for the patient species and weight range, the invoiced quantity is unchanged.
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.
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.