starting to add Hospitalization
This commit is contained in:
@@ -21,6 +21,7 @@ class BatchCodeTableFactory:
|
||||
'Deaths',
|
||||
'Disabilities',
|
||||
'Life Threatening Illnesses',
|
||||
'Hospitalization',
|
||||
'Company',
|
||||
'Severe reports',
|
||||
'Lethality'
|
||||
|
||||
@@ -12,7 +12,7 @@ class BatchCodeTableFactoryTest(unittest.TestCase):
|
||||
dataFrame = TestHelper.createDataFrame(
|
||||
columns = ['DIED', 'L_THREAT', 'DISABLE', 'VAX_TYPE', 'VAX_MANU', 'VAX_LOT', 'VAX_DOSE_SERIES', 'SPLTTYPE', 'HOSPITAL', 'ER_VISIT', 'COUNTRY'],
|
||||
data = [ [1, 0, 0, 'COVID19', 'PFIZER\BIONTECH', '016M20A', '2', 'GBPFIZER INC2020486806', 0, 0, 'United Kingdom'],
|
||||
[0, 0, 0, 'COVID19', 'MODERNA', '030L20A', '1', 'FRMODERNATX, INC.MOD20224', 0, 0, 'France'],
|
||||
[0, 0, 0, 'COVID19', 'MODERNA', '030L20A', '1', 'FRMODERNATX, INC.MOD20224', 1, 0, 'France'],
|
||||
[1, 1, 1, 'COVID19', 'MODERNA', '030L20B', '1', 'FRMODERNATX, INC.MOD20224', 0, 0, 'France'],
|
||||
[0, 1, 1, 'COVID19', 'MODERNA', '030L20B', '1', 'FRMODERNATX, INC.MOD20224', 0, 0, 'France']],
|
||||
index = [
|
||||
@@ -28,11 +28,11 @@ class BatchCodeTableFactoryTest(unittest.TestCase):
|
||||
|
||||
# Then
|
||||
assert_frame_equal(
|
||||
batchCodeTable[['Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Company', 'Severe reports', 'Lethality']],
|
||||
batchCodeTable[['Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Hospitalization', 'Company', 'Severe reports', 'Lethality']],
|
||||
TestHelper.createDataFrame(
|
||||
columns = ['Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Company', 'Severe reports', 'Lethality'],
|
||||
data = [ [2, 1, 2, 2, 'MODERNA', 2/2 * 100, 1/2 * 100],
|
||||
[1, 0, 0, 0, 'MODERNA', 0/1 * 100, 0/1 * 100]],
|
||||
columns = ['Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Hospitalization', 'Company', 'Severe reports', 'Lethality'],
|
||||
data = [ [2, 1, 2, 2, 0, 'MODERNA', 2/2 * 100, 1/2 * 100],
|
||||
[1, 0, 0, 0, 1, 'MODERNA', 0/1 * 100, 0/1 * 100]],
|
||||
index = pd.Index(
|
||||
[
|
||||
'030L20B',
|
||||
@@ -47,8 +47,8 @@ class BatchCodeTableFactoryTest(unittest.TestCase):
|
||||
columns = ['DIED', 'L_THREAT', 'DISABLE', 'VAX_TYPE', 'VAX_MANU', 'VAX_LOT', 'VAX_DOSE_SERIES', 'SPLTTYPE', 'HOSPITAL', 'ER_VISIT', 'COUNTRY'],
|
||||
data = [ [1, 0, 0, 'COVID19', 'PFIZER\BIONTECH', '016M20A', '2', 'dummy', 0, 0, None],
|
||||
[0, 0, 0, 'COVID19', 'MODERNA', '030L20A', '1', 'FRMODERNATX, INC.MOD20224', 0, 0, 'France'],
|
||||
[1, 1, 1, 'COVID19', 'MODERNA', '030L20B', '1', 'FRMODERNATX, INC.MOD20224', 0, 0, 'France'],
|
||||
[0, 1, 1, 'COVID19', 'MODERNA', '030L20B', '1', 'FRMODERNATX, INC.MOD20224', 0, 0, 'United Kingdom']],
|
||||
[1, 1, 1, 'COVID19', 'MODERNA', '030L20B', '1', 'FRMODERNATX, INC.MOD20224', 1, 0, 'France'],
|
||||
[0, 1, 1, 'COVID19', 'MODERNA', '030L20B', '1', 'FRMODERNATX, INC.MOD20224', 1, 0, 'United Kingdom']],
|
||||
index = [
|
||||
"1048786",
|
||||
"1048786",
|
||||
@@ -62,12 +62,12 @@ class BatchCodeTableFactoryTest(unittest.TestCase):
|
||||
|
||||
# Then
|
||||
assert_frame_equal(
|
||||
batchCodeTable[['Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Company', 'Severe reports', 'Lethality']],
|
||||
batchCodeTable[['Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Hospitalization', 'Company', 'Severe reports', 'Lethality']],
|
||||
TestHelper.createDataFrame(
|
||||
columns = ['Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Company', 'Severe reports', 'Lethality'],
|
||||
data = [ [1, 1, 0, 0, 'PFIZER\BIONTECH', 1/1 * 100, 1/1 * 100],
|
||||
[2, 1, 2, 2, 'MODERNA', 2/2 * 100, 1/2 * 100],
|
||||
[1, 0, 0, 0, 'MODERNA', 0/1 * 100, 0/1 * 100]],
|
||||
columns = ['Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Hospitalization', 'Company', 'Severe reports', 'Lethality'],
|
||||
data = [ [1, 1, 0, 0, 0, 'PFIZER\BIONTECH', 1/1 * 100, 1/1 * 100],
|
||||
[2, 1, 2, 2, 2, 'MODERNA', 2/2 * 100, 1/2 * 100],
|
||||
[1, 0, 0, 0, 0, 'MODERNA', 0/1 * 100, 0/1 * 100]],
|
||||
index = pd.Index(
|
||||
[
|
||||
'016M20A',
|
||||
@@ -98,9 +98,9 @@ class BatchCodeTableFactoryTest(unittest.TestCase):
|
||||
|
||||
# Then
|
||||
assert_frame_equal(
|
||||
batchCodeTable[['Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Company', 'Severe reports', 'Lethality']],
|
||||
batchCodeTable[['Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Hospitalization', 'Company', 'Severe reports', 'Lethality']],
|
||||
TestHelper.createDataFrame(
|
||||
columns = ['Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Company', 'Severe reports', 'Lethality'],
|
||||
columns = ['Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Hospitalization', 'Company', 'Severe reports', 'Lethality'],
|
||||
data = [ ],
|
||||
index = pd.Index([], name = 'VAX_LOT')),
|
||||
check_dtype = False)
|
||||
|
||||
@@ -9,6 +9,7 @@ class SummationTableFactory:
|
||||
'Deaths': pd.NamedAgg(column = 'DIED', aggfunc = 'sum'),
|
||||
'Adverse Reaction Reports': pd.NamedAgg(column = 'DIED', aggfunc = 'size'),
|
||||
'Life Threatening Illnesses': pd.NamedAgg(column = 'L_THREAT', aggfunc = 'sum'),
|
||||
'Hospitalization': pd.NamedAgg(column = 'HOSPITAL', aggfunc = 'sum'),
|
||||
'Disabilities': pd.NamedAgg(column = 'DISABLE', aggfunc = 'sum'),
|
||||
'Severities': pd.NamedAgg(column = 'SEVERE', aggfunc = 'sum')
|
||||
})
|
||||
@@ -20,6 +21,7 @@ class SummationTableFactory:
|
||||
'Deaths',
|
||||
'Disabilities',
|
||||
'Life Threatening Illnesses',
|
||||
'Hospitalization',
|
||||
'Severe reports',
|
||||
'Lethality'
|
||||
]]
|
||||
|
||||
17
src/help.txt
17
src/help.txt
@@ -21,6 +21,23 @@ jupyter notebook
|
||||
FK-FIXME:
|
||||
|
||||
FK-TODO:
|
||||
- add HOSPITAL, 'Hospitalization':
|
||||
see: L_THREAT, 'Life Threatening Illnesses'
|
||||
+ BatchCodeTableFactoryTest
|
||||
- DataFrameFilterTest
|
||||
- SevereColumnAdder
|
||||
+ SummationTableFactory
|
||||
- VaersDescrReaderTest
|
||||
- VaersDescrReader
|
||||
|
||||
- AdverseReactionReportsChartView
|
||||
- batchCodes.html
|
||||
- BatchCodeTableInitializer
|
||||
+ BatchCodeTableFactory
|
||||
- BatchCodeTableIntoHistogramDescriptionTableMergerTest
|
||||
- BatchCodeTableIntoHistogramDescriptionTableMerger
|
||||
- BatchCodeTablePersister.py
|
||||
|
||||
|
||||
anacron job:
|
||||
sudo cp src/intensivstationen_howbadismybatch.sh /etc/cron.daily/intensivstationen_howbadismybatch
|
||||
|
||||
Reference in New Issue
Block a user