From 33a3b12824a08783140abcdab9aa41df033eb691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gru=CC=88ndner?= Date: Fri, 8 Sep 2023 15:08:54 +0200 Subject: [PATCH] Optimize Code Structure and Revamp Reports Closes: #2 --- .env.default | 16 +- .github/workflows/buid.yml | 46 + .gitignore | 6 +- CHANGELOG.md | 1 + DEVELOPMENT.md | 13 + Dockerfile | 17 - README.md | 69 ++ automatic-connection-test.py | 324 ------- config/config.yml | 57 ++ config/history-query.json | 38 + .../input-queries.json | 202 ++++- docker-compose.yml | 16 - docker-entrypoint.sh | 21 - docker/Dockerfile | 25 + docker/docker-compose.yml | 28 + docker/docker-entrypoint.sh | 30 + docker/requirements.txt | 4 + input-queries-translated.json | 839 ------------------ reports/README.md | 1 - src/execute-local.sh | 30 + src/py/execute_feasibility_test.py | 307 +++++++ src/py/execute_ping_test.py | 103 +++ src/py/feasibility-monitoring.py | 104 +++ src/resources/ping-task.xml | 35 + translate-input-queries.py | 17 - 25 files changed, 1060 insertions(+), 1289 deletions(-) create mode 100644 .github/workflows/buid.yml create mode 100644 CHANGELOG.md create mode 100644 DEVELOPMENT.md delete mode 100644 Dockerfile delete mode 100644 automatic-connection-test.py create mode 100644 config/config.yml create mode 100644 config/history-query.json rename input-queries.json => config/input-queries.json (67%) delete mode 100644 docker-compose.yml delete mode 100644 docker-entrypoint.sh create mode 100644 docker/Dockerfile create mode 100644 docker/docker-compose.yml create mode 100644 docker/docker-entrypoint.sh create mode 100644 docker/requirements.txt delete mode 100644 input-queries-translated.json delete mode 100644 reports/README.md create mode 100644 src/execute-local.sh create mode 100644 src/py/execute_feasibility_test.py create mode 100644 src/py/execute_ping_test.py create mode 100644 src/py/feasibility-monitoring.py create mode 100644 src/resources/ping-task.xml delete mode 100644 translate-input-queries.py diff --git a/.env.default b/.env.default index 3347c75..729b9e3 100644 --- a/.env.default +++ b/.env.default @@ -3,8 +3,18 @@ BACKEND_CLIENT_ID="feasibility-gui" BACKEND_CLIENT_SECRET="test" KEYCLOAK_TOKEN_URL="https://localhost/auth/realms/feasibility/protocol/openid-connect/token" CONFLUENCE_API_BASE_URL="https://myconfluence-rest-api-url" -CONFLUENCE_PAGE_ID="123" CONF_USER="username" CONF_PW="password" -WAIT_RESULT_SECS=60 -SEND_TO_CONFLUENCE=false \ No newline at end of file +WAIT_RESULT_SECS_FEAS=60 +WAIT_RESULT_SECS_PING=600 +SEND_TO_CONFLUENCE=false +DSF_BASE_URL="https://dsf.base-url-here" +EXECUTE_HISTORY_TEST=false +CONFLUENCE_PAGE_ID_HIST="" +HISTORY_TABLE_LEN=14 +EXECUTE_FEAS_TEST=false +CONFLUENCE_PAGE_ID_FEAS="" +EXECUTE_DSF_PING_TEST=false +CONFLUENCE_PAGE_ID_PING="" +DSF_CERT_PATH= +DSF_KEY_PATH= \ No newline at end of file diff --git a/.github/workflows/buid.yml b/.github/workflows/buid.yml new file mode 100644 index 0000000..30bb6dd --- /dev/null +++ b/.github/workflows/buid.yml @@ -0,0 +1,46 @@ +name: Build + +on: + push: + branches: + - main + - develop + pull_request: + branches: + - main + - develop + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Check out Git repository + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Prepare Version Info + id: prep + run: | + echo "mii=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ghcr.io/${{ steps.prep.outputs.mii }}/feasibility-monitoring:test diff --git a/.gitignore b/.gitignore index b8f17b8..8249c52 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .env -test.py feasibility-results.json dev-call.sh -reports/*.json \ No newline at end of file +reports/*.json +certs/ +temp/ +__pycache__/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..825c32f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..083d629 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,13 @@ +# Development + +## Release Checklist + +* create a release branch called `release-v` like `release-v0.1.1` +* update the CHANGELOG based on the milestone +* create a commit with the title `Release v` +* create a PR from the release branch into main +* merge that PR +* create and push a tag called `v` like `v0.1.1` on main at the merge commit +* create a new branch called `next-dev` on top of the release branch +* merge the `next-dev` branch back into develop +* create release notes on GitHub diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 55478f7..0000000 --- a/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM python:3.9 - -COPY . /opt/reportclient -RUN pip install requests==2.22.0 -RUN pip install psycopg2==2.9.3 -RUN pip install prettytable==3.3.0 -RUN useradd -r -s /bin/false 10001 -RUN chown -R 10001:10001 /opt/reportclient - -WORKDIR /opt/reportclient - -COPY docker-entrypoint.sh /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-entrypoint.sh - -USER 10001 - -ENTRYPOINT ["docker-entrypoint.sh"] \ No newline at end of file diff --git a/README.md b/README.md index fc0126f..e1eb2c8 100644 --- a/README.md +++ b/README.md @@ -1 +1,70 @@ # automatic-connection-test-feasibility + +## Goal + +The goal of this repository is to test the overall connectedness and what data the sites offer. +The results of the test are saved on disk and can optionally be uploaded to a Confluence page. + +* The Feasibility test sends SQ's to the Backend and cheks which sites have enough data fitting the SQ's +* The History test sends one SQ to the Backend and saves multiple results over time on disk +* The Ping test sends a ping to the DSF and checks which sites answer with a pong (see [ping-task.xml](src/resources/ping-task.xml)) + +## Setup + +For the Feasibility test, the SQ's of the [input-queries.json](config/input-queries.json) are used. This JSON has one field "queries", which contains a list where each element must have the following fields: + +| Name | Description | +|:-----------------|:---------------------------------------------------------------------------------------------| +| query-name | A custom name for the query, which is used in the table on Confluence to identify the query. | +| Module | The module of the query (e.g. Procedure). | +| optional | Boolean: whether or not the sites must have data fitting this SQ - used to calculate the percentage of required modules a site fulfills in the confluence table. | +| sq | The Structured Query. | + +For the History test, the [history-query.json](config/history-query.json) must contain one single SQ. + +### Config + +Additionally, the following fields in the [config.yml](config/config.yml) can be configured: + +| Name | Description | +|:------------------------------|:---------------------------------------------------------------------------| +| feas-page-title | The title of the Confluence page for the Feasibility test. | +| feas-page-content-html | The HTML content of the Confluence page for the Feasibility test. | +| hist-page-title | The title of the Confluence page for the Feasibility history test. | +| hist-page-content-html | The HTML content of the Confluence page for the Feasibility history test. | +| ping-page-title | The title of the Confluence page for the Feasibility history test. | +| ping-page-content-html | The HTML content of the Confluence page for the ping test. | +| dsf-site-ids | A list of all sites that are expected to respont to the test. | + + +## Run + +```sh +docker-compose -f docker/docker-compose.yml up +``` + + +## Environment Variables + +| Name | Default | Description | +|:------------------------------|:--------------------------------------|:-------------------------------------------------------------------------------------------------| +| LOCAL_DSF_CERT_PATH | ./cert/dsf-cert.cer | The local path of the DSF certificate. | +| LOCAL_DSF_KEY_PATH | ./cert/dsf-key.key | The local path of the DSF key. | +| BACKEND_BASE_URL | https://localhost/api/v1 | The URL of the Feasibility Backend. | +| BACKEND_CLIENT_ID | | The client ID for the Feasibility Backend. | +| BACKEND_CLIENT_SECRET | | The client secret for the Feasibility Backend. | +| KEYCLOAK_TOKEN_URL | | The token URL for Keycloak. | +| CONFLUENCE_API_BASE_URL | https://myconfluence-rest-api-url | The base URL of the Confluence API, where the results will be uploaded. | +| CONF_USER | | The username of the account that is used to upload the result to Confluence. | +| CONF_PW | | The password of the account that is used to upload the result to Confluence. | +| WAIT_RESULT_SECS_FEAS | 60 | The seconds to wait for the response of the Feasibility Backend for the feasibility test. | +| WAIT_RESULT_SECS_PING | 60 | The seconds to wait for the response of the DSF for the ping test. | +| SEND_TO_CONFLUENCE | false | Boolean: Whether to send the results to confluence. | +| DSF_BASE_URL | | The Base URL of the DSF - used to execute the ping test against. | +| EXECUTE_FEAS_TEST | false | Boolean: Whether to execute the Feasibility test. | +| CONFLUENCE_PAGE_ID_FEAS | | The Confluence page ID where the Feasibility test result will be uploaded. | +| EXECUTE_HISTORY_TEST | false | Boolean: Whether to execute the Feasibility history test. | +| CONFLUENCE_PAGE_ID_HIST | | The Confluence page ID where the Feasibility history test result will be uploaded. | +| HISTORY_TABLE_LEN | 14 | The maximum amount of history repots displayed in the Confluence table. | +| EXECUTE_DSF_PING_TEST | false | Boolean: Whether to execute the DSF ping test. | +| CONFLUENCE_PAGE_ID_PING | | The Confluence page ID where the ping test result will be uploaded. | diff --git a/automatic-connection-test.py b/automatic-connection-test.py deleted file mode 100644 index 374d9f5..0000000 --- a/automatic-connection-test.py +++ /dev/null @@ -1,324 +0,0 @@ -import requests -import time -import base64 -import argparse -from prettytable import PrettyTable -import json -from datetime import datetime -import sys - -parser = argparse.ArgumentParser() -parser.add_argument('--backend_base_url', help='base url of the feasibility backend', - default="https://localhost/api/v2") -parser.add_argument('--backend_client_id', help='backend client id', - nargs="?", default="feasibility-gui") -parser.add_argument('--backend_user', help='', nargs="?", default="test") -parser.add_argument('--client_secret', help='', nargs="?", default="test") -parser.add_argument('--keycloak_token_url', help='keycloak token url', - default="https://localhost/auth/realms/feasibility/protocol/openid-connect/token") -parser.add_argument('--confluence_api_base_url', help='', nargs="?", - default='https://myconfluence-rest-api-url') -parser.add_argument('--confluence_page_id', help='', nargs="?", - default='') -parser.add_argument('--send_results_confluence', help='', action='store_true', - default=False) -parser.add_argument('--conf_user', help='username of confluence account', nargs="?", default='username') -parser.add_argument('--conf_pw', help='password of confluence account', nargs="?", default='password') -parser.add_argument('--wait_result_secs', help='number of seconds to wait before results for a query are fetched', nargs="?", default='60') - -args = vars(parser.parse_args()) - -backend_base_url = args["backend_base_url"] -backend_client_id = args["backend_client_id"] -backend_user = args["backend_user"] -client_secret = args["client_secret"] -keycloak_token_url = args["keycloak_token_url"] -confluence_api_base_url = args["confluence_api_base_url"] -confluence_page_id = args["confluence_page_id"] -send_results_confluence = args["send_results_confluence"] -conf_user = args["conf_user"] -conf_pw = args["conf_pw"] -wait_result_secs = args["wait_result_secs"] - -site_list = ["UKA", "UKAU", "Charite", "UKB", "UKDD", "UKEr", "UKF", "UKFR","UKGI", "UMG", "UKH", "MHH", "UKHD", "UKJ", "UKL", "UKSH", - "UMM", "KUM", "MRI", "UKR", "UKS", "UKT", "UKW", "UKU", "UKRUB","UKD", "UME", "UKE", "UKK", "UMMD", "UKMR", "UKM", "UM", "UKG", "UMR"] - -site_list.sort() - -site_consortia_mapping = {"Charite": "HiGHmed", "KUM": "DIFUTURE", "MHH": "HiGHmed", "MRI": "DIFUTURE", "UKA": "SMITH", "UKAU": "DIFUTURE", "UKB": "SMITH", - "UKD": "SMITH", "UKDD": "MIRACUM", "UKE": "SMITH", "UKEr": "MIRACUM", "UKF": "MIRACUM", "UKFR": "MIRACUM", "UKG": "MIRACUM", "UKGI": "MIRACUM", - "UKH": "SMITH", "UKHD": "HiGHmed", "UKJ": "SMITH", "UKK": "HiGHmed", "UKL": "SMITH", "UKM": "HiGHmed", "UKMR": "MIRACUM", "UKR": "DIFUTURE", - "UKRUB": "SMITH", "UKS": "DIFUTURE", "UKSH": "HiGHmed", "UKT": "DIFUTURE", "UKU": "DIFUTURE", "UKW": "HiGHmed", "UM": "MIRACUM", - "UME": "SMITH", "UMG": "HiGHmed", "UMM": "MIRACUM","UMMD": "MIRACUM", "UMR": "SMITH"} - -site_list_ident_mapping = {"charite.de": "Charite", "unimedizin-mainz.de": "UM", "uniklinikum-jena.de": "UKJ", "uni-giessen.de": "UKGI", "ukhd.de": "UKHD", "ukm.de": "UKM", "kgu.de": "", "umm.de": "UMM", "umg.eu": "UMG", "uk-koeln.de": "UKK", "uk-augsburg.de": "UKAU", "ukaachen.de": "UKA", "mh-hannover.de": "MHH", "uksh.de": "UKSH", "uk-halle.de": "UKH", "ukw.de": "UKW", - "uniklinik-ulm.de": "UKU", "uke.de": "UKE", "uniklinik-freiburg.de": "UKFR", "medizin.uni-tuebingen.de": "UKT", "ukdd.de": "UKDD", "ukbonn.de": "UKB", "uniklinikum-leipzig.de": "UKL", "mri.tum.de": "MRI", "uni-marburg.de": "UKMR", "www.med.uni-magdeburg.de": "UMMD", "lmu-klinikum.de": "KUM", "uk-erlangen.de": "UKEr", "uk-essen.de": "UME", "www.medizin.uni-greifswald.de": "UKG", "ukr.de": "UKR"} - - -def connect_to_keycloak(): - backend_user_login = {'client_id': backend_client_id, - 'grant_type': 'client_credentials', - 'client_secret': client_secret, - - } - - print(f'Getting access token from {keycloak_token_url}') - resp = requests.post(keycloak_token_url, data=backend_user_login) - print(f'Token Status code: {resp.status_code}') - access_token = resp.json()['access_token'] - return access_token - - -def send_test_query_and_get_id(access_token, sq): - - header = { - 'Authorization': f'Bearer {access_token}', - 'Content-Type': 'application/json' - } - - run_query_path = "/query" - print(f'Running query on backend: {backend_base_url}{run_query_path}') - resp = requests.post( - f'{backend_base_url}{run_query_path}', headers=header, json=sq) - - result_location = resp.headers['Location'] - query_id = result_location.rsplit('/', 1)[-1] - return query_id - - -def get_results(query_id, access_token): - - run_query_path = "/query" - header = { - 'Authorization': f'Bearer {access_token}', - 'Content-Type': 'application/json' - } - resp = requests.get( - f'{backend_base_url}{run_query_path}/{query_id}/detailed-result', headers=header) - return resp.json() - - -def convert_results(results): - - result_list = {} - for site in site_list: - result_list[site] = -1 - - for result in results['resultLines']: - site_name = result['siteName'] - - n_patients = result['numberOfPatients'] - - if n_patients >= 20: - n_patients = 20 - elif n_patients == 10: - n_patients = 0 - - if site_name in site_list_ident_mapping.keys(): - mapped_site_name = site_list_ident_mapping[site_name] - result_list[mapped_site_name] = n_patients - elif site_name in result_list: - result_list[site_name] = n_patients - - return result_list - - -def save_results_to_disk(query_report): - - report_time = datetime.now().strftime("%Y-%m-%d_%H-%M-%S") - - with open(f'reports/feasibility_results-{report_time}.json', 'a+') as f: - new_entry = json.dumps(query_report) - f.write(new_entry) - f.write("\n") - - -def load_queries(): - with open('input-queries.json', 'r') as f: - return json.load(f) - - -def create_info_result(number): - if number == 20: - return "YES" - elif number == 0: - return "no" - else: - return "." - - -def order_module_list(module_list, dict): - ordered_list = [] - - for module in module_list: - ordered_list.append(dict[module]) - - ordered_list.append(dict['overall']) - return ordered_list - - -def convert_report_to_table(input_report): - module_list = ["Patient", "Condition", "Laboratory", - "Procedure", "Consent", "Medication", "Specimen"] - mandatory_modules = ["Patient", "Condition", - "Laboratory", "Procedure", "Consent"] - table = { - "header": ['Consortium', 'Site'] - } - - table['overall'] = {} - table['totalYes'] = {"overall": 0} - table['totalNo'] = {"overall": 0} - table['totalNa'] = {"overall": 0} - - for query in input_report['queries']: - header_entry = query['module'] - if query['module'] not in mandatory_modules: - header_entry = f'{header_entry} (optional)' - - table['header'].append(header_entry) - table['totalYes'][query['module']] = 0 - table['totalNo'][query['module']] = 0 - table['totalNa'][query['module']] = 0 - - table['header'].append("% fulfilled non-optional") - - for site in site_list: - table['overall'][site] = 0 - table[site] = [site_consortia_mapping[site], site] - - for query in input_report['queries']: - - if query['result'][site] == 20: - if query['module'] in mandatory_modules: - table['overall'][site] = table['overall'][site] + 1 - table['totalYes'][query['module'] - ] = table['totalYes'][query['module']] + 1 - elif query['result'][site] == 0: - table['totalNo'][query['module'] - ] = table['totalNo'][query['module']] + 1 - else: - table['totalNa'][query['module'] - ] = table['totalNa'][query['module']] + 1 - - table[site].append(create_info_result(query['result'][site])) - - percentage_fulfilled = ( - table['overall'][site] / len(mandatory_modules)) * 100 - table[site].append(percentage_fulfilled) - - if percentage_fulfilled == 100.0: - table['totalYes']['overall'] = table['totalYes']['overall'] + 1 - elif percentage_fulfilled > 0: - table['totalNo']['overall'] = table['totalNo']['overall'] + 1 - else: - table['totalNa']['overall'] = table['totalNa']['overall'] + 1 - - pTable = PrettyTable(table['header']) - - pTable.add_row(['Total Yes', "100% fulfilled"] + - order_module_list(module_list, table['totalYes'])) - pTable.add_row(['Total No', ">0% fullfilled"] + - order_module_list(module_list, table['totalNo'])) - pTable.add_row(['Total Na', "0% fulfilled"] + - order_module_list(module_list, table['totalNa'])) - - for site in site_list: - pTable.add_row(table[site]) - - return pTable - - -def send_result_to_confluence(report_table): - - page_info = ''' -
- Ausgewählte automatische Abfragen des FDPG Machbarkeitsportal

