public interface LogicContext
| Modifier and Type | Method and Description | 
|---|---|
Result | 
eval(Integer patientId,
    LogicCriteria criteria,
    Map<String,Object> parameters)
Evaluate a rule with criteria and parameters for a single patient 
 | 
Result | 
eval(Integer patientId,
    String token)
Evaluate a rule for a single patient 
 | 
Result | 
eval(Integer patientId,
    String token,
    Map<String,Object> parameters)
Evaluate a rule with parameters for a single patient 
 | 
Object | 
getGlobalParameter(String id)
Fetches a global parameter value by name 
 | 
Collection<String> | 
getGlobalParameters()  | 
Date | 
getIndexDate()  | 
LogicDataSource | 
getLogicDataSource(String name)
Fetches a logic data source by name 
 | 
Patient | 
getPatient(Integer patientId)
Gets the patient object for the given patient id (this patient must be in the cohort of this context) 
 | 
Result | 
read(Integer patientId,
    LogicCriteria criteria)
Reads a key with criteria from a logic data source 
 | 
Result | 
read(Integer patientId,
    LogicDataSource dataSource,
    LogicCriteria criteria)
Reads a key with criteria from a logic data source 
 | 
Result | 
read(Integer patientId,
    LogicDataSource dataSource,
    String key)
Reads a key from a logic data source 
 | 
Result | 
read(Integer patientId,
    String key)
Reads a key from a logic data source 
 | 
Object | 
setGlobalParameter(String id,
                  Object value)
Assigns a value to a global parameters within this logic context 
 | 
void | 
setIndexDate(Date indexDate)
Changes the index date for this logic context 
 | 
Date | 
today()  | 
Patient getPatient(Integer patientId)
patientId - Result eval(Integer patientId, String token) throws LogicException
patientId - token - Result of the evaluationLogicExceptionLogicService.eval(Patient, String)Result eval(Integer patientId, String token, Map<String,Object> parameters) throws LogicException
patientId - token - parameters - Result of the evaluationLogicExceptionLogicService.eval(Patient, String, Map)Result eval(Integer patientId, LogicCriteria criteria, Map<String,Object> parameters) throws LogicException
patientId - criteria - parameters - Result object with the result of the evaluationLogicExceptionLogicService.eval(Patient, LogicCriteria, Map)LogicDataSource getLogicDataSource(String name)
name - LogicDataSourceResult read(Integer patientId, LogicDataSource dataSource, String key) throws LogicException
patientId - dataSource - key - Result of the read operationLogicExceptionResult read(Integer patientId, String key) throws LogicException
patientId - key - Result of the read operationLogicExceptionResult read(Integer patientId, LogicCriteria criteria) throws LogicException
patientId - criteria - Result of the readLogicExceptionResult read(Integer patientId, LogicDataSource dataSource, LogicCriteria criteria) throws LogicException
patientId - dataSource - criteria - Result of the readLogicExceptionvoid setIndexDate(Date indexDate)
indexDate - the new Date value for "today" to be used by rules within this
            logic contextDate getIndexDate()
Date today()
getIndexDate()Object setGlobalParameter(String id, Object value)
id - value - Object getGlobalParameter(String id)
id - ObjectCollection<String> getGlobalParameters()
Copyright © 2018 OpenMRS LLC.. All Rights Reserved.