Problem with finding cohort members via REST web services API

classic Classic list List threaded Threaded
8 messages Options
Mathias Lin Mathias Lin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem with finding cohort members via REST web services API

I try to get the members of the cohort via web services, following the
API resources in the wiki, but it fails.
$ curl -i -u "admin:Admin123"
http://localhost:8080/openmrs183/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230/member
(other web services calls, like finding a cohort by UUID or by query
'q' works fine; but finding cohort members doesn't work for me).
Error log as below.


Related to that:
I found that the syntax in the API call mentioned in the ticket
https://tickets.openmrs.org/browse/RESTWS-140
curl -i -u admin:test
http://localhost:8080/openmrs/ws/rest/cohort/0bbc73bd-0986-4581-9d3a-87cdeea13251/members
differs from the one in the wiki.
(no /v1 in the url, and it's 'members' instead of 'member' at the
end). Does this just relate to a newer REST web services module other
than the one in the module repository (version 0.8.21639)?


btw: I plan to display patients of a certain cohort (or actually even
better, if possible, who are enrolled in a certain program ('saved
search'), which is dynamic, while a saved cohort is fixed) in the
role-based homepage, using the respective module. I thought of using
the web services API for that. Or is there another approach that would
be simpler (DWR?).


Cohort query works fine:

curl -i -u "admin:Admin123"
http://localhost:8080/openmrs183/ws/rest/v1/cohort?q=
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=120FB4A6A045AD550E0FD1600C1CFD65; Path=/openmrs183
ETag: "0ab50a58f7149ca8ba4dd9a2430146b11"
Content-Type: application/json;charset=UTF-8
Content-Length: 190
Date: Mon, 14 May 2012 03:58:42 GMT
{"results":[{"uuid":"7f077157-ab26-45cd-9bfd-e8911157e230","display":"HIV
Cohort","links":[{"uri":"NEED-TO-CONFIGURE/ws/rest/v1/cohort/7f077157-


Cohort search by UUID works fine:

curl -i -u "admin:Admin123"
http://localhost:8080/openmrs183/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=74A35274221FDDC76A6A251FFDCAB59B; Path=/openmrs183
ETag: "075426985fcf5609a7e22896e3caf2bfc"
Content-Type: application/json;charset=UTF-8
Content-Length: 334
Date: Mon, 14 May 2012 03:58:52 GMT

{"uuid":"7f077157-ab26-45cd-9bfd-e8911157e230","name":"HIV
Cohort","description":"HIV
Cohort","voided":false,"memberIds":[3],"links":[{"uri":"NEED-TO-CONFIGURE/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230","rel":"self"},{"uri":"NEED-TO-CONFIGURE/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230?v=full","rel":"full"}]}


Cohort member search by cohort UUID fails:
Isn't it the cohort UUID that I need to use in the API call url (as
per wiki: GET /ws/rest/v1/cohort/{parentUuid}/member)?

curl -i -u "admin:Admin123" http://localhost:8080/ourl -i -u
"admin:Admin123"
http://localhost:8080/openmrs183/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230/member
HTTP/1.1 404 Not Found
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=F1FDE6D2A210EB34999EC4DFF1D28C4F; Path=/openmrs183
Content-Type: application/json;charset=UTF-8
Content-Length: 6115
Date: Mon, 14 May 2012 03:59:11 GMT

{"error":{"message":"Resource does not exist. Please check
documentation for implemented resources and their
paths","code":"org.openmrs.module.webservices.rest.web.v1_0.controller.BaseRestController:93","detail":"org.openmrs.module.webservices.rest.web.response.UnknownResourceException\n\tat
org.openmrs.module.webservices.rest.web.v1_0.controller.BaseRestController.handleUnknownResource(BaseRestController.java:93)\n\tat
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n\tat
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n\tat
java.lang.reflect.Method.invoke(Method.java:597)\n\tat
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)\n\tat
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)\n\tat
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)\n\tat
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)\n\tat
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)\n\tat
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)\n\tat
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)\n\tat
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)\n\tat
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:65)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)\n\tat
org.openmrs.module.xforms.web.XformsFilter.doFilter(XformsFilter.java:60)\n\tat
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:74)\n\tat
org.openmrs.module.webservices.rest.web.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:100)\n\tat
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:74)\n\tat
org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:58)\n\tat
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n\tat
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:74)\n\tat
org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:112)\n\tat
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)\n\tat
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)\n\tat
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)\n\tat
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)\n\tat
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)\n\tat
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)\n\tat
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)\n\tat
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)\n\tat
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)\n\tat
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)\n\tat
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)\n\tat
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)\n\tat
java.lang.Thread.run(Thread.java:680)\n"}}

