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

type classification #247

Closed
erwinspeybroeck opened this issue Sep 23, 2021 · 7 comments · Fixed by #269
Closed

type classification #247

erwinspeybroeck opened this issue Sep 23, 2021 · 7 comments · Fixed by #269

Comments

@erwinspeybroeck
Copy link
Collaborator

erwinspeybroeck commented Sep 23, 2021

We have an API description for a conformation score event.
Herdbooks are doing type classifications = scoring a number of linear traits and composite traits (thes might be calculated from linear traits) at once for a number of animal on a location

So we might consider an extra API : type-classifications. This would then comprise in one event an array of linear and an array of composite traits.

@ahokkonen
Copy link
Contributor

ahokkonen commented Sep 24, 2021

Here is the model we use for animal classification:

{
    "classificationDate": "2021-09-23T00:00:00.000Z",
    "body": {
        "score": 60,
        "foreEndWidth": 1,
        "chestDepth": 1,
        "topline": 2,
        "rumpAngle": 3,
        "rumpLength": 4,
        "rumpWidth": 3,
        "harmony": 2,
        "stature": 99
    },
    "muscularity": {
        "score": 60,
        "chineWidth": 1,
        "loinWidth": 2,
        "backLength": 77,
        "thighsWidth": 2,
        "thighsInside": 3,
        "thighsDepth": 4,
        "thighsMuscularity": 2
    },
    "legs": {
        "score": 60,
        "rearLegsSideView": 1,
        "pasternAngle": 2,
        "rearLegsRearView": 1,
        "foreLegsFrontView": 3,
        "boneQuality": 2
    },
    "beefButtockDistance": 1,
    "locomotion": 2,
    "navelDisorder": 3,
    "bodyConditionScore": 3,
    "totalScore": 60,
}

So as you see resource is divided into the several composite traits - body, muscularity, legs - together with some common linear traits (BCS, locomotion). Each composite trait contains linear traits + area score calculated from the trait scores. Also model has total score which is a classification score from ill the inputs.

@erwinspeybroeck
Copy link
Collaborator Author

erwinspeybroeck commented Sep 24, 2021

I would prefer something like this:

GET /locations/{location-scheme}/{location-id}/type-classifications

response:

array of
[

  • event date = the date of the type classification
  • location-number = the location (+scheme) where the type classification was executed
  • responsible = the person who executed the classification
  • array of animals --> animals that were part of this type classification
    [ - animal_id = the id + schema of the animal
    • base = the base on which the classification has been done (DairyCattle, BeefCattle, DualPurposeCattle, DairyGoats)
    • array of conformationScores
      [
      • traitLabel - id and scheme
      • traitType --> enum indicating Linear or Composite
      • traitScored --> enum of the traits (see the individual trait - composites have to be added
      • score
      • method --> manual or automated
        ]
        ]
        ]

to distinguish better between linear and composites we could decide to have two arrays

  • array of LinearScores
    [
    • traitLabel - id and scheme
    • traitScored --> enum of the traits (see the individual trait enum)
    • score
    • method --> manual or automated
      ]
  • array of CompositeScores
    [
    • traitLabel - id and scheme
    • traitScored --> enum of the composite traits (to be derived from ICAR)
    • score
    • method --> manual or automated
      ]
      ]
      ]

@ahokkonen
Copy link
Contributor

My post was only an example what we use at the moment, but for ADE I would prefer more generic solution for sure :)
Do we want it to be multi-animal event?

@erwinspeybroeck
Copy link
Collaborator Author

In my opinion there has to be one, a regular type classification always consist of scoring the new heifers, so always a number of animals on one day. There is surely a use case to request the type classifications based on a classification date.
Another use case is to request the type classifications for all in herd animals. Maye these should be 2 seperate API's , or we can try to have the same response? In the last use case it is maybe better to put the event date in the animal array, since not all in herd animal are scored on the same date - same for the responsible …

@cookeac
Copy link
Collaborator

cookeac commented Oct 7, 2021

I think we should initially define the event in a way that is consistent with the rest of the animal events - with each event being for an Individual. If you want to deliver data for a set of heifers classified on a single day you can always post them as a /batch :-)

To me the first step would to be to define a Composite Score event that define the composite score (which can be calculated or overriden by the inspector). This Composite Score event could potentially (but not necessarily) contain an array of the Linear Score events (which we already have - see icarConformationScoreEventResource.

Then the second step if you wanted would be to define an overall Inspection event which could have an array of Composite Score Events and an array of Linear Score events.

The reason for separating these (and not just coding the Linear Score values as in @ahokkonen's example is that different species, countries, and breed organisations may record a variety of different scores.

cookeac added a commit that referenced this issue Jan 9, 2022
Type classification for sets of classification scores, including calculated scores. Resolves #247
@stale
Copy link

stale bot commented Mar 16, 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 Mar 16, 2022
@cookeac cookeac removed the stale-issue Identifies that an issue is stale and will be closed unless reactivated. label Mar 16, 2022
@cookeac
Copy link
Collaborator

cookeac commented May 20, 2022

Resolved by #269

@cookeac cookeac linked a pull request May 20, 2022 that will close this issue
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