Skip to content

Commit 61e41e5

Browse files
committed
Merge branch 'release26.3-SNAPSHOT' into 26.3_fb_deArchiveTwoAuditLogTables
2 parents 4a9ca10 + d7fad8b commit 61e41e5

70 files changed

Lines changed: 2317 additions & 428 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

GeneticsCore/resources/views/mhcDataDashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
'query.viewName': 'SBT Information',
6767
'query.readset~nonblank': null,
6868
'query.readset/status~isblank': null,
69-
'query.numCachedResults~gt': 0,
69+
'query.numCachedResults~eq': 0,
7070
})
7171
},{
7272
name: 'Readsets Without Alignments',

GeneticsCore/src/org/labkey/GeneticsCore/etl/ImportGeneticsCalculationsStep.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.labkey.GeneticsCore.etl;
22

33
import org.apache.commons.lang3.StringUtils;
4-
import org.apache.xmlbeans.XmlException;
54
import org.jetbrains.annotations.NotNull;
65
import org.labkey.GeneticsCore.GeneticsCoreModule;
76
import org.labkey.api.data.Container;
@@ -17,6 +16,8 @@
1716
import org.labkey.api.security.permissions.UpdatePermission;
1817
import org.labkey.api.view.UnauthorizedException;
1918
import org.labkey.api.writer.ContainerUser;
19+
import org.labkey.vfs.FileLike;
20+
import org.labkey.vfs.FileSystemLike;
2021

2122
import java.io.File;
2223
import java.util.Collections;
@@ -64,19 +65,19 @@ public RecordedActionSet run(@NotNull PipelineJob job) throws PipelineJobExcepti
6465
throw new PipelineJobException("Must provide the filepath to import data using the KinshipDataPath module property");
6566
}
6667

67-
File pipeDir = new File(pipeDirPath);
68+
FileLike pipeDir = FileSystemLike.wrapFile(new File(pipeDirPath));
6869
if (!pipeDir.exists())
6970
{
7071
throw new PipelineJobException("Path does not exist: " + pipeDir.getPath());
7172
}
7273

73-
File kinship = new File(pipeDir, "kinship.txt");
74+
FileLike kinship = pipeDir.resolveChild("kinship.txt");
7475
if (!kinship.exists())
7576
{
7677
throw new PipelineJobException("File does not exist: " + kinship.getPath());
7778
}
7879

79-
File inbreeding = new File(pipeDir, "inbreeding.txt");
80+
FileLike inbreeding = pipeDir.resolveChild("inbreeding.txt");
8081
if (!inbreeding.exists())
8182
{
8283
throw new PipelineJobException("File does not exist: " + inbreeding.getPath());
@@ -94,7 +95,7 @@ public List<String> getRequiredSettings()
9495
}
9596

