Summary
This method calculates the amount of additive based on the total volume collected for sample collections.
Formal Expression
The following variable may need to be updated based on specific study design naming conventions -
SampleWeight
🔸Reagent Multiplier🔸
should be updated to the desired amount to be calculated based on volume/weight (eg. 0.02)
var repeatKey = itemJson.item.itemGroupRepeatKey; var SampleWeight = findFirstItemByName(formJson, 'Sample Volume', null, repeatKey); var SampleWeightValue = SampleWeight.value; var Additive = SampleWeightValue * 🔸Reagent Multiplier🔸; return Additive.toFixed(4);
*Note also that the number in line five can be modified to adjust the decimal place precision