_________________________________________

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]
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
|  
Report Content as Inappropriate

Re: Problem with finding cohort members via REST web services API

Are you using the version of RESTWS that's in the module repo (i.e. 0.8)? Because there's been a lot of bugfixing since then. Are you in a position to build that module from source, until we get 1.0 released?

-Darius

On Sun, May 13, 2012 at 9:02 PM, Mathias Lin | Meta Healthcare <[hidden email]> wrote:
I try to get the members of the cohort via web services, following the
API resources in the wiki, but it fails.
$ curl -i -u "admin:Admin123"
http://localhost:8080/openmrs183/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230/member
(other web services calls, like finding a cohort by UUID or by query
'q' works fine; but finding cohort members doesn't work for me).
Error log as below.


Related to that:
I found that the syntax in the API call mentioned in the ticket
https://tickets.openmrs.org/browse/RESTWS-140
curl -i -u admin:test
http://localhost:8080/openmrs/ws/rest/cohort/0bbc73bd-0986-4581-9d3a-87cdeea13251/members
differs from the one in the wiki.
(no /v1 in the url, and it's 'members' instead of 'member' at the
end). Does this just relate to a newer REST web services module other
than the one in the module repository (version 0.8.21639)?


btw: I plan to display patients of a certain cohort (or actually even
better, if possible, who are enrolled in a certain program ('saved
search'), which is dynamic, while a saved cohort is fixed) in the
role-based homepage, using the respective module. I thought of using
the web services API for that. Or is there another approach that would
be simpler (DWR?).


Cohort query works fine:

curl -i -u "admin:Admin123"
http://localhost:8080/openmrs183/ws/rest/v1/cohort?q=
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=120FB4A6A045AD550E0FD1600C1CFD65; Path=/openmrs183
ETag: "0ab50a58f7149ca8ba4dd9a2430146b11"
Content-Type: application/json;charset=UTF-8
Content-Length: 190
Date: Mon, 14 May 2012 03:58:42 GMT
{"results":[{"uuid":"7f077157-ab26-45cd-9bfd-e8911157e230","display":"HIV
Cohort","links":[{"uri":"NEED-TO-CONFIGURE/ws/rest/v1/cohort/7f077157-


Cohort search by UUID works fine:

curl -i -u "admin:Admin123"
<a href="http://localhost:8080/openmrs183/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230 HTTP/1.1" target="_blank">http://localhost:8080/openmrs183/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=74A35274221FDDC76A6A251FFDCAB59B; Path=/openmrs183
ETag: "075426985fcf5609a7e22896e3caf2bfc"
Content-Type: application/json;charset=UTF-8
Content-Length: 334
Date: Mon, 14 May 2012 03:58:52 GMT

{"uuid":"7f077157-ab26-45cd-9bfd-e8911157e230","name":"HIV
Cohort","description":"HIV
Cohort","voided":false,"memberIds":[3],"links":[{"uri":"NEED-TO-CONFIGURE/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230","rel":"self"},{"uri":"NEED-TO-CONFIGURE/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230?v=full","rel":"full"}]}


Cohort member search by cohort UUID fails:
Isn't it the cohort UUID that I need to use in the API call url (as
per wiki: GET /ws/rest/v1/cohort/{parentUuid}/member)?

curl -i -u "admin:Admin123" http://localhost:8080/ourl -i -u
"admin:Admin123"
<a href="http://localhost:8080/openmrs183/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230/member HTTP/1.1" target="_blank">http://localhost:8080/openmrs183/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230/member
HTTP/1.1 404 Not Found
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=F1FDE6D2A210EB34999EC4DFF1D28C4F; Path=/openmrs183
Content-Type: application/json;charset=UTF-8
Content-Length: 6115
Date: Mon, 14 May 2012 03:59:11 GMT

{"error":{"message":"Resource does not exist. Please check
documentation for implemented resources and their
paths","code":"org.openmrs.module.webservices.rest.web.v1_0.controller.BaseRestController:93","detail":"org.openmrs.module.webservices.rest.web.response.UnknownResourceException\n\tat
org.openmrs.module.webservices.rest.web.v1_0.controller.BaseRestController.handleUnknownResource(BaseRestController.java:93)\n\tat
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n\tat
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n\tat
java.lang.reflect.Method.invoke(Method.java:597)\n\tat
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)\n\tat
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)\n\tat
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)\n\tat
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)\n\tat
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)\n\tat
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)\n\tat
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)\n\tat
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)\n\tat
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:65)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)\n\tat
org.openmrs.module.xforms.web.XformsFilter.doFilter(XformsFilter.java:60)\n\tat
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:74)\n\tat
org.openmrs.module.webservices.rest.web.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:100)\n\tat
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:74)\n\tat
org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:58)\n\tat
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n\tat
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:74)\n\tat
org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:112)\n\tat
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)\n\tat
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)\n\tat
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n\tat
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)\n\tat
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)\n\tat
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)\n\tat
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)\n\tat
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)\n\tat
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)\n\tat
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)\n\tat
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)\n\tat
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)\n\tat
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)\n\tat
java.lang.Thread.run(Thread.java:680)\n"}}

