From 1f64a77f609126129409249e4ae37f5fee56bf56 Mon Sep 17 00:00:00 2001 From: Sebastian Iancu Date: Wed, 13 Mar 2024 09:38:06 +0100 Subject: [PATCH] adding GROUP, ORGANISATION and ROLE resources (#99 SPECITS-70) --- specifications/demographic.openapi.yaml | 94 +++++++++++++++++++ specifications/headers/Location_GROUP.yaml | 6 ++ .../headers/Location_ORGANISATION.yaml | 6 ++ specifications/headers/Location_ROLE.yaml | 6 ++ .../Location_VERSIONED_GROUP_VERSION.yaml | 6 ++ ...cation_VERSIONED_ORGANISATION_VERSION.yaml | 6 ++ .../Location_VERSIONED_ROLE_VERSION.yaml | 6 ++ specifications/operations/group_create.yaml | 25 +++++ specifications/operations/group_delete.yaml | 20 ++++ specifications/operations/group_get.yaml | 23 +++++ specifications/operations/group_update.yaml | 35 +++++++ .../operations/organisation_create.yaml | 25 +++++ .../operations/organisation_delete.yaml | 20 ++++ .../operations/organisation_get.yaml | 23 +++++ .../operations/organisation_update.yaml | 35 +++++++ specifications/operations/role_create.yaml | 25 +++++ specifications/operations/role_delete.yaml | 20 ++++ specifications/operations/role_get.yaml | 23 +++++ specifications/operations/role_update.yaml | 35 +++++++ .../operations/versioned_group_get.yaml | 13 +++ .../versioned_group_revision_history.yaml | 13 +++ .../versioned_group_version_get_at_time.yaml | 16 ++++ .../versioned_group_version_get_by_id.yaml | 14 +++ .../versioned_organisation_get.yaml | 13 +++ ...rsioned_organisation_revision_history.yaml | 13 +++ ...oned_organisation_version_get_at_time.yaml | 16 ++++ ...sioned_organisation_version_get_by_id.yaml | 14 +++ .../operations/versioned_role_get.yaml | 13 +++ .../versioned_role_revision_history.yaml | 13 +++ .../versioned_role_version_get_at_time.yaml | 16 ++++ .../versioned_role_version_get_by_id.yaml | 14 +++ .../path/versioned_object_uid_GROUP.yaml | 9 ++ .../versioned_object_uid_ORGANISATION.yaml | 9 ++ .../path/versioned_object_uid_ROLE.yaml | 9 ++ .../responses/200_GROUP_retrieved.yaml | 11 +++ .../responses/200_GROUP_updated.yaml | 11 +++ .../responses/200_ORGANISATION_retrieved.yaml | 11 +++ .../responses/200_ORGANISATION_updated.yaml | 11 +++ .../responses/200_ROLE_retrieved.yaml | 11 +++ .../responses/200_ROLE_updated.yaml | 11 +++ .../responses/200_VERSIONED_GROUP.yaml | 6 ++ .../responses/200_VERSIONED_ORGANISATION.yaml | 6 ++ .../responses/200_VERSIONED_ROLE.yaml | 6 ++ .../200_VERSION_of_GROUP_at_time.yaml | 11 +++ .../responses/200_VERSION_of_GROUP_by_id.yaml | 6 ++ .../200_VERSION_of_ORGANISATION_at_time.yaml | 11 +++ .../200_VERSION_of_ORGANISATION_by_id.yaml | 6 ++ .../200_VERSION_of_ROLE_at_time.yaml | 11 +++ .../responses/200_VERSION_of_ROLE_by_id.yaml | 6 ++ specifications/responses/201_GROUP.yaml | 12 +++ .../responses/201_ORGANISATION.yaml | 12 +++ specifications/responses/201_ROLE.yaml | 12 +++ .../responses/204_GROUP_deleted.yaml | 7 ++ .../responses/204_ORGANISATION_deleted.yaml | 7 ++ .../responses/204_ROLE_deleted.yaml | 7 ++ .../409_GROUP_with_uid_based_id.yaml | 8 ++ .../409_ORGANISATION_with_uid_based_id.yaml | 8 ++ .../responses/409_ROLE_with_uid_based_id.yaml | 8 ++ specifications/responses/412_GROUP.yaml | 8 ++ .../responses/412_ORGANISATION.yaml | 8 ++ specifications/responses/412_ROLE.yaml | 8 ++ .../demographic/UMImportedVersionOfGroup.yaml | 15 +++ .../UMImportedVersionOfOrganisation.yaml | 15 +++ .../demographic/UMImportedVersionOfRole.yaml | 15 +++ .../demographic/UMOriginalVersionOfGroup.yaml | 13 +++ .../UMOriginalVersionOfOrganisation.yaml | 13 +++ .../demographic/UMOriginalVersionOfRole.yaml | 13 +++ .../schemas/demographic/UVersionOfGroup.yaml | 9 ++ .../demographic/UVersionOfOrganisation.yaml | 9 ++ .../schemas/demographic/UVersionOfRole.yaml | 9 ++ .../schemas/demographic/VersionOfGroup.yaml | 18 ++++ .../demographic/VersionOfOrganisation.yaml | 18 ++++ .../schemas/demographic/VersionOfRole.yaml | 18 ++++ .../schemas/demographic/VersionedGroup.yaml | 21 +++++ .../demographic/VersionedOrganisation.yaml | 21 +++++ .../schemas/demographic/VersionedRole.yaml | 21 +++++ 76 files changed, 1102 insertions(+) create mode 100644 specifications/headers/Location_GROUP.yaml create mode 100644 specifications/headers/Location_ORGANISATION.yaml create mode 100644 specifications/headers/Location_ROLE.yaml create mode 100644 specifications/headers/Location_VERSIONED_GROUP_VERSION.yaml create mode 100644 specifications/headers/Location_VERSIONED_ORGANISATION_VERSION.yaml create mode 100644 specifications/headers/Location_VERSIONED_ROLE_VERSION.yaml create mode 100644 specifications/operations/group_create.yaml create mode 100644 specifications/operations/group_delete.yaml create mode 100644 specifications/operations/group_get.yaml create mode 100644 specifications/operations/group_update.yaml create mode 100644 specifications/operations/organisation_create.yaml create mode 100644 specifications/operations/organisation_delete.yaml create mode 100644 specifications/operations/organisation_get.yaml create mode 100644 specifications/operations/organisation_update.yaml create mode 100644 specifications/operations/role_create.yaml create mode 100644 specifications/operations/role_delete.yaml create mode 100644 specifications/operations/role_get.yaml create mode 100644 specifications/operations/role_update.yaml create mode 100644 specifications/operations/versioned_group_get.yaml create mode 100644 specifications/operations/versioned_group_revision_history.yaml create mode 100644 specifications/operations/versioned_group_version_get_at_time.yaml create mode 100644 specifications/operations/versioned_group_version_get_by_id.yaml create mode 100644 specifications/operations/versioned_organisation_get.yaml create mode 100644 specifications/operations/versioned_organisation_revision_history.yaml create mode 100644 specifications/operations/versioned_organisation_version_get_at_time.yaml create mode 100644 specifications/operations/versioned_organisation_version_get_by_id.yaml create mode 100644 specifications/operations/versioned_role_get.yaml create mode 100644 specifications/operations/versioned_role_revision_history.yaml create mode 100644 specifications/operations/versioned_role_version_get_at_time.yaml create mode 100644 specifications/operations/versioned_role_version_get_by_id.yaml create mode 100644 specifications/parameters/path/versioned_object_uid_GROUP.yaml create mode 100644 specifications/parameters/path/versioned_object_uid_ORGANISATION.yaml create mode 100644 specifications/parameters/path/versioned_object_uid_ROLE.yaml create mode 100644 specifications/responses/200_GROUP_retrieved.yaml create mode 100644 specifications/responses/200_GROUP_updated.yaml create mode 100644 specifications/responses/200_ORGANISATION_retrieved.yaml create mode 100644 specifications/responses/200_ORGANISATION_updated.yaml create mode 100644 specifications/responses/200_ROLE_retrieved.yaml create mode 100644 specifications/responses/200_ROLE_updated.yaml create mode 100644 specifications/responses/200_VERSIONED_GROUP.yaml create mode 100644 specifications/responses/200_VERSIONED_ORGANISATION.yaml create mode 100644 specifications/responses/200_VERSIONED_ROLE.yaml create mode 100644 specifications/responses/200_VERSION_of_GROUP_at_time.yaml create mode 100644 specifications/responses/200_VERSION_of_GROUP_by_id.yaml create mode 100644 specifications/responses/200_VERSION_of_ORGANISATION_at_time.yaml create mode 100644 specifications/responses/200_VERSION_of_ORGANISATION_by_id.yaml create mode 100644 specifications/responses/200_VERSION_of_ROLE_at_time.yaml create mode 100644 specifications/responses/200_VERSION_of_ROLE_by_id.yaml create mode 100644 specifications/responses/201_GROUP.yaml create mode 100644 specifications/responses/201_ORGANISATION.yaml create mode 100644 specifications/responses/201_ROLE.yaml create mode 100644 specifications/responses/204_GROUP_deleted.yaml create mode 100644 specifications/responses/204_ORGANISATION_deleted.yaml create mode 100644 specifications/responses/204_ROLE_deleted.yaml create mode 100644 specifications/responses/409_GROUP_with_uid_based_id.yaml create mode 100644 specifications/responses/409_ORGANISATION_with_uid_based_id.yaml create mode 100644 specifications/responses/409_ROLE_with_uid_based_id.yaml create mode 100644 specifications/responses/412_GROUP.yaml create mode 100644 specifications/responses/412_ORGANISATION.yaml create mode 100644 specifications/responses/412_ROLE.yaml create mode 100644 specifications/schemas/demographic/UMImportedVersionOfGroup.yaml create mode 100644 specifications/schemas/demographic/UMImportedVersionOfOrganisation.yaml create mode 100644 specifications/schemas/demographic/UMImportedVersionOfRole.yaml create mode 100644 specifications/schemas/demographic/UMOriginalVersionOfGroup.yaml create mode 100644 specifications/schemas/demographic/UMOriginalVersionOfOrganisation.yaml create mode 100644 specifications/schemas/demographic/UMOriginalVersionOfRole.yaml create mode 100644 specifications/schemas/demographic/UVersionOfGroup.yaml create mode 100644 specifications/schemas/demographic/UVersionOfOrganisation.yaml create mode 100644 specifications/schemas/demographic/UVersionOfRole.yaml create mode 100644 specifications/schemas/demographic/VersionOfGroup.yaml create mode 100644 specifications/schemas/demographic/VersionOfOrganisation.yaml create mode 100644 specifications/schemas/demographic/VersionOfRole.yaml create mode 100644 specifications/schemas/demographic/VersionedGroup.yaml create mode 100644 specifications/schemas/demographic/VersionedOrganisation.yaml create mode 100644 specifications/schemas/demographic/VersionedRole.yaml diff --git a/specifications/demographic.openapi.yaml b/specifications/demographic.openapi.yaml index 34bf2123..696256cf 100644 --- a/specifications/demographic.openapi.yaml +++ b/specifications/demographic.openapi.yaml @@ -44,6 +44,50 @@ paths: '/demographic/versioned_agent/{versioned_object_uid}/version/{version_uid}': get: $ref: ./operations/versioned_agent_version_get_by_id.yaml + '/demographic/group': + post: + $ref: ./operations/group_create.yaml + '/demographic/group/{uid_based_id}': + get: + $ref: ./operations/group_get.yaml + put: + $ref: ./operations/group_update.yaml + delete: + $ref: ./operations/group_delete.yaml + '/demographic/versioned_group/{versioned_object_uid}': + get: + $ref: ./operations/versioned_group_get.yaml + '/demographic/versioned_group/{versioned_object_uid}/revision_history': + get: + $ref: ./operations/versioned_group_revision_history.yaml + '/demographic/versioned_group/{versioned_object_uid}/version': + get: + $ref: ./operations/versioned_group_version_get_at_time.yaml + '/demographic/versioned_group/{versioned_object_uid}/version/{version_uid}': + get: + $ref: ./operations/versioned_group_version_get_by_id.yaml + '/demographic/organisation': + post: + $ref: ./operations/organisation_create.yaml + '/demographic/organisation/{uid_based_id}': + get: + $ref: ./operations/organisation_get.yaml + put: + $ref: ./operations/organisation_update.yaml + delete: + $ref: ./operations/organisation_delete.yaml + '/demographic/versioned_organisation/{versioned_object_uid}': + get: + $ref: ./operations/versioned_organisation_get.yaml + '/demographic/versioned_organisation/{versioned_object_uid}/revision_history': + get: + $ref: ./operations/versioned_organisation_revision_history.yaml + '/demographic/versioned_organisation/{versioned_object_uid}/version': + get: + $ref: ./operations/versioned_organisation_version_get_at_time.yaml + '/demographic/versioned_organisation/{versioned_object_uid}/version/{version_uid}': + get: + $ref: ./operations/versioned_organisation_version_get_by_id.yaml '/demographic/person': post: $ref: ./operations/person_create.yaml @@ -66,6 +110,28 @@ paths: '/demographic/versioned_person/{versioned_object_uid}/version/{version_uid}': get: $ref: ./operations/versioned_person_version_get_by_id.yaml + '/demographic/role': + post: + $ref: ./operations/role_create.yaml + '/demographic/role/{uid_based_id}': + get: + $ref: ./operations/role_get.yaml + put: + $ref: ./operations/role_update.yaml + delete: + $ref: ./operations/role_delete.yaml + '/demographic/versioned_role/{versioned_object_uid}': + get: + $ref: ./operations/versioned_role_get.yaml + '/demographic/versioned_role/{versioned_object_uid}/revision_history': + get: + $ref: ./operations/versioned_role_revision_history.yaml + '/demographic/versioned_role/{versioned_object_uid}/version': + get: + $ref: ./operations/versioned_role_version_get_at_time.yaml + '/demographic/versioned_role/{versioned_object_uid}/version/{version_uid}': + get: + $ref: ./operations/versioned_role_version_get_by_id.yaml '/demographic/contribution': post: $ref: ./operations/contribution_create.yaml @@ -76,13 +142,41 @@ tags: - name: AGENT description: | Management of the [AGENT](https://specifications.openehr.org/releases/RM/latest/demographic.html#_agent_class) and the associated [VERSIONED_AGENT](https://specifications.openehr.org/releases/RM/latest/demographic.html#_versioned_party_class) resource. + - name: GROUP + description: | + Management of the [GROUP](https://specifications.openehr.org/releases/RM/latest/demographic.html#_group_class) and the associated [VERSIONED_GROUP](https://specifications.openehr.org/releases/RM/latest/demographic.html#_versioned_party_class) resource. + - name: ORGANISATION + description: | + Management of the [ORGANISATION](https://specifications.openehr.org/releases/RM/latest/demographic.html#_organisation_class) and the associated [VERSIONED_ORGANISATION](https://specifications.openehr.org/releases/RM/latest/demographic.html#_versioned_party_class) resource. - name: PERSON description: | Management of the [PERSON](https://specifications.openehr.org/releases/RM/latest/demographic.html#_person_class) and the associated [VERSIONED_PERSON](https://specifications.openehr.org/releases/RM/latest/demographic.html#_versioned_party_class) resource. + - name: ROLE + description: | + Management of the [ROLE](https://specifications.openehr.org/releases/RM/latest/demographic.html#_ROLE_class) and the associated [VERSIONED_ROLE](https://specifications.openehr.org/releases/RM/latest/demographic.html#_versioned_party_class) resource. - name: CONTRIBUTION description: | Management of [CONTRIBUTION](https://specifications.openehr.org/releases/RM/latest/common.html#_contribution_class) resource. +x-tagGroups: + - name: Resource endpoints + tags: + - AGENT + - GROUP + - ORGANISATION + - PERSON + - ROLE + - CONTRIBUTION components: schemas: UAbstractItemStructure: $ref: ./schemas/data_structures/UAbstractItemStructure.yaml + VersionOfAgent: + $ref: ./schemas/demographic/VersionOfAgent.yaml + VersionOfGroup: + $ref: ./schemas/demographic/VersionOfGroup.yaml + VersionOfOrganisation: + $ref: ./schemas/demographic/VersionOfOrganisation.yaml + VersionOfPerson: + $ref: ./schemas/demographic/VersionOfPerson.yaml + VersionOfRole: + $ref: ./schemas/demographic/VersionOfRole.yaml diff --git a/specifications/headers/Location_GROUP.yaml b/specifications/headers/Location_GROUP.yaml new file mode 100644 index 00000000..e0c4b6a6 --- /dev/null +++ b/specifications/headers/Location_GROUP.yaml @@ -0,0 +1,6 @@ +description: | + The `Location` response header indicates the URL of the GROUP resource. +schema: + type: string + format: url + example: 'https://openEHRSys.example.com/v1/demographic/group/6cb19121-4307-4648-9da0-d62e4d51f19b::openEHRSys.example.com::2' diff --git a/specifications/headers/Location_ORGANISATION.yaml b/specifications/headers/Location_ORGANISATION.yaml new file mode 100644 index 00000000..9916b1b3 --- /dev/null +++ b/specifications/headers/Location_ORGANISATION.yaml @@ -0,0 +1,6 @@ +description: | + The `Location` response header indicates the URL of the ORGANISATION resource. +schema: + type: string + format: url + example: 'https://openEHRSys.example.com/v1/demographic/organisation/6cb19121-4307-4648-9da0-d62e4d51f19b::openEHRSys.example.com::2' diff --git a/specifications/headers/Location_ROLE.yaml b/specifications/headers/Location_ROLE.yaml new file mode 100644 index 00000000..124d9367 --- /dev/null +++ b/specifications/headers/Location_ROLE.yaml @@ -0,0 +1,6 @@ +description: | + The `Location` response header indicates the URL of the ROLE resource. +schema: + type: string + format: url + example: 'https://openEHRSys.example.com/v1/demographic/role/6cb19121-4307-4648-9da0-d62e4d51f19b::openEHRSys.example.com::2' diff --git a/specifications/headers/Location_VERSIONED_GROUP_VERSION.yaml b/specifications/headers/Location_VERSIONED_GROUP_VERSION.yaml new file mode 100644 index 00000000..60d9e3be --- /dev/null +++ b/specifications/headers/Location_VERSIONED_GROUP_VERSION.yaml @@ -0,0 +1,6 @@ +description: | + The `Location` response header indicates the URL of the VERSION resource. +schema: + type: string + format: url + example: 'https://openEHRSys.example.com/v1/demographic/versioned_group/6cb19121-4307-4648-9da0-d62e4d51f19b/version/6cb19121-4307-4648-9da0-d62e4d51f19b::openEHRSys.example.com::1' diff --git a/specifications/headers/Location_VERSIONED_ORGANISATION_VERSION.yaml b/specifications/headers/Location_VERSIONED_ORGANISATION_VERSION.yaml new file mode 100644 index 00000000..b6cd6c6f --- /dev/null +++ b/specifications/headers/Location_VERSIONED_ORGANISATION_VERSION.yaml @@ -0,0 +1,6 @@ +description: | + The `Location` response header indicates the URL of the VERSION resource. +schema: + type: string + format: url + example: 'https://openEHRSys.example.com/v1/demographic/versioned_organisation/6cb19121-4307-4648-9da0-d62e4d51f19b/version/6cb19121-4307-4648-9da0-d62e4d51f19b::openEHRSys.example.com::1' diff --git a/specifications/headers/Location_VERSIONED_ROLE_VERSION.yaml b/specifications/headers/Location_VERSIONED_ROLE_VERSION.yaml new file mode 100644 index 00000000..a81351c7 --- /dev/null +++ b/specifications/headers/Location_VERSIONED_ROLE_VERSION.yaml @@ -0,0 +1,6 @@ +description: | + The `Location` response header indicates the URL of the VERSION resource. +schema: + type: string + format: url + example: 'https://openEHRSys.example.com/v1/demographic/versioned_role/6cb19121-4307-4648-9da0-d62e4d51f19b/version/6cb19121-4307-4648-9da0-d62e4d51f19b::openEHRSys.example.com::1' diff --git a/specifications/operations/group_create.yaml b/specifications/operations/group_create.yaml new file mode 100644 index 00000000..6475a06a --- /dev/null +++ b/specifications/operations/group_create.yaml @@ -0,0 +1,25 @@ +operationId: group_create +summary: Create GROUP +description: | + Creates the first version of a new GROUP. +tags: + - GROUP +parameters: + - $ref: ../parameters/header/Prefer.yaml +requestBody: + description: | + The GROUP. + content: + application/json: + schema: + $ref: ../schemas/demographic/Group.yaml + required: true +responses: + '201': + $ref: ../responses/201_GROUP.yaml + '400': + $ref: ../responses/400.yaml + '422': + $ref: ../responses/422.yaml + '404': + $ref: ../responses/404.yaml diff --git a/specifications/operations/group_delete.yaml b/specifications/operations/group_delete.yaml new file mode 100644 index 00000000..553a61b9 --- /dev/null +++ b/specifications/operations/group_delete.yaml @@ -0,0 +1,20 @@ +operationId: group_delete +summary: Delete GROUP +description: | + Deletes the GROUP identified by `uid_based_id`. + + The `uid_based_id` MUST be in a form of an OBJECT_VERSION_ID identifier taken from the last (most recent) VERSION.uid.value, representing the `preceding_version_uid` to be deleted. + +tags: + - GROUP +parameters: + - $ref: ../parameters/path/uid_based_id_as_version_uid.yaml +responses: + '204': + $ref: ../responses/204_GROUP_deleted.yaml + '400': + $ref: ../responses/400_already_deleted.yaml + '404': + $ref: ../responses/404.yaml + '409': + $ref: ../responses/409_GROUP_with_uid_based_id.yaml diff --git a/specifications/operations/group_get.yaml b/specifications/operations/group_get.yaml new file mode 100644 index 00000000..80da6658 --- /dev/null +++ b/specifications/operations/group_get.yaml @@ -0,0 +1,23 @@ +operationId: group_get +summary: Get GROUP +description: | + Retrieves a version of the GROUP identified by `uid_based_id`. + + The `uid_based_id` can take a form of an OBJECT_VERSION_ID identifier taken from VERSION.uid.value (i.e. a `version_uid`), or a form of a HIER_OBJECT_ID identifier taken from VERSIONED_OBJECT.uid.value (i.e. a `versioned_object_uid`). + The former is used to retrieve a specific known version of the GROUP (e.g. one identified by `8849182c-82ad-4088-a07f-48ead4180515::openEHRSys.example.com::1`), whereas the later (e.g. an identifier like `8849182c-82ad-4088-a07f-48ead4180515`) is be used to retrieve a version from the version container whenever the _version_tree_id_ is unknown or irrelevant (such as when most recent version is requested). + + When the `uid_based_id` has the form of a HIER_OBJECT_ID, if the `version_at_time` is supplied, retrieves the version extant _at specified time_, otherwise retrieves the _latest_ GROUP version. + + See [Resource identification](overview.html#tag/Resources/Resource-identification) for more details about the identifiers usage and meaning. +tags: + - GROUP +parameters: + - $ref: ../parameters/path/uid_based_id.yaml + - $ref: ../parameters/query/version_at_time.yaml +responses: + '200': + $ref: ../responses/200_GROUP_retrieved.yaml + '204': + $ref: ../responses/204_because_deleted_at_time.yaml + '404': + $ref: ../responses/404_not_found_or_no_version_at_time.yaml diff --git a/specifications/operations/group_update.yaml b/specifications/operations/group_update.yaml new file mode 100644 index 00000000..a2de3e03 --- /dev/null +++ b/specifications/operations/group_update.yaml @@ -0,0 +1,35 @@ +operationId: group_update +summary: Update GROUP +description: | + Updates GROUP identified by `uid_based_id`. + + The `uid_based_id` can take only a form of an HIER_OBJECT_ID identifier taken from VERSIONED_OBJECT.uid.value (i.e. a `versioned_object_uid`). + + If the request body already contains a GROUP.uid.value, it must match the `uid_based_id` in the URL. + + The existing latest `version_uid` of GROUP resource (i.e. the `preceding_version_uid`) must be specified in the `If-Match` header. +tags: + - GROUP +parameters: + - $ref: ../parameters/path/uid_based_id_as_versioned_object_uid.yaml + - $ref: ../parameters/header/If-Match.yaml + - $ref: ../parameters/header/Prefer.yaml +requestBody: + description: | + The new GROUP. + content: + application/json: + schema: + $ref: ../schemas/demographic/Group.yaml + required: true +responses: + '200': + $ref: ../responses/200_GROUP_updated.yaml + '400': + $ref: ../responses/400.yaml + '404': + $ref: ../responses/404.yaml + '412': + $ref: ../responses/412_GROUP.yaml + '422': + $ref: ../responses/422.yaml diff --git a/specifications/operations/organisation_create.yaml b/specifications/operations/organisation_create.yaml new file mode 100644 index 00000000..13054578 --- /dev/null +++ b/specifications/operations/organisation_create.yaml @@ -0,0 +1,25 @@ +operationId: organisation_create +summary: Create ORGANISATION +description: | + Creates the first version of a new ORGANISATION. +tags: + - ORGANISATION +parameters: + - $ref: ../parameters/header/Prefer.yaml +requestBody: + description: | + The ORGANISATION. + content: + application/json: + schema: + $ref: ../schemas/demographic/Organisation.yaml + required: true +responses: + '201': + $ref: ../responses/201_ORGANISATION.yaml + '400': + $ref: ../responses/400.yaml + '422': + $ref: ../responses/422.yaml + '404': + $ref: ../responses/404.yaml diff --git a/specifications/operations/organisation_delete.yaml b/specifications/operations/organisation_delete.yaml new file mode 100644 index 00000000..9c9a0371 --- /dev/null +++ b/specifications/operations/organisation_delete.yaml @@ -0,0 +1,20 @@ +operationId: organisation_delete +summary: Delete ORGANISATION +description: | + Deletes the ORGANISATION identified by `uid_based_id`. + + The `uid_based_id` MUST be in a form of an OBJECT_VERSION_ID identifier taken from the last (most recent) VERSION.uid.value, representing the `preceding_version_uid` to be deleted. + +tags: + - ORGANISATION +parameters: + - $ref: ../parameters/path/uid_based_id_as_version_uid.yaml +responses: + '204': + $ref: ../responses/204_ORGANISATION_deleted.yaml + '400': + $ref: ../responses/400_already_deleted.yaml + '404': + $ref: ../responses/404.yaml + '409': + $ref: ../responses/409_ORGANISATION_with_uid_based_id.yaml diff --git a/specifications/operations/organisation_get.yaml b/specifications/operations/organisation_get.yaml new file mode 100644 index 00000000..fcfa307c --- /dev/null +++ b/specifications/operations/organisation_get.yaml @@ -0,0 +1,23 @@ +operationId: organisation_get +summary: Get ORGANISATION +description: | + Retrieves a version of the ORGANISATION identified by `uid_based_id`. + + The `uid_based_id` can take a form of an OBJECT_VERSION_ID identifier taken from VERSION.uid.value (i.e. a `version_uid`), or a form of a HIER_OBJECT_ID identifier taken from VERSIONED_OBJECT.uid.value (i.e. a `versioned_object_uid`). + The former is used to retrieve a specific known version of the ORGANISATION (e.g. one identified by `8849182c-82ad-4088-a07f-48ead4180515::openEHRSys.example.com::1`), whereas the later (e.g. an identifier like `8849182c-82ad-4088-a07f-48ead4180515`) is be used to retrieve a version from the version container whenever the _version_tree_id_ is unknown or irrelevant (such as when most recent version is requested). + + When the `uid_based_id` has the form of a HIER_OBJECT_ID, if the `version_at_time` is supplied, retrieves the version extant _at specified time_, otherwise retrieves the _latest_ ORGANISATION version. + + See [Resource identification](overview.html#tag/Resources/Resource-identification) for more details about the identifiers usage and meaning. +tags: + - ORGANISATION +parameters: + - $ref: ../parameters/path/uid_based_id.yaml + - $ref: ../parameters/query/version_at_time.yaml +responses: + '200': + $ref: ../responses/200_ORGANISATION_retrieved.yaml + '204': + $ref: ../responses/204_because_deleted_at_time.yaml + '404': + $ref: ../responses/404_not_found_or_no_version_at_time.yaml diff --git a/specifications/operations/organisation_update.yaml b/specifications/operations/organisation_update.yaml new file mode 100644 index 00000000..2458f31b --- /dev/null +++ b/specifications/operations/organisation_update.yaml @@ -0,0 +1,35 @@ +operationId: organisation_update +summary: Update ORGANISATION +description: | + Updates ORGANISATION identified by `uid_based_id`. + + The `uid_based_id` can take only a form of an HIER_OBJECT_ID identifier taken from VERSIONED_OBJECT.uid.value (i.e. a `versioned_object_uid`). + + If the request body already contains a ORGANISATION.uid.value, it must match the `uid_based_id` in the URL. + + The existing latest `version_uid` of ORGANISATION resource (i.e. the `preceding_version_uid`) must be specified in the `If-Match` header. +tags: + - ORGANISATION +parameters: + - $ref: ../parameters/path/uid_based_id_as_versioned_object_uid.yaml + - $ref: ../parameters/header/If-Match.yaml + - $ref: ../parameters/header/Prefer.yaml +requestBody: + description: | + The new ORGANISATION. + content: + application/json: + schema: + $ref: ../schemas/demographic/Organisation.yaml + required: true +responses: + '200': + $ref: ../responses/200_ORGANISATION_updated.yaml + '400': + $ref: ../responses/400.yaml + '404': + $ref: ../responses/404.yaml + '412': + $ref: ../responses/412_ORGANISATION.yaml + '422': + $ref: ../responses/422.yaml diff --git a/specifications/operations/role_create.yaml b/specifications/operations/role_create.yaml new file mode 100644 index 00000000..c8111721 --- /dev/null +++ b/specifications/operations/role_create.yaml @@ -0,0 +1,25 @@ +operationId: role_create +summary: Create ROLE +description: | + Creates the first version of a new ROLE. +tags: + - ROLE +parameters: + - $ref: ../parameters/header/Prefer.yaml +requestBody: + description: | + The ROLE. + content: + application/json: + schema: + $ref: ../schemas/demographic/Role.yaml + required: true +responses: + '201': + $ref: ../responses/201_ROLE.yaml + '400': + $ref: ../responses/400.yaml + '422': + $ref: ../responses/422.yaml + '404': + $ref: ../responses/404.yaml diff --git a/specifications/operations/role_delete.yaml b/specifications/operations/role_delete.yaml new file mode 100644 index 00000000..f34d8e33 --- /dev/null +++ b/specifications/operations/role_delete.yaml @@ -0,0 +1,20 @@ +operationId: role_delete +summary: Delete ROLE +description: | + Deletes the ROLE identified by `uid_based_id`. + + The `uid_based_id` MUST be in a form of an OBJECT_VERSION_ID identifier taken from the last (most recent) VERSION.uid.value, representing the `preceding_version_uid` to be deleted. + +tags: + - ROLE +parameters: + - $ref: ../parameters/path/uid_based_id_as_version_uid.yaml +responses: + '204': + $ref: ../responses/204_ROLE_deleted.yaml + '400': + $ref: ../responses/400_already_deleted.yaml + '404': + $ref: ../responses/404.yaml + '409': + $ref: ../responses/409_ROLE_with_uid_based_id.yaml diff --git a/specifications/operations/role_get.yaml b/specifications/operations/role_get.yaml new file mode 100644 index 00000000..0b81e9c2 --- /dev/null +++ b/specifications/operations/role_get.yaml @@ -0,0 +1,23 @@ +operationId: role_get +summary: Get ROLE +description: | + Retrieves a version of the ROLE identified by `uid_based_id`. + + The `uid_based_id` can take a form of an OBJECT_VERSION_ID identifier taken from VERSION.uid.value (i.e. a `version_uid`), or a form of a HIER_OBJECT_ID identifier taken from VERSIONED_OBJECT.uid.value (i.e. a `versioned_object_uid`). + The former is used to retrieve a specific known version of the ROLE (e.g. one identified by `8849182c-82ad-4088-a07f-48ead4180515::openEHRSys.example.com::1`), whereas the later (e.g. an identifier like `8849182c-82ad-4088-a07f-48ead4180515`) is be used to retrieve a version from the version container whenever the _version_tree_id_ is unknown or irrelevant (such as when most recent version is requested). + + When the `uid_based_id` has the form of a HIER_OBJECT_ID, if the `version_at_time` is supplied, retrieves the version extant _at specified time_, otherwise retrieves the _latest_ ROLE version. + + See [Resource identification](overview.html#tag/Resources/Resource-identification) for more details about the identifiers usage and meaning. +tags: + - ROLE +parameters: + - $ref: ../parameters/path/uid_based_id.yaml + - $ref: ../parameters/query/version_at_time.yaml +responses: + '200': + $ref: ../responses/200_ROLE_retrieved.yaml + '204': + $ref: ../responses/204_because_deleted_at_time.yaml + '404': + $ref: ../responses/404_not_found_or_no_version_at_time.yaml diff --git a/specifications/operations/role_update.yaml b/specifications/operations/role_update.yaml new file mode 100644 index 00000000..3c4ea273 --- /dev/null +++ b/specifications/operations/role_update.yaml @@ -0,0 +1,35 @@ +operationId: role_update +summary: Update ROLE +description: | + Updates ROLE identified by `uid_based_id`. + + The `uid_based_id` can take only a form of an HIER_OBJECT_ID identifier taken from VERSIONED_OBJECT.uid.value (i.e. a `versioned_object_uid`). + + If the request body already contains a ROLE.uid.value, it must match the `uid_based_id` in the URL. + + The existing latest `version_uid` of ROLE resource (i.e. the `preceding_version_uid`) must be specified in the `If-Match` header. +tags: + - ROLE +parameters: + - $ref: ../parameters/path/uid_based_id_as_versioned_object_uid.yaml + - $ref: ../parameters/header/If-Match.yaml + - $ref: ../parameters/header/Prefer.yaml +requestBody: + description: | + The new ROLE. + content: + application/json: + schema: + $ref: ../schemas/demographic/Role.yaml + required: true +responses: + '200': + $ref: ../responses/200_ROLE_updated.yaml + '400': + $ref: ../responses/400.yaml + '404': + $ref: ../responses/404.yaml + '412': + $ref: ../responses/412_ROLE.yaml + '422': + $ref: ../responses/422.yaml diff --git a/specifications/operations/versioned_group_get.yaml b/specifications/operations/versioned_group_get.yaml new file mode 100644 index 00000000..6a94a14f --- /dev/null +++ b/specifications/operations/versioned_group_get.yaml @@ -0,0 +1,13 @@ +operationId: versioned_group_get +summary: Get versioned GROUP +description: | + Retrieves a VERSIONED_GROUP identified by `versioned_object_uid`. +tags: + - GROUP +parameters: + - $ref: ../parameters/path/versioned_object_uid_GROUP.yaml +responses: + '200': + $ref: ../responses/200_VERSIONED_GROUP.yaml + '404': + $ref: ../responses/404.yaml diff --git a/specifications/operations/versioned_group_revision_history.yaml b/specifications/operations/versioned_group_revision_history.yaml new file mode 100644 index 00000000..a28731d9 --- /dev/null +++ b/specifications/operations/versioned_group_revision_history.yaml @@ -0,0 +1,13 @@ +operationId: versioned_group_revision_history +summary: Get versioned GROUP revision history +description: | + Retrieves revision history of the VERSIONED_GROUP identified by `versioned_object_uid`. +tags: + - GROUP +parameters: + - $ref: ../parameters/path/versioned_object_uid_GROUP.yaml +responses: + '200': + $ref: ../responses/200_REVISION_HISTORY.yaml + '404': + $ref: ../responses/404.yaml diff --git a/specifications/operations/versioned_group_version_get_at_time.yaml b/specifications/operations/versioned_group_version_get_at_time.yaml new file mode 100644 index 00000000..e06b1cf5 --- /dev/null +++ b/specifications/operations/versioned_group_version_get_at_time.yaml @@ -0,0 +1,16 @@ +operationId: versioned_group_version_get_at_time +summary: Get versioned GROUP version at time +description: | + Retrieves a VERSION from the VERSIONED_GROUP identified by `versioned_object_uid`. + + If `version_at_time` is supplied, retrieves the VERSION extant _at specified time_, otherwise retrieves the _latest_ VERSION. +tags: + - GROUP +parameters: + - $ref: ../parameters/path/versioned_object_uid_GROUP.yaml + - $ref: ../parameters/query/version_at_time.yaml +responses: + '200': + $ref: ../responses/200_VERSION_of_GROUP_at_time.yaml + '404': + $ref: ../responses/404_not_found_or_no_version_at_time.yaml diff --git a/specifications/operations/versioned_group_version_get_by_id.yaml b/specifications/operations/versioned_group_version_get_by_id.yaml new file mode 100644 index 00000000..a2332ae3 --- /dev/null +++ b/specifications/operations/versioned_group_version_get_by_id.yaml @@ -0,0 +1,14 @@ +operationId: versioned_composition_version_get_by_id +summary: Get versioned GROUP version by id +description: | + Retrieves a VERSION identified by `version_uid` of a VERSIONED_GROUP identified by `versioned_object_uid`. +tags: + - GROUP +parameters: + - $ref: ../parameters/path/versioned_object_uid_GROUP.yaml + - $ref: ../parameters/path/version_uid.yaml +responses: + '200': + $ref: ../responses/200_VERSION_of_GROUP_by_id.yaml + '404': + $ref: ../responses/404.yaml diff --git a/specifications/operations/versioned_organisation_get.yaml b/specifications/operations/versioned_organisation_get.yaml new file mode 100644 index 00000000..19cdfa72 --- /dev/null +++ b/specifications/operations/versioned_organisation_get.yaml @@ -0,0 +1,13 @@ +operationId: versioned_organisation_get +summary: Get versioned ORGANISATION +description: | + Retrieves a VERSIONED_ORGANISATION identified by `versioned_object_uid`. +tags: + - ORGANISATION +parameters: + - $ref: ../parameters/path/versioned_object_uid_ORGANISATION.yaml +responses: + '200': + $ref: ../responses/200_VERSIONED_ORGANISATION.yaml + '404': + $ref: ../responses/404.yaml diff --git a/specifications/operations/versioned_organisation_revision_history.yaml b/specifications/operations/versioned_organisation_revision_history.yaml new file mode 100644 index 00000000..c844830d --- /dev/null +++ b/specifications/operations/versioned_organisation_revision_history.yaml @@ -0,0 +1,13 @@ +operationId: versioned_organisation_revision_history +summary: Get versioned ORGANISATION revision history +description: | + Retrieves revision history of the VERSIONED_ORGANISATION identified by `versioned_object_uid`. +tags: + - ORGANISATION +parameters: + - $ref: ../parameters/path/versioned_object_uid_ORGANISATION.yaml +responses: + '200': + $ref: ../responses/200_REVISION_HISTORY.yaml + '404': + $ref: ../responses/404.yaml diff --git a/specifications/operations/versioned_organisation_version_get_at_time.yaml b/specifications/operations/versioned_organisation_version_get_at_time.yaml new file mode 100644 index 00000000..aa6f5af8 --- /dev/null +++ b/specifications/operations/versioned_organisation_version_get_at_time.yaml @@ -0,0 +1,16 @@ +operationId: versioned_organisation_version_get_at_time +summary: Get versioned ORGANISATION version at time +description: | + Retrieves a VERSION from the VERSIONED_ORGANISATION identified by `versioned_object_uid`. + + If `version_at_time` is supplied, retrieves the VERSION extant _at specified time_, otherwise retrieves the _latest_ VERSION. +tags: + - ORGANISATION +parameters: + - $ref: ../parameters/path/versioned_object_uid_ORGANISATION.yaml + - $ref: ../parameters/query/version_at_time.yaml +responses: + '200': + $ref: ../responses/200_VERSION_of_ORGANISATION_at_time.yaml + '404': + $ref: ../responses/404_not_found_or_no_version_at_time.yaml diff --git a/specifications/operations/versioned_organisation_version_get_by_id.yaml b/specifications/operations/versioned_organisation_version_get_by_id.yaml new file mode 100644 index 00000000..cfc7821a --- /dev/null +++ b/specifications/operations/versioned_organisation_version_get_by_id.yaml @@ -0,0 +1,14 @@ +operationId: versioned_composition_version_get_by_id +summary: Get versioned ORGANISATION version by id +description: | + Retrieves a VERSION identified by `version_uid` of a VERSIONED_ORGANISATION identified by `versioned_object_uid`. +tags: + - ORGANISATION +parameters: + - $ref: ../parameters/path/versioned_object_uid_ORGANISATION.yaml + - $ref: ../parameters/path/version_uid.yaml +responses: + '200': + $ref: ../responses/200_VERSION_of_ORGANISATION_by_id.yaml + '404': + $ref: ../responses/404.yaml diff --git a/specifications/operations/versioned_role_get.yaml b/specifications/operations/versioned_role_get.yaml new file mode 100644 index 00000000..013726fc --- /dev/null +++ b/specifications/operations/versioned_role_get.yaml @@ -0,0 +1,13 @@ +operationId: versioned_role_get +summary: Get versioned ROLE +description: | + Retrieves a VERSIONED_ROLE identified by `versioned_object_uid`. +tags: + - ROLE +parameters: + - $ref: ../parameters/path/versioned_object_uid_ROLE.yaml +responses: + '200': + $ref: ../responses/200_VERSIONED_ROLE.yaml + '404': + $ref: ../responses/404.yaml diff --git a/specifications/operations/versioned_role_revision_history.yaml b/specifications/operations/versioned_role_revision_history.yaml new file mode 100644 index 00000000..d0038042 --- /dev/null +++ b/specifications/operations/versioned_role_revision_history.yaml @@ -0,0 +1,13 @@ +operationId: versioned_role_revision_history +summary: Get versioned ROLE revision history +description: | + Retrieves revision history of the VERSIONED_ROLE identified by `versioned_object_uid`. +tags: + - ROLE +parameters: + - $ref: ../parameters/path/versioned_object_uid_ROLE.yaml +responses: + '200': + $ref: ../responses/200_REVISION_HISTORY.yaml + '404': + $ref: ../responses/404.yaml diff --git a/specifications/operations/versioned_role_version_get_at_time.yaml b/specifications/operations/versioned_role_version_get_at_time.yaml new file mode 100644 index 00000000..4e336e95 --- /dev/null +++ b/specifications/operations/versioned_role_version_get_at_time.yaml @@ -0,0 +1,16 @@ +operationId: versioned_role_version_get_at_time +summary: Get versioned ROLE version at time +description: | + Retrieves a VERSION from the VERSIONED_ROLE identified by `versioned_object_uid`. + + If `version_at_time` is supplied, retrieves the VERSION extant _at specified time_, otherwise retrieves the _latest_ VERSION. +tags: + - ROLE +parameters: + - $ref: ../parameters/path/versioned_object_uid_ROLE.yaml + - $ref: ../parameters/query/version_at_time.yaml +responses: + '200': + $ref: ../responses/200_VERSION_of_ROLE_at_time.yaml + '404': + $ref: ../responses/404_not_found_or_no_version_at_time.yaml diff --git a/specifications/operations/versioned_role_version_get_by_id.yaml b/specifications/operations/versioned_role_version_get_by_id.yaml new file mode 100644 index 00000000..db0bc519 --- /dev/null +++ b/specifications/operations/versioned_role_version_get_by_id.yaml @@ -0,0 +1,14 @@ +operationId: versioned_composition_version_get_by_id +summary: Get versioned ROLE version by id +description: | + Retrieves a VERSION identified by `version_uid` of a VERSIONED_ROLE identified by `versioned_object_uid`. +tags: + - ROLE +parameters: + - $ref: ../parameters/path/versioned_object_uid_ROLE.yaml + - $ref: ../parameters/path/version_uid.yaml +responses: + '200': + $ref: ../responses/200_VERSION_of_ROLE_by_id.yaml + '404': + $ref: ../responses/404.yaml diff --git a/specifications/parameters/path/versioned_object_uid_GROUP.yaml b/specifications/parameters/path/versioned_object_uid_GROUP.yaml new file mode 100644 index 00000000..a1d48135 --- /dev/null +++ b/specifications/parameters/path/versioned_object_uid_GROUP.yaml @@ -0,0 +1,9 @@ +name: versioned_object_uid +in: path +description: | + VERSIONED_GROUP identifier taken from VERSIONED_GROUP.uid.value. +required: true +style: simple +schema: + type: string + example: '6cb19121-4307-4648-9da0-d62e4d51f19b' diff --git a/specifications/parameters/path/versioned_object_uid_ORGANISATION.yaml b/specifications/parameters/path/versioned_object_uid_ORGANISATION.yaml new file mode 100644 index 00000000..609f6517 --- /dev/null +++ b/specifications/parameters/path/versioned_object_uid_ORGANISATION.yaml @@ -0,0 +1,9 @@ +name: versioned_object_uid +in: path +description: | + VERSIONED_ORGANISATION identifier taken from VERSIONED_ORGANISATION.uid.value. +required: true +style: simple +schema: + type: string + example: '6cb19121-4307-4648-9da0-d62e4d51f19b' diff --git a/specifications/parameters/path/versioned_object_uid_ROLE.yaml b/specifications/parameters/path/versioned_object_uid_ROLE.yaml new file mode 100644 index 00000000..791455b5 --- /dev/null +++ b/specifications/parameters/path/versioned_object_uid_ROLE.yaml @@ -0,0 +1,9 @@ +name: versioned_object_uid +in: path +description: | + VERSIONED_ROLE identifier taken from VERSIONED_ROLE.uid.value. +required: true +style: simple +schema: + type: string + example: '6cb19121-4307-4648-9da0-d62e4d51f19b' diff --git a/specifications/responses/200_GROUP_retrieved.yaml b/specifications/responses/200_GROUP_retrieved.yaml new file mode 100644 index 00000000..8b361544 --- /dev/null +++ b/specifications/responses/200_GROUP_retrieved.yaml @@ -0,0 +1,11 @@ +description: | + `200 OK` is returned when the requested GROUP is successfully retrieved. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_GROUP.yaml +content: + application/json: + schema: + $ref: ../schemas/demographic/Group.yaml diff --git a/specifications/responses/200_GROUP_updated.yaml b/specifications/responses/200_GROUP_updated.yaml new file mode 100644 index 00000000..03bfb594 --- /dev/null +++ b/specifications/responses/200_GROUP_updated.yaml @@ -0,0 +1,11 @@ +description: | + `200 OK` is returned when the GROUP is successfully updated and the updated resource is returned in the body when `Prefer` header value is `return=representation`. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_GROUP.yaml +content: + application/json: + schema: + $ref: ../schemas/demographic/Group.yaml diff --git a/specifications/responses/200_ORGANISATION_retrieved.yaml b/specifications/responses/200_ORGANISATION_retrieved.yaml new file mode 100644 index 00000000..acdad822 --- /dev/null +++ b/specifications/responses/200_ORGANISATION_retrieved.yaml @@ -0,0 +1,11 @@ +description: | + `200 OK` is returned when the requested ORGANISATION is successfully retrieved. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_ORGANISATION.yaml +content: + application/json: + schema: + $ref: ../schemas/demographic/Organisation.yaml diff --git a/specifications/responses/200_ORGANISATION_updated.yaml b/specifications/responses/200_ORGANISATION_updated.yaml new file mode 100644 index 00000000..5cdaa44f --- /dev/null +++ b/specifications/responses/200_ORGANISATION_updated.yaml @@ -0,0 +1,11 @@ +description: | + `200 OK` is returned when the ORGANISATION is successfully updated and the updated resource is returned in the body when `Prefer` header value is `return=representation`. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_ORGANISATION.yaml +content: + application/json: + schema: + $ref: ../schemas/demographic/Organisation.yaml diff --git a/specifications/responses/200_ROLE_retrieved.yaml b/specifications/responses/200_ROLE_retrieved.yaml new file mode 100644 index 00000000..ff402aff --- /dev/null +++ b/specifications/responses/200_ROLE_retrieved.yaml @@ -0,0 +1,11 @@ +description: | + `200 OK` is returned when the requested ROLE is successfully retrieved. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_ROLE.yaml +content: + application/json: + schema: + $ref: ../schemas/demographic/Role.yaml diff --git a/specifications/responses/200_ROLE_updated.yaml b/specifications/responses/200_ROLE_updated.yaml new file mode 100644 index 00000000..d3d0c8f1 --- /dev/null +++ b/specifications/responses/200_ROLE_updated.yaml @@ -0,0 +1,11 @@ +description: | + `200 OK` is returned when the ROLE is successfully updated and the updated resource is returned in the body when `Prefer` header value is `return=representation`. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_ROLE.yaml +content: + application/json: + schema: + $ref: ../schemas/demographic/Role.yaml diff --git a/specifications/responses/200_VERSIONED_GROUP.yaml b/specifications/responses/200_VERSIONED_GROUP.yaml new file mode 100644 index 00000000..0eb1599e --- /dev/null +++ b/specifications/responses/200_VERSIONED_GROUP.yaml @@ -0,0 +1,6 @@ +description: | + `200 OK` is returned when the requested VERSIONED_GROUP is successfully retrieved. +content: + application/json: + schema: + $ref: ../schemas/demographic/VersionedGroup.yaml diff --git a/specifications/responses/200_VERSIONED_ORGANISATION.yaml b/specifications/responses/200_VERSIONED_ORGANISATION.yaml new file mode 100644 index 00000000..8fc0f6af --- /dev/null +++ b/specifications/responses/200_VERSIONED_ORGANISATION.yaml @@ -0,0 +1,6 @@ +description: | + `200 OK` is returned when the requested VERSIONED_ORGANISATION is successfully retrieved. +content: + application/json: + schema: + $ref: ../schemas/demographic/VersionedOrganisation.yaml diff --git a/specifications/responses/200_VERSIONED_ROLE.yaml b/specifications/responses/200_VERSIONED_ROLE.yaml new file mode 100644 index 00000000..129ae47b --- /dev/null +++ b/specifications/responses/200_VERSIONED_ROLE.yaml @@ -0,0 +1,6 @@ +description: | + `200 OK` is returned when the requested VERSIONED_ROLE is successfully retrieved. +content: + application/json: + schema: + $ref: ../schemas/demographic/VersionedRole.yaml diff --git a/specifications/responses/200_VERSION_of_GROUP_at_time.yaml b/specifications/responses/200_VERSION_of_GROUP_at_time.yaml new file mode 100644 index 00000000..a2a650e4 --- /dev/null +++ b/specifications/responses/200_VERSION_of_GROUP_at_time.yaml @@ -0,0 +1,11 @@ +description: | + `200 OK` is returned when the requested VERSION is successfully retrieved. +headers: + ETag: + $ref: ../headers/ETag_VERSION.yaml + Location: + $ref: ../headers/Location_VERSIONED_GROUP_VERSION.yaml +content: + application/json: + schema: + $ref: ../schemas/demographic/UVersionOfGroup.yaml diff --git a/specifications/responses/200_VERSION_of_GROUP_by_id.yaml b/specifications/responses/200_VERSION_of_GROUP_by_id.yaml new file mode 100644 index 00000000..6e3694e1 --- /dev/null +++ b/specifications/responses/200_VERSION_of_GROUP_by_id.yaml @@ -0,0 +1,6 @@ +description: | + `200 OK` is returned when the requested VERSION is successfully retrieved. +content: + application/json: + schema: + $ref: ../schemas/demographic/UVersionOfGroup.yaml diff --git a/specifications/responses/200_VERSION_of_ORGANISATION_at_time.yaml b/specifications/responses/200_VERSION_of_ORGANISATION_at_time.yaml new file mode 100644 index 00000000..aabf0155 --- /dev/null +++ b/specifications/responses/200_VERSION_of_ORGANISATION_at_time.yaml @@ -0,0 +1,11 @@ +description: | + `200 OK` is returned when the requested VERSION is successfully retrieved. +headers: + ETag: + $ref: ../headers/ETag_VERSION.yaml + Location: + $ref: ../headers/Location_VERSIONED_ORGANISATION_VERSION.yaml +content: + application/json: + schema: + $ref: ../schemas/demographic/UVersionOfOrganisation.yaml diff --git a/specifications/responses/200_VERSION_of_ORGANISATION_by_id.yaml b/specifications/responses/200_VERSION_of_ORGANISATION_by_id.yaml new file mode 100644 index 00000000..cedb05e0 --- /dev/null +++ b/specifications/responses/200_VERSION_of_ORGANISATION_by_id.yaml @@ -0,0 +1,6 @@ +description: | + `200 OK` is returned when the requested VERSION is successfully retrieved. +content: + application/json: + schema: + $ref: ../schemas/demographic/UVersionOfOrganisation.yaml diff --git a/specifications/responses/200_VERSION_of_ROLE_at_time.yaml b/specifications/responses/200_VERSION_of_ROLE_at_time.yaml new file mode 100644 index 00000000..ed16649a --- /dev/null +++ b/specifications/responses/200_VERSION_of_ROLE_at_time.yaml @@ -0,0 +1,11 @@ +description: | + `200 OK` is returned when the requested VERSION is successfully retrieved. +headers: + ETag: + $ref: ../headers/ETag_VERSION.yaml + Location: + $ref: ../headers/Location_VERSIONED_ROLE_VERSION.yaml +content: + application/json: + schema: + $ref: ../schemas/demographic/UVersionOfRole.yaml diff --git a/specifications/responses/200_VERSION_of_ROLE_by_id.yaml b/specifications/responses/200_VERSION_of_ROLE_by_id.yaml new file mode 100644 index 00000000..e3fa5bca --- /dev/null +++ b/specifications/responses/200_VERSION_of_ROLE_by_id.yaml @@ -0,0 +1,6 @@ +description: | + `200 OK` is returned when the requested VERSION is successfully retrieved. +content: + application/json: + schema: + $ref: ../schemas/demographic/UVersionOfRole.yaml diff --git a/specifications/responses/201_GROUP.yaml b/specifications/responses/201_GROUP.yaml new file mode 100644 index 00000000..d7488313 --- /dev/null +++ b/specifications/responses/201_GROUP.yaml @@ -0,0 +1,12 @@ +description: | + `201 Created` is returned when the GROUP was created. + Content body is only returned when `Prefer` header has `return=representation`, otherwise only headers are returned. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_GROUP.yaml +content: + application/json: + schema: + $ref: ../schemas/demographic/Group.yaml diff --git a/specifications/responses/201_ORGANISATION.yaml b/specifications/responses/201_ORGANISATION.yaml new file mode 100644 index 00000000..b3c2ea10 --- /dev/null +++ b/specifications/responses/201_ORGANISATION.yaml @@ -0,0 +1,12 @@ +description: | + `201 Created` is returned when the ORGANISATION was created. + Content body is only returned when `Prefer` header has `return=representation`, otherwise only headers are returned. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_ORGANISATION.yaml +content: + application/json: + schema: + $ref: ../schemas/demographic/Organisation.yaml diff --git a/specifications/responses/201_ROLE.yaml b/specifications/responses/201_ROLE.yaml new file mode 100644 index 00000000..d1d56ff2 --- /dev/null +++ b/specifications/responses/201_ROLE.yaml @@ -0,0 +1,12 @@ +description: | + `201 Created` is returned when the ROLE was created. + Content body is only returned when `Prefer` header has `return=representation`, otherwise only headers are returned. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_ROLE.yaml +content: + application/json: + schema: + $ref: ../schemas/demographic/Role.yaml diff --git a/specifications/responses/204_GROUP_deleted.yaml b/specifications/responses/204_GROUP_deleted.yaml new file mode 100644 index 00000000..b2f6625d --- /dev/null +++ b/specifications/responses/204_GROUP_deleted.yaml @@ -0,0 +1,7 @@ +description: | + `204 No Content` is returned when GROUP was deleted. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_GROUP.yaml diff --git a/specifications/responses/204_ORGANISATION_deleted.yaml b/specifications/responses/204_ORGANISATION_deleted.yaml new file mode 100644 index 00000000..a7d2d1f6 --- /dev/null +++ b/specifications/responses/204_ORGANISATION_deleted.yaml @@ -0,0 +1,7 @@ +description: | + `204 No Content` is returned when ORGANISATION was deleted. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_ORGANISATION.yaml diff --git a/specifications/responses/204_ROLE_deleted.yaml b/specifications/responses/204_ROLE_deleted.yaml new file mode 100644 index 00000000..2a8bc935 --- /dev/null +++ b/specifications/responses/204_ROLE_deleted.yaml @@ -0,0 +1,7 @@ +description: | + `204 No Content` is returned when ROLE was deleted. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_ROLE.yaml diff --git a/specifications/responses/409_GROUP_with_uid_based_id.yaml b/specifications/responses/409_GROUP_with_uid_based_id.yaml new file mode 100644 index 00000000..851b745f --- /dev/null +++ b/specifications/responses/409_GROUP_with_uid_based_id.yaml @@ -0,0 +1,8 @@ +description: | + `409 Conflict` is returned when supplied `uid_based_id` doesn't match the latest version. + Returns also latest version in the `Location` and `ETag` headers. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_GROUP.yaml diff --git a/specifications/responses/409_ORGANISATION_with_uid_based_id.yaml b/specifications/responses/409_ORGANISATION_with_uid_based_id.yaml new file mode 100644 index 00000000..0aac0228 --- /dev/null +++ b/specifications/responses/409_ORGANISATION_with_uid_based_id.yaml @@ -0,0 +1,8 @@ +description: | + `409 Conflict` is returned when supplied `uid_based_id` doesn't match the latest version. + Returns also latest version in the `Location` and `ETag` headers. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_ORGANISATION.yaml diff --git a/specifications/responses/409_ROLE_with_uid_based_id.yaml b/specifications/responses/409_ROLE_with_uid_based_id.yaml new file mode 100644 index 00000000..b49b5e3c --- /dev/null +++ b/specifications/responses/409_ROLE_with_uid_based_id.yaml @@ -0,0 +1,8 @@ +description: | + `409 Conflict` is returned when supplied `uid_based_id` doesn't match the latest version. + Returns also latest version in the `Location` and `ETag` headers. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_ROLE.yaml diff --git a/specifications/responses/412_GROUP.yaml b/specifications/responses/412_GROUP.yaml new file mode 100644 index 00000000..eb8bf2d0 --- /dev/null +++ b/specifications/responses/412_GROUP.yaml @@ -0,0 +1,8 @@ +description: | + `412 Precondition Failed` is returned when `If-Match` request header doesn't match the latest version on the service side. + Returns also latest `version_uid` in the `Location` and `ETag` headers. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_ORGANISATION.yaml diff --git a/specifications/responses/412_ORGANISATION.yaml b/specifications/responses/412_ORGANISATION.yaml new file mode 100644 index 00000000..eb8bf2d0 --- /dev/null +++ b/specifications/responses/412_ORGANISATION.yaml @@ -0,0 +1,8 @@ +description: | + `412 Precondition Failed` is returned when `If-Match` request header doesn't match the latest version on the service side. + Returns also latest `version_uid` in the `Location` and `ETag` headers. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_ORGANISATION.yaml diff --git a/specifications/responses/412_ROLE.yaml b/specifications/responses/412_ROLE.yaml new file mode 100644 index 00000000..915bac84 --- /dev/null +++ b/specifications/responses/412_ROLE.yaml @@ -0,0 +1,8 @@ +description: | + `412 Precondition Failed` is returned when `If-Match` request header doesn't match the latest version on the service side. + Returns also latest `version_uid` in the `Location` and `ETag` headers. +headers: + ETag: + $ref: ../headers/ETag.yaml + Location: + $ref: ../headers/Location_ROLE.yaml diff --git a/specifications/schemas/demographic/UMImportedVersionOfGroup.yaml b/specifications/schemas/demographic/UMImportedVersionOfGroup.yaml new file mode 100644 index 00000000..1c324b96 --- /dev/null +++ b/specifications/schemas/demographic/UMImportedVersionOfGroup.yaml @@ -0,0 +1,15 @@ +title: IMPORTED_VERSION +type: object +allOf: + - $ref: ../common/ImportedVersion.yaml +required: + - _type +properties: + _type: + type: string + enum: [IMPORTED_VERSION] + data: + $ref: ../demographic/Group.yaml + item: + $ref: ../demographic/UMOriginalVersionOfGroup.yaml +x-discriminator-value: IMPORTED_VERSION diff --git a/specifications/schemas/demographic/UMImportedVersionOfOrganisation.yaml b/specifications/schemas/demographic/UMImportedVersionOfOrganisation.yaml new file mode 100644 index 00000000..1482e39f --- /dev/null +++ b/specifications/schemas/demographic/UMImportedVersionOfOrganisation.yaml @@ -0,0 +1,15 @@ +title: IMPORTED_VERSION +type: object +allOf: + - $ref: ../common/ImportedVersion.yaml +required: + - _type +properties: + _type: + type: string + enum: [IMPORTED_VERSION] + data: + $ref: ../demographic/Organisation.yaml + item: + $ref: ../demographic/UMOriginalVersionOfOrganisation.yaml +x-discriminator-value: IMPORTED_VERSION diff --git a/specifications/schemas/demographic/UMImportedVersionOfRole.yaml b/specifications/schemas/demographic/UMImportedVersionOfRole.yaml new file mode 100644 index 00000000..84f371f0 --- /dev/null +++ b/specifications/schemas/demographic/UMImportedVersionOfRole.yaml @@ -0,0 +1,15 @@ +title: IMPORTED_VERSION +type: object +allOf: + - $ref: ../common/ImportedVersion.yaml +required: + - _type +properties: + _type: + type: string + enum: [IMPORTED_VERSION] + data: + $ref: ../demographic/Role.yaml + item: + $ref: ../demographic/UMOriginalVersionOfRole.yaml +x-discriminator-value: IMPORTED_VERSION diff --git a/specifications/schemas/demographic/UMOriginalVersionOfGroup.yaml b/specifications/schemas/demographic/UMOriginalVersionOfGroup.yaml new file mode 100644 index 00000000..da4b603e --- /dev/null +++ b/specifications/schemas/demographic/UMOriginalVersionOfGroup.yaml @@ -0,0 +1,13 @@ +title: ORIGINAL_VERSION +type: object +allOf: + - $ref: ../common/OriginalVersion.yaml +required: + - _type +properties: + _type: + type: string + enum: [ORIGINAL_VERSION] + data: + $ref: ../demographic/Group.yaml +x-discriminator-value: ORIGINAL_VERSION diff --git a/specifications/schemas/demographic/UMOriginalVersionOfOrganisation.yaml b/specifications/schemas/demographic/UMOriginalVersionOfOrganisation.yaml new file mode 100644 index 00000000..74ada897 --- /dev/null +++ b/specifications/schemas/demographic/UMOriginalVersionOfOrganisation.yaml @@ -0,0 +1,13 @@ +title: ORIGINAL_VERSION +type: object +allOf: + - $ref: ../common/OriginalVersion.yaml +required: + - _type +properties: + _type: + type: string + enum: [ORIGINAL_VERSION] + data: + $ref: ../demographic/Organisation.yaml +x-discriminator-value: ORIGINAL_VERSION diff --git a/specifications/schemas/demographic/UMOriginalVersionOfRole.yaml b/specifications/schemas/demographic/UMOriginalVersionOfRole.yaml new file mode 100644 index 00000000..5f11f7e3 --- /dev/null +++ b/specifications/schemas/demographic/UMOriginalVersionOfRole.yaml @@ -0,0 +1,13 @@ +title: ORIGINAL_VERSION +type: object +allOf: + - $ref: ../common/OriginalVersion.yaml +required: + - _type +properties: + _type: + type: string + enum: [ORIGINAL_VERSION] + data: + $ref: ../demographic/Role.yaml +x-discriminator-value: ORIGINAL_VERSION diff --git a/specifications/schemas/demographic/UVersionOfGroup.yaml b/specifications/schemas/demographic/UVersionOfGroup.yaml new file mode 100644 index 00000000..2c8c532d --- /dev/null +++ b/specifications/schemas/demographic/UVersionOfGroup.yaml @@ -0,0 +1,9 @@ +title: VERSION +oneOf: + - $ref: ../demographic/UMOriginalVersionOfGroup.yaml + - $ref: ../demographic/UMImportedVersionOfGroup.yaml +discriminator: + propertyName: _type + mapping: + ORIGINAL_VERSION: ../demographic/UMOriginalVersionOfGroup.yaml + IMPORTED_VERSION: ../demographic/UMImportedVersionOfGroup.yaml diff --git a/specifications/schemas/demographic/UVersionOfOrganisation.yaml b/specifications/schemas/demographic/UVersionOfOrganisation.yaml new file mode 100644 index 00000000..d8b682aa --- /dev/null +++ b/specifications/schemas/demographic/UVersionOfOrganisation.yaml @@ -0,0 +1,9 @@ +title: VERSION +oneOf: + - $ref: ../demographic/UMOriginalVersionOfOrganisation.yaml + - $ref: ../demographic/UMImportedVersionOfOrganisation.yaml +discriminator: + propertyName: _type + mapping: + ORIGINAL_VERSION: ../demographic/UMOriginalVersionOfOrganisation.yaml + IMPORTED_VERSION: ../demographic/UMImportedVersionOfOrganisation.yaml diff --git a/specifications/schemas/demographic/UVersionOfRole.yaml b/specifications/schemas/demographic/UVersionOfRole.yaml new file mode 100644 index 00000000..1530ca84 --- /dev/null +++ b/specifications/schemas/demographic/UVersionOfRole.yaml @@ -0,0 +1,9 @@ +title: VERSION +oneOf: + - $ref: ../demographic/UMOriginalVersionOfRole.yaml + - $ref: ../demographic/UMImportedVersionOfRole.yaml +discriminator: + propertyName: _type + mapping: + ORIGINAL_VERSION: ../demographic/UMOriginalVersionOfRole.yaml + IMPORTED_VERSION: ../demographic/UMImportedVersionOfRole.yaml diff --git a/specifications/schemas/demographic/VersionOfGroup.yaml b/specifications/schemas/demographic/VersionOfGroup.yaml new file mode 100644 index 00000000..5f88fb9d --- /dev/null +++ b/specifications/schemas/demographic/VersionOfGroup.yaml @@ -0,0 +1,18 @@ +title: VERSION +type: object +description: A VERSION resource +required: + - contribution + - commit_audit + - data +properties: + _type: + type: string + contribution: + $ref: ../base_types/ObjectRef.yaml + signature: + type: string + commit_audit: + $ref: ../common/AuditDetails.yaml + data: + $ref: ../demographic/Group.yaml diff --git a/specifications/schemas/demographic/VersionOfOrganisation.yaml b/specifications/schemas/demographic/VersionOfOrganisation.yaml new file mode 100644 index 00000000..365a3154 --- /dev/null +++ b/specifications/schemas/demographic/VersionOfOrganisation.yaml @@ -0,0 +1,18 @@ +title: VERSION +type: object +description: A VERSION resource +required: + - contribution + - commit_audit + - data +properties: + _type: + type: string + contribution: + $ref: ../base_types/ObjectRef.yaml + signature: + type: string + commit_audit: + $ref: ../common/AuditDetails.yaml + data: + $ref: ../demographic/Organisation.yaml diff --git a/specifications/schemas/demographic/VersionOfRole.yaml b/specifications/schemas/demographic/VersionOfRole.yaml new file mode 100644 index 00000000..bfb20cdd --- /dev/null +++ b/specifications/schemas/demographic/VersionOfRole.yaml @@ -0,0 +1,18 @@ +title: VERSION +type: object +description: A VERSION resource +required: + - contribution + - commit_audit + - data +properties: + _type: + type: string + contribution: + $ref: ../base_types/ObjectRef.yaml + signature: + type: string + commit_audit: + $ref: ../common/AuditDetails.yaml + data: + $ref: ../demographic/Role.yaml diff --git a/specifications/schemas/demographic/VersionedGroup.yaml b/specifications/schemas/demographic/VersionedGroup.yaml new file mode 100644 index 00000000..ac2a9e0e --- /dev/null +++ b/specifications/schemas/demographic/VersionedGroup.yaml @@ -0,0 +1,21 @@ +title: VERSIONED_GROUP +description: A VERSIONED_GROUP resource +type: object +allOf: + - $ref: ../common/VersionedObject.yaml +properties: + _type: + type: string + default: VERSIONED_GROUP +x-discriminator-value: VERSIONED_GROUP +example: + uid: + value: 8849182c-82ad-4088-a07f-48ead4180515 + owner_id: + id: + _type: HIER_OBJECT_ID + value: 7d44b88c-4199-4bad-97dc-d78268e01398 + namespace: local + type: EHR + time_created: + value: '2015-01-20T19:30:22.765+01:00' diff --git a/specifications/schemas/demographic/VersionedOrganisation.yaml b/specifications/schemas/demographic/VersionedOrganisation.yaml new file mode 100644 index 00000000..7e757d5b --- /dev/null +++ b/specifications/schemas/demographic/VersionedOrganisation.yaml @@ -0,0 +1,21 @@ +title: VERSIONED_ORGANISATION +description: A VERSIONED_ORGANISATION resource +type: object +allOf: + - $ref: ../common/VersionedObject.yaml +properties: + _type: + type: string + default: VERSIONED_ORGANISATION +x-discriminator-value: VERSIONED_ORGANISATION +example: + uid: + value: 8849182c-82ad-4088-a07f-48ead4180515 + owner_id: + id: + _type: HIER_OBJECT_ID + value: 7d44b88c-4199-4bad-97dc-d78268e01398 + namespace: local + type: EHR + time_created: + value: '2015-01-20T19:30:22.765+01:00' diff --git a/specifications/schemas/demographic/VersionedRole.yaml b/specifications/schemas/demographic/VersionedRole.yaml new file mode 100644 index 00000000..f9e6705e --- /dev/null +++ b/specifications/schemas/demographic/VersionedRole.yaml @@ -0,0 +1,21 @@ +title: VERSIONED_ROLE +description: A VERSIONED_ROLE resource +type: object +allOf: + - $ref: ../common/VersionedObject.yaml +properties: + _type: + type: string + default: VERSIONED_ROLE +x-discriminator-value: VERSIONED_ROLE +example: + uid: + value: 8849182c-82ad-4088-a07f-48ead4180515 + owner_id: + id: + _type: HIER_OBJECT_ID + value: 7d44b88c-4199-4bad-97dc-d78268e01398 + namespace: local + type: EHR + time_created: + value: '2015-01-20T19:30:22.765+01:00'