Skip to content

Commit 34414c2

Browse files
Merge 25.7 to 25.8
2 parents d13afdb + b405a2f commit 34414c2

11 files changed

Lines changed: 175 additions & 55 deletions

File tree

WNPRC_EHR/resources/referenceStudy/study/datasets/datasets_manifest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,5 +229,8 @@
229229
<dataset name="BehaviorAbstract" id="5015" category="ColonyManagement" type="Standard">
230230
<tags/>
231231
</dataset>
232+
<dataset name="cases" id="6020" category="Clinical" type="Standard">
233+
<tags/>
234+
</dataset>
232235
</datasets>
233236
</datasets>

WNPRC_EHR/resources/referenceStudy/study/datasets/datasets_metadata.xml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,55 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<tables xmlns="http://labkey.org/data/xml">
3+
<!-- Case dataset added just to clear errors for common EHR components -->
4+
<table tableName="cases" tableDbType="TABLE">
5+
<columns>
6+
<column columnName="Id">
7+
<datatype>varchar</datatype>
8+
<propertyURI>http://cpas.labkey.com/Study#ParticipantId</propertyURI>
9+
<importAliases>
10+
<importAlias>ptid</importAlias>
11+
</importAliases>
12+
</column>
13+
<column columnName="date">
14+
<datatype>timestamp</datatype>
15+
<propertyURI>http://cpas.labkey.com/Study#VisitDate</propertyURI>
16+
<conceptURI>http://cpas.labkey.com/Study#VisitDate</conceptURI>
17+
</column>
18+
<column columnName="enddate">
19+
<datatype>timestamp</datatype>
20+
<propertyURI>urn:ehr.labkey.org/#EndDate</propertyURI>
21+
</column>
22+
<column columnName="caseid">
23+
<datatype>varchar</datatype>
24+
<propertyURI>urn:ehr.labkey.org/#CaseId</propertyURI>
25+
</column>
26+
<column columnName="reviewdate">
27+
<datatype>timestamp</datatype>
28+
</column>
29+
<column columnName="category">
30+
<datatype>varchar</datatype>
31+
</column>
32+
<column columnName="problemCategory">
33+
<datatype>varchar</datatype>
34+
</column>
35+
<column columnName="problemSubcategory">
36+
<datatype>varchar</datatype>
37+
</column>
38+
<column columnName="plan">
39+
<datatype>varchar</datatype>
40+
</column>
41+
<column columnName="vetreview">
42+
<datatype>varchar</datatype>
43+
<propertyURI>urn:ehr.labkey.org/#VetReview</propertyURI>
44+
</column>
45+
<column columnName="vetreviewdate">
46+
<datatype>timestamp</datatype>
47+
<propertyURI>urn:ehr.labkey.org/#VetReviewDate</propertyURI>
48+
</column>
49+
</columns>
50+
<tableTitle>Cases</tableTitle>
51+
</table>
52+
<!-- -->
353
<table tableName="breeding_encounters" tableDbType="TABLE">
454
<description>Contains one row for each breeding pairing/assignment for a dam at the center.</description>
555
<columns>

WNPRC_EHR/resources/views/dataAdmin.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
{queryName: 'dental_teeth', schemaName: 'ehr_lookups', title: 'Dental Teeth Field'},
105105

106106
{queryName: 'encounter_types', schemaName: 'ehr_lookups', title: 'Encounter Types'},
107-
{queryName: 'error_types', schemaName: 'ehr_lookups', title: 'Error Report Error Types'},
108107
{queryName: 'gender_codes', schemaName: 'ehr_lookups', title: 'Gender Codes'},
109108
{queryName: 'geographic_origins', schemaName: 'ehr_lookups', title: 'Geographic Origin Codes'},
110109
{queryName: 'hematology_method', schemaName: 'ehr_lookups', title: 'Hematology Method'},