9697
@Override
97-
public void setSettings(Map<String, String> settings) throws XmlException
98+
public void setSettings(Map<String, String> settings)
9899
{
99100

100101
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<customView xmlns="http://labkey.org/data/xml/queryCustomView" label="All">
2+
<columns>
3+
<column name="email"/>
4+
<column name="employeeid"/>
5+
<column name="lastname"/>
6+
<column name="firstname"/>
7+
<column name="host"/>
8+
<column name="unit"/>
9+
<column name="category"/>
10+
<column name="requirementname"/>
11+
<column name="trackingflag"/>
12+
<column name="times_completed"/>
13+
<column name="expired_period"/>
14+
<column name="new_expired_period"/>
15+
<column name="mostrecentcompleted_date"/>
16+
<column name="comment"/>
17+
<column name="months_until_renewal"/>
18+
<column name="snooze_date"/>
19+
</columns>
20+
<sorts>
21+
<sort column="lastname" descending="false"/>
22+
<sort column="firstName" descending="false"/>
23+
<sort column="requirementname" descending="false"/>
24+
</sorts>
25+
</customView>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<script type="text/javascript" nonce="<%=scriptNonce%>">
2+
3+
Ext4.onReady(function (){
4+
if (!LABKEY.ActionURL.getParameter('employeeid')){
5+
alert('Must Provide An Employee Id');
6+
return;
7+
}
8+
9+
var webpart = <%=webpartContext%>;
10+
Ext4.create('EHR_ComplianceDB.panel.EmployeeDetailsPanel', {
11+
employeeId: LABKEY.ActionURL.getParameter('employeeid'),
12+
schemaName: 'EmployeeData'
13+
}).render(webpart.wrapperDivId);
14+
});
15+
16+
</script>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<view xmlns="http://labkey.org/data/xml/view" title="Employee Details" frame="none">
2+
<dependencies>
3+
<dependency path="Ext4"/>
4+
<dependency path="LDK/LDKApi"/>
5+
<dependency path="ehr_complianceDB/panel/EmployeeDetailsPanel.js"/>
6+
</dependencies>
7+
</view>

onprc_billing/resources/queries/onprc_billing/leaseFees.sql

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ When a5.id is not Null
5656
then (Select c.rowid from Site.{substitutePath moduleProperty('ONPRC_Billing','BillingContainer')}.onprc_billing.chargeableItems c where c.itemCode = 'ONR41')
5757
When (a4.id is not null and (TIMESTAMPDIFF('SQL_TSI_Day',a.date,a.projectedRelease)) <=14 and a.endDate is null and a.ageAtTime.AgeAtTimeYearsRounded < 1)
5858
then (Select c.rowid from Site.{substitutePath moduleProperty('ONPRC_Billing','BillingContainer')}.onprc_billing.chargeableItems c where c.itemCode = 'ONR44')
59-
WHEN (a.duration <= CAST(javaConstant('org.labkey.onprc_billing.ONPRC_BillingManager.DAY_LEASE_MAX_DURATION') as INTEGER) AND a.enddate IS NOT NULL AND a.assignCondition = a.releaseCondition) THEN (SELECT rowid FROM onprc_billing_public.chargeableItems ci WHERE ci.active = true AND ci.name = javaConstant('org.labkey.onprc_billing.ONPRC_BillingManager.DAY_LEASE_NAME'))
60-
WHEN (a.duration <= CAST(javaConstant('org.labkey.onprc_billing.ONPRC_BillingManager.DAY_LEASE_MAX_DURATION') as INTEGER) AND a.enddate IS NOT NULL AND a.assignCondition = a.releaseCondition) THEN (SELECT rowid FROM onprc_billing_public.chargeableItems ci WHERE ci.active = true AND ci.name = javaConstant('org.labkey.onprc_billing.ONPRC_BillingManager.DAY_LEASE_NAME'))
59+
WHEN (a.duration <= CAST(javaConstant('org.labkey.onprc_billing.ONPRC_BillingManager.DAY_LEASE_MAX_DURATION') as INTEGER) AND a.enddate IS NOT NULL AND a.assignCondition = a.releaseCondition) THEN (SELECT rowid FROM onprc_billing_public.chargeableItems ci WHERE ci.active = true AND ci.name = javaConstant('org.labkey.onprc_billing.ONPRC_BillingManager.DAY_LEASE_NAME'))
6160
WHEN a2.id IS NOT NULL THEN (SELECT rowid FROM onprc_billing_public.chargeableItems ci WHERE (ci.startDate <= a.date and ci.endDate >= a.date) AND ci.name = javaConstant('org.labkey.onprc_billing.ONPRC_BillingManager.TMB_LEASE_NAME'))
6261
ELSE lf.chargeId
6362
END as chargeId,
@@ -81,7 +80,8 @@ CASE
8180
where b.id = a.id and a1.project.protocol = a2.project.protocol) > 0 THEN 0
8281

