/** * Gets allergies for a given patient (paged according to context if necessary) only if a * patient parameter exists in the request set on the {@link RequestContext} * * @param context * @see org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource#doSearch(RequestContext) */ @Override protected PageableResult doSearch(RequestContext context) { String patientUuid = context.getRequest().getParameter("patient"); if (patientUuid != null) { Patient patient = ((PatientResource1_8) Context.getService(RestService.class).getResourceBySupportedClass( Patient.class)).getByUniqueId(patientUuid); if (patient == null) return new EmptySearchResult(); return new NeedsPaging<Allergy>(Context.getPatientService().getAllergies(patient), context); } //currently this is not supported since the superclass throws an exception return super.doSearch(context); }
/** * Gets problems for a given patient (paged according to context if necessary) only if a patient * parameter exists in the request set on the {@link RequestContext} * * @param context * @see org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource#doSearch(org.openmrs.module.webservices.rest.web.RequestContext) */ @Override protected PageableResult doSearch(RequestContext context) { String patientUuid = context.getRequest().getParameter("patient"); if (patientUuid != null) { Patient patient = ((PatientResource1_8) Context.getService(RestService.class).getResourceBySupportedClass( Patient.class)).getByUniqueId(patientUuid); if (patient == null) return new EmptySearchResult(); return new NeedsPaging<Problem>(Context.getPatientService().getProblems(patient), context); } //currently this is not supported since the superclass throws an exception return super.doSearch(context); }