Hi Team,
Thanks everyone for your help resolving O3: Cohort Endpoint Support . Now it is possible to post a cohort with multiple members. The next step is to implement a cohort search. The idea is we want to be able to search by name for a cohort we previously created so we can find it easily and perform actions for the cohort members. Currently reading the readme of the cohort-module it doesn’t look like this is a supported action? Does anyone know if the endpoint actually exists but isn’t documented yet? Or if it doesn’t exist would it be possible to create this endpoint?
Ideally the response would have a format like
{
"results": [
{
"name": "Rodeo Group 2",
"description": null,
"startDate": null,
"endDate": null,
"groupCohort": false,
"uuid": "49caa1ab-82dc-4285-a753-2b521971d81c",
"location": null,
"cohortType": null,
"attributes": [],
"voided": false,
"voidReason": null,
"display": "Rodeo Group 2",
"links": [
{
"rel": "self",
"uri": "http://backend:8080/openmrs/ws/rest/v1/cohortm/cohort/49caa1ab-82dc-4285-a753-2b521971d81c",
"resourceAlias": "cohort"
},
{
"rel": "full",
"uri": "http://backend:8080/openmrs/ws/rest/v1/cohortm/cohort/49caa1ab-82dc-4285-a753-2b521971d81c?v=full",
"resourceAlias": "cohort"
}
],
"resourceVersion": "1.8",
"cohortMembers": [
{
"uuid": "49caa1ab-82dc-4285-a753-2b521971d81c",
"uuid": "51caa1ab-82dc-4285-a753-2b521971f819",
...
}
]
},
...
]
}
Additionally, it would be very useful to have the GET /ws/rest/v1/cohortm/cohort/<cohort_uuid>
endpoint return cohortMembers
and their uuids. Right now this is returning just the cohort object, and I’m not sure how to get the cohortMembers
from that object? Is that a different endpoint? For the endpoint which returns the cohort members, is it possible to include (for patients) their patientUuids ?
Thanks in advance.