adding convertVAX_LOTColumnToUpperCase() in VaersDescrReader

This commit is contained in:
frankknoll
2023-01-27 10:54:48 +01:00
parent 702d48aaf7
commit 68fcb4da40
4 changed files with 8 additions and 74 deletions

View File

@@ -167,45 +167,3 @@ class SymptomByBatchcodeTableFactoryTest(unittest.TestCase):
index = pd.MultiIndex.from_tuples(
names = ['VAX_LOT1', 'VAX_LOT2'],
tuples = [['1808982', 'EW0175']] * 13 + [['EW0167', 'EW0175']] * 10)))
def test_createSymptomByBatchcodeTable_after_convertVAX_LOTColumnToUpperCase(self):
# Given
VAX_LOT = 'EW0175'
VAX_LOT_lower = VAX_LOT.lower()
VAERSVAX = TestHelper.createDataFrame(
columns = ['VAX_TYPE', 'VAX_MANU', 'VAX_LOT', 'VAX_DOSE_SERIES'],
data = [ ['COVID19', 'JANSSEN', VAX_LOT, '1'],
['COVID19', 'JANSSEN', VAX_LOT_lower, '1']],
index = pd.Index(
name = 'VAERS_ID',
data=[
2547730,
2547731]),
dtypes = {
'VAX_DOSE_SERIES': 'string',
'VAX_LOT': 'string'})
VAERSSYMPTOMS = TestHelper.createDataFrame(
columns = ['SYMPTOM1', 'SYMPTOM2', 'SYMPTOM3', 'SYMPTOM4', 'SYMPTOM5'],
data = [ ['Blood pressure orthostatic abnormal', np.nan, np.nan, np.nan, np.nan],
['Blood pressure orthostatic abnormal', np.nan, np.nan, np.nan, np.nan]],
index = pd.Index(
name = 'VAERS_ID',
data=[
2547730,
2547731]))
# When
symptomByBatchcodeTable = SymptomByBatchcodeTableFactory.createSymptomByBatchcodeTable(VAERSVAX, VAERSSYMPTOMS)
# Then
assert_frame_equal(
symptomByBatchcodeTable,
TestHelper.createDataFrame(
columns = ['SYMPTOM'],
data = [ ['Blood pressure orthostatic abnormal'],
['Blood pressure orthostatic abnormal']],
index = pd.Index(
name = 'VAX_LOT1',
data = [VAX_LOT,
VAX_LOT])),
check_dtype = False)