Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Milk recording information on herd level #184

Closed
erwinspeybroeck opened this issue Jan 27, 2021 · 14 comments · Fixed by #298
Closed

Milk recording information on herd level #184

erwinspeybroeck opened this issue Jan 27, 2021 · 14 comments · Fixed by #298

Comments

@erwinspeybroeck
Copy link
Collaborator

Do we need this? One could calculate aggregated data based upon the animal data.
But what we see : a number of herd management systems like to get the aggregated data from the MRO's because they don't want to explain (small) differences between MRO's overviews and HMS overviews.

MRO's sometimes also calculate herd KPI's that are not easy to calculate on animal data solely.

Data in scope:
location-id and scheme
date of milk recording
number of animals (total, dry, sampled, ...)
date of analysis of the samples
average 24 hour kg milk, fat, protein, urea, lactosis, cellcount
average calving age
average 305 productions (milk, fat, protein, lactosis)
average lactation value - herd level KPI that CRV provides
BSK (herd standard cow) - herd level KPI that CRV provides
NO (net earnings) - herd level KPI that CRV provides
...

@erwinspeybroeck
Copy link
Collaborator Author

erwinspeybroeck commented Feb 23, 2021

I'm thinking of 1 to 4 API's:

  • milk-recording-statistics (counts, overall averages, group averages) - could be 3 API's, could be parameters, ...
  • milk-recording-kpis, could also be a parameter in case of 1 API ...

milk-recording-statistics
{
location {
id,
scheme },
milk recording date,
analysis date,
counts [
name --> enum [MILK,SAMPLE,DRY]
count ],
averages [
]
groups [
]

milk-recording-kpis
{
location {
id,
scheme },
milk recording date,
kpis[
indicator {
id, scheme
}
name --> string
value],
calculationType and resolution ???

@erwinspeybroeck
Copy link
Collaborator Author

image

@AndreasSchultzGEA
Copy link
Collaborator

Erwin, does your proposal also cope the statistic-values for single animals?
We are thinking of milking-averages calculated per day per animal.

@cookeac
Copy link
Collaborator

cookeac commented May 20, 2021

I had wondered about an alternative approach for herd/group statistics.

icarStatistic {
metric: string, // or enumeration, or scheme/id?
count: integer,
mean: number
}

icarGroupStatistics {
id : string, //UUID of course
location: icarLocationIdentifier,
recordingDate: icarDateTime, // or with a duration? A test day is a single date, but other things might be a period?
groupType: icarStatisticGroupType, // enumeration - lactationNumber, daysInMilk, animalSet ...
groupSpecifier {
lactationNumber: integer,
daysInMilkRangeMin : integer,
daysInMilkRangeMax: integer,
animalSet : icarAnimalSetResourceReference
}
statistics[] : icarStatistic // array of statistics; server decides what it provides
}

GET /locations///test-day-statistics?group-type=... etc

@erwinspeybroeck
Copy link
Collaborator Author

Erwin, does your proposal also cope the statistic-values for single animals?
We are thinking of milking-averages calculated per day per animal.

This proposal is really about herd level data. The proposal will contain an average of the day-production of all animals (in herd or group) on the test day.
You would need an API like GET​/locations​/{location-scheme}​/{location-id}​/day-productions which would give you the day-productions of an animal or all animals in the location (herd).

@cookeac
Copy link
Collaborator

cookeac commented Jul 15, 2021

@erwinspeybroeck to review the above and suggest a draft PR for release 1.3.

@stale
Copy link

stale bot commented Oct 13, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-issue Identifies that an issue is stale and will be closed unless reactivated. label Oct 13, 2021
@erwinspeybroeck erwinspeybroeck added agenda-next-meeting and removed stale-issue Identifies that an issue is stale and will be closed unless reactivated. labels Oct 21, 2021
@erwinspeybroeck
Copy link
Collaborator Author

I will need to pick this up, but lack of time for the moment ...

@erwinspeybroeck
Copy link
Collaborator Author

erwinspeybroeck commented Nov 3, 2021

I'd rather think of a test-day-statistics which gives statistics of the test day observations.
This could include a statistics resource which migth be usable for other events that need statistics, and which may go over a period.

test-day-statistics {
id : string, //UUID of course
location: icarLocationIdentifier,
recordingDate: icarDateTime
groupId: refers to a group --> seperate API to define the groups?
statistics = array of icarStatistics {
metric: string, // or enumeration, or scheme/id?
count: integer,
mean: number }
}

groups {
id
groupType: icarStatisticsGroupType, // enumeration - herd, lactationNumber, daysInMilk, animalSet ...
groupSpecifier {
lactationNumber: integer,
daysInMilkRangeMin : integer,
daysInMilkRangeMax: integer,
animalSet : icarAnimalSetResourceReference}
}

test-day-statistics?group-type= ... or test-day-statistics/group-type/type-id or test-day-statistics?animal-set= ...

@erwinspeybroeck
Copy link
Collaborator Author

erwinspeybroeck commented Feb 15, 2022

A try to make it more generic

icarStatistics {
id : unique identifier of this statistics record
description : string to describe the contenct of these statistics - could be also an enum ( test day statistics, reproduction statistics, feeding statistics, ...)
statisticsStartDate : Date (inclusive) for which the statistics are acalculated
statisticsEndDate : Date (inclusive) for which the statistics are calculated
Group array {
groupType : string (or enum : herd, lactationNumber, daysInMilk, animalSet, ...)
groupSpecifier { --to be filled according to groupType
lactationNumberRangeMin: integer,
lactationNumberRangeMax: integer,
daysInMilkRangeMin : integer,
daysInMilkRangeMax: integer,
animalSet : icarAnimalSetResourceReference}
}
statistics array {
description : string or enum (kg milk, scc, %fat, %protein, ...)
metric : enum (average, sum, stdev, min, max, count)
value : double
}
}
}

@erwinspeybroeck
Copy link
Collaborator Author

Next iteration after working group meeting

icarStatistics {
id : unique identifier of this statistics record
location
description or purpose: enum ( test day statistics, reproduction statistics, feeding statistics, ...)
startDate : Date (inclusive) for which the statistics are calculated
endDate : Date (inclusive) for which the statistics are calculated
Group array {
groupType : string (or enum : herd, lactationNumber, daysInMilk, animalSet, ...)
denombinator : number of animal in the group
groupSpecifier { --to be filled according to groupType
lactationNumberRangeMin: integer,
lactationNumberRangeMax: integer,
daysInMilkRangeMin : integer,
daysInMilkRangeMax: integer,
animalSet : icarAnimalSetResourceReference}
}
statistics array {
kpi or measure or metric: enum (animals, milk, scc, %fat, %protein, ...)
unit : enum (KG, LT,…)
aggregation : enum (average, sum, stdev, min, max, count)
value : double
}
}
}

@erwinspeybroeck
Copy link
Collaborator Author

cookeac added a commit that referenced this issue May 19, 2022
Adds icarStatisticsCollection and other classes for group statistics. Resolves #184
@cookeac
Copy link
Collaborator

cookeac commented May 20, 2022

Resolved by #298

@cookeac cookeac linked a pull request May 20, 2022 that will close this issue
@stale
Copy link

stale bot commented Aug 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-issue Identifies that an issue is stale and will be closed unless reactivated. label Aug 30, 2022
@cookeac cookeac removed the stale-issue Identifies that an issue is stale and will be closed unless reactivated. label Aug 30, 2022
@cookeac cookeac closed this as completed Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants