Exporting a Patient, Encounters and Obs

I have gotten a request from a partner to be able to export all the encounters and obs for a patient to Excel. Is there a quick and dirty way to do this other than going via SQL?

Can this export be extended to a cohort of patients?

@ssmusoke, are you able to try to use an EncounterAndObsDataSetDefinition for this?

@mseaton Do you have any examples I can look at?

@ssmusoke, one example can be seen here. In this case, we are adding one data set per encounter type, which results in an Excel output document with one tab per encounter type. In each tab is listed all encounters of that type. We are adding the demographic and encounter columns we care about (if none are specified there are some defaults), and all obs are automatically added as well.

You can also look at the EncounterAndObsDataSetEvaluatorTest within the reporting module codebase.