Skip to content

Commit cb34964

Browse files
authored
Luminex module property for setting a min filter date for Levey-Jennings reports (#996)
- Add a module property to luminex module for site level "leveyJenningsMinDate" - If available, apply "leveyJenningsMinDate" as AcquisitionDate min date filter to Levey-Jennings report data query - If available, show plot footer message for "leveyJenningsMinDate" AcquisitionDate min date filter to Levey-Jennings report data query
1 parent b127651 commit cb34964

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

luminex/src/org/labkey/luminex/LuminexModule.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.labkey.api.exp.property.PropertyService;
2929
import org.labkey.api.module.DefaultModule;
3030
import org.labkey.api.module.ModuleContext;
31+
import org.labkey.api.module.ModuleProperty;
3132
import org.labkey.api.view.WebPartFactory;
3233
import org.labkey.luminex.query.LuminexProtocolSchema;
3334

@@ -84,6 +85,12 @@ public void doStartup(ModuleContext moduleContext)
8485
PropertyService.get().registerDomainKind(new LuminexDataDomainKind());
8586

8687
AssayFlagHandler.registerHandler(AssayService.get().getProvider(LuminexAssayProvider.NAME), new AssayDefaultFlagHandler());
88+
89+
ModuleProperty leveyJenningsMinDateProp = new ModuleProperty(this, "leveyJenningsMinDate");
90+
leveyJenningsMinDateProp.setLabel("Levey-Jennings Report Min Date Filter");
91+
leveyJenningsMinDateProp.setDescription("If provided, the minimum acquisition date to use as a filter for the Luminex Levey-Jennings report data");
92+
leveyJenningsMinDateProp.setInputType(ModuleProperty.InputType.text);
93+
addModuleProperty(leveyJenningsMinDateProp);
8794
}
8895

8996
@Override

luminex/webapp/luminex/LeveyJenningsTrackingDataPanel.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ LABKEY.LeveyJenningsTrackingDataPanel = Ext.extend(Ext.Component, {
104104
filters.push(LABKEY.Filter.create('Titration/IncludeInQcReport', true));
105105
}
106106

107+
var minDateProp = LABKEY.getModuleContext("luminex")?.leveyJenningsMinDate;
108+
if (minDateProp) {
109+
filters.push(LABKEY.Filter.create('Analyte/Data/AcquisitionDate', minDateProp, LABKEY.Filter.Types.GTE));
110+
}
111+
107112
var buttonBarItems = [
108113
LABKEY.QueryWebPart.standardButtons.views,
109114
LABKEY.QueryWebPart.standardButtons.exportRows,

luminex/webapp/luminex/LeveyJenningsTrendPlotPanel.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,9 @@ LABKEY.LeveyJenningsTrendPlotPanel = Ext.extend(Ext.FormPanel, {
154154
});
155155
this.items.push(this.trendTabPanel);
156156

157-
this.fbar = [
158-
{xtype: 'label', text: 'The default plot is showing the most recent ' + this.defaultRowSize + ' data points.'},
159-
];
157+
this.fbar = [];
160158

161159
LABKEY.LeveyJenningsTrendPlotPanel.superclass.initComponent.call(this);
162-
163-
this.fbar.hide();
164160
},
165161

166162
// function called by the JSP when the graph params are selected and the "Apply" button is clicked
@@ -193,10 +189,23 @@ LABKEY.LeveyJenningsTrendPlotPanel = Ext.extend(Ext.FormPanel, {
193189
}
194190

195191
this.plotDataLoadComplete = true;
196-
this.fbar.setVisible(!hasReportFilter && this.trendDataStore.getTotalCount() >= this.defaultRowSize);
192+
193+
this.fbar.removeAll();
194+
if (!hasReportFilter && this.trendDataStore.getTotalCount() >= this.defaultRowSize) {
195+
this.fbar.add({xtype: 'label', text: 'The default plot is showing the most recent ' + this.defaultRowSize + ' data points.'});
196+
}
197+
if (this.getMinDateModuleProp()) {
198+
this.fbar.add({xtype: 'label', text: 'Filtering for acquisition date greater than or equal to ' + this.getMinDateModuleProp() + '.'});
199+
}
200+
this.fbar.doLayout();
201+
197202
this.updateTrendPlot();
198203
},
199204

205+
getMinDateModuleProp: function() {
206+
return LABKEY.getModuleContext("luminex")?.leveyJenningsMinDate;
207+
},
208+
200209
setTrendPlotLoading: function() {
201210
this.plotDataLoadComplete = false;
202211
var plotType = this.trendTabPanel.getActiveTab().itemId;

0 commit comments

Comments
 (0)