At this moment, CohortMember is modeled as a subresource of Cohort. However, since the CohortMembers are patients, and we allow creation and editing of CohortMembers, we now are breaking caching for patients. It seems to me we have a few possible ways to fix this:
(1) not support POST or DELETE for CohortMembers; [makes CohortMember sort of hokey]
(2) use GET on a Cohort with a parameter (e.g. ?evaluate) to produce a list of members; [makes Cohort GET polymorphic]
(3) use PUT on a Cohort to produce a list of members; [PUT?]
(4) have an Evaluate resource that would work with various types of definition objects (e.g. Cohort, LogicRule, Form, Report). [probably would require parameters to identify object and POST for passing parameters to the object]
Click here to unsubscribe from OpenMRS Developers' mailing list
Darius --
I had just looked at the catalog, not the code. Since a cohort's membership is persistent, I agree with you about the REST call (although I can't say I like the idea of different users being able to add or delete patients from the same cohort at the same time). I also agree about the default representation.
But that still leaves a number of objects which contain definitions that have an evaluate-like function. Could we agree on a common approach to that use case?
-- OpenMRS Developers: http://go.openmrs.org/dev
Post: d...@openmrs.org
Unsubscribe: dev+uns...@openmrs.org