Merge branch 'dev/report-form' into 'master'
Updates to report form See merge request cara/cara!28
This commit is contained in:
commit
6af1f19d66
3 changed files with 93 additions and 76 deletions
|
|
@ -32,49 +32,42 @@ def build_report(model: models.Model, form: FormData):
|
|||
now = datetime.now()
|
||||
time = now.strftime("%d/%m/%Y %H:%M:%S")
|
||||
request = {"the": "form", "request": "data"}
|
||||
|
||||
context = {
|
||||
"model": model,
|
||||
"form": form,
|
||||
"creation_date": time,
|
||||
"model_version": "Beta v1.0.0",
|
||||
"simulation_name": "SAMPLE",
|
||||
"room_number": "40/1-02A",
|
||||
"room_volume": 30,
|
||||
"mechanical_ventilation": "Yes",
|
||||
"air_supply": 1,
|
||||
"air_changes": 2,
|
||||
"windows_number": 5,
|
||||
"window_height": 2,
|
||||
"window_width": 1,
|
||||
"opening_distance": 0.05,
|
||||
"windows_open": "20 minutes every 2 hours",
|
||||
"hepa_filtration": "No",
|
||||
"total_people": 8,
|
||||
"infected_people": 7,
|
||||
"activity_type": "Office work – typical scenario with all persons seated, talking",
|
||||
"activity_start": "00:00",
|
||||
"activity_finish": "01:15",
|
||||
"exposure_start": "00:00",
|
||||
"exposure_finish": "01:15",
|
||||
"single_event_date": "5th November",
|
||||
"lunch_option": "Yes",
|
||||
"lunch_start": "00:00",
|
||||
"lunch_finish": "01:15",
|
||||
"coffee_option": "Yes",
|
||||
"coffee_number": 4,
|
||||
"coffee_duration": 15,
|
||||
"coffee_start1": "00:00",
|
||||
"coffee_finish1": "00:00",
|
||||
"coffee_start2": "00:00",
|
||||
"coffee_finish2": "00:00",
|
||||
"coffee_start3": "00:00",
|
||||
"coffee_finish3": "00:00",
|
||||
"coffee_start4": "00:00",
|
||||
"coffee_finish4": "00:00",
|
||||
"mask_wearing": "Yes",
|
||||
"infection_probability": round(model.infection_probability(), 2),
|
||||
"reproduction_rate": 2,
|
||||
'model': model,
|
||||
'request': request,
|
||||
'creation_date': time,
|
||||
'model_version': 'Beta v1.0.0',
|
||||
'simulation_name': form.simulation_name,
|
||||
'room_number': form.room_number,
|
||||
'room_volume': form.room_volume,
|
||||
'ventilation_type': form.ventilation_type,
|
||||
'air_supply': form.air_supply,
|
||||
'air_changes': form.air_changes,
|
||||
'windows_number': form.windows_number,
|
||||
'window_height': form.window_height,
|
||||
'window_width': form.window_width,
|
||||
'opening_distance': form.opening_distance,
|
||||
'windows_open': form.windows_open,
|
||||
'hepa_option': 'No',
|
||||
'total_people': form.total_people,
|
||||
'infected_people': form.infected_people,
|
||||
'activity_type': form.activity_type,
|
||||
'activity_start': form.activity_start,
|
||||
'activity_finish': form.activity_finish,
|
||||
'exposure_start': '00:00',
|
||||
'exposure_finish': '01:15',
|
||||
'event_type': form.event_type,
|
||||
'single_event_date': form.single_event_date,
|
||||
'recurrent_event_month': form.recurrent_event_month,
|
||||
'lunch_option': form.lunch_option,
|
||||
'lunch_start': form.lunch_start,
|
||||
'lunch_finish': form.lunch_finish,
|
||||
'coffee_breaks': form.coffee_breaks,
|
||||
'coffee_duration': form.coffee_duration,
|
||||
'coffee_times': [['00:00','00:00'], ['00:00','00:00'], ['00:00','00:00'], ['00:00','00:00']],
|
||||
'mask_wearing': form.mask_wearing,
|
||||
'infection_probability': round(model.infection_probability(), 2),
|
||||
'reproduction_rate': 2
|
||||
}
|
||||
|
||||
context.update(calculate_report_data(model))
|
||||
|
|
@ -82,4 +75,4 @@ def build_report(model: models.Model, form: FormData):
|
|||
p = Path(__file__).parent / "templates"
|
||||
env = jinja2.Environment(loader=jinja2.FileSystemLoader(Path(p)))
|
||||
template = env.get_template("report.html.j2")
|
||||
return template.render(**context)
|
||||
return template.render(**context)
|
||||
|
|
@ -6,14 +6,7 @@
|
|||
padding: 20px;
|
||||
}
|
||||
|
||||
.image {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 13pt;
|
||||
}
|
||||
|
||||
h1{
|
||||
h1 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
|
@ -41,3 +34,12 @@ p.result_title {
|
|||
font-weight: bold;
|
||||
font-size: 15pt;
|
||||
}
|
||||
|
||||
.image {
|
||||
text-align: center;
|
||||
font-size: 13pt;
|
||||
}
|
||||
|
||||
.discalimer {
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
|
@ -9,9 +9,6 @@
|
|||
|
||||
<body id="body">
|
||||
|
||||
<p class=image> <img src="/calculator/static/images/disclaimer.jpg" width="40" height="40">
|
||||
VERY IMPORTANT DISCLAIMER</p>
|
||||
|
||||
<h1>Output from CARA - COVID Airborne Risk Assessment tool</h1>
|
||||
|
||||
<p class=subtitle> Created {{ creation_date }} using model version {{ model_version }}</p><br>
|
||||
|
|
@ -26,15 +23,19 @@
|
|||
|
||||
<p class="data_title">Ventilation data:</p>
|
||||
<ul>
|
||||
<li><p class="data_text">Mechanical ventilation: {{ mechanical_ventilation }}</p></li>
|
||||
<!--If mechanical ventialtion is yes {-->
|
||||
<li><p class="data_text">Mechanical ventilation:
|
||||
{% if ventilation_type == "mechanical_ventilation"%}
|
||||
Yes </p></li>
|
||||
<ul>
|
||||
<li><p class="data_subtext">Air supply flow rate: {{ air_supply }}</p></li>
|
||||
<li><p class="data_subtext">Air changes per hour: {{ air_changes }}</p></li>
|
||||
</ul>
|
||||
<!--}-->
|
||||
<li><p class="data_text">Natural ventilation: No</li>
|
||||
<!--If natural ventialtion is yes {
|
||||
{% else %}
|
||||
No </li>
|
||||
{% endif %}
|
||||
<li><p class="data_text">Natural ventilation:
|
||||
{% if ventilation_type == "natural_ventilation"%}
|
||||
Yes </p></li>
|
||||
<ul>
|
||||
<li><p class="data_subtext">Number of windows: {{ windows_number }}</p></li>
|
||||
<li><p class="data_subtext">Height of window: {{ window_height }}</p></li>
|
||||
|
|
@ -42,11 +43,11 @@
|
|||
<li><p class="data_subtext">Opening distance: {{ opening_distance }}</p></li>
|
||||
<li><p class="data_subtext">Windows open: {{ windows_open }}</p></li>
|
||||
</ul>
|
||||
}-->
|
||||
<li><p class="data_text">HEPA Filtration: {{ hepa_filtration }}</li>
|
||||
<!--If HEPA filtration is yes {
|
||||
X type of filter with y flow rate (default model assumption) ?
|
||||
}-->
|
||||
{% else %}
|
||||
No </p></li>
|
||||
{% endif %}
|
||||
<li><p class="data_text">HEPA Filtration: {{ hepa_option }}</li>
|
||||
<!--TODO: X type of filter with y flow rate (default model assumption) ? This was in the output doc..? -->
|
||||
</ul>
|
||||
|
||||
<p class="data_title">Event data:</p>
|
||||
|
|
@ -54,29 +55,41 @@
|
|||
<li><p class="data_text">Number of attendees and infected people: {{ total_people }} in attendance, of whom {{ infected_people }} are infected.</p></li>
|
||||
<li><p class="data_text">Activity type: {{ activity_type }}</p></li>
|
||||
<ul>
|
||||
<li><p class="data_subtext">Start time: {{ activity_start }} End time: {{ activity_finish }}</p></li>
|
||||
<li><p class="data_subtext">Start time: {{ activity_start }}    End time: {{ activity_finish }}</p></li>
|
||||
</ul>
|
||||
<li><p class="data_text">Exposure time (presence of infected person):</p></li>
|
||||
<ul>
|
||||
<li><p class="data_subtext">Start time: {{ exposure_start }} End time: {{ exposure_finish }}</p></li>
|
||||
<li><p class="data_subtext">Start time: {{ exposure_start }}    End time: {{ exposure_finish }}</p></li>
|
||||
</ul>
|
||||
{% if event_type == "single_event"%}
|
||||
<li><p class="data_text">Single event on {{ single_event_date }}</p></li>
|
||||
{% endif %}
|
||||
{% if event_type == "recurrent_event"%}
|
||||
<li><p class="data_text">Recurrent event for the month of {{ recurrent_event_month }}</p></li>
|
||||
{% endif %}
|
||||
|
||||
</ul>
|
||||
|
||||
<p class="data_title">Break data:</p>
|
||||
<ul>
|
||||
<li><p class="data_text">Lunchbreak: {{ lunch_option }} Start: {{ lunch_start }} End: {{ lunch_end }}</p></li>
|
||||
<li><p class="data_text">Coffee breaks: {{ coffee_option }} Number: {{ coffee_number }} Duration: {{ coffee_duration }}</p></li>
|
||||
<li><p class="data_text">Lunch break: {{ lunch_option }}</li>
|
||||
{% if lunch_option == "Yes" %}
|
||||
<ul>
|
||||
<li><p class="data_subtext">Coffee break 1: Start: {{ coffee_start1 }} End: {{ coffee_finish1 }}</p></li>
|
||||
<li><p class="data_subtext">Coffee break 2: Start: {{ coffee_start2 }} End: {{ coffee_finish2 }}</p></li>
|
||||
<li><p class="data_subtext">Coffee break 3: Start: {{ coffee_start3 }} End: {{ coffee_finish3 }}</p></li>
|
||||
<li><p class="data_subtext">Coffee break 4: Start: {{ coffee_start4 }} End: {{ coffee_finish4 }}</p></li>
|
||||
<li> Start: {{ lunch_start }}    End: {{ lunch_finish }}</p></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
<li><p class="data_text">Coffee breaks: {{ coffee_breaks }}
|
||||
{% if coffee_breaks > 0 %}
|
||||
each of {{ coffee_duration }} minutes duration
|
||||
</p></li>
|
||||
<ul>
|
||||
{%- for coffee in coffee_times %}
|
||||
<li><p class="data_subtext">Coffee break {{ loop.index }}: Start: {{ coffee[0] }}    End: {{ coffee[1] }}</p></li>
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
<!--or Recurrent for months of X, Y and Z…-->
|
||||
|
||||
<p class="data_title">Mask wearing:</p>
|
||||
<ul>
|
||||
<li><p class="data_text">Masks worn at workstations? {{ mask_wearing }}</p></li>
|
||||
|
|
@ -84,8 +97,17 @@
|
|||
</ul>
|
||||
|
||||
<p class="result_title">Results:</p>
|
||||
<p class="data_text"> In this scenario, the estimated probability of one exposed occupant getting infected (Pi) is {{ infection_probability }} % and the estimated basic reproduction rate (R0) rate is {{ reproduction_rate }}. If you have selected a recurrent event, this is the probability per day, and is cumulative over the number of days.<p>
|
||||
<p class="data_title">Exposure graph:
|
||||
<p class="data_text"> In this scenario, the estimated probability of one exposed occupant getting infected P(i) is {{ infection_probability }} % and the estimated basic reproduction rate (R0) rate is {{ reproduction_rate }}. This probability estimate is per simulated time period, i.e. if you have simulated a working day, which will be repeated n times per week, the cumulative probability of infection per person is n x P(i).<p>
|
||||
<p class="data_title">Exposure graph:</p>
|
||||
|
||||
<br><br><br><br><br><br><br>
|
||||
<div style="border: 2px solid black; padding: 15px;">
|
||||
<p class="image"> <img <img align="middle" src="/calculator/static/images/disclaimer.jpg" width="40" height="40"><b>Disclaimer:</b><br><br></p>
|
||||
<p class="discalimer">The risk assessment tool simulates the long range airborne spread SARS-CoV-2 virus in a finite volume, assuming a homogenous mixture, and estimates the risk of COVID-19 infection thereto. The results DO NOT include short-range airborne exposure (where the physical distance plays a factor) nor the other know modes of transmission of SARS-CoV-2. Hence, this model implies that proper physical distancing, good hand hygiene and other barrier measures are ensured.<br><br>
|
||||
It is based on current scientific data and can be used to measures the effectiveness of different mitigation measures.<br><br>
|
||||
Note that this model is based on a deterministic approach, i.e., at least one person is infected and shedding viruses into the volume. Nonetheless, it is also important to understand that the absolute risk of infection is uncertain as it will depend on the probability that someone infected attends the event. The model is mostly useful to compare the impact and effectiveness of mitigation measures such as ventilation, filtration, exposure time, activity and the size of the room on long-range airborne transmission of COVID-19 in indoor settings.<br><br>
|
||||
This application is meant for informative and educational purposes. The user can be able to adapt different settings and measure the relative impact on the estimated infection probabilities to allow for a targeted decision making and investment. The user should acknowledge that until the virus is in circulation among the population, the notion of 'zero risk' or a 'completely safe scenario' does not exist. Each event is unique and the results are as accurate as the inputs. The app is based on our scientific understanding of infectious diseases transmission, exposure and aerosol science as of November 2020.<br><br>
|
||||
<b>We do not assume responsibility for any injury or damage to persons or property arising out of or related to any use of this app.</b></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in a new issue