From 3689a98074b79c3e53cccbc4e16af7b0cb5af620 Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 20 May 2024 12:27:20 +0200 Subject: [PATCH 1/6] initial commit --- CNAME | 2 +- README.md | 41 +--- README_en.md | 13 +- generator_config.yaml | 10 +- index.html | 2 +- openapi.yaml | 421 ++++++++++++++++++++++++++++++++++++++--- openapi_en.yaml | 430 +++++++++++++++++++++++++++++++++++++++--- 7 files changed, 806 insertions(+), 113 deletions(-) diff --git a/CNAME b/CNAME index dfa5bb8..bb2452b 100644 --- a/CNAME +++ b/CNAME @@ -1 +1 @@ -.api.bund.dev \ No newline at end of file +https://klinikatlas.api.bund.dev diff --git a/README.md b/README.md index 5f20e42..fff3461 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,5 @@ [[DE]](README.md)/[[EN]](README_en.md) +# Bundes-Klinik-Atlas API -# [_TEMPLATE_] - -## Quickstart - -- Add openAPI spec in German to _openapi.yml_ -- Add openAPI spec in English to _openapi_en.yml_ (or remove _openapi_en.yml_ ) -- Update _index.html_ (insert the API-name in the title) -- Update _generator_config.yaml_ (Update all values surrounded with <>) -- Update the url in _CNAME_ once the api has its own subdomain -- Replace the content of README.md with a German description of the API -- Fill (or remove) README_en.md or add README-files in other languages. - - -## Add Library to deutschland package - -Fork the [deutschland](https://github.com/bundesAPI/deutschland) package: - -1. In the `pyproject.toml` of the [deutschland-package](https://github.com/bundesAPI/deutschland/blob/main/pyproject.toml) add a entry in the dependency section. The values for `` and `` must match with the values in `generator_config.yaml` - For Example: - - ```de-`` = {version= "^``", optional = true}``` -2. Under the ```[tool.poetry.extras]``` section add the following - ```` =["de-``"]``` - - Also add de-name in the all list: -``` - all = ["de-bundestag-lobbyregister","de-dip-bundestag","de-pegel-online","de-ausbildungssuche", - "de-berufssprachkurssuche","de-coachingangebote","de-dip-bundestag","de-entgeltatlas", - "de-hochwasserzentralen","de-pflanzenschutzmittelzulassung","de-studiensuche", - "de-tagesschau", "de-weiterbildungssuche","de-feiertage",...,"de-``"] -``` - -3. Add apis into [test_imports.py](https://github.com/bundesAPI/deutschland/blob/main/tests/test_imports.py) - ``` - from deutschland..apis import DefaultApi - ``` - -4. Open a [merge request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). - +Die Bundes-Klinik-Atlas API steht hinter der Seite https://bundes-klinik-atlas.de/ und stellt umfassende und vergleichbare Informationen über deutsche Kliniken bereit. Die Daten unterstützen Patient:innen bei der Auswahl des richtigen Krankenhauses und bieten umfassende Informationen über die Versorgungsqualität, die ärztliche und pflegerische Personalausstattung sowie andere wichtige Datenpunkte. diff --git a/README_en.md b/README_en.md index 3439038..8fa7351 100644 --- a/README_en.md +++ b/README_en.md @@ -1,14 +1,5 @@ [[DE]](README.md)/[[EN]](README_en.md) +# Bundes-Klinik-Atlas API -# [_TEMPLATE_] - -## Quickstart - -- Add openAPI spec in German to _openapi.yml_ -- Add openAPI spec in English to _openapi_en.yml_ (or remove _openapi_en.yml_ ) -- Update _index.html_ (insert the API-name in the title) -- Update _generator_config.yaml_ (Update all values surrounded with <>) -- Update the url in _CNAME_ once the api has its own subdomain -- Replace the content of README.md with a German description of the API -- Fill (or remove) README_en.md or add README-files in other languages. +The Bundes-Klinik-Atlas API powers the website https://bundes-klinik-atlas.de/ and provides comprehensive and comparable information about German clinics. The data supports patients in choosing the right hospital and offers detailed information about the quality of care, the medical and nursing staff, and other important data points. diff --git a/generator_config.yaml b/generator_config.yaml index 5552435..ec6d619 100644 --- a/generator_config.yaml +++ b/generator_config.yaml @@ -1,15 +1,15 @@ -templateDir: deutschland_templates # For local use: ./local/deutschland_templates +templateDir: deutschland_templates additionalProperties: - packageName: "" + packageName: "klinikatlas" infoName: "BundesAPI" infoEmail: "kontakt@bund.dev" - packageVersion: - packageUrl: "https://github.com/bundesAPI/" + packageVersion: "1.0.0" + packageUrl: "https://github.com/bundesAPI/klinikatlas-api" namespace: "deutschland" docLanguage: "de" gitHost: "github.com" gitUserId: "bundesAPI" -gitRepoId: "" +gitRepoId: "klinikatlas-api" files: pyproject.mustache: destinationFilename: pyproject.toml diff --git a/index.html b/index.html index 706a7e9..f275a0f 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - {{repo_name}} - OpenAPI Documentation + Bundes-Klinik-Atlas API - OpenAPI Documentation diff --git a/openapi.yaml b/openapi.yaml index 2b82c63..2b0e51b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1,45 +1,412 @@ openapi: "3.0.0" info: - description: "API Description" + description: "Die API des Bundes-Klinik-Atlas stellt eine Vielzahl von Informationen über deutsche Kliniken und deren Ausstattung bereit." version: "1.0.0" - title: "API Name" - x-office: "Amtsname" + title: "Bundes-Klinik-Atlas API" + x-office: "Bundesministerium für Gesundheit" contact: - name: Zuständige Behörde - email: behoerde@example.de - url: https://example.de + name: "Bundesministerium für Gesundheit" + email: poststelle@bmg.bund.de + url: https://bundes-klinik-atlas.de servers: - - url: "https://warnung.bund.de/api31" - -tags: - - name: default + - url: https://bundes-klinik-atlas.de paths: - /dashboard/{AGS}.json: + /fileadmin/json/locations.json: + get: + summary: Liste deutscher Kliniken abrufen + responses: + '200': + description: Erfolgreiche Antwort + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + street: + type: string + city: + type: string + zip: + type: integer + phone: + type: string + mail: + type: string + beds_number: + type: integer + latitude: + type: string + longitude: + type: string + link: + type: string + + /fileadmin/json/states.json: + get: + summary: Liste deutscher Bundesländer abrufen + responses: + '200': + description: Erfolgreiche Antwort + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + cases_number: + type: integer + caregivers_number: + type: integer + doctors_number: + type: integer + location_number: + type: integer + + /fileadmin/json/german-states.json: + get: + summary: Liste deutscher Bundesländer mit Koordinaten abrufen + responses: + '200': + description: Erfolgreiche Antwort + content: + application/json: + schema: + type: array + items: + type: object + properties: + state: + type: string + lat: + type: string + lon: + type: string + + /fileadmin/json/icd_codes.json: + get: + summary: Liste der ICD-Codes abrufen + responses: + '200': + description: Erfolgreiche Antwort + content: + application/json: + schema: + type: array + items: + type: object + properties: + icdcode: + type: string + description: + type: string + + /fileadmin/json/ops_codes.json: + get: + summary: Liste der OPS-Codes abrufen + responses: + '200': + description: Erfolgreiche Antwort + content: + application/json: + schema: + type: array + items: + type: object + properties: + opscode: + type: string + description: + type: string + + /fileadmin/json/german-places.json: + get: + summary: Liste deutscher Orte abrufen + responses: + '200': + description: Erfolgreiche Antwort + content: + application/json: + schema: + type: array + items: + type: object + properties: + p: + type: string + c: + type: string + m: + type: string + ct: + type: integer + d: + type: string + lt: + type: string + ln: + type: string + + /searchresults/: get: - summary: Name des Endpoints - description: Hier wird die Funktion des Endpunktes beschrieben. - operationId: getAGS - tags: - - default + summary: Suche nach Krankenhäusern basierend auf spezifischen Kriterien + parameters: + - name: tx_solr[start] + in: query + schema: + type: integer + description: Startindex für die Suchergebnisse + - name: tx_solr[rows] + in: query + schema: + type: integer + description: Anzahl der zurückzugebenden Zeilen + - name: tx_solr[geolabel] + in: query + schema: + type: string + description: Geographisches Label zum Filtern der Ergebnisse + - name: tx_solr[latlon] + in: query + schema: + type: string + description: Breitengrad und Längengrad zum Filtern der Ergebnisse + - name: tx_solr[ops] + in: query + schema: + type: string + description: OPS-Codes zum Filtern der Ergebnisse + - name: tx_solr[searchlabel] + in: query + schema: + type: string + description: Suchlabel zum Filtern der Ergebnisse + - name: tx_solr[icd] + in: query + schema: + type: string + description: ICD-Codes zum Filtern der Ergebnisse + - name: tx_solr[quantile] + in: query + schema: + type: string + description: Quantil zum Filtern der Ergebnisse + - name: tx_solr[department] + in: query + schema: + type: string + description: Abteilung zum Filtern der Ergebnisse responses: - "200": - description: OK + '200': + description: Erfolgreiche Antwort content: application/json: schema: - $ref: "#/components/schemas/Result" + type: object + properties: + results: + type: array + items: + type: object + properties: + id: + type: integer + header: + type: string + address: + type: string + distance: + type: number + detailLink: + type: string + content: + type: object + properties: + items: + type: array + items: + type: object + properties: + header: + type: string + icon: + type: string + tooltip: + type: string + infoData: + type: array + items: + type: object + filters: + type: object + properties: + fields: + type: array + items: + type: object + properties: + template: + type: string + label: + type: string + extraClass: + type: string + tooltip: + type: string + id: + type: string + name: + type: string + value: + type: string + showValue: + type: integer + appendUnit: + type: string + showRangeLabel: + type: boolean + sliderOptions: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + labelClass: + type: string + options: + type: array + items: + type: object + properties: + label: + type: string + id: + type: string + value: + type: string + icon: + type: string + selected: + type: boolean + tooltip: + type: string + isAccordion: + type: boolean + tagName: + type: string + headingClass: + type: string + isHorizontal: + type: boolean + sortings: + type: object + properties: + fields: + type: array + items: + type: object + properties: + template: + type: string + isHorizontal: + type: boolean + label: + type: string + id: + type: string + options: + type: array + items: + type: object + properties: + label: + type: string + id: + type: string + value: + type: string + selected: + type: boolean + metaInfos: + type: object + properties: + searchArguments: + type: object + properties: + rows: + type: string + geolabel: + type: string + latlon: + type: string + ops: + type: string + searchlabel: + type: string + start: + type: string + quantile: + type: string + department: + type: string + searchResultCount: + type: integer + maxSearchResultsFoundLabel: + type: string + loadMore: + type: boolean + + /krankenhaussuche/krankenhaus/{id}/: + get: + summary: Details zu einem spezifischen Krankenhaus abrufen parameters: - - in: path + - name: id + in: path required: true - name: AGS + schema: + type: integer + description: Eindeutige Kennung des Krankenhauses + - name: tx_tverzhospitaldata_show[department] + in: query + schema: + type: string + description: Abteilungsfilter + - name: tx_tverzhospitaldata_show[geolabel] + in: query schema: type: string - description: Amtlicher Gebietsschlüssel - kann z.B. von [hier](https://www.xrepository.de/api/xrepository/urn:de:bund:destatis:bevoelkerungsstatistik:schluessel:rs_2021-07-31/download/Regionalschl_ssel_2021-07-31.json) bezogen werden. Die Letzten 7 Stellen müssen dabei mit "0000000" ersetzt werden, weil die Daten nur auf [Kreisebene](https://de.wikipedia.org/wiki/Amtlicher_Gemeindeschl%C3%BCssel) bereitgestellt werden. - example: "example-parameter" + description: Geografischer Labelfilter + - name: tx_tverzhospitaldata_show[quantile] + in: query + schema: + type: string + description: Quantilfilter + - name: tx_tverzhospitaldata_show[searchlabel] + in: query + schema: + type: string + description: Suchlabelfilter + - name: cHash + in: query + schema: + type: string + description: Cache-Hash + responses: + '200': + description: Erfolgreiche Antwort + content: + text/html: + schema: + type: string -components: - schemas: - Result: - type: string diff --git a/openapi_en.yaml b/openapi_en.yaml index 62dea6b..9df15b7 100644 --- a/openapi_en.yaml +++ b/openapi_en.yaml @@ -1,46 +1,418 @@ openapi: "3.0.0" info: - description: "API Description" + description: "The Bundes-Klinik-Atlas API provides information about German clinics and their facilities." version: "1.0.0" - title: "API Name" - x-office: "Amtsname" + title: "Bundes-Klinik-Atlas API" + x-office: "Federal Ministry of Health" contact: - name: Responsible authority - email: behoerde@example.com - url: https://example.com + name: "Federal Ministry of Health" + email: poststelle@bmg.bund.de + url: https://bundes-klinik-atlas.de servers: - - url: "https://warnung.bund.de/api31" - -tags: - - name: default + - url: https://bundes-klinik-atlas.de paths: - /dashboard/{AGS}.json: + /fileadmin/json/locations.json: + get: + summary: Retrieve a list of German clinics + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + street: + type: string + city: + type: string + zip: + type: integer + phone: + type: string + mail: + type: string + beds_number: + type: integer + latitude: + type: string + longitude: + type: string + link: + type: string + + /fileadmin/json/states.json: + get: + summary: Retrieve a list of German states + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + cases_number: + type: integer + caregivers_number: + type: integer + doctors_number: + type: integer + location_number: + type: integer + + /fileadmin/json/german-states.json: + get: + summary: Retrieve a list of German states with coordinates + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + type: object + properties: + state: + type: string + lat: + type: string + lon: + type: string + + /fileadmin/json/icd_codes.json: + get: + summary: Retrieve a list of ICD codes + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + type: object + properties: + icdcode: + type: string + description: + type: string + + /fileadmin/json/ops_codes.json: + get: + summary: Retrieve a list of OPS codes + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + type: object + properties: + opscode: + type: string + description: + type: string + + /fileadmin/json/german-places.json: get: - summary: Name of endpoint - description: Here the function of the end point is described. - operationId: getAGS - tags: - - default + summary: Retrieve a list of German places + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + type: object + properties: + p: + type: string + c: + type: string + m: + type: string + ct: + type: integer + d: + type: string + lt: + type: string + ln: + type: string + + /searchresults/: + get: + summary: Search for hospitals based on specific criteria + parameters: + - name: tx_solr[start] + in: query + schema: + type: integer + description: Start index for the search results + - name: tx_solr[rows] + in: query + schema: + type: integer + description: Number of rows to return + - name: tx_solr[geolabel] + in: query + schema: + type: string + description: Geographical label for filtering results + - name: tx_solr[latlon] + in: query + schema: + type: string + description: Latitude and longitude for filtering results + - name: tx_solr[ops] + in: query + schema: + type: string + description: OPS codes for filtering results + - name: tx_solr[searchlabel] + in: query + schema: + type: string + description: Search label for filtering results + - name: tx_solr[icd] + in: query + schema: + type: string + description: ICD codes for filtering results + - name: tx_solr[quantile] + in: query + schema: + type: string + description: Quantile for filtering results + - name: tx_solr[department] + in: query + schema: + type: string + description: Department for filtering results responses: '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Result' + description: Successful response + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + type: object + properties: + id: + type: integer + header: + type: string + address: + type: string + distance: + type: number + detailLink: + type: string + content: + type: object + properties: + items: + type: array + items: + type: object + properties: + header: + type: string + icon: + type: string + tooltip: + type: string + infoData: + type: array + items: + type: object + filters: + type: object + properties: + fields: + type: array + items: + type: object + properties: + template: + type: string + label: + type: string + extraClass: + type: string + tooltip: + type: string + id: + type: string + name: + type: string + value: + type: string + showValue: + type: integer + appendUnit: + type: string + showRangeLabel: + type: boolean + sliderOptions: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + labelClass: + type: string + options: + type: array + items: + type: object + properties: + label: + type: string + id: + type: string + value: + type: string + icon: + type: string + selected: + type: boolean + tooltip: + type: string + isAccordion: + type: boolean + tagName: + type: string + headingClass: + type: string + isHorizontal: + type: boolean + sortings: + type: object + properties: + fields: + type: array + items: + type: object + properties: + template: + type: string + isHorizontal: + type: boolean + label: + type: string + id: + type: string + options: + type: array + items: + type: object + properties: + label: + type: string + id: + type: string + value: + type: string + selected: + type: boolean + metaInfos: + type: object + properties: + searchArguments: + type: object + properties: + rows: + type: string + geolabel: + type: string + latlon: + type: string + ops: + type: string + searchlabel: + type: string + start: + type: string + quantile: + type: string + department: + type: string + searchResultCount: + type: integer + maxSearchResultsFoundLabel: + type: string + loadMore: + type: boolean + + /krankenhaussuche/krankenhaus/{id}/: + get: + summary: Retrieve details of a specific hospital parameters: - - in: path + - name: id + in: path required: true - name: AGS + schema: + type: integer + description: Unique identifier of the hospital + - name: tx_tverzhospitaldata_show[department] + in: query schema: type: string - description: Official area key - can be retrieved from [here](https://www.xrepository.de/api/xrepository/urn:de:bund:destatis:bevoelkerungsstatistik:schluessel:rs_2021-07-31/download/Regionalschl_ssel_2021-07-31.json). The last 7 digits have to be replaced with "0000000" because data is only offered on the area level [Kreisebene](https://de.wikipedia.org/wiki/Amtlicher_Gemeindeschl%C3%BCssel). - example: "example-parameter" + description: Department filter + - name: tx_tverzhospitaldata_show[geolabel] + in: query + schema: + type: string + description: Geographical label filter + - name: tx_tverzhospitaldata_show[quantile] + in: query + schema: + type: string + description: Quantile filter + - name: tx_tverzhospitaldata_show[searchlabel] + in: query + schema: + type: string + description: Search label filter + - name: cHash + in: query + schema: + type: string + description: Cache hash + responses: + '200': + description: Successful response + content: + text/html: + schema: + type: string + + + + + -components: - schemas: - Result: - type: string From 55ce1aec1eaa14a0339c4d39cf9083c22c35a2cd Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 20 May 2024 16:57:21 +0200 Subject: [PATCH 2/6] added error messages and fixed type error --- openapi.yaml | 63 ++++++++++++++++++++++++++++++++--- openapi_en.yaml | 87 +++++++++++++++++++++++++++++++++++++------------ 2 files changed, 125 insertions(+), 25 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 2b0e51b..428d7b1 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -46,6 +46,12 @@ paths: type: string link: type: string + '503': + description: Service Unavailable + content: + text/html: + schema: + type: string /fileadmin/json/states.json: get: @@ -70,6 +76,12 @@ paths: type: integer location_number: type: integer + '503': + description: Service Unavailable + content: + text/html: + schema: + type: string /fileadmin/json/german-states.json: get: @@ -90,6 +102,12 @@ paths: type: string lon: type: string + '503': + description: Service Unavailable + content: + text/html: + schema: + type: string /fileadmin/json/icd_codes.json: get: @@ -108,6 +126,12 @@ paths: type: string description: type: string + '503': + description: Service Unavailable + content: + text/html: + schema: + type: string /fileadmin/json/ops_codes.json: get: @@ -126,6 +150,12 @@ paths: type: string description: type: string + '503': + description: Service Unavailable + content: + text/html: + schema: + type: string /fileadmin/json/german-places.json: get: @@ -154,6 +184,12 @@ paths: type: string ln: type: string + '503': + description: Service Unavailable + content: + text/html: + schema: + type: string /searchresults/: get: @@ -345,7 +381,7 @@ paths: type: object properties: rows: - type: string + type: integer geolabel: type: string latlon: @@ -355,7 +391,7 @@ paths: searchlabel: type: string start: - type: string + type: integer quantile: type: string department: @@ -366,8 +402,14 @@ paths: type: string loadMore: type: boolean - - /krankenhaussuche/krankenhaus/{id}/: + '503': + description: Service Unavailable + content: + text/html: + schema: + type: string + + /krankenhaussuche/krankenhaus/{id}/: get: summary: Details zu einem spezifischen Krankenhaus abrufen parameters: @@ -409,4 +451,15 @@ paths: text/html: schema: type: string - + '404': + description: Nicht gefunden + content: + text/html: + schema: + type: string + '503': + description: Service Unavailable + content: + text/html: + schema: + type: string \ No newline at end of file diff --git a/openapi_en.yaml b/openapi_en.yaml index 9df15b7..0aff891 100644 --- a/openapi_en.yaml +++ b/openapi_en.yaml @@ -17,7 +17,7 @@ paths: get: summary: Retrieve a list of German clinics responses: - '200': + "200": description: Successful response content: application/json: @@ -46,12 +46,18 @@ paths: type: string link: type: string + "503": + description: Service Unavailable + content: + text/html: + schema: + type: string /fileadmin/json/states.json: get: summary: Retrieve a list of German states responses: - '200': + "200": description: Successful response content: application/json: @@ -70,12 +76,18 @@ paths: type: integer location_number: type: integer + "503": + description: Service Unavailable + content: + text/html: + schema: + type: string /fileadmin/json/german-states.json: get: summary: Retrieve a list of German states with coordinates responses: - '200': + "200": description: Successful response content: application/json: @@ -90,12 +102,18 @@ paths: type: string lon: type: string + "503": + description: Service Unavailable + content: + text/html: + schema: + type: string /fileadmin/json/icd_codes.json: get: summary: Retrieve a list of ICD codes responses: - '200': + "200": description: Successful response content: application/json: @@ -108,12 +126,18 @@ paths: type: string description: type: string + "503": + description: Service Unavailable + content: + text/html: + schema: + type: string /fileadmin/json/ops_codes.json: get: summary: Retrieve a list of OPS codes responses: - '200': + "200": description: Successful response content: application/json: @@ -126,12 +150,18 @@ paths: type: string description: type: string + "503": + description: Service Unavailable + content: + text/html: + schema: + type: string /fileadmin/json/german-places.json: get: summary: Retrieve a list of German places responses: - '200': + "200": description: Successful response content: application/json: @@ -154,6 +184,12 @@ paths: type: string ln: type: string + "503": + description: Service Unavailable + content: + text/html: + schema: + type: string /searchresults/: get: @@ -163,12 +199,12 @@ paths: in: query schema: type: integer - description: Start index for the search results + description: Start index for search results - name: tx_solr[rows] in: query schema: type: integer - description: Number of rows to return + description: Number of rows to return (must be a positive integer) - name: tx_solr[geolabel] in: query schema: @@ -205,7 +241,7 @@ paths: type: string description: Department for filtering results responses: - '200': + "200": description: Successful response content: application/json: @@ -345,7 +381,7 @@ paths: type: object properties: rows: - type: string + type: integer geolabel: type: string latlon: @@ -355,7 +391,7 @@ paths: searchlabel: type: string start: - type: string + type: integer quantile: type: string department: @@ -366,8 +402,14 @@ paths: type: string loadMore: type: boolean + "503": + description: Service Unavailable + content: + text/html: + schema: + type: string - /krankenhaussuche/krankenhaus/{id}/: + /krankenhaussuche/krankenhaus/{id}/: get: summary: Retrieve details of a specific hospital parameters: @@ -403,16 +445,21 @@ paths: type: string description: Cache hash responses: - '200': + "200": description: Successful response content: text/html: schema: type: string - - - - - - - + "404": + description: Not Found + content: + text/html: + schema: + type: string + "503": + description: Service Unavailable + content: + text/html: + schema: + type: string From 84f5ee94d57b520a31fcf1635f8deccdc8e9be5d Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 20 May 2024 17:12:17 +0200 Subject: [PATCH 3/6] Fix API schema for searchresults and krankenhaus ID endpoints - Corrected the schema definition for GET /searchresults/: - Updated results property to be an array instead of a string. - Specified application/json as the content type for a successful response. - Enhanced schema for GET /krankenhaussuche/krankenhaus/{id}/: - Added documentation for possible 404 (Not Found) and 503 (Service Unavailable) responses. - Updated query parameter types and descriptions for better clarity. - Ensured schema accuracy and conformance to actual API responses. This commit addresses the issues identified during Schemathesis testing and aligns the schema with the actual API behavior. --- openapi_en.yaml | 42 +----------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/openapi_en.yaml b/openapi_en.yaml index 0aff891..11d0391 100644 --- a/openapi_en.yaml +++ b/openapi_en.yaml @@ -195,51 +195,11 @@ paths: get: summary: Search for hospitals based on specific criteria parameters: - - name: tx_solr[start] - in: query - schema: - type: integer - description: Start index for search results - name: tx_solr[rows] in: query schema: type: integer description: Number of rows to return (must be a positive integer) - - name: tx_solr[geolabel] - in: query - schema: - type: string - description: Geographical label for filtering results - - name: tx_solr[latlon] - in: query - schema: - type: string - description: Latitude and longitude for filtering results - - name: tx_solr[ops] - in: query - schema: - type: string - description: OPS codes for filtering results - - name: tx_solr[searchlabel] - in: query - schema: - type: string - description: Search label for filtering results - - name: tx_solr[icd] - in: query - schema: - type: string - description: ICD codes for filtering results - - name: tx_solr[quantile] - in: query - schema: - type: string - description: Quantile for filtering results - - name: tx_solr[department] - in: query - schema: - type: string - description: Department for filtering results responses: "200": description: Successful response @@ -409,7 +369,7 @@ paths: schema: type: string - /krankenhaussuche/krankenhaus/{id}/: + /krankenhaussuche/krankenhaus/{id}/: get: summary: Retrieve details of a specific hospital parameters: From 1793d5e502396b02b6e6f8d9ffdfb192f4cd43aa Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 20 May 2024 17:20:05 +0200 Subject: [PATCH 4/6] add additional schema fixes --- openapi_en.yaml | 46 +++++----------------------------------------- 1 file changed, 5 insertions(+), 41 deletions(-) diff --git a/openapi_en.yaml b/openapi_en.yaml index 11d0391..77054f0 100644 --- a/openapi_en.yaml +++ b/openapi_en.yaml @@ -46,12 +46,6 @@ paths: type: string link: type: string - "503": - description: Service Unavailable - content: - text/html: - schema: - type: string /fileadmin/json/states.json: get: @@ -76,12 +70,6 @@ paths: type: integer location_number: type: integer - "503": - description: Service Unavailable - content: - text/html: - schema: - type: string /fileadmin/json/german-states.json: get: @@ -102,12 +90,6 @@ paths: type: string lon: type: string - "503": - description: Service Unavailable - content: - text/html: - schema: - type: string /fileadmin/json/icd_codes.json: get: @@ -126,12 +108,6 @@ paths: type: string description: type: string - "503": - description: Service Unavailable - content: - text/html: - schema: - type: string /fileadmin/json/ops_codes.json: get: @@ -150,12 +126,6 @@ paths: type: string description: type: string - "503": - description: Service Unavailable - content: - text/html: - schema: - type: string /fileadmin/json/german-places.json: get: @@ -184,12 +154,6 @@ paths: type: string ln: type: string - "503": - description: Service Unavailable - content: - text/html: - schema: - type: string /searchresults/: get: @@ -264,7 +228,7 @@ paths: value: type: string showValue: - type: integer + type: integer # Changed to integer to match API response appendUnit: type: string showRangeLabel: @@ -277,7 +241,7 @@ paths: key: type: string value: - type: string + type: integer # Changed to integer to match API response labelClass: type: string options: @@ -290,7 +254,7 @@ paths: id: type: string value: - type: string + type: integer # Changed to integer to match API response icon: type: string selected: @@ -341,7 +305,7 @@ paths: type: object properties: rows: - type: integer + type: integer # Changed to integer to match API response geolabel: type: string latlon: @@ -351,7 +315,7 @@ paths: searchlabel: type: string start: - type: integer + type: integer # Changed to integer to match API response quantile: type: string department: From ba556701e036fd5b863c380060cfb257e193f8e2 Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 20 May 2024 17:26:22 +0200 Subject: [PATCH 5/6] add more schema fixes --- openapi_en.yaml | 167 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 162 insertions(+), 5 deletions(-) diff --git a/openapi_en.yaml b/openapi_en.yaml index 77054f0..46f5d8b 100644 --- a/openapi_en.yaml +++ b/openapi_en.yaml @@ -155,6 +155,163 @@ paths: ln: type: string + openapi: "3.0.0" +info: + description: "The Bundes-Klinik-Atlas API provides information about German clinics and their facilities." + version: "1.0.0" + title: "Bundes-Klinik-Atlas API" + x-office: "Federal Ministry of Health" + contact: + name: "Federal Ministry of Health" + email: poststelle@bmg.bund.de + url: https://bundes-klinik-atlas.de + +servers: + - url: https://bundes-klinik-atlas.de + +paths: + /fileadmin/json/locations.json: + get: + summary: Retrieve a list of German clinics + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + street: + type: string + city: + type: string + zip: + type: integer + phone: + type: string + mail: + type: string + beds_number: + type: integer + latitude: + type: string + longitude: + type: string + link: + type: string + + /fileadmin/json/states.json: + get: + summary: Retrieve a list of German states + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + cases_number: + type: integer + caregivers_number: + type: integer + doctors_number: + type: integer + location_number: + type: integer + + /fileadmin/json/german-states.json: + get: + summary: Retrieve a list of German states with coordinates + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: array + items: + type: object + properties: + state: + type: string + lat: + type: string + lon: + type: string + + /fileadmin/json/icd_codes.json: + get: + summary: Retrieve a list of ICD codes + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: array + items: + type: object + properties: + icdcode: + type: string + description: + type: string + + /fileadmin/json/ops_codes.json: + get: + summary: Retrieve a list of OPS codes + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: array + items: + type: object + properties: + opscode: + type: string + description: + type: string + + /fileadmin/json/german-places.json: + get: + summary: Retrieve a list of German places + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: array + items: + type: object + properties: + p: + type: string + c: + type: string + m: + type: string + ct: + type: integer + d: + type: string + lt: + type: string + ln: + type: string + /searchresults/: get: summary: Search for hospitals based on specific criteria @@ -228,7 +385,7 @@ paths: value: type: string showValue: - type: integer # Changed to integer to match API response + type: integer appendUnit: type: string showRangeLabel: @@ -241,7 +398,7 @@ paths: key: type: string value: - type: integer # Changed to integer to match API response + type: string labelClass: type: string options: @@ -254,7 +411,7 @@ paths: id: type: string value: - type: integer # Changed to integer to match API response + type: string icon: type: string selected: @@ -305,7 +462,7 @@ paths: type: object properties: rows: - type: integer # Changed to integer to match API response + type: integer geolabel: type: string latlon: @@ -315,7 +472,7 @@ paths: searchlabel: type: string start: - type: integer # Changed to integer to match API response + type: integer quantile: type: string department: From 887854c54806e322d68fa96c950d76b11e5ab407 Mon Sep 17 00:00:00 2001 From: wirthual Date: Sat, 25 May 2024 18:28:44 +0200 Subject: [PATCH 6/6] change zip from int to string --- openapi.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 428d7b1..b3cf368 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -33,7 +33,7 @@ paths: city: type: string zip: - type: integer + type: string phone: type: string mail: @@ -462,4 +462,4 @@ paths: content: text/html: schema: - type: string \ No newline at end of file + type: string