These are very large commits, and honestly I don’t have time to read it all now. Please highlight the relevant parts.
@achachiez, can you please clarify where there used to be a patient property? The old Cohort.java class does not contain a List or anything like that.
If you are talking about the REST module, here is the background reading for why this happened:
- Ticket for changing the way cohorts work in OpenMRS core in 2.1.x (includes links to various discussions): [TRUNK-4906] - OpenMRS Issues
- Ticket for supporting this in the REST module: [RESTWS-657] - OpenMRS Issues
- Design discussion about the REST changes: Cohort REST API changes with openmrs-core 2.1?
It is intentional to not expose the patient directly.
Generally the best way to get many fields for a cohort of patients is with the Reporting module (and Reporting REST).
If you need to do this without the reporting module, I suggest introducing a convenience method like getPatients(Cohort), rather than trying to rewrite anything.