handlich vaccines in UI

This commit is contained in:
frankknoll
2023-10-13 20:57:18 +02:00
parent f28ee6e400
commit 7b78a6f449
7 changed files with 259 additions and 17 deletions

View File

@@ -439,8 +439,8 @@
"outputs": [],
"source": [
"from SymptomsCausedByVaccines.HtmlUpdater import updateHtmlFile\n",
"from src.SymptomsCausedByVaccines.PrrSeriesFactory import PrrSeriesFactory\n",
"from src.SymptomsCausedByVaccines.PrrSeriesTransformer import PrrSeriesTransformer\n",
"from SymptomsCausedByVaccines.PrrSeriesFactory import PrrSeriesFactory\n",
"from SymptomsCausedByVaccines.PrrSeriesTransformer import PrrSeriesTransformer\n",
"from SymptomsCausedByVaccines.ProportionalReportingRatiosPersister import saveProportionalReportingRatios\n",
"import os\n",
"import pandas as pd"
@@ -537,6 +537,7 @@
"source": [
"updateHtmlFile(\n",
" symptoms = list(prrByVaccineAndSymptom.columns),\n",
" vaccines = list(prrByVaccineAndSymptom.index),\n",
" htmlFile = \"../docs/SymptomsCausedByVaccines/index.html\")"
]
}

View File

@@ -1,16 +1,21 @@
from bs4 import BeautifulSoup
from HtmlTransformerUtil import HtmlTransformerUtil
from DateProvider import DateProvider
from SymptomsCausedByVaccines.HtmlUtils import getSymptomOptions
from SymptomsCausedByVaccines.HtmlUtils import getSymptomOptions, getVaccineOptions
from SymptomsCausedByVaccines.OptionsSetter import OptionsSetter
def updateHtmlFile(symptoms, htmlFile):
def updateHtmlFile(symptoms, vaccines, htmlFile):
_saveOptions(
options = getSymptomOptions(symptoms),
htmlFile = htmlFile,
selectElementId = 'symptomSelect')
_saveOptions(
options = getVaccineOptions(vaccines),
htmlFile = htmlFile,
selectElementId = 'vaccineSelect')
def _saveOptions(options, htmlFile, selectElementId):
HtmlTransformerUtil().applySoupTransformerToFile(
file=htmlFile,