8382
WHEN (a.duration = 0 AND a.enddate IS NOT NULL AND a.assignCondition = a.releaseCondition) THEN 1
84-
WHEN (fl.id Is Not Null) THEN 0
83+
-- Exempt PI-purchased NHPs from lease fees
84+
WHEN (fl.id IS NOT NULL) THEN 0
8585
--This will check for infants born to resource moms and will not charge
8686

8787
WHEN (a.duration <= CAST(javaConstant('org.labkey.onprc_billing.ONPRC_BillingManager.DAY_LEASE_MAX_DURATION') as INTEGER) AND a.enddate IS NOT NULL AND a.assignCondition = a.releaseCondition) THEN a.duration
@@ -139,21 +139,20 @@ LEFT JOIN onprc_billing.leaseFeeDefinition lf ON (
139139
AND lf.active = true
140140
)
141141

142-
143-
144-
--adds the reasearch owned animal exemption
145-
LEFT JOIN study.flags fl on
146-
(a.id = fl.id
147-
and fl.flag.code = 4034
148-
and (a.date >= fl.date and a.date <=COALESCE(fl.enddate,Now()) ))
149-
142+
-- Add PI-purchased NHP flag data
143+
LEFT JOIN study.flags fl
144+
ON (a.id = fl.id
145+
AND fl.flag.code = 4034
146+
AND a.date BETWEEN CAST(fl.date AS DATE) AND COALESCE(fl.enddate, now())
147+
)
150148

151149
WHERE CAST(a.datefinalized AS DATE) >= CAST(STARTDATE as DATE) AND CAST(a.datefinalized AS DATE) <= CAST(ENDDATE as DATE)
152150
AND a.qcstate.publicdata = true --and a.participantID.demographics.species.common not in ('Rabbit','Guinea Pigs')
153151

154152

155-
--add setup fees for all starts, except day leases aznd sla
153+
-- Add lease setup fees for all lease starts, except day leases, PI-purchased NHPs, and sla
156154
UNION ALL
155+
157156
SELECT
158157
a.id,
159158
a.date,
@@ -168,7 +167,7 @@ SELECT
168167
' ' as ESPFAnimal,
169168
'Lease Setup Fees' as category,
170169
(SELECT rowid FROM onprc_billing_public.chargeableItems ci WHERE ci.active = true AND ci.name = javaConstant('org.labkey.onprc_billing.ONPRC_BillingManager.LEASE_SETUP_FEES')) as chargeId,
171-
1 as quantity,
170+
1 AS quantity,
172171
cast(null as integer) as leaseCharge1,
173172
cast(null as integer) as leaseCharge2,
174173
a.objectid as sourceRecord,
@@ -179,11 +178,19 @@ SELECT
179178

180179
FROM study.assignment a
181180

181+
-- Add PI-purchased NHP flag data
182+
LEFT JOIN study.flags fl
183+
ON (a.id = fl.id
184+
AND fl.flag.code = 4034
185+
AND a.date BETWEEN CAST(fl.date AS DATE) AND COALESCE(fl.enddate, now())
186+
)
187+
182188
WHERE CAST(a.datefinalized AS DATE) >= CAST(STARTDATE as DATE) AND CAST(a.datefinalized AS DATE) <= CAST(ENDDATE as DATE)
183189
AND a.qcstate.publicdata = true
184190
--only charge setup fee for leases >24H. note: duration assumes today as end, so exclude null enddates
185191
AND ((a.duration > CAST(javaConstant('org.labkey.onprc_billing.ONPRC_BillingManager.DAY_LEASE_MAX_DURATION') as INTEGER)) OR ( a.assignCondition != a.releaseCondition AND a.enddate IS NULL))
186192
and a.id.demographics.species Not IN ('Rabbit','Guinea Pigs')
193+
AND fl.id IS NULL -- Exempt PI-purchased NHPs from lease setup fees
187194

