refactoring

This commit is contained in:
frankknoll
2022-02-19 15:14:23 +01:00
parent b2d4e93df6
commit 608f268a84
14 changed files with 25 additions and 22 deletions
+1 -1
View File
@@ -1 +1 @@
{"columns":["VAX_LOT","Total Number of Adverse Reaction Reports","Deaths","Disabilities","Life Threatening Illnesses","Severe reports (%)"],"data":[["UNKNOWN",58,1,4,2,12.0689655172]]}
{"columns":["Batch","Total Number of Adverse Reaction Reports","Deaths","Disabilities","Life Threatening Illnesses","Severe reports (%)"],"data":[["3002188",1,0,0,1,null],["EX2405",1,0,1,0,null],["FL350",1,0,1,0,null],["FF3438",1,0,1,0,null],["FE8163",2,0,2,0,null],["FF4222",1,0,1,0,null],["EP2163 SERIAL 1",1,1,0,0,null],["FF4206",2,0,1,0,null],["NO BATCH NUMBER",33,4,0,0,null],["UNKNOWN",58,1,4,2,null],["FA7338",1,0,0,0,null],["FE3712",1,0,0,0,null],["ER7449",1,0,0,0,null],["3006325",1,0,0,0,null],["FG1657",1,0,0,0,null],["FG3712",1,0,0,0,null],["FG7372",1,0,0,0,null],["FH3219",1,0,0,0,null],["EJ8516",1,0,0,0,null],["FL3560",1,0,0,0,null],["FN0565",1,0,0,0,null],["UNSURE",1,0,0,0,null]]}
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+5 -5
View File
@@ -14,7 +14,7 @@
<script>
function createEmptyBatchCodeTable() {
const columnIndex = {
'VAX_LOT': 0,
'Batch': 0,
'Total Number of Adverse Reaction Reports': 1,
'Deaths': 2,
'Disabilities': 3,
@@ -48,10 +48,10 @@
},
{
render: (data, type, row) => {
const lethality = parseFloat(data);
return !isNaN(lethality) ? lethality.toFixed(2) + " %" : '';
const severeReports = parseFloat(data);
return !isNaN(severeReports) ? severeReports.toFixed(2) + " %" : '';
},
targets: [columnIndex['Lethality']]
targets: [columnIndex['Severe reports (%)']]
}
]
});
@@ -107,7 +107,7 @@
<table class="display" id="batchCodeTable">
<thead>
<tr>
<th>VAX_LOT</th>
<th>Batch</th>
<th>Total Number of Adverse Reaction Reports</th>
<th>Deaths</th>
<th>Disabilities</th>
+8 -5
View File
@@ -1352,15 +1352,17 @@
"metadata": {},
"outputs": [],
"source": [
"def createAndSaveAndDisplayBatchCodeTableByCountry(nonDomesticVaers, country):\n",
"def createAndSaveAndDisplayBatchCodeTableByCountry(nonDomesticVaers, country, minADRsForLethality = None):\n",
" batchCodeTable = InternationalLotTableFactory.createBatchCodeTableByCountry(nonDomesticVaers, country)\n",
" batchCodeTable = batchCodeTable[batchCodeTable['Total Number of Adverse Reaction Reports'] > 50]\n",
" batchCodeTable.index.set_names(\"Batch\", inplace = True)\n",
" if minADRsForLethality is not None:\n",
" batchCodeTable.loc[batchCodeTable['Total Number of Adverse Reaction Reports'] < minADRsForLethality, 'Severe reports (%)'] = np.nan\n",
" IOUtils.saveDataFrame(batchCodeTable, '../data/' + country)\n",
" display(country + \":\", batchCodeTable)\n",
"\n",
"def createAndSaveAndDisplayBatchCodeTablesByCountry(nonDomesticVaers, countries):\n",
"def createAndSaveAndDisplayBatchCodeTablesByCountry(nonDomesticVaers, countries, minADRsForLethality = None):\n",
" for country in countries:\n",
" createAndSaveAndDisplayBatchCodeTableByCountry(nonDomesticVaers, country)"
" createAndSaveAndDisplayBatchCodeTableByCountry(nonDomesticVaers, country, minADRsForLethality)"
]
},
{
@@ -1385,7 +1387,8 @@
" 'Sweden',\n",
" 'Portugal',\n",
" 'Australia'\n",
" ])"
" ],\n",
" minADRsForLethality = 100)"
]
},
{