Changeset 5144 for openmrs-modules/logicws/web/src/org/openmrs/module/logicws/web/FilterResource.java
- Timestamp:
- 08/03/08 02:50:22 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs-modules/logicws/web/src/org/openmrs/module/logicws/web/FilterResource.java
r4990 r5144 1 /** 2 * The contents of this file are subject to the OpenMRS Public License 3 * Version 1.0 (the "License"); you may not use this file except in 4 * compliance with the License. You may obtain a copy of the License at 5 * http://license.openmrs.org 6 * 7 * Software distributed under the License is distributed on an "AS IS" 8 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 9 * License for the specific language governing rights and limitations 10 * under the License. 11 * 12 * Copyright (C) OpenMRS, LLC. All Rights Reserved. 13 */ 1 14 package org.openmrs.module.logicws.web; 2 15 … … 8 21 import javax.servlet.http.HttpServletResponse; 9 22 10 import org.openmrs.Cohort;11 import org.openmrs.reporting.PatientFilter;12 23 import org.openmrs.api.context.Context; 13 24 import org.openmrs.cohort.CohortDefinitionItemHolder; 14 25 26 /** 27 * Processes queries for the list of available filters/cohorts. 28 */ 15 29 public class FilterResource implements RestResource { 16 30 31 /** 32 * @see org.openmrs.module.logicws.web.RestResource#handleRequest(org.openmrs.module.logicws.web.RestResource.Operation, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) 33 */ 17 34 public void handleRequest(Operation operation, HttpServletRequest request, 18 35 HttpServletResponse response) throws ServletException, IOException { … … 23 40 out.print("<filterList>"); 24 41 25 26 for (CohortDefinitionItemHolder c : Context.getCohortService().getAllCohortDefinitions())27 {28 out.print("<filter name=\"" + c.getName() + "\" id=\""+ c.getKey() + "\" />");42 for (CohortDefinitionItemHolder c : Context.getCohortService() 43 .getAllCohortDefinitions()) { 44 out.print("<filter name=\"" + c.getName() + "\" id=\"" 45 + c.getKey() + "\" />"); 29 46 } 30 31 32 /*33 // List Filters <filter name="VALUE" id="VALUE" />34 for (Cohort c : Context.getCohortService().getCohorts()) {35 out.print("<filter name=\"" + c.getName() + "\" id=\""36 + c.getCohortId() + "\" type=\"static\" />");37 }38 39 40 for (PatientFilter pf : Context.getReportObjectService()41 .getAllPatientFilters()) {42 out.print("<filter name=\"" + pf.getName() + "\" id=\""43 + pf.getReportObjectId() + "\" type=\"dynamic\" />");44 }45 */46 47 out.print("</filterList>"); 47 48 break;