adewg / ICAR

Standard messages and specifications for animal data exchange in livestock.
https://icar.org/
Apache License 2.0
47 stars 26 forks source link

Specification for asynchronous callbacks #408

Open cookeac opened 1 year ago

cookeac commented 1 year ago

Asynchronous services and tasks may result in data being updated outside of the usual timeframe of a GET message. There may also be cases where exceptions should be raised.

@erwinspeybroeck gave some examples of how this works in the CRV system. An example is animal registration status notifications.

Possible solutions:

Two specific cases:

erwinspeybroeck commented 1 year ago

Hereby the 2 use case regarding notifications

 

Animal-registration-statuses

 

{

description: | Body for posting a (I&R) registration status notification -- | -- id* | string Unique identifier for this registration, is generated by the source registrationType | string Type of registration Enum: [ ARRIVAL, DEPARTURE, BIRTH, DEATH, STILLBIRTH ] animal* | { description: Identifies an animal using a scheme and ID. id* string A unique identification for the resource issued under the auspices of the scheme. scheme* string The identifier (in reverse domain format) of an official scheme that manages unique identifiers. } | description: | Identifies an animal using a scheme and ID. | id* | string A unique identification for the resource issued under the auspices of the scheme. | scheme* | string The identifier (in reverse domain format) of an official scheme that manages unique identifiers. description: | Identifies an animal using a scheme and ID. id* | string A unique identification for the resource issued under the auspices of the scheme. scheme* | string The identifier (in reverse domain format) of an official scheme that manages unique identifiers. location | { description: Location identifier based on a scheme and ID. id* string A unique identification for the resource issued under the auspices of the scheme. scheme* string The identifier (in reverse domain format) of an official scheme that manages unique identifiers. } | description: | Location identifier based on a scheme and ID. | id* | string A unique identification for the resource issued under the auspices of the scheme. | scheme* | string The identifier (in reverse domain format) of an official scheme that manages unique identifiers. description: | Location identifier based on a scheme and ID. id* | string A unique identification for the resource issued under the auspices of the scheme. scheme* | string The identifier (in reverse domain format) of an official scheme that manages unique identifiers. eventDateTime* | string($date-time) udt:DateTimeType \| A particular point in the progression of time together with relevant supplementary information. registrationDateTime | string($date-time) udt:DateTimeType \| A particular point in the progression of time together with relevant supplementary information. statusDateTime | string($date-time) udt:DateTimeType \| A particular point in the progression of time together with relevant supplementary information. registrationNumber | string Number to identify the registration at RvO/FAVV message | string Message concerning the registration(status) status* | string Type of registration Enum: [ INITIAL_REQUEST, VALIDATION_MESSAGE_OFFERED, VALIDATION_ERROR, VALIDATED, VALIDATED_WITH_A_WARNING, SENT_TO_RVO, SENT_TO_FAVV, RECEIVED_AT_RVO, RECEIVED_AT_FAVV, ERROR_RVO, WARNING_RVO, ERROR_FAVV, WARNING_FAVV, NOT_PROCESSED, PROCESSED, PROCESSED_WITH_A_WARNING, WITHDRAWN, REPLACED, INFO_RVO, ERROR_CRV, PROVISIONALLY_PROCESSED, REPLACEMENT_REQUESTED, WITHDRAWAL_REQUESTED, WITHDRAWAL_ERROR_CRV, WITHDRAWAL_SENT_TO_RVO, WITHDRAWAL_WARNING_RVO, WITHDRAWAL_ERROR_RVO ]

}

Functional errors

 

{

description: | Body for posting reproduction functional error -- | -- id* | string($uuid) Unique identifier for this event, is generated by the source. eventDateTime* | string($date-time) udt:DateTimeType \| A particular point in the progression of time together with relevant supplementary information. animal* | { description: Identifies an animal using a scheme and ID. id* string A unique identification for the resource issued under the auspices of the scheme. scheme* string The identifier (in reverse domain format) of an official scheme that manages unique identifiers. } | description: | Identifies an animal using a scheme and ID. | id* | string A unique identification for the resource issued under the auspices of the scheme. | scheme* | string The identifier (in reverse domain format) of an official scheme that manages unique identifiers. description: | Identifies an animal using a scheme and ID. id* | string A unique identification for the resource issued under the auspices of the scheme. scheme* | string The identifier (in reverse domain format) of an official scheme that manages unique identifiers. originalId | string Unique identifier, which refers to the original id of the reproduction event. message | string Message concerning the functional error. reproductionType | string Reproduction type. Enum: [ ABORTION, DO_NOT_BREED, HEAT, PREGNANCY_CHECK, INSEMINATION, HEAT_REPORT ]

}