_________________________________________

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
Mathias Lin Mathias Lin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with finding cohort members via REST web services API

Yes, 0.8 from the module repo. I searched Jira for any related ticket
regarding the cohort search, but couldn't find any, therefore my
posting.
I can build the module from the sources, no problem. Probably need to
do that anyway, as I need to get program members, not cohort members,
so I will need to extend it anyway for our custom usage, (or using the
other alpha module you pointed at in the dev list, either way).

- Mathias


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

> Are you using the version of RESTWS that's in the module repo (i.e. 0.8)?
> Because there's been a lot of bugfixing since then. Are you in a position to
> build that module from source, until we get 1.0 released?
>
> -Darius
>
> On Sun, May 13, 2012 at 9:02 PM, Mathias Lin | Meta Healthcare
> <[hidden email]> wrote:
>>
>> I try to get the members of the cohort via web services, following the
>> API resources in the wiki, but it fails.
>> $ curl -i -u "admin:Admin123"
>>
>> http://localhost:8080/openmrs183/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230/member
>> (other web services calls, like finding a cohort by UUID or by query
>> 'q' works fine; but finding cohort members doesn't work for me).
>> Error log as below.
>>
>>
>> Related to that:
>> I found that the syntax in the API call mentioned in the ticket
>> https://tickets.openmrs.org/browse/RESTWS-140
>> curl -i -u admin:test
>>
>> http://localhost:8080/openmrs/ws/rest/cohort/0bbc73bd-0986-4581-9d3a-87cdeea13251/members
>> differs from the one in the wiki.
>> (no /v1 in the url, and it's 'members' instead of 'member' at the
>> end). Does this just relate to a newer REST web services module other
>> than the one in the module repository (version 0.8.21639)?
>>
>>
>> btw: I plan to display patients of a certain cohort (or actually even
>> better, if possible, who are enrolled in a certain program ('saved
>> search'), which is dynamic, while a saved cohort is fixed) in the
>> role-based homepage, using the respective module. I thought of using
>> the web services API for that. Or is there another approach that would
>> be simpler (DWR?).
>>
>>
>> Cohort query works fine:
>>
>> curl -i -u "admin:Admin123"
>> http://localhost:8080/openmrs183/ws/rest/v1/cohort?q=
>> HTTP/1.1 200 OK
>> Server: Apache-Coyote/1.1
>> Set-Cookie: JSESSIONID=120FB4A6A045AD550E0FD1600C1CFD65; Path=/openmrs183
>> ETag: "0ab50a58f7149ca8ba4dd9a2430146b11"
>> Content-Type: application/json;charset=UTF-8
>> Content-Length: 190
>> Date: Mon, 14 May 2012 03:58:42 GMT
>> {"results":[{"uuid":"7f077157-ab26-45cd-9bfd-e8911157e230","display":"HIV
>> Cohort","links":[{"uri":"NEED-TO-CONFIGURE/ws/rest/v1/cohort/7f077157-
>>
>>
>> Cohort search by UUID works fine:
>>
>> curl -i -u "admin:Admin123"
>>
>> http://localhost:8080/openmrs183/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230
>> HTTP/1.1 200 OK
>> Server: Apache-Coyote/1.1
>> Set-Cookie: JSESSIONID=74A35274221FDDC76A6A251FFDCAB59B; Path=/openmrs183
>> ETag: "075426985fcf5609a7e22896e3caf2bfc"
>> Content-Type: application/json;charset=UTF-8
>> Content-Length: 334
>> Date: Mon, 14 May 2012 03:58:52 GMT
>>
>> {"uuid":"7f077157-ab26-45cd-9bfd-e8911157e230","name":"HIV
>> Cohort","description":"HIV
>>
>> Cohort","voided":false,"memberIds":[3],"links":[{"uri":"NEED-TO-CONFIGURE/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230","rel":"self"},{"uri":"NEED-TO-CONFIGURE/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230?v=full","rel":"full"}]}
>>
>>
>> Cohort member search by cohort UUID fails:
>> Isn't it the cohort UUID that I need to use in the API call url (as
>> per wiki: GET /ws/rest/v1/cohort/{parentUuid}/member)?
>>
>> curl -i -u "admin:Admin123" http://localhost:8080/ourl -i -u
>> "admin:Admin123"
>>
>> http://localhost:8080/openmrs183/ws/rest/v1/cohort/7f077157-ab26-45cd-9bfd-e8911157e230/member
>> HTTP/1.1 404 Not Found
>> Server: Apache-Coyote/1.1
>> Set-Cookie: JSESSIONID=F1FDE6D2A210EB34999EC4DFF1D28C4F; Path=/openmrs183
>> Content-Type: application/json;charset=UTF-8
>> Content-Length: 6115
>> Date: Mon, 14 May 2012 03:59:11 GMT
>>
>> {"error":{"message":"Resource does not exist. Please check
>> documentation for implemented resources and their
>>
>> paths","code":"org.openmrs.module.webservices.rest.web.v1_0.controller.BaseRestController:93","detail":"org.openmrs.module.webservices.rest.web.response.UnknownResourceException\n\tat
>>
>> org.openmrs.module.webservices.rest.web.v1_0.controller.BaseRestController.handleUnknownResource(BaseRestController.java:93)\n\tat
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat
>>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n\tat
>>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n\tat
>> java.lang.reflect.Method.invoke(Method.java:597)\n\tat
>>
>> org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)\n\tat
>>
>> org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)\n\tat
>>
>> org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)\n\tat
>>
>> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)\n\tat
>>
>> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)\n\tat
>>
>> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)\n\tat
>>
>> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)\n\tat
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:617)\n\tat
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
>>
>> org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:65)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
>>
>> org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)\n\tat
>>
>> org.openmrs.module.xforms.web.XformsFilter.doFilter(XformsFilter.java:60)\n\tat
>>
>> org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:74)\n\tat
>>
>> org.openmrs.module.webservices.rest.web.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:100)\n\tat
>>
>> org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:74)\n\tat
>>
>> org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:58)\n\tat
>>
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n\tat
>>
>> org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:74)\n\tat
>>
>> org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
>>
>> org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:112)\n\tat
>>
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
>>
>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)\n\tat
>>
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
>> org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
>> org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
>> org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
>>
>> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)\n\tat
>>
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat
>>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat
>>
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)\n\tat
>>
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)\n\tat
>>
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)\n\tat
>>
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)\n\tat
>>
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)\n\tat
>>
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)\n\tat
>>
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)\n\tat
>>
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)\n\tat
>>
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)\n\tat
>>
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)\n\tat
>> java.lang.Thread.run(Thread.java:680)\n"}}
>>
>> _________________________________________
>>
>> 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

