[api] [export] The export API now has an endpoint to fetch entries from inside an extraction directly.

EH/population-statistics-authorisation
Reinier Zwitserloot 1 year ago
parent bbc351536b
commit 6cfd454f8d
No known key found for this signature in database
GPG Key ID: DADEDCAA42950296

@ -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.<br />
If using the <a href="#tag/Exports/operation/exportsDownload">fetch as zip</a> endpoint, the zip will contain an entry named <code><em>that_name</em>.csv</code>.<br />
If using the <a href="#tag/Exports/operation/exportsDownloadPerTable">fetch each table individually</a> endpoint, this name represents a table name you can ask for.
items:
type: string
required:
- filename
- timestamp
- tables
required:
- agb
- name

@ -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':

@ -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'

@ -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:

Loading…
Cancel
Save