From 84cb211ca0ca8c2557fdb9b0188aaa86e3c8ba19 Mon Sep 17 00:00:00 2001 From: Frank Knoll Date: Sat, 13 Jul 2024 17:49:50 +0200 Subject: [PATCH 01/13] adding AddToAny share button --- docs/SymptomsCausedByDrugs/index.html | 14439 +++++++++++++++++++++++- 1 file changed, 14309 insertions(+), 130 deletions(-) diff --git a/docs/SymptomsCausedByDrugs/index.html b/docs/SymptomsCausedByDrugs/index.html index 7d31bda102f..c3d617493cf 100644 --- a/docs/SymptomsCausedByDrugs/index.html +++ b/docs/SymptomsCausedByDrugs/index.html @@ -1,40 +1,41 @@ + - - - - - -Eudra Safety Signal (All drugs) - - - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + -
-
- -
-
- - -
-
-
-
-

Eudra Safety Signal (All drugs)

- +
+
+
+
+
+

Worst Drugs

+
+
+
+
+ + +
+ + + + + + + +
DrugLower Confidence Limit of Proportional Reporting Ratio
+ +
+
+
+
+
+
+

Strongest Symptoms

+
+
+
+
+ + +
+ + + + + + + +
SymptomLower Confidence Limit of Proportional Reporting Ratio >= 2
+ +
+
+
+
+
+
+
+
+ + + -
- - - - - - - - - - - - - - + +
+ +
+ + + + + + + + + + + + + + + \ No newline at end of file From 8b3da7fe49d4a384d2ffb7ea210838fe10fc7859 Mon Sep 17 00:00:00 2001 From: Frank Knoll Date: Sat, 13 Jul 2024 18:13:51 +0200 Subject: [PATCH 02/13] demo to set a new value for the shared URL --- docs/SymptomsCausedByDrugs/index.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/SymptomsCausedByDrugs/index.html b/docs/SymptomsCausedByDrugs/index.html index c3d617493cf..c4ce24472b0 100644 --- a/docs/SymptomsCausedByDrugs/index.html +++ b/docs/SymptomsCausedByDrugs/index.html @@ -14314,6 +14314,28 @@
+
From f75d2f37558e936fba6cdb42fc9348fad1056c64 Mon Sep 17 00:00:00 2001 From: Frank Knoll Date: Sat, 13 Jul 2024 20:46:52 +0200 Subject: [PATCH 03/13] styling AddToAny share button --- docs/SymptomsCausedByDrugs/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/SymptomsCausedByDrugs/index.html b/docs/SymptomsCausedByDrugs/index.html index c4ce24472b0..00f83d3f0f9 100644 --- a/docs/SymptomsCausedByDrugs/index.html +++ b/docs/SymptomsCausedByDrugs/index.html @@ -14311,7 +14311,9 @@ data-a2a-title="Eudra Safety Signal (All drugs)"> - + + + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + -

Batch Codes of Coronavirus 2019 Vaccines

