refactoring

This commit is contained in:
frankknoll
2022-02-20 12:09:06 +01:00
parent 928aface1d
commit be6ee46445
3 changed files with 19 additions and 9 deletions

View File

@@ -67,16 +67,21 @@
input.select();
}
function displayCountry(country, batchCodeTable) {
document.querySelector('.heading').textContent = `Batch Codes for ${country}`;
batchCodeTable.ajax.url(`data/${country}.json`).load();
selectInput();
}
$(document).ready(function () {
const batchCodeTable = createEmptyBatchCodeTable();
document.querySelector('#country').addEventListener(
document.querySelector('#countrySelect').addEventListener(
'change',
event => {
const country = event.target.value;
const result = document.querySelector('.result');
result.textContent = `Batch Codes for ${country}`;
batchCodeTable.ajax.url(`data/${country}.json`).load();
selectInput();
if (country != 'Select country ...') {
displayCountry(country, batchCodeTable);
}
});
});
</script>
@@ -87,8 +92,8 @@
<h1>International Batch Codes</h1>
<p>
<label>Select country:
<select id="country" name="country">
<option value="">Select One …</option>
<select id="countrySelect" name="country">
<option value="Select country ...">Select country ...</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
@@ -254,7 +259,7 @@
<option value="Zimbabwe">Zimbabwe</option>
</select>
</label>
<h2 class="result"></h2>
<h2 class="heading"></h2>
<p>
<b>Check out your batch code</b> (last updated 16th February 2022)
</p>

View File

@@ -182,6 +182,7 @@
" def createSummationTable(\n",
" groupBy,\n",
" columnNameMappingsDict = {\n",
" # FK-TODO: rename \"Total Number of Adverse Reaction Reports\" to \"Adverse Reaction Reports\" everywhere\n",
" \"DIED_size\": \"Total Number of Adverse Reaction Reports\",\n",
" \"DIED_sum\": \"Deaths\",\n",
" \"L_THREAT_sum\": \"Life Threatening Illnesses\",\n",
@@ -1262,6 +1263,8 @@
"outputs": [],
"source": [
"def saveBatchCodeTable(vaers, file):\n",
" # FK-TODO: show \"Sever Reports\"\n",
" # FK-TODO: show combination of ALL doses\n",
" batchCodeTable = BatchCodeTableFactory.createBatchCodeTable(vaers, dose = '1', minADRsForLethality = 100)\n",
" batchCodeTable.index.set_names(\"Batch\", inplace = True)\n",
" display(batchCodeTable)\n",

View File

@@ -45,4 +45,6 @@ u039k20a
039K20A, 011L20
df[df.index.duplicated(False)].to_excel('results/pfizer_duplicates.xlsx')
df[df.index.duplicated(False)].to_excel('results/pfizer_duplicates.xlsx')
http://www.howbadismybatch.info/internationalBatchCodeTables.html