/**
* The contents of this file are subject to the OpenMRS Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://license.openmrs.org
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* Copyright (C) OpenMRS, LLC. All Rights Reserved.
*/
package org.openmrs.module.reporting.cohort.definition.service;
import org.openmrs.module.reporting.cohort.EvaluatedCohort;
import org.openmrs.module.reporting.cohort.definition.CohortDefinition;
import org.openmrs.module.reporting.definition.service.DefinitionService;
import org.openmrs.module.reporting.evaluation.Definition;
import org.openmrs.module.reporting.evaluation.EvaluationContext;
import org.openmrs.module.reporting.evaluation.EvaluationException;
import org.openmrs.module.reporting.evaluation.parameter.Mapped;
/**
* Interface for methods used to manage and evaluate CohortDefinitions
*/
public interface CohortDefinitionService extends DefinitionService<CohortDefinition> {
/**
* @see DefinitionService#evaluate(Definition, EvaluationContext)
*/
public EvaluatedCohort evaluate(CohortDefinition definition, EvaluationContext context) throws EvaluationException;
/**
* @see DefinitionService#evaluate(Mapped, EvaluationContext)
*/
public EvaluatedCohort evaluate(Mapped<? extends CohortDefinition> definition, EvaluationContext context) throws EvaluationException;
/**
* IF YOU ARE A NORMAL CONSUMER OF THE API, DO NOT CALL THIS METHOD! THE CORRECT CONSUMER-FACING METHOD IS
* {@link #evaluate(org.openmrs.module.reporting.cohort.definition.CohortDefinition, org.openmrs.module.reporting.evaluation.EvaluationContext)}
*
* This method performs the logic of the evaluate method, but it bypasses the logic to exclude test patients. This
* is used internally by the reporting framework in special cases, e.g. to determine <em>which</em> patients are
* test patients.
*/
public EvaluatedCohort evaluateBypassingExclusionOfTestPatients(CohortDefinition definition, EvaluationContext context) throws EvaluationException;
}