From e87a5e28309aa932eecb4068aeb761f421016065 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Thu, 22 Sep 2022 11:23:09 +0200 Subject: [PATCH 01/13] added backend changes for vaccination data --- caimira/apps/calculator/model_generator.py | 32 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/caimira/apps/calculator/model_generator.py b/caimira/apps/calculator/model_generator.py index 4896e485..41cc4d07 100644 --- a/caimira/apps/calculator/model_generator.py +++ b/caimira/apps/calculator/model_generator.py @@ -72,6 +72,10 @@ class FormData: room_volume: float simulation_name: str total_people: int + vaccine_option: bool + vaccine_booster_option: bool + vaccine_type: str + vaccine_booster_type: str ventilation_type: str virus_type: str volume_type: str @@ -133,6 +137,10 @@ class FormData: 'room_volume': 0., 'simulation_name': _NO_DEFAULT, 'total_people': _NO_DEFAULT, + 'vaccine_option': False, + 'vaccine_booster_option': False, + 'vaccine_type': _NO_DEFAULT, + 'vaccine_booster_type': _NO_DEFAULT, 'ventilation_type': 'no_ventilation', 'virus_type': 'SARS_CoV_2', 'volume_type': _NO_DEFAULT, @@ -270,8 +278,9 @@ class FormData: ('window_opening_regime', WINDOWS_OPENING_REGIMES), ('window_type', WINDOWS_TYPES), ('event_month', MONTH_NAMES), - ('ascertainment_bias', CONFIDENCE_LEVEL_OPTIONS),] - + ('ascertainment_bias', CONFIDENCE_LEVEL_OPTIONS), + ('vaccine_type', VACCINE_OPTIONS), + ('vaccine_booster_type', VACCINE_BOOSTER_OPTIONS),] for attr_name, valid_set in validation_tuples: if getattr(self, attr_name) not in valid_set: raise ValueError(f"{getattr(self, attr_name)} is not a valid value for {attr_name}") @@ -517,7 +526,7 @@ class FormData: mask=self.mask(), activity=activity, expiration=expiration, - host_immunity=0., + host_immunity=0., # Vaccination status does not affect the infected population (for now) ) return infected @@ -545,12 +554,20 @@ class FormData: # minus the number of infected occupants. exposed_occupants = self.total_people - infected_occupants + if self.vaccine_option == False: + HI = 0.0 + else: + if self.vaccine_booster_option == False: + HI = data.vaccine_host_immunity[self.vaccine_type] + else: + HI = data.vaccine_booster_host_immunity[self.vaccine_booster_type] + exposed = mc.Population( number=exposed_occupants, presence=self.exposed_present_interval(), activity=activity, mask=self.mask(), - host_immunity=0., + host_immunity=HI, ) return exposed @@ -790,6 +807,10 @@ def baseline_raw_form_data() -> typing.Dict[str, typing.Union[str, float]]: 'room_volume': '75', 'simulation_name': 'Test', 'total_people': '10', + 'vaccine_option': '', + 'vaccine_booster_option': '', + 'vaccine_type': '', + 'vaccine_booster_type': '', 'ventilation_type': 'natural_ventilation', 'virus_type': 'SARS_CoV_2', 'volume_type': 'room_volume_explicit', @@ -814,6 +835,9 @@ VIRUS_TYPES = {'SARS_CoV_2', 'SARS_CoV_2_ALPHA', 'SARS_CoV_2_BETA','SARS_CoV_2_G VOLUME_TYPES = {'room_volume_explicit', 'room_volume_from_dimensions'} WINDOWS_OPENING_REGIMES = {'windows_open_permanently', 'windows_open_periodically', 'not-applicable'} WINDOWS_TYPES = {'window_sliding', 'window_hinged', 'not-applicable'} +VACCINE_OPTIONS = {'janssen', 'any_mRNA', 'astraZeneca', 'astraZeneca_mRNA', 'astraZeneca_mRNA_pfizer', 'beijingCNBG', 'pfizer', + 'pfizer_moderna', 'sinovac', 'sinovac_astraZeneca', 'covishield', 'moderna', 'gamaleya', 'sinovac_pfizer'} +VACCINE_BOOSTER_OPTIONS = {'booster_janssen', 'booster_astraZeneca', 'booster_pfizer', 'booster_pfizer_moderna', 'booster_sinovac', 'booster_moderna'} COFFEE_OPTIONS_INT = {'coffee_break_0': 0, 'coffee_break_1': 1, 'coffee_break_2': 2, 'coffee_break_4': 4} CONFIDENCE_LEVEL_OPTIONS = {'confidence_low': 10, 'confidence_medium': 5, 'confidence_high': 2} MONTH_NAMES = [ From b2d6a308a591b57790290be9131bc817ed19125f Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Thu, 22 Sep 2022 11:24:36 +0200 Subject: [PATCH 02/13] added vaccine effectiveness data to __init__.py in data folder --- caimira/data/__init__.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/caimira/data/__init__.py b/caimira/data/__init__.py index 23dab962..b244a17b 100644 --- a/caimira/data/__init__.py +++ b/caimira/data/__init__.py @@ -40,3 +40,32 @@ GenevaTemperatures = { month: GenevaTemperatures_hourly[month].refine(refine_factor=10) for month, temperatures in local_hourly_temperatures_celsius_per_hour.items() } + + +# From data available in Results of COVID-19 Vaccine Effectiveness +# Studies: An Ongoing Systematic Review - Updated September 8, 2022. +# https://view-hub.org/resources +vaccine_host_immunity = { + 'janssen': 0.551277778, + 'any_mRNA': 0.93875, + 'astraZeneca': 0.55921875, + 'astraZeneca_mRNA': 0.718571429, + 'astraZeneca_mRNA_pfizer': 0.7865, + 'beijingCNBG': 0.4325, + 'pfizer': 0.62503012, + 'pfizer_moderna': 0.567126761, + 'sinovac': 0.286884615, + 'sinovac_astraZeneca': 0.561333333, + 'covishield': 0.98, + 'moderna': 0.683255814, + 'gamaleya': 0.696, + 'sinovac_pfizer': 0.7965, + } +vaccine_booster_host_immunity = { + 'booster_janssen': 0.492666667, + 'booster_astraZeneca': 0.672166667, + 'booster_pfizer': 0.612971831, + 'booster_pfizer_moderna': 0.645, + 'booster_sinovac': 0.427857143, + 'booster_moderna': 0.632442105, +} \ No newline at end of file From 4dee41a41e85e08ad2ba8450c92edec0c10280ea Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Thu, 22 Sep 2022 11:25:06 +0200 Subject: [PATCH 03/13] Added UI input field for vaccination (primary and booster) --- caimira/apps/calculator/static/js/form.js | 34 ++++++++++ .../templates/base/calculator.form.html.j2 | 66 +++++++++++++++++-- 2 files changed, 96 insertions(+), 4 deletions(-) diff --git a/caimira/apps/calculator/static/js/form.js b/caimira/apps/calculator/static/js/form.js index 6ed6c0b3..439daef7 100644 --- a/caimira/apps/calculator/static/js/form.js +++ b/caimira/apps/calculator/static/js/form.js @@ -328,6 +328,28 @@ function on_wearing_mask_change() { }) } +function on_vaccination_change() { + vaccination_option = $('input[type=radio][name=vaccine_option]'); + vaccination_option.each(function (index) { + if (this.checked) { + getChildElement($(this)).show(); + require_fields(this); + } + else { + getChildElement($(this)).hide(); + require_fields(this); + } + }) +} + +function on_vaccination_booster_change() { + vaccination_booster_option = $('input[type=radio][name=vaccine_booster_option]'); + vaccination_booster_option.each(function (index) { + if (this.checked) getChildElement($(this)).show(); + else getChildElement($(this)).hide(); + }) +} + function populate_temp_hum_values(data, index) { $("#sensor_temperature").text(Math.round(data[index].Details.T) + '°C'); $("#sensor_humidity").text(Math.round(data[index].Details.RH) + '%'); @@ -931,6 +953,18 @@ $(document).ready(function () { // Call the function now to handle forward/back button presses in the browser. on_wearing_mask_change(); + // When the vaccinated_option_option changes we want to make its respective + // children show/hide. + $("input[type=radio][name=vaccine_option]").change(on_vaccination_change); + // Call the function now to handle forward/back button presses in the browser. + on_vaccination_change(); + + // When the vaccinated_booster_option changes we want to make its respective + // children show/hide. + $("input[type=radio][name=vaccine_booster_option]").change(on_vaccination_booster_change); + // Call the function now to handle forward/back button presses in the browser. + on_vaccination_booster_change(); + // When the short_range_option changes we want to make its respective // children show/hide. $("input[type=radio][name=short_range_option]").change(on_short_range_option_change); diff --git a/caimira/apps/templates/base/calculator.form.html.j2 b/caimira/apps/templates/base/calculator.form.html.j2 index 665527f6..bc8ac04f 100644 --- a/caimira/apps/templates/base/calculator.form.html.j2 +++ b/caimira/apps/templates/base/calculator.form.html.j2 @@ -359,6 +359,67 @@ +
+
Vaccinated? 💉
+
+ + + + +
+
+ + +
@@ -381,7 +442,6 @@
-
Exposed person(s) presence:
@@ -427,7 +487,7 @@

