adding Lethality column
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
{"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]]}
|
{"columns":["Batch","Total Number of Adverse Reaction Reports","Deaths","Disabilities","Life Threatening Illnesses","Severe reports","Lethality"],"data":[["3002188",1,0,0,1,null,null],["EX2405",1,0,1,0,null,null],["FL350",1,0,1,0,null,null],["FF3438",1,0,1,0,null,null],["FE8163",2,0,2,0,null,null],["FF4222",1,0,1,0,null,null],["EP2163 SERIAL 1",1,1,0,0,null,null],["FF4206",2,0,1,0,null,null],["NO BATCH NUMBER",33,4,0,0,null,null],["UNKNOWN",58,1,4,2,null,null],["FA7338",1,0,0,0,null,null],["FE3712",1,0,0,0,null,null],["ER7449",1,0,0,0,null,null],["3006325",1,0,0,0,null,null],["FG1657",1,0,0,0,null,null],["FG3712",1,0,0,0,null,null],["FG7372",1,0,0,0,null,null],["FH3219",1,0,0,0,null,null],["EJ8516",1,0,0,0,null,null],["FL3560",1,0,0,0,null,null],["FN0565",1,0,0,0,null,null],["UNSURE",1,0,0,0,null,null]]}
|
||||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -20,6 +20,7 @@
|
|||||||
'Disabilities': 3,
|
'Disabilities': 3,
|
||||||
'Life Threatening Illnesses': 4,
|
'Life Threatening Illnesses': 4,
|
||||||
'Severe reports': 5,
|
'Severe reports': 5,
|
||||||
|
'Lethality': 6
|
||||||
};
|
};
|
||||||
return $('#batchCodeTable').DataTable(
|
return $('#batchCodeTable').DataTable(
|
||||||
{
|
{
|
||||||
@@ -43,15 +44,16 @@
|
|||||||
columnIndex['Deaths'],
|
columnIndex['Deaths'],
|
||||||
columnIndex['Disabilities'],
|
columnIndex['Disabilities'],
|
||||||
columnIndex['Life Threatening Illnesses'],
|
columnIndex['Life Threatening Illnesses'],
|
||||||
columnIndex['Severe reports']
|
columnIndex['Severe reports'],
|
||||||
|
columnIndex['Lethality']
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
render: (data, type, row) => {
|
render: (data, type, row) => {
|
||||||
const severeReports = parseFloat(data);
|
const numberInPercent = parseFloat(data);
|
||||||
return !isNaN(severeReports) ? severeReports.toFixed(2) + " %" : '';
|
return !isNaN(numberInPercent) ? numberInPercent.toFixed(2) + " %" : '';
|
||||||
},
|
},
|
||||||
targets: [columnIndex['Severe reports']]
|
targets: [columnIndex['Severe reports'], columnIndex['Lethality']]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
@@ -113,6 +115,7 @@
|
|||||||
<th>Disabilities</th>
|
<th>Disabilities</th>
|
||||||
<th>Life Threatening Illnesses</th>
|
<th>Life Threatening Illnesses</th>
|
||||||
<th>Severe reports</th>
|
<th>Severe reports</th>
|
||||||
|
<th>Lethality</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
+22
-12
@@ -213,7 +213,16 @@
|
|||||||
" \"SEVERE_sum\": \"Severities\"\n",
|
" \"SEVERE_sum\": \"Severities\"\n",
|
||||||
" })\n",
|
" })\n",
|
||||||
" summationTable['Severe reports'] = summationTable['Severities'] / summationTable['Total Number of Adverse Reaction Reports'] * 100\n",
|
" summationTable['Severe reports'] = summationTable['Severities'] / summationTable['Total Number of Adverse Reaction Reports'] * 100\n",
|
||||||
" summationTable = summationTable[['Total Number of Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Severe reports']]\n",
|
" summationTable['Lethality'] = summationTable['Deaths'] / summationTable['Total Number of Adverse Reaction Reports'] * 100\n",
|
||||||
|
" summationTable = summationTable[\n",
|
||||||
|
" [\n",
|
||||||
|
" 'Total Number of Adverse Reaction Reports',\n",
|
||||||
|
" 'Deaths',\n",
|
||||||
|
" 'Disabilities',\n",
|
||||||
|
" 'Life Threatening Illnesses',\n",
|
||||||
|
" 'Severe reports',\n",
|
||||||
|
" 'Lethality'\n",
|
||||||
|
" ]]\n",
|
||||||
" return summationTable\n",
|
" return summationTable\n",
|
||||||
"\n",
|
"\n",
|
||||||
" @staticmethod\n",
|
" @staticmethod\n",
|
||||||
@@ -1005,7 +1014,8 @@
|
|||||||
" 'Deaths': [2, 1],\n",
|
" 'Deaths': [2, 1],\n",
|
||||||
" 'Disabilities': [1, 0],\n",
|
" 'Disabilities': [1, 0],\n",
|
||||||
" 'Life Threatening Illnesses': [1, 0],\n",
|
" 'Life Threatening Illnesses': [1, 0],\n",
|
||||||
" 'Severe reports': [2/2 * 100, 1/1 * 100]\n",
|
" 'Severe reports': [2/2 * 100, 1/1 * 100],\n",
|
||||||
|
" 'Lethality': [2/2 * 100, 1/1 * 100]\n",
|
||||||
" },\n",
|
" },\n",
|
||||||
" index = pd.Index(['1', '2'], dtype = \"string\", name = 'Dose')))\n",
|
" index = pd.Index(['1', '2'], dtype = \"string\", name = 'Dose')))\n",
|
||||||
" \n",
|
" \n",
|
||||||
@@ -1036,7 +1046,8 @@
|
|||||||
" 'Deaths': [2, 1],\n",
|
" 'Deaths': [2, 1],\n",
|
||||||
" 'Disabilities': [1, 0],\n",
|
" 'Disabilities': [1, 0],\n",
|
||||||
" 'Life Threatening Illnesses': [1, 0],\n",
|
" 'Life Threatening Illnesses': [1, 0],\n",
|
||||||
" 'Severe reports': [2/2 * 100, 1/1 * 100]\n",
|
" 'Severe reports': [2/2 * 100, 1/1 * 100],\n",
|
||||||
|
" 'Lethality': [2/2 * 100, 1/1 * 100]\n",
|
||||||
" },\n",
|
" },\n",
|
||||||
" index = pd.MultiIndex.from_tuples(\n",
|
" index = pd.MultiIndex.from_tuples(\n",
|
||||||
" [\n",
|
" [\n",
|
||||||
@@ -1082,10 +1093,10 @@
|
|||||||
" assert_frame_equal(\n",
|
" assert_frame_equal(\n",
|
||||||
" internationalLotTable,\n",
|
" internationalLotTable,\n",
|
||||||
" TestHelper.createDataFrame(\n",
|
" TestHelper.createDataFrame(\n",
|
||||||
" columns = ['Total Number of Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Severe reports'],\n",
|
" columns = ['Total Number of Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Severe reports', 'Lethality'],\n",
|
||||||
" data = [ [2, 2, 1, 1, 2/2 * 100],\n",
|
" data = [ [2, 2, 1, 1, 2/2 * 100, 2/2 * 100],\n",
|
||||||
" [1, 1, 0, 0, 1/1 * 100],\n",
|
" [1, 1, 0, 0, 1/1 * 100, 1/1 * 100],\n",
|
||||||
" [2, 0, 0, 0, 0/2 * 100]],\n",
|
" [2, 0, 0, 0, 0/2 * 100, 0/2 * 100]],\n",
|
||||||
" index = pd.Index(\n",
|
" index = pd.Index(\n",
|
||||||
" [\n",
|
" [\n",
|
||||||
" 'France',\n",
|
" 'France',\n",
|
||||||
@@ -1117,9 +1128,9 @@
|
|||||||
" assert_frame_equal(\n",
|
" assert_frame_equal(\n",
|
||||||
" batchCodeTable,\n",
|
" batchCodeTable,\n",
|
||||||
" TestHelper.createDataFrame(\n",
|
" TestHelper.createDataFrame(\n",
|
||||||
" columns = ['Total Number of Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Severe reports'],\n",
|
" columns = ['Total Number of Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Severe reports', 'Lethality'],\n",
|
||||||
" data = [ [2, 1, 2, 2, 2/2 * 100],\n",
|
" data = [ [2, 1, 2, 2, 2/2 * 100, 1/2 * 100],\n",
|
||||||
" [1, 0, 0, 0, 0/1 * 100]],\n",
|
" [1, 0, 0, 0, 0/1 * 100, 0/1 * 100]],\n",
|
||||||
" index = pd.Index(\n",
|
" index = pd.Index(\n",
|
||||||
" [\n",
|
" [\n",
|
||||||
" '030L20B',\n",
|
" '030L20B',\n",
|
||||||
@@ -1353,12 +1364,11 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"def createAndSaveAndDisplayBatchCodeTableByCountry(nonDomesticVaers, country, minADRsForLethality = None):\n",
|
"def createAndSaveAndDisplayBatchCodeTableByCountry(nonDomesticVaers, country, minADRsForLethality = None):\n",
|
||||||
" # FK-TODO: add Lethality column\n",
|
|
||||||
" # FK-TODO: add Company column\n",
|
" # FK-TODO: add Company column\n",
|
||||||
" batchCodeTable = InternationalLotTableFactory.createBatchCodeTableByCountry(nonDomesticVaers, country)\n",
|
" batchCodeTable = InternationalLotTableFactory.createBatchCodeTableByCountry(nonDomesticVaers, country)\n",
|
||||||
" batchCodeTable.index.set_names(\"Batch\", inplace = True)\n",
|
" batchCodeTable.index.set_names(\"Batch\", inplace = True)\n",
|
||||||
" if minADRsForLethality is not None:\n",
|
" if minADRsForLethality is not None:\n",
|
||||||
" batchCodeTable.loc[batchCodeTable['Total Number of Adverse Reaction Reports'] < minADRsForLethality, 'Severe reports'] = np.nan\n",
|
" batchCodeTable.loc[batchCodeTable['Total Number of Adverse Reaction Reports'] < minADRsForLethality, ['Severe reports', 'Lethality']] = [np.nan, np.nan]\n",
|
||||||
" IOUtils.saveDataFrame(batchCodeTable, '../data/' + country)\n",
|
" IOUtils.saveDataFrame(batchCodeTable, '../data/' + country)\n",
|
||||||
" display(country + \":\", batchCodeTable)\n",
|
" display(country + \":\", batchCodeTable)\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user