_________________________________________

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]
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
Alvin Marcelo Alvin Marcelo
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Liquibaselock issues

In reply to this post by Mathias Lin
Dear all,

Our Openmrs installs have been encountering errors which have been attributed to the liquibaselock process not having been completed. I'll ask the field team to post the errordetails.

My concern is the workaround they developed:

They run a delete from liquibaselock which solves the problem. Is this  safe?

_________________________________________

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]
Wyclif Luyima-2 Wyclif Luyima-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Liquibaselock issues

It should be fine however, you should probably  seek for help from the community to fix why the install process is failing in the first place to avoid getting into this situation.

Wyclif

On Mon, May 14, 2012 at 8:37 PM, alvin.marcelo <[hidden email]> wrote:
Dear all,

Our Openmrs installs have been encountering errors which have been attributed to the liquibaselock process not having been completed. I'll ask the field team to post the errordetails.

My concern is the workaround they developed:

They run a delete from liquibaselock which solves the problem. Is this  safe?

_________________________________________

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
Darius Jazayeri-3 Darius Jazayeri-3
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Liquibaselock issues

In reply to this post by Alvin Marcelo
Hi Alvin,

Deleting from liquibasechangeloglock is safe.

The idea is that when you start OpenMRS liquibase writes to that table to indicate it's "in progress", but if things crash for any reason, it remains in the "locked" state. So as long as you know that no code is actively running updates against the database, it's safe to delete from liquibasechangeloglock.