The use of masks mitigates exposure at short-range. The analytical model with short-range interactions does not take mask wearing into account.

-
+

0 short-range interactions.

@@ -604,8 +664,6 @@
Coffee breaks are spread evenly throughout the day.
- -

From 4ab95fcfaa11456608b7201c119355ac9ae46eee Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Thu, 22 Sep 2022 11:37:31 +0200 Subject: [PATCH 04/13] added default values for vaccine types on tests --- caimira/apps/calculator/model_generator.py | 23 ++-- caimira/apps/calculator/report_generator.py | 5 + caimira/apps/calculator/static/js/form.js | 32 +++++- .../templates/base/calculator.form.html.j2 | 104 ++++++++++++------ .../templates/base/calculator.report.html.j2 | 15 +++ caimira/data/__init__.py | 86 +++++++++++---- 6 files changed, 190 insertions(+), 75 deletions(-) diff --git a/caimira/apps/calculator/model_generator.py b/caimira/apps/calculator/model_generator.py index 41cc4d07..fe062b0f 100644 --- a/caimira/apps/calculator/model_generator.py +++ b/caimira/apps/calculator/model_generator.py @@ -554,20 +554,22 @@ class FormData: # minus the number of infected occupants. exposed_occupants = self.total_people - infected_occupants - if self.vaccine_option == False: - HI = 0.0 - else: - if self.vaccine_booster_option == False: - HI = data.vaccine_host_immunity[self.vaccine_type] + if (self.vaccine_option): + if (self.vaccine_booster_option and self.vaccine_booster_type != 'Other'): + host_immunity = [vaccine['VE'] for vaccine in data.vaccine_booster_host_immunity if + vaccine['primary series vaccine'] == self.vaccine_type and + vaccine['booster vaccine'] == self.vaccine_booster_type][0] else: - HI = data.vaccine_booster_host_immunity[self.vaccine_booster_type] + host_immunity = data.vaccine_primary_host_immunity[self.vaccine_type] + else: + host_immunity = 0. exposed = mc.Population( number=exposed_occupants, presence=self.exposed_present_interval(), activity=activity, mask=self.mask(), - host_immunity=HI, + host_immunity=host_immunity, ) return exposed @@ -809,8 +811,8 @@ def baseline_raw_form_data() -> typing.Dict[str, typing.Union[str, float]]: 'total_people': '10', 'vaccine_option': '', 'vaccine_booster_option': '', - 'vaccine_type': '', - 'vaccine_booster_type': '', + 'vaccine_type': 'Ad26.COV2.S (Janssen)', + 'vaccine_booster_type': 'AZD1222 (AstraZeneca)', 'ventilation_type': 'natural_ventilation', 'virus_type': 'SARS_CoV_2', 'volume_type': 'room_volume_explicit', @@ -835,9 +837,6 @@ VIRUS_TYPES = {'SARS_CoV_2', 'SARS_CoV_2_ALPHA', 'SARS_CoV_2_BETA','SARS_CoV_2_G VOLUME_TYPES = {'room_volume_explicit', 'room_volume_from_dimensions'} WINDOWS_OPENING_REGIMES = {'windows_open_permanently', 'windows_open_periodically', 'not-applicable'} WINDOWS_TYPES = {'window_sliding', 'window_hinged', 'not-applicable'} -VACCINE_OPTIONS = {'janssen', 'any_mRNA', 'astraZeneca', 'astraZeneca_mRNA', 'astraZeneca_mRNA_pfizer', 'beijingCNBG', 'pfizer', - 'pfizer_moderna', 'sinovac', 'sinovac_astraZeneca', 'covishield', 'moderna', 'gamaleya', 'sinovac_pfizer'} -VACCINE_BOOSTER_OPTIONS = {'booster_janssen', 'booster_astraZeneca', 'booster_pfizer', 'booster_pfizer_moderna', 'booster_sinovac', 'booster_moderna'} COFFEE_OPTIONS_INT = {'coffee_break_0': 0, 'coffee_break_1': 1, 'coffee_break_2': 2, 'coffee_break_4': 4} CONFIDENCE_LEVEL_OPTIONS = {'confidence_low': 10, 'confidence_medium': 5, 'confidence_high': 2} MONTH_NAMES = [ diff --git a/caimira/apps/calculator/report_generator.py b/caimira/apps/calculator/report_generator.py index b2d5ff25..456a64be 100644 --- a/caimira/apps/calculator/report_generator.py +++ b/caimira/apps/calculator/report_generator.py @@ -214,6 +214,10 @@ def readable_minutes(minutes: int) -> str: return time_str + unit +def percentage(absolute: float) -> float: + return absolute * 100 + + def non_zero_percentage(percentage: int) -> str: if percentage < 0.01: return "<0.01%" @@ -389,6 +393,7 @@ class ReportGenerator: env.filters['minutes_to_time'] = minutes_to_time env.filters['float_format'] = "{0:.2f}".format env.filters['int_format'] = "{:0.0f}".format + env.filters['percentage'] = percentage env.filters['JSONify'] = json.dumps return env diff --git a/caimira/apps/calculator/static/js/form.js b/caimira/apps/calculator/static/js/form.js index 439daef7..5ce28dd1 100644 --- a/caimira/apps/calculator/static/js/form.js +++ b/caimira/apps/calculator/static/js/form.js @@ -328,7 +328,22 @@ function on_wearing_mask_change() { }) } -function on_vaccination_change() { +function update_booster_warning() { + // Check if "Other" is selected + $("#vaccine_booster_type").find(":selected").val() == "Other" ? $("#booster_warning").show() : $("#booster_warning").hide(); +} + +function update_booster_dropdown(url) { + let primary_vaccine_option = $("#vaccine_type").find(":selected").val(); + $($("#vaccine_booster_type > option").get().reverse()).each(function() { + if ($(this).attr('data-primary-vaccine') != primary_vaccine_option && $(this).val() != "Other") $(this).hide(); + else $(this).show().prop('selected', true); + }); + if (url.searchParams.has('vaccine_booster_type')) $("#vaccine_booster_type").val(url.searchParams.get('vaccine_booster_type')); + update_booster_warning(); +} + +function on_vaccination_change(url) { vaccination_option = $('input[type=radio][name=vaccine_option]'); vaccination_option.each(function (index) { if (this.checked) { @@ -339,7 +354,8 @@ function on_vaccination_change() { getChildElement($(this)).hide(); require_fields(this); } - }) + }); + update_booster_dropdown(url); } function on_vaccination_booster_change() { @@ -347,7 +363,7 @@ function on_vaccination_booster_change() { vaccination_booster_option.each(function (index) { if (this.checked) getChildElement($(this)).show(); else getChildElement($(this)).hide(); - }) + }); } function populate_temp_hum_values(data, index) { @@ -840,6 +856,7 @@ window.onpagehide = function(){ $(document).ready(function () { var url = new URL(decodeURIComponent(window.location.href)); //Pre-fill form with known values + url.searchParams.forEach((value, name) => { //If element exists if(document.getElementsByName(name).length > 0) { @@ -955,9 +972,14 @@ $(document).ready(function () { // When the vaccinated_option_option changes we want to make its respective // children show/hide. - $("input[type=radio][name=vaccine_option]").change(on_vaccination_change); + $("input[type=radio][name=vaccine_option]").change(() => on_vaccination_change(url)); // Call the function now to handle forward/back button presses in the browser. - on_vaccination_change(); + on_vaccination_change(url); + + // When the vaccine_type dropdown selected option changes we want to update + // the booster vaccine dropdown. + $("#vaccine_type").change(() => update_booster_dropdown(url)); + $("#vaccine_booster_type").change(update_booster_warning); // When the vaccinated_booster_option changes we want to make its respective // children show/hide. diff --git a/caimira/apps/templates/base/calculator.form.html.j2 b/caimira/apps/templates/base/calculator.form.html.j2 index bc8ac04f..1723e7d8 100644 --- a/caimira/apps/templates/base/calculator.form.html.j2 +++ b/caimira/apps/templates/base/calculator.form.html.j2 @@ -368,55 +368,91 @@
- - + {% if form.vaccine_option %} +
+
+
Vaccination data:
+
+
    +
  • Primary vaccine: {{ form.vaccine_type | replace("_", " ") }} + {% if form.vaccine_booster_option %} +
  • Booster vaccine: {{ form.vaccine_booster_type | replace("_", " ")}}
  • + {% endif %} +
  • Vaccine effectiveness: {{ model.exposed.host_immunity | percentage | non_zero_percentage }}
  • +
