This extracts the pathological stage from the histopathology specimen. It is done using 'degradation' so that it will look for the worst overall grade in the histology specimen and if not found it will look for the next worst and so on. It looks per report not per biopsy (it is more common for histopathology reports to contain the worst overall grade rather than individual biopsy grades). Specfically it extracts the histopathology worst grade Being the procedure done at the time and the follow-up timings

Barretts_PathStage(dataframe, PathColumn)

Arguments

dataframe

dataframe with column of interest

PathColumn

column of interest

Examples

# 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<-HistolAll(Mypath)
#> 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 default
# 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 then takes the Histology column from the merged data set (v). # It extracts the worst histological grade for a specimen b<-Barretts_PathStage(v,'Histology') rm(v)