188195
--add released animals that need adjustments
189196
UNION ALL
@@ -208,9 +215,9 @@ a5.id as ESPFAnimal,
208215
--////This selectes the charge ID to be used
209216
(SELECT max(rowid) as rowid FROM onprc_billing_public.chargeableItems ci WHERE ci.name = javaConstant('org.labkey.onprc_billing.ONPRC_BillingManager.LEASE_FEE_ADJUSTMENT') and ci.active = true) as chargeId,
210217
CASE
211-
when (fl.id Is Not Null) then 0
212-
else 1
213-
end as quantity,
218+
WHEN (fl.id IS NOT NULL) THEN 0 -- Exempt PI-purchased NHPs from lease fees
219+
ELSE 1
220+
END AS quantity,
214221
lf2.chargeId as leaseCharge1,
215222
lf.chargeId as leaseCharge2,
216223
a.objectid as sourceRecord,
@@ -248,11 +255,12 @@ LEFT join assignment_U42ESPF a5 on
248255
and a5.dateonly <=a.dateOnly
249256
AND a5.endDateCoalesced >= a.dateOnly)
250257

251-
--adds the reasearch owned animal exemption
252-
LEFT JOIN study.flags fl on
253-
(a.id = fl.id
254-
and fl.flag.code = 4034
255-
and (a.date >= fl.date and a.date <=COALESCE(fl.enddate,Now()) ))
258+
-- Add PI-purchased NHP flag data
259+
LEFT JOIN study.flags fl
260+
ON (a.id = fl.id
261+
AND fl.flag.code = 4034
262+
AND a.date BETWEEN CAST(fl.date AS DATE) AND COALESCE(fl.enddate, now())
263+
)
256264

257265
WHERE a.releaseCondition != a.projectedReleaseCondition
258266
and (A.id != A5.id or A5.id is Null)

onprc_billing/src/org/labkey/onprc_billing/ONPRC_BillingController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@
4343
import org.labkey.onprc_billing.notification.BillingValidationNotification;
4444
import org.labkey.onprc_billing.pipeline.BillingPipelineJob;
4545
import org.labkey.onprc_billing.security.ONPRCBillingAdminPermission;
46+
import org.labkey.vfs.FileLike;
4647
import org.springframework.validation.BindException;
4748
import org.springframework.validation.Errors;
4849
import org.springframework.web.servlet.ModelAndView;
4950