+
+
+ {% endif %}
Ventilation data:
diff --git a/caimira/data/__init__.py b/caimira/data/__init__.py index b244a17b..7ca7fb70 100644 --- a/caimira/data/__init__.py +++ b/caimira/data/__init__.py @@ -42,30 +42,68 @@ GenevaTemperatures = { } +# ------- VACCINATION DATA ------- + # From data available in Results of COVID-19 Vaccine Effectiveness # Studies: An Ongoing Systematic Review - Updated September 8, 2022. # https://view-hub.org/resources -vaccine_host_immunity = { - 'janssen': 0.551277778, - 'any_mRNA': 0.93875, - 'astraZeneca': 0.55921875, - 'astraZeneca_mRNA': 0.718571429, - 'astraZeneca_mRNA_pfizer': 0.7865, - 'beijingCNBG': 0.4325, - 'pfizer': 0.62503012, - 'pfizer_moderna': 0.567126761, - 'sinovac': 0.286884615, - 'sinovac_astraZeneca': 0.561333333, - 'covishield': 0.98, - 'moderna': 0.683255814, - 'gamaleya': 0.696, - 'sinovac_pfizer': 0.7965, - } -vaccine_booster_host_immunity = { - 'booster_janssen': 0.492666667, - 'booster_astraZeneca': 0.672166667, - 'booster_pfizer': 0.612971831, - 'booster_pfizer_moderna': 0.645, - 'booster_sinovac': 0.427857143, - 'booster_moderna': 0.632442105, -} \ No newline at end of file +vaccine_primary_host_immunity = { + 'Ad26.COV2.S_(Janssen)': 0.551277778, + 'Any_mRNA_-_heterologous': 0.93875, + 'AZD1222_(AstraZeneca)': 0.55921875, + 'AZD1222_(AstraZeneca)_and_any_mRNA_-_heterologous': 0.718571429, + 'AZD1222_(AstraZeneca)_and_BNT162b2_(Pfizer)': 0.7865, + 'BBIBP-CorV_(Beijing_CNBG)': 0.4325, + 'BNT162b2_(Pfizer)': 0.62503012, + 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)': 0.567126761, + 'CoronaVac_(Sinovac)': 0.286884615, + 'CoronaVac_(Sinovac)_and_AZD1222_(AstraZeneca)': 0.561333333, + 'Covishield': 0.98, + 'mRNA-1273_(Moderna)': 0.683255814, + 'Sputnik_V_(Gamaleya)': 0.696, + 'CoronaVac_(Sinovac)_and_BNT162b2_(Pfizer)': 0.7965, +} + +vaccine_booster_host_immunity = [ + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'AZD1222_(AstraZeneca)', 'VE': 0.6353636363636364}, + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.7389019607843137}, + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', 'VE': 0.26}, + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.3846666666666667}, + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'Sinopharm', 'VE': 0.7346666666666666}, + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.8642399999999999}, + {'primary series vaccine': 'Ad26.COV2.S_(Janssen)', 'booster vaccine': 'Ad26.COV2.S_(Janssen)', 'VE': 0.615}, + {'primary series vaccine': 'Ad26.COV2.S_(Janssen)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.9155000000000001}, + {'primary series vaccine': 'Ad26.COV2.S_(Janssen)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.6725}, + {'primary series vaccine': 'BBIBP-CorV_(Beijing_CNBG)', 'booster vaccine': 'Ad26.COV2.S_(Janssen)', 'VE': 0.8973333333333333}, + {'primary series vaccine': 'BBIBP-CorV_(Beijing_CNBG)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.9283333333333332}, + {'primary series vaccine': 'BBIBP-CorV_(Beijing_CNBG)', 'booster vaccine': 'Sinopharm', 'VE': 0.7639999999999999}, + {'primary series vaccine': 'BBIBP-CorV_(Beijing_CNBG)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.9526666666666667}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'AZD1222_(AstraZeneca)', 'VE': 0.8960000000000001}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'Ad26.COV2.S_(Janssen)', 'VE': 0.9306666666666666}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.7413183520599251}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.6004285714285714}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'CoronaVac_(Sinovac)', 'VE': 0.121}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'Sinopharm', 'VE': 0.6683333333333333}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.7530214285714285}, + {'primary series vaccine': 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', 'VE': 0.645}, + {'primary series vaccine': 'BNT162b2_(Pfizer)_(2_doses)_+_mRNA-1273_(Moderna)_(3rd_dose)', 'booster vaccine': 'mRNA-1273_(Moderna)_(4th_dose)', 'VE': 0.6466666666666667}, + {'primary series vaccine': 'BNT162b2_(Pfizer)_(3_doses)', 'booster vaccine': 'BNT162b2_(Pfizer)_(4th_dose)', 'VE': 0.6068333333333333}, + {'primary series vaccine': 'BNT162b2_(Pfizer)_(3_doses)', 'booster vaccine': 'mRNA-1273_(Moderna)_(4th_dose)', 'VE': 0.498}, + {'primary series vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.7564285714285713}, + {'primary series vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.7541721854304636}, + {'primary series vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.7538571428571429}, + {'primary series vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)_(3_doses)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)_(4th_dose)', 'VE': 0.5788888888888889}, + {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'AZD1222_(AstraZeneca)', 'VE': 0.9584285714285714}, + {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.7631960784313726}, + {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'CoronaVac_(Sinovac)', 'VE': 0.7141851851851851}, + {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'Coronavac_(Sinovac)', 'VE': 0.5107647058823529}, + {'primary series vaccine': 'Sputnik_V_(Gamaleya)', 'booster vaccine': 'Ad26.COV2.S_(Janssen)', 'VE': 0.8076666666666666}, + {'primary series vaccine': 'Sputnik_V_(Gamaleya)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.936}, + {'primary series vaccine': 'Sputnik_V_(Gamaleya)', 'booster vaccine': 'Sinopharm', 'VE': 0.5285}, + {'primary series vaccine': 'Sputnik_V_(Gamaleya)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.9366666666666668}, + {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'Ad26.COV2.S_(Janssen)', 'VE': 0.8873333333333333}, + {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.8068636363636363}, + {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.5692499999999999}, + {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'Sinopharm', 'VE': 0.7739999999999999}, + {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.7141650485436892}, + {'primary series vaccine': 'mRNA-1273_(Moderna)_(3_doses)', 'booster vaccine': 'mRNA-1273_(Moderna)_(4th_dose)', 'VE': 0.7066666666666667}] \ No newline at end of file From 65afb91b6126fbf64496488b98f77c0e9cb7a352 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Tue, 27 Sep 2022 18:10:07 +0200 Subject: [PATCH 05/13] handled display errors --- caimira/apps/calculator/static/js/form.js | 19 ++++++++++++++----- .../templates/base/calculator.form.html.j2 | 6 +++--- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/caimira/apps/calculator/static/js/form.js b/caimira/apps/calculator/static/js/form.js index 5ce28dd1..68b08f4e 100644 --- a/caimira/apps/calculator/static/js/form.js +++ b/caimira/apps/calculator/static/js/form.js @@ -336,10 +336,15 @@ function update_booster_warning() { function update_booster_dropdown(url) { let primary_vaccine_option = $("#vaccine_type").find(":selected").val(); $($("#vaccine_booster_type > option").get().reverse()).each(function() { - if ($(this).attr('data-primary-vaccine') != primary_vaccine_option && $(this).val() != "Other") $(this).hide(); - else $(this).show().prop('selected', true); + if ($(this).attr('data-primary-vaccine') != primary_vaccine_option && $(this).attr('data-primary-vaccine') != "Other") $(this).hide(); + else { + $(this).show(); + if (url.searchParams.has('vaccine_type')) { + if (url.searchParams.get('vaccine_type') != primary_vaccine_option) $(this).prop('selected', true); // Select first of the list if not from the URL + } + else $(this).prop('selected', true); + } }); - if (url.searchParams.has('vaccine_booster_type')) $("#vaccine_booster_type").val(url.searchParams.get('vaccine_booster_type')); update_booster_warning(); } @@ -891,8 +896,8 @@ $(document).ready(function () { $("#sr_interactions").text(index - 1); } - else if (name == 'sensor_in_use') { - // TODO - Validate if sensor exists + else if (name == 'sensor_in_use' || name == 'vaccine_booster_type') { + // Validation after } //Ignore 0 (default) values from server side @@ -903,6 +908,10 @@ $(document).ready(function () { } }); + let primary_vaccine = url.searchParams.has('vaccine_type') ? url.searchParams.get('vaccine_type') : null; + let booster_vaccine = url.searchParams.has('vaccine_booster_type') ? url.searchParams.get('vaccine_booster_type') : null; + $(`#vaccine_booster_type > option[data-primary-vaccine="${primary_vaccine}"][value="${booster_vaccine}"]`).attr('selected', true); + // Handle default URL values if they are not explicitly defined. if (Array.from(url.searchParams).length > 0) { if (!url.searchParams.has('location_name')) { diff --git a/caimira/apps/templates/base/calculator.form.html.j2 b/caimira/apps/templates/base/calculator.form.html.j2 index 1723e7d8..215eef2d 100644 --- a/caimira/apps/templates/base/calculator.form.html.j2 +++ b/caimira/apps/templates/base/calculator.form.html.j2 @@ -408,8 +408,8 @@
From 34f32006f46c60a4567c19aa8bc997cb94e57448 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Wed, 28 Sep 2022 16:36:09 +0200 Subject: [PATCH 06/13] added primary and booster vaccine input tuple validation --- caimira/apps/calculator/model_generator.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/caimira/apps/calculator/model_generator.py b/caimira/apps/calculator/model_generator.py index fe062b0f..16f76d7e 100644 --- a/caimira/apps/calculator/model_generator.py +++ b/caimira/apps/calculator/model_generator.py @@ -279,8 +279,8 @@ class FormData: ('window_type', WINDOWS_TYPES), ('event_month', MONTH_NAMES), ('ascertainment_bias', CONFIDENCE_LEVEL_OPTIONS), - ('vaccine_type', VACCINE_OPTIONS), - ('vaccine_booster_type', VACCINE_BOOSTER_OPTIONS),] + ('vaccine_type', VACCINE_TYPE), + ('vaccine_booster_type', VACCINE_BOOSTER_TYPE),] for attr_name, valid_set in validation_tuples: if getattr(self, attr_name) not in valid_set: raise ValueError(f"{getattr(self, attr_name)} is not a valid value for {attr_name}") @@ -811,8 +811,8 @@ def baseline_raw_form_data() -> typing.Dict[str, typing.Union[str, float]]: 'total_people': '10', 'vaccine_option': '', 'vaccine_booster_option': '', - 'vaccine_type': 'Ad26.COV2.S (Janssen)', - 'vaccine_booster_type': 'AZD1222 (AstraZeneca)', + 'vaccine_type': 'Ad26.COV2.S_(Janssen)', + 'vaccine_booster_type': 'AZD1222_(AstraZeneca)', 'ventilation_type': 'natural_ventilation', 'virus_type': 'SARS_CoV_2', 'volume_type': 'room_volume_explicit', @@ -843,7 +843,12 @@ MONTH_NAMES = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ] - +VACCINE_TYPE = ['Ad26.COV2.S_(Janssen)', 'Any_mRNA_-_heterologous', 'AZD1222_(AstraZeneca)', 'AZD1222_(AstraZeneca)_and_any_mRNA_-_heterologous', 'AZD1222_(AstraZeneca)_and_BNT162b2_(Pfizer)', + 'BBIBP-CorV_(Beijing_CNBG)', 'BNT162b2_(Pfizer)', 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', 'CoronaVac_(Sinovac)', 'CoronaVac_(Sinovac)_and_AZD1222_(AstraZeneca)', 'Covishield', + 'mRNA-1273_(Moderna)', 'Sputnik_V_(Gamaleya)', 'CoronaVac_(Sinovac)_and_BNT162b2_(Pfizer)'] +VACCINE_BOOSTER_TYPE = ['AZD1222_(AstraZeneca)', 'Ad26.COV2.S_(Janssen)', 'BNT162b2_(Pfizer)', 'BNT162b2_(Pfizer)_(4th_dose)', 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', + 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)_(4th_dose)', 'CoronaVac_(Sinovac)', 'Coronavac_(Sinovac)', 'Sinopharm', + 'mRNA-1273_(Moderna)', 'mRNA-1273_(Moderna)_(4th_dose)', 'Other'] def _hours2timestring(hours: float): # Convert times like 14.5 to strings, like "14:30" From 01c2454e0d55bb9d64612cca67bcd15bbd3dd5e6 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Mon, 3 Oct 2022 11:12:56 +0100 Subject: [PATCH 07/13] new vaccination data with VE < 0 as 0 and " or " entries counting on both vaccines --- .../templates/base/calculator.form.html.j2 | 75 ++++++--------- caimira/data/__init__.py | 91 +++++++------------ 2 files changed, 62 insertions(+), 104 deletions(-) diff --git a/caimira/apps/templates/base/calculator.form.html.j2 b/caimira/apps/templates/base/calculator.form.html.j2 index 215eef2d..298735bb 100644 --- a/caimira/apps/templates/base/calculator.form.html.j2 +++ b/caimira/apps/templates/base/calculator.form.html.j2 @@ -374,19 +374,21 @@
@@ -406,48 +408,25 @@
diff --git a/caimira/data/__init__.py b/caimira/data/__init__.py index 7ca7fb70..7ed3a76b 100644 --- a/caimira/data/__init__.py +++ b/caimira/data/__init__.py @@ -48,62 +48,41 @@ GenevaTemperatures = { # Studies: An Ongoing Systematic Review - Updated September 8, 2022. # https://view-hub.org/resources vaccine_primary_host_immunity = { - 'Ad26.COV2.S_(Janssen)': 0.551277778, - 'Any_mRNA_-_heterologous': 0.93875, - 'AZD1222_(AstraZeneca)': 0.55921875, - 'AZD1222_(AstraZeneca)_and_any_mRNA_-_heterologous': 0.718571429, - 'AZD1222_(AstraZeneca)_and_BNT162b2_(Pfizer)': 0.7865, - 'BBIBP-CorV_(Beijing_CNBG)': 0.4325, - 'BNT162b2_(Pfizer)': 0.62503012, - 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)': 0.567126761, - 'CoronaVac_(Sinovac)': 0.286884615, - 'CoronaVac_(Sinovac)_and_AZD1222_(AstraZeneca)': 0.561333333, - 'Covishield': 0.98, - 'mRNA-1273_(Moderna)': 0.683255814, - 'Sputnik_V_(Gamaleya)': 0.696, - 'CoronaVac_(Sinovac)_and_BNT162b2_(Pfizer)': 0.7965, + 'AZD1222_(AstraZeneca)': 0.56474, + 'AZD1222_(AstraZeneca)_and_BNT162b2_(Pfizer)': 0.7865, + 'AZD1222_(AstraZeneca)_and_any_mRNA_-_heterologous': 0.752143, + 'Ad26.COV2.S_(Janssen)': 0.551278, + 'Any_mRNA_-_heterologous': 0.93875, + 'BBIBP-CorV_(Beijing_CNBG)': 0.4325, + 'BNT162b2_(Pfizer)': 0.628452, + 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)': 0.569803, + 'CoronaVac_(Sinovac)': 0.292923, + 'CoronaVac_(Sinovac)_and_AZD1222_(AstraZeneca)': 0.472, + 'CoronaVac_(Sinovac)_and_AZD1222_(AstraZeneca)_-_heterologous': 0.74, + 'CoronaVac_(Sinovac)_and_BNT162b2_(Pfizer)': 0.7965, + 'Covishield': 0.98, + 'Sputnik_V_(Gamaleya)': 0.696, + 'mRNA-1273_(Moderna)': 0.690527, } vaccine_booster_host_immunity = [ - {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'AZD1222_(AstraZeneca)', 'VE': 0.6353636363636364}, - {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.7389019607843137}, - {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', 'VE': 0.26}, - {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.3846666666666667}, - {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'Sinopharm', 'VE': 0.7346666666666666}, - {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.8642399999999999}, - {'primary series vaccine': 'Ad26.COV2.S_(Janssen)', 'booster vaccine': 'Ad26.COV2.S_(Janssen)', 'VE': 0.615}, - {'primary series vaccine': 'Ad26.COV2.S_(Janssen)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.9155000000000001}, - {'primary series vaccine': 'Ad26.COV2.S_(Janssen)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.6725}, - {'primary series vaccine': 'BBIBP-CorV_(Beijing_CNBG)', 'booster vaccine': 'Ad26.COV2.S_(Janssen)', 'VE': 0.8973333333333333}, - {'primary series vaccine': 'BBIBP-CorV_(Beijing_CNBG)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.9283333333333332}, - {'primary series vaccine': 'BBIBP-CorV_(Beijing_CNBG)', 'booster vaccine': 'Sinopharm', 'VE': 0.7639999999999999}, - {'primary series vaccine': 'BBIBP-CorV_(Beijing_CNBG)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.9526666666666667}, - {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'AZD1222_(AstraZeneca)', 'VE': 0.8960000000000001}, - {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'Ad26.COV2.S_(Janssen)', 'VE': 0.9306666666666666}, - {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.7413183520599251}, - {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.6004285714285714}, - {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'CoronaVac_(Sinovac)', 'VE': 0.121}, - {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'Sinopharm', 'VE': 0.6683333333333333}, - {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.7530214285714285}, - {'primary series vaccine': 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', 'VE': 0.645}, - {'primary series vaccine': 'BNT162b2_(Pfizer)_(2_doses)_+_mRNA-1273_(Moderna)_(3rd_dose)', 'booster vaccine': 'mRNA-1273_(Moderna)_(4th_dose)', 'VE': 0.6466666666666667}, - {'primary series vaccine': 'BNT162b2_(Pfizer)_(3_doses)', 'booster vaccine': 'BNT162b2_(Pfizer)_(4th_dose)', 'VE': 0.6068333333333333}, - {'primary series vaccine': 'BNT162b2_(Pfizer)_(3_doses)', 'booster vaccine': 'mRNA-1273_(Moderna)_(4th_dose)', 'VE': 0.498}, - {'primary series vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.7564285714285713}, - {'primary series vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.7541721854304636}, - {'primary series vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.7538571428571429}, - {'primary series vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)_(3_doses)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)_(4th_dose)', 'VE': 0.5788888888888889}, - {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'AZD1222_(AstraZeneca)', 'VE': 0.9584285714285714}, - {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.7631960784313726}, - {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'CoronaVac_(Sinovac)', 'VE': 0.7141851851851851}, - {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'Coronavac_(Sinovac)', 'VE': 0.5107647058823529}, - {'primary series vaccine': 'Sputnik_V_(Gamaleya)', 'booster vaccine': 'Ad26.COV2.S_(Janssen)', 'VE': 0.8076666666666666}, - {'primary series vaccine': 'Sputnik_V_(Gamaleya)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.936}, - {'primary series vaccine': 'Sputnik_V_(Gamaleya)', 'booster vaccine': 'Sinopharm', 'VE': 0.5285}, - {'primary series vaccine': 'Sputnik_V_(Gamaleya)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.9366666666666668}, - {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'Ad26.COV2.S_(Janssen)', 'VE': 0.8873333333333333}, - {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.8068636363636363}, - {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.5692499999999999}, - {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'Sinopharm', 'VE': 0.7739999999999999}, - {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.7141650485436892}, - {'primary series vaccine': 'mRNA-1273_(Moderna)_(3_doses)', 'booster vaccine': 'mRNA-1273_(Moderna)_(4th_dose)', 'VE': 0.7066666666666667}] \ No newline at end of file + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'AZD1222_(AstraZeneca)', 'VE': 0.500429}, + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.537818}, + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.284}, + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.709143}, + {'primary series vaccine': 'Ad26.COV2.S_(Janssen)', 'booster vaccine': 'Ad26.COV2.S_(Janssen)', 'VE': 0.492667}, + {'primary series vaccine': 'Ad26.COV2.S_(Janssen)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.79}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'AZD1222_(AstraZeneca)', 'VE': 0.801}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.599132}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.632633}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.716786}, + {'primary series vaccine': 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', 'VE': 0.645}, + {'primary series vaccine': 'BNT162b2_(Pfizer)_(3_doses)', 'booster vaccine': 'BNT162b2_(Pfizer)_(4th_dose)', 'VE': 0.962}, + {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'AZD1222_(AstraZeneca)', 'VE': 0.9405}, + {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.649941}, + {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'CoronaVac_(Sinovac)', 'VE': 0.605429}, + {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'CoronaVac_(Sinovac)', 'VE': 0.289857}, + {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.842143}, + {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.632633}, + {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.618512} +] From 9e4d1c0937d4f56b32a51005cc110f31d9bb8a31 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Thu, 6 Oct 2022 11:49:36 +0200 Subject: [PATCH 08/13] updated VE and added default values on UI components --- caimira/apps/calculator/model_generator.py | 8 +++---- .../templates/base/calculator.report.html.j2 | 7 +++++-- caimira/data/__init__.py | 21 +++++++++---------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/caimira/apps/calculator/model_generator.py b/caimira/apps/calculator/model_generator.py index 16f76d7e..51d716da 100644 --- a/caimira/apps/calculator/model_generator.py +++ b/caimira/apps/calculator/model_generator.py @@ -139,8 +139,8 @@ class FormData: 'total_people': _NO_DEFAULT, 'vaccine_option': False, 'vaccine_booster_option': False, - 'vaccine_type': _NO_DEFAULT, - 'vaccine_booster_type': _NO_DEFAULT, + 'vaccine_type': 'AZD1222_(AstraZeneca)', + 'vaccine_booster_type': 'AZD1222_(AstraZeneca)', 'ventilation_type': 'no_ventilation', 'virus_type': 'SARS_CoV_2', 'volume_type': _NO_DEFAULT, @@ -809,8 +809,8 @@ def baseline_raw_form_data() -> typing.Dict[str, typing.Union[str, float]]: 'room_volume': '75', 'simulation_name': 'Test', 'total_people': '10', - 'vaccine_option': '', - 'vaccine_booster_option': '', + 'vaccine_option': '0', + 'vaccine_booster_option': '0', 'vaccine_type': 'Ad26.COV2.S_(Janssen)', 'vaccine_booster_type': 'AZD1222_(AstraZeneca)', 'ventilation_type': 'natural_ventilation', diff --git a/caimira/apps/templates/base/calculator.report.html.j2 b/caimira/apps/templates/base/calculator.report.html.j2 index 1d071fb7..550a8e30 100644 --- a/caimira/apps/templates/base/calculator.report.html.j2 +++ b/caimira/apps/templates/base/calculator.report.html.j2 @@ -375,11 +375,12 @@ - {% if form.vaccine_option %} +
Vaccination data:
+ {% if form.vaccine_option %}
  • Primary vaccine: {{ form.vaccine_type | replace("_", " ") }} {% if form.vaccine_booster_option %} @@ -387,9 +388,11 @@ {% endif %}
  • Vaccine effectiveness: {{ model.exposed.host_immunity | percentage | non_zero_percentage }}
+ {% else %} +

No vaccination selected.

+ {% endif %}
- {% endif %}
Ventilation data:
diff --git a/caimira/data/__init__.py b/caimira/data/__init__.py index 7ed3a76b..8c0a1390 100644 --- a/caimira/data/__init__.py +++ b/caimira/data/__init__.py @@ -48,21 +48,21 @@ GenevaTemperatures = { # Studies: An Ongoing Systematic Review - Updated September 8, 2022. # https://view-hub.org/resources vaccine_primary_host_immunity = { - 'AZD1222_(AstraZeneca)': 0.56474, + 'AZD1222_(AstraZeneca)': 0.589293, 'AZD1222_(AstraZeneca)_and_BNT162b2_(Pfizer)': 0.7865, - 'AZD1222_(AstraZeneca)_and_any_mRNA_-_heterologous': 0.752143, + 'AZD1222_(AstraZeneca)_and_any_mRNA_-_heterologous': 0.81, 'Ad26.COV2.S_(Janssen)': 0.551278, 'Any_mRNA_-_heterologous': 0.93875, 'BBIBP-CorV_(Beijing_CNBG)': 0.4325, - 'BNT162b2_(Pfizer)': 0.628452, - 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)': 0.569803, - 'CoronaVac_(Sinovac)': 0.292923, + 'BNT162b2_(Pfizer)': 0.660272, + 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)': 0.586319, + 'CoronaVac_(Sinovac)': 0.317333, 'CoronaVac_(Sinovac)_and_AZD1222_(AstraZeneca)': 0.472, 'CoronaVac_(Sinovac)_and_AZD1222_(AstraZeneca)_-_heterologous': 0.74, 'CoronaVac_(Sinovac)_and_BNT162b2_(Pfizer)': 0.7965, 'Covishield': 0.98, 'Sputnik_V_(Gamaleya)': 0.696, - 'mRNA-1273_(Moderna)': 0.690527, + 'mRNA-1273_(Moderna)': 0.730148, } vaccine_booster_host_immunity = [ @@ -73,16 +73,15 @@ vaccine_booster_host_immunity = [ {'primary series vaccine': 'Ad26.COV2.S_(Janssen)', 'booster vaccine': 'Ad26.COV2.S_(Janssen)', 'VE': 0.492667}, {'primary series vaccine': 'Ad26.COV2.S_(Janssen)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.79}, {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'AZD1222_(AstraZeneca)', 'VE': 0.801}, - {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.599132}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.60712}, {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.632633}, {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.716786}, {'primary series vaccine': 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', 'VE': 0.645}, {'primary series vaccine': 'BNT162b2_(Pfizer)_(3_doses)', 'booster vaccine': 'BNT162b2_(Pfizer)_(4th_dose)', 'VE': 0.962}, {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'AZD1222_(AstraZeneca)', 'VE': 0.9405}, - {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.649941}, - {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'CoronaVac_(Sinovac)', 'VE': 0.605429}, - {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'CoronaVac_(Sinovac)', 'VE': 0.289857}, + {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.690563}, + {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'CoronaVac_(Sinovac)', 'VE': 0.52225}, {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)', 'VE': 0.842143}, {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)', 'VE': 0.632633}, - {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.618512} + {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'mRNA-1273_(Moderna)', 'VE': 0.633238} ] From 98b08a05e052b1cb88461fc2912b07bf90a3339f Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Fri, 7 Oct 2022 10:51:05 +0200 Subject: [PATCH 09/13] moved select options (primary and booster vaccines) to JS --- caimira/apps/calculator/static/js/form.js | 77 +++++++++++++++---- .../templates/base/calculator.form.html.j2 | 37 +-------- 2 files changed, 64 insertions(+), 50 deletions(-) diff --git a/caimira/apps/calculator/static/js/form.js b/caimira/apps/calculator/static/js/form.js index 68b08f4e..20c0b5b4 100644 --- a/caimira/apps/calculator/static/js/form.js +++ b/caimira/apps/calculator/static/js/form.js @@ -335,16 +335,16 @@ function update_booster_warning() { function update_booster_dropdown(url) { let primary_vaccine_option = $("#vaccine_type").find(":selected").val(); - $($("#vaccine_booster_type > option").get().reverse()).each(function() { - if ($(this).attr('data-primary-vaccine') != primary_vaccine_option && $(this).attr('data-primary-vaccine') != "Other") $(this).hide(); - else { - $(this).show(); - if (url.searchParams.has('vaccine_type')) { - if (url.searchParams.get('vaccine_type') != primary_vaccine_option) $(this).prop('selected', true); // Select first of the list if not from the URL - } - else $(this).prop('selected', true); - } + $("#vaccine_booster_type option").remove(); + vaccine_booster_host_immunity.forEach(booster => { + if (booster['primary series vaccine'] == primary_vaccine_option) + $("#vaccine_booster_type").append(``); }); + $("#vaccine_booster_type").append(``); + + let booster_vaccine = url.searchParams.has('vaccine_booster_type') ? url.searchParams.get('vaccine_booster_type') : null; + $(`#vaccine_booster_type > option[value="${booster_vaccine}"`).attr('selected', true); + update_booster_warning(); } @@ -896,7 +896,7 @@ $(document).ready(function () { $("#sr_interactions").text(index - 1); } - else if (name == 'sensor_in_use' || name == 'vaccine_booster_type') { + else if (name == 'sensor_in_use' || name == 'vaccine_type' || name == 'vaccine_booster_type') { // Validation after } @@ -908,11 +908,15 @@ $(document).ready(function () { } }); - let primary_vaccine = url.searchParams.has('vaccine_type') ? url.searchParams.get('vaccine_type') : null; - let booster_vaccine = url.searchParams.has('vaccine_booster_type') ? url.searchParams.get('vaccine_booster_type') : null; - $(`#vaccine_booster_type > option[data-primary-vaccine="${primary_vaccine}"][value="${booster_vaccine}"]`).attr('selected', true); - // Handle default URL values if they are not explicitly defined. + + // Populate primary vaccine dropdown + $("#vaccine_type option").remove(); + let primary_vaccine = url.searchParams.has('vaccine_type') ? url.searchParams.get('vaccine_type') : null; + vaccine_primary_host_immunity.forEach(vaccine => $("#vaccine_type").append(``)); + $(`#vaccine_type > option[value="${primary_vaccine}"]`).attr('selected', true); + + // Handle geographic location input if (Array.from(url.searchParams).length > 0) { if (!url.searchParams.has('location_name')) { $('[name="location_name"]').val('Geneva') @@ -926,7 +930,6 @@ $(document).ready(function () { } } - // When the document is ready, deal with the fact that we may be here // as a result of a forward/back browser action. If that is the case, update // the visibility of some of our inputs. @@ -1281,3 +1284,47 @@ function objectifyForm(formArray) { returnArray[formArray[i]['name']] = formArray[i]['value']; return returnArray; } + +// ------- VACCINATION DATA ------- + +// From data available in Results of COVID-19 Vaccine Effectiveness +// Studies: An Ongoing Systematic Review - Updated September 8, 2022. +// https://view-hub.org/resources +vaccine_primary_host_immunity = [ + 'AZD1222_(AstraZeneca)', + 'AZD1222_(AstraZeneca)_and_BNT162b2_(Pfizer)', + 'AZD1222_(AstraZeneca)_and_any_mRNA_-_heterologous', + 'Ad26.COV2.S_(Janssen)', + 'Any_mRNA_-_heterologous', + 'BBIBP-CorV_(Beijing_CNBG)', + 'BNT162b2_(Pfizer)', + 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', + 'CoronaVac_(Sinovac)', + 'CoronaVac_(Sinovac)_and_AZD1222_(AstraZeneca)', + 'CoronaVac_(Sinovac)_and_AZD1222_(AstraZeneca)_-_heterologous', + 'CoronaVac_(Sinovac)_and_BNT162b2_(Pfizer)', + 'Covishield', + 'Sputnik_V_(Gamaleya)', + 'mRNA-1273_(Moderna)', +] + +vaccine_booster_host_immunity = [ + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'AZD1222_(AstraZeneca),'}, + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'BNT162b2_(Pfizer)',}, + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)',}, + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'mRNA-1273_(Moderna)',}, + {'primary series vaccine': 'Ad26.COV2.S_(Janssen)', 'booster vaccine': 'Ad26.COV2.S_(Janssen)',}, + {'primary series vaccine': 'Ad26.COV2.S_(Janssen)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)',}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'AZD1222_(AstraZeneca)',}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'BNT162b2_(Pfizer)',}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)',}, + {'primary series vaccine': 'BNT162b2_(Pfizer)', 'booster vaccine': 'mRNA-1273_(Moderna)',}, + {'primary series vaccine': 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)_and_mRNA-1273_(Moderna)',}, + {'primary series vaccine': 'BNT162b2_(Pfizer)_(3_doses)', 'booster vaccine': 'BNT162b2_(Pfizer)_(4th_dose)',}, + {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'AZD1222_(AstraZeneca)',}, + {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'BNT162b2_(Pfizer)',}, + {'primary series vaccine': 'CoronaVac_(Sinovac)', 'booster vaccine': 'CoronaVac_(Sinovac)',}, + {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)',}, + {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)',}, + {'primary series vaccine': 'mRNA-1273_(Moderna)', 'booster vaccine': 'mRNA-1273_(Moderna)',} +] diff --git a/caimira/apps/templates/base/calculator.form.html.j2 b/caimira/apps/templates/base/calculator.form.html.j2 index 298735bb..c1fad444 100644 --- a/caimira/apps/templates/base/calculator.form.html.j2 +++ b/caimira/apps/templates/base/calculator.form.html.j2 @@ -374,21 +374,7 @@
@@ -408,26 +394,7 @@
From e82f6e58d252f2f97ab45d89840043086ca0c3a1 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Fri, 7 Oct 2022 10:52:44 +0200 Subject: [PATCH 10/13] test for host immunity vectorisation --- caimira/tests/models/test_exposure_model.py | 27 ++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/caimira/tests/models/test_exposure_model.py b/caimira/tests/models/test_exposure_model.py index f66943a5..1a986815 100644 --- a/caimira/tests/models/test_exposure_model.py +++ b/caimira/tests/models/test_exposure_model.py @@ -297,13 +297,13 @@ def test_prob_meet_infected_person(pop, cases, AB, exposed, infected, prob_meet_ [30, known_concentrations(lambda t: 1.2), 100000, 68, 5, 55.93154502], ]) -def test_probabilistic_exposure_probability(exposed_population, cm, +def test_probabilistic_exposure_probability(sr_model, exposed_population, cm, pop, AB, cases, probabilistic_exposure_probability): population = models.Population( exposed_population, models.PeriodicInterval(120, 60), models.Mask.types['Type I'], models.Activity.types['Standing'], host_immunity=0.,) - model = ExposureModel(cm, (), population, models.Cases(geographic_population=pop, + model = ExposureModel(cm, sr_model, population, models.Cases(geographic_population=pop, geographic_cases=cases, ascertainment_bias=AB),) np.testing.assert_allclose( model.total_probability_rule(), probabilistic_exposure_probability, rtol=0.05 @@ -390,4 +390,25 @@ def test_diameter_vectorisation_room(diameter_dependent_model, sr_model, cases_m ventilation = models.HVACMechanical(active=models.SpecificInterval(((0., 24.), )), q_air_mech=100.)) with pytest.raises(ValueError, match=error_message): models.ExposureModel(concentration, sr_model, populations[0], cases_model) - \ No newline at end of file + + +@pytest.mark.parametrize( + ["cm", "host_immunity", "expected_probability"], + [ + [known_concentrations(lambda t: 36.), np.array([0.25, 0.5]), np.array([57.40415859, 41.03956914])], + [known_concentrations(lambda t: 36.), np.array([0., 1.]), np.array([67.95037626, 0.])], + ] +) +def test_host_immunity_vectorisation(sr_model, cases_model, cm, host_immunity, expected_probability): + population = models.Population( + 10, halftime, models.Mask(np.array([0.3, 0.35])), + models.Activity.types['Standing'], host_immunity=host_immunity + ) + model = ExposureModel(cm, sr_model, population, cases_model) + inf_probability = model.infection_probability() + + np.testing.assert_almost_equal( + inf_probability, expected_probability, decimal=1 + ) + assert isinstance(inf_probability, np.ndarray) + assert inf_probability.shape == (2, ) From a239b4f1ba00afc3eee2de3f92ffb25691495fd6 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Mon, 10 Oct 2022 16:53:39 +0200 Subject: [PATCH 11/13] Increased version number --- caimira/apps/calculator/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caimira/apps/calculator/__init__.py b/caimira/apps/calculator/__init__.py index 4072648c..8502868c 100644 --- a/caimira/apps/calculator/__init__.py +++ b/caimira/apps/calculator/__init__.py @@ -33,7 +33,7 @@ from .user import AuthenticatedUser, AnonymousUser # calculator version. If the calculator needs to make breaking changes (e.g. change # form attributes) then it can also increase its MAJOR version without needing to # increase the overall CAiMIRA version (found at ``caimira.__version__``). -__version__ = "4.4" +__version__ = "4.5" class BaseRequestHandler(RequestHandler): From db85c41fa0fe0966d28b77255de1fa1f8b81d35e Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Wed, 9 Nov 2022 11:55:47 +0100 Subject: [PATCH 12/13] added VE script and excel file --- .gitattributes | 1 + ..._COVID19_VE_Studies_08Sep2022_adapted.xlsx | 3 + caimira/scripts/data/vaccine_effectiveness.py | 56 +++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 .gitattributes create mode 100644 caimira/scripts/data/WeeklySummary_COVID19_VE_Studies_08Sep2022_adapted.xlsx create mode 100644 caimira/scripts/data/vaccine_effectiveness.py diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..ca21a586 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.xlsx filter=lfs diff=lfs merge=lfs -text diff --git a/caimira/scripts/data/WeeklySummary_COVID19_VE_Studies_08Sep2022_adapted.xlsx b/caimira/scripts/data/WeeklySummary_COVID19_VE_Studies_08Sep2022_adapted.xlsx new file mode 100644 index 00000000..c3ff459d --- /dev/null +++ b/caimira/scripts/data/WeeklySummary_COVID19_VE_Studies_08Sep2022_adapted.xlsx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2aef0605c3668b4884b815f71c0eae93eaaa7b88d6b6c17ff97f6a86a38674a5 +size 76179581 diff --git a/caimira/scripts/data/vaccine_effectiveness.py b/caimira/scripts/data/vaccine_effectiveness.py new file mode 100644 index 00000000..8186da64 --- /dev/null +++ b/caimira/scripts/data/vaccine_effectiveness.py @@ -0,0 +1,56 @@ +import pandas as pd +from tabulate import tabulate + +''' +Script file to generate the vaccine effectiveness values. +To generate the primary vaccine effectiveness values, uncoment lines 16-21. +To generate the booster effectiveness values, uncoment lines 26-56. +''' + +# Data from 08 Sep. 2022 +file_loc = "./WeeklySummary_COVID19_VE_Studies_08Sep2022_adapted.xlsx" + + +# ------- PRIMARY VACCINATION ------ # + +# df = pd.read_excel(file_loc, sheet_name="Primary_filtered", usecols="A, B, E") + +# calculate the VE value +# df = df.drop(df[df['VE'] < 0].index) +# ve_data = df.groupby(['vaccine'])['VE'].mean().divide(100).reset_index() +# print(tabulate(ve_data, headers='keys', tablefmt='psql')) + + +# ------- BOOSTER VACCINATION ------ # + +# df = pd.read_excel(file_loc, sheet_name="Booster_filtered", usecols="A, B, C, F") + +# # create df without the ' or ' substring in primary vaccines +# rows_with_or = df[df['primary series vaccine'].str.contains(' or ')] +# rows_indexes = list(rows_with_or.index) +# df_without_or = df.drop(labels=rows_indexes, axis=0) + +# # copy of all the rows that contain ' or ' +# new_rows_with_or = rows_with_or.reset_index().copy() + +# # create new dataframe empty +# rows_to_add = pd.DataFrame(columns=rows_with_or.columns) + +# # duplicate each row and add it into the new dataframe +# for index, row in new_rows_with_or.iterrows(): +# new_rows_with_or.at[index, 'primary series vaccine'] = row['primary series vaccine'].split(' or ')[0] +# rows_to_add.loc[index] = new_rows_with_or.loc[index] +# new_rows_with_or.at[index, 'primary series vaccine'] = row['primary series vaccine'].split(' or ')[1] +# rows_to_add.loc[len(rows_indexes)+index] = new_rows_with_or.loc[index] + +# # merge the dataframe without the ' or ' with the new dataframe that has the rows divided in two +# final_df = pd.concat([df_without_or, rows_to_add]).reset_index().drop(columns=['index']) + +# # calculate the VE value +# final_df = final_df.drop(final_df[final_df['VE'] < 0].index) + +# ve_data = final_df.groupby(['primary series vaccine', 'booster vaccine'])['VE'].mean().divide(100).reset_index() + +# result = ve_data.to_dict('records') + +# print(tabulate(ve_data, headers='keys', tablefmt='psql')) From 2b19ea163f7833b21b59cf4c4343636d7d864f09 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Thu, 10 Nov 2022 11:25:16 +0100 Subject: [PATCH 13/13] updated userguide for VE data and moved vaccination block under virus type --- caimira/apps/calculator/static/js/form.js | 2 +- .../templates/base/calculator.form.html.j2 | 89 ++++++++++--------- caimira/apps/templates/base/userguide.html.j2 | 5 ++ setup.cfg | 2 + 4 files changed, 53 insertions(+), 45 deletions(-) diff --git a/caimira/apps/calculator/static/js/form.js b/caimira/apps/calculator/static/js/form.js index 20c0b5b4..86c23880 100644 --- a/caimira/apps/calculator/static/js/form.js +++ b/caimira/apps/calculator/static/js/form.js @@ -1309,7 +1309,7 @@ vaccine_primary_host_immunity = [ ] vaccine_booster_host_immunity = [ - {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'AZD1222_(AstraZeneca),'}, + {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'AZD1222_(AstraZeneca)',}, {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'BNT162b2_(Pfizer)',}, {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'BNT162b2_(Pfizer)_or_mRNA-1273_(Moderna)',}, {'primary series vaccine': 'AZD1222_(AstraZeneca)', 'booster vaccine': 'mRNA-1273_(Moderna)',}, diff --git a/caimira/apps/templates/base/calculator.form.html.j2 b/caimira/apps/templates/base/calculator.form.html.j2 index c1fad444..5959d555 100644 --- a/caimira/apps/templates/base/calculator.form.html.j2 +++ b/caimira/apps/templates/base/calculator.form.html.j2 @@ -58,7 +58,7 @@ Virus data: -
+
?

@@ -76,6 +76,49 @@
+
+
Vaccinated? 💉
+
+ + + + +
+
+ +
+
+
+
+ +
+
+ +
+

With booster?

+
+ + + + +
+
+ +
+
+
+
+ +
+
+ +
+
+
Room data: @@ -325,7 +368,7 @@ -
+
@@ -359,48 +402,6 @@
-
-
Vaccinated? 💉
-
- - - - -
-
- -
-
-
-
- -
-
- -
-

With booster?

-
- - - - -
-
- -
-
-
-
- -
-
- -
-

diff --git a/caimira/apps/templates/base/userguide.html.j2 b/caimira/apps/templates/base/userguide.html.j2 index 14929ff9..95a2361d 100644 --- a/caimira/apps/templates/base/userguide.html.j2 +++ b/caimira/apps/templates/base/userguide.html.j2 @@ -51,6 +51,11 @@ The local population in Manaus had very high levels of Covid-19 antibodies (> This factor has been taken into account by the authors of the study, via statistical adjustments to the transmission value (i.e. it has been increased, to account for spread in a population with significant acquired Covid-19 immunity). However, this value may be revised in the future as more studies of the Gamma VOC transmission in different geographical locations become available.


+

Vaccine effectiveness

+
+

The vaccination input corresponds to the vaccine type(s) administrated to the exposed population, assuming every exposed (or the occupant in question) has received the vaccine cocktail selected by the user. +The respective vaccine effectiveness values were extracted from data available in Results of COVID-19 Vaccine Effectiveness Studies: An Ongoing Systematic Review - Updated September 8, 2022, using this script.

+

Room Data


Please enter either the room volume (in m³) or both the floor area (m²) and the room height (m). diff --git a/setup.cfg b/setup.cfg index c2f968b6..46f08728 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,3 +29,5 @@ ignore_missing_imports = True [mypy-timezonefinder.*] ignore_missing_imports = True +[mypy-pandas.*] +ignore_missing_imports = True