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

#285 milk predictions #346

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
276f10e
Merge pull request #339 from adewg/Develop
erwinspeybroeck Oct 27, 2022
b5168e8
added milk predictions
erwinspeybroeck Oct 27, 2022
1208d95
Merge branch 'erwinspeybroeck' of https://github.com/adewg/ICAR into …
erwinspeybroeck Oct 27, 2022
75f9ced
Merge pull request #344 from adewg/Develop
erwinspeybroeck Nov 4, 2022
84c3ed8
new type
erwinspeybroeck Nov 4, 2022
791c5d4
Merge branch 'erwinspeybroeck' of https://github.com/adewg/ICAR into …
erwinspeybroeck Nov 4, 2022
a23f125
adapted urls
erwinspeybroeck Nov 4, 2022
19c54c3
error in tag
erwinspeybroeck Nov 10, 2022
bb69e2b
Update types/icarMilkingPredictionType.json
erwinspeybroeck Nov 22, 2022
32b12f0
Update types/icarMilkingPredictionType.json
erwinspeybroeck Nov 22, 2022
dbfca8a
Update types/icarMilkingPredictionType.json
erwinspeybroeck Nov 22, 2022
a54c57e
Delete icarMilkingFatWeightType.json
erwinspeybroeck Nov 22, 2022
a1ac7ea
Update resources/icarMilkPredictionResource.json
erwinspeybroeck Nov 22, 2022
6f902c3
Update resources/icarMilkPredictionResource.json
erwinspeybroeck Nov 22, 2022
bfd79d3
Update resources/icarTestDayResultEventResource.json
erwinspeybroeck Nov 22, 2022
c1af117
Update resources/icarMilkPredictionResource.json
erwinspeybroeck Nov 22, 2022
7c8daa5
Delete icarMilkingProteinWeightType.json
erwinspeybroeck Nov 22, 2022
17bac59
Merge pull request #352 from adewg/Develop
erwinspeybroeck Nov 25, 2022
19f223e
Update icarStatisticsResource.json
erwinspeybroeck Dec 7, 2022
e29ae5b
Update icarStatisticsResource.json
erwinspeybroeck Dec 7, 2022
247d7d4
Update icarStatisticsGroupType.json
erwinspeybroeck Dec 7, 2022
0e7297a
Update managementURLScheme.json
erwinspeybroeck Dec 7, 2022
26719e1
Update exampleUrlScheme.json
erwinspeybroeck Dec 7, 2022
e1e83bf
Update types/icarMilkingPredictionType.json
erwinspeybroeck Mar 22, 2023
5b2c350
Update types/icarMilkingPredictionType.json
erwinspeybroeck Mar 22, 2023
e2d5913
Update types/icarMilkingPredictionType.json
erwinspeybroeck Mar 22, 2023
e3a4ba3
Update types/icarMilkingPredictionType.json
erwinspeybroeck Mar 22, 2023
46785ce
Update url-schemes/exampleUrlScheme.json
erwinspeybroeck Mar 22, 2023
5acf5f8
Update resources/icarStatisticsResource.json
erwinspeybroeck Mar 22, 2023
d51c255
Update url-schemes/exampleUrlScheme.json
erwinspeybroeck Mar 22, 2023
84eed0d
Update url-schemes/exampleUrlScheme.json
erwinspeybroeck Mar 22, 2023
e7dbd5f
Update url-schemes/exampleUrlScheme.json
erwinspeybroeck Mar 22, 2023
7c85253
Update url-schemes/managementURLScheme.json
erwinspeybroeck Mar 22, 2023
cb58dd4
Update url-schemes/managementURLScheme.json
erwinspeybroeck Mar 22, 2023
b1d6853
Update url-schemes/milkURLScheme.json
erwinspeybroeck Mar 22, 2023
ad48008
Update url-schemes/milkURLScheme.json
erwinspeybroeck Mar 22, 2023
b5e5d35
Update url-schemes/milkURLScheme.json
erwinspeybroeck Mar 22, 2023
b8318c5
Update url-schemes/managementURLScheme.json
erwinspeybroeck Mar 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions collections/icarMilkPredictionsCollection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"description": "Represents a collection of milk predictions per animal. Based on icarResourceCollection to provide paging etc.",

