Skip to content

Commit

Permalink
No more DROP TABLE at end. Closes #19.
Browse files Browse the repository at this point in the history
  • Loading branch information
zimolzak committed Mar 7, 2021
1 parent bec4dd6 commit 76498a5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 151 deletions.
70 changes: 0 additions & 70 deletions Fobt.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3553,73 +3553,3 @@ order by sta3n,sta6a,[year],[month]
--where CBC_dt between (select sp_start from #FOBT_Sta3n528_0_1_inputP) --altered (ORD_...Dflt) --altered (temp table)
-- and (select sp_end from #FOBT_Sta3n528_0_1_inputP) --altered (ORD_...Dflt) --altered (temp table)
-- and Sta6a in (select sta6a from #FOBT_Sta3n528_0_1_inputP) --altered (ORD_...Dflt) --altered (temp table)


---- Uncomment below to delete intermediate tables created during execution
--Drop Table #FOBT_Sta3n528_0_2_DxICD10CodeExc --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_0_3_PreProcICD10ProcExc --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_0_4_DxICD9CodeExc --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_0_5_PrevProcCPTCodeExc --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_0_6_PreProcICD9ProcExc --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_0_7_FOBTLabTestName --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_0_8_ColonCancerDxICD9Code --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_0_9_ColonCancerDxICD10Code --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_0_A_RedFlagFOBTTestResult --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_1_Inc_9_IncPat --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_0_PrevCLCFromProblemList_ICD9ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_1_OutPatDx_ICD9ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_2_SurgDx_ICD9ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_3_A_InPatDx_ICD9ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_3_A_InPatDx_ICD9ICD10_Census501Diagnosis --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_3_A_InPatDx_ICD9ICD10_Inpat_CensusDiagnosis --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_3_A_InPatDx_ICD9ICD10_Inpat_Inpatient501TransactionDiagnosis --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_3_A_InPatDx_ICD9ICD10_InpatientDischargeDiagnosis --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_3_A_InPatDx_ICD9ICD10_PatientTransferDiagnosis --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_3_A_InPatDx_ICD9ICD10_SpecialtyTransferDiagnosis --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_3_B_InpatientFeeDiagnosisDx_ICD9ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_3_C_FeeICDDxFromFeeServiceProvided_ICD9ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_4_ALLDx_ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_4_ALLDx_ICD9 --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_2_ExcDx_4_Union_ALLDx_ICD --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_3_PrevProc_0_HLP_InPICDProc_Inpat_ICD9ProcICD10Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_3_PrevProc_1_HLP_CensusICDProc_Inpat_ICD9ProcICD10Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_3_PrevProc_2_HLP_InPSurgICD_Inpat_ICD9ProcICD10Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_3_PrevProc_3_HLP_CensusSurgICD_Inpat_ICD9ProcICD10Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_3_PrevProc_4_HLP_FeeICDProc_Inpat_ICD9ProcICD10Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_3_PrevProc_5_Union_Inpat_ICD10Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_3_PrevProc_5_Union_Inpat_ICD9Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_3_PrevProc_6_Outpat --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_3_PrevProc_7_surg --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_3_PrevProc_8_Inpat_CPT --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_3_PrevProc_9_FeeCPT --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_3_PrevProc_All_1_ColonScpy --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_3_PrevProc_All_2_Colectomy --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_3_Exc_NonDx_6_AllImgProcFromRad --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Exc_NonDx_3_AllVisit --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Exc_NonDx_3_AllVisit_Hlp1 --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Exc_NonDx_5_AllVisits_StopCode --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Exc_NonDx_7_VisitTIU --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Exc_NonDx_9_VisitTIUConsult_joinByConsultSID --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_1_Age --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_2_ALive --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_3_PrevCRCCancer --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_4_colectomy --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_5_Term --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_6_Hospice --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_6B1_Inpat_HospiceSpecialty --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_6B2_Hospice_FeeInpatInvoice_PurposeOfVisit --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_6B3_Hospice_FeeServiceProvided_HCFAType --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_6D1_Hospice_Refer_joinByConsultSID --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_7_UGIBleed --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_8_ColonScpy --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_9_ColonScpy_60d --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_A01_GIRefer60d_joinByConsultSID --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_A01_GIRefer60d_joinByConsultSID_A --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_A01_GIRefer60d_joinByConsultSID_B1 --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_A01_GIRefer60d_joinByConsultSID_B2 --altered (ORD_...Dflt) --altered (temp table)
--Drop Table #FOBT_Sta3n528_5_Ins_V_FirstOfPat --altered (ORD_...Dflt) --altered (temp table)





81 changes: 0 additions & 81 deletions Lung.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4060,84 +4060,3 @@ order by sta3n,sta6a,[year],[month]
--select * from #Lung_Sta3n528_1_In_3_RedFlagXRayCT --altered (ORD_...Dflt) --altered (temp table)
---- data set: Chest XRay/CT which come out trigger positive
--select * from #Lung_Sta3n528_3_Ins_U_TriggerPos --altered (ORD_...Dflt) --altered (temp table)



---- Delete intermediate tables

--Drop table #Lung_Sta3n528_0_0_1_Sta3nSta6a --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_0_1_inputP --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_0_2_0_LungImg --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_0_2_DxICD10CodeExc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_0_3_PreProcICD10ProcExc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_0_4_DxICD9CodeExc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_0_5_PreProcICD9ProcExc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_0_6_LungCancerDxICD10CodeExc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_0_7_LungCancerDxICD9CodeExc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_0_8_PrevProcCPTCodeExc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_0_A_RedFlagXRayCTDiagnosticCode --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_1_In_1_All_Chest_XRayCTPET --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_1_In_1_All_Chest_XRayCTPET_SSN --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_1_In_2_All_Chest_XRayCT_Sta6a --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_1_In_3_RedFlagXRayCT --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_1_In_6_IncIns --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_1_In_8_IncPat --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_1_SurgDx_ICD9ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_2_OutPatDx_ICD9ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_3_A_InPatDx_ICD9ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_3_A_InPatDx_ICD9ICD10_Census501Diagnosis --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_3_A_InPatDx_ICD9ICD10_Inpat_CensusDiagnosis --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_3_A_InPatDx_ICD9ICD10_Inpat_Inpatient501TransactionDiagnosis --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_3_A_InPatDx_ICD9ICD10_InpatientDischargeDiagnosis --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_3_A_InPatDx_ICD9ICD10_PatientTransferDiagnosis --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_3_A_InPatDx_ICD9ICD10_SpecialtyTransferDiagnosis --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_3_B_InpatientFeeDiagnosisDx_ICD9ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_3_C_FeeICDDxFromFeeServiceProvided_ICD9ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_4_AllDx_ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_4_AllDx_ICD9 --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_4_UnionAllDx_ICD9ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_2_Ex_7_ProblemListLC_Dx_ICD9ICD10 --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_3_PrevProc_0_HLP_InPICDProc_Inpat_ICD9ProcICD10Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_3_PrevProc_1_HLP_CensusICDProc_Inpat_ICD9ProcICD10Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_3_PrevProc_2_HLP_InPSurgICD_Inpat_ICD9ProcICD10Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_3_PrevProc_3_HLP_CensusSurgICD_Inpat_ICD9ProcICD10Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_3_PrevProc_4_HLP_FeeICDProc_Inpat_ICD9ProcICD10Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_3_PrevProc_Inpat_0_UnionAllInpICD10Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_3_PrevProc_Inpat_0_UnionAllInpICD9Proc --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_4_PrevProc_Inpat_1_CPT --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_5_PrevProc_Outpat --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_6_PrevProc_surg --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_7_PrevProc_FeeServiceProvidedCPT --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_8_PrevProc_AllNonDxProcICD9ICD10Proc_LungBiopsy --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_9_PrevProc_AllNonDxProcICD9ICD10Proc_Bronchoscopy --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_A_PrevProc_AllNonDxProcICD9ICD10Proc_LungSurgery --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_E_PrevProc_AllNonDxProcICD9ICD10Proc_XRay --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_F_PrevProc_AllNonDxProcICD9ICD10Proc_CT --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Exc_NonDx_G_PrevProc_AllNonDxProcICD9ICD10Proc_PET --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_0_1_In_4_Age --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_0_2_In_5_Alive --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_1_Ex_LungCancer --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_2_Ex_Termi_Major --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_3_Ex_Hospi_1_ByDx --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_3_Ex_Hospi_2_Fee --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_3_Ex_Hospi_3_ByPTF --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_3_Ex_Hospi_3_Refer_joinByConsultSID --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_4_Ex_Tuber --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_7_OutCome_Lung_Proc_A_LungBiopsy --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_7_OutCome_Lung_Proc_B_Bronchoscopy --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_7_OutCome_Lung_Proc_C_LungSurgery --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_8_OutCome_Rep_Img_A_XRay --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_8_OutCome_Rep_Img_B_CT --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_8_OutCome_Rep_Img_C_PET --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_9_Ex_0_AllVisits_Hlp1 --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_9_Ex_1_AllVisits --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_9_Ex_1_AllVisits_StopCode --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_9_Ex_2_VisitTIU --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_9_Ex_3_VisitTIUconsult_joinByConsultSID --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_D_OutCome_refer_1_pulm_joinByConsultSID --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_D_OutCome_refer_3_ThoracicSurgery_joinByConsultSID --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_D_OutCome_refer_4_TumorBoard_joinByConsultSID --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_U_TriggerPos --altered (ORD_...Dflt) --altered (temp table)
--Drop table #Lung_Sta3n528_3_Ins_V_TriggerPos_FirstOfPat_SP --altered (ORD_...Dflt) --altered (temp table)


0 comments on commit 76498a5

Please sign in to comment.