Skip to content

Commit 93fc770

Browse files
authored
Add support for adding query param in billing queries (#656)
1 parent 5927797 commit 93fc770

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

ehr_billing/api-src/org/labkey/api/ehr_billing/pipeline/BillingPipelineJobProcess.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class BillingPipelineJobProcess
3636
private boolean _useEHRContainer = false;
3737
private boolean _isMiscCharges = false;
3838
private TableInfo _miscChargesTableInfo;
39+
private Map<String,Object> _params;
3940

4041
/**
4142
*
@@ -139,9 +140,17 @@ public void setMiscCharges(boolean miscCharges, TableInfo tableInfo)
139140

140141
public Map<String, Object> getQueryParams(BillingPipelineJobSupport support)
141142
{
142-
Map<String, Object> params = new HashMap<>();
143-
params.put("StartDate", support.getStartDate());
144-
params.put("EndDate", support.getEndDate());
145-
return params;
143+
if (_params == null)
144+
_params = new HashMap<>();
145+
_params.put("StartDate", support.getStartDate());
146+
_params.put("EndDate", support.getEndDate());
147+
return _params;
148+
}
149+
150+
public void addQueryParam(String name, Object value)
151+
{
152+
if (_params == null)
153+
_params = new HashMap<>();
154+
_params.put(name, value);
146155
}
147156
}

ehr_billing/api-src/org/labkey/api/ehr_billing/pipeline/InvoicedItemsProcessingService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,6 @@ default Pair<String,String> verifyBillingRunPeriod(User user, Container containe
9696
}
9797

9898
default void processBillingRerun(String newInvoiceId, String newInvoiceRowId, Date billingStartDate, Date billingRunEndDate, int nextTransactionNumber, User user, Container container, Logger logger) {}
99+
100+
default void setBillingStartDate(Date billingStartDate) {}
99101
}

ehr_billing/src/org/labkey/ehr_billing/pipeline/BillingTask.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public RecordedActionSet run() throws PipelineJobException
149149
{
150150
getOrCreateInvoiceRunRecord();
151151
loadTransactionNumber();
152+
processingService.setBillingStartDate(getSupport().getStartDate());
152153

153154
if (null != _previousInvoice)
154155
{

0 commit comments

Comments
 (0)