-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#850 | Refactor CustomQuestions generation functionality
- Loading branch information
Showing
3 changed files
with
68 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 34 additions & 3 deletions
37
avni-server-data/src/main/java/org/avni/server/domain/metabase/QuestionName.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,47 @@ | ||
package org.avni.server.domain.metabase; | ||
|
||
public enum QuestionName { | ||
QUESTION_1("Pie Chart : Count of Non Voided Individuals - Non Voided Subject Type"), | ||
QUESTION_2("Pie Chart : Number of Non exited and Non voided Enrollments for Non Voided Program"); | ||
NonVoidedIndividual("Pie Chart : Count of Non Voided Individuals - Non Voided Subject Type", "individual", | ||
"subject_type", | ||
"subject_type_id", | ||
"name"), | ||
NonExitedNonVoidedProgram("Pie Chart : Number of Non exited and Non voided Enrolments for Non Voided Program", "program_enrolment", | ||
"program", | ||
"program_id", | ||
"name"); | ||
|
||
private final String questionName; | ||
private final String primaryTableName; | ||
private final String secondaryTableName; | ||
private final String primaryField; | ||
private final String breakoutField; | ||
|
||
QuestionName(String questionName) { | ||
|
||
QuestionName(String questionName, String primaryTableName, String secondaryTableName, String primaryField, String breakoutField) { | ||
this.questionName = questionName; | ||
this.primaryTableName = primaryTableName; | ||
this.secondaryTableName = secondaryTableName; | ||
this.primaryField = primaryField; | ||
this.breakoutField = breakoutField; | ||
} | ||
|
||
public String getQuestionName() { | ||
return questionName; | ||
} | ||
|
||
public String getPrimaryTableName() { | ||
return primaryTableName; | ||
} | ||
|
||
public String getSecondaryTableName() { | ||
return secondaryTableName; | ||
} | ||
|
||
public String getPrimaryField() { | ||
return primaryField; | ||
} | ||
|
||
public String getBreakoutField() { | ||
return breakoutField; | ||
} | ||
} |