diff --git a/docs/BatchCodeDetailsView.js b/docs/BatchCodeDetailsView.js index 068db1d9a39..a77e3951098 100644 --- a/docs/BatchCodeDetailsView.js +++ b/docs/BatchCodeDetailsView.js @@ -1,12 +1,14 @@ class BatchCodeDetailsView { #uiContainer; + #headingElement; #adverseReactionReportsChartView; #histogramChartView; #chartWithSlider; constructor(uiContainer) { this.#uiContainer = uiContainer + this.#headingElement = this.#uiContainer.querySelector(".heading"); this.#adverseReactionReportsChartView = new AdverseReactionReportsChartView(this.#uiContainer.querySelector('#adverseReactionReportsChartView')); this.#chartWithSlider = this.#uiContainer.querySelector('.chartWithSlider'); this.#histogramChartView = new HistogramChartView(this.#chartWithSlider.querySelector("canvas")); @@ -39,9 +41,7 @@ class BatchCodeDetailsView { } #displayHeading(batchcode) { - const h1 = document.createElement("h3"); - h1.appendChild(document.createTextNode(`Frequencies of reported Symptoms for Batch Code Combinations containing ${batchcode}`)); - this.#uiContainer.appendChild(h1); + this.#headingElement.textContent = `Frequencies of reported Symptoms for Batch Code Combinations containing ${batchcode}` } #displayAdverseReactionReportsChart(histoDescrs) { diff --git a/docs/BatchcodeCombinationSelection.js b/docs/BatchcodeCombinationSelection.js index 7619f42c7bd..ccd60aca310 100644 --- a/docs/BatchcodeCombinationSelection.js +++ b/docs/BatchcodeCombinationSelection.js @@ -2,7 +2,7 @@ class BatchcodeCombinationSelection { static configureSelectBatchcodeCombinationElement({ selectBatchcodeCombinationElement, histograms, onSelect }) { const batchcodesSelect = selectBatchcodeCombinationElement.querySelector('#batchcodesSelect'); - this.#addBatchcodeCombinationOptions(batchcodesSelect, histograms); + this.#setBatchcodeCombinationOptions(batchcodesSelect, histograms); batchcodesSelect.addEventListener( 'change', event => { @@ -12,7 +12,8 @@ class BatchcodeCombinationSelection { onSelect(histograms[0]); } - static #addBatchcodeCombinationOptions(batchcodesSelect, histograms) { + static #setBatchcodeCombinationOptions(batchcodesSelect, histograms) { + UIUtils.clear(batchcodesSelect); this.#getBatchcodeCombinationOptions(histograms).forEach(option => batchcodesSelect.add(option)); } diff --git a/docs/batchCodeTable.html b/docs/batchCodeTable.html index d6833035c32..a277ad0cdc7 100644 --- a/docs/batchCodeTable.html +++ b/docs/batchCodeTable.html @@ -49763,6 +49763,7 @@

+