abstracting the encounter table into its own directive