Re: Cohort.getMembersIds() exists, but no Program.getMemberIds()

classic Classic list List threaded Threaded
4 messages Options
Ben Wolfe (openmrs) Ben Wolfe (openmrs)
Reply | Threaded
Open this post in threaded view
|

Re: Cohort.getMembersIds() exists, but no Program.getMemberIds()

(This is probably more of a dev list question, cc'ing that list so we can continue it there if need-be)

I think you want:

List<PatientProgram> ProgramWorkflowService.getPatientPrograms(Patient patient, Program program, Date minEnrollmentDate, Date maxEnrollmentDate, Date minCompletionDate, Date maxCompletionDate, boolean includeVoided)

Yes, the rest call should be:
GET /ws/rest/v1/program/{parentUuid}/member
or
GET /ws/rest/v1/program/{parentUuid}/patient

it would returns a list of patients ideally.  But then you have to do extra steps to get the current states.

Ben

On Mon, May 14, 2012 at 12:49 AM, Saptarshi Purkayastha <[hidden email]> wrote:
Hi Mathias,


I dont think there is a way by pure REST services that this can be done. Atleast from my discovery one needs to use the Reporting Compatibility module to be able to create and save Patient searches.
In the Raxa project we are creating a patientlist REST resource to be able to deal with the issue of patient searches

---
Regards,
Saptarshi PURKAYASTHA

My Tech Blog:  http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE



On 14 May 2012 09:52, Mathias Lin | Meta Healthcare <[hidden email]> wrote:
I want to get all patients currently enrolled in a program. For that
I'm looking into the Java API but only find that the Cohort class
offers a method getMembersIds(), but not the Program class, and
therefore I'm wondering why and how to best get the patients of a
certain program?
(in sql: select patient.* from patient left join patient_program on
patient.patient_id = patient_program.patient_id where
patient_program.program_id = 1)

I want to display patients of a certain program on the role-based homepage.

In addition to that: would an REST api like
GET /ws/rest/v1/program/{parentUuid}/member
make sense here to be added, or is it just not used in practice?

_________________________________________

To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-implement-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-implement-l]


[hidden email] from OpenMRS Implementers' mailing list


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

Re: Cohort.getMembersIds() exists, but no Program.getMemberIds()

Mathias,

