refactoring

This commit is contained in:
frankknoll
2023-10-15 15:23:10 +02:00
parent d84bc82a8c
commit fb53822fdc
6 changed files with 74 additions and 76 deletions

View File

@@ -3,6 +3,7 @@ class PrrBySymptomTable {
#tableElement;
#table;
#sumPrrs;
#prrBySymptom;
constructor(tableElement) {
this.#tableElement = tableElement;
@@ -13,10 +14,23 @@ class PrrBySymptomTable {
}
display(prrBySymptom) {
this.#prrBySymptom = prrBySymptom;
const symptom_prr_pairs = Object.entries(prrBySymptom);
this.#setTableRows(symptom_prr_pairs);
}
getDisplayedTableAsCsv(heading) {
return PrrByKey2CsvConverter.convertPrrByKey2Csv(
{
heading: heading,
columns: {
keyColumn: 'Symptom',
prrColumn: 'Proportional Reporting Ratio > 1'
},
prrByKey: this.#prrBySymptom
});
}
#createEmptyTable() {
return this.#tableElement.DataTable(
{