diff --git a/docs/SymptomsCausedByDrugs/index.html b/docs/SymptomsCausedByDrugs/index.html index 7d31bda102f..44d9fec4064 100644 --- a/docs/SymptomsCausedByDrugs/index.html +++ b/docs/SymptomsCausedByDrugs/index.html @@ -1,40 +1,44 @@ + - - - - - -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
+ +
+
+
+
+
+
+
+
+ + +
+

+ Data Source + +

+ +
+ + + + + + +
+ + + +
+ Fork me on GitHub - -
-
-
- - - - - - - - - - - - - - + +
+ +
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/SymptomsCausedByDrugs/js/PageInitializer.js b/docs/SymptomsCausedByDrugs/js/PageInitializer.js index 227533551db..7cb92e0faca 100644 --- a/docs/SymptomsCausedByDrugs/js/PageInitializer.js +++ b/docs/SymptomsCausedByDrugs/js/PageInitializer.js @@ -5,34 +5,31 @@ class PageInitializer { PageInitializer.#configureVaccine(vaccine); } - static #configureSymptom({ symptomSelectElement, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) { + static #configureSymptom({ symptomSelectElement, searchParam, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) { const prrByVaccineTableView = new PrrByVaccineTableView(prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName); - PageInitializer.#initializeSelectElement( + Select2.initializeSelectElement( { selectElement: symptomSelectElement, - onValueSelected: (id, text) => prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text), + textOfOption2Select: searchParam.get(), + onSelectOptionHavingValueAndText: (id, text) => { + prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text); + searchParam.set(text); + }, minimumInputLength: 0 }); } - static #configureVaccine({ vaccineSelectElement, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) { + static #configureVaccine({ vaccineSelectElement, searchParam, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) { const prrBySymptomTableView = new PrrBySymptomTableView(prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName); - PageInitializer.#initializeSelectElement( + Select2.initializeSelectElement( { selectElement: vaccineSelectElement, - onValueSelected: (id, text) => prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id ,text), + textOfOption2Select: searchParam.get(), + onSelectOptionHavingValueAndText: (id, text) => { + prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id, text); + searchParam.set(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/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 new file mode 100644 index 00000000000..d22583d1bec --- /dev/null +++ b/docs/SymptomsCausedByDrugs/js/SearchParam.js @@ -0,0 +1,16 @@ +class SearchParam { + + #name; + + constructor(name) { + this.#name = name; + } + + get() { + return UrlUtils.getSearchParamOfCurrentUrl(this.#name); + } + + set(value) { + UrlUtils.setSearchParamOfCurrentUrl(this.#name, value); + } +} \ No newline at end of file diff --git a/docs/SymptomsCausedByDrugs/js/Select2.js b/docs/SymptomsCausedByDrugs/js/Select2.js new file mode 100644 index 00000000000..8fc3b646b83 --- /dev/null +++ b/docs/SymptomsCausedByDrugs/js/Select2.js @@ -0,0 +1,50 @@ +class Select2 { + + static initializeSelectElement( + { + selectElement, + textOfOption2Select, + onSelectOptionHavingValueAndText, + minimumInputLength + }) { + selectElement.select2({ minimumInputLength: minimumInputLength }); + selectElement.on( + 'select2:select', + function (event) { + const id = event.params.data.id; + const text = event.params.data.text; + onSelectOptionHavingValueAndText(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/index.html b/docs/SymptomsCausedByVaccines/index.html index a72065159ff..8e04a87d067 100644 --- a/docs/SymptomsCausedByVaccines/index.html +++ b/docs/SymptomsCausedByVaccines/index.html @@ -1,40 +1,44 @@ + - - - - - -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 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 @@ - - - - - - - - + + + + + + + + diff --git a/docs/UIUtils.js b/docs/UIUtils.js index 4b939b18526..668fc8758d5 100644 --- a/docs/UIUtils.js +++ b/docs/UIUtils.js @@ -20,75 +20,11 @@ class UIUtils { return document.getElementById(templateId).content.firstElementChild.cloneNode(true); } - static createCanvas() { - return UIUtils.instantiateTemplate('template-canvas'); - } - static clear(container) { container.replaceChildren(); } - static createChartViewElementWithHeading(heading) { - const chartViewElement = UIUtils.instantiateTemplate('template-ChartView'); - chartViewElement.querySelector(".heading").textContent = heading; - return { - chartViewElement: chartViewElement, - canvas: chartViewElement.querySelector(".canvas") - }; - } - static getSelectedOption(selectElement) { return selectElement.options[selectElement.selectedIndex]; } - - static getYLabelWithPercent(context) { - return UIUtils.#getLabelWithPercent(context, context.parsed.y); - } - - static getXLabelWithPercent(context) { - return UIUtils.#getLabelWithPercent(context, context.parsed.x); - } - - static #getLabelWithPercent(context, value) { - let label = context.dataset.label || ''; - - if (label) { - label += ': '; - } - if (value !== null) { - label += value.toFixed(1) + "%"; - } - return label; - } - - static getPercentageScale(label) { - return { - min: 0, - max: 100, - title: { - display: true, - text: label - }, - ticks: { - callback: value => value + "%" - } - } - } - - 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 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 97d3f55bf77..59b4daf8988 100644 --- a/docs/batchCodes.html +++ b/docs/batchCodes.html @@ -1,88 +1,95 @@ + - - -Batch Codes of Coronavirus 2019 Vaccines - - - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + -

Batch Codes of Coronavirus 2019 Vaccines

- - - - - - - - - - - - - - - -
BatchAdverse Reaction ReportsDeathsDisabilitiesLife-Threatening IllnessesHospitalizationsCompanySevere reportsLethalityCountries
- - - +
+ + + \ No newline at end of file