RESTWS and CohortMember

classic Classic list List threaded Threaded
2 messages Options
Friedman, Roger (CDC/CGH/DGHA) (CTR) Friedman, Roger (CDC/CGH/DGHA) (CTR)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RESTWS and CohortMember

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]


[hidden email] from OpenMRS Developers' mailing list
Darius Jazayeri-3 Darius Jazayeri-3
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RESTWS and CohortMember

Hi Roger,

I don't think this is correct.

CohortMember has a patient, but it isn't a patient itself. Doing this

    POST .../cohort/(parentUuid)/member ...

does not create a patient, but rather it adds the patient to the specified cohort, writing a row to the cohort_member table. 

Is that not how it's working? (If not, could you provide the sequence of REST calls that would cause an error?)

I do see that CohortMemberResource includes a default rep of patient in its own default rep. Is that what you're referring to? I do think we should change things so the default rep only includes a ref of the patient...

-Darius

On Mon, May 21, 2012 at 6:45 AM, Friedman, Roger (CDC/CGH/DGHA) (CTR) <[hidden email]> wrote:

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]


[hidden email] from OpenMRS Developers' mailing list

-- OpenMRS Developers: http://go.openmrs.org/dev
Post: [hidden email]
Unsubscribe: [hidden email]
[hidden email] from OpenMRS Developers' mailing list
Loading...