addin heading to convertPrrByKey2Csv() method
This commit is contained in:
@@ -1,12 +1,19 @@
|
||||
class PrrByKey2CsvConverter {
|
||||
|
||||
static convertPrrByKey2Csv({ prrByKey, keyColumn, prrColumn }) {
|
||||
return PrrByKey2CsvConverter.#convert2Csv(
|
||||
{
|
||||
prrByKey: PrrByKey2CsvConverter.#quoteKeys(prrByKey),
|
||||
keyColumn: PrrByKey2CsvConverter.#quote(keyColumn),
|
||||
prrColumn: PrrByKey2CsvConverter.#quote(prrColumn)
|
||||
});
|
||||
static convertPrrByKey2Csv(
|
||||
{
|
||||
heading,
|
||||
columns: { keyColumn, prrColumn },
|
||||
prrByKey
|
||||
}
|
||||
) {
|
||||
return heading + '\n\n' +
|
||||
PrrByKey2CsvConverter.#convert2Csv(
|
||||
{
|
||||
prrByKey: PrrByKey2CsvConverter.#quoteKeys(prrByKey),
|
||||
keyColumn: PrrByKey2CsvConverter.#quote(keyColumn),
|
||||
prrColumn: PrrByKey2CsvConverter.#quote(prrColumn)
|
||||
});
|
||||
}
|
||||
|
||||
static #quoteKeys(prrByKey) {
|
||||
|
||||
@@ -38,9 +38,12 @@ class PrrByVaccineTableView {
|
||||
[
|
||||
PrrByKey2CsvConverter.convertPrrByKey2Csv(
|
||||
{
|
||||
prrByKey: this.#prrByVaccine,
|
||||
keyColumn: 'Vaccine',
|
||||
prrColumn: 'Proportional Reporting Ratio'
|
||||
heading: '# Symptom: ' + this.#symptom,
|
||||
columns: {
|
||||
keyColumn: 'Vaccine',
|
||||
prrColumn: 'Proportional Reporting Ratio'
|
||||
},
|
||||
prrByKey: this.#prrByVaccine
|
||||
})
|
||||
],
|
||||
{ type: 'text/csv' })),
|
||||
|
||||
Reference in New Issue
Block a user