Hi Anies,
Very briefly, assuming that you are doing this is code, you would do:
dsd = new PatientDataSetDefinition()
If you want to limit to a specific subset of patients, you would do something like
females = new GenderCohortDefinition();
females.setFemaleIncluded(true);
dsd.addRowFilter(females, null);
Then you need to add a "patient data definition" for each column that you want included in the dataset. Like:
dsd.addColumn("internal patient_id", new PatientIdDataDefinition(), null);
Here is an actual example:
There are implementations in the reporting module for row-per-patient, -encounter, and -obs (if I remember off the top of my head). Looking at the encounter or obs ones should show a pattern that can be copied to other domain objects.
-Darius