How to use reportOutput method in fMBT

Best Python code snippet using fMBT_python

Lupin_general_validations.py

Source:Lupin_general_validations.py Github

copy

Full Screen

1import pyodbc2from shutil import ReadError3defaultchannels = ['Commercial w/o Managed Medicaid', 'Managed Medicaid']4defaultRegions = ['43000', '44000', '99000']5cnxnto15Db = pyodbc.connect(6 'DRIVER={SQL Server Native Client 10.0};SERVER=10.0.0.15;PORT=1433;DATABASE=Reports_DB;UID=m1bqc;PWD=m1b0813')7cnxnto36Db = pyodbc.connect(8 'DRIVER={SQL Server Native Client 10.0};SERVER=10.0.0.36;PORT=1433;DATABASE=M1B_LupRx;UID=m1bqc;PWD=m1bqc@0813')9cursor = cnxnto15Db.cursor()10cursorOn36Db = cnxnto36Db.cursor()11Suprax_TRX_drugs = ['cefdinir', 'Suprax']12WomensHealthCare_TQTY_drugs = ['Cleocin Vaginal', 'Cleocin Vaginal Ovules', 'clindamycin phosphate vaginal cream',13 'Clindesse', 'Flagyl', 'Metrogel-Vaginal', 'metronidazole', 'metronidazole vaginal',14 'Nuvessa', 'Solosec', 'Tindamax', 'tinidazole']15ReportOutput = []16RAWDbOutputSupraxCapTabManagedMedicaid = []17RAWDbOutputSupraxCapTabcommercialwithoutManagedMedicaid = []18RAWDBMattyWomensHealthcarecommercialwithoutManagedMedicaid = []19RAWDBMattyWomensHealthcare_Managed_Medicaid = []20def CheckRegions_For_Report():21 regionQuery1 = "SELECT DISTINCT Region FROM LupinAllPrescribersReportData"22 regionQueryoutput = cursor.execute(regionQuery1)23 region = regionQueryoutput.fetchall()24 regionlist = []25 for i in range(list(region).__len__()):26 regionlist.append(tuple(region[i]).__getitem__(0))27 Missing_Regions_IN_All_PrescriberReport = set(regionlist) - set(defaultRegions)28 if (Missing_Regions_IN_All_PrescriberReport.__len__()) == 0:29 print("The region is matching aganist The Requiement")30 else:31 print("The region is not matching against The Reqirement")32 print(Missing_Regions_IN_All_PrescriberReport)33 return Missing_Regions_IN_All_PrescriberReport.__len__()34#### Checking Channel for Suprax _TRX ######35def Channels_Suprax_TRX():36 Channels_Suprax_TRX_query = "Select DISTINCT CHANNEL [Suprax_TRX] FROM LupinAllPrescribersReportData Where REPORT_NO =3"37 Channels_Suprax_TRX_query_output = cursor.execute(Channels_Suprax_TRX_query)38 Suprax_TRX_ReportChannel = Channels_Suprax_TRX_query_output.fetchall()39 Suprax_TRX_ReportChannel_list1 = []40 #print(ReportChannel)41 for i in range(list(Suprax_TRX_ReportChannel).__len__()):42 Suprax_TRX_ReportChannel_list1.append(tuple(Suprax_TRX_ReportChannel[i]).__getitem__(0))43 Missing_Channels_IN_Suprax_TRX = set(Suprax_TRX_ReportChannel_list1) - set(defaultchannels)44 ##print(res)45 if(Missing_Channels_IN_Suprax_TRX.__len__())==0:46 print("The Channel is matching aganist The Requiement")47 else:48 print("The Channel is not matching against The Reqirement")49 return Missing_Channels_IN_Suprax_TRX.__len__()50#### Checking Channel for WomensHealthCare_TQTY ######51def Channels_WomensHealthCare_TQTY():52 Channels_WomensHealthCare_TQTY_query1 = "Select DISTINCT CHANNEL [Antara NRX] FROM LupinAllPrescribersReportData Where REPORT_NO =4"53 Channels_WomensHealthCare_TQTY_output1 = cursor.execute(Channels_WomensHealthCare_TQTY_query1)54 WomensHealthCare_TQTY_ReportChannel = Channels_WomensHealthCare_TQTY_output1.fetchall()55 WomensHealthCare_TQTY_list1 = []56 # print(ReportChannel)57 for i in range(list(WomensHealthCare_TQTY_ReportChannel).__len__()):58 WomensHealthCare_TQTY_list1.append(tuple(WomensHealthCare_TQTY_ReportChannel[i]).__getitem__(0))59 Missing_Chhanels_InWomensHealthCare_TQTY = set(WomensHealthCare_TQTY_list1) - set(defaultchannels)60 ##print(Missing_Chhanels_InWomensHealthCare_TQTY)61 if(Missing_Chhanels_InWomensHealthCare_TQTY.__len__())==0:62 print("The Channel is matching aganist The Requiement")63 else:64 print("The Channel is not matching against The Reqirement")65 return Missing_Chhanels_InWomensHealthCare_TQTY.__len__()66#### Checking Drugs for Suprax_TRX ######67def Drugs_Suprax_TRX():68 query3 = "Select DISTINCT [Drug Name] [Suprax TRX] FROM LupinAllPrescribersReportData Where REPORT_NO =3"69 output3 = cursor.execute(query3)70 ReportDrugs = output3.fetchall()71 list1 = []72 # print(ReportChannel)73 for i in range(list(ReportDrugs).__len__()):74 list1.append(tuple(ReportDrugs[i]).__getitem__(0))75 res = set(list1) - set(Suprax_TRX_drugs)76 print(res)77 return res.__len__()78#### Checking Drugs for WomensHealthCare_TQTY ######79def Drugs_WomensHealthCare_TQTY():80 query4 = "Select DISTINCT [Drug Name] [Suprax TRX] FROM LupinAllPrescribersReportData Where REPORT_NO =4"81 output4 = cursor.execute(query4)82 ReportDrugs1 = output4.fetchall()83 list1 = []84 # print(ReportChannel)85 for i in range(list(ReportDrugs1).__len__()):86 list1.append(tuple(ReportDrugs1[i]).__getitem__(0))87 res = set(list1) - set(WomensHealthCare_TQTY_drugs)88 print(res)89 return res.__len__()90### Getting The Report Matty and saving it into a Variable "ReportMatty" ###91def Report_Matty():92 global ReportOutput93 query5 = """ SELECT Channel,[Drug Name],[Prescriber Name],[Prescriber ME #],Region,Report_NO,94 CASE 95 WHEN REPORT_NO=1 THEN 'Antara Market TRX'96 WHEN REPORT_No=2 THEN 'Antara Market NRX'97 WHEN REPORT_No=3 THEN 'Suprax Chew MAREKT TRX'98 WHEN REPORT_No=4 THEN 'Womens Health Care Market TQTY' END AS MARKET ,sum(Matty) Matty99 into #tmp FROM LupinAllPrescribersReportData100 group by Channel,Report_No,[Drug Name],[Prescriber Name],[Prescriber ME #],Region,Report_NO101 order by sum(Matty) desc 102 """103 output5 = cursor.execute(query5)104 ##tempReportMatty = output5.fetchall()105 query6= """ SELECT MARKET,Channel,Region,SUM(MATTY) AS Matty FROM #tmp WHERE MARKET IN ('Suprax Chew MAREKT TRX','Womens Health Care Market TQTY')106 GROUP BY Region,Channel,MARKET107 ORDER BY MARKET,Region,Channel 108 """109 output6 = cursor.execute(query6)110 ReportMatty = output6.fetchall()111 print("-------------------Report OutPut-----------------")112 for each in range(list(ReportMatty).__len__()):113 ##print("Report Matty is :---------",ReportMatty)114 ##ReportOutput.append(ReportMatty[each][0]+"|"+str(ReportMatty[each][1])+"|"+str(ReportMatty[each][2])+"|"+str(round(ReportMatty[each][3],2)))115 ReportOutput.append(ReportMatty[each][0] + "|" + ReportMatty[each][1] + "|" + str(ReportMatty[each][2]) + "|" + str(ReportMatty[each][3]))116 print(ReportOutput)117### Getting The Matty of Suprax Cap Tab TRX for Managed medicaid Cahhenl ###118def RAWDBMattySupraxCapTabManagedMedicaid():119 global RAWDbOutputSupraxCapTabManagedMedicaid120 rawDbQuery1= """ Select regionid,BUID,ME_NO,SRA2 IMSDR_Key,F_NM,L_NM,c.drug_name DrugName,Case when F.IMS_NUM IS NULL Then 'N' else 'Y' End as PDRP,121 SUM(TRX1+TRX2+TRX3+TRX4+TRX5+TRX6+TRX7+TRX8+TRX9+TRX10+TRX11+TRX12) Matty 122 into #MMRX_Thera_Name1 from EXT_RAW_DATA A 123 INNER JOIN DI_MASTER.dbo.MHC_EXT_DRUG_REL B ON A.PROD_ID=B.EXT_DRUG_ID AND B.CLIENT_ID = 2 AND B.STATUS='A' 124 Inner join [B1-124].M1B_DF.DBO.MASTER_THERA_Class H ON B.THERA_ID=H.THERA_ID AND Thera_Name='Antibiotics Market Suprax Cap/Tab'--Change Thera125 INNER JOIN [B1-124].M1B_DF.DBO.MASTER_THERA_DRUG C ON B.DRUG_BRD_ID=C.DRUG_ID AND C.DRUG_STRENGTH='ALL' 126 AND C.DRUG_NAME in ('cefdinir','Suprax')--Change Drugs as per market 127 INNER JOIN DI_MASTER..TMP_ENTITY_IMS_XREF D ON A.PAYER_PLAN_CD=D.PAYER_PLAN_ID 128 INNER JOIN [B1-124].[BOTMAster].Dbo.VWLinkageChannelXref G ON D.Channel_id=G.Subchannelid AND G.subchannel='managed Medicaid'--Change Channel129 LEFT JOIN DF_PDRP_LIST F ON A.SRA2=F.IMS_NUM 130 Inner join [B1-124].M1B_LUP.dbo.PrescriberAlignment T on A.SRA2=T.IMSID and BUID is not null 131 inner join [b1-124].M1B_LUP.DBO.MHC_SLS_ORG_RETL u132 on u.LVL_NO=1 AND u.THERA_ID=774 and t.TerritoryID=u.RETL_TERR_ID133 Group by RegionID,BUID,ME_NO,SRA2,F_NM,L_NM,c.drug_name,Case when F.IMS_NUM IS NULL Then 'N' else 'Y' End134 """135 rawDbOutput1=cursorOn36Db.execute(rawDbQuery1)136 rawDbQuery2=""" Select ME_NO,IMSDR_Key,F_NM,L_NM,DrugName,RegionID,PDRP,Matty into #tmp1 FROM #MMRX_Thera_Name1137 Where PDRP='N' AND RegionID NOT IN ('41000','42000')138 Group BY ME_NO,IMSDR_Key,F_NM,L_NM,DrugName,RegionID,PDRP,Matty139 """140 rawDbOutput2=cursorOn36Db.execute(rawDbQuery2)141 rawDbQuery4=""" SELECT RegionID,SUM(MATTY) FROM #tmp1 GROUP BY RegionID """142 rawDbOutput4 = cursorOn36Db.execute(rawDbQuery4)143 RAWDbMatty = rawDbOutput4.fetchall()144 for each in range(list(RAWDbMatty).__len__()):145 print("-------------------RAW DB OutPut-----------------")146 RAWDbOutputSupraxCapTabManagedMedicaid.append("Suprax Chew MAREKT TRX" + "|" + "Managed Medicaid"+ "|" + RAWDbMatty[each][0] + "|" + str(RAWDbMatty[each][1]))147 print(RAWDbOutputSupraxCapTabManagedMedicaid)148### Comparing The Matty of Suprax Cap Tab TRX for Managed medicaid Channel against Report Matty ###149def CompareMattySupraxCapTabManagedMedicaid():150 global ReportOutput151 Report_Matty()152 RAWDBMattySupraxCapTabManagedMedicaid()153 count = 0154 #print(ReportOutput)155 for i in range(RAWDbOutputSupraxCapTabManagedMedicaid.__len__()):156 item = RAWDbOutputSupraxCapTabManagedMedicaid[i]157 print("item ", item)158 if (ReportOutput.__contains__(item)):159 print("passed")160 else:161 count = count + 1162 print("Failed")163 return count164### Getting The Matty of Suprax Cap Tab TRX for Commercial w/o Managed medicaid Channel ###165def RAWDBMattySupraxCapTabcommercialwithoutManagedMedicaid():166 global RAWDbOutputSupraxCapTabcommercialwithoutManagedMedicaid167 rawDbQuery2 = """ Select regionid,BUID,ME_NO,SRA2 IMSDR_Key,F_NM,L_NM,c.drug_name DrugName,Case when F.IMS_NUM IS NULL Then 'N' else 'Y' End as PDRP,168 SUM(TRX1+TRX2+TRX3+TRX4+TRX5+TRX6+TRX7+TRX8+TRX9+TRX10+TRX11+TRX12) Matty 169 into #MMRX_Thera_Name2 from EXT_RAW_DATA A 170 INNER JOIN DI_MASTER.dbo.MHC_EXT_DRUG_REL B ON A.PROD_ID=B.EXT_DRUG_ID AND B.CLIENT_ID = 2 AND B.STATUS='A' 171 Inner join [B1-124].M1B_DF.DBO.MASTER_THERA_Class H ON B.THERA_ID=H.THERA_ID AND Thera_Name='Antibiotics Market Suprax Cap/Tab'--Change Thera172 INNER JOIN [B1-124].M1B_DF.DBO.MASTER_THERA_DRUG C ON B.DRUG_BRD_ID=C.DRUG_ID AND C.DRUG_STRENGTH='ALL' 173 AND C.DRUG_NAME in ('cefdinir','Suprax')--Change Drugs as per market 174 INNER JOIN DI_MASTER..TMP_ENTITY_IMS_XREF D ON A.PAYER_PLAN_CD=D.PAYER_PLAN_ID 175 INNER JOIN [B1-124].[BOTMAster].Dbo.VWLinkageChannelXref G ON D.Channel_id=G.Subchannelid AND G.subchannel='commercial w/o managed Medicaid'--Change Channel176 LEFT JOIN DF_PDRP_LIST F ON A.SRA2=F.IMS_NUM 177 Inner join [B1-124].M1B_LUP.dbo.PrescriberAlignment T on A.SRA2=T.IMSID and BUID is not null178 inner join [b1-124].M1B_LUP.DBO.MHC_SLS_ORG_RETL u179 on u.LVL_NO=1 AND u.THERA_ID=774 and t.TerritoryID=u.RETL_TERR_ID180 Group by RegionID,BUID,ME_NO,SRA2,F_NM,L_NM,c.drug_name,Case when F.IMS_NUM IS NULL Then 'N' else 'Y' End181 """182 rawDbOutput2 = cursorOn36Db.execute(rawDbQuery2)183 rawDbQuery3 = """ Select ME_NO,IMSDR_Key,F_NM,L_NM,DrugName,RegionID,PDRP,Matty into #tmp2 FROM #MMRX_Thera_Name2184 Where PDRP='N' AND RegionID NOT IN ('41000','42000')185 Group BY ME_NO,IMSDR_Key,F_NM,L_NM,DrugName,RegionID,PDRP,Matty186 """187 rawDbOutput3 = cursorOn36Db.execute(rawDbQuery3)188 rawDbQuery5 = """ SELECT RegionID,SUM(MATTY) FROM #tmp2 GROUP BY RegionID """189 rawDbOutput5 = cursorOn36Db.execute(rawDbQuery5)190 RAWDbMatty2 = rawDbOutput5.fetchall()191 for each in range(list(RAWDbMatty2).__len__()):192 print("-------------------RAW DB OutPut-----------------")193 RAWDbOutputSupraxCapTabcommercialwithoutManagedMedicaid.append("Suprax Chew MAREKT TRX" + "|" + "Commercial w/o Managed Medicaid" + "|" + RAWDbMatty2[each][0] + "|" + str(RAWDbMatty2[each][1]))194 ###RAWDbOutputSupraxCapTabManagedMedicaid.append ("Suprax Chew MAREKT TRX" + "|" + "Commercial w/o Managed Medicaid" + "|" + RAWDbMatty2[each][0] + "|" + str(RAWDbMatty2[each][1]))195 print(RAWDbOutputSupraxCapTabcommercialwithoutManagedMedicaid)196### Comparing The Matty of Suprax Cap Tab TRX for Commercial w/o Managed medicaid Channel against Report Matty ###197def CompareMattySupraxCapTabcommercialwoManagedMedicaid():198 global ReportOutput,RAWDbOutputSupraxCapTabcommercialwithoutManagedMedicaid199 #Report_Matty()200 RAWDBMattySupraxCapTabcommercialwithoutManagedMedicaid()201 count1 = 0202 print("------------------ReportOutput----------------------",ReportOutput)203 for i in range(RAWDbOutputSupraxCapTabcommercialwithoutManagedMedicaid.__len__()):204 item1 = RAWDbOutputSupraxCapTabcommercialwithoutManagedMedicaid[i]205 print("item1 ",item1)206 if(ReportOutput.__contains__(item1)):207 print("passed")208 else:209 count1 = count1 + 1210 print("Failed")211 """ for j in range(ReportOutput.__len__()):212 print(ReportOutput[j])213 if (ReportOutput[j] == item1):214 print(" comming")215 else:216 count1 = count1 + 1"""217 return count1218### Getting The Matty of Womens' Healthcare TQTY for Managed medicaid Channel ###219def RAWDBMattyWomensHealthcareManagedMedicaid():220 global RAWDBMattyWomensHealthcare_Managed_Medicaid221 rawDbQuery3 = """ Select regionid,BUID,ME_NO,SRA2 IMSDR_Key,F_NM,L_NM,c.drug_name DrugName,Case when F.IMS_NUM IS NULL Then 'N' else 'Y' End as PDRP,222 SUM(TQTY1+TQTY2+TQTY3+TQTY4+TQTY5+TQTY6+TQTY7+TQTY8+TQTY9+TQTY10+TQTY11+TQTY12) Matty 223 into #MMRX_Thera_Name5 from EXT_RAW_DATA A 224 INNER JOIN DI_MASTER.dbo.MHC_EXT_DRUG_REL B ON A.PROD_ID=B.EXT_DRUG_ID AND B.CLIENT_ID = 2 AND B.STATUS='A' 225 Inner join [B1-124].M1B_DF.DBO.MASTER_THERA_Class H ON B.THERA_ID=H.THERA_ID AND Thera_Name='Bacterial Vaginosis'--Change Thera226 INNER JOIN [B1-124].M1B_DF.DBO.MASTER_THERA_DRUG C ON B.DRUG_BRD_ID=C.DRUG_ID AND C.DRUG_STRENGTH='ALL' 227 AND C.DRUG_NAME in ('Cleocin Vaginal','Cleocin Vaginal Ovules','clindamycin phosphate vaginal cream','Clindesse',228 'Flagyl','Metrogel-Vaginal','metronidazole','metronidazole vaginal','Nuvessa','Solosec','Tindamax','tinidazole')--Change Drugs as per market 229 INNER JOIN DI_MASTER..TMP_ENTITY_IMS_XREF D ON A.PAYER_PLAN_CD=D.PAYER_PLAN_ID 230 INNER JOIN [B1-124].[BOTMAster].Dbo.VWLinkageChannelXref G ON D.Channel_id=G.Subchannelid AND G.subchannel='managed Medicaid'--Change Channel231 LEFT JOIN DF_PDRP_LIST F ON A.SRA2=F.IMS_NUM 232 Inner join [B1-124].M1B_LUP.dbo.PrescriberAlignment T on A.SRA2=T.IMSID and BUID is not null233 inner join [b1-124].M1B_LUP.DBO.MHC_SLS_ORG_RETL u234 on u.LVL_NO=1 AND u.THERA_ID=774 and t.TerritoryID=u.RETL_TERR_ID235 Group by RegionID,BUID,ME_NO,SRA2,F_NM,L_NM,c.drug_name,Case when F.IMS_NUM IS NULL Then 'N' else 'Y' End236 """237 rawDbOutput3 = cursorOn36Db.execute(rawDbQuery3)238 rawDbQuery4 = """ Select ME_NO,IMSDR_Key,F_NM,L_NM,DrugName,RegionID,PDRP,Matty239 into #tmp3 FROM #MMRX_Thera_Name5 240 Where PDRP='N' AND RegionID NOT IN ('41000','42000')241 Group BY ME_NO,IMSDR_Key,F_NM,L_NM,DrugName,RegionID,PDRP,Matty242 """243 rawDbOutput4 = cursorOn36Db.execute(rawDbQuery4)244 rawDbQuery6 = """ SELECT RegionID,SUM(MATTY) FROM #tmp3 GROUP BY RegionID """245 rawDbOutput5 = cursorOn36Db.execute(rawDbQuery6)246 RAWDbMatty3 = rawDbOutput5.fetchall()247 for each in range(list(RAWDbMatty3).__len__()):248 print("-------------------RAW DB OutPut-----------------")249 ## RAWDBMattyWomensHealthcareManagedMedicaid.append("Womens Health Care Market TQTY" + "|" + "Managed Medicaid" + "|" + RAWDbMatty3[each][0] + "|" + str(RAWDbMatty3[each][1]))250 RAWDBMattyWomensHealthcare_Managed_Medicaid.append("Womens Health Care Market TQTY" + "|" + "Managed Medicaid" + "|" + RAWDbMatty3[each][0] + "|" + str(RAWDbMatty3[each][1]))251 ###RAWDbOutputSupraxCapTabManagedMedicaid.append ("Suprax Chew MAREKT TRX" + "|" + "Commercial w/o Managed Medicaid" + "|" + RAWDbMatty2[each][0] + "|" + str(RAWDbMatty2[each][1]))252 print(RAWDBMattyWomensHealthcare_Managed_Medicaid)253### Comparing The Matty of Womens' Healthcare TQTY for Managed medicaid Channel against Report Matty ###254def CompareRAWDBMattyWomensHealthcareManagedMedicaid():255 global RAWDBMattyWomensHealthcare_Managed_Medicaid256 RAWDBMattyWomensHealthcareManagedMedicaid()257 count10 = 0258 #Report_Matty()259 print("------------------ReportOutput----------------------", ReportOutput)260 for i in range(RAWDBMattyWomensHealthcare_Managed_Medicaid.__len__()):261 item1 = RAWDBMattyWomensHealthcare_Managed_Medicaid[i]262 print(" ")263 print("item1 ",item1)264 if(ReportOutput.__contains__(item1)):265 print("passed")266 else:267 count10 = count10 + 1268 print("Failed")269 """for j in range(ReportOutput.__len__()):270 ##print(ReportOutput[j])271 if (ReportOutput[j] == item1):272 print(" ")273 else:274 count10 = count10 + 1"""275 return count10276### Getting The Matty of Womens' Healthcare TQTY for commercial w/o Managed medicaid Channel ###277def RAWDBMattyWomensHealthcarecommwithoutManagedMedicaid():278 global RAWDBMattyWomensHealthcarecommercialwithoutManagedMedicaid279 rawDbQuery4 = """ Select regionid,BUID,ME_NO,SRA2 IMSDR_Key,F_NM,L_NM,c.drug_name DrugName,Case when F.IMS_NUM IS NULL Then 'N' else 'Y' End as PDRP,280 SUM(TQTY1+TQTY2+TQTY3+TQTY4+TQTY5+TQTY6+TQTY7+TQTY8+TQTY9+TQTY10+TQTY11+TQTY12) Matty 281 into #MMRX_Thera_Name4 from EXT_RAW_DATA A 282 INNER JOIN DI_MASTER.dbo.MHC_EXT_DRUG_REL B ON A.PROD_ID=B.EXT_DRUG_ID AND B.CLIENT_ID = 2 AND B.STATUS='A' 283 Inner join [B1-124].M1B_DF.DBO.MASTER_THERA_Class H ON B.THERA_ID=H.THERA_ID AND Thera_Name='Bacterial Vaginosis'--Change Thera284 INNER JOIN [B1-124].M1B_DF.DBO.MASTER_THERA_DRUG C ON B.DRUG_BRD_ID=C.DRUG_ID AND C.DRUG_STRENGTH='ALL' 285 AND C.DRUG_NAME in ('Cleocin Vaginal','Cleocin Vaginal Ovules','clindamycin phosphate vaginal cream','Clindesse',286 'Flagyl','Metrogel-Vaginal','metronidazole','metronidazole vaginal','Nuvessa','Solosec','Tindamax','tinidazole')--Change Drugs as per market 287 INNER JOIN DI_MASTER..TMP_ENTITY_IMS_XREF D ON A.PAYER_PLAN_CD=D.PAYER_PLAN_ID 288 INNER JOIN [B1-124].[BOTMAster].Dbo.VWLinkageChannelXref G ON D.Channel_id=G.Subchannelid AND G.subchannel='commercial w/o managed Medicaid'--Change Channel289 LEFT JOIN DF_PDRP_LIST F ON A.SRA2=F.IMS_NUM 290 Inner join [B1-124].M1B_LUP.dbo.PrescriberAlignment T on A.SRA2=T.IMSID and BUID is not null291 inner join [b1-124].M1B_LUP.DBO.MHC_SLS_ORG_RETL u292 on u.LVL_NO=1 AND u.THERA_ID=774 and t.TerritoryID=u.RETL_TERR_ID293 Group by RegionID,BUID,ME_NO,SRA2,F_NM,L_NM,c.drug_name,Case when F.IMS_NUM IS NULL Then 'N' else 'Y' End294 """295 rawDbOutput4 = cursorOn36Db.execute(rawDbQuery4)296 rawDbQuery5 = """ Select ME_NO,IMSDR_Key,F_NM,L_NM,DrugName,RegionID,PDRP,Matty297 into #tmp4 FROM #MMRX_Thera_Name4 298 Where PDRP='N' 299 Group BY ME_NO,IMSDR_Key,F_NM,L_NM,DrugName,RegionID,PDRP,Matty300 """301 rawDbOutput6 = cursorOn36Db.execute(rawDbQuery5)302 rawDbQuery7 = """ SELECT RegionID,SUM(MATTY) FROM #tmp4 GROUP BY RegionID """303 rawDbOutput6 = cursorOn36Db.execute(rawDbQuery7)304 RAWDbMatty4 = rawDbOutput6.fetchall()305 for each in range(list(RAWDbMatty4).__len__()):306 print("-------------------RAW DB OutPut-----------------")307 RAWDBMattyWomensHealthcarecommercialwithoutManagedMedicaid.append("Womens Health Care Market TQTY" + "|" + "Commercial w/o Managed Medicaid" + "|" + RAWDbMatty4[each][0] + "|" + str(RAWDbMatty4[each][1]))308 ###RAWDbOutputSupraxCapTabManagedMedicaid.append ("Suprax Chew MAREKT TRX" + "|" + "Commercial w/o Managed Medicaid" + "|" + RAWDbMatty2[each][0] + "|" + str(RAWDbMatty2[each][1]))309 print(RAWDBMattyWomensHealthcarecommercialwithoutManagedMedicaid)310### Comparing The Matty of Womens' Healthcare TQTY for commercial w/o Managed medicaid Channel against Report Matty ###311def CompareRAWDBMattyWomensHealthcarecommercialwithoutManagedMedicaid():312 global RAWDBMattyWomensHealthcarecommercialwithoutManagedMedicaid313 RAWDBMattyWomensHealthcarecommwithoutManagedMedicaid()314 count3 = 0315 #Report_Matty()316 print("------------------ReportOutput----------------------", ReportOutput)317 for i in range(RAWDBMattyWomensHealthcarecommercialwithoutManagedMedicaid.__len__()):318 item1 = RAWDBMattyWomensHealthcarecommercialwithoutManagedMedicaid[i]319 ##print("RAWDBMattyWomensHealthcarecommercialwithoutManagedMedicaid",RAWDBMattyWomensHealthcarecommercialwithoutManagedMedicaid)320 print(" ")321 print("item1 ", item1)322 """for j in range(ReportOutput.__len__()):323 ##print(ReportOutput[j])324 print("item1 ",item1)"""325 if(ReportOutput.__contains__(item1)):326 print("passed")327 else:328 count3 = count3 + 1329 print("Failed")...

