DHI Lactation Total Milk Item

DHI Lactation Total Milk Item

DHI Lactation Total Milk (DHIAtmilk) Item

· @Daniel

Summary

Add a backend lactation item, DHIAtmilk (DHI Lactation Total Milk), that calculates total milk for each lactation from test-day data using the National DHI Test Interval Method. Tested by hand on one cow's seven lactations, the method matches the DHIA-reported lactation milk within 8 lbs (0.03%) every time. A companion item, LTDHAItmlk, sums DHIAtmilk across all of a cow's lactations. Building them as backend items, like BV_M305, avoids the report-formula length limits we hit trying to do it as a custom formula.

Problem

BoviSync has no item that gives a lactation's total milk the way DHIA reports it. Producers and consultants expect DHIA lactation milk on previous-lactation reports, and our current items don't reproduce it.

  • BV_M305 / BV_ECM305 are 305-day or projected values, not the actual total through dry-off.
  • acc_milk uses parlor daily milk and only covers the current lactation. Herds without meters, and archived lactations, have no parlor data.
  • A report formula is too long. We built the method as custom formulas using lact_milk_test. Even the compact version needs 30 helper items plus several long formulas, and it doesn't fit report formula limits.

Proposed solution

Compute lactation total milk on the backend from the Milk_Test rows assigned to each lactation, and expose it as a lactation report item. It should also be available to animal reports for the current and previous lactations.

  • Name: DHIAtmilk, "DHI Lactation Total Milk".
  • Lifetime total: a second animal item, LTDHAItmlk, "Lifetime DHI Total Milk". It adds up DHIAtmilk across all of the animal's lactations, including the current lactation to date. Lactations with no usable tests count as 0, and the item is blank only when none of the lactations have usable tests.
  • Unit: lbs, rounded to whole pounds.
  • Completed lactations: total from calving through the day before the dry date.
  • Lactations in progress: total to date, through the most recent test. This is an assumption; see Open questions.
  • Refresh: recalculate when a test, fresh date or dry date for that lactation is added or edited.

Attached is an DHIA article that describes the calculation method in full.