5051
import java.io.File;
52+
import java.io.IOException;
5153
import java.util.Date;
5254
import java.util.HashMap;
5355
import java.util.Map;
@@ -68,14 +70,14 @@ public ONPRC_BillingController()
6870
public static class RunBillingPipelineAction extends MutatingApiAction<BillingPipelineForm>
6971
{
7072
@Override
71-
public ApiResponse execute(BillingPipelineForm form, BindException errors) throws PipelineJobException
73+
public ApiResponse execute(BillingPipelineForm form, BindException errors) throws IOException
7274
{
7375
Map<String, Object> resultProperties = new HashMap<>();
7476

7577
try
7678
{
7779
PipeRoot pipelineRoot = PipelineService.get().findPipelineRoot(getContainer());
78-
File analysisDir = BillingPipelineJob.createAnalysisDir(pipelineRoot, form.getProtocolName());
80+
FileLike analysisDir = BillingPipelineJob.createAnalysisDir(pipelineRoot, form.getProtocolName());
7981
PipelineService.get().queueJob(new BillingPipelineJob(getContainer(), getUser(), getViewContext().getActionURL(), pipelineRoot, analysisDir, form));
8082

8183
resultProperties.put("success", true);

onprc_billing/src/org/labkey/onprc_billing/pipeline/BillingPipelineJob.java

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
import org.labkey.api.view.ActionURL;
3131
import org.labkey.api.view.ViewBackgroundInfo;
3232
import org.labkey.onprc_billing.ONPRC_BillingController;
33+
import org.labkey.vfs.FileLike;
3334

34-
import java.io.File;
35+
import java.io.IOException;
3536
import java.util.Calendar;
3637
import java.util.Date;
3738

@@ -42,33 +43,30 @@
4243
*/
4344
public class BillingPipelineJob extends PipelineJob implements BillingPipelineJobSupport
4445
{
45-
private File _analysisDir;
4646
private ONPRC_BillingController.BillingPipelineForm _form;
4747

4848
// For deserialization
4949
public BillingPipelineJob()
5050
{
5151
}
5252

53-
public BillingPipelineJob(Container c, User user, ActionURL url, PipeRoot pipeRoot, File analysisDir, ONPRC_BillingController.BillingPipelineForm form)
53+
public BillingPipelineJob(Container c, User user, ActionURL url, PipeRoot pipeRoot, FileLike analysisDir, ONPRC_BillingController.BillingPipelineForm form)
5454
{
5555
super(null, new ViewBackgroundInfo(c, user, url), pipeRoot);
56-
57-
_analysisDir = analysisDir;
58-
setLogFile(new File(analysisDir, FileUtil.makeFileNameWithTimestamp("billingPipeline", "log")));
56+
setLogFile(analysisDir.resolveChild(FileUtil.makeFileNameWithTimestamp("billingPipeline", "log")));
5957
_form = form;
6058
}
6159

62-
public static File createAnalysisDir(PipeRoot pipeRoot, String name) throws PipelineValidationException
60+
public static FileLike createAnalysisDir(PipeRoot pipeRoot, String name) throws PipelineValidationException, IOException
6361
{
6462
String trialName = FileUtil.makeLegalName(name);
65-
File analysisDir = new File(pipeRoot.getRootPath(), trialName);
63+
FileLike analysisDir = pipeRoot.resolvePathToFileLike(trialName);
6664
int suffix = 0;
6765
while (analysisDir.exists())
6866
{
6967
suffix++;
7068
trialName = FileUtil.makeLegalName(name) + "." + suffix;
71-
analysisDir = new File(pipeRoot.getRootPath(), trialName);
69+
analysisDir = pipeRoot.resolvePathToFileLike(trialName);
7270
}
7371

7472
analysisDir.mkdirs();
@@ -89,23 +87,21 @@ public ActionURL getStatusHref()
8987
}
9088

9189
@Override
92-
public TaskPipeline getTaskPipeline()
90+
public TaskPipeline<?> getTaskPipeline()
9391
{
9492
return PipelineJobService.get().getTaskPipeline(new TaskId(BillingPipelineJob.class));
9593
}
9694

9795
@Override
9896
public Date getStartDate()
9997
{
100-
Date ret = _form.getStartDate() == null ? null : DateUtils.truncate(_form.getStartDate(), Calendar.DATE);
101-
return ret;
98+
return _form.getStartDate() == null ? null : DateUtils.truncate(_form.getStartDate(), Calendar.DATE);
10299
}
103100

104101
@Override
105102
public Date getEndDate()
106103
{
107-
Date ret = _form.getEndDate() == null ? null : DateUtils.truncate(_form.getEndDate(), Calendar.DATE);
108-
return ret;
104+
return _form.getEndDate() == null ? null : DateUtils.truncate(_form.getEndDate(), Calendar.DATE);
109105
}
110106

111107
@Override
@@ -119,10 +115,4 @@ public String getName()
119115
{
120116
return _form.getProtocolName();
121117
}
122-
123-
@Override
124-
public File getAnalysisDir()
125-
{
126-
return _analysisDir;
127-
}
128118
}

onprc_billing/src/org/labkey/onprc_billing/pipeline/BillingPipelineJobSupport.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,4 @@ public interface BillingPipelineJobSupport
3232
String getComment();
3333

3434
String getName();
35-
36-
File getAnalysisDir();
3735
}

0 commit comments

Comments
 (0)