Full Screen

Full Screen

ReportOutput_Fm.py

Source:ReportOutput_Fm.py Github

copy

Full Screen

1# -*- coding: utf-8 -*-2# Form implementation generated from reading ui file 'F:\code\Top\ui\ReportOutput.ui'3#4# Created by: PyQt5 UI code generator 5.8.15#6# WARNING! All changes made in this file will be lost!7from PyQt5 import QtCore, QtGui, QtWidgets8class Ui_ReportOutput(object):9 def setupUi(self, ReportOutput):10 ReportOutput.setObjectName("ReportOutput")11 ReportOutput.resize(736, 577)12 icon = QtGui.QIcon()13 icon.addPixmap(QtGui.QPixmap(":/new/wl/Logo_ico.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)14 ReportOutput.setWindowIcon(icon)15 self.groupBox = QtWidgets.QGroupBox(ReportOutput)16 self.groupBox.setGeometry(QtCore.QRect(3, 3, 731, 571))17 self.groupBox.setTitle("")18 self.groupBox.setObjectName("groupBox")19 self.retranslateUi(ReportOutput)20 QtCore.QMetaObject.connectSlotsByName(ReportOutput)21 def retranslateUi(self, ReportOutput):22 _translate = QtCore.QCoreApplication.translate23 ReportOutput.setWindowTitle(_translate("ReportOutput", "Dialog"))...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fMBT automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful