diff --git a/collections/icarFeedTransactionCollection.json b/collections/icarFeedTransactionCollection.json new file mode 100644 index 0000000..caa4703 --- /dev/null +++ b/collections/icarFeedTransactionCollection.json @@ -0,0 +1,21 @@ +{ + "description": "Represents a collection of feed inventory transactions. Based on icarResourceCollection to provide paging etc.", + + "allOf": [{ + "$ref": "../collections/icarResourceCollection.json" + }, + { + "type": "object", + + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "../resources/icarFeedTransactionResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case inventory transactions." + } + } + } + ] +} \ No newline at end of file diff --git a/collections/icarInventoryTransactionCollection.json b/collections/icarInventoryTransactionCollection.json new file mode 100644 index 0000000..d80ef06 --- /dev/null +++ b/collections/icarInventoryTransactionCollection.json @@ -0,0 +1,21 @@ +{ + "description": "Represents a collection of inventory transactions. Based on icarResourceCollection to provide paging etc.", + + "allOf": [{ + "$ref": "../collections/icarResourceCollection.json" + }, + { + "type": "object", + + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "../resources/icarInventoryTransactionResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case inventory transactions." + } + } + } + ] +} \ No newline at end of file diff --git a/collections/icarMedicineTransactionCollection.json b/collections/icarMedicineTransactionCollection.json new file mode 100644 index 0000000..2977aa5 --- /dev/null +++ b/collections/icarMedicineTransactionCollection.json @@ -0,0 +1,21 @@ +{ + "description": "Represents a collection of medicine inventory transactions. Based on icarResourceCollection to provide paging etc.", + + "allOf": [{ + "$ref": "../collections/icarResourceCollection.json" + }, + { + "type": "object", + + "properties": { + "member": { + "type": "array", + "items": { + "$ref": "../resources/icarMedicineTransactionResource.json" + }, + "description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case inventory transactions." + } + } + } + ] +} \ No newline at end of file diff --git a/enums/icarInventoryTransactionKindType.json b/enums/icarInventoryTransactionKindType.json new file mode 100644 index 0000000..fd94266 --- /dev/null +++ b/enums/icarInventoryTransactionKindType.json @@ -0,0 +1,11 @@ +{ + "description": "Defines the kinds of inventory transaction, which can represent items received, disposed of (including sale or destruction), used, counted in a stocktake or calculated on hand.", + "type": "string", + "enum": [ + "Receipt", + "Disposal", + "OnHand", + "StockTake", + "Use" + ] +} \ No newline at end of file diff --git a/enums/icarProductFamilyType.json b/enums/icarProductFamilyType.json new file mode 100644 index 0000000..894bba6 --- /dev/null +++ b/enums/icarProductFamilyType.json @@ -0,0 +1,16 @@ +{ + "description": "Defines the families of products", + "type": "string", + "enum": [ + "Animal Feeds", + "Animal Reproductive Products", + "Veterinary Supplies", + "Seed and Plant Material", + "Fertilisers and Nutrients", + "Pest Control Products", + "Other Animal Products", + "Milking Supplies", + "Fencing Supplies", + "Water System Supplies" + ] +} \ No newline at end of file diff --git a/resources/icarFeedTransactionResource.json b/resources/icarFeedTransactionResource.json new file mode 100644 index 0000000..ac416fc --- /dev/null +++ b/resources/icarFeedTransactionResource.json @@ -0,0 +1,24 @@ +{ + "description": "An inventory transaction resource for a feed product.", + "type": "object", + + "allOf": [ + { + "$ref": "../types/icarInventoryTransactionType.json" + }, + { + "type": "object", + + "required": [ + "product" + ], + + "properties": { + "product": { + "$ref": "../types/icarFeedReferenceType.json", + "description": "The feed product in this transaction." + } + } + } + ] +} \ No newline at end of file diff --git a/resources/icarInventoryTransactionResource.json b/resources/icarInventoryTransactionResource.json new file mode 100644 index 0000000..60af4f5 --- /dev/null +++ b/resources/icarInventoryTransactionResource.json @@ -0,0 +1,22 @@ +{ + "description": "Generic inventory transaction resource. Some product families have specific transaction resources (e.g. medicines, feeds).", + + "allOf": [ + { + "$ref": "../types/icarInventoryTransactionType.json" + }, + { + "type": "object", + + "required": [ + "product" + ], + "properties": { + "product": { + "$ref": "../types/icarProductReferenceType.json", + "description": "The product in this inventory transaction." + } + } + } + ] +} \ No newline at end of file diff --git a/resources/icarMedicineTransactionResource.json b/resources/icarMedicineTransactionResource.json new file mode 100644 index 0000000..a620fee --- /dev/null +++ b/resources/icarMedicineTransactionResource.json @@ -0,0 +1,23 @@ +{ + "description": "An inventory transaction resource for a medicine product.", + + "allOf": [ + { + "$ref": "../types/icarInventoryTransactionType.json" + }, + { + "type": "object", + + "required": [ + "product" + ], + + "properties": { + "product": { + "$ref": "../types/icarMedicineReferenceType.json", + "description": "The medicine product in this transaction." + } + } + } + ] +} \ No newline at end of file diff --git a/types/icarFeedReferenceType.json b/types/icarFeedReferenceType.json new file mode 100644 index 0000000..ba4e22d --- /dev/null +++ b/types/icarFeedReferenceType.json @@ -0,0 +1,22 @@ +{ + "description": "Feed Reference defines a feed product.", + + "allOf": [ + { + "$ref": "../types/icarProductReferenceType.json" + }, + { + "type": "object", + "properties": { + "category": { + "$ref": "../enums/icarFeedCategoryType.json", + "description": "Defines the category of the feed product." + }, + "type": { + "$ref": "../types/icarFeedIdentifierType.json", + "description": "The scheme + id identifying the type of feed." + } + } + } + ] +} \ No newline at end of file diff --git a/types/icarInventoryTransactionType.json b/types/icarInventoryTransactionType.json new file mode 100644 index 0000000..63a25f1 --- /dev/null +++ b/types/icarInventoryTransactionType.json @@ -0,0 +1,58 @@ +{ + "description": "Inventory Transaction defines a transaction on a product inventory where the transaction may be a receipt, disposal, on hand, stocktake, use", + + "allOf": [ + { + "$ref": "../resources/icarEventCoreResource.json" + } + , + { + "type": "object", + + "required": [ + "transactionKind", + "quantity", + "units" + ], + + "properties": { + "transactionKind": { + "$ref": "../enums/icarInventoryTransactionKindType.json", + "description": "Identifies the transaction kind." + }, + "quantity": { + "type": "number", + "description": "The overall volume, weight or count of the product in the transaction in the units defined." + }, + "units": { + "description": "The units of the quantity specified. Where applicable it is recommended that uncefact mass and volume units are used.", + "type": "string" + }, + "supplierName": { + "type": "string", + "description": "The supplier of the product in this transaction. This is particularly relevant if the transaction is a receipt." + }, + "expiryDate": { + "$ref": "../types/icarDateTimeType.json", + "description": "The expiry date of the product supplied in the transaction." + }, + "totalCost": { + "type": "number", + "description": "Total cost applied to this transaction" + }, + "currency": { + "type": "string", + "description": "The currency of the cost expressed using the ISO 4217 3-character code (such as AUD, GBP, USD, EUR)." + }, + "packSize": { + "type": "number", + "description": "The volume or weight of the product in a pack in the units defined. Especially relevant for Vet Medicines." + }, + "numberOfPacks": { + "type": "number", + "description": "The number of packs of the product in the transaction. Especially relevant for Vet Medicines. Could be a decimal number for a part-pack." + } + } + } + ] +} \ No newline at end of file diff --git a/types/icarMedicineReferenceType.json b/types/icarMedicineReferenceType.json index a08b42e..b14851b 100644 --- a/types/icarMedicineReferenceType.json +++ b/types/icarMedicineReferenceType.json @@ -2,15 +2,12 @@ "description": "Provides basic details about a medicine and links to a medicine resource (if available).", "allOf": [ { - "$ref": "icarResourceReferenceType.json" + "$ref": "../types/icarProductReferenceType.json" }, { "type": "object", "properties": { - "name": { - "type": "string", - "description": "Name of the medicine or remedy given for this treatment" - }, + "approved": { "type": "string", "description": "An indicator whether the medicine or remedy is an approved medicine" diff --git a/types/icarProductIdentifierType.json b/types/icarProductIdentifierType.json new file mode 100644 index 0000000..dc7f4c9 --- /dev/null +++ b/types/icarProductIdentifierType.json @@ -0,0 +1,9 @@ +{ + "description": "Provides a scheme + identifier mechanism for product types.", + + "allOf": [ + { + "$ref": "../types/icarIdentifierType.json" + } + ] +} \ No newline at end of file diff --git a/types/icarProductReferenceType.json b/types/icarProductReferenceType.json new file mode 100644 index 0000000..c503b0b --- /dev/null +++ b/types/icarProductReferenceType.json @@ -0,0 +1,44 @@ +{ + "description": "Product Reference refers to a specific product. It is based on the generalised resource reference type.", + "type": "object", + + "allOf": [ + { + "$ref": "../types/icarResourceReferenceType.json" + }, + { + "type": "object", + + "required": [ + "identifier", + "family" + ], + + "properties": { + "identifiers": { + "type": "array", + "description": "An array of product identifiers. This allows a product to have multiple identifiers for manufacturers, distributors, official registrations, etc.", + "items": { + "$ref": "../types/icarProductIdentifierType.json" + } + }, + "family": { + "$ref": "../enums/icarProductFamilyType.json", + "description": "The product family to which this product belongs." + }, + "name": { + "type": "string", + "description": "The name of the product." + }, + "gtin": { + "type": "string", + "description": "GS1 global trade item number." + }, + "unspc": { + "type": "string", + "description": "UN service and product code (the code, not the accompanying description)." + } + } + } + ] +} \ No newline at end of file diff --git a/url-schemes/exampleUrlScheme.json b/url-schemes/exampleUrlScheme.json index ec7b2d1..6e37583 100644 --- a/url-schemes/exampleUrlScheme.json +++ b/url-schemes/exampleUrlScheme.json @@ -2251,6 +2251,162 @@ } } } + }, + "/locations/{location-scheme}/{location-id}/inventory-transactions": { + "get": { + "operationId": "get-inventory-transactions", + "summary": "Get the inventory transactions that relate to a certain location", + "description": "# Purpose\nProvides the inventory transactions relating to a location\n", + "tags": [ + "ADE-1.3-management" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/date-from" + }, + { + "$ref": "#/components/parameters/date-to" + }, + { + "$ref": "#/components/parameters/family" + }, + { + "$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 inventory transactions for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarInventoryTransactionCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/feed-inventory-transactions": { + "get": { + "operationId": "get-feed-inventory-transactions", + "summary": "Get the feed inventory transactions that relate to a certain location", + "description": "# Purpose\nProvides the feed inventory transactions relating to a location\n", + "tags": [ + "ADE-1.3-management" + ], + "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 feed inventory transactions for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarFeedTransactionCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/medicine-inventory-transactions": { + "get": { + "operationId": "get-medicine-inventory-transactions", + "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" + ], + "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 medicine inventory transactions for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMedicineTransactionCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } } }, "components": { @@ -2419,6 +2575,15 @@ }, "icarCarcassObservationsEventCollection" : { "$ref": "../collections/icarCarcassObservationsEventCollection.json" + }, + "icarInventoryTransactionCollection": { + "$ref": "../collections/icarInventoryTransactionCollection.json" + }, + "icarFeedTransactionCollection": { + "$ref": "../collections/icarFeedTransactionCollection.json" + }, + "icarMedicineTransactionCollection": { + "$ref": "../collections/icarMedicineTransactionCollection.json" } }, "parameters": { @@ -2490,7 +2655,16 @@ "$ref": "../enums/icarStatisticsPurposeType.json" } }, - "report-start-date-time": { + "family": { + "name": "family", + "in": "query", + "description": "The family of products.", + "required": false, + "schema": { + "$ref": "../enums/icarProductFamilyType.json" + } + }, + "report-start-date-time": { "name": "report-start-date-time", "in": "query", "description": "The start of the date-time range for the data to get in the request based on the event date time.", @@ -2543,6 +2717,24 @@ "schema": { "type": "string" } + }, + "identifier-scheme": { + "name": "identifier-scheme", + "in": "query", + "description": "The scheme for an identifier.", + "required": false, + "schema": { + "type": "string" + } + }, + "identifier-id": { + "name": "identifier-id", + "in": "query", + "description": "The unique identifier within a scheme.", + "required": false, + "schema": { + "type": "string" + } } }, "responses": { diff --git a/url-schemes/feedURLscheme.json b/url-schemes/feedURLscheme.json index adf5fae..cf7fe39 100644 --- a/url-schemes/feedURLscheme.json +++ b/url-schemes/feedURLscheme.json @@ -597,6 +597,123 @@ } } }, + "/locations/{location-scheme}/{location-id}/feed-inventory-transactions": { + "get": { + "operationId": "get-feed-inventory-transactions", + "summary": "Get the feed inventory transactions that relate to a certain location", + "description": "# Purpose\nProvides the feed inventory transactions relating to a location\n", + "tags": [ + "ADE-1.3-feed" + ], + "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 feed inventory transactions for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarFeedTransactionCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-feed-inventory-transaction", + "summary": "Add a single new feed inventory transaction.", + "description": "# Purpose\nAllows a client to add a single feed inventory transaction.\n", + "tags": [ + "ADE-1.3-feed" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The feed inventory transaction to create. \nA client MAY fill in the *Id* field with a client-generated UUID and the server MAY use this *Id*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarFeedTransactionResource" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the event, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarFeedTransactionResource" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the new resource." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, "/batches/locations/{location-scheme}/{location-id}/feeds": { "post": { "operationId": "post-batch-feeds", @@ -971,6 +1088,81 @@ } } } + }, + "/batches/locations/{location-scheme}/{location-id}/feed-inventory-transactions": { + "post": { + "operationId": "post-batch-feed-inventory-transactions", + "summary": "Add an array of feed inventory transactions.", + "description": "# Purpose \nAllows a client to add a collection of feed inventory transactions.\n", + "tags": [ + "ADE-1.3-feed" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of feed inventory transactions to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarFeedTransactionArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } } }, "components": { @@ -1043,7 +1235,19 @@ }, "icarFeedReportCollection": { "$ref": "../collections/icarFeedReportCollection.json" - } + }, + "icarFeedTransactionResource": { + "$ref": "../resources/icarFeedTransactionResource.json" + }, + "icarFeedTransactionCollection": { + "$ref": "../collections/icarFeedTransactionCollection.json" + }, + "icarFeedTransactionArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarFeedTransactionResource" + } + } }, "parameters": { "location-scheme": { @@ -1099,7 +1303,44 @@ "type": "string", "format": "date-time" } - } + }, + "date-from": { + "name": "date-to", + "in": "query", + "description": "The end of the date range for the period for which data is needed, the date inclusive.", + "schema": { + "type": "string", + "format": "date" + } + }, + "date-to": { + "name": "date-from", + "in": "query", + "description": "The start of the date range for the period for which data is needed, the date inclusive.", + "schema": { + "type": "string", + "format": "date" + } + }, + "identifier-scheme": { + "name": "identifier-scheme", + "in": "query", + "description": "The scheme for an identifier.", + "required": false, + "schema": { + "type": "string" + } + }, + "identifier-id": { + "name": "identifier-id", + "in": "query", + "description": "The unique identifier within a scheme.", + "required": false, + "schema": { + "type": "string" + } + } + }, "responses": { "default": { diff --git a/url-schemes/healthURLScheme.json b/url-schemes/healthURLScheme.json index ba7c4a8..c5814a1 100644 --- a/url-schemes/healthURLScheme.json +++ b/url-schemes/healthURLScheme.json @@ -475,6 +475,105 @@ } } }, + "/locations/{location-scheme}/{location-id}/medicine-transaction": { + "get": { + "operationId": "get-medicine-inventory-transaction", + "summary": "Get medicine inventory transactions.", + "description": "# Purpose\nProvides the medicine inventory transactions for a location\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 medicine inventory transactions for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMedicineTransactionCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-medicine-inventory-transaction", + "summary": "Add a single new medicine inventory transaction.", + "description": "# Purpose \nAllows a client to add a single medicine inventory transaction.\n", + "tags": [ + "ADE-1.3-health" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The medicine transaction resource to create. \nA client MAY fill in the *ID* field with a client-generated UUID and the server MAY use this *ID*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\nThis applies to all resource *ID* and *meta* objects in the *icarTreatmentProgramEvent*.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMedicineTransactionResource" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the resource, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarHealthStatusObservedEvent" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource." + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status." + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, "/batches/locations/{location-scheme}/{location-id}/diagnoses": { "post": { "operationId": "post-batch-Diagnosis", @@ -849,6 +948,81 @@ } } } + }, + "/batches/locations/{location-scheme}/{location-id}/medicine-inventory-transactions": { + "post": { + "operationId": "post-batch-medicine-inventory-transactions", + "summary": "Add an array of medicine inventory transactions.", + "description": "# Purpose \nAllows a client to add a collection of medicine inventory transactions.\n", + "tags": [ + "ADE-1.3-health" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of medicine inventory transactions to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMedicineTransactionArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } } }, "components": { @@ -918,7 +1092,19 @@ "items": { "$ref": "../resources/icarHealthStatusObservedEventResource.json" } - } + }, + "icarMedicineTransactionResource": { + "$ref": "../resources/icarMedicineTransactionResource.json" + }, + "icarMedicineTransactionCollection": { + "$ref": "../collections/icarMedicineTransactionCollection.json" + }, + "icarMedicineTransactionArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarMedicineTransactionResource" + } + } }, "parameters": { "location-scheme": { @@ -956,6 +1142,42 @@ "type": "string", "format": "date-time" } + }, + "date-from": { + "name": "date-to", + "in": "query", + "description": "The end of the date range for the period for which data is needed, the date inclusive.", + "schema": { + "type": "string", + "format": "date" + } + }, + "date-to": { + "name": "date-from", + "in": "query", + "description": "The start of the date range for the period for which data is needed, the date inclusive.", + "schema": { + "type": "string", + "format": "date" + } + }, + "identifier-scheme": { + "name": "identifier-scheme", + "in": "query", + "description": "The scheme for an identifier.", + "required": false, + "schema": { + "type": "string" + } + }, + "identifier-id": { + "name": "identifier-id", + "in": "query", + "description": "The unique identifier within a scheme.", + "required": false, + "schema": { + "type": "string" + } } }, "responses": { diff --git a/url-schemes/managementURLScheme.json b/url-schemes/managementURLScheme.json index dd6fc99..ff9fd65 100644 --- a/url-schemes/managementURLScheme.json +++ b/url-schemes/managementURLScheme.json @@ -484,6 +484,162 @@ } } }, + "/locations/{location-scheme}/{location-id}/inventory-transactions": { + "get": { + "operationId": "get-inventory-transactions", + "summary": "Get the inventory transactions that relate to a certain location", + "description": "# Purpose\nProvides the inventory transactions relating to a location\n", + "tags": [ + "ADE-1.3-management" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/date-from" + }, + { + "$ref": "#/components/parameters/date-to" + }, + { + "$ref": "#/components/parameters/family" + }, + { + "$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 inventory transactions for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarInventoryTransactionCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/feed-inventory-transactions": { + "get": { + "operationId": "get-feed-inventory-transactions", + "summary": "Get the feed inventory transactions that relate to a certain location", + "description": "# Purpose\nProvides the feed inventory transactions relating to a location\n", + "tags": [ + "ADE-1.3-management" + ], + "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 feed inventory transactions for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarFeedTransactionCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/medicine-inventory-transactions": { + "get": { + "operationId": "get-medicine-inventory-transactions", + "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" + ], + "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 medicine inventory transactions for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMedicineTransactionCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, "/batches/locations/{location-scheme}/{location-id}/animal-sets": { "post": { "operationId": "post-batch-animal-sets", @@ -783,6 +939,231 @@ } } } + }, + "/batches/locations/{location-scheme}/{location-id}/inventory-transactions": { + "post": { + "operationId": "post-batch-inventory-transactions", + "summary": "Add an array of inventory transactions.", + "description": "# Purpose \nAllows a client to add a collection of inventory transactions.\n", + "tags": [ + "ADE-1.3-management" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of inventory transactions to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarInventoryTransactionArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + }, + "/batches/locations/{location-scheme}/{location-id}/feed-transactions": { + "post": { + "operationId": "post-batch-feed-transactions", + "summary": "Add an array of feed inventory transactions.", + "description": "# Purpose \nAllows a client to add a collection of feed inventory transactions.\n", + "tags": [ + "ADE-1.3-management" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of feed inventory transactions to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarFeedTransactionArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + }, + "/batches/locations/{location-scheme}/{location-id}/medicine-transactions": { + "post": { + "operationId": "post-batch-medicine-transactions", + "summary": "Add an array of medicine inventory transactions.", + "description": "# Purpose \nAllows a client to add a collection of medicine inventory transactions.\n", + "tags": [ + "ADE-1.3-management" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of medicine inventory transactions to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMedicineTransactionArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } } }, "components": { @@ -843,6 +1224,42 @@ "items": { "$ref": "#/components/schemas/icarDeviceResource" } + }, + "icarInventoryTransactionResource": { + "$ref": "../resources/icarInventoryTransactionResource.json" + }, + "icarInventoryTransactionCollection": { + "$ref": "../collections/icarInventoryTransactionCollection.json" + }, + "icarInventoryTransactionArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarInventoryTransactionResource" + } + }, + "icarFeedTransactionResource": { + "$ref": "../resources/icarFeedTransactionResource.json" + }, + "icarFeedTransactionCollection": { + "$ref": "../collections/icarFeedTransactionCollection.json" + }, + "icarFeedTransactionArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarFeedTransactionResource" + } + }, + "icarMedicineTransactionResource": { + "$ref": "../resources/icarMedicineTransactionResource.json" + }, + "icarMedicineTransactionCollection": { + "$ref": "../collections/icarMedicineTransactionCollection.json" + }, + "icarMedicineTransactionArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarMedicineTransactionResource" + } } }, "parameters": { @@ -908,6 +1325,33 @@ "schema": { "$ref": "../enums/icarStatisticsPurposeType.json" } + }, + "family": { + "name": "family", + "in": "query", + "description": "The family of products.", + "required": false, + "schema": { + "$ref": "../enums/icarProductFamilyType.json" + } + }, + "identifier-scheme": { + "name": "identifier-scheme", + "in": "query", + "description": "The scheme for an identifier.", + "required": false, + "schema": { + "type": "string" + } + }, + "identifier-id": { + "name": "identifier-id", + "in": "query", + "description": "The unique identifier within a scheme.", + "required": false, + "schema": { + "type": "string" + } } }, "responses": { diff --git a/well-known/icarProductIdentifierType.md b/well-known/icarProductIdentifierType.md new file mode 100644 index 0000000..fffe3e9 --- /dev/null +++ b/well-known/icarProductIdentifierType.md @@ -0,0 +1,4 @@ +# Well-known Product Schemes + +| Short URI | Resolvable URI | Organisation | Description | +| --- | --- | --- | --- |