This function gets the unique patient ID's for each patient, for each rule. It lists the unique PatientIDs assocaited with a rule ('Rule1','Rule2','Rule3','NoRules'). This allows us to determine how many patients will need follow up at specific time intervals. This should be run after the Barretts_PragueScore and Barretts_PathStage.
BarrettsSurveil_HospNum(dataframe, rule, PatientID)
dataframe | dataframe with column of interest |
---|---|
rule | Rule of interest |
PatientID | Column containing patient numbers |
# 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') # The follow-up group depends on the histology and the Prague score for a # patient so it takes the processed Barrett's data and then looks in the # Findings column for permutations of the Prague score. b4<-Barretts_FUType(b3,'Findings') colnames(b4)[colnames(b4) == 'pHospitalNum'] <- 'HospitalNumber' #Finally the unique hospital numbers are obtained according to the follow-up # rule you are looking for ff<-BarrettsSurveil_HospNum(b4,'Rule1','HospitalNumber') rm(v)