If you're looking at doing more than just this one query for "patients like xyz" then I'd suggest looking at the reporting module (in the module repo) in conjunction with the reportingrest module (still alpha, at http://svn.openmrs.org/openmrs-modules/reportingrest/trunk/)

-Darius

On Mon, May 14, 2012 at 7:29 AM, Ben Wolfe <[hidden email]> wrote:
(This is probably more of a dev list question, cc'ing that list so we can continue it there if need-be)

I think you want:

List<PatientProgram> ProgramWorkflowService.getPatientPrograms(Patient patient, Program program, Date minEnrollmentDate, Date maxEnrollmentDate, Date minCompletionDate, Date maxCompletionDate, boolean includeVoided)

Yes, the rest call should be:
GET /ws/rest/v1/program/{parentUuid}/member
or
GET /ws/rest/v1/program/{parentUuid}/patient

it would returns a list of patients ideally.  But then you have to do extra steps to get the current states.

Ben


On Mon, May 14, 2012 at 12:49 AM, Saptarshi Purkayastha <[hidden email]> wrote:
Hi Mathias,


I dont think there is a way by pure REST services that this can be done. Atleast from my discovery one needs to use the Reporting Compatibility module to be able to create and save Patient searches.
In the Raxa project we are creating a patientlist REST resource to be able to deal with the issue of patient searches

---
Regards,
Saptarshi PURKAYASTHA

My Tech Blog:  http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE



On 14 May 2012 09:52, Mathias Lin | Meta Healthcare <[hidden email]> wrote:
I want to get all patients currently enrolled in a program. For that
I'm looking into the Java API but only find that the Cohort class
offers a method getMembersIds(), but not the Program class, and
therefore I'm wondering why and how to best get the patients of a
certain program?
(in sql: select patient.* from patient left join patient_program on
patient.patient_id = patient_program.patient_id where
patient_program.program_id = 1)

I want to display patients of a certain program on the role-based homepage.

In addition to that: would an REST api like
GET /ws/rest/v1/program/{parentUuid}/member
make sense here to be added, or is it just not used in practice?

_________________________________________

To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-implement-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-implement-l]


[hidden email] from OpenMRS Implementers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Mathias Lin Mathias Lin
Reply | Threaded
Open this post in threaded view
|

Re: Cohort.getMembersIds() exists, but no Program.getMemberIds()

Hi Darius,

thanks for the link, I will take a look at it.
I just want to show patients that are enrolled in a certain program,
on the role-based homepage (using that module), and link from there to
each respective patient page. That's all actually, very simple,
basically just this one query.

- Mathias


On Mon, May 14, 2012 at 10:58 PM, Darius Jazayeri
<[hidden email]> wrote:

> Mathias,
>
> If you're looking at doing more than just this one query for "patients like
> xyz" then I'd suggest looking at the reporting module (in the module repo)
> in conjunction with the reportingrest module (still alpha, at
> http://svn.openmrs.org/openmrs-modules/reportingrest/trunk/)
>
> -Darius
>
>
> On Mon, May 14, 2012 at 7:29 AM, Ben Wolfe <[hidden email]> wrote:
>>
>> (This is probably more of a dev list question, cc'ing that list so we can
>> continue it there if need-be)
>>
>> I think you want:
>>
>> List<PatientProgram> ProgramWorkflowService.getPatientPrograms(Patient
>> patient, Program program, Date minEnrollmentDate, Date maxEnrollmentDate,
>> Date minCompletionDate, Date maxCompletionDate, boolean includeVoided)
>>
>> Yes, the rest call should be:
>> GET /ws/rest/v1/program/{parentUuid}/member
>> or
>> GET /ws/rest/v1/program/{parentUuid}/patient
>>
>> it would returns a list of patients ideally.  But then you have to do
>> extra steps to get the current states.
>>
>> Ben
>>
>>
>> On Mon, May 14, 2012 at 12:49 AM, Saptarshi Purkayastha <[hidden email]>
>> wrote:
>>>
>>> Hi Mathias,
>>>
>>> You can use the PatientSetService
>>> - http://resources.openmrs.org/doc/org/openmrs/api/PatientSetService.html
>>> and probably this method
>>> - http://resources.openmrs.org/doc/org/openmrs/api/PatientSetService.html#getPatientsInProgram(org.openmrs.Program,
>>> java.util.Date, java.util.Date)
>>>
>>> I dont think there is a way by pure REST services that this can be done.
>>> Atleast from my discovery one needs to use the Reporting Compatibility
>>> module to be able to create and save Patient searches.
>>> In the Raxa project we are creating a patientlist REST resource to be
>>> able to deal with the issue of patient searches
>>>
>>> ---
>>> Regards,
>>> Saptarshi PURKAYASTHA
>>>
>>> My Tech Blog:  http://sunnytalkstech.blogspot.com
>>> You Live by CHOICE, Not by CHANCE
>>>
>>>
>>>
>>> On 14 May 2012 09:52, Mathias Lin | Meta Healthcare
>>> <[hidden email]> wrote:
>>>>
>>>> I want to get all patients currently enrolled in a program. For that
>>>> I'm looking into the Java API but only find that the Cohort class
>>>> offers a method getMembersIds(), but not the Program class, and
>>>> therefore I'm wondering why and how to best get the patients of a
>>>> certain program?
>>>> (in sql: select patient.* from patient left join patient_program on
>>>> patient.patient_id = patient_program.patient_id where
>>>> patient_program.program_id = 1)
>>>>
>>>> I want to display patients of a certain program on the role-based
>>>> homepage.
>>>>
>>>> In addition to that: would an REST api like
>>>> GET /ws/rest/v1/program/{parentUuid}/member
>>>> make sense here to be added, or is it just not used in practice?
>>>>
>>>> _________________________________________
>>>>
>>>> To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail
>>>> to [hidden email] with "SIGNOFF openmrs-implement-l" in the
>>>>  body (not the subject) of your e-mail.
>>>>
>>>> [mailto:[hidden email]?body=SIGNOFF%20openmrs-implement-l]
>>>
>>>
>>> ________________________________
>>> Click here to unsubscribe from OpenMRS Implementers' mailing list
>>
>>
>> ________________________________
>> Click here to unsubscribe from OpenMRS Developers' mailing list
>
>
> ________________________________
> Click here to unsubscribe from OpenMRS Developers' mailing list

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]
Mathias LIN
Meta Healthcare Systems Ltd.
20/F Central Tower, 28 Queen's Rd Central, Hong Kong
T +852 8199 9605, M +86 159 0208 1701, Skype: mathias.lin
http://www.metahealthcare.com
Darius Jazayeri-3 Darius Jazayeri-3
Reply | Threaded
Open this post in threaded view
|

