def setUp(self): """Prepare state for test cases.""" DBTestCase.setUp(self) StrideLoader.build_stride_psql_schemata() ClinicalItemDataLoader.build_clinical_item_psql_schemata() self._deleteTestRecords() self._insertTestRecords()
def setUp(self): """Prepare state for test cases""" DBTestCase.setUp(self) log.info("Populate the database with test data") StrideLoader.build_stride_psql_schemata() ClinicalItemDataLoader.build_clinical_item_psql_schemata() self.orderProcIdStrList = list() headers = [ "order_proc_id", "pat_id", "pat_enc_csn_id", "order_type", "proc_id", "proc_code", "description", "order_time", "instantiated_time", "stand_interval" ] dataModels = \ [ # Deliberately design dates in far future to facilitate isolated testing RowItemModel( [ -417974686, "380873", 111, "Nursing", 1453, "NUR1043", "NURSING PULSE OXIMETRY", "2111-12-10", None, "CONTINUOUS"], headers ), RowItemModel( [ -419697343, "3042640", 222, "Point of Care Testing", 1001, "LABPOCGLU", "GLUCOSE BY METER", "2112-01-13", None, "Q6H"], headers ), RowItemModel( [ -418928388, "-1612899", 333, "Point of Care Testing", 1001, "LABPOCGLU", "GLUCOSE BY METER", "2111-12-28", None, "ONCE"], headers ), RowItemModel( [ -418928399, "-1612899", 333, "Point of Care Testing", 1001, "LABPOCGLU", "GLUCOSE BY METER", "2111-12-28", None, "DAILY"], headers ), # Ignore repeast when consider unique by patient, item, date RowItemModel( [ -418928378, "-1612899", 333, "Point of Care Testing", 1001, "LABPOCGLU", "GLUCOSE BY METER", "2111-12-18", None, "PRN"], headers ), # PRN orders should be ignored RowItemModel( [ -418045499, "2087083", 444, "Nursing", 1428, "NUR1018", "MONITOR INTAKE AND OUTPUT", "2111-12-11", None, None], headers ), RowItemModel( [ -417843774, "2648748", 555, "Nursing", 1508, "NUR1068", "WEIGHT", "2111-12-08", None, "ONCE"], headers ), RowItemModel( [ -419268931, "3039254", 666, "Lab", 1721, "LABPTT", "PTT PARTIAL THROMBOPLASTIN TIME", "2112-01-04", None, "DAILY"], headers ), RowItemModel( [ -419268231, "3039254", 666, "Lab", 1721, "LABPTT", "PTT PARTIAL THROMBOPLASTIN TIME", "2112-01-04", "2112-01-06", "Q6H PRN"], headers ), # Ignore instantiated / spawned child orders RowItemModel( [ -419268937, "3039254", 666, "Lab", 9991721, "LABPTT", "PTT (PARTIAL THROMBOPLASTIN TIME)", "2112-01-05", None, "DAILY"], headers ), # Different proc_id, but same proc_Code. Treat like the same RowItemModel( [ -419268935, "3039254", 777, "Lab", 1721, "LABPTT", "PTT PARTIAL THROMBOPLASTIN TIME", "2112-01-04", "2112-01-07", "ONCE"], headers ), # Primarily only interested in the decision point with the original order ] for dataModel in dataModels: (dataItemId, isNew) = DBUtil.findOrInsertItem("stride_order_proc", dataModel, retrieveCol="order_proc_id") self.orderProcIdStrList.append(str(dataItemId)) # Certain items drawn from order sets headers = [ "order_proc_id", "protocol_id", "protocol_name", "section_name", "smart_group" ] dataModels = \ [ RowItemModel( [ -418928388, -222, "ER General", "Testing", "PoC",], headers ), RowItemModel( [ -418928378, -222, "ER General", "Testing", "PoC",], headers ), RowItemModel( [ -418045499, -111, "General Admit", "Nursing", "Monitoring",], headers ), RowItemModel( [ -419268931, -111, "General Admit", "Lab", "Coag",], headers ), ] for dataModel in dataModels: (dataItemId, isNew) = DBUtil.findOrInsertItem("stride_orderset_order_proc", dataModel, retrieveCol="order_proc_id") self.converter = STRIDEOrderProcConversion()
def setUp(self): """Prepare state for test cases.""" DBTestCase.setUp(self) StrideLoader.build_stride_psql_schemata() ClinicalItemDataLoader.build_clinical_item_psql_schemata() self._deleteTestRecords() self._insertTestRecords() self.factory = FeatureMatrixFactory() self.connection = DBUtil.connection()
def setUp(self): """Prepare state for test cases""" DBTestCase.setUp(self) log.info("Populate the database with test data") StrideLoader.build_stride_psql_schemata() ClinicalItemDataLoader.build_clinical_item_psql_schemata() ###### PREPARE SOME FAKE INPUT DATA TO BE CONVERTED ############## ###### PREPARE SOME FAKE INPUT DATA TO BE CONVERTED ############## ###### PREPARE SOME FAKE INPUT DATA TO BE CONVERTED ############## ###### PREPARE SOME FAKE INPUT DATA TO BE CONVERTED ############## ###### PREPARE SOME FAKE INPUT DATA TO BE CONVERTED ############## dataTextStr = \ """order_proc_anon_id,pat_anon_id,pat_enc_csn_anon_id,proc_code,organism_name,antibiotic_name,suseptibility,shifted_result_time -10,1,2,LABBLC,BACTEROIDES FRAGILIS,Clindamycin,Intermediate,9/10/2111 13:15 -11,2,3,LABBLC,COAG NEGATIVE STAPHYLOCOCCUS,Vancomycin,Susceptible,4/26/2109 9:49 -12,3,4,LABBLC,COAG NEGATIVE STAPHYLOCOCCUS,Oxacillin,Resistant,4/18/2109 4:48 -13,4,5,LABBLC,COAG NEGATIVE STAPHYLOCOCCUS,Vancomycin,Susceptible,3/28/2109 23:21 -14,5,6,LABBLC,ENTEROCOCCUS FAECALIS,Amoxicillin/Clavulanic Acid,Susceptible,6/3/2109 17:07 -14,5,6,LABBLC,ENTEROCOCCUS FAECALIS,Amoxicillin/Clavulanic Acid,Susceptible,6/3/2109 17:07 -20,10,11,LABBLC,ENTEROCOCCUS FAECALIS,Method,,6/10/2109 17:07 -15,6,7,LABBLC2,,,,6/4/2109 17:07 -16,7,8,LABBLC2,,,, -17,10,10,LABBLC2,ENTEROCOCCUS FAECALIS,Penicillin,,6/8/2109 17:07 -17,10,10,LABBLC2,ENTEROCOCCUS FAECALIS,,Intermediate,6/11/2109 17:07 -18,11,11,LABBLC2,ENTEROCOCCUS FAECALIS,Amikacin,Positive,6/11/2111 18:07 """ # Parse into DB insertion object # DBUtil.insertFile( StringIO(dataTextStr), "stride_culture_micro", delim=" ", dateColFormats={"trtmnt_tm_begin_date": None, "trtmnt_tm_end_date": None} ); DBUtil.insertFile(StringIO(dataTextStr), "stride_culture_micro", delim=",", dateColFormats={"shifted_result_time": None}) self.converter = STRIDECultureMicroConversion()
def setUp(self): """Prepare state for test cases""" DBTestCase.setUp(self) log.info("Populate the database with test data") StrideLoader.build_stride_psql_schemata() ClinicalItemDataLoader.build_clinical_item_psql_schemata() dataTextStr = """order_proc_id\tpat_id\tpat_enc_csn_id\torder_type\tproc_id\tproc_code\tdescription -30560253\t-7803\t-1772\tLab\t471521\tLABACETA\tACETAMINOPHEN, SERUM -31300455\t-2168\t-261\tLab\t471521\tLABACETA\tACETAMINOPHEN, SERUM -29501223\t-9860\t-1772\tLab\t471521\tLABACETA\tACETAMINOPHEN, SERUM -31823670\t-2130\t-3897\tLab\t471521\tLABACETA\tACETAMINOPHEN, SERUM -31237072\t-124\t-8391\tLab\t471521\tLABACETA\tACETAMINOPHEN, SERUM -29966444\t-5690\t-1150\tLab\t471521\tLABACETA\tACETAMINOPHEN, SERUM -33197720\t-9926\t-4898\tLab\t471521\tLABACETA\tACETAMINOPHEN, SERUM -36668349\t-9815\t-3658\tLab\t471521\tLABACETA\tACETAMINOPHEN, SERUM -33280031\t-3858\t-6463\tLab\t471521\tLABACETA\tACETAMINOPHEN, SERUM -38543619\t-6562\t-4489\tLab\t898794\tLABCSMP\tCANCER SOMATIC MUTATION PANEL -35954787\t-7074\t-6965\tLab\t898794\tLABCSMP\tCANCER SOMATIC MUTATION PANEL -22793877\t-3261\t-4837\tLab\t471944\tLABCBCD\tCBC WITH DIFF -40604146\t-7480\t-8730\tLab\t896082\t10355R\tHLA - MONITORING BY IGG -33765278\t-4255\t-622\tLab\t896082\t10355R\tHLA - MONITORING BY IGG -39004110\t-5750\t-4953\tLab\t472748\tLABYLEPTN\tLEPTIN -22910018\t-1862\t-621\tLab\t472785\tLABMGN\tMAGNESIUM, SERUM/PLASMA -22840955\t-9532\t-639\tLab\t472837\tLABTNI\tTROPONIN I -21479311\t-9844\t-5135\tLab\t473684\tLABMETB\tMETABOLIC PANEL, BASIC -19231504\t-1518\t-3744\tLab\t473684\tLABMETB\tMETABOLIC PANEL, BASIC -19007449\t-9542\t-4105\tLab\t473684\tLABMETB\tMETABOLIC PANEL, BASIC -1748206\t-1099\t-9890\tLab\t473766\tLABY25VD\tVITAMIN D, 25-HYDROXY -2794591\t-4038\t-6687\tLab\t473766\tLABY25VD\tVITAMIN D, 25-HYDROXY -3580354\t-2795\t-752\tLab\t473766\tLABY25VD\tVITAMIN D, 25-HYDROXY -3347071\t-6139\t-7104\tLab\t473766\tLABY25VD\tVITAMIN D, 25-HYDROXY -4464954\t-4591\t-1383\tLab\t473766\tLABY25VD\tVITAMIN D, 25-HYDROXY -3393444\t-5157\t-5537\tLab\t473766\tLABY25VD\tVITAMIN D, 25-HYDROXY -2658433\t-6894\t-211\tLab\t473766\tLABY25VD\tVITAMIN D, 25-HYDROXY """ DBUtil.insertFile(StringIO(dataTextStr), "stride_order_proc", delim="\t") # Deliberately design dates in far future to facilitate isolated testing dataTextStr = \ """order_proc_id\tline\tresult_time\tcommon_name\tbase_name\tord_num_value\tresult_flag\tresult_in_range_yn -4464954\t2\t5/28/2113 23:28\t25-HYDROXY D3\t25OHD3\t55\tNone\tNone -3580354\t2\t12/17/2113 0:40\t25-HYDROXY D3\t25OHD3\t49\tNone\tNone -3393444\t2\t10/9/2113 5:03\t25-HYDROXY D3\t25OHD3\t65\tNone\tNone -3347071\t2\t9/8/2113 22:10\t25-HYDROXY D3\t25OHD3\t2\tNone\tNone -2794591\t2\t3/19/2113 19:26\t25-HYDROXY D3\t25OHD3\t70\tNone\tNone -2658433\t2\t7/5/2111 0:28\t25-HYDROXY D3\t25OHD3\t45\tNone\tNone -1748206\t2\t7/3/2111 14:21\t25-HYDROXY D3\t25OHD3\t50\tNone\tNone -36668349\t1\t10/30/2111 7:23\tACETAMINOPHEN(ACETA)\tACETA\t7.7\tNone\tNone -33280031\t1\t11/29/2111 7:41\tACETAMINOPHEN(ACETA)\tACETA\t9999999\tNone\tNone -33197720\t1\t11/29/2111 15:22\tACETAMINOPHEN(ACETA)\tACETA\tNone\tNone\tNone -31823670\t1\t11/29/2111 14:08\tACETAMINOPHEN(ACETA)\tACETA\t5.4\tNone\tNone -31300455\t1\t11/29/2111 18:58\tACETAMINOPHEN(ACETA)\tACETA\t270.7\tNone\tNone -31237072\t1\t11/29/2111 5:45\tACETAMINOPHEN(ACETA)\tACETA\t50.6\tNone\tNone -30560253\t1\t11/29/2111 16:13\tACETAMINOPHEN(ACETA)\tACETA\t2.6\tNone\tNone -29966444\t1\t11/29/2111 2:27\tACETAMINOPHEN(ACETA)\tACETA\t4.2\tNone\tNone -29501223\t1\t11/29/2111 0:15\tACETAMINOPHEN(ACETA)\tACETA\t5.1\tNone\tNone -22793877\t4\t11/29/2111 14:36\tHEMATOCRIT(HCT)\tHCT\t19.7\tLow Panic\tNone -22793877\t3\t11/30/2111 7:36\tHEMOGLOBIN(HGB)\tHGB\t7\tLow Panic\tNone -40604146\t15\t12/13/2111 18:12\tINTERPRETATION/ COMMENTS CLASS II 9374R\t9374R\tNone\tNone\tNone -33765278\t10\t9/22/2112 20:26\tINTERPRETATION/ COMMENTS CLASS II 9374R\t9374R\t9999999\tNone\tNone -39004110\t1\t8/26/2112 15:07\tLEPTIN\tYLEPT1\t20\tNone\tNone -22910018\t1\t11/13/2112 8:18\tMAGNESIUM, SER/PLAS(MGN)\tMG\t2.1\tNone\tY -22793877\t6\t10/17/2112 1:09\tMCH(MCH)\tMCH\t31.7\tNone\tY -22793877\t7\t12/13/2112 2:54\tMCHC(MCHC)\tMCHC\t35.4\tNone\tY -22793877\t5\t11/11/2112 2:54\tMCV(MCV)\tMCV\t89.7\tNone\tY -22793877\t9\t1/30/2113 13:28\tPLATELET COUNT(PLT)\tPLT\t11\tLow\tNone -22793877\t2\t7/11/2113 23:24\tRBC(RBC)\tRBC\t2.2\tLow\tNone -22793877\t8\t1/27/2113 14:44\tRDW(RDW)\tRDW\t33.3\tHigh\tNone -21479311\t1\t8/31/2109 15:42\tSODIUM, SER/PLAS\tNA\t142\tNone\tNone -19231504\t1\t8/20/2109 12:22\tSODIUM, SER/PLAS\tNA\t134\tLow\tNone -19007449\t1\t9/13/2109 11:55\tSODIUM, SER/PLAS\tNA\t157\tHigh\tNone -38543619\t15\t10/23/2109 14:30\tTP53(GTP53)\tGTP53\t9999999\tNone\tNone -35954787\t15\t8/19/2109 16:39\tTP53(GTP53)\tGTP53\t9999999\tNone\tNone -22793877\t1\t9/25/2109 16:10\tWBC(WBC)\tWBC\t0.2\tLow Panic\tNone """ DBUtil.insertFile(StringIO(dataTextStr), "stride_order_results", delim="\t", dateColFormats={"result_time": None}) self.converter = STRIDEOrderResultsConversion()
def setUp(self): """Prepare state for test cases""" DBTestCase.setUp(self) log.info("Populate the database with test data") StrideLoader.build_stride_psql_schemata() ClinicalItemDataLoader.build_clinical_item_psql_schemata() self.patientIdStrList = list() headers = [ "pat_id", "pat_enc_csn_id", "noted_date", "resolved_date", "dx_icd9_code", "dx_icd9_code_list", "dx_icd10_code_list", "data_source" ] dataModels = \ [ RowItemModel( ["-126500", -131017780655, "2111-10-14", None, "-431.00", "-431.00,-432","","PROBLEM_LIST"], headers ), RowItemModel( ["-126268", -131015534571, "2111-05-04", None, "-0285", "-0285,-0286","","PROBLEM_LIST"], headers ), RowItemModel( ["-126268", -131015534571, None, None, "-272.4", "-272.4,-273","","PROBLEM_LIST"], headers ), RowItemModel( ["-126268", -131015534571, None, None, "-309.9", "-309.9,-310","","ENC_Dx"], headers ), RowItemModel( ["-126268", -131015534571, "2111-05-18", None, "-785", "-785,-786","","ADMIT_DX"], headers ), RowItemModel( ["-126472", -131015404439, None, None, "-719.46", "-719.46,-720","","ENC_Dx"], headers ), # Repeat, but under different encounter, should be ignored, just base on noted date RowItemModel( ["-126500", -131000000000, "2111-10-14", None, "-431.00", "-431.00,-432","","PROBLEM_LIST"], headers ), RowItemModel( ["-126798", -131014753610, None, None, "-482.9", "-482.9,-483","","ENC_Dx"], headers ), RowItemModel( ["-126798", -131014753610, "2111-03-08", None, "-780", "-780,-781","","ADMIT_DX"], headers ), RowItemModel( ["-126798", -131016557370, "2111-07-26", None, "-780.97", "-780.97,-781","","ADMIT_DX"], headers ), # No matching diagnosis code, will just make up a label then # Different patient, but using ICD9 list instead of ICD9 code # If there is no ICD9 list, and only ICD10 list, we will need # to add special logic and decide whether to try to # cross-reference with ICD9-based Dx'es RowItemModel( ["-2126500", -135000000000, "2111-10-14", None, "", "-431.00,-432","-10431.00,-10432","PROBLEM_LIST"], headers ), RowItemModel( ["-2126798", -135014753610, "2111-06-06", None, "", "-482.9,-483","-10482.9,-10483","PROBLEM_LIST"], headers ), RowItemModel( ["-2126798", -135014753610, "2111-03-08", None, "", "-780","-10780","ADMIT_DX"], headers ), ] for dataModel in dataModels: (dataItemId, isNew) = DBUtil.findOrInsertItem("stride_dx_list", dataModel, retrieveCol="pat_id") self.patientIdStrList.append(str(dataItemId)) self.icd9CUIdStrList = list() headers = ["cui", "ispref", "aui", "tty", "code", "str", "suppress"] dataModels = \ [ RowItemModel( ["-C1", "Y", "-A1", "PT", "-0285", "Diagnosis 1","N"], headers ), RowItemModel( ["-C2b","Y", "-A2b","PT", "-431.0", "Diagnosis 2b","N"], headers ), # Parent diagnoses RowItemModel( ["-C2", "Y", "-A2", "PT", "-431.00", "Diagnosis 2","N"], headers ), RowItemModel( ["-C3", "N", "-A3", "AB", "-431.00", "Diagnosis 3","N"], headers ), # Repeat, but not preferred RowItemModel( ["-C4", "N", "-A4", "HT", "-785", "Diagnosis 4","N"], headers ), RowItemModel( ["-C5", "Y", "-A5", "HT", "-780", "Diagnosis 5","N"], headers ), RowItemModel( ["-C6a","Y", "-A6a","PT", "-780.9", "Diagnosis 6a","N"], headers ), RowItemModel( ["-C6", "Y", "-A6", "PT", "-780.97", "Diagnosis 6","N"], headers ), ] for dataModel in dataModels: (dataItemId, isNew) = DBUtil.findOrInsertItem("stride_icd9_cm", dataModel, retrieveCol="cui") self.icd9CUIdStrList.append(str(dataItemId)) self.icd10_order_number_str_list = list() headers = [ 'order_number', 'icd10', 'hipaa_covered', 'short_description', 'full_description', 'icd10_code' ] data_models = [ RowItemModel([ -1, '-1043100', 1, 'Diagnosis 2', 'Diagnosis 2 Full', '-10431.00' ], headers), RowItemModel([ -2, '-104310', 0, 'Diagnosis 2b', 'Diagnosis 2b Full', '-10431.0' ], headers), RowItemModel( [-6, '-10780', 0, 'Diagnosis 5', 'Diagnosis 5 Full', '-10780'], headers) ] for data_model in data_models: (dataItemId, isNew) = DBUtil.findOrInsertItem("stride_icd10_cm", data_model, retrieveCol='order_number') self.icd10_order_number_str_list.append(str(dataItemId)) self.converter = STRIDEDxListConversion()
def setUp(self): """Prepare state for test cases""" DBTestCase.setUp(self); log.info("Populate the database with test data") StrideLoader.build_stride_psql_schemata() ClinicalItemDataLoader.build_clinical_item_psql_schemata(); self.orderMedIdStrList = list(); headers = ["order_med_id", "pat_id", "pat_enc_csn_id", "ordering_date", "medication_id", "description","freq_name","med_route","number_of_doses"]; dataModels = \ [ # Deliberately design dates in far future to facilitate isolated testing RowItemModel( [ -418063010, "3032765", 111, datetime(2111,12,12, 8,56), 9000000, "ZZZ IMS TEMPLATE","DAILY","PO", None], headers ), RowItemModel( [ -418436155, "1607844", 222, datetime(2111,12,20, 0,40), -1080, "BISACODYL 10 MG PR SUPP","DAILY PRN","PR", None], headers ), RowItemModel( [ -418436145, "1607844", 222, datetime(2111,12,22, 0,40), -1080, "BISACODYL 10 MG PR SUPP","DAILY","PR", None], headers ), RowItemModel( [ -421032269, "2968778", 333, datetime(2112, 2, 8,11,17), -96559, "PIPERACILLIN-TAZOBACTAM-DEXTRS 3.375 GRAM/50 ML IV PGBK","EVERY 6 HOURS","IV", None], headers ), RowItemModel( [ -418011851, "-2429057", 444, datetime(2111,12,10,19, 9), -10011, "FAMOTIDINE 20 MG PO TABS","2 TIMES DAILY","PO", None], headers ), RowItemModel( [ -418013851, "-2429057", 444, datetime(2111,12,10,19,10), -10012, "FAMOTIDINE 40 MG PO TABS","2 TIMES DAILY","PO", None], headers ), RowItemModel( [ -418062652, "3036488", 555, datetime(2111,12,12, 8,30), -5007, "METOPROLOL TARTRATE 5 MG/5 ML IV SOLN 20 mg injection","ONCE","IV", 1], headers ), RowItemModel( [ -418062352, "3016488", 666, datetime(2111,12,13, 8,30), -5007, "METOPROLOL TARTRATE 5 MG/5 ML IV SOLN","ONCE","IV", 1], headers ), RowItemModel( [ -414321352, "3036588", 777, datetime(2111,12,14, 8,30), -5007, "ZZZ IMS TEMPLATE","ONCE","IV", 1], headers ), # Simple mixture in unimportant base RowItemModel( [ -395900000, "1234567", 888, datetime(2111, 1, 2, 3, 0), -520102, "CEFEPIME 2 GM IVPB","ONCE","IV", 1], headers ), RowItemModel( [ -395800000, "1234567", 888, datetime(2111, 1,10, 3, 0), -520102, "CEFEPIME 2 GM IVPB","q8h","IV", 6], headers ), # Fixed number of doses RowItemModel( [ -395700000, "1234567", 888, datetime(2111, 3,10, 3, 0), -520102, "CEFEPIME 2 GM IVPB","q8h","IV", None], headers ), # No dose limit specified # Complex mixtures RowItemModel( [ -392000000, "1234567", 888, datetime(2111, 4, 1, 3, 0), -530000, "IVF Mix","ONCE","IV", 1], headers ), RowItemModel( [ -391000000, "1234567", 888, datetime(2111, 4, 2, 3, 0), -540000, "Mini TPN","ONCE","IV", 1], headers ), RowItemModel( [ -390000000, "1234567", 888, datetime(2111, 5, 2, 3, 0), -550000, "TPN Adult","Continuous","IV", None], headers ), ]; for dataModel in dataModels: (dataItemId, isNew) = DBUtil.findOrInsertItem("stride_order_med", dataModel, retrieveCol="order_med_id" ); self.orderMedIdStrList.append( str(dataItemId) ); # Child table for more detailed mixtures headers = ["order_med_id", "line", "medication_id", "medication_name","ingredient_type_c","ingredient_type"]; dataModels = \ [ # Just a dose combination RowItemModel( [ -418063010, 1, -6494, "PREDNISONE 10 MG PO TABS", 3, "Medications",], headers ), RowItemModel( [ -418063010, 2, -6498, "PREDNISONE 50 MG PO TABS", 3, "Medications",], headers ), # Simple mixture with a base fluid of negligible significance RowItemModel( [ -395900000, 1, -87114, "CEFEPIME 2 GRAM IV SOLR", 3, "Medications",], headers ), RowItemModel( [ -395900000, 2, -2364, "DEXTROSE 5 % IN WATER (D5W) IV SOLP", 1, "Base",], headers ), RowItemModel( [ -395800000, 1, -87114, "CEFEPIME 2 GRAM IV SOLR", 3, "Medications",], headers ), RowItemModel( [ -395800000, 2, -2364, "DEXTROSE 5 % IN WATER (D5W) IV SOLP", 1, "Base",], headers ), RowItemModel( [ -395700000, 1, -87114, "CEFEPIME 2 GRAM IV SOLR", 3, "Medications",], headers ), RowItemModel( [ -395700000, 2, -2364, "DEXTROSE 5 % IN WATER (D5W) IV SOLP", 1, "Base",], headers ), # IVF Mix RowItemModel( [ -392000000, 2, -2367, "DEXTROSE 70 % IN WATER (D70W) IV SOLP", 1, "Base",], headers ), RowItemModel( [ -392000000, 3, -7322, "SODIUM CHLORIDE 4 MEQ/ML IV SOLP", 2, "Additives",], headers ), RowItemModel( [ -392000000, 5, -116034, "POTASSIUM CHLORIDE 2 MEQ/ML IV SOLP", 2, "Additives",], headers ), # Mini mixture, expands RowItemModel( [ -391000000, 1, -203799, "PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP", 1, "Base",], headers ), RowItemModel( [ -391000000, 2, -2367, "DEXTROSE 70 % IN WATER (D70W) IV SOLP", 1, "Base",], headers ), RowItemModel( [ -391000000, 3, -7322, "SODIUM CHLORIDE 4 MEQ/ML IV SOLP", 2, "Additives",], headers ), RowItemModel( [ -391000000, 4, -7351, "SODIUM PHOSPHATE 3 MMOL/ML IV SOLN", 2, "Additives",], headers ), # Complex mixture RowItemModel( [ -390000000, 1, -203799, "PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP", 1, "Base",], headers ), RowItemModel( [ -390000000, 2, -2367, "DEXTROSE 70 % IN WATER (D70W) IV SOLP", 1, "Base",], headers ), RowItemModel( [ -390000000, 3, -7322, "SODIUM CHLORIDE 4 MEQ/ML IV SOLP", 2, "Additives",], headers ), RowItemModel( [ -390000000, 4, -7351, "SODIUM PHOSPHATE 3 MMOL/ML IV SOLN", 2, "Additives",], headers ), RowItemModel( [ -390000000, 5, -116034, "POTASSIUM CHLORIDE 2 MEQ/ML IV SOLP", 2, "Additives",], headers ), RowItemModel( [ -390000000, 6, -1312, "CALCIUM GLUCONATE 100 MG/ML (10%) IV SOLN", 2, "Additives",], headers ), RowItemModel( [ -390000000, 7, -4720, "MAGNESIUM SULFATE 4 MEQ/ML (50 %) INJ SOLN", 2, "Additives",], headers ), RowItemModel( [ -390000000, 8, -8047, "TRACE ELEM ZN-CUPRIC CL-MN-CR 0.8-0.2-0.16 MG IV SOLN", 2, "Additives",], headers ), RowItemModel( [ -390000000, 9, -124215, "MVI, ADULT NO.1 WITH VIT K 3,300 UNIT- 150 MCG/10 ML IV SOLN", 2, "Additives",], headers ), RowItemModel( [ -390000000, 10,-540571, "INSULIN REG HUMAN 100 UNITS/ML INJ", 2, "Additives",], headers ), ]; for dataModel in dataModels: (dataItemId, isNew) = DBUtil.findOrInsertItem("stride_order_medmixinfo", dataModel, retrieveCol="order_med_id" ); # Mapping table to simplify dose headers = ["medication_id", "name", "rxcui", "active_ingredient"]; dataModels = \ [ # If multiple active ingredients in a combo, unravel to active components RowItemModel( [ -96559, "PIPERACILLIN-TAZOBACTAM-DEXTRS 3.375 GRAM/50 ML IV PGBK", -1001, "Piperacillin"], headers ), RowItemModel( [ -96559, "PIPERACILLIN-TAZOBACTAM-DEXTRS 3.375 GRAM/50 ML IV PGBK", -1002, "Tazobactam"], headers ), # Multiple names / dosage totals for the same medication, use this mapping to narrow to a common ingredient RowItemModel( [ -10011, "FAMOTIDINE 20 MG PO TABS", -2001, "Famotidine"], headers ), RowItemModel( [ -10012, "FAMOTIDINE 40 MG PO TABS", -2001, "Famotidine"], headers ), RowItemModel( [ -1080, "BISACODYL 10 MG PR SUPP", -3001, "Bisacodyl"], headers ), RowItemModel( [ -6494, "PREDNISONE 10 MG PO TABS", -4001, "prednisone"], headers ), RowItemModel( [ -6498, "PREDNISONE 50 MG PO TABS", -4001, "prednisone"], headers ), # Simple mixture RowItemModel( [ -87114, "CEFEPIME 2 GRAM IV SOLR", -20481, "cefepime"], headers ), RowItemModel( [ -2364, "DEXTROSE 5% IN WATER (D5W) IV SOLP", -4850, "Glucose"], headers ), # Additional medication level mapping should probably ignored if have mixture components RowItemModel( [ -520102, "CEFEPIME 2 GM IVPB", -20481, "cefepime"], headers ), # Complex ingredients RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -10898, 'Tryptophan',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -11115, 'Valine',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -4919, 'Glycine',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -5340, 'Histidine',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -6033, 'Isoleucine',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -6308, 'Leucine',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -6536, 'Lysine',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -6837, 'Methionine',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -8156, 'Phenylalanine',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -8737, 'Proline',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -9671, 'Serine',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -10524, 'Threonine',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -10962, 'Tyrosine',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -426, 'Alanine',], headers ), RowItemModel( [ -203799, 'PARENTERAL AMINO ACID 10% NO.6 10 % IV SOLP', -1091, 'Arginine',], headers ), RowItemModel( [ -2367, 'DEXTROSE 70% IN WATER (D70W) IV SOLP', -4850, 'Glucose',], headers ), RowItemModel( [ -7322, 'SODIUM CHLORIDE 4 MEQ/ML IV SOLP', -9863, 'Sodium Chloride',], headers ), RowItemModel( [ -7351, 'SODIUM PHOSPHATE 3 MILLIMOLE/ML IV SOLN', -235496, 'Sodium Phosphate, Monobasic',], headers ), RowItemModel( [ -7351, 'SODIUM PHOSPHATE 3 MILLIMOLE/ML IV SOLN', -236719, 'Sodium Phosphate, Dibasic',], headers ), RowItemModel( [ -116034, 'POTASSIUM CHLORIDE 2 MEQ/ML IV SOLP', -8591, 'Potassium Chloride',], headers ), RowItemModel( [ -1312, 'CALCIUM GLUCONATE 100 MG/ML (10%) IV SOLN', -1908, 'Calcium Gluconate',], headers ), RowItemModel( [ -4720, 'MAGNESIUM SULFATE 50 % (4 MEQ/ML) INJ SOLN', -6585, 'Magnesium Sulfate',], headers ), RowItemModel( [ -8047, 'TRACE ELEM ZN-CUPRIC CL-MN-CR 0.8-0.2-0.16 MG IV SOLN', -39937, 'zinc chloride',], headers ), RowItemModel( [ -8047, 'TRACE ELEM ZN-CUPRIC CL-MN-CR 0.8-0.2-0.16 MG IV SOLN', -21032, 'chromous chloride',], headers ), RowItemModel( [ -8047, 'TRACE ELEM ZN-CUPRIC CL-MN-CR 0.8-0.2-0.16 MG IV SOLN', -21579, 'Copper Sulfate',], headers ), RowItemModel( [ -8047, 'TRACE ELEM ZN-CUPRIC CL-MN-CR 0.8-0.2-0.16 MG IV SOLN', -29261, 'manganese chloride',], headers ), RowItemModel( [ -124215, 'MVI, ADULT NO.1 WITH VIT K 1-5-10-200 MG-MCG-MG-MG IV SOLN', -8308, 'Vitamin K 1',], headers ), RowItemModel( [ -124215, 'MVI, ADULT NO.1 WITH VIT K 1-5-10-200 MG-MCG-MG-MG IV SOLN', -89905, 'Multivitamin preparation',], headers ), RowItemModel( [ -540571, 'INSULIN REG HUMAN 100 UNITS/ML INJ', -253182, 'Regular Insulin, Human',], headers ), ]; for dataModel in dataModels: (dataItemId, isNew) = DBUtil.findOrInsertItem("stride_mapped_meds", dataModel, retrieveCol="rxcui" ); # Certain items drawn from order sets headers = ["order_med_id", "protocol_id","protocol_name","section_name","smart_group"]; dataModels = \ [ RowItemModel( [ -418436145, -111, "General Admit", "Medications", "Stool Softeners",], headers ), RowItemModel( [ -421032269, -111, "General Admit", "Medications", "Antibiotics",], headers ), RowItemModel( [ -391000000, -222, "Nutrition", "Infusions", "TPN",], headers ), ]; for dataModel in dataModels: (dataItemId, isNew) = DBUtil.findOrInsertItem("stride_orderset_order_med", dataModel, retrieveCol="order_med_id" ); self.converter = STRIDEOrderMedConversion(); # Instance to test on
def setUp(self): """Prepare state for test cases""" DBTestCase.setUp(self) log.info("Populate the database with test data") StrideLoader.build_stride_psql_schemata() ClinicalItemDataLoader.build_clinical_item_psql_schemata() headers = [ "stride_preadmit_med_id", "pat_anon_id", "contact_date", "medication_id", "description", "thera_class", "pharm_class", "pharm_subclass" ] dataModels = \ [ # Deliberately design dates in far future to facilitate isolated testing RowItemModel([-100, -1000, datetime(2113, 7, 6), -5680, "NORVASC 5 MG PO TABS", "CARDIAC DRUGS", "CALCIUM CHANNEL BLOCKING AGENTS", "Calcium Channel Blockers - Dihydropyridines"], headers ), RowItemModel([-110, -2000, datetime(2110, 3, 8), -6540, "PRILOSEC 20 MG PO CPDR", "GASTROINTESTINAL", "PROTON-PUMP INHIBITORS", "Gastric Acid Secretion Reducing Agents - Proton Pump Inhibitors (PPIs)"], headers ), RowItemModel([-120, -2000, datetime(2110, 3, 8), -8113, "TRIAMCINOLONE 0.1% CREAM", "SKIN PREPS", "TOPICAL ANTI-INFLAMMATORY STEROIDAL", "Dermatological - Glucocorticoid"], headers ), # Multiple or no mappings RowItemModel([-130, -3000, datetime(2109, 9,20),-126745, "NORETHINDRN ESTRADIOL", "CONTRACEPTIVES", "CONTRACEPTIVES,ORAL", "Contraceptive Oral - Monophasic"], headers ), RowItemModel([-140, -4000, datetime(2110, 5, 4), -28384, "HYDROCODONE-ACETAMINOPHEN 10-325 MG PO TABS", "ANALGESICS", "ANALGESICS, NARCOTICS", "Analgesic Narcotic Hydrocodone Combinations"], headers ), # Excessively complex mapping RowItemModel([-150, -5000, datetime(2108, 8, 6), -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", "BIOLOGICALS", "GRAM POSITIVE COCCI VACCINES", "Vaccine Bacterial - Gram Positive Cocci"], headers ), ] for dataModel in dataModels: (dataItemId, isNew) = DBUtil.findOrInsertItem("stride_preadmit_med", dataModel, retrieveCol="pat_anon_id") # Mapping table to simplify dose headers = ["medication_id", "name", "rxcui", "active_ingredient"] dataModels = \ [ # Mappings to active ingredients RowItemModel( [ -5680, "NORVASC 5 MG PO TABS", -17767, "Amlodipine"], headers ), RowItemModel( [ -6540, "PRILOSEC 20 MG PO CPDR", -7646, "Omeprazole"], headers ), RowItemModel( [ -8113, "TRIAMCINOLONE ACETONIDE 0.1 % TP CREA", -10759, "Triamcinolone"], headers ), # If multiple active ingredients in a combo, unravel to active components RowItemModel( [ -28384, "HYDROCODONE-ACETAMINOPHEN 10-325 MG PO TABS", -161, "Acetaminophen"], headers ), RowItemModel( [ -28384, "HYDROCODONE-ACETAMINOPHEN 10-325 MG PO TABS", -5489, "Hydrocodone"], headers ), # No mapping entries for Norethindrone+Estradiol # Excessive mappings for pneumovax RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854930, "pneumococcal capsular polysaccharide type 1 vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854932, "pneumococcal capsular polysaccharide type 10A vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854934, "pneumococcal capsular polysaccharide type 11A vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854936, "pneumococcal capsular polysaccharide type 12F vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854938, "pneumococcal capsular polysaccharide type 14 vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854940, "pneumococcal capsular polysaccharide type 15B vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854942, "pneumococcal capsular polysaccharide type 17F vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854944, "pneumococcal capsular polysaccharide type 18C vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854946, "pneumococcal capsular polysaccharide type 19A vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854948, "pneumococcal capsular polysaccharide type 19F vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854950, "pneumococcal capsular polysaccharide type 2 vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854952, "pneumococcal capsular polysaccharide type 20 vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854954, "pneumococcal capsular polysaccharide type 22F vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854956, "pneumococcal capsular polysaccharide type 23F vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854958, "pneumococcal capsular polysaccharide type 3 vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854960, "pneumococcal capsular polysaccharide type 33F vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854962, "pneumococcal capsular polysaccharide type 4 vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854964, "pneumococcal capsular polysaccharide type 5 vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854966, "pneumococcal capsular polysaccharide type 6B vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854968, "pneumococcal capsular polysaccharide type 7F vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854970, "pneumococcal capsular polysaccharide type 8 vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854972, "pneumococcal capsular polysaccharide type 9N vaccine"], headers ), RowItemModel( [ -95140, "PNEUMOCOCCAL 23-VALPS VACCINE 25 MCG/0.5 ML INJ INJ", -854974, "pneumococcal capsular polysaccharide type 9V vaccine"], headers ), ] for dataModel in dataModels: (dataItemId, isNew) = DBUtil.findOrInsertItem("stride_mapped_meds", dataModel, retrieveCol="rxcui") self.converter = STRIDEPreAdmitMedConversion()
def setUp(self): """Prepare state for test cases""" DBTestCase.setUp(self) log.info("Populate the database with test data") StrideLoader.build_stride_psql_schemata() ClinicalItemDataLoader.build_clinical_item_psql_schemata() dataTextStr = \ """pat_id\tdeath_date\tbirth_year\tgender\trace\tethnicity -100\tNone\t1958\tMALE\tAMERICAN INDIAN OR ALASKA NATIVE\tNON-HISPANIC/NON-LATINO -200\tNone\t1992\tMALE\tAMERICAN INDIAN OR ALASKA NATIVE\tHISPANIC/LATINO -300\tNone\t1993\tFEMALE\tASIAN\tNON-HISPANIC/NON-LATINO -400\t2011-09-28\t1997\tFEMALE\tASIAN\tHISPANIC/LATINO -500\tNone\t1952\tMALE\tASIAN\tPATIENT REFUSED -600\tNone\t1984\tMALE\tASIAN\tUNKNOWN -700\tNone\t1991\tFEMALE\tASIAN - HISTORICAL CONV\tNON-HISPANIC/NON-LATINO -800\tNone\t1962\tMALE\tASIAN, HISPANIC\tUNKNOWN -900\tNone\t1972\tMALE\tASIAN, HISPANIC\tHISPANIC/LATINO -1000\tNone\t1970\tMALE\tASIAN, NON-HISPANIC\tNON-HISPANIC/NON-LATINO -1100\tNone\t2001\tFEMALE\tASIAN, NON-HISPANIC\tUNKNOWN -1200\tNone\t1969\tFEMALE\tBLACK OR AFRICAN AMERICAN\tNON-HISPANIC/NON-LATINO -1300\tNone\t1945\tFEMALE\tBLACK OR AFRICAN AMERICAN\tHISPANIC/LATINO -1400\tNone\t1945\tFEMALE\tBLACK OR AFRICAN AMERICAN\tUNKNOWN -1500\t2012-05-02\t1956\tMALE\tBLACK OR AFRICAN AMERICAN\tPATIENT REFUSED -1600\tNone\t1981\tFEMALE\tBLACK, HISPANIC\tHISPANIC/LATINO -1700\tNone\t1985\tFEMALE\tBLACK, HISPANIC\tUNKNOWN -1800\tNone\t1932\tMALE\tBLACK, NON-HISPANIC\tNON-HISPANIC/NON-LATINO -1900\tNone\t1954\tMALE\tBLACK, NON-HISPANIC\tUNKNOWN -2000\tNone\t1932\tMALE\tNATIVE AMERICAN, HISPANIC\tHISPANIC/LATINO -2100\tNone\t1961\tFEMALE\tNATIVE AMERICAN, NON-HISPANIC\tUNKNOWN -2200\tNone\t1974\tMALE\tNATIVE HAWAIIAN OR OTHER PACIFIC ISLANDER \tNON-HISPANIC/NON-LATINO -2300\tNone\t1953\tFEMALE\tNATIVE HAWAIIAN OR OTHER PACIFIC ISLANDER \tHISPANIC/LATINO -2400\tNone\t1943\tFEMALE\tNATIVE HAWAIIAN OR OTHER PACIFIC ISLANDER \tUNKNOWN -2500\tNone\t1963\tFEMALE\tOTHER\tHISPANIC/LATINO -2600\tNone\t1974\tMALE\tOTHER\tNON-HISPANIC/NON-LATINO -2700\tNone\t1963\tFEMALE\tOTHER\tPATIENT REFUSED -2800\tNone\t2005\tFEMALE\tOTHER\tUNKNOWN -2900\tNone\t1996\tMALE\tOTHER, HISPANIC\tUNKNOWN -3000\tNone\t1952\tMALE\tOTHER, HISPANIC\tHISPANIC/LATINO -3100\tNone\t1983\tFEMALE\tOTHER, HISPANIC\tNON-HISPANIC/NON-LATINO -3200\tNone\t1971\tFEMALE\tOTHER, NON-HISPANIC\tNON-HISPANIC/NON-LATINO -3300\tNone\t1976\tMALE\tOTHER, NON-HISPANIC\tUNKNOWN -3400\tNone\t1995\tFEMALE\tOTHER, NON-HISPANIC\tHISPANIC/LATINO -3500\tNone\t1982\tMALE\tPACIFIC ISLANDER, NON-HISPANIC\tNON-HISPANIC/NON-LATINO -3600\tNone\t1940\tMALE\tPACIFIC ISLANDER, NON-HISPANIC\tUNKNOWN -3700\tNone\t1934\tMALE\tPATIENT REFUSED\tPATIENT REFUSED -3800\tNone\t1981\tFEMALE\tPATIENT REFUSED\tNON-HISPANIC/NON-LATINO -3900\tNone\t1998\tMALE\tPATIENT REFUSED\tHISPANIC/LATINO -4000\tNone\t1978\tMALE\tRACE AND ETHNICITY UNKNOWN\tUNKNOWN -4100\tNone\t1933\tFEMALE\tRACE AND ETHNICITY UNKNOWN\tNON-HISPANIC/NON-LATINO -4200\tNone\t1997\tFEMALE\tUNKNOWN\tUNKNOWN -4300\tNone\t1932\tMALE\tUNKNOWN\tNON-HISPANIC/NON-LATINO -4400\t2012-11-13\t1947\tFEMALE\tUNKNOWN\tHISPANIC/LATINO -4500\tNone\t1932\tMALE\tUNKNOWN\tPATIENT REFUSED -4600\tNone\t1936\tMALE\tUNKNOWN\t -4700\tNone\t1993\tFEMALE\tWHITE\tNON-HISPANIC/NON-LATINO -4800\tNone\t1948\tMALE\tWHITE\tHISPANIC/LATINO -4900\tNone\t1968\tMALE\tWHITE\tUNKNOWN -5000\tNone\t2003\tFEMALE\tWHITE\tPATIENT REFUSED -5100\tNone\t1970\tMALE\tWHITE\t -5200\tNone\t1998\tMALE\tWHITE, HISPANIC\tHISPANIC/LATINO -5300\tNone\t1986\tMALE\tWHITE, HISPANIC\tUNKNOWN -5400\tNone\t1997\tFEMALE\tWHITE, HISPANIC\tNON-HISPANIC/NON-LATINO -5500\tNone\t1964\tMALE\tWHITE, NON-HISPANIC\tNON-HISPANIC/NON-LATINO -5600\tNone\t1940\tMALE\tWHITE, NON-HISPANIC\tUNKNOWN -5700\tNone\t1962\tMALE\tWHITE, NON-HISPANIC\tHISPANIC/LATINO -5800\tNone\t1931\tFEMALE\tNone\tNone -5900\tNone\t1991\tFEMALE\tNone\tNON-HISPANIC/NON-LATINO -6000\tNone\t1973\tFEMALE\tNone\tUNKNOWN -6050\tNone\tNone\tNone\tNone\tNone -6100\tNone\t1953\tFEMALE\tNone\tHISPANIC/LATINO """ self.patientIds = [ "-100", "-200", "-300", "-400", "-500", "-600", "-700", "-800", "-900", "-1000", "-1100", "-1200", "-1300", "-1400", "-1500", "-1600", "-1700", "-1800", "-1900", "-2000", "-2100", "-2200", "-2300", "-2400", "-2500", "-2600", "-2700", "-2800", "-2900", "-3000", "-3100", "-3200", "-3300", "-3400", "-3500", "-3600", "-3700", "-3800", "-3900", "-4000", "-4100", "-4200", "-4300", "-4400", "-4500", "-4600", "-4700", "-4800", "-4900", "-5000", "-5100", "-5200", "-5300", "-5400", "-5500", "-5600", "-5700", "-5800", "-5900", "-6000", "-6050", "-6100" ] # Parse into DB insertion object DBUtil.insertFile(StringIO(dataTextStr), "stride_patient", delim="\t", dateColFormats={"death_date": None}) self.converter = STRIDEDemographicsConversion()