Patient Allergy Error

Module: OpenMRS rest API

Module Version: I am currently using the online demo website at https://demo.openmrs.org/openmrs/ws/rest/v1/

System Version: I am currently using the online demo website

Issue or Question: Getting Patient Allergy Using the RestApi module is throwing 500 error, What are mine doing wrong? https://demo.openmrs.org/openmrs/ws/rest/v1/patient/b52ec6f9-0e26-424c-a4a1-c64f9d571eb3/allergy

Type Exception Report

Message Request processing failed; nested exception is org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:73) org.openmrs.web.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:65) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71) org.openmrs.module.webservices.rest.web.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:105) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71) org.openmrs.module.webservices.rest.web.filter.ContentTypeFilter.doFilter(ContentTypeFilter.java:64) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71) org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:106) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71) org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:93) org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:61) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71) org.openmrs.module.spa.filter.SpaFilter.doFilter(SpaFilter.java:53) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71) org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:57) org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:105) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:156) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:108) org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:108) org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:108) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) Root Cause

org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs2_0.PatientAllergyResource2_0.doGetAll(PatientAllergyResource2_0.java:179) org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs2_0.PatientAllergyResource2_0.doGetAll(PatientAllergyResource2_0.java:42) org.openmrs.module.webservices.rest.web.resource.impl.DelegatingSubResource.getAll(DelegatingSubResource.java:176) org.openmrs.module.webservices.rest.web.v1_0.controller.MainSubResourceController.get(MainSubResourceController.java:106) sun.reflect.GeneratedMethodAccessor1589.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:73) org.openmrs.web.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:65) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71) org.openmrs.module.webservices.rest.web.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:105) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71) org.openmrs.module.webservices.rest.web.filter.ContentTypeFilter.doFilter(ContentTypeFilter.java:64) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71) org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:106) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71) org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:93) org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:61) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71) org.openmrs.module.spa.filter.SpaFilter.doFilter(SpaFilter.java:53) org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71) org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:57) org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:105) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:156) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:108) org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:108) org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:108) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) Note The full stack trace of the root cause is available in the server logs.

You are getting that error because the patient does not yet have any allergies. This is the ticket for fixing it: [RESTWS-895] Fetching allergies for a newly registered patient throws an exception - OpenMRS Issues

@kdaud do you have any status update for this? Or should i unassign you and have some body else take it up?