Skip to content

Dead Dam List

Dan edited this page Feb 7, 2021 · 3 revisions

A dead dam is a dam who only has daughters in the herd or has been dead for a long time. It contains the dams name and identity information, and PTAs. These are used to save space over a full cow overview.

deadDamList is a function to get all these from the datastream - usage and return value as listed below.

Usage

import { deadDamList, openDatastream } from 'nmr-datastream';

(async () => {
  try {
    const datastream = await openDatastream('./path/to/your/datastream');

    console.log(deadDamList(datastream));
  } catch (e) {
    console.error(e);
  }
})();

Output / Returns

Returns an array of objects with the following information:

{
  name: string,
  breed: string,  // Code (e.g. 01) - Will return look up in due course.
  identity: string, // Type identified below.
  identityType: string | undefined, // See src/lookups/IDType for return values
  authenticIdentity: boolean,
  pedigreeStatus: string | undefined, // See src/lookups/pedigreeStatus for return values
  ptas: {
    evaluationGroup: string | undefined, // See src/lookups/ptaSource for return values.
    evaluationSource: string | undefined, // As above
    evaluationDate: Date | null,
    reliability: number, // 00 (Percentage)
    milkKG: number, // +/- 0000
    fatKG: number, // +/-000.0
    proteinKG: number, // +/-000.0
    fatPercentage: number, // +/-00.00
    proteinPercentage: number, // +/-00.00
  }
}