- Für Öffnung vorausgesetzt:

- Patient: code=263495000 (female|male)

- Condition: code=E10-E14 (Diabetes mellitus)

- Labor: code=718-7|17856-6|4548-4|4549-2 (Hemoglobin)

- Prozedur: code=3-20|8-19 (CT,nativ| Verbände Gewebe)

- Konsent: code=central-consent (MDAT wissenschaftlich nutzen)

-

- Für Öffnung nicht vorausgesetzt:

- Medikation (admin): code=A10 (Antidiabetika)

- Specimen: code=119297000|119361006|119376003|441652008|441479001|420135007

- (Blood|Plasma|Tissue|fixed Tissue|fresh Tissue|Whole blood)

-
- -
-



- Standorte die nicht angeschlossen sind finden die Anleitungen zum Anschluss ans Feasibility-Portal - mit Aktin hier:

- https://github.com/medizininformatik-initiative/feasibility-deploy/tree/v2.0.0

- Für das Triangle-Update der Readme hier folgen: https://github.com/medizininformatik-initiative/feasibility-deploy/tree/v2.0.0/feasibility-triangle#updating-the-feasibility-triangle

- Die neue Ontologie muss hier runtergeladen werden: https://confluence.imi.med.fau.de/display/MIIC/Ontologie