-Darius

On Mon, May 14, 2012 at 5:37 PM, alvin.marcelo <[hidden email]> wrote:
Dear all,

Our Openmrs installs have been encountering errors which have been attributed to the liquibaselock process not having been completed. I'll ask the field team to post the errordetails.

My concern is the workaround they developed:

They run a delete from liquibaselock which solves the problem. Is this  safe?

_________________________________________

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
Ana Maria A. Chupungco Ana Maria A. Chupungco
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Liquibaselock issues

In reply to this post by Wyclif Luyima-2
Thanks, Darius and Wyclif.
 
We'll put together all the instances when it occurred and give you an update.
 
Ana

On Tue, May 15, 2012 at 9:35 AM, Wyclif Luyima <[hidden email]> wrote:
It should be fine however, you should probably  seek for help from the community to fix why the install process is failing in the first place to avoid getting into this situation.

Wyclif

On Mon, May 14, 2012 at 8:37 PM, alvin.marcelo <[hidden email]> wrote:
Dear all,

Our Openmrs installs have been encountering errors which have been attributed to the liquibaselock process not having been completed. I'll ask the field team to post the errordetails.

My concern is the workaround they developed:

They run a delete from liquibaselock which solves the problem. Is this  safe?

_________________________________________

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 Implementers' mailing list
Joseph Aghatise Joseph Aghatise
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Liquibaselock issues

We  had same error at the beginning of our implementation. We created  a first-line support manual for the facility staff to resolve the issue themselves. The problem from our experience is a result of improper shutdown, we identified this and educate our facility people on the need for proper system shutdown for the standalone. We have not had this problem since then.

Joseph Aghatise
eHealth Nigeria


On Tue, May 15, 2012 at 12:57 PM, Ana Maria A. Chupungco <[hidden email]> wrote:
Thanks, Darius and Wyclif.
 
We'll put together all the instances when it occurred and give you an update.
 
Ana

On Tue, May 15, 2012 at 9:35 AM, Wyclif Luyima <[hidden email]> wrote:
It should be fine however, you should probably  seek for help from the community to fix why the install process is failing in the first place to avoid getting into this situation.

Wyclif

On Mon, May 14, 2012 at 8:37 PM, alvin.marcelo <[hidden email]> wrote:
Dear all,

Our Openmrs installs have been encountering errors which have been attributed to the liquibaselock process not having been completed. I'll ask the field team to post the errordetails.

My concern is the workaround they developed:

They run a delete from liquibaselock which solves the problem. Is this  safe?

_________________________________________

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 Implementers' mailing list



--
Aghatise Ehis Joseph
eHealth Nigeria, Abuja
Tel: 07044029633, 08072235615
 


[hidden email] from OpenMRS Implementers' mailing list
Loading...