diff --git a/resources/exampleErrorResource.json b/resources/exampleErrorResource.json index b1a4a7f..3045cde 100644 --- a/resources/exampleErrorResource.json +++ b/resources/exampleErrorResource.json @@ -1,18 +1,18 @@ { - "description": "An extention to a RFC7807 compliant problem response for JSON APIs", + "description": "An extension to an (almost) RFC7807 compliant problem response for JSON APIs.", "type": "object", "properties": { - "type": { + "id": { "type": "string", - "format": "uri", - "description": "Machine readable URI that uniquely defines the problem." + "description": "Machine readable URI that uniquely defines the problem (this field should really be called 'type')." }, "status": { "type": "integer", - "description": "The HTTP status code applicable to this problem", - "format": "int32" + "description": "The HTTP status code applicable to this problem.", + "format": "int32", + "nullable": true }, "title": { "type": "string", @@ -24,24 +24,8 @@ }, "instance": { "type": "string", - "description": "A URI reference or internal JSON document reference to the specific data resource that caused the problem." - }, - "instanceIdentification": { - "type": "object", - "properties": { - "source": { - "type": "string", - "description": "Identifies the source of the resource as contained in the resource metadata." - }, - "sourceId": { - "type": "string", - "description": "Identifies the resource using its source identifier as contained in the resource metadata." - }, - "hostId": { - "type": "string", - "description": "If specified, identifies the resource with a unique Id (UUID) in the host system." - } - } + "description": "A URI reference or internal JSON document reference to the specific data item that caused the problem.", + "nullable": true } } } \ No newline at end of file diff --git a/resources/icarBatchResult.json b/resources/icarBatchResult.json new file mode 100644 index 0000000..a064c83 --- /dev/null +++ b/resources/icarBatchResult.json @@ -0,0 +1,30 @@ +{ + "description": "Returned by a batch POST event to return identity (meta), errors, and warnings for a resource.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier created in the system for this event. SHOULD be a UUID." + }, + "meta": { + "$ref": "../types/icarMetaDataType.json", + "description": "Metadata for the posted resource. Allows specification of the source, source Id to synchronise data." + }, + "errors": { + "type": "array", + "description": "An arry of errors for this resource.", + "nullable": true, + "items": { + "$ref": "../resources/icarErrorResource.json" + } + }, + "warnings": { + "type": "array", + "description": "An arry of warnings for this resource.", + "nullable": true, + "items": { + "$ref": "../resources/icarErrorResource.json" + } + } + } +} \ No newline at end of file diff --git a/resources/icarErrorResource.json b/resources/icarErrorResource.json new file mode 100644 index 0000000..aab32e3 --- /dev/null +++ b/resources/icarErrorResource.json @@ -0,0 +1,31 @@ +{ + "description": "An RFC7807 compliant problem response for JSON APIs.", + + "type": "object", + + "properties": { + "type": { + "type": "string", + "description": "Machine readable URI or code that defines the type of error or warning." + }, + "status": { + "type": "integer", + "description": "The HTTP status code applicable to this problem.", + "format": "int32", + "nullable": true + }, + "title": { + "type": "string", + "description": "A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization." + }, + "detail": { + "type": "string", + "description": "A human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized." + }, + "instance": { + "type": "string", + "description": "A URI reference or internal JSON document reference to the specific data item that caused the problem.", + "nullable": true + } + } +} \ No newline at end of file diff --git a/url-schemes/healthURLScheme.json b/url-schemes/healthURLScheme.json index 73b4126..586fa0b 100644 --- a/url-schemes/healthURLScheme.json +++ b/url-schemes/healthURLScheme.json @@ -319,35 +319,35 @@ ], "requestBody": { "required": true, - "description": "The collection of health diagnosis events 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.\nAlthough a collection is used, servers SHALL IGNORE any pagination-related attributes.\n", + "description": "The collection of health diagnosis events 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/icarDiagnosisEventCollection" + "$ref": "#/components/schemas/icarDiagnosisEventArray" } } } }, "responses": { "200": { - "description": "Successful. The response contains a copy of the collection, as modifed by the server.", + "description": "Successful. The response contains a set of batch results, which may include warnings.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/icarDiagnosisEventCollection" + "$ref": "#/components/schemas/batchResults" } } } }, "201": { - "description": "Created. The Location header contains the URI to the collection, as modified by the server.", + "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 new resource." + "description": "Contains the URI to the results." } } }, @@ -364,7 +364,14 @@ } }, "default": { - "$ref": "#/components/responses/default" + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } } } } @@ -387,35 +394,35 @@ ], "requestBody": { "required": true, - "description": "The collection of health treatment events 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.\nAlthough a collection is used, servers SHALL IGNORE any pagination-related attributes.\n", + "description": "The collection of health treatment events 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/icarTreatmentEventCollection" + "$ref": "#/components/schemas/icarTreatmentEventArray" } } } }, "responses": { "200": { - "description": "Successful. The response contains a copy of the collection, as modifed by the server.", + "description": "Successful. The response contains a set of batch results, which may include warnings.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/icarDiagnosisEventCollection" + "$ref": "#/components/schemas/batchResults" } } } }, "201": { - "description": "Created. The Location header contains the URI to the collection, as modified by the server.", + "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 a collection of new resources." + "description": "Contains the URI to the results." } } }, @@ -432,7 +439,14 @@ } }, "default": { - "$ref": "#/components/responses/default" + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } } } } @@ -455,35 +469,35 @@ ], "requestBody": { "required": true, - "description": "The collection of health treatment program events 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.\nAlthough a collection is used, servers SHALL IGNORE any pagination-related attributes.\n", + "description": "The collection of health treatment program events 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/icarTreatmentProgramEventCollection" + "$ref": "#/components/schemas/icarTreatmentProgramEventArray" } } } }, "responses": { "200": { - "description": "Successful. The response contains a copy of the collection, as modifed by the server.", + "description": "Successful. The response contains a set of batch results, which may include warnings.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/icarTreatmentProgramEventCollection" + "$ref": "#/components/schemas/batchResults" } } } }, "201": { - "description": "Created. The Location header contains the URI to the collection, as modified by the server.", + "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 a collection of new resources." + "description": "Contains the URI to the results." } } }, @@ -500,7 +514,14 @@ } }, "default": { - "$ref": "#/components/responses/default" + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } } } } @@ -508,8 +529,14 @@ }, "components": { "schemas": { + "batchResults": { + "type": "array", + "items": { + "$ref": "../resources/icarBatchResult.json" + } + }, "error": { - "$ref": "../resources/exampleErrorResource.json" + "$ref": "../resources/icarErrorResource.json" }, "icarDiagnosisEvent": { "$ref": "../resources/icarDiagnosisEventResource.json" @@ -517,17 +544,35 @@ "icarDiagnosisEventCollection": { "$ref": "../collections/icarDiagnosisEventCollection.json" }, + "icarDiagnosisEventArray": { + "type": "array", + "items": { + "$ref": "../resources/icarDiagnosisEventResource.json" + } + }, "icarTreatmentEvent": { "$ref": "../resources/icarTreatmentEventResource.json" }, "icarTreatmentEventCollection": { "$ref": "../collections/icarTreatmentEventCollection.json" }, + "icarTreatmentEventArray": { + "type": "array", + "items": { + "$ref": "../resources/icarTreatmentEventResource.json" + } + }, "icarTreatmentProgramEvent": { "$ref": "../resources/icarTreatmentProgramEventResource.json" }, "icarTreatmentProgramEventCollection": { "$ref": "../collections/icarTreatmentProgramEventCollection.json" + }, + "icarTreatmentProgramEventArray": { + "type": "array", + "items": { + "$ref": "../resources/icarTreatmentProgramEventResource.json" + } } }, "parameters": {