From b0ec2683bc4b01965b707c15b715384e0a68ad90 Mon Sep 17 00:00:00 2001 From: Frank Knoll Date: Wed, 24 Apr 2024 14:21:23 +0200 Subject: [PATCH] starting to add batch code heading --- docs/BatchCodeSelectInitializer.js | 21 +- docs/CompanyByBatchcodeProvider.js | 8 + docs/HowBadIsMyBatch.html | 9806 +++++++++++++++++++++++++++- 3 files changed, 9706 insertions(+), 129 deletions(-) create mode 100644 docs/CompanyByBatchcodeProvider.js diff --git a/docs/BatchCodeSelectInitializer.js b/docs/BatchCodeSelectInitializer.js index 3cc94f596eb..0090879e31d 100644 --- a/docs/BatchCodeSelectInitializer.js +++ b/docs/BatchCodeSelectInitializer.js @@ -1,15 +1,28 @@ class BatchCodeSelectInitializer { - static initialize({batchCodeSelectElement, batchCodeDetailsElement}) { + static initialize({ batchCodeSelectElement, batchCodeDetailsElement, batchCodeHeadingElement }) { const batchCodeDetailsView = new BatchCodeDetailsView(batchCodeDetailsElement); batchCodeSelectElement.select2({ minimumInputLength: 4 }); batchCodeSelectElement.on( 'select2:select', function (event) { - const batchcode = event.params.data.id; - batchCodeDetailsView.displayBatchCodeDetails(batchcode); - GoogleAnalytics.click_batchcode(batchcode); + BatchCodeSelectInitializer.#onBatchCodeSelected( + { + batchcode: event.params.data.id, + batchCodeHeadingElement: batchCodeHeadingElement, + batchCodeDetailsView: batchCodeDetailsView + }); }); batchCodeSelectElement.select2('open'); } + + static #onBatchCodeSelected({ batchcode, batchCodeHeadingElement, batchCodeDetailsView }) { + CompanyByBatchcodeProvider + .getCompany(batchcode) + .then(company => { + batchCodeHeadingElement.innerText = `Batch ${batchcode} (${company})`; + batchCodeDetailsView.displayBatchCodeDetails(batchcode); + GoogleAnalytics.click_batchcode(batchcode); + }); + } } diff --git a/docs/CompanyByBatchcodeProvider.js b/docs/CompanyByBatchcodeProvider.js new file mode 100644 index 00000000000..171de66a3f9 --- /dev/null +++ b/docs/CompanyByBatchcodeProvider.js @@ -0,0 +1,8 @@ +class CompanyByBatchcodeProvider { + + static getCompany(batchcode) { + return fetch(`data/histograms/Global/${batchcode}.json`) + .then(response => response.json()) + .then(histoDescrs => histoDescrs.Company); + } +} \ No newline at end of file diff --git a/docs/HowBadIsMyBatch.html b/docs/HowBadIsMyBatch.html index 418da473afa..8c3399b9b1f 100644 --- a/docs/HowBadIsMyBatch.html +++ b/docs/HowBadIsMyBatch.html @@ -1,150 +1,9706 @@ + - - - - - -How Bad is My Batch? - - - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - +batchCodeHeading + -
-
- -
-
- - -
-
-
-
-

How Bad is My Batch?

-
-
-
-

- Visit the main page How Bad is My Batch - -

-

- - -

-
-
-
-
-

Outcomes of Adverse Events

-
-
-
- -
-
-
-
-
-
-

Frequencies of Reported Symptoms

-
-
-
- - - - - - - -
SymptomFrequency
-
-
-
-
-
-
-
-
- - -
-
-
Data Source:
-
Vaccine Adverse Event +
+
+ +
+
+ + +
+
+
+
+

How Bad is My Batch?

+
+
+
+

+ Visit the main page How Bad is My Batch + +

+

+ + +

+
+
+

+
+
+
+
+
+
+
+

Outcomes of Adverse Events

+
+
+
+ +
+
+
+
+
+
+

Frequencies of Reported Symptoms

+
+
+
+ + + + + + + +
SymptomFrequency
+
+
+
+
+
+
+
+
+ + +
+
Visit also:
+
table of all batch codes +
+
Last updated:
+
April 05, 2024
+
+ Fork me on GitHub - -
-
-
- - - - - - - - - - - - - - + +
+ + + + + + + + + + + + + + + + + \ No newline at end of file