use of org.hl7.davinci.endpoint.database.RuleMapping in project CRD by HL7-DaVinci.
the class RuleFinder method findRules.
/**
* Find and retern the relevant coverage rules in the database.
* @param criteria The search criteria object
* @return List of matching RuleMapping entries
*/
public List<RuleMapping> findRules(CoverageRequirementRuleCriteria criteria) {
logger.info("RuleFinder::findRules(" + criteria.getQueryString() + ")");
List<RuleMapping> ruleList = new ArrayList<>();
if (ruleMappingRepository == null) {
logger.warn("RuleFinder::findRules: the ruleMappingRepository is null");
return ruleList;
}
for (RuleMapping rule : ruleMappingRepository.findRules(criteria)) {
ruleList.add(rule);
}
if (ruleList.size() == 0) {
logger.info("RuleFinder::findRules() returned no results for query: " + criteria.toString());
}
return ruleList;
}
use of org.hl7.davinci.endpoint.database.RuleMapping in project CRD by HL7-DaVinci.
the class FhirBundleProcessor method buildExecutionContexts.
private void buildExecutionContexts(List<CoverageRequirementRuleCriteria> criteriaList, HashMap<String, Resource> cqlParams) {
for (CoverageRequirementRuleCriteria criteria : criteriaList) {
logger.info("FhirBundleProcessor::buildExecutionContexts() criteria: " + criteria.toString());
List<RuleMapping> rules = fileStore.findRules(criteria);
for (RuleMapping rule : rules) {
CoverageRequirementRuleResult result = new CoverageRequirementRuleResult();
result.setCriteria(criteria).setTopic(rule.getTopic());
try {
logger.info("FhirBundleProcessor::buildExecutionContexts() found rule topic: " + rule.getTopic());
// get the CqlRule
CqlRule cqlRule = fileStore.getCqlRule(rule.getTopic(), rule.getFhirVersion());
result.setContext(CqlExecutionContextBuilder.getExecutionContext(cqlRule, cqlParams, baseUrl));
results.add(result);
} catch (Exception e) {
logger.info("r4/FhirBundleProcessor::buildExecutionContexts: failed processing cql bundle: " + e.getMessage());
}
}
}
}
use of org.hl7.davinci.endpoint.database.RuleMapping in project CRD by HL7-DaVinci.
the class RuleFinder method findRules.
public List<RuleMapping> findRules(String topic, String fhirVersion) {
logger.info("RuleFinder::findRules(" + topic + ", " + fhirVersion + ")");
List<RuleMapping> ruleList = new ArrayList<>();
if (ruleMappingRepository == null) {
logger.warn("RuleFinder::findRules: the ruleMappingRepository is null");
return ruleList;
}
for (RuleMapping rule : ruleMappingRepository.findRules(topic, fhirVersion)) {
ruleList.add(rule);
}
if (ruleList.size() == 0) {
logger.info("RuleFinder::findRules() returned no results for topic: " + topic + "(" + fhirVersion + ")");
}
return ruleList;
}
use of org.hl7.davinci.endpoint.database.RuleMapping in project CRD by HL7-DaVinci.
the class RuleFinder method findAll.
/**
* Find all of the lookup table rules in the database.
* @return List of all RuleMapping entries
*/
public List<RuleMapping> findAll() {
logger.info("RuleFinder::findAll()");
List<RuleMapping> ruleList = new ArrayList<>();
for (RuleMapping rule : ruleMappingRepository.findAll()) {
ruleList.add(rule);
}
if (ruleList.size() == 0) {
logger.debug("RuleFinder returned no results for find all");
}
return ruleList;
}
Aggregations