Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
08/03/08 02:50:22 (5 months ago)
Author:
kevjay
Message:

logicws: Added javadocs, formatted, and reorganized code.

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 */ 
    114package org.openmrs.module.logicws.web; 
    215 
     
    821import javax.servlet.http.HttpServletResponse; 
    922 
    10 import org.openmrs.Cohort; 
    11 import org.openmrs.reporting.PatientFilter; 
    1223import org.openmrs.api.context.Context; 
    1324import org.openmrs.cohort.CohortDefinitionItemHolder; 
    1425 
     26/** 
     27 * Processes queries for the list of available filters/cohorts. 
     28 */ 
    1529public class FilterResource implements RestResource { 
    1630 
     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     */ 
    1734    public void handleRequest(Operation operation, HttpServletRequest request, 
    1835            HttpServletResponse response) throws ServletException, IOException { 
     
    2340            out.print("<filterList>"); 
    2441 
    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() + "\" />"); 
    2946            } 
    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                 */ 
    4647            out.print("</filterList>"); 
    4748            break;