-

- mit DSF hier:

- https://github.com/medizininformatik-initiative/feasibility-deploy/wiki/DSF-Middleware-Setup

-

- Informationen zum Feasibility Portal, DIZ-Dashboard und zur Datenausleitung mit DSF finden Sie hier:

- https://xdash.forschen-fuer-gesundheit.de/?readme

-

- Kontakt: info@forschen-fuer-gesundheit.de

-
-

-
- Legende:

- „YES“: mehr als 20 Datenpunkte

- „no“: weniger als 20 Datenpunkte

- „.“: keine Antwort

-
- ''' - - table_html = report_table.get_html_string() - page_info = f'{page_info}{table_html}

' - - base64_bytes = base64.b64encode(f'{conf_user}:{conf_pw}'.encode('ascii')) - base64_message = base64_bytes.decode('ascii') - header = { - 'Authorization': f'Basic {base64_message}', - 'Content-Type': 'application/json' - } - - res = requests.get(f'{confluence_api_base_url}/content/{confluence_page_id}', - headers=header) - - version_number = res.json()['version']['number'] - content_update = { - 'title': 'Status Erfüllung Umsetzung Module Machbarkeit Standorte', - 'type': 'page', - 'body': {'storage': {'value': page_info, - 'representation': 'storage' - }, - }, - 'version': {'number': version_number + 1} - } - res = requests.put(f'{confluence_api_base_url}/content/{confluence_page_id}', - headers=header, json=content_update) - - -def execute_queries(queries): - - for query in queries['queries']: - access_token = connect_to_keycloak() - print(f'Sending query: {query["sq"]}') - query_id = send_test_query_and_get_id(access_token, query['sq']) - print(f'Query ID: {query_id}') - print(f'Sleep for {wait_result_secs} seconds to wait for results') - sys.stdout.flush() - time.sleep(int(wait_result_secs)) - access_token = connect_to_keycloak() - results = get_results(query_id, access_token) - result = convert_results(results) - query['result'] = result - - -queries = load_queries() -execute_queries(queries) -save_results_to_disk(queries) - -if send_results_confluence: - report_table = convert_report_to_table(queries) - send_result_to_confluence(report_table) diff --git a/config/config.yml b/config/config.yml new file mode 100644 index 0000000..678430c --- /dev/null +++ b/config/config.yml @@ -0,0 +1,57 @@ +feas-page-title: "Automatische Pruefung Anbindung Testumgebung Feasibility" +feas-page-content-html: | +
+ Ausgewählte automatische Abfragen des FDPG Machbarkeitsportal

+ Für Öffnung vorausgesetzt:

+ Patient: code=263495000 (female|male)

+ Condition: code=E10-E14 (Diabetes mellitus)

+ Labor: code=718-7|17856-6|4548-4|4549-2 (Hemoglobin)

+ Prozedur: code=3-20|8-19 (CT,nativ| Verbände Gewebe)

+ Konsent: code=central-consent (MDAT wissenschaftlich nutzen)

+

+ Für Öffnung nicht vorausgesetzt:

+ Medikation (admin): code=A10 (Antidiabetika)

+ Specimen: code=119297000|119361006|119376003|441652008|441479001|420135007

+ (Blood|Plasma|Tissue|fixed Tissue|fresh Tissue|Whole blood)

+
+ +
+



+ Standorte die nicht angeschlossen sind finden die Anleitungen zum Anschluss ans Feasibility-Portal + mit Aktin hier:

+ https://github.com/medizininformatik-initiative/feasibility-deploy/tree/v2.0.0

+ Für das Triangle-Update der Readme hier folgen: https://github.com/medizininformatik-initiative/feasibility-deploy/tree/v2.0.0/feasibility-triangle#updating-the-feasibility-triangle

+ Die neue Ontologie muss hier runtergeladen werden: https://confluence.imi.med.fau.de/display/MIIC/Ontologie

+

+ mit DSF hier:

+ https://github.com/medizininformatik-initiative/feasibility-deploy/wiki/DSF-Middleware-Setup

+

+ Informationen zum Feasibility Portal, DIZ-Dashboard und zur Datenausleitung mit DSF finden Sie hier:

+ https://xdash.forschen-fuer-gesundheit.de/?readme

+

+ Kontakt: info@forschen-fuer-gesundheit.de

+
+

+
+ Legende:

+ „YES“: mehr als 20 Datenpunkte

+ „no“: weniger als 20 Datenpunkte

+ „.“: keine Antwort

+
+hist-page-title: "test title" +hist-page-content-html: | +
+ test body +
+ping-page-title: "Ergebnis Ping DSF Testumgebung FDPG" +ping-page-content-html: | +
+ DSF ping test Ergebnisse

+
+dsf-site-ids: | + [ + "ukaachen.de", "uk-augsburg.de", "charite.de", "ukbonn.de", "ukdd.de", "uniklinik-duesseldorf.de", "www.uk-erlangen.de", "uk-essen.de", "kgu.de", + "uniklinik-freiburg.de", "uni-giessen.de", "umg.eu", "www.medizin.uni-greifswald.de", "uk-halle.de", "uke.de", "mh-hannover.de", "ukhd.de", + "uniklinikum-jena.de", "uk-koeln.de", "uniklinikum-leipzig.de", "www.med.uni-magdeburg.de", "unimedizin-mainz.de", "umm.de", "uni-marburg.de", + "lmu-klinikum.de", "mri.tum.de", "ukm.de", "ukr.de", "med.uni-rostock.de", "uks.eu", "uksh.de","medizin.uni-tuebingen.de", "uniklinik-ulm.de", "ukw.de" + ] diff --git a/config/history-query.json b/config/history-query.json new file mode 100644 index 0000000..ba00ff5 --- /dev/null +++ b/config/history-query.json @@ -0,0 +1,38 @@ +{ + "version": "http://to_be_decided.com/draft-1/schema#", + "display": "", + "inclusionCriteria": [ + [ + { + "termCodes": [ + { + "code": "263495000", + "system": "http://snomed.info/sct", + "display": "Geschlecht" + } + ], + "context": { + "code": "Patient", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Patient" + }, + "valueFilter": { + "selectedConcepts": [ + { + "code": "female", + "display": "Female", + "system": "http://hl7.org/fhir/administrative-gender" + }, + { + "code": "male", + "display": "Male", + "system": "http://hl7.org/fhir/administrative-gender" + } + ], + "type": "concept" + } + } + ] + ] +} diff --git a/input-queries.json b/config/input-queries.json similarity index 67% rename from input-queries.json rename to config/input-queries.json index 98926d8..2a3b0ad 100644 --- a/input-queries.json +++ b/config/input-queries.json @@ -3,6 +3,7 @@ { "query-name": "patient-gender", "module": "Patient", + "optional": false, "sq": { "version": "http://to_be_decided.com/draft-1/schema#", "display": "", @@ -16,6 +17,12 @@ "display": "Geschlecht" } ], + "context": { + "code": "Patient", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Patient" + }, "valueFilter": { "selectedConcepts": [ { @@ -39,6 +46,7 @@ { "query-name": "diabetes-any", "module": "Condition", + "optional": false, "sq": { "version": "http://to_be_decided.com/draft-1/schema#", "display": "", @@ -52,7 +60,13 @@ "version": "2023", "display": "Diabetes mellitus" } - ] + ], + "context": { + "code": "Diagnose", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Diagnose" + } } ] ] @@ -61,6 +75,7 @@ { "query-name": "hemoglobin-718-7", "module": "Laboratory", + "optional": false, "sq": { "version": "http://to_be_decided.com/draft-1/schema#", "display": "", @@ -74,6 +89,12 @@ "display": "Hämoglobin" } ], + "context": { + "code": "Laboruntersuchung", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Laboruntersuchung" + }, "valueFilter": { "selectedConcepts": [], "type": "quantity-comparator", @@ -93,6 +114,12 @@ "display": "Hämoglobin A1c" } ], + "context": { + "code": "Laboruntersuchung", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Laboruntersuchung" + }, "valueFilter": { "selectedConcepts": [], "type": "quantity-comparator", @@ -112,6 +139,12 @@ "display": "Hämoglobin A1c" } ], + "context": { + "code": "Laboruntersuchung", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Laboruntersuchung" + }, "valueFilter": { "selectedConcepts": [], "type": "quantity-comparator", @@ -131,6 +164,12 @@ "display": "Hemoglobin A1c/Hemoglobin.total in Blood by Electrophoresis" } ], + "context": { + "code": "Laboruntersuchung", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Laboruntersuchung" + }, "valueFilter": { "selectedConcepts": [], "type": "quantity-comparator", @@ -147,8 +186,9 @@ } }, { - "query-name": "procedure-endocronological-function", - "module": "Procedure", + "query-name": "medication-administration-antidiab", + "module": "Medication", + "optional": true, "sq": { "version": "http://to_be_decided.com/draft-1/schema#", "display": "", @@ -157,30 +197,27 @@ { "termCodes": [ { - "code": "3-20", - "system": "http://fhir.de/CodeSystem/bfarm/ops", - "version": "2023", - "display": "Computertomographie [CT], nativ" - } - ] - }, - { - "termCodes": [ - { - "code": "8-19", - "system": "http://fhir.de/CodeSystem/bfarm/ops", - "version": "2023", - "display": "Verbände und Entfernung von erkranktem Gewebe an Haut und Unterhaut" + "code": "A10", + "system": "http://fhir.de/CodeSystem/bfarm/atc", + "version": "2022", + "display": "Antidiabetika" } - ] + ], + "context": { + "code": "Medikamentenverabreichung", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Verabreichung von Medikamenten" + } } ] ] } }, { - "query-name": "central-consent-eudsgvoniveau", - "module": "Consent", + "query-name": "procedure-endocronological-function", + "module": "Procedure", + "optional": false, "sq": { "version": "http://to_be_decided.com/draft-1/schema#", "display": "", @@ -189,33 +226,34 @@ { "termCodes": [ { - "code": "central-consent", - "system": "mii.abide", - "display": "MDAT wissenschaftlich nutzen - EU DSGVO Niveau" + "code": "3-20", + "system": "http://fhir.de/CodeSystem/bfarm/ops", + "version": "2023", + "display": "Computertomographie [CT], nativ" } - ] - } - ] - ] - } - }, - { - "query-name": "medication-administration-antidiab", - "module": "Medication", - "sq": { - "version": "http://to_be_decided.com/draft-1/schema#", - "display": "", - "inclusionCriteria": [ - [ + ], + "context": { + "code": "Procedure", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Prozedur" + } + }, { "termCodes": [ { - "code": "A10", - "system": "http://fhir.de/CodeSystem/bfarm/atc", - "version": "2022", - "display": "Antidiabetika" + "code": "8-19", + "system": "http://fhir.de/CodeSystem/bfarm/ops", + "version": "2023", + "display": "Verbände und Entfernung von erkranktem Gewebe an Haut und Unterhaut" } - ] + ], + "context": { + "code": "Procedure", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Prozedur" + } } ] ] @@ -224,6 +262,7 @@ { "query-name": "specimen-test", "module": "Specimen", + "optional": true, "sq": { "version": "http://to_be_decided.com/draft-1/schema#", "display": "", @@ -237,7 +276,13 @@ "version": "http://snomed.info/sct/900000000000207008/version/20220930", "display": "Blood specimen" } - ] + ], + "context": { + "code": "Specimen", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Bioprobe" + } }, { "termCodes": [ @@ -247,7 +292,13 @@ "version": "http://snomed.info/sct/900000000000207008/version/20220930", "display": "Plasma specimen" } - ] + ], + "context": { + "code": "Specimen", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Bioprobe" + } }, { "termCodes": [ @@ -257,7 +308,13 @@ "version": "http://snomed.info/sct/900000000000207008/version/20220930", "display": "Tissue specimen" } - ] + ], + "context": { + "code": "Specimen", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Bioprobe" + } }, { "termCodes": [ @@ -267,7 +324,13 @@ "version": "http://snomed.info/sct/900000000000207008/version/20220930", "display": "Formalin-fixed paraffin-embedded tissue specimen" } - ] + ], + "context": { + "code": "Specimen", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Bioprobe" + } }, { "termCodes": [ @@ -277,7 +340,13 @@ "version": "http://snomed.info/sct/900000000000207008/version/20220930", "display": "Fresh tissue specimen" } - ] + ], + "context": { + "code": "Specimen", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Bioprobe" + } }, { "termCodes": [ @@ -287,11 +356,46 @@ "version": "http://snomed.info/sct/900000000000207008/version/20220930", "display": "Whole blood" } - ] + ], + "context": { + "code": "Specimen", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Bioprobe" + } + } + ] + ] + } + }, + { + "query-name": "central-consent-eudsgvoniveau", + "module": "Consent", + "optional": false, + "sq": { + "version": "http://to_be_decided.com/draft-1/schema#", + "display": "", + "inclusionCriteria": [ + [ + { + "termCodes": [ + { + "code": "2.16.840.1.113883.3.1937.777.24.5.3.8", + "system": "urn:oid:2.16.840.1.113883.3.1937.777.24.5.3", + "version": "1.0.2", + "display": "MDAT wissenschaftlich nutzen EU DSGVO NIVEAU" + } + ], + "context": { + "code": "Einwilligung", + "system": "fdpg.mii.cds", + "version": "1.0.0", + "display": "Einwilligung" + } } ] ] } } ] -} \ No newline at end of file +} diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 8e68f51..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,16 +0,0 @@ -services: - feasibility-test-client: - build: . - # entrypoint: bash -c "tail -f /dev/null" - environment: - - BACKEND_BASE_URL=${BACKEND_BASE_URL:-"https://localhost/api/v1"} - - BACKEND_CLIENT_ID=${BACKEND_CLIENT_ID:-"feasibility-gui"} - - BACKEND_CLIENT_SECRET=${BACKEND_CLIENT_SECRET:-"test"} - - KEYCLOAK_TOKEN_URL=${KEYCLOAK_TOKEN_URL:-"https://localhost/auth/realms/feasibility/protocol/openid-connect/token"} - - CONFLUENCE_API_BASE_URL=${CONFLUENCE_API_BASE_URL:-""} - - CONFLUENCE_PAGE_ID=${CONFLUENCE_PAGE_ID:-""} - - CONF_USER=${CONF_USER:-"username"} - - CONF_PW=${CONF_PW:-"password"} - - WAIT_RESULT_SECS=${WAIT_RESULT_SECS:-60} - volumes: - - .:/opt/reportclient \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh deleted file mode 100644 index 8e5ac51..0000000 --- a/docker-entrypoint.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -BACKEND_BASE_URL=${BACKEND_BASE_URL:-"https://localhost/api/v1"} -BACKEND_CLIENT_ID=${BACKEND_CLIENT_ID:-"feasibility-gui"} -BACKEND_CLIENT_SECRET=${BACKEND_CLIENT_SECRET:-"test"} -KEYCLOAK_TOKEN_URL=${KEYCLOAK_TOKEN_URL:-"https://localhost/auth/realms/feasibility/protocol/openid-connect/token"} -CONFLUENCE_API_BASE_URL=${CONFLUENCE_API_BASE_URL:-"https://myconfluence-rest-api-url"} -CONFLUENCE_PAGE_ID=${CONFLUENCE_PAGE_ID} -CONF_USER=${CONF_USER:-"username"} -CONF_PW=${CONF_PW:-"password"} -WAIT_RESULT_SECS=${WAIT_RESULT_SECS:-60} - -if [[ $SEND_TO_CONFLUENCE == "true" ]] || [[ $SEND_TO_CONFLUENCE == "True" ]] -then -SEND_TO_CONFLUENCE="--send_to_confluence" -fi - -python3 automatic-connection-test.py --backend_base_url "$BACKEND_BASE_URL" --backend_client_id "$BACKEND_CLIENT_ID" \ ---client_secret "$BACKEND_CLIENT_SECRET" --keycloak_token_url "$KEYCLOAK_TOKEN_URL" \ ---confluence_api_base_url "$CONFLUENCE_API_BASE_URL" --conf_user "$CONF_USER" --conf_pw "$CONF_PW" --confluence_page_id "$CONFLUENCE_PAGE_ID" \ ---wait_result_secs "$WAIT_RESULT_SECS" $SEND_TO_CONFLUENCE diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..56b2d5f --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,25 @@ +FROM python:3.9 + +RUN mkdir -p /opt/reportclient + +COPY src/py/feasibility-monitoring.py /opt/reportclient/src/py/feasibility-monitoring.py +COPY src/py/execute_ping_test.py /opt/reportclient/src/py/execute_ping_test.py +COPY src/py/execute_feasibility_test.py /opt/reportclient/src/py/execute_feasibility_test.py +COPY config/input-queries.json /opt/reportclient/config/input-queries.json +COPY config/history-query.json /opt/reportclient/config/history-query.json +COPY config/config.yml /opt/reportclient/config/config.yml +COPY src/resources/ping-task.xml /opt/reportclient/src/resources/ping-task.xml +COPY docker/requirements.txt /tmp/requirements.txt + +RUN pip3 install -r /tmp/requirements.txt + +WORKDIR /opt/reportclient +RUN mkdir reports +RUN chown -R 1001:1001 /opt/reportclient + +COPY docker/docker-entrypoint.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/docker-entrypoint.sh + +USER 1001 + +ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..d8c77fc --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,28 @@ +services: + feasibility-test-client: + image: ghcr.io/medizininformatik-initiative/feasibility-monitoring:test + environment: + - BACKEND_BASE_URL=${BACKEND_BASE_URL:-"https://localhost/api/v1"} + - BACKEND_CLIENT_ID=${BACKEND_CLIENT_ID:-""} + - BACKEND_CLIENT_SECRET=${BACKEND_CLIENT_SECRET:-""} + - KEYCLOAK_TOKEN_URL=${KEYCLOAK_TOKEN_URL:-""} + - CONFLUENCE_API_BASE_URL=${CONFLUENCE_API_BASE_URL:-"https://myconfluence-rest-api-url"} + - CONFLUENCE_PAGE_ID=${CONFLUENCE_PAGE_ID:-""} + - CONF_USER=${CONF_USER:-""} + - CONF_PW=${CONF_PW:-""} + - WAIT_RESULT_SECS_FEAS=${WAIT_RESULT_SECS_FEAS:-60} + - WAIT_RESULT_SECS_PING=${WAIT_RESULT_SECS_PING:-60} + - SEND_TO_CONFLUENCE=${SEND_TO_CONFLUENCE:-"false"} + - DSF_BASE_URL=${DSF_BASE_URL:-""} + - EXECUTE_FEAS_TEST=${EXECUTE_FEAS_TEST:-"false"} + - CONFLUENCE_PAGE_ID_FEAS=${CONFLUENCE_PAGE_ID_FEAS:-""} + - EXECUTE_HISTORY_TEST=${EXECUTE_HISTORY_TEST:-"false"} + - CONFLUENCE_PAGE_ID_HIST=${CONFLUENCE_PAGE_ID_HIST:-""} + - HISTORY_TABLE_LEN=${HISTORY_TABLE_LEN:-14} + - EXECUTE_DSF_PING_TEST=${EXECUTE_DSF_PING_TEST:-"false"} + - CONFLUENCE_PAGE_ID_PING=${CONFLUENCE_PAGE_ID_PING:-""} + volumes: + - ${LOCAL_DSF_CERT_PATH:-./cert/dsf-cert.cer}:/opt/reportclient/certs/dsf-cert.cer + - ${LOCAL_DSF_KEY_PATH:-./cert/dsf-key.key}:/opt/reportclient/certs/dsf-key.key + - ../config:/opt/reportclient/config + - ../reports:/opt/reportclient/reports \ No newline at end of file diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh new file mode 100644 index 0000000..6e07453 --- /dev/null +++ b/docker/docker-entrypoint.sh @@ -0,0 +1,30 @@ +#!/bin/bash +DSF_CERT_PATH="/opt/reportclient/certs/dsf-cert.cer" +DSF_KEY_PATH="/opt/reportclient/certs/dsf-key.key" +BACKEND_BASE_URL=${BACKEND_BASE_URL:-"https://localhost/api/v1"} +BACKEND_CLIENT_ID=${BACKEND_CLIENT_ID:-""} +BACKEND_CLIENT_SECRET=${BACKEND_CLIENT_SECRET:-""} +KEYCLOAK_TOKEN_URL=${KEYCLOAK_TOKEN_URL:-""} +CONFLUENCE_API_BASE_URL=${CONFLUENCE_API_BASE_URL:-"https://myconfluence-rest-api-url"} +CONF_USER=${CONF_USER:-""} +CONF_PW=${CONF_PW:-""} +WAIT_RESULT_SECS_FEAS=${WAIT_RESULT_SECS_FEAS:-60} +WAIT_RESULT_SECS_PING=${WAIT_RESULT_SECS_PING:-60} + +SEND_TO_CONFLUENCE=${SEND_TO_CONFLUENCE:-"false"} +DSF_BASE_URL=${DSF_BASE_URL:-""} +EXECUTE_FEAS_TEST=${EXECUTE_FEAS_TEST:-"false"} +CONFLUENCE_PAGE_ID_FEAS=${CONFLUENCE_PAGE_ID_FEAS:-""} +EXECUTE_HISTORY_TEST=${EXECUTE_HISTORY_TEST:-"false"} +CONFLUENCE_PAGE_ID_HIST=${CONFLUENCE_PAGE_ID_HIST:-""} +HISTORY_TABLE_LEN=${HISTORY_TABLE_LEN:-14} +EXECUTE_DSF_PING_TEST=${EXECUTE_DSF_PING_TEST:-"false"} +CONFLUENCE_PAGE_ID_PING=${CONFLUENCE_PAGE_ID_PING:""} + +python src/py/feasibility-monitoring.py --dsf_cert_path $DSF_CERT_PATH --dsf_key_path $DSF_KEY_PATH --backend_base_url "$BACKEND_BASE_URL" --backend_client_id "$BACKEND_CLIENT_ID" \ + --client_secret "$BACKEND_CLIENT_SECRET" --keycloak_token_url "$KEYCLOAK_TOKEN_URL" \ + --confluence_api_base_url "$CONFLUENCE_API_BASE_URL" --conf_user "$CONF_USER" --conf_pw "$CONF_PW"\ + --send_results_confluence $SEND_TO_CONFLUENCE --wait_result_secs_feas "$WAIT_RESULT_SECS_FEAS"\ + --dsf_base_url $DSF_BASE_URL --execute_feas_test $EXECUTE_FEAS_TEST --confluence_page_id_feas $CONFLUENCE_PAGE_ID_FEAS\ + --execute_history_test $EXECUTE_HISTORY_TEST --confluence_page_id_hist $CONFLUENCE_PAGE_ID_HIST --history_table_len $HISTORY_TABLE_LEN\ + --execute_ping_test $EXECUTE_DSF_PING_TEST --confluence_page_id_ping $CONFLUENCE_PAGE_ID_PING --wait_result_secs_ping "$WAIT_RESULT_SECS_PING" diff --git a/docker/requirements.txt b/docker/requirements.txt new file mode 100644 index 0000000..0847b34 --- /dev/null +++ b/docker/requirements.txt @@ -0,0 +1,4 @@ +requests==2.22.0 +psycopg2==2.9.3 +prettytable==3.3.0 +PyYAML==6.0 diff --git a/input-queries-translated.json b/input-queries-translated.json deleted file mode 100644 index ee9bb6d..0000000 --- a/input-queries-translated.json +++ /dev/null @@ -1,839 +0,0 @@ -{ - "queries": [ - { - "query-name": "patient-gender", - "module": "Patient", - "sq": { - "version": "http://to_be_decided.com/draft-1/schema#", - "display": "", - "inclusionCriteria": [ - [ - { - "termCodes": [ - { - "code": "263495000", - "system": "http://snomed.info/sct", - "display": "Geschlecht" - } - ], - "valueFilter": { - "selectedConcepts": [ - { - "code": "female", - "display": "Female", - "system": "http://hl7.org/fhir/administrative-gender" - }, - { - "code": "male", - "display": "Male", - "system": "http://hl7.org/fhir/administrative-gender" - } - ], - "type": "concept" - } - } - ] - ] - }, - "fhir": { - "name": "intersection", - "operands": [ - { - "name": "union", - "operands": [ - "[base]/Patient?gender=female", - "[base]/Patient?gender=male" - ] - } - ] - } - }, - { - "query-name": "diabetes-any", - "module": "Condition", - "sq": { - "version": "http://to_be_decided.com/draft-1/schema#", - "display": "", - "inclusionCriteria": [ - [ - { - "termCodes": [ - { - "code": "E10-E14", - "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", - "version": "2023", - "display": "Diabetes mellitus" - } - ] - } - ] - ] - }, - "fhir": { - "name": "intersection", - "operands": [ - { - "name": "union", - "operands": [ - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10-E14", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.3", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.31", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.30", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.1", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.11", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.0", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.01", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.7", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.75", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.74", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.73", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.72", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.4", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.41", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.40", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.8", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.81", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.80", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.2", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.21", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.20", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.5", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.51", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.50", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.6", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.61", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.60", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.9", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.91", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E12.90", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.3", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.31", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.30", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.1", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.11", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.0", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.01", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.7", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.75", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.74", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.73", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.72", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.4", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.41", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.40", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.8", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.81", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.80", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.2", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.21", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.20", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.5", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.51", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.50", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.6", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.61", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.60", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.9", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.91", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E10.90", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.3", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.31", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.30", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.1", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.11", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.0", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.01", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.7", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.75", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.74", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.73", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.72", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.4", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.41", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.40", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.8", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.81", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.80", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.2", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.21", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.20", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.5", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.51", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.50", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.6", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.61", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.60", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.9", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.91", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E11.90", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.3", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.31", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.30", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.1", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.11", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.0", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.01", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.7", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.75", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.74", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.73", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.72", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.4", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.41", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.40", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.8", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.81", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.80", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.2", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.21", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.20", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.5", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.51", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.50", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.6", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.61", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.60", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.9", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.91", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E14.90", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.3", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.31", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.30", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.1", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.11", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.0", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.01", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.7", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.75", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.74", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.73", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.72", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.4", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.41", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.40", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.8", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.81", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.80", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.2", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.21", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.20", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.5", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.51", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.50", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.6", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.61", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.60", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.9", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.91", - "[base]/Condition?code=http://fhir.de/CodeSystem/bfarm/icd-10-gm|E13.90" - ] - } - ] - } - }, - { - "query-name": "hemoglobin-718-7", - "module": "Laboratory", - "sq": { - "version": "http://to_be_decided.com/draft-1/schema#", - "display": "", - "inclusionCriteria": [ - [ - { - "termCodes": [ - { - "code": "718-7", - "system": "http://loinc.org", - "display": "H\u00e4moglobin" - } - ], - "valueFilter": { - "selectedConcepts": [], - "type": "quantity-comparator", - "unit": { - "code": "g/dL", - "display": "g/dL" - }, - "value": 0, - "comparator": "gt" - } - }, - { - "termCodes": [ - { - "code": "17856-6", - "system": "http://loinc.org", - "display": "H\u00e4moglobin A1c" - } - ], - "valueFilter": { - "selectedConcepts": [], - "type": "quantity-comparator", - "unit": { - "code": "%", - "display": "%" - }, - "value": 0, - "comparator": "gt" - } - }, - { - "termCodes": [ - { - "code": "4548-4", - "system": "http://loinc.org", - "display": "H\u00e4moglobin A1c" - } - ], - "valueFilter": { - "selectedConcepts": [], - "type": "quantity-comparator", - "unit": { - "code": "%", - "display": "%" - }, - "value": 0, - "comparator": "gt" - } - }, - { - "termCodes": [ - { - "code": "4549-2", - "system": "http://loinc.org", - "display": "Hemoglobin A1c/Hemoglobin.total in Blood by Electrophoresis" - } - ], - "valueFilter": { - "selectedConcepts": [], - "type": "quantity-comparator", - "unit": { - "code": "%", - "display": "%" - }, - "value": 0, - "comparator": "gt" - } - } - ] - ] - }, - "fhir": { - "name": "intersection", - "operands": [ - { - "name": "union", - "operands": [ - "[base]/Observation?code=http://loinc.org|718-7&value-quantity=gt0|http://unitsofmeasure.org|g/dL", - "[base]/Observation?code=http://loinc.org|17856-6&value-quantity=gt0|http://unitsofmeasure.org|%", - "[base]/Observation?code=http://loinc.org|4548-4&value-quantity=gt0|http://unitsofmeasure.org|%", - "[base]/Observation?code=http://loinc.org|4549-2&value-quantity=gt0|http://unitsofmeasure.org|%" - ] - } - ] - } - }, - { - "query-name": "procedure-endocronological-function", - "module": "Procedure", - "sq": { - "version": "http://to_be_decided.com/draft-1/schema#", - "display": "", - "inclusionCriteria": [ - [ - { - "termCodes": [ - { - "code": "3-20", - "system": "http://fhir.de/CodeSystem/bfarm/ops", - "version": "2023", - "display": "Computertomographie [CT], nativ" - } - ] - }, - { - "termCodes": [ - { - "code": "8-19", - "system": "http://fhir.de/CodeSystem/bfarm/ops", - "version": "2023", - "display": "Verb\u00e4nde und Entfernung von erkranktem Gewebe an Haut und Unterhaut" - } - ] - } - ] - ] - }, - "fhir": { - "name": "intersection", - "operands": [ - { - "name": "union", - "operands": [ - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|3-20", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|3-208", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|3-207", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|3-206", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|3-201", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|3-204", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|3-205", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|3-200", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|3-202", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|3-203", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|3-20x", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-19", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.1", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.1b", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.1a", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.1g", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.1d", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.15", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.19", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.1c", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.10", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.17", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.1e", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.16", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.1x", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.14", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.18", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.1f", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.3", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.3b", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.3a", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.3g", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.3d", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.35", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.39", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.3c", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.30", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.37", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.3e", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.36", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.3x", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.34", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.38", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.3f", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.2", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.2b", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.2a", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.2g", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.2d", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.25", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.29", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.2c", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.20", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.27", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.2e", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.26", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.2x", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.24", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.28", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.2f", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.0", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.0b", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.0a", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.0g", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.0d", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.05", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.09", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.0c", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.00", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.07", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.0e", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.06", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.0x", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.04", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.08", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.0f", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.y", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.x", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.xb", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.xa", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.xg", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.xd", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.x5", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.x9", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.xc", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.x0", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.x7", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.xe", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.x6", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.xx", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.x4", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.x8", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-192.xf", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.2", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.22", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.21", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.20", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.23", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.4", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.42", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.41", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.40", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.43", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.3", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.32", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.31", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.30", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-190.33", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.1", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.11", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.10", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.2", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.21", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.20", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.0", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.01", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.00", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.5", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.y", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.7", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.72", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.73", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.74", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.75", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.76", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.77", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.78", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.79", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.71", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.70", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.6", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.4", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.41", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.40", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.3", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.31", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.30", - "[base]/Procedure?code=http://fhir.de/CodeSystem/bfarm/ops|8-191.x" - ] - } - ] - } - }, - { - "query-name": "central-consent-eudsgvoniveau", - "module": "Consent", - "sq": { - "version": "http://to_be_decided.com/draft-1/schema#", - "display": "", - "inclusionCriteria": [ - [ - { - "termCodes": [ - { - "code": "central-consent", - "system": "mii.abide", - "display": "MDAT wissenschaftlich nutzen - EU DSGVO Niveau" - } - ] - } - ] - ] - }, - "fhir": { - "name": "intersection", - "operands": [ - { - "name": "union", - "operands": [ - "[base]/Consent?status=active&mii-provision-provision-code=urn:oid:2.16.840.1.113883.3.1937.777.24.5.3|2.16.840.1.113883.3.1937.777.24.5.3.8" - ] - } - ] - } - }, - { - "query-name": "medication-administration-antidiab", - "module": "Medication", - "sq": { - "version": "http://to_be_decided.com/draft-1/schema#", - "display": "", - "inclusionCriteria": [ - [ - { - "termCodes": [ - { - "code": "A10", - "system": "http://fhir.de/CodeSystem/bfarm/atc", - "version": "2022", - "display": "Antidiabetika" - } - ] - } - ] - ] - }, - "fhir": { - "name": "intersection", - "operands": [ - { - "name": "union", - "operands": [ - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10B", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BF", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BF01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BF02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BF03", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BA", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BA03", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BA02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BA01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BH", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BH04", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BH07", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BH06", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BH52", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BH05", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BH03", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BH01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BH51", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BH08", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BH02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BJ", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BJ04", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BJ07", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BJ05", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BJ01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BJ02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BJ03", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BJ06", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD06", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD04", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD19", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD17", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD13", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD16", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD15", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD20", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD23", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD22", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD18", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD31", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD11", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD26", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD05", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD14", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD03", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD10", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD07", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD08", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD27", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD25", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD09", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD12", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD21", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BD24", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BK", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BK02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BK01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BK03", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BK04", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BK05", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BK07", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BK06", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BC", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BC01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB31", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB06", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB04", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB09", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB12", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB07", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB08", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB11", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB10", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB05", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BB03", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BG", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BG04", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BG03", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BG02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BG01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BX", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BX06", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BX01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BX15", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BX08", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BX03", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BX05", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10BX02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10A", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AF", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AF01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AD", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AD01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AD02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AD03", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AD05", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AD06", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AD04", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AD30", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AC", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AC01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AC02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AC03", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AC04", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AC30", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AE", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AE01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AE02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AE03", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AE06", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AE56", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AE05", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AE04", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AE54", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AE30", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AB", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AB01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AB02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AB03", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AB05", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AB06", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AB04", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10AB30", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10X", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10XA", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10XA01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10XH", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10XH20", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10XP", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10XP02", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10XP01", - "[base]/MedicationAdministration?medication.code=http://fhir.de/CodeSystem/bfarm/atc|A10XP30" - ] - } - ] - } - }, - { - "query-name": "specimen-test", - "module": "Specimen", - "sq": { - "version": "http://to_be_decided.com/draft-1/schema#", - "display": "", - "inclusionCriteria": [ - [ - { - "termCodes": [ - { - "code": "119297000", - "system": "http://snomed.info/sct", - "version": "http://snomed.info/sct/900000000000207008/version/20220930", - "display": "Blood specimen" - } - ] - }, - { - "termCodes": [ - { - "code": "119361006", - "system": "http://snomed.info/sct", - "version": "http://snomed.info/sct/900000000000207008/version/20220930", - "display": "Plasma specimen" - } - ] - }, - { - "termCodes": [ - { - "code": "119376003", - "system": "http://snomed.info/sct", - "version": "http://snomed.info/sct/900000000000207008/version/20220930", - "display": "Tissue specimen" - } - ] - }, - { - "termCodes": [ - { - "code": "441652008", - "system": "http://snomed.info/sct", - "version": "http://snomed.info/sct/900000000000207008/version/20220930", - "display": "Formalin-fixed paraffin-embedded tissue specimen" - } - ] - }, - { - "termCodes": [ - { - "code": "441479001", - "system": "http://snomed.info/sct", - "version": "http://snomed.info/sct/900000000000207008/version/20220930", - "display": "Fresh tissue specimen" - } - ] - }, - { - "termCodes": [ - { - "code": "420135007", - "system": "http://snomed.info/sct", - "version": "http://snomed.info/sct/900000000000207008/version/20220930", - "display": "Whole blood" - } - ] - } - ] - ] - }, - "fhir": { - "name": "intersection", - "operands": [ - { - "name": "union", - "operands": [ - "[base]/Specimen?type=http://snomed.info/sct|119297000", - "[base]/Specimen?type=http://snomed.info/sct|446272009", - "[base]/Specimen?type=http://snomed.info/sct|441510007", - "[base]/Specimen?type=http://snomed.info/sct|445295009", - "[base]/Specimen?type=http://snomed.info/sct|57921000052103", - "[base]/Specimen?type=http://snomed.info/sct|122556008", - "[base]/Specimen?type=http://snomed.info/sct|122551003", - "[base]/Specimen?type=http://snomed.info/sct|119361006", - "[base]/Specimen?type=http://snomed.info/sct|708048008", - "[base]/Specimen?type=http://snomed.info/sct|708049000", - "[base]/Specimen?type=http://snomed.info/sct|119362004", - "[base]/Specimen?type=http://snomed.info/sct|119364003", - "[base]/Specimen?type=http://snomed.info/sct|258580003", - "[base]/Specimen?type=http://snomed.info/sct|119361006", - "[base]/Specimen?type=http://snomed.info/sct|708048008", - "[base]/Specimen?type=http://snomed.info/sct|708049000", - "[base]/Specimen?type=http://snomed.info/sct|119362004", - "[base]/Specimen?type=http://snomed.info/sct|119376003", - "[base]/Specimen?type=http://snomed.info/sct|258417006", - "[base]/Specimen?type=http://snomed.info/sct|441652008", - "[base]/Specimen?type=http://snomed.info/sct|441479001", - "[base]/Specimen?type=http://snomed.info/sct|16214131000119104", - "[base]/Specimen?type=http://snomed.info/sct|309186001", - "[base]/Specimen?type=http://snomed.info/sct|309072003", - "[base]/Specimen?type=http://snomed.info/sct|119325001", - "[base]/Specimen?type=http://snomed.info/sct|258435002", - "[base]/Specimen?type=http://snomed.info/sct|441652008", - "[base]/Specimen?type=http://snomed.info/sct|441479001", - "[base]/Specimen?type=http://snomed.info/sct|420135007" - ] - } - ] - } - } - ] -} \ No newline at end of file diff --git a/reports/README.md b/reports/README.md deleted file mode 100644 index 6a56a64..0000000 --- a/reports/README.md +++ /dev/null @@ -1 +0,0 @@ -directory needed to store the reports \ No newline at end of file diff --git a/src/execute-local.sh b/src/execute-local.sh new file mode 100644 index 0000000..2ce5802 --- /dev/null +++ b/src/execute-local.sh @@ -0,0 +1,30 @@ +#!/bin/bash +DSF_CERT_PATH=$LOCAL_DSF_CERT_PATH +DSF_KEY_PATH=$LOCAL_DSF_KEY_PATH +BACKEND_BASE_URL=${BACKEND_BASE_URL:-"https://localhost/api/v1"} +BACKEND_CLIENT_ID=${BACKEND_CLIENT_ID:-"feasibility-gui"} +BACKEND_CLIENT_SECRET=${BACKEND_CLIENT_SECRET:-"test"} +KEYCLOAK_TOKEN_URL=${KEYCLOAK_TOKEN_URL:-"https://localhost/auth/realms/feasibility/protocol/openid-connect/token"} +CONFLUENCE_API_BASE_URL=${CONFLUENCE_API_BASE_URL:-"https://myconfluence-rest-api-url"} +CONF_USER=${CONF_USER:-"username"} +CONF_PW=${CONF_PW:-"password"} +WAIT_RESULT_SECS_FEAS=${WAIT_RESULT_SECS_FEAS:-60} +WAIT_RESULT_SECS_PING=${WAIT_RESULT_SECS_PING:-600} + +SEND_TO_CONFLUENCE=${SEND_TO_CONFLUENCE:-"false"} +DSF_BASE_URL=${DSF_BASE_URL:-""} +EXECUTE_FEAS_TEST=${EXECUTE_FEAS_TEST:-"false"} +CONFLUENCE_PAGE_ID_FEAS=$CONFLUENCE_PAGE_ID_FEAS +EXECUTE_HISTORY_TEST=${EXECUTE_HISTORY_TEST:-"false"} +CONFLUENCE_PAGE_ID_HIST=${CONFLUENCE_PAGE_ID_HIST:-""} +HISTORY_TABLE_LEN=${HISTORY_TABLE_LEN:-14} +EXECUTE_DSF_PING_TEST=${EXECUTE_DSF_PING_TEST:-"false"} +CONFLUENCE_PAGE_ID_PING=$CONFLUENCE_PAGE_ID_PING + +python src/py/feasibility-monitoring.py --dsf_cert_path $DSF_CERT_PATH --dsf_key_path $DSF_KEY_PATH --backend_base_url "$BACKEND_BASE_URL" --backend_client_id "$BACKEND_CLIENT_ID" \ + --client_secret "$BACKEND_CLIENT_SECRET" --keycloak_token_url "$KEYCLOAK_TOKEN_URL" \ + --confluence_api_base_url "$CONFLUENCE_API_BASE_URL" --conf_user "$CONF_USER" --conf_pw "$CONF_PW"\ + --send_results_confluence $SEND_TO_CONFLUENCE --wait_result_secs_feas "$WAIT_RESULT_SECS_FEAS"\ + --dsf_base_url $DSF_BASE_URL --execute_feas_test $EXECUTE_FEAS_TEST --confluence_page_id_feas $CONFLUENCE_PAGE_ID_FEAS\ + --execute_history_test $EXECUTE_HISTORY_TEST --confluence_page_id_hist $CONFLUENCE_PAGE_ID_HIST --history_table_len $HISTORY_TABLE_LEN\ + --execute_ping_test $EXECUTE_DSF_PING_TEST --confluence_page_id_ping $CONFLUENCE_PAGE_ID_PING --wait_result_secs_ping "$WAIT_RESULT_SECS_PING" diff --git a/src/py/execute_feasibility_test.py b/src/py/execute_feasibility_test.py new file mode 100644 index 0000000..311b46b --- /dev/null +++ b/src/py/execute_feasibility_test.py @@ -0,0 +1,307 @@ +from prettytable import PrettyTable +from datetime import datetime +import requests +import base64 +import json +import yaml +import time +import sys +import os + + +CONFIG = None +DSF_SITE_IDS = None +HISTORY_REPORT_FILE = "reports/history-report.json" +HISTORY_QUERY_FILE = "config/history-query.json" +INPUT_QUERIES_FILE = "config/input-queries.json" +CONFIG_FILE = "config/config.yml" + + +def load_config(): + global CONFIG + with open(CONFIG_FILE, 'r', encoding='utf-8') as f: + CONFIG = yaml.safe_load(f) + + +def load_constants(): + load_config() + + global DSF_SITE_IDS + DSF_SITE_IDS = json.loads(CONFIG["dsf-site-ids"]) + + +def load_json_file(file_path): + with open(file_path, 'r') as f: + return json.load(f) + + +def get_results(query_id, access_token, backend_base_url): + run_query_path = "/query" + header = { + 'Authorization': f'Bearer {access_token}', + 'Content-Type': 'application/json' + } + resp = requests.get( + f'{backend_base_url}{run_query_path}/{query_id}/detailed-result', headers=header) + return resp.json() + + +def connect_to_keycloak(backend_client_id, client_secret, keycloak_token_url): + backend_user_login = {'client_id': backend_client_id, + 'grant_type': 'client_credentials', + 'client_secret': client_secret, + + } + + print(f'Getting access token from {keycloak_token_url}') + resp = requests.post(keycloak_token_url, + data=backend_user_login) + print(f'Token Status code: {resp.status_code}') + access_token = resp.json()['access_token'] + return access_token + + +def send_test_query_and_get_id(access_token, sq, backend_base_url): + header = { + 'Authorization': f'Bearer {access_token}', + 'Content-Type': 'application/json' + } + + run_query_path = "/query" + print(f'Running query on backend: {backend_base_url}{run_query_path}') + resp = requests.post( + f'{backend_base_url}{run_query_path}', headers=header, json=sq) + + result_location = resp.headers['Location'] + query_id = result_location.rsplit('/', 1)[-1] + return query_id + + +def convert_results(results): + converted_results = {} + + for site in DSF_SITE_IDS: + converted_results[site] = '.' + + for result in results["resultLines"]: + if result["siteName"] not in DSF_SITE_IDS: + continue + + n_patients = result['numberOfPatients'] + + if n_patients >= 20: + n_patients = "Yes" + else: + n_patients = "No" + + converted_results[result["siteName"]] = n_patients + + return dict(sorted(converted_results.items())) + + +def save_results_to_disk(query_report): + + report_time = datetime.now().strftime("%Y-%m-%d_%H-%M-%S") + + with open(f'reports/feasibility_results-{report_time}.json', 'a+') as f: + json.dump(query_report, f) + + +def append_percentage_fulfilled_column(site_module_yes_no_map, modules, optional_modules): + fulfilled_100 = 0 + fulfilled_gt0 = 0 + fulfilled_0 = 0 + + for site_url in DSF_SITE_IDS: + site_yes_count = 0 + for column_name in modules: + if site_module_yes_no_map[column_name][site_url] == "Yes" and column_name not in optional_modules: + site_yes_count += 1 + + non_optional_modules = (len(modules) - len(optional_modules)) + site_fulfilled = 100 if non_optional_modules == 0 else int(100 * site_yes_count / non_optional_modules) + + site_module_yes_no_map["percentage_fulfilled"][site_url] = str(site_fulfilled) + " %" + if site_fulfilled == 100: + fulfilled_100 += 1 + elif site_fulfilled > 0: + fulfilled_gt0 += 1 + else: + fulfilled_0 += 1 + site_module_yes_no_map["percentage_fulfilled"]["total_yes"] = fulfilled_100 + site_module_yes_no_map["percentage_fulfilled"]["total_no"] = fulfilled_gt0 + site_module_yes_no_map["percentage_fulfilled"]["total_na"] = fulfilled_0 + + +def create_columns(query_reports, column_names, optional_modules, column_attribute): + site_module_yes_no_map = {column_name: {"total_yes": 0, "total_no": 0, "total_na": 0} for column_name in column_names} + + for query_report in query_reports: + column_name = query_report[column_attribute] + + for site_url, converted_query_result in query_report["result"].items(): + + if converted_query_result == "Yes": + site_module_yes_no_map[column_name]["total_yes"] += 1 + elif converted_query_result == "No": + site_module_yes_no_map[column_name]["total_no"] += 1 + else: + site_module_yes_no_map[column_name]["total_na"] += 1 + + site_module_yes_no_map[column_name][site_url] = converted_query_result + + if column_attribute == "module": + module_names = list(filter(lambda x: x != "percentage_fulfilled", column_names)) + append_percentage_fulfilled_column(site_module_yes_no_map, module_names, optional_modules) + return site_module_yes_no_map + + +def get_column_keys(report_results, column_attribute): + column_keys = [report[column_attribute] for report in report_results] + + if column_attribute == "module": + optional_modules = [query_report["module"] for query_report in filter(lambda x: x["optional"] is True, report_results)] + sorted_query_modules = [] + for module in column_keys: + if module not in optional_modules: + sorted_query_modules.append(module) + + sorted_query_modules += optional_modules + sorted_query_modules += ["percentage_fulfilled"] + + return sorted_query_modules, optional_modules + else: + return column_keys, [] + + +# column_attribute can be date or module +def convert_to_table(report_results, column_attribute): + row_keys = ["total_yes", "total_no", "total_na"] + list(DSF_SITE_IDS) + column_keys, optional_column_keys = get_column_keys(report_results, column_attribute) + columns = create_columns(report_results, column_keys, optional_column_keys, column_attribute) + + pTable = PrettyTable() + first_column = ["Total Yes | 100% fullfilled", "Total No | >0% fullfilled", "Total Na | 0% fullfilled"] + list(DSF_SITE_IDS) + pTable.add_column("Site URL", first_column) + + for column_key in column_keys: + column = [] + for row_key in row_keys: + column.append(columns[column_key][row_key]) + + column_name = column_key + " (optional)" if column_key in optional_column_keys else column_key + if column_name == "percentage_fulfilled": + column_name = "% fulfilled" + pTable.add_column(column_name, column) + + return pTable + + +def load_history_report(): + history_query = load_json_file(HISTORY_QUERY_FILE) + + if not os.path.isfile(HISTORY_REPORT_FILE): + open(HISTORY_REPORT_FILE, "x") + if os.path.isfile(HISTORY_REPORT_FILE) and os.path.getsize(HISTORY_REPORT_FILE) == 0: + history_report = {"reports": [], "query": history_query} + return history_report + + with open(HISTORY_REPORT_FILE, "r") as f: + history_report = json.load(f) + + if history_report["query"] != history_query: + raise ValueError("history report contains query that is not equal to the current history query") + + history_report["reports"].sort(key=lambda x: datetime.strptime(x["date"], "%Y-%m-%d")) + return history_report + + +def update_and_save_history_report(history_report, new_result): + now = datetime.now().strftime("%Y-%m-%d") + new_history_result = {"date": now, "result": new_result} + + reports = history_report["reports"] + most_recent_date = reports[len(reports)-1]["date"] if len(reports) > 0 else None + + if most_recent_date == now: + reports[len(reports)-1] = new_history_result + else: + history_report["reports"].append(new_history_result) + + with open(HISTORY_REPORT_FILE, "w") as f: + json.dump(history_report, f) + + +def send_table_to_conf(table, conf_user, conf_pw, conf_api_base_url, conf_page_id, page_title, page_content): + table_html = table.get_html_string() + page_content = f'{page_content}{table_html}

' + + base64_bytes = base64.b64encode(f'{conf_user}:{conf_pw}'.encode('ascii')) + base64_message = base64_bytes.decode('ascii') + header = { + 'Authorization': f'Basic {base64_message}', + 'Content-Type': 'application/json' + } + + res = requests.get(f'{conf_api_base_url}/content/{conf_page_id}', + headers=header) + + version_number = res.json()['version']['number'] + content_update = { + 'title': page_title, + 'type': 'page', + 'body': {'storage': {'value': page_content, + 'representation': 'storage' + }, + }, + 'version': {'number': version_number + 1} + } + res = requests.put(f'{conf_api_base_url}/content/{conf_page_id}', + headers=header, json=content_update) + + +def send_query_and_get_results(query, backend_base_url, backend_client_id, client_secret, keycloak_token_url, wait_result_secs_feas): + access_token = connect_to_keycloak(backend_client_id, client_secret, keycloak_token_url) + print(f'Sending query: {query}') + query_id = send_test_query_and_get_id(access_token, query, backend_base_url) + print(f'Query ID: {query_id}') + print(f'Sleep for {wait_result_secs_feas} seconds to wait for results') + sys.stdout.flush() + time.sleep(int(wait_result_secs_feas)) + access_token = connect_to_keycloak(backend_client_id, client_secret, keycloak_token_url) + return get_results(query_id, access_token, backend_base_url) + + +def execute_history_query(backend_base_url, backend_client_id, client_secret, keycloak_token_url, wait_result_secs_feas, conf_user, conf_pw, + confluence_api_base_url, confluence_page_id_hist, send_results_confluence, history_table_len): + load_constants() + history_report = load_history_report() + history_query = load_json_file(HISTORY_QUERY_FILE) + results = send_query_and_get_results(history_query, backend_base_url, backend_client_id, client_secret, keycloak_token_url, wait_result_secs_feas) + converted_result = convert_results(results) + + update_and_save_history_report(history_report, converted_result) + + history_table = convert_to_table(history_report["reports"][-int(history_table_len):], "date") + print(history_table) + + if send_results_confluence: + send_table_to_conf(history_table, conf_user, conf_pw, confluence_api_base_url, confluence_page_id_hist, CONFIG["hist-page-title"], CONFIG["hist-page-content-html"]) + + +def execute_feas_test_queries(backend_base_url, backend_client_id, client_secret, keycloak_token_url, conf_user, conf_pw, + confluence_api_base_url, confluence_page_id_feas, wait_result_secs_feas, send_results_confluence): + load_constants() + queries = load_json_file(INPUT_QUERIES_FILE) + + for query in queries['queries']: + results = send_query_and_get_results(query["sq"], backend_base_url, backend_client_id, client_secret, keycloak_token_url, wait_result_secs_feas) + query['result'] = convert_results(results) + + report_table = convert_to_table(queries["queries"], "module") + print(report_table) + + if send_results_confluence: + send_table_to_conf(report_table, conf_user, conf_pw, confluence_api_base_url, confluence_page_id_feas, CONFIG["feas-page-title"], CONFIG["feas-page-content-html"]) + + save_results_to_disk(queries) diff --git a/src/py/execute_ping_test.py b/src/py/execute_ping_test.py new file mode 100644 index 0000000..8744206 --- /dev/null +++ b/src/py/execute_ping_test.py @@ -0,0 +1,103 @@ +from prettytable import PrettyTable +import requests +import base64 +import time +import yaml + + +CONFIG = None +CONFIG_FILE = "config/config.yml" +PING_TASK_FILE = "src/resources/ping-task.xml" + + +def load_config(): + global CONFIG + with open(CONFIG_FILE, 'r', encoding='utf-8') as f: + CONFIG = yaml.safe_load(f) + + +def load_ping_task(): + with open(PING_TASK_FILE, 'r') as f: + return f.read() + + +def convert_report_to_simple_table_ping(input_report): + table = { + "header": ['Site', 'Ping Result'] + } + + pTable = PrettyTable(table['header']) + + for site_ident in input_report.keys(): + ping_result = input_report[site_ident] + table[site_ident] = [site_ident] + table[site_ident].append(ping_result) + pTable.add_row(table[site_ident]) + + return pTable + + +def send_result_to_confluence_ping(report_table, confluence_api_base_url, confluence_page_id_ping, conf_user, conf_pw): + + page_info = CONFIG["ping-page-content-html"] + + table_html = report_table.get_html_string() + page_info = f'{page_info}{table_html}

' + + base64_bytes = base64.b64encode(f'{conf_user}:{conf_pw}'.encode('ascii')) + base64_message = base64_bytes.decode('ascii') + header = { + 'Authorization': f'Basic {base64_message}', + 'Content-Type': 'application/json' + } + + res = requests.get(f'{confluence_api_base_url}/content/{confluence_page_id_ping}', + headers=header) + + version_number = res.json()['version']['number'] + content_update = { + 'title': CONFIG["ping-page-title"], + 'type': 'page', + 'body': {'storage': {'value': page_info, + 'representation': 'storage' + }, + }, + 'version': {'number': version_number + 1} + } + + res = requests.put(f'{confluence_api_base_url}/content/{confluence_page_id_ping}', + headers=header, json=content_update) + + +def execute_ping_task(dsf_base_url, wait_result_secs_ping, b_send_results_confluence, confluence_api_base_url, confluence_page_id_ping, conf_user, conf_pw, dsf_cert_path, dsf_key_path): + load_config() + + header = { + 'Content-Type': 'application/xml', + 'Accept': "application/json" + } + + ping_task = load_ping_task() + + res = requests.post(f'{dsf_base_url}/Task', headers=header, + cert=(dsf_cert_path, dsf_key_path), data=ping_task) + ping_task_id = res.json()['id'] + + time.sleep(int(wait_result_secs_ping)) + + res = requests.get(f'{dsf_base_url}/Task/{ping_task_id}?_format=json', + headers=header, cert=(dsf_cert_path, dsf_key_path)) + ping_task_result = res.json() + ping_results = {} + + for result in ping_task_result['output']: + site_ident = result['extension'][0]['extension'][1]['valueIdentifier']['value'] + ping_result = result['valueCoding']['code'] + ping_results[site_ident] = ping_result + + ping_results = dict(sorted(ping_results.items())) + report_table = convert_report_to_simple_table_ping(ping_results) + print(report_table) + + if b_send_results_confluence: + send_result_to_confluence_ping(report_table, confluence_api_base_url, confluence_page_id_ping, conf_user, conf_pw) diff --git a/src/py/feasibility-monitoring.py b/src/py/feasibility-monitoring.py new file mode 100644 index 0000000..9444256 --- /dev/null +++ b/src/py/feasibility-monitoring.py @@ -0,0 +1,104 @@ +import argparse +import execute_ping_test +import execute_feasibility_test + + +def str_to_bool(s): + return s.lower() in ["true", "yes", "1"] + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('--backend_base_url', help='base url of the feasibility backend', + default="https://localhost/api/v2") + parser.add_argument('--backend_client_id', help='backend client id', + nargs="?", default="feasibility-gui") + parser.add_argument('--dsf_base_url', help='base url of the feasibility backend', + default="https://localhost/api/v2") + parser.add_argument('--dsf_cert_path', help='path to the dsf cert', + nargs="?", default="certs/dsf-cert.cer") + parser.add_argument('--dsf_key_path', help='path to the dsf key', + nargs="?", default="certs/dsf-key.key") + parser.add_argument('--backend_user', help='', nargs="?", default="test") + parser.add_argument('--client_secret', help='', nargs="?", default="test") + parser.add_argument('--keycloak_token_url', help='keycloak token url', + default="https://localhost/auth/realms/feasibility/protocol/openid-connect/token") + parser.add_argument('--confluence_api_base_url', help='', nargs="?", + default='https://myconfluence-rest-api-url') + parser.add_argument('--confluence_page_id_feas', help='', nargs="?", + default='') + parser.add_argument('--confluence_page_id_hist', help='', nargs="?", + default='') + parser.add_argument('--confluence_page_id_ping', help='', nargs="?", + default='') + parser.add_argument('--send_results_confluence', help='', type=str_to_bool, + default="false") + parser.add_argument( + '--conf_user', help='username of confluence account', nargs="?", default='username') + parser.add_argument( + '--conf_pw', help='password of confluence account', nargs="?", default='password') + parser.add_argument('--wait_result_secs_feas', + help='number of seconds to wait before results for a query are fetched', nargs="?", default='60') + parser.add_argument('--wait_result_secs_ping', + help='number of seconds to wait before results for the ping task fetched', nargs="?", default='600') + parser.add_argument('--history_table_len', + help='length of the history table that is sent to confluence', nargs="?", default='14') + parser.add_argument('--execute_feas_test', help='', type=str_to_bool, default="false") + parser.add_argument('--execute_history_test', help='', type=str_to_bool, default="false") + parser.add_argument('--execute_ping_test', help='', type=str_to_bool, default="false") + + args = vars(parser.parse_args()) + + backend_base_url = args["backend_base_url"] + backend_client_id = args["backend_client_id"] + dsf_base_url = args["dsf_base_url"] + dsf_cert_path = args["dsf_cert_path"] + dsf_key_path = args["dsf_key_path"] + backend_user = args["backend_user"] + client_secret = args["client_secret"] + keycloak_token_url = args["keycloak_token_url"] + confluence_api_base_url = args["confluence_api_base_url"] + confluence_page_id_feas = args["confluence_page_id_feas"] + confluence_page_id_hist = args["confluence_page_id_hist"] + confluence_page_id_ping = args["confluence_page_id_ping"] + b_send_results_confluence = args["send_results_confluence"] + conf_user = args["conf_user"] + conf_pw = args["conf_pw"] + wait_result_secs_feas = args["wait_result_secs_feas"] + wait_result_secs_ping = args["wait_result_secs_ping"] + history_table_len = args["history_table_len"] + b_execute_feas_test = args["execute_feas_test"] + b_execute_history_test = args["execute_history_test"] + b_execute_ping_test = args["execute_ping_test"] + + if b_execute_history_test: + execute_feasibility_test.execute_history_query(backend_base_url, + backend_client_id, + client_secret, + keycloak_token_url, + wait_result_secs_feas, + conf_user, conf_pw, + confluence_api_base_url, + confluence_page_id_hist, + b_send_results_confluence, + history_table_len) + if b_execute_feas_test: + execute_feasibility_test.execute_feas_test_queries(backend_base_url, + backend_client_id, + client_secret, + keycloak_token_url, + conf_user, conf_pw, + confluence_api_base_url, + confluence_page_id_feas, + wait_result_secs_feas, + b_send_results_confluence) + + if b_execute_ping_test: + execute_ping_test.execute_ping_task(dsf_base_url, + wait_result_secs_ping, + b_send_results_confluence, + confluence_api_base_url, + confluence_page_id_ping, + conf_user, conf_pw, + dsf_cert_path, + dsf_key_path) diff --git a/src/resources/ping-task.xml b/src/resources/ping-task.xml new file mode 100644 index 0000000..29d7d39 --- /dev/null +++ b/src/resources/ping-task.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/translate-input-queries.py b/translate-input-queries.py deleted file mode 100644 index 65b324b..0000000 --- a/translate-input-queries.py +++ /dev/null @@ -1,17 +0,0 @@ -import json -import requests -import os - -input_queries = {} -flare_url = os.getenv('FLARE_URL') -headers = {'content-type': 'application/sq+json'} - -with open ("input-queries.json", "r") as rf: - input_queries = json.load(rf) - -for query in input_queries['queries']: - res = requests.post(flare_url, json=query['sq'], headers=headers) - query['fhir'] = res.json() - -with open ("input-queries-translated.json", "w+") as wf: - json.dump(input_queries, wf)