This collects the patients in whom it is assumed that complete clearance of intestinal metasplasia has occurred (CRIM) after ablation therapy. This is done by collecting those endoscopies where the last EVENT was equal to 'nothing' when the patient had undergone radiofrequency ablation at some point
Barretts_CRIM(dataframe, HospNum, EVENT)
dataframe | The dataframe |
---|---|
HospNum | The Hospital Number column |
EVENT | The column called EVENT that determines what procedure the patient had at that endoscopy |
# Firstly relevant columns are extrapolated from the # Mypath demo dataset. These functions are all part of Histology data # cleaning as part of the package. v<-HistolAccessionNumber(Mypath,'Histology', 'SP-\\d{2}-\\d{7}') v<-HistolDx(v,'Diagnosis') v<-HistolExtrapolDx(v,'Diagnosis')#> Error in paste0("[Cc]arcin|[Cc]ance|[Ll]ymphoma|[Tt]umour|[Dd]yspla|G[Ii][Ss][Tt]|[Ss]tromal|[Ll]eio|[Cc]rohn", userString): argument "userString" is missing, with no defaultv<-HistolNumbOfBx(v,'Macroscopicdescription','specimen') v<-HistolBxSize(v,'Macroscopicdescription') # The histology is then merged with the Endoscopy dataset. The merge occurs # according to date and Hospital number v<-Endomerge2(Myendo,'Dateofprocedure','HospitalNumber',v,'Dateofprocedure', 'HospitalNumber') # The function relies on the other Barrett's functions being run as well: b1<-Barretts_PragueScore(v,'Findings') b2<-Barretts_PathStage(b1,'Histology') b3<-Barretts_EventType(b2,'Histology', 'ProcedurePerformed','Indications','Findings') colnames(b3)[colnames(b3) == 'pHospitalNum'] <- 'HospitalNumber' # The function groups the procedures by patient and then looks at those which # have 'nothing' in the event column (which means biopsies only) which was # preceded by radiofrequency ablation (RFA) so that these patients are # labelled as having clearance of intestinal metaplasia. The result is a true # or false column. nn<-Barretts_CRIM(b3,'HospitalNumber',"EVENT") rm(v)