WNPRC_EHR/resources/views/ehrAdmin.html

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
items: [
1414
{name: 'Client Errors', url: '<%=contextPath%>' + '/shared/query-executeQuery.view?schemaName=auditlog&query.queryName=Client%20API%20Actions'},
1515
{name: 'EHR Backups', url: '<%=contextPath%><%=containerPath%>/Backups/project-begin.view'},
16-
{name: 'ETL Admin', url: '<%=contextPath%><%=containerPath%>/onprc_ehr-etlAdmin.view'},
1716
{name: 'Genetics Calculations', url: '<%=contextPath%><%=containerPath%>/ehr-geneticCalculationSettings.view'},
1817
//{name: 'ETL Duration', url: '<%=contextPath%><%=containerPath%>/query-executeQuery.view?schemaName=core&query.queryName=Sync Duration'},
1918
//{name: 'ETL History', url: '<%=contextPath%><%=containerPath%>/query-executeQuery.view?schemaName=core&query.queryName=Sync History'},
@@ -41,15 +40,6 @@
4140
{header: 'Logs',
4241
items: [
4342
{name: 'All Logs', url: '<%=contextPath%><%=containerPath%>/Logs/project-begin.view'},
44-
{name: 'Labkey.log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Tomcat%20Logs/labkey.log'},
45-
{name: 'Labkey-errors.log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Tomcat%20Logs/labkey-errors.log'},
46-
{name: 'ETL Log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Tomcat%20Logs/ehr-etl.log'},
47-
{name: 'ETL Errors Log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Tomcat%20Logs/ehr-etl-errors.log'},
48-
{name: 'ActiveMQ.log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/ActiveMQ/activemq.log'},
49-
{name: 'Monit.log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Monit/monit.log'},
50-
{name: 'Munin.log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Munin/munin.log'},
51-
{name: 'Inbreeding Coefficients Reload Cron Job Log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Kinship/kinshipOut.txt'},
52-
{name: 'Kinship Reload Cron Job Log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Kinship/inbreedingOut.txt'}
5343
]
5444
},
5545
{header: 'Notifications',

WNPRC_EHR/resources/views/moreReports.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
header: 'Reports',
1313
items: [
1414
{name: 'Blood Needlesticks', url: '<%=contextPath%>' + ctx['EHRStudyContainer'] + '/query-executeQuery.view?schemaName=study&query.queryName=bloodNeedlesticks'},
15-
{name: 'Housing By Room and Cage', url: '<%=contextPath%>' + ctx['EHRStudyContainer'] + '/query-executeQuery.view?schemaName=study&query.queryName=housingByRoomCage'},
1615
{name: 'Per Diems (in testing)', url: '<%=contextPath%>' + ctx['EHRStudyContainer'] + '/query-executeQuery.view?schemaName=study&query.queryName=PerDiems'},
1716
{name: 'Per Diems Raw Data (in testing)', url: '<%=contextPath%>' + ctx['EHRStudyContainer'] + '/query-executeQuery.view?schemaName=study&query.queryName=PerDiemsByDay'},
1817
{name: 'Restraints Used', url: '<%=contextPath%>' + ctx['EHRStudyContainer'] + '/query-executeQuery.view?schemaName=study&query.queryName=restraintUsed'},

WNPRC_EHR/src/org/labkey/wnprc_ehr/WNPRC_EHRModule.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@
4545
import org.labkey.api.query.DetailsURL;
4646
import org.labkey.api.query.QuerySchema;
4747
import org.labkey.api.resource.Resource;
48+
import org.labkey.api.security.Directive;
4849
import org.labkey.api.security.User;
4950
import org.labkey.api.security.roles.RoleManager;
5051
import org.labkey.api.view.WebPartFactory;
5152
import org.labkey.api.view.template.ClientDependency;
53+
import org.labkey.filters.ContentSecurityPolicyFilter;
5254
import org.labkey.wnprc_ehr.bc.BCReportRunner;
5355
import org.labkey.wnprc_ehr.buttons.ChangeBloodQCButton;
5456
import org.labkey.wnprc_ehr.buttons.CreateTaskButton;
@@ -193,6 +195,9 @@ protected void init() {
193195
addController(CONTROLLER_NAME, WNPRC_EHRController.class);
194196
addController(TEST_CONTROLLER_NAME, WNPRC_EHRTestController.class);
195197

198+
ContentSecurityPolicyFilter.registerAllowedSources("bs_style", Directive.Style, "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css");
199+
ContentSecurityPolicyFilter.registerAllowedSources("bs_font", Directive.Font, "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/fonts/");
200+
196201
registerRoles();
197202
registerPermissions();
198203
}

WNPRC_EHR/src/org/labkey/wnprc_ehr/data/ColonyCensus/ColonyCensus.java

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -135,36 +135,46 @@ public TreeMap<LocalDate, PopulationInstant> getPopulationOverTimeForSpecies(Pop
135135
Map<LocalDate, Integer> deltasPerDate = new HashMap<>();
136136
Integer animalsAtStart = 0;
137137

138-
for( String id : animalsBySpeciesId.get(species)) {
139-
AnimalEventSet animalEventSet = animalEventSetsById.get(id);
140-
for( StintAtPrimateCenter stint: animalEventSet.getStints() ) {
141-
// Null startdate is okay...
142-
LocalDate startDate = (stint.getStartDay() == null) ? null : new LocalDate(stint.getStartDay());
143-
LocalDate endDate = ( stint.getEndDay() == null) ? null : new LocalDate(stint.getEndDay());
144-
145-
146-
// Increment the counter for start of stints, if there was a start
147-
if (startDate != null) {
148-
Integer currentStartDelta = deltasPerDate.get(startDate);
149-
if (currentStartDelta == null) {
150-
currentStartDelta = 0;
138+
if (animalsBySpeciesId.get(species) != null)
139+
{
140+
for (String id : animalsBySpeciesId.get(species))
141+
{
142+
AnimalEventSet animalEventSet = animalEventSetsById.get(id);
143+
for (StintAtPrimateCenter stint : animalEventSet.getStints())
144+
{
145+
// Null startdate is okay...
146+
LocalDate startDate = (stint.getStartDay() == null) ? null : new LocalDate(stint.getStartDay());
147+
LocalDate endDate = (stint.getEndDay() == null) ? null : new LocalDate(stint.getEndDay());
148+
149+
150+
// Increment the counter for start of stints, if there was a start
151+
if (startDate != null)
152+
{
153+
Integer currentStartDelta = deltasPerDate.get(startDate);
154+
if (currentStartDelta == null)
155+
{
156+
currentStartDelta = 0;
157+
}
158+
deltasPerDate.put(startDate, currentStartDelta + 1);
159+
}
160+
else
161+
{
162+
// If there wasn't a start, assume the animal was always in the colony
163+
animalsAtStart++;
151164
}
152-
deltasPerDate.put(startDate, currentStartDelta + 1);
153-
}
154-
else {
155-
// If there wasn't a start, assume the animal was always in the colony
156-
animalsAtStart++;
157-
}
158165

159-
// Decrement the counter for end of stints, if there was an end
160-
if ( endDate != null) {
161-
Integer currentEndDelta = deltasPerDate.get(endDate);
162-
if ( currentEndDelta == null ) {
163-
currentEndDelta = 0;
166+
// Decrement the counter for end of stints, if there was an end
167+
if (endDate != null)
168+
{
169+
Integer currentEndDelta = deltasPerDate.get(endDate);
170+
if (currentEndDelta == null)
171+
{
172+
currentEndDelta = 0;
173+
}
174+
deltasPerDate.put(endDate, currentEndDelta - 1);
164175
}
165-
deltasPerDate.put(endDate, currentEndDelta - 1);
166-
}
167176

177+
}
168178
}
169179
}
170180

WNPRC_EHR/src/org/labkey/wnprc_ehr/pages/dataentry/NecropsySchedule.jsp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
dependencies.add("fullcalendar");
2323
}
2424
%>
25-
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
25+
<script src="https://code.jquery.com/jquery-1.12.4.min.js" nonce="<%=getScriptNonce()%>" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
2626
<%--<script src='https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.6.0/fullcalendar.js'></script>--%>
27-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
27+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" nonce="<%=getScriptNonce()%>">
2828
<%--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.css">--%>
29-
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-3-typeahead/4.0.2/bootstrap3-typeahead.min.js" integrity="sha512-HWlJyU4ut5HkEj0QsK/IxBCY55n5ZpskyjVlAoV9Z7XQwwkqXoYdCIC93/htL3Gu5H3R4an/S0h2NXfbZk3g7w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
30-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.70/jquery.blockUI.min.js" integrity="sha512-eYSzo+20ajZMRsjxB6L7eyqo5kuXuS2+wEbbOkpaur+sA2shQameiJiWEzCIDwJqaB0a4a6tCuEvCOBHUg3Skg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
31-
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
32-
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js"></script>
29+
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-3-typeahead/4.0.2/bootstrap3-typeahead.min.js" nonce="<%=getScriptNonce()%>" integrity="sha512-HWlJyU4ut5HkEj0QsK/IxBCY55n5ZpskyjVlAoV9Z7XQwwkqXoYdCIC93/htL3Gu5H3R4an/S0h2NXfbZk3g7w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
30+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.70/jquery.blockUI.min.js" nonce="<%=getScriptNonce()%>" integrity="sha512-eYSzo+20ajZMRsjxB6L7eyqo5kuXuS2+wEbbOkpaur+sA2shQameiJiWEzCIDwJqaB0a4a6tCuEvCOBHUg3Skg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
31+
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js" integrity="sha512-Y+0b10RbVUTf3Mi0EgJue0FoheNzentTMMIE2OreNbqnUPNbQj8zmjK3fs5D2WhQeGWIem2G2UkKjAL/bJ/UXQ==" crossorigin="anonymous" referrerpolicy="no-referrer" nonce="<%=getScriptNonce()%>"></script>
32+
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js" integrity="sha512-vjqLmddiMORo2KKnzvlZ0fMnp7Z8+U+PIzG8h/TLVhZyXpbvdfiaPiZCVtzMIC91TeM5mNKIbTIMMlPAH70uoA==" crossorigin="anonymous" referrerpolicy="no-referrer" nonce="<%=getScriptNonce()%>"></script>
3333

3434
<%
3535
SimpleQueryFactory queryFactory = new SimpleQueryFactory(getUser(), getContainer());

WNPRC_EHR/src/org/labkey/wnprc_ehr/pages/husbandry/WaterCalendar.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
107107
%>
108108

109-
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
109+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
110110

111111
<style type="text/css">
112112
/* Full Calendar heading */

WNPRC_EHR/src/org/labkey/wnprc_ehr/table/WNPRC_EHRCustomizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public void renderGridCellContents(RenderContext ctx, HtmlWriter out)
197197
String formType = (String) ctx.get(new FieldKey(getBoundColumn().getFieldKey().getParent(), "formtype"));
198198
String qcState = (String) ctx.get(new FieldKey(getBoundColumn().getFieldKey().getParent(), "QCState$Label"));
199199

200-
if (isExt4Form("form", formType))
200+
if (formType != null && isExt4Form("form", formType))
201201
{
202202
ActionURL url = new ActionURL("ehr", "dataEntryForm.view", us.getContainer());
203203
if ("Research Ultrasounds".equalsIgnoreCase(formType))

0 commit comments

Comments
 (0)