This extracts the polyps types from the data (for colonoscopy and flexible sigmoidosscopy data) and output the adenoma,adenocarcinoma and hyperplastic detection rate by endoscopist as well as overall number of colonoscopies. This will be extended to other GRS outputs in the future.

GRS_Type_Assess_By_Unit(dataframe, ProcPerformed, Endo_Endoscopist, Dx, Histol)

Arguments

dataframe

The dataframe

ProcPerformed

The column containing the Procedure type performed

Endo_Endoscopist

column containing the Endoscopist name

Dx

The column with the Histological diagnosis

Histol

The column with the Histology text in it

Examples

# Firstly merge histology and endoscopy datasets for the colon: MypathColon<-PathDataFrameFinalColon MyendoColon <- ColonFinal MyendoColon$OGDReportWhole <-gsub("2nd Endoscopist:","Second endoscopist:", MyendoColon$OGDReportWhole) EndoscTree <-c("Hospital Number:","Patient Name:","General Practitioner:", "Date of procedure:","Endoscopist:","Second endoscopist:","Medications", "Instrument","Extent of Exam:","Indications:","Procedure Performed:", "Findings:","Endoscopic Diagnosis:") MyendoColon<-Extractor(MyendoColon,"OGDReportWhole",EndoscTree) Histoltree <-c( "Hospital Number:","Patient Name:","DOB:","General Practitioner:", "Date received:","Clinical Details","Nature of specimen","Macroscopic description:","Histology", "Diagnosis") MypathColon <-Extractor(MypathColon,"PathReportWhole",Histoltree) names(MypathColon)[names(MypathColon) == 'Datereceived'] <- 'Dateofprocedure' MypathColon$Dateofprocedure <- as.Date(MypathColon$Dateofprocedure) vColon <-Endomerge2(MypathColon, "Dateofprocedure","HospitalNumber", MyendoColon, "Dateofprocedure","HospitalNumber") nn<-GRS_Type_Assess_By_Unit(vColon,'ProcedurePerformed', 'Endoscopist','Diagnosis','Histology') rm(vColon) rm(MypathColon) rm(MyendoColon)