- - - - - - - - - - - - - - - -
BatchAdverse Reaction ReportsDeathsDisabilitiesLife-Threatening IllnessesHospitalizationsCompanySevere reportsLethalityCountries
- - - +
+ + + \ No newline at end of file From 214510bc3327030ad27d009362db5e6703ad9f20 Mon Sep 17 00:00:00 2001 From: Frank Knoll Date: Sun, 14 Jul 2024 00:32:36 +0200 Subject: [PATCH 05/13] adding url params vaccine and symptom --- docs/SymptomsCausedByDrugs/index.html | 22 +++------ .../js/PageInitializer.js | 23 +++------- docs/SymptomsCausedByDrugs/js/Select2.js | 45 +++++++++++++++++++ .../test/index.test.html | 16 +++---- 4 files changed, 66 insertions(+), 40 deletions(-) create mode 100644 docs/SymptomsCausedByDrugs/js/Select2.js diff --git a/docs/SymptomsCausedByDrugs/index.html b/docs/SymptomsCausedByDrugs/index.html index 00f83d3f0f9..e9465e25ac2 100644 --- a/docs/SymptomsCausedByDrugs/index.html +++ b/docs/SymptomsCausedByDrugs/index.html @@ -35,21 +35,25 @@ + diff --git a/docs/SymptomsCausedByDrugs/js/PageInitializer.js b/docs/SymptomsCausedByDrugs/js/PageInitializer.js index 227533551db..63defaa2597 100644 --- a/docs/SymptomsCausedByDrugs/js/PageInitializer.js +++ b/docs/SymptomsCausedByDrugs/js/PageInitializer.js @@ -5,34 +5,25 @@ class PageInitializer { PageInitializer.#configureVaccine(vaccine); } - static #configureSymptom({ symptomSelectElement, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) { + static #configureSymptom({ symptomSelectElement, selectSymptom, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) { const prrByVaccineTableView = new PrrByVaccineTableView(prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName); - PageInitializer.#initializeSelectElement( + Select2.initializeSelectElement( { selectElement: symptomSelectElement, + textOfOption2Select: selectSymptom, onValueSelected: (id, text) => prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text), minimumInputLength: 0 }); } - static #configureVaccine({ vaccineSelectElement, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) { + static #configureVaccine({ vaccineSelectElement, selectVaccine, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) { const prrBySymptomTableView = new PrrBySymptomTableView(prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName); - PageInitializer.#initializeSelectElement( + Select2.initializeSelectElement( { selectElement: vaccineSelectElement, - onValueSelected: (id, text) => prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id ,text), + textOfOption2Select: selectVaccine, + onValueSelected: (id, text) => prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id, text), minimumInputLength: 0 }); } - - static #initializeSelectElement({ selectElement, onValueSelected, minimumInputLength }) { - selectElement.select2({ minimumInputLength: minimumInputLength }); - selectElement.on( - 'select2:select', - function (event) { - const id = event.params.data.id; - const text = event.params.data.text; - onValueSelected(id, text); - }); - } } diff --git a/docs/SymptomsCausedByDrugs/js/Select2.js b/docs/SymptomsCausedByDrugs/js/Select2.js new file mode 100644 index 00000000000..953046bf6be --- /dev/null +++ b/docs/SymptomsCausedByDrugs/js/Select2.js @@ -0,0 +1,45 @@ +class Select2 { + + // FK-TODO: rename onValueSelected to onSelectOptionHavingValueAndText + static initializeSelectElement({ selectElement, textOfOption2Select, onValueSelected, minimumInputLength }) { + selectElement.select2({ minimumInputLength: minimumInputLength }); + selectElement.on( + 'select2:select', + function (event) { + const id = event.params.data.id; + const text = event.params.data.text; + onValueSelected(id, text); + }); + Select2.#selectOptionHavingText(selectElement, textOfOption2Select); + } + + static #selectOptionHavingText(selectElement, text) { + const option = Select2.#getOptionHavingText(selectElement, text); + if (option === undefined) { + return; + } + Select2.#selectOption(selectElement, option); + } + + static #getOptionHavingText(selectElement, text) { + if (text === null) { + return undefined; + } + return Array + .from(selectElement[0].options) + .find(option => option.text == text); + } + + static #selectOption(selectElement, option) { + selectElement.val(option.value).trigger('change'); + selectElement.trigger({ + type: 'select2:select', + params: { + data: { + "id": option.value, + "text": option.text + } + } + }); + } +} diff --git a/docs/SymptomsCausedByVaccines/test/index.test.html b/docs/SymptomsCausedByVaccines/test/index.test.html index 21af9568fec..6f77573b4eb 100644 --- a/docs/SymptomsCausedByVaccines/test/index.test.html +++ b/docs/SymptomsCausedByVaccines/test/index.test.html @@ -11,14 +11,14 @@ - - - - - - - - + + + + + + + + From 3f2c43aeb1f7ee6581db2327ae64c9e05d12d917 Mon Sep 17 00:00:00 2001 From: Frank Knoll Date: Sun, 14 Jul 2024 01:11:04 +0200 Subject: [PATCH 06/13] setting searchParams when selecting symptom or vaccine --- docs/SymptomsCausedByDrugs/index.html | 1 - docs/SymptomsCausedByDrugs/js/PageInitializer.js | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/SymptomsCausedByDrugs/index.html b/docs/SymptomsCausedByDrugs/index.html index e9465e25ac2..adbef9bff16 100644 --- a/docs/SymptomsCausedByDrugs/index.html +++ b/docs/SymptomsCausedByDrugs/index.html @@ -14324,7 +14324,6 @@ var a2a_config = a2a_config || {}; a2a_config.callbacks = a2a_config.callbacks || []; a2a_config.callbacks.push({ - // FK-TODO: use selected symptom and vaccine for url share: _ => ({ url: window.location.href }), }); diff --git a/docs/SymptomsCausedByDrugs/js/PageInitializer.js b/docs/SymptomsCausedByDrugs/js/PageInitializer.js index 63defaa2597..033e486ae19 100644 --- a/docs/SymptomsCausedByDrugs/js/PageInitializer.js +++ b/docs/SymptomsCausedByDrugs/js/PageInitializer.js @@ -11,7 +11,12 @@ class PageInitializer { { selectElement: symptomSelectElement, textOfOption2Select: selectSymptom, - onValueSelected: (id, text) => prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text), + onValueSelected: (id, text) => { + prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text); + const url = new URL(window.location.href); + url.searchParams.set('symptom', text); + window.history.replaceState(null, "", url); + }, minimumInputLength: 0 }); } @@ -22,7 +27,12 @@ class PageInitializer { { selectElement: vaccineSelectElement, textOfOption2Select: selectVaccine, - onValueSelected: (id, text) => prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id, text), + onValueSelected: (id, text) => { + prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id, text); + const url = new URL(window.location.href); + url.searchParams.set('vaccine', text); + window.history.replaceState(null, "", url); + }, minimumInputLength: 0 }); } From 1aba82ce249b7916de21d783f6b82fd05a2c61be Mon Sep 17 00:00:00 2001 From: Frank Knoll Date: Sun, 14 Jul 2024 01:27:22 +0200 Subject: [PATCH 07/13] refactoring --- docs/SymptomsCausedByDrugs/index.html | 2 ++ docs/SymptomsCausedByDrugs/js/PageInitializer.js | 12 ++++-------- docs/UIUtils.js | 6 ++++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/SymptomsCausedByDrugs/index.html b/docs/SymptomsCausedByDrugs/index.html index adbef9bff16..30ef302ac64 100644 --- a/docs/SymptomsCausedByDrugs/index.html +++ b/docs/SymptomsCausedByDrugs/index.html @@ -47,6 +47,7 @@ symptom: { symptomSelectElement: $('#symptomSelect'), selectSymptom: UIUtils.getSearchParam(urlSearchParams, 'symptom', null), + onSymptomSelected: symptom => UIUtils.setSearchParamOfCurrentUrl('symptom', symptom), prrByVaccineTableElement: $('#prrByVaccineTable'), downloadPrrByVaccineTableButton: document.querySelector("#downloadPrrByVaccineTable"), keyColumnName: name @@ -54,6 +55,7 @@ vaccine: { vaccineSelectElement: $('#vaccineSelect'), selectVaccine: UIUtils.getSearchParam(urlSearchParams, 'vaccine', null), + onVaccineSelected: vaccine => UIUtils.setSearchParamOfCurrentUrl('vaccine', vaccine), prrBySymptomTableElement: $('#prrBySymptomTable'), downloadPrrBySymptomTableButton: document.querySelector("#downloadPrrBySymptomTable"), valueName: name diff --git a/docs/SymptomsCausedByDrugs/js/PageInitializer.js b/docs/SymptomsCausedByDrugs/js/PageInitializer.js index 033e486ae19..e4a1ee846a2 100644 --- a/docs/SymptomsCausedByDrugs/js/PageInitializer.js +++ b/docs/SymptomsCausedByDrugs/js/PageInitializer.js @@ -5,7 +5,7 @@ class PageInitializer { PageInitializer.#configureVaccine(vaccine); } - static #configureSymptom({ symptomSelectElement, selectSymptom, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) { + static #configureSymptom({ symptomSelectElement, selectSymptom, onSymptomSelected, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) { const prrByVaccineTableView = new PrrByVaccineTableView(prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName); Select2.initializeSelectElement( { @@ -13,15 +13,13 @@ class PageInitializer { textOfOption2Select: selectSymptom, onValueSelected: (id, text) => { prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text); - const url = new URL(window.location.href); - url.searchParams.set('symptom', text); - window.history.replaceState(null, "", url); + onSymptomSelected(text); }, minimumInputLength: 0 }); } - static #configureVaccine({ vaccineSelectElement, selectVaccine, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) { + static #configureVaccine({ vaccineSelectElement, selectVaccine, onVaccineSelected, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) { const prrBySymptomTableView = new PrrBySymptomTableView(prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName); Select2.initializeSelectElement( { @@ -29,9 +27,7 @@ class PageInitializer { textOfOption2Select: selectVaccine, onValueSelected: (id, text) => { prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id, text); - const url = new URL(window.location.href); - url.searchParams.set('vaccine', text); - window.history.replaceState(null, "", url); + onVaccineSelected(text); }, minimumInputLength: 0 }); diff --git a/docs/UIUtils.js b/docs/UIUtils.js index 6aae5dc2c68..530604b8159 100644 --- a/docs/UIUtils.js +++ b/docs/UIUtils.js @@ -38,6 +38,12 @@ class UIUtils { return UIUtils.getSearchParam(urlParams, searchParam, 'NO').toUpperCase() == 'YES'; } + static setSearchParamOfCurrentUrl(nameOfSearchParam, valueOfSearchParam) { + const url = new URL(window.location.href); + url.searchParams.set(nameOfSearchParam, valueOfSearchParam); + window.history.replaceState(null, "", url); + } + static downloadUrlAsFilename(url, filename) { const a = document.createElement('a'); a.setAttribute('href', url); From d8e63b2a7cb49f10f960a9685cd358f0c26191b5 Mon Sep 17 00:00:00 2001 From: Frank Knoll Date: Sun, 14 Jul 2024 01:33:27 +0200 Subject: [PATCH 08/13] refactoring --- docs/SymptomsCausedByDrugs/index.html | 5 ++--- docs/UIUtils.js | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/SymptomsCausedByDrugs/index.html b/docs/SymptomsCausedByDrugs/index.html index 30ef302ac64..0b45a9c37d4 100644 --- a/docs/SymptomsCausedByDrugs/index.html +++ b/docs/SymptomsCausedByDrugs/index.html @@ -40,13 +40,12 @@ document.addEventListener( "DOMContentLoaded", event => { - const urlSearchParams = new URLSearchParams(window.location.search); const name = 'Drug'; PageInitializer.initializePage( { symptom: { symptomSelectElement: $('#symptomSelect'), - selectSymptom: UIUtils.getSearchParam(urlSearchParams, 'symptom', null), + selectSymptom: UIUtils.getSearchParamOfCurrentUrl('symptom'), onSymptomSelected: symptom => UIUtils.setSearchParamOfCurrentUrl('symptom', symptom), prrByVaccineTableElement: $('#prrByVaccineTable'), downloadPrrByVaccineTableButton: document.querySelector("#downloadPrrByVaccineTable"), @@ -54,7 +53,7 @@ }, vaccine: { vaccineSelectElement: $('#vaccineSelect'), - selectVaccine: UIUtils.getSearchParam(urlSearchParams, 'vaccine', null), + selectVaccine: UIUtils.getSearchParamOfCurrentUrl('vaccine'), onVaccineSelected: vaccine => UIUtils.setSearchParamOfCurrentUrl('vaccine', vaccine), prrBySymptomTableElement: $('#prrBySymptomTable'), downloadPrrBySymptomTableButton: document.querySelector("#downloadPrrBySymptomTable"), diff --git a/docs/UIUtils.js b/docs/UIUtils.js index 530604b8159..d5b113f62a0 100644 --- a/docs/UIUtils.js +++ b/docs/UIUtils.js @@ -38,6 +38,11 @@ class UIUtils { return UIUtils.getSearchParam(urlParams, searchParam, 'NO').toUpperCase() == 'YES'; } + static getSearchParamOfCurrentUrl(searchParam) { + const urlSearchParams = new URLSearchParams(window.location.search); + return UIUtils.getSearchParam(urlSearchParams, searchParam, null) + } + static setSearchParamOfCurrentUrl(nameOfSearchParam, valueOfSearchParam) { const url = new URL(window.location.href); url.searchParams.set(nameOfSearchParam, valueOfSearchParam); From b1439497985be5d464f499c07cd57c90ed23848e Mon Sep 17 00:00:00 2001 From: Frank Knoll Date: Sun, 14 Jul 2024 01:41:55 +0200 Subject: [PATCH 09/13] refactoring --- docs/SymptomsCausedByDrugs/index.html | 11 +++++++---- docs/SymptomsCausedByDrugs/js/SearchParam.js | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 docs/SymptomsCausedByDrugs/js/SearchParam.js diff --git a/docs/SymptomsCausedByDrugs/index.html b/docs/SymptomsCausedByDrugs/index.html index 0b45a9c37d4..91ff432b899 100644 --- a/docs/SymptomsCausedByDrugs/index.html +++ b/docs/SymptomsCausedByDrugs/index.html @@ -35,26 +35,29 @@ + + @@ -42,22 +43,18 @@ "DOMContentLoaded", event => { const name = 'Drug'; - const symptomSearchParam = new SearchParam('symptom'); - const vaccineSearchParam = new SearchParam('vaccine'); PageInitializer.initializePage( { symptom: { symptomSelectElement: $('#symptomSelect'), - selectSymptom: symptomSearchParam.get(), - onSymptomSelected: symptom => symptomSearchParam.set(symptom), + searchParam: new SearchParam('symptom'), prrByVaccineTableElement: $('#prrByVaccineTable'), downloadPrrByVaccineTableButton: document.querySelector("#downloadPrrByVaccineTable"), keyColumnName: name }, vaccine: { vaccineSelectElement: $('#vaccineSelect'), - selectVaccine: vaccineSearchParam.get(), - onVaccineSelected: vaccine => vaccineSearchParam.set(vaccine), + searchParam: new SearchParam('vaccine'), prrBySymptomTableElement: $('#prrBySymptomTable'), downloadPrrBySymptomTableButton: document.querySelector("#downloadPrrBySymptomTable"), valueName: name diff --git a/docs/SymptomsCausedByDrugs/js/PageInitializer.js b/docs/SymptomsCausedByDrugs/js/PageInitializer.js index e4a1ee846a2..d5c094d6107 100644 --- a/docs/SymptomsCausedByDrugs/js/PageInitializer.js +++ b/docs/SymptomsCausedByDrugs/js/PageInitializer.js @@ -5,29 +5,29 @@ class PageInitializer { PageInitializer.#configureVaccine(vaccine); } - static #configureSymptom({ symptomSelectElement, selectSymptom, onSymptomSelected, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) { + static #configureSymptom({ symptomSelectElement, searchParam, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) { const prrByVaccineTableView = new PrrByVaccineTableView(prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName); Select2.initializeSelectElement( { selectElement: symptomSelectElement, - textOfOption2Select: selectSymptom, + textOfOption2Select: searchParam.get(), onValueSelected: (id, text) => { prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text); - onSymptomSelected(text); + searchParam.set(text); }, minimumInputLength: 0 }); } - static #configureVaccine({ vaccineSelectElement, selectVaccine, onVaccineSelected, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) { + static #configureVaccine({ vaccineSelectElement, searchParam, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) { const prrBySymptomTableView = new PrrBySymptomTableView(prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName); Select2.initializeSelectElement( { selectElement: vaccineSelectElement, - textOfOption2Select: selectVaccine, + textOfOption2Select: searchParam.get(), onValueSelected: (id, text) => { prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id, text); - onVaccineSelected(text); + searchParam.set(text); }, minimumInputLength: 0 }); diff --git a/docs/SymptomsCausedByDrugs/js/PrrByKeyTableView.js b/docs/SymptomsCausedByDrugs/js/PrrByKeyTableView.js index 715f8473e5d..378f5c30130 100644 --- a/docs/SymptomsCausedByDrugs/js/PrrByKeyTableView.js +++ b/docs/SymptomsCausedByDrugs/js/PrrByKeyTableView.js @@ -33,7 +33,7 @@ class PrrByKeyTableView { } #downloadPrrByKey() { - UIUtils.downloadUrlAsFilename( + UrlUtils.downloadUrlAsFilename( window.URL.createObjectURL( new Blob( [this.#prrByKeyTable.getDisplayedTableAsCsv(`# ${this.#valueName}: ${this.#text}`)], diff --git a/docs/SymptomsCausedByDrugs/js/SearchParam.js b/docs/SymptomsCausedByDrugs/js/SearchParam.js index 6c911f2f467..d22583d1bec 100644 --- a/docs/SymptomsCausedByDrugs/js/SearchParam.js +++ b/docs/SymptomsCausedByDrugs/js/SearchParam.js @@ -7,10 +7,10 @@ class SearchParam { } get() { - return UIUtils.getSearchParamOfCurrentUrl(this.#name); + return UrlUtils.getSearchParamOfCurrentUrl(this.#name); } set(value) { - UIUtils.setSearchParamOfCurrentUrl(this.#name, value); + UrlUtils.setSearchParamOfCurrentUrl(this.#name, value); } } \ No newline at end of file diff --git a/docs/SymptomsCausedByVaccines/index.html b/docs/SymptomsCausedByVaccines/index.html index a72065159ff..b318664b19b 100644 --- a/docs/SymptomsCausedByVaccines/index.html +++ b/docs/SymptomsCausedByVaccines/index.html @@ -26,6 +26,7 @@ + diff --git a/docs/UIUtils.js b/docs/UIUtils.js index d5b113f62a0..668fc8758d5 100644 --- a/docs/UIUtils.js +++ b/docs/UIUtils.js @@ -27,32 +27,4 @@ class UIUtils { static getSelectedOption(selectElement) { return selectElement.options[selectElement.selectedIndex]; } - - static getSearchParam(urlParams, searchParam, defaultValue) { - return urlParams.has(searchParam) ? - urlParams.get(searchParam) : - defaultValue; - } - - static isSearchParamYES(urlParams, searchParam) { - return UIUtils.getSearchParam(urlParams, searchParam, 'NO').toUpperCase() == 'YES'; - } - - static getSearchParamOfCurrentUrl(searchParam) { - const urlSearchParams = new URLSearchParams(window.location.search); - return UIUtils.getSearchParam(urlSearchParams, searchParam, null) - } - - static setSearchParamOfCurrentUrl(nameOfSearchParam, valueOfSearchParam) { - const url = new URL(window.location.href); - url.searchParams.set(nameOfSearchParam, valueOfSearchParam); - window.history.replaceState(null, "", url); - } - - static downloadUrlAsFilename(url, filename) { - const a = document.createElement('a'); - a.setAttribute('href', url); - a.setAttribute('download', filename); - a.click(); - } } diff --git a/docs/UrlUtils.js b/docs/UrlUtils.js new file mode 100644 index 00000000000..eb84b60ebab --- /dev/null +++ b/docs/UrlUtils.js @@ -0,0 +1,38 @@ +class UrlUtils { + + static isSearchParamYES(urlParams, searchParam) { + return UrlUtils.#getSearchParam(urlParams, searchParam, 'NO').toUpperCase() == 'YES'; + } + + static getSearchParamOfCurrentUrl(searchParam) { + return UrlUtils.#getSearchParam( + new URLSearchParams(window.location.search), + searchParam, + null) + } + + static setSearchParamOfCurrentUrl(nameOfSearchParam, valueOfSearchParam) { + UrlUtils.#setSearchParam( + new URL(window.location.href), + nameOfSearchParam, + valueOfSearchParam); + } + + static downloadUrlAsFilename(url, filename) { + const a = document.createElement('a'); + a.setAttribute('href', url); + a.setAttribute('download', filename); + a.click(); + } + + static #getSearchParam(urlParams, searchParam, defaultValue) { + return urlParams.has(searchParam) ? + urlParams.get(searchParam) : + defaultValue; + } + + static #setSearchParam(url, nameOfSearchParam, valueOfSearchParam) { + url.searchParams.set(nameOfSearchParam, valueOfSearchParam); + window.history.replaceState(null, "", url); + } +} diff --git a/docs/batchCodes.html b/docs/batchCodes.html index e11eeef01ce..59b4daf8988 100644 --- a/docs/batchCodes.html +++ b/docs/batchCodes.html @@ -30,6 +30,7 @@ + @@ -41,8 +42,8 @@ new BatchCodeTableInitializer().initialize( { batchCodeTableElement: $('#batchCodeTable'), - showCountriesColumn: UIUtils.isSearchParamYES(urlSearchParams, 'showCountriesColumn'), - showDataTablesFilter: UIUtils.isSearchParamYES(urlSearchParams, 'showDataTablesFilter'), + showCountriesColumn: UrlUtils.isSearchParamYES(urlSearchParams, 'showCountriesColumn'), + showDataTablesFilter: UrlUtils.isSearchParamYES(urlSearchParams, 'showDataTablesFilter'), }); }); From bddea07e2fa11ac8583f22dfbf60200eae3aa821 Mon Sep 17 00:00:00 2001 From: Frank Knoll Date: Sun, 14 Jul 2024 10:15:26 +0200 Subject: [PATCH 11/13] adding share button to VAERS Safety Signal --- docs/SymptomsCausedByVaccines/index.html | 4367 +++++++++++++++++++++- 1 file changed, 4236 insertions(+), 131 deletions(-) diff --git a/docs/SymptomsCausedByVaccines/index.html b/docs/SymptomsCausedByVaccines/index.html index b318664b19b..fe7cfd93672 100644 --- a/docs/SymptomsCausedByVaccines/index.html +++ b/docs/SymptomsCausedByVaccines/index.html @@ -1,41 +1,45 @@ + - - - - - -VAERS Safety Signal - - - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + -
-
- -
-
- - -
-
-
-
-

VAERS Safety Signal

- +
+
+
+
+
+

Worst Vaccines

+
+
+
+
+ + +
+ + + + + + + +
VaccineLower Confidence Limit of Proportional Reporting Ratio
+ +
+
+
+
+
+
+

Strongest Symptoms

+
+
+
+
+ + +
+ + + + + + + +
SymptomLower Confidence Limit of Proportional Reporting Ratio >= 2
+ +
+
+
+
+
+
+
+
+ + +
+

+ Data Source + +

+ +
+ + + + + + +
+ + + +
+ Fork me on GitHub - -
-
-
- - - - - - - - - - - - - - + +
+ +
+ + + + + + + + + + + + + + + \ No newline at end of file From a9d76d36fae6cad6bab8706406ba44bf94061eb4 Mon Sep 17 00:00:00 2001 From: Frank Knoll Date: Sun, 14 Jul 2024 10:16:08 +0200 Subject: [PATCH 12/13] adding share button to VAERS Safety Signal --- docs/SymptomsCausedByDrugs/index.html | 7 +++---- docs/SymptomsCausedByVaccines/index.html | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/SymptomsCausedByDrugs/index.html b/docs/SymptomsCausedByDrugs/index.html index 243d67e9e6b..44d9fec4064 100644 --- a/docs/SymptomsCausedByDrugs/index.html +++ b/docs/SymptomsCausedByDrugs/index.html @@ -7,7 +7,7 @@ - Eudra Safety Signal (All drugs) + EU Safety Signal (All drugs)