diff --git a/paths/exports_available.yaml b/paths/exports_available.yaml index cef7615..8a8e218 100644 --- a/paths/exports_available.yaml +++ b/paths/exports_available.yaml @@ -39,9 +39,18 @@ get: description: |- The export contains data sourced from an EPD system at this time; it will not contain any medical dossier data later than this timestamp. + tables: + type: array + description: |- + Lists the names of all tables that are provided as part of this export.
+ If using the fetch as zip endpoint, the zip will contain an entry named that_name.csv.
+ If using the fetch each table individually endpoint, this name represents a table name you can ask for. + items: + type: string required: - filename - timestamp + - tables required: - agb - name diff --git a/paths/exports_{agb}_{filename}.yaml b/paths/exports_{agb}_{filename}.yaml index fcf3516..874457a 100644 --- a/paths/exports_{agb}_{filename}.yaml +++ b/paths/exports_{agb}_{filename}.yaml @@ -13,13 +13,16 @@ get: - name: filename in: path required: true - description: The name of the file as provided by the `/exports/available` endpoint. + description: |- + The name of the file as provided by the `/exports/available` endpoint. schema: type: string responses: '200': description: |- Fetches the requested HIS export as ZIP file. + + Note that the response will have content type `application/zip` even if the requester's `Accept` header does not indicate this mime type is supported. '401': $ref: '../zoo-api.yaml/#/components/responses/NoAuth' '403': diff --git a/paths/exports_{agb}_{filename}_{tablename}.yaml b/paths/exports_{agb}_{filename}_{tablename}.yaml new file mode 100644 index 0000000..891729e --- /dev/null +++ b/paths/exports_{agb}_{filename}_{tablename}.yaml @@ -0,0 +1,36 @@ +get: + operationId: exportsDownloadPerTable + tags: + - Exports + summary: Download one CSV table from an available export + parameters: + - name: agb + in: path + description: The AGB code of the practice for the export file you want to download. + required: true + schema: + $ref: ../schemas/agb.yaml + - name: filename + in: path + required: true + description: |- + The name of the file as provided by the `/exports/available` endpoint. + schema: + type: string + - name: tablename + in: path + required: true + description: |- + The name of one of the tables in the export as provided by the `/exports/available` endpoint's `tables` list. + schema: + type: string + responses: + '200': + description: |- + Fetches the requested table from the HIS export. + + Note that the response will have the content type of the request resource (usually `text/csv`) even if the requester's `Accept` header does not indicate this mime type is supported. + '401': + $ref: '../zoo-api.yaml/#/components/responses/NoAuth' + '403': + $ref: '../zoo-api.yaml/#/components/responses/NoAccess' \ No newline at end of file diff --git a/zoo-api.yaml b/zoo-api.yaml index a6bf124..31fbf44 100644 --- a/zoo-api.yaml +++ b/zoo-api.yaml @@ -95,6 +95,8 @@ paths: $ref: 'paths/exports_available.yaml' /exports/{agb}/{filename}: $ref: 'paths/exports_{agb}_{filename}.yaml' + /exports/{agb}/{filename}/{tablename}: + $ref: 'paths/exports_{agb}_{filename}_{tablename}.yaml' components: parameters: Authorization: