diff --git a/src/BatchCodeTableFactory.py b/src/BatchCodeTableFactory.py index 8897e4e563e..6b0739c4569 100644 --- a/src/BatchCodeTableFactory.py +++ b/src/BatchCodeTableFactory.py @@ -21,6 +21,7 @@ class BatchCodeTableFactory: 'Deaths', 'Disabilities', 'Life Threatening Illnesses', + 'Hospitalization', 'Company', 'Severe reports', 'Lethality' diff --git a/src/BatchCodeTableFactoryTest.py b/src/BatchCodeTableFactoryTest.py index a77f1353b6b..005bafec71f 100644 --- a/src/BatchCodeTableFactoryTest.py +++ b/src/BatchCodeTableFactoryTest.py @@ -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) diff --git a/src/SummationTableFactory.py b/src/SummationTableFactory.py index 0d1c0c6c1f2..5492fc096ff 100644 --- a/src/SummationTableFactory.py +++ b/src/SummationTableFactory.py @@ -8,7 +8,8 @@ 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'), + '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' ]] diff --git a/src/help.txt b/src/help.txt index f2c610ac34a..84f686b18e7 100644 --- a/src/help.txt +++ b/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