Skip to content

Commit

Permalink
Added ability to select whether rollups should be enabled for Cost & …
Browse files Browse the repository at this point in the history
…Util reports

(cherry picked from commit b1e0a6b)
  • Loading branch information
pavgra committed Aug 16, 2018
1 parent fa22dff commit 96aabb9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public class CohortAnalysisTask {

private List<PeriodType> periods;

private boolean rollupUtilizationVisit;

private boolean rollupUtilizationDrug;

public String getSourceKey() {
return sourceKey;
}
Expand Down Expand Up @@ -270,7 +274,27 @@ public void setPeriods(final List<PeriodType> periods) {

this.periods = periods;
}


public boolean getRollupUtilizationVisit() {

return rollupUtilizationVisit;
}

public void setRollupUtilizationVisit(boolean rollupUtilizationVisit) {

this.rollupUtilizationVisit = rollupUtilizationVisit;
}

public boolean getRollupUtilizationDrug() {

return rollupUtilizationDrug;
}

public void setRollupUtilizationDrug(boolean rollupUtilizationDrug) {

this.rollupUtilizationDrug = rollupUtilizationDrug;
}

@Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,15 @@ public static String getCohortAnalysisSql(CohortAnalysisTask task) {
String[] params = new String[]{"CDM_schema", "results_schema", "source_name",
"smallcellcount", "runHERACLESHeel", "CDM_version", "cohort_definition_id", "list_of_analysis_ids",
"condition_concept_ids", "drug_concept_ids", "procedure_concept_ids", "observation_concept_ids",
"measurement_concept_ids", "cohort_period_only", "source_id", "periods"};
"measurement_concept_ids", "cohort_period_only", "source_id", "periods", "rollupUtilizationVisit", "rollupUtilizationDrug"};

String[] values = new String[]{cdmTableQualifier, resultsTableQualifier, task.getSource().getSourceName(),
String.valueOf(task.getSmallCellCount()), String.valueOf(task.runHeraclesHeel()).toUpperCase(),
task.getCdmVersion(), cohortDefinitionIds, analysisIds, conditionIds, drugIds, procedureIds,
observationIds, measurementIds,String.valueOf(task.isCohortPeriodOnly()),
String.valueOf(task.getSource().getSourceId()), concatenatedPeriods};
String.valueOf(task.getSource().getSourceId()), concatenatedPeriods,
String.valueOf(task.getRollupUtilizationVisit()).toUpperCase(), String.valueOf(task.getRollupUtilizationDrug()).toUpperCase()
};
sql = SqlRender.renderSql(sql, params, values);
sql = SqlTranslate.translateSql(sql, task.getSource().getSourceDialect(), SessionUtils.sessionId(), resultsTableQualifier);

Expand Down

0 comments on commit 96aabb9

Please sign in to comment.