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

Add icarAttentionEventResource issue 393 #407

Merged
merged 7 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/icarAttentionEventCollection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"description": "Represents a collection of attention events generated by devices. Based on icarResourceCollection to provide paging etc.",

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

"properties": {
"member": {
"type": "array",
"items": {
"$ref": "../resources/icarAttentionEventResource.json"
},
"description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case attention events."
}
}
}
]
}
12 changes: 12 additions & 0 deletions enums/icarAttentionCategoryType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"description": "Defines a category of device messages that may allow filtering of alerts.",

"type": "string",

"enum": [
"Behaviour",
"Environment",
"Health",
"Other"
]
}
35 changes: 35 additions & 0 deletions enums/icarAttentionCauseType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"description": "Defines causes of alerts from devices.",

"type": "string",

"enum": [
"Activity",
"AnimalTemperature",
"BodyCondition",
"EatingLess",
"EnvironmentTemperature",
"Disturbance",
"Health",
"HeartRate",
"Inactivity",
"Ketosis",
"Lameness",
"Location",
"LowerRumination",
"LyingTooLong",
"LyingTooShort",
"Mastitis",
"MobilityScore",
"NoMovement",
"Parturition",
"PostParturitionRisk",
"ProlongedParturition",
"RespirationRate",
"Standing",
"StandingUp",
"Walking",
"Other",
"Undefined"
]
}
12 changes: 12 additions & 0 deletions enums/icarAttentionPriorityType.json
Copy link
Collaborator

@dirksieben dirksieben Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not use this one anymore, since we have the severity index now.
My earlier suggestion to include "Critical" here might be irrelevant. I suggest leaving "critical" out again, but it is not a deal breaker.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"description": "Defines the relative priority of alerts.",

"type": "string",

"enum": [
"Informational",
"Normal",
"Urgent",
"Critical"
]
}
3 changes: 3 additions & 0 deletions enums/icarSetPurposeType.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"enum": [
"Enclosure",
"Feeding",
"Finishing",
"Growing",
"Health",
"Lactation",
"Movement",
"Rearing",
"Reproduction",
"Session",
"Other"
Expand Down
50 changes: 50 additions & 0 deletions resources/icarAttentionEventResource.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"description": "Defines an alert for an animal that may require attention.",

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

"required" : ["category", "causes"],

"properties": {
"alertEndDateTime": {
"$ref": "../types/icarDateTimeType.json",
"nullable": true,
"description": "RFC3339 date time that represents the end time of an alert (start time is the eventDateTime) if it has ended."
},
"category": {
"$ref": "../enums/icarAttentionCategoryType.json",
"description": "A category that allows filtering of alerts by subject."
},
"causes": {
"type": "array",
"items": {
"$ref": "../enums/icarAttentionCauseType.json"
},
"description": "The specific causes of the alert. This is an array and at least one cause must be specified."
},
"priority": {
"$ref": "../enums/icarAttentionPriorityType.json",
"description": "The relative priority of the alert."
},
"severity": {
"$ref": "../enums/icarDiagnosisSeverityType.json",
"description": "A structured set of severity values that align with those used in disease diagnosis."
},
"deviceAttentionScore": {
"type": "number",
"description": "Provides a manufacturer- and device-specific score related to the alert."
},
"device": {
"$ref": "../types/icarDeviceReferenceType.json",
"description": "Identifies the device that is raising the alert."
}
}
}
]
}

56 changes: 55 additions & 1 deletion url-schemes/exampleUrlScheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -2363,7 +2363,7 @@
"summary": "Get the medicine inventory transactions that relate to a certain location",
"description": "# Purpose\nProvides the medicine inventory transactions relating to a location\n",
"tags": [
"ADE-1.3-management"
"ADE-1.3-health"
],
"parameters": [
{
Expand Down Expand Up @@ -2407,6 +2407,57 @@
}
}
}
},
"/locations/{location-scheme}/{location-id}/attention-events": {
"get": {
"operationId": "get-attention-events",
"summary": "Get attention events.",
"description": "# Purpose\nProvides the attention events for a location. These are individual animal events, typically generated by devices such as wearables and sensors.\n",
"tags": [
"ADE-1.3-health"
],
"parameters": [
{
"$ref": "#/components/parameters/location-scheme"
},
{
"$ref": "#/components/parameters/location-id"
},
{
"$ref": "#/components/parameters/date-from"
},
{
"$ref": "#/components/parameters/date-to"
},
{
"$ref": "#/components/parameters/identifier-scheme"
},
{
"$ref": "#/components/parameters/identifier-id"
},
{
"$ref": "#/components/parameters/meta-modified-from"
},
{
"$ref": "#/components/parameters/meta-modified-to"
}
],
"responses": {
"200": {
"description": "Successful. The response contains the attention event resources for the given location.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/icarAttentionEventCollection"
}
}
}
},
"default": {
"$ref": "#/components/responses/default"
}
}
}
}
},
"components": {
Expand Down Expand Up @@ -2584,6 +2635,9 @@
},
"icarMedicineTransactionCollection": {
"$ref": "../collections/icarMedicineTransactionCollection.json"
},
"icarAttentionEventCollection": {
"$ref": "../collections/icarAttentionEventCollection.json"
}
},
"parameters": {
Expand Down
Loading