"allOf": [{
"$ref": "../collections/icarResourceCollection.json"
},
{
"type": "object",

"properties": {
"member": {
"type": "array",
"items": {
"$ref": "../resources/icarMilkPredictionResource.json"
},
"description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case milk prediction events."
}
}
}
]
}
27 changes: 27 additions & 0 deletions resources/icarMilkPredictionResource.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"description": "This returns a prediction of the expected milk, fat and protein for a cow for the remaining the lactation. Also a prediction of this production on the next testday is included and it eventually gives indication of when the peak production is reached.",

"allOf": [{
"$ref": "../resources/icarAnimalEventCoreResource.json"
},
{
"type": "object",

"properties": {
"averageRemainingProduction": {
"$ref": "../types/icarMilkingPredictionType.json"
},
"daysInMilkAtLactationPeak": {
"type": "integer",
"description": "The days in milk in a lactation when the peak production is expected to occur."
},
"lactationPeakProduction": {
"$ref": "../types/icarMassMeasureType.json"
},
"productionNextMilkRecording": {
"$ref": "../types/icarMilkingPredictionType.json"
}
}
}
]
}
8 changes: 1 addition & 7 deletions resources/icarStatisticsResource.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@
"group": {
"type": "array",
"items": {
"$ref": "../types/icarStatisticsGroupType.json"
}
},
"statistics": {
"type": "array",
"items": {
"$ref": "../types/icarStatisticsType.json"
"$ref": "../types/icarStatisticsGroupType.json",
erwinspeybroeck marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion resources/icarTestDayResultEventResource.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
"items": {
"$ref": "../types/icarMilkCharacteristicsType.json"
}
}
},
"predictedProductionOnTestday": {
"$ref": "../types/icarMilkingPredictionType.json"
}
}
}
]
Expand Down
26 changes: 26 additions & 0 deletions types/icarMilkingPredictionType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"description": "The amount of milk, fat and protein milked in a defined period of time",

"type": "object",

"required": [
"unitCode",
"value"
],

"properties": {
"milkWeight": {
"$ref": "../types/icarMassMeasureType.json"
},
"fatWeight": {
"$ref": "../types/icarMassMeasureType.json"
},
"proteinWeight": {
"$ref": "../types/icarMassMeasureType.json"
},
"hours": {
"type": "number",
"description": "The number of hours in which the mentioned milk, fat and protein were produced. Most commonly used is a 24 hours production."
}
}
}
6 changes: 6 additions & 0 deletions types/icarStatisticsGroupType.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
"items": {
"$ref": "../types/icarGroupSpecifierType.json"
}
},
"statistics": {
"type": "array",
"items": {
"$ref": "../types/icarStatisticsType.json"
}
}
}
}
49 changes: 48 additions & 1 deletion url-schemes/exampleUrlScheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
"name": "ADE-1.3-management",
"description": "Management messages approved by the working group"
},
{
"name": "ADE-1.3.2-management",
erwinspeybroeck marked this conversation as resolved.
Show resolved Hide resolved
"description": "Management messages approved by the working group"
},

{
"name": "ADE-1.3-milk",
"description": "Milk messages approved by the working group"
Expand Down Expand Up @@ -249,6 +254,45 @@
}
}
},
"/locations/{location-scheme}/{location-id}/milk-predictions": {
"get": {
"operationId": "get-milk-predictions",
"summary": "Get the milk predictions for a certain location",
"description": "# Purpose\nProvides the milk predictions for a location\n",
"tags": [
"ADE-1.4 additions"
erwinspeybroeck marked this conversation as resolved.
Show resolved Hide resolved
],
"parameters": [
{
"$ref": "#/components/parameters/location-scheme"
},
{
"$ref": "#/components/parameters/location-id"
},
{
"$ref": "#/components/parameters/meta-modified-from"
},
{
"$ref": "#/components/parameters/meta-modified-to"
}
],
"responses": {
"200": {
"description": "Successful. The response contains the milk predictions for the given location.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/icarMilkPredictionsCollection"
}
}
}
},
"default": {
"$ref": "#/components/responses/default"
}
}
}
},
"/locations/{location-scheme}/{location-id}/daily-milking-averages": {
"get": {
"operationId": "get-daily-milking-averages",
Expand Down Expand Up @@ -680,7 +724,7 @@
"summary": "Get the statistics for a certain location",
"description": "# Purpose\nProvides the statistics for a location\n One can specify the period for which the statistics can be calculated by specifying a date to and date from parameter. Also the purpose can be provided to limit the purpose of the statistics",
"tags": [
"ADE-1.3-management"
"ADE-1.3.2-management"
erwinspeybroeck marked this conversation as resolved.
Show resolved Hide resolved
],
"parameters": [
{
Expand Down Expand Up @@ -2104,6 +2148,9 @@
"icarWithdrawalEventCollection": {
"$ref": "../collections/icarWithdrawalEventCollection.json"
},
"icarMilkPredictionsCollection": {
"$ref": "../collections/icarMilkPredictionsCollection.json"
},
"icarReproMatingRecommendationCollection": {
"$ref": "../collections/icarReproMatingRecommendationCollection.json"
},
Expand Down
6 changes: 5 additions & 1 deletion url-schemes/managementURLScheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
{
"name": "ADE-1.3-management",
erwinspeybroeck marked this conversation as resolved.
Show resolved Hide resolved
"description": "Management messages approved by the working group"
},
{
"name": "ADE-1.3.2-management",
erwinspeybroeck marked this conversation as resolved.
Show resolved Hide resolved
"description": "Management messages approved by the working group"
}
],
"paths": {
Expand Down Expand Up @@ -448,7 +452,7 @@
"summary": "Get the statistics for a certain location",
"description": "# Purpose\nProvides the statistics for a location\n One can specify the period for which the statistics can be calculated by specifying a date to and date from parameter. Also the purpose can be provided to limit the purpose of the statistics",
"tags": [
"ADE-1.3-management"
"ADE-1.3.2-management"
erwinspeybroeck marked this conversation as resolved.
Show resolved Hide resolved
],
"parameters": [
{
Expand Down
50 changes: 48 additions & 2 deletions url-schemes/milkURLScheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
}
],
"tags": [
{
"name": "ADE-1.4-milk",
erwinspeybroeck marked this conversation as resolved.
Show resolved Hide resolved
"description": "new endpoints not yet approved"
},
{
"name": "ADE-1.3-milk",
"description": "Milking-related messages approved by the working group"
Expand Down Expand Up @@ -361,7 +365,7 @@
],
"responses": {
"200": {
"description": "Successful. The response contains the diagnoses for the given location.",
"description": "Successful. The response contains the daily milk averages for the given location.",
"content": {
"application/json": {
"schema": {
Expand All @@ -376,6 +380,45 @@
}
}
},
"/locations/{location-scheme}/{location-id}/milk-predictions": {
"get": {
"operationId": "get-milk-predictions",
"summary": "Get the milk predictions for a certain location",
"description": "# Purpose\nProvides the milk predictions for a location\n",
"tags": [
"ADE-1.4-milk"
erwinspeybroeck marked this conversation as resolved.
Show resolved Hide resolved
],
"parameters": [
{
"$ref": "#/components/parameters/location-scheme"
},
{
"$ref": "#/components/parameters/location-id"
},
{
"$ref": "#/components/parameters/meta-modified-from"
},
{
"$ref": "#/components/parameters/meta-modified-to"
}
],
"responses": {
"200": {
"description": "Successful. The response contains the milk predictions for the given location.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/icarMilkPredictionsCollection"
}
}
}
},
"default": {
"$ref": "#/components/responses/default"
}
}
}
},
"/locations/{location-scheme}/{location-id}/lactations": {
"get": {
"operationId": "get-lactations",
Expand Down Expand Up @@ -516,7 +559,7 @@
},
"/locations/{location-scheme}/{location-id}/milking-withdrawals": {
"get": {
"operationId": "get existing milking-withdrawals",
"operationId": "get-existing-milking-withdrawals",
"summary": "Get the milking-withdrawals for a certain location",
"description": "# Purpose\nProvides the milking-withdrawals for a certain location\n",
"tags": [
Expand Down Expand Up @@ -901,6 +944,9 @@
"icarDailyMilkingAveragesCollection": {
"$ref": "../collections/icarDailyMilkingAveragesCollection.json"
},
"icarMilkPredictionsCollection": {
"$ref": "../collections/icarMilkPredictionsCollection.json"
},
"icarLactationCollection": {
"$ref": "../collections/icarLactationCollection.json"
},
Expand Down