Re: Cohort.getMembersIds() exists, but no Program.getMemberIds()

In that case I'd suggest just doing the query that Ben mentioned a couple of emails back, in a custom controller.

-Darius

On Mon, May 14, 2012 at 8:08 AM, Mathias Lin | Meta Healthcare <[hidden email]> wrote:
Hi Darius,

thanks for the link, I will take a look at it.
I just want to show patients that are enrolled in a certain program,
on the role-based homepage (using that module), and link from there to
each respective patient page. That's all actually, very simple,
basically just this one query.

- Mathias


On Mon, May 14, 2012 at 10:58 PM, Darius Jazayeri
<[hidden email]> wrote:
> Mathias,
>
> If you're looking at doing more than just this one query for "patients like
> xyz" then I'd suggest looking at the reporting module (in the module repo)
> in conjunction with the reportingrest module (still alpha, at
> http://svn.openmrs.org/openmrs-modules/reportingrest/trunk/)
>
> -Darius
>
>
> On Mon, May 14, 2012 at 7:29 AM, Ben Wolfe <[hidden email]> wrote:
>>
>> (This is probably more of a dev list question, cc'ing that list so we can
>> continue it there if need-be)
>>
>> I think you want:
>>
>> List<PatientProgram> ProgramWorkflowService.getPatientPrograms(Patient
>> patient, Program program, Date minEnrollmentDate, Date maxEnrollmentDate,
>> Date minCompletionDate, Date maxCompletionDate, boolean includeVoided)
>>
>> Yes, the rest call should be:
>> GET /ws/rest/v1/program/{parentUuid}/member
>> or
>> GET /ws/rest/v1/program/{parentUuid}/patient
>>
>> it would returns a list of patients ideally.  But then you have to do
>> extra steps to get the current states.
>>
>> Ben
>>
>>
>> On Mon, May 14, 2012 at 12:49 AM, Saptarshi Purkayastha <[hidden email]>
>> wrote:
>>>
>>> Hi Mathias,
>>>
>>> You can use the PatientSetService
>>> - http://resources.openmrs.org/doc/org/openmrs/api/PatientSetService.html
>>> and probably this method
>>> - http://resources.openmrs.org/doc/org/openmrs/api/PatientSetService.html#getPatientsInProgram(org.openmrs.Program,
>>> java.util.Date, java.util.Date)
>>>
>>> I dont think there is a way by pure REST services that this can be done.
>>> Atleast from my discovery one needs to use the Reporting Compatibility
>>> module to be able to create and save Patient searches.
>>> In the Raxa project we are creating a patientlist REST resource to be
>>> able to deal with the issue of patient searches
>>>
>>> ---
>>> Regards,
>>> Saptarshi PURKAYASTHA
>>>
>>> My Tech Blog:  http://sunnytalkstech.blogspot.com
>>> You Live by CHOICE, Not by CHANCE
>>>
>>>
>>>
>>> On 14 May 2012 09:52, Mathias Lin | Meta Healthcare
>>> <[hidden email]> wrote:
>>>>
>>>> I want to get all patients currently enrolled in a program. For that
>>>> I'm looking into the Java API but only find that the Cohort class
>>>> offers a method getMembersIds(), but not the Program class, and
>>>> therefore I'm wondering why and how to best get the patients of a
>>>> certain program?
>>>> (in sql: select patient.* from patient left join patient_program on
>>>> patient.patient_id = patient_program.patient_id where
>>>> patient_program.program_id = 1)
>>>>
>>>> I want to display patients of a certain program on the role-based
>>>> homepage.
>>>>
>>>> In addition to that: would an REST api like
>>>> GET /ws/rest/v1/program/{parentUuid}/member
>>>> make sense here to be added, or is it just not used in practice?
>>>>
>>>> _________________________________________
>>>>
>>>> To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail
>>>> to [hidden email] with "SIGNOFF openmrs-implement-l" in the
>>>>  body (not the subject) of your e-mail.
>>>>
>>>> [mailto:[hidden email]?body=SIGNOFF%20openmrs-implement-l]
>>>
>>>
>>> ________________________________
>>> Click here to unsubscribe from OpenMRS Implementers' mailing list
>>
>>
>> ________________________________
>> Click here to unsubscribe from OpenMRS Developers' mailing list
>
>
> ________________________________
> Click here to unsubscribe from OpenMRS Developers' mailing list

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]


[hidden email] from OpenMRS Developers' mailing list