From b186f0a606ffda7774bdee7b02776e000a3c0e35 Mon Sep 17 00:00:00 2001 From: Anton Hokkonen Date: Tue, 18 Feb 2020 20:23:52 +0200 Subject: [PATCH 1/3] - added new collections for all main resource types - renamed TestDayResource into TestDayResultEventResource - fixed typo in icarWeightEventCollection (allof->allOf due case sensitivity) Resolves adewg/ICAR#73 --- .../icarAnimalCoreCollection.json | 21 ++++++++++++++++++ .../icarDeviceCollection.json | 21 ++++++++++++++++++ .../icarMilkingDryOffEventCollection.json | 21 ++++++++++++++++++ .../icarMilkingVisitEventCollection.json | 21 ++++++++++++++++++ .../icarMovementArrivalEventCollection.json | 21 ++++++++++++++++++ .../icarMovementBirthEventCollection.json | 21 ++++++++++++++++++ .../icarMovementDeathEventCollection.json | 21 ++++++++++++++++++ .../icarMovementDepartureEventCollection.json | 21 ++++++++++++++++++ .../icarReproAbortionEventCollection.json | 21 ++++++++++++++++++ .../icarReproHeatEventCollection.json | 21 ++++++++++++++++++ .../icarReproInseminationEventCollection.json | 21 ++++++++++++++++++ ...arReproMatingRecommendationCollection.json | 21 ++++++++++++++++++ .../icarReproParturitionEventCollection.json | 21 ++++++++++++++++++ ...carReproPregnancyCheckEventCollection.json | 22 +++++++++++++++++++ .../icarResourceCollection.json | 1 + .../icarTestDayResultEventCollection.json | 22 +++++++++++++++++++ ...on => icarTestDayResultEventResource.json} | 0 .../icarWeightEventCollection.json | 12 +++++----- 18 files changed, 324 insertions(+), 6 deletions(-) create mode 100644 Release Candidate Messages/icarAnimalCoreCollection.json create mode 100644 Release Candidate Messages/icarDeviceCollection.json create mode 100644 Release Candidate Messages/icarMilkingDryOffEventCollection.json create mode 100644 Release Candidate Messages/icarMilkingVisitEventCollection.json create mode 100644 Release Candidate Messages/icarMovementArrivalEventCollection.json create mode 100644 Release Candidate Messages/icarMovementBirthEventCollection.json create mode 100644 Release Candidate Messages/icarMovementDeathEventCollection.json create mode 100644 Release Candidate Messages/icarMovementDepartureEventCollection.json create mode 100644 Release Candidate Messages/icarReproAbortionEventCollection.json create mode 100644 Release Candidate Messages/icarReproHeatEventCollection.json create mode 100644 Release Candidate Messages/icarReproInseminationEventCollection.json create mode 100644 Release Candidate Messages/icarReproMatingRecommendationCollection.json create mode 100644 Release Candidate Messages/icarReproParturitionEventCollection.json create mode 100644 Release Candidate Messages/icarReproPregnancyCheckEventCollection.json create mode 100644 Release Candidate Messages/icarTestDayResultEventCollection.json rename Release Candidate Messages/{icarTestDayResource.json => icarTestDayResultEventResource.json} (100%) diff --git a/Release Candidate Messages/icarAnimalCoreCollection.json b/Release Candidate Messages/icarAnimalCoreCollection.json new file mode 100644 index 0000000..df222fd --- /dev/null +++ b/Release Candidate Messages/icarAnimalCoreCollection.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "description": "Represents a collection of animals. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarAnimalCoreResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarDeviceCollection.json b/Release Candidate Messages/icarDeviceCollection.json new file mode 100644 index 0000000..e6fd400 --- /dev/null +++ b/Release Candidate Messages/icarDeviceCollection.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "description": "Represents a collection of devices. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarDeviceResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarMilkingDryOffEventCollection.json b/Release Candidate Messages/icarMilkingDryOffEventCollection.json new file mode 100644 index 0000000..cf8534e --- /dev/null +++ b/Release Candidate Messages/icarMilkingDryOffEventCollection.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "description": "Represents a collection of animal drying off events. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarMilkingDryOffEventResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarMilkingVisitEventCollection.json b/Release Candidate Messages/icarMilkingVisitEventCollection.json new file mode 100644 index 0000000..b3b9f80 --- /dev/null +++ b/Release Candidate Messages/icarMilkingVisitEventCollection.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "description": "Represents a collection of animal milking visit events. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarMilkingVisitEventResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarMovementArrivalEventCollection.json b/Release Candidate Messages/icarMovementArrivalEventCollection.json new file mode 100644 index 0000000..4fe901c --- /dev/null +++ b/Release Candidate Messages/icarMovementArrivalEventCollection.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "description": "Represents a collection of animal arrival events. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarMovementArrivalEventResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarMovementBirthEventCollection.json b/Release Candidate Messages/icarMovementBirthEventCollection.json new file mode 100644 index 0000000..8eab8df --- /dev/null +++ b/Release Candidate Messages/icarMovementBirthEventCollection.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "description": "Represents a collection of animal birth events. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarMovementBirthEventResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarMovementDeathEventCollection.json b/Release Candidate Messages/icarMovementDeathEventCollection.json new file mode 100644 index 0000000..f212810 --- /dev/null +++ b/Release Candidate Messages/icarMovementDeathEventCollection.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "description": "Represents a collection of animal death events. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarMovementDeathEventResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarMovementDepartureEventCollection.json b/Release Candidate Messages/icarMovementDepartureEventCollection.json new file mode 100644 index 0000000..448885f --- /dev/null +++ b/Release Candidate Messages/icarMovementDepartureEventCollection.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "description": "Represents a collection of animal departure events. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarMovementDepartureEventResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarReproAbortionEventCollection.json b/Release Candidate Messages/icarReproAbortionEventCollection.json new file mode 100644 index 0000000..7c0453b --- /dev/null +++ b/Release Candidate Messages/icarReproAbortionEventCollection.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "description": "Represents a collection of animal abortion events. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarReproAbortionEventResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarReproHeatEventCollection.json b/Release Candidate Messages/icarReproHeatEventCollection.json new file mode 100644 index 0000000..32883b3 --- /dev/null +++ b/Release Candidate Messages/icarReproHeatEventCollection.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "description": "Represents a collection of animal heat events. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarReproHeatEventResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarReproInseminationEventCollection.json b/Release Candidate Messages/icarReproInseminationEventCollection.json new file mode 100644 index 0000000..68c9ba6 --- /dev/null +++ b/Release Candidate Messages/icarReproInseminationEventCollection.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "description": "Represents a collection of animal insemination events. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarReproInseminationEventResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarReproMatingRecommendationCollection.json b/Release Candidate Messages/icarReproMatingRecommendationCollection.json new file mode 100644 index 0000000..30151b5 --- /dev/null +++ b/Release Candidate Messages/icarReproMatingRecommendationCollection.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "description": "Represents a collection of animal mating recommendation events. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarReproMatingRecommendationResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarReproParturitionEventCollection.json b/Release Candidate Messages/icarReproParturitionEventCollection.json new file mode 100644 index 0000000..c2d3980 --- /dev/null +++ b/Release Candidate Messages/icarReproParturitionEventCollection.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "description": "Represents a collection of animal parturition events. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarReproParturitionEventResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarReproPregnancyCheckEventCollection.json b/Release Candidate Messages/icarReproPregnancyCheckEventCollection.json new file mode 100644 index 0000000..0cedfdd --- /dev/null +++ b/Release Candidate Messages/icarReproPregnancyCheckEventCollection.json @@ -0,0 +1,22 @@ +{ + "type": "object", + + "description": "Represents a collection of animal pregnancy checks events. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarReproPregnancyCheckEventResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarResourceCollection.json b/Release Candidate Messages/icarResourceCollection.json index 8b43de3..6bb400c 100644 --- a/Release Candidate Messages/icarResourceCollection.json +++ b/Release Candidate Messages/icarResourceCollection.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "Base class for a collection of items such as animals, devices, or events. Use allOf to add an items array of the right type.", "properties": { diff --git a/Release Candidate Messages/icarTestDayResultEventCollection.json b/Release Candidate Messages/icarTestDayResultEventCollection.json new file mode 100644 index 0000000..c5b0777 --- /dev/null +++ b/Release Candidate Messages/icarTestDayResultEventCollection.json @@ -0,0 +1,22 @@ +{ + "type": "object", + + "description": "Represents a collection of test day result events. Based on icarResourceCollection to provide paging etc.", + + "allOf": [ + { + "$ref": "icarResourceCollection.json" + }, + { + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "icarTestDayResultEventResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + } + } + } + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/icarTestDayResource.json b/Release Candidate Messages/icarTestDayResultEventResource.json similarity index 100% rename from Release Candidate Messages/icarTestDayResource.json rename to Release Candidate Messages/icarTestDayResultEventResource.json diff --git a/Release Candidate Messages/icarWeightEventCollection.json b/Release Candidate Messages/icarWeightEventCollection.json index 979b46d..2810914 100644 --- a/Release Candidate Messages/icarWeightEventCollection.json +++ b/Release Candidate Messages/icarWeightEventCollection.json @@ -2,18 +2,18 @@ "type": "object", "description": "Represents a collection of animal weight events. Based on icarResourceCollection to provide paging etc.", - "allof": [ + "allOf": [ { "$ref": "icarResourceCollection.json" }, { "properties": { "member": { - "type": "array", - "items": { - "$ref": "icarWeightEventResource.json" - }, - "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." + "type": "array", + "items": { + "$ref": "icarWeightEventResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case weight events." } } } From f8fa94ef24af19c9b7defada1456af73554079ec Mon Sep 17 00:00:00 2001 From: Anton Hokkonen Date: Tue, 18 Feb 2020 20:25:40 +0200 Subject: [PATCH 2/3] - replaced responses for all endpoint to return typed collection instead of adday if resources - wrapped examples into type sollections Resolves adewg/ICAR#73 --- .../exampleUrlScheme.json | 202 +++++++++--------- 1 file changed, 96 insertions(+), 106 deletions(-) diff --git a/Release Candidate Messages/exampleUrlScheme.json b/Release Candidate Messages/exampleUrlScheme.json index ee30788..ea49a9e 100644 --- a/Release Candidate Messages/exampleUrlScheme.json +++ b/Release Candidate Messages/exampleUrlScheme.json @@ -10,13 +10,10 @@ "email": "icar@icar.org" } }, - "servers": [ - { - "url": "https://icar-ade.standard.com" - } - ], - "tags": [ - { + "servers": [{ + "url": "https://icar-ade.standard.com" + }], + "tags": [{ "name": "additions", "description": "new endpoints not yet approved" }, @@ -46,8 +43,7 @@ "tags": [ "release-candidate-milk" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -93,8 +89,7 @@ "tags": [ "release-candidate-milk" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -140,8 +135,7 @@ "tags": [ "release-candidate-registration" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -182,8 +176,7 @@ "tags": [ "release-candidate-registration" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -224,8 +217,7 @@ "tags": [ "release-candidate-registration" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -271,8 +263,7 @@ "tags": [ "release-candidate-registration" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -313,8 +304,7 @@ "tags": [ "release-candidate-registration" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -349,8 +339,7 @@ "tags": [ "release-candidate-reproduction" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -396,8 +385,7 @@ "tags": [ "release-candidate-reproduction" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -438,8 +426,7 @@ "tags": [ "release-candidate-reproduction" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -485,8 +472,7 @@ "tags": [ "release-candidate-reproduction" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -535,8 +521,7 @@ "tags": [ "release-candidate-reproduction" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -577,8 +562,7 @@ "tags": [ "release-candidate-reproduction" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -619,8 +603,7 @@ "tags": [ "release-candidate-other" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -661,8 +644,7 @@ "tags": [ "release-candidate-other" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -695,7 +677,7 @@ } } }, - "/locations/{location-scheme}/{location-id}/mating-recommendations": { + "/locations/{location-scheme}/{location-id}/mating-recommendations": { "get": { "operationId": "get-mating-recommendations", "summary": "Get the mating recommendations for a certain location", @@ -703,8 +685,7 @@ "tags": [ "release-candidate-reproduction" ], - "parameters": [ - { + "parameters": [{ "$ref": "#/components/parameters/location-scheme" }, { @@ -750,52 +731,52 @@ } }, "milking-visit": { - "$ref": "icarMilkingVisitEventResource.json" + "$ref": "icarMilkingVisitEventCollection.json" }, "mating-recommendation": { - "$ref": "icarReproMatingRecommendationResource.json" + "$ref": "icarReproMatingRecommendationCollection.json" }, "test-day-result": { - "$ref": "icarTestDayResource.json" + "$ref": "icarTestDayResultEventCollection.json" }, "birth": { - "$ref": "icarMovementBirthEventResource.json" + "$ref": "icarMovementBirthEventCollection.json" }, "death": { - "$ref": "icarMovementDeathEventResource.json" + "$ref": "icarMovementDeathEventCollection.json" }, "arrival": { - "$ref": "icarMovementArrivalEventResource.json" + "$ref": "icarMovementArrivalEventCollection.json" }, "departure": { - "$ref": "icarMovementDepartureEventResource.json" + "$ref": "icarMovementDepartureEventCollection.json" }, "animal": { - "$ref": "icarAnimalCoreResource.json" + "$ref": "icarAnimalCoreCollection.json" }, "pregnancy-check": { - "$ref": "icarReproPregnancyCheckEventResource.json" + "$ref": "icarReproPregnancyCheckEventCollection.json" }, "heat": { - "$ref": "icarReproHeatEventResource.json" + "$ref": "icarReproHeatEventCollection.json" }, "insemination": { - "$ref": "icarReproInseminationEventResource.json" + "$ref": "icarReproInseminationEventCollection.json" }, "drying-off": { - "$ref": "icarMilkingDryOffEventResource.json" + "$ref": "icarMilkingDryOffEventCollection.json" }, "abortion": { - "$ref": "icarReproAbortionEventResource.json" + "$ref": "icarReproAbortionEventCollection.json" }, "parturition": { - "$ref": "icarReproParturitionEventResource.json" + "$ref": "icarReproParturitionEventCollection.json" }, "weight": { - "$ref": "icarWeightEventResource.json" + "$ref": "icarWeightEventCollection.json" }, "device": { - "$ref": "icarDeviceResource.json" + "$ref": "icarDeviceCollection.json" } }, "parameters": { @@ -864,8 +845,14 @@ }, "examples": { "arrival": { - "value": [ - { + "value": { + "view": { + "totalItems": 1, + "totalPages": 1, + "pageSize": 10, + "currentPage": 1 + }, + "member": [{ "id": "ac9bdd26-0e20-44e7-b311-7d3d988f9717", "animal": { "id": "NL 919713288", @@ -883,23 +870,20 @@ "birthDate": "2013-11-06", "breedFractions": { "denominator": "8", - "fractions": [ - { - "breed": { - "id": "HF", - "scheme": "icar.org" - }, - "fraction": "8" - } - ] + "fractions": [{ + "breed": { + "id": "HF", + "scheme": "icar.org" + }, + "fraction": "8" + }] }, "coatColor": "RB", "managementTag": "88", "name": "NELLY 258", "productionPurpose": "Milk", "status": "Alive", - "parentage": [ - { + "parentage": [{ "parentOf": { "id": "NL 919713288", "scheme": "nl.ubn" @@ -927,12 +911,18 @@ } ] } - } - ] + }] + } }, "milking-visit": { - "value": [ - { + "value": { + "view": { + "totalItems": 1, + "totalPages": 1, + "pageSize": 10, + "currentPage": 1 + }, + "member": [{ "id": "706250", "animal": { "id": "NL 877034232", @@ -959,28 +949,23 @@ "measureDeviceId": "101", "eventOffset": "2019-11-01T23:58:31", "eventDeviceId": "101", - "quarterMilkings": [ - { - "icarQuarterId": "LF", - "milkingDuration": { - "value": "210", - "unitCode": "SEC" - }, - "milkingMilkWeight": { - "value": 3.5, - "unitCode": "KGM" - } - } - ], - "animalMilkingSample": [ - { - "bottleIdentifierType": "BRC", - "rackNumber": "3", - "bottlePosition": "7" + "quarterMilkings": [{ + "icarQuarterId": "LF", + "milkingDuration": { + "value": "210", + "unitCode": "SEC" + }, + "milkingMilkWeight": { + "value": 3.5, + "unitCode": "KGM" } - ], - "icarMilkCharacteristics": [ - { + }], + "animalMilkingSample": [{ + "bottleIdentifierType": "BRC", + "rackNumber": "3", + "bottlePosition": "7" + }], + "icarMilkCharacteristics": [{ "characteristic": "FAT", "value": "3.74", "unit": "VP", @@ -992,12 +977,18 @@ "unit": "VP" } ] - } - ] + }] + } }, "test-day-result": { - "value": [ - { + "value": { + "view": { + "totalItems": 1, + "totalPages": 1, + "pageSize": 10, + "currentPage": 1 + }, + "member": [{ "id": "706250", "animal": { "id": "NL 877034232", @@ -1009,8 +1000,7 @@ "unitCode": "KGM" }, "testDayCode": "0", - "icarMilkCharacteristics": [ - { + "icarMilkCharacteristics": [{ "characteristic": "FAT", "value": "3.74", "unit": "VP", @@ -1022,31 +1012,31 @@ "unit": "VP" } ] - } - ] + }] + } }, "insemination-finland": { "value": { "summary": "Example of insemination event messages from finnish milk recording organization", - "externalValue": "./examples/exampleInseminationEventResources_Finland.json" + "externalValue": "examples/exampleInseminationEventResources_Finland.json" } }, "pregnancy-check-finland": { "value": { "summary": "Example of pregnancy check event messages from finnish milk recording organization", - "externalValue": "./examples/examplePregnancyCheckEventResources_Finland.json" + "externalValue": "examples/examplePregnancyCheckEventResources_Finland.json" } }, "drying-off-finland": { "value": { "summary": "Example of drying off event messages from finnish milk recording organization", - "externalValue": "./examples/exampleDryOffEventResources_Finland.json" + "externalValue": "examples/exampleDryOffEventResources_Finland.json" } }, "drying-off-sweden": { "value": { "summary": "Example of drying off event messages from swedish milk recording organization", - "externalValue": "./examples/exampleDryOffEventResources_Sweden.json" + "externalValue": "examples/exampleDryOffEventResources_Sweden.json" } } } From fea8fcef7d2d511bb6ceaa6a8cf4686bd76fa732 Mon Sep 17 00:00:00 2001 From: Anton Hokkonen Date: Tue, 18 Feb 2020 20:47:41 +0200 Subject: [PATCH 3/3] Converted external examples into type based resource collections --- .../exampleDryOffEventResources_Finland.json | 86 +++++++------ .../exampleDryOffEventResources_Sweden.json | 86 +++++++------ ...pleInseminationEventResources_Finland.json | 68 ++++++----- ...ePregnancyCheckEventResources_Finland.json | 114 ++++++++++-------- 4 files changed, 192 insertions(+), 162 deletions(-) diff --git a/Release Candidate Messages/examples/exampleDryOffEventResources_Finland.json b/Release Candidate Messages/examples/exampleDryOffEventResources_Finland.json index b18ee26..67b83e8 100644 --- a/Release Candidate Messages/examples/exampleDryOffEventResources_Finland.json +++ b/Release Candidate Messages/examples/exampleDryOffEventResources_Finland.json @@ -1,42 +1,50 @@ -[ - { - "id": "4bd700b2-4f8b-4ab8-8cbf-7bb62d4e2bc3", - "animal": { - "id": "FI000010065148-2", - "scheme": "fi.animal-id" - }, - "eventDateTime": "2017-03-19T00:00:00", - "location": { - "id": "990000001", - "scheme": "fi.herd-id" - }, - "meta": { - "source": "fi.mro", - "creator": "v990000001", - "modified": "2017-03-29T08:49:06.0421042+00:00", - "created": "2017-03-29T08:49:06.0421042+00:00", - "validFrom": null, - "validTo": null - } +{ + "view": { + "totalItems": 2, + "totalPages": 1, + "pageSize": 10, + "currentPage": 1 }, - { - "id": "85ec425d-f079-437e-801b-88756c912102", - "animal": { - "id": "FI000010065150-1", - "scheme": "fi.animal-id" - }, - "eventDateTime": "2017-01-29T08:00:00", - "location": { - "id": "990000001", - "scheme": "fi.herd-id" + "member": [ + { + "id": "4bd700b2-4f8b-4ab8-8cbf-7bb62d4e2bc3", + "animal": { + "id": "FI000010065148-2", + "scheme": "fi.animal-id" + }, + "eventDateTime": "2017-03-19T00:00:00", + "location": { + "id": "990000001", + "scheme": "fi.herd-id" + }, + "meta": { + "source": "fi.mro", + "creator": "v990000001", + "modified": "2017-03-29T08:49:06.0421042+00:00", + "created": "2017-03-29T08:49:06.0421042+00:00", + "validFrom": null, + "validTo": null + } }, - "meta": { - "source": "fi.mro", - "creator": "v990000001", - "modified": "2017-01-29T08:49:06.1314223+00:00", - "created": "2017-01-29T08:49:06.1314223+00:00", - "validFrom": null, - "validTo": null + { + "id": "85ec425d-f079-437e-801b-88756c912102", + "animal": { + "id": "FI000010065150-1", + "scheme": "fi.animal-id" + }, + "eventDateTime": "2017-01-29T08:00:00", + "location": { + "id": "990000001", + "scheme": "fi.herd-id" + }, + "meta": { + "source": "fi.mro", + "creator": "v990000001", + "modified": "2017-01-29T08:49:06.1314223+00:00", + "created": "2017-01-29T08:49:06.1314223+00:00", + "validFrom": null, + "validTo": null + } } - } -] \ No newline at end of file + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/examples/exampleDryOffEventResources_Sweden.json b/Release Candidate Messages/examples/exampleDryOffEventResources_Sweden.json index b034deb..9e58215 100644 --- a/Release Candidate Messages/examples/exampleDryOffEventResources_Sweden.json +++ b/Release Candidate Messages/examples/exampleDryOffEventResources_Sweden.json @@ -1,42 +1,50 @@ -[ - { - "id": "1", - "animal": { - "id": "SE-801-2137-4", - "scheme": "se.animal-id" - }, - "eventDateTime": "2020-03-19T00:00:00", - "location": { - "id": "801", - "scheme": "se.herd-id" - }, - "meta": { - "source": "vxa.mro", - "creator": "bza632", - "modified": "2020-01-29T08:49:06.0421042+00:00", - "created": "2020-01-19T10:20:00.0421042+00:00", - "validFrom": null, - "validTo": null - } +{ + "view": { + "totalItems": 2, + "totalPages": 1, + "pageSize": 10, + "currentPage": 1 }, - { - "id": "2", - "animal": { - "id": "SE-801-4259-5", - "scheme": "se.animal-id" - }, - "eventDateTime": "2020-01-03T00:00:00", - "location": { - "id": "801", - "scheme": "se.herd-id" + "member": [ + { + "id": "1", + "animal": { + "id": "SE-801-2137-4", + "scheme": "se.animal-id" + }, + "eventDateTime": "2020-03-19T00:00:00", + "location": { + "id": "801", + "scheme": "se.herd-id" + }, + "meta": { + "source": "vxa.mro", + "creator": "bza632", + "modified": "2020-01-29T08:49:06.0421042+00:00", + "created": "2020-01-19T10:20:00.0421042+00:00", + "validFrom": null, + "validTo": null + } }, - "meta": { - "source": "vxa.mro", - "creator": "bza632", - "modified": "2020-01-18T08:49:06.1314223+00:00", - "created": "2020-01-03T10:29:00.0421042+00:00", - "validFrom": null, - "validTo": null + { + "id": "2", + "animal": { + "id": "SE-801-4259-5", + "scheme": "se.animal-id" + }, + "eventDateTime": "2020-01-03T00:00:00", + "location": { + "id": "801", + "scheme": "se.herd-id" + }, + "meta": { + "source": "vxa.mro", + "creator": "bza632", + "modified": "2020-01-18T08:49:06.1314223+00:00", + "created": "2020-01-03T10:29:00.0421042+00:00", + "validFrom": null, + "validTo": null + } } - } -] \ No newline at end of file + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/examples/exampleInseminationEventResources_Finland.json b/Release Candidate Messages/examples/exampleInseminationEventResources_Finland.json index a7418bc..d4f0a2c 100644 --- a/Release Candidate Messages/examples/exampleInseminationEventResources_Finland.json +++ b/Release Candidate Messages/examples/exampleInseminationEventResources_Finland.json @@ -1,35 +1,41 @@ -[ - { - "id": "4bd700b2-4f8b-4ab8-8cbf-7bb62d4e2bc3", - "animal": { - "id": "FI000010065148-2", - "scheme": "fi.animal-id" - }, - "eventDateTime": "2017-03-19T00:00:00", - "location": { - "id": "990000001", - "scheme": "fi.herd-id" - }, - "inseminationType": "Insemination", - "sireIdentifiers": [ - { +{ + "view": { + "totalItems": 1, + "totalPages": 1, + "pageSize": 10, + "currentPage": 1 + }, + "member": [ + { + "id": "4bd700b2-4f8b-4ab8-8cbf-7bb62d4e2bc3", + "animal": { + "id": "FI000010065148-2", + "scheme": "fi.animal-id" + }, + "eventDateTime": "2017-03-19T00:00:00", + "location": { + "id": "990000001", + "scheme": "fi.herd-id" + }, + "inseminationType": "Insemination", + "sireIdentifiers": [{ "id": "FI000013718337-8", "scheme": "fi.animal-id" + }], + "sireOfficialName": "3-95890", + "sireURI": null, + "semenFromFarmStocks": true, + "farmContainer": 6202, + "straw": null, + "embryo": null, + "meta": { + "source": "fi.mro", + "creator": "v990000001", + "modified": "2017-03-29T08:49:06.0421042+00:00", + "created": "2017-03-29T08:49:06.0421042+00:00", + "validFrom": null, + "validTo": null } - ], - "sireOfficialName": "3-95890", - "sireURI": null, - "semenFromFarmStocks": true, - "farmContainer": 6202, - "straw": null, - "embryo": null, - "meta": { - "source": "fi.mro", - "creator": "v990000001", - "modified": "2017-03-29T08:49:06.0421042+00:00", - "created": "2017-03-29T08:49:06.0421042+00:00", - "validFrom": null, - "validTo": null } - } -] \ No newline at end of file + ] +} \ No newline at end of file diff --git a/Release Candidate Messages/examples/examplePregnancyCheckEventResources_Finland.json b/Release Candidate Messages/examples/examplePregnancyCheckEventResources_Finland.json index fe96f25..1568105 100644 --- a/Release Candidate Messages/examples/examplePregnancyCheckEventResources_Finland.json +++ b/Release Candidate Messages/examples/examplePregnancyCheckEventResources_Finland.json @@ -1,56 +1,64 @@ -[ - { - "id": "4bd700b2-4f8b-4ab8-8cbf-7bb62d4e2bc3", - "animal": { - "id": "FI000010773604-2", - "scheme": "fi.animal-id" - }, - "eventDateTime": "2018-03-19T00:00:00", - "location": { - "id": "9900001", - "scheme": "fi.herd-id" - }, - "method": "Palpation", - "result": "Unknown", - "foetalAge": null, - "foetusCount": null, - "foetusCountMale": null, - "foetusCountFemale": null, - "exceptions": null, - "meta": { - "source": "fi.mro", - "creator": "v9900001", - "modified": "2018-03-29T08:49:06.0421042+00:00", - "created": "2018-03-19T08:49:06.0421042+00:00", - "validFrom": null, - "validTo": null - } +{ + "view": { + "totalItems": 1, + "totalPages": 1, + "pageSize": 10, + "currentPage": 1 }, - { - "id": "85ec425d-f079-437e-801b-88756c912102", - "animal": { - "id": "FI000010065148-1", - "scheme": "fi.animal-id" - }, - "eventDateTime": "2018-04-03T00:00:00", - "location": { - "id": "9900001", - "scheme": "fi.herd-id" + "member": [ + { + "id": "4bd700b2-4f8b-4ab8-8cbf-7bb62d4e2bc3", + "animal": { + "id": "FI000010773604-2", + "scheme": "fi.animal-id" + }, + "eventDateTime": "2018-03-19T00:00:00", + "location": { + "id": "9900001", + "scheme": "fi.herd-id" + }, + "method": "Palpation", + "result": "Unknown", + "foetalAge": null, + "foetusCount": null, + "foetusCountMale": null, + "foetusCountFemale": null, + "exceptions": null, + "meta": { + "source": "fi.mro", + "creator": "v9900001", + "modified": "2018-03-29T08:49:06.0421042+00:00", + "created": "2018-03-19T08:49:06.0421042+00:00", + "validFrom": null, + "validTo": null + } }, - "method": "Palpation", - "result": "Pregnant", - "foetalAge": null, - "foetusCount": null, - "foetusCountMale": null, - "foetusCountFemale": null, - "exceptions": null, - "meta": { - "source": "fi.mro", - "creator": "v9900001", - "modified": "2018-04-29T08:49:06.0421042+00:00", - "created": "2018-04-19T08:49:06.0421042+00:00", - "validFrom": null, - "validTo": null + { + "id": "85ec425d-f079-437e-801b-88756c912102", + "animal": { + "id": "FI000010065148-1", + "scheme": "fi.animal-id" + }, + "eventDateTime": "2018-04-03T00:00:00", + "location": { + "id": "9900001", + "scheme": "fi.herd-id" + }, + "method": "Palpation", + "result": "Pregnant", + "foetalAge": null, + "foetusCount": null, + "foetusCountMale": null, + "foetusCountFemale": null, + "exceptions": null, + "meta": { + "source": "fi.mro", + "creator": "v9900001", + "modified": "2018-04-29T08:49:06.0421042+00:00", + "created": "2018-04-19T08:49:06.0421042+00:00", + "validFrom": null, + "validTo": null + } } - } -] \ No newline at end of file + ] +} \ No newline at end of file