This function graphs the patients who were not on surveillance programmes and sees how many then had an endoscopy.This allows us to determine how many index Barrett's detections went on to undergo surveillance. This should be run after the Barretts_PragueScore and Barretts_PathStage.
BarrettsSurveil(dataframe, PatientID, Endo_ResultPerformed, IndicationsFroExamination)
dataframe | dataframe |
---|---|
PatientID | column of interest with unique hospital number in it |
Endo_ResultPerformed | column of interest with date endiscopy performed in it |
IndicationsFroExamination | column of interest with indications in it (usually 'Surveillance' or similar) |
#This takes the Myendo demo dataset # and then groups the Barrett's endoscopies by patient (as defined by their # unique hospital identifier and then orders by the date of procedure. It # should look in the Indications column for Barrett's related indication ee<-BarrettsSurveil(Myendo, 'HospitalNumber', 'Dateofprocedure','Indications')