Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,8 @@
<dataset name="BehaviorAbstract" id="5015" category="ColonyManagement" type="Standard">
<tags/>
</dataset>
<dataset name="cases" id="6020" category="Clinical" type="Standard">
<tags/>
</dataset>
</datasets>
</datasets>
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<tables xmlns="http://labkey.org/data/xml">
<!-- Case dataset added just to clear errors for common EHR components -->
<table tableName="cases" tableDbType="TABLE">
<columns>
<column columnName="Id">
<datatype>varchar</datatype>
<propertyURI>http://cpas.labkey.com/Study#ParticipantId</propertyURI>
<importAliases>
<importAlias>ptid</importAlias>
</importAliases>
</column>
<column columnName="date">
<datatype>timestamp</datatype>
<propertyURI>http://cpas.labkey.com/Study#VisitDate</propertyURI>
<conceptURI>http://cpas.labkey.com/Study#VisitDate</conceptURI>
</column>
<column columnName="enddate">
<datatype>timestamp</datatype>
<propertyURI>urn:ehr.labkey.org/#EndDate</propertyURI>
</column>
<column columnName="caseid">
<datatype>varchar</datatype>
<propertyURI>urn:ehr.labkey.org/#CaseId</propertyURI>
</column>
<column columnName="reviewdate">
<datatype>timestamp</datatype>
</column>
<column columnName="category">
<datatype>varchar</datatype>
</column>
<column columnName="problemCategory">
<datatype>varchar</datatype>
</column>
<column columnName="problemSubcategory">
<datatype>varchar</datatype>
</column>
<column columnName="plan">
<datatype>varchar</datatype>
</column>
<column columnName="vetreview">
<datatype>varchar</datatype>
<propertyURI>urn:ehr.labkey.org/#VetReview</propertyURI>
</column>
<column columnName="vetreviewdate">
<datatype>timestamp</datatype>
<propertyURI>urn:ehr.labkey.org/#VetReviewDate</propertyURI>
</column>
</columns>
<tableTitle>Cases</tableTitle>
</table>
<!-- -->
<table tableName="breeding_encounters" tableDbType="TABLE">
<description>Contains one row for each breeding pairing/assignment for a dam at the center.</description>
<columns>
Expand Down
1 change: 0 additions & 1 deletion WNPRC_EHR/resources/views/dataAdmin.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
{queryName: 'dental_teeth', schemaName: 'ehr_lookups', title: 'Dental Teeth Field'},

{queryName: 'encounter_types', schemaName: 'ehr_lookups', title: 'Encounter Types'},
{queryName: 'error_types', schemaName: 'ehr_lookups', title: 'Error Report Error Types'},
{queryName: 'gender_codes', schemaName: 'ehr_lookups', title: 'Gender Codes'},
{queryName: 'geographic_origins', schemaName: 'ehr_lookups', title: 'Geographic Origin Codes'},
{queryName: 'hematology_method', schemaName: 'ehr_lookups', title: 'Hematology Method'},
Expand Down
10 changes: 0 additions & 10 deletions WNPRC_EHR/resources/views/ehrAdmin.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
items: [
{name: 'Client Errors', url: '<%=contextPath%>' + '/shared/query-executeQuery.view?schemaName=auditlog&query.queryName=Client%20API%20Actions'},
{name: 'EHR Backups', url: '<%=contextPath%><%=containerPath%>/Backups/project-begin.view'},
{name: 'ETL Admin', url: '<%=contextPath%><%=containerPath%>/onprc_ehr-etlAdmin.view'},
{name: 'Genetics Calculations', url: '<%=contextPath%><%=containerPath%>/ehr-geneticCalculationSettings.view'},
//{name: 'ETL Duration', url: '<%=contextPath%><%=containerPath%>/query-executeQuery.view?schemaName=core&query.queryName=Sync Duration'},
//{name: 'ETL History', url: '<%=contextPath%><%=containerPath%>/query-executeQuery.view?schemaName=core&query.queryName=Sync History'},
Expand Down Expand Up @@ -41,15 +40,6 @@
{header: 'Logs',
items: [
{name: 'All Logs', url: '<%=contextPath%><%=containerPath%>/Logs/project-begin.view'},
{name: 'Labkey.log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Tomcat%20Logs/labkey.log'},
{name: 'Labkey-errors.log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Tomcat%20Logs/labkey-errors.log'},
{name: 'ETL Log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Tomcat%20Logs/ehr-etl.log'},
{name: 'ETL Errors Log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Tomcat%20Logs/ehr-etl-errors.log'},
{name: 'ActiveMQ.log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/ActiveMQ/activemq.log'},
{name: 'Monit.log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Monit/monit.log'},
{name: 'Munin.log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Munin/munin.log'},
{name: 'Inbreeding Coefficients Reload Cron Job Log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Kinship/kinshipOut.txt'},
{name: 'Kinship Reload Cron Job Log', url: '<%=contextPath%>/files<%=containerPath%>/Logs/%40filesets/Kinship/inbreedingOut.txt'}
]
},
{header: 'Notifications',
Expand Down
1 change: 0 additions & 1 deletion WNPRC_EHR/resources/views/moreReports.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
header: 'Reports',
items: [
{name: 'Blood Needlesticks', url: '<%=contextPath%>' + ctx['EHRStudyContainer'] + '/query-executeQuery.view?schemaName=study&query.queryName=bloodNeedlesticks'},
{name: 'Housing By Room and Cage', url: '<%=contextPath%>' + ctx['EHRStudyContainer'] + '/query-executeQuery.view?schemaName=study&query.queryName=housingByRoomCage'},
{name: 'Per Diems (in testing)', url: '<%=contextPath%>' + ctx['EHRStudyContainer'] + '/query-executeQuery.view?schemaName=study&query.queryName=PerDiems'},
{name: 'Per Diems Raw Data (in testing)', url: '<%=contextPath%>' + ctx['EHRStudyContainer'] + '/query-executeQuery.view?schemaName=study&query.queryName=PerDiemsByDay'},
{name: 'Restraints Used', url: '<%=contextPath%>' + ctx['EHRStudyContainer'] + '/query-executeQuery.view?schemaName=study&query.queryName=restraintUsed'},
Expand Down
5 changes: 5 additions & 0 deletions WNPRC_EHR/src/org/labkey/wnprc_ehr/WNPRC_EHRModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@
import org.labkey.api.query.DetailsURL;
import org.labkey.api.query.QuerySchema;
import org.labkey.api.resource.Resource;
import org.labkey.api.security.Directive;
import org.labkey.api.security.User;
import org.labkey.api.security.roles.RoleManager;
import org.labkey.api.view.WebPartFactory;
import org.labkey.api.view.template.ClientDependency;
import org.labkey.filters.ContentSecurityPolicyFilter;
import org.labkey.wnprc_ehr.bc.BCReportRunner;
import org.labkey.wnprc_ehr.buttons.ChangeBloodQCButton;
import org.labkey.wnprc_ehr.buttons.CreateTaskButton;
Expand Down Expand Up @@ -193,6 +195,9 @@ protected void init() {
addController(CONTROLLER_NAME, WNPRC_EHRController.class);
addController(TEST_CONTROLLER_NAME, WNPRC_EHRTestController.class);

ContentSecurityPolicyFilter.registerAllowedSources("bs_style", Directive.Style, "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css");
ContentSecurityPolicyFilter.registerAllowedSources("bs_font", Directive.Font, "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/fonts/");

registerRoles();
registerPermissions();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,36 +135,46 @@ public TreeMap<LocalDate, PopulationInstant> getPopulationOverTimeForSpecies(Pop
Map<LocalDate, Integer> deltasPerDate = new HashMap<>();
Integer animalsAtStart = 0;

for( String id : animalsBySpeciesId.get(species)) {
AnimalEventSet animalEventSet = animalEventSetsById.get(id);
for( StintAtPrimateCenter stint: animalEventSet.getStints() ) {
// Null startdate is okay...
LocalDate startDate = (stint.getStartDay() == null) ? null : new LocalDate(stint.getStartDay());
LocalDate endDate = ( stint.getEndDay() == null) ? null : new LocalDate(stint.getEndDay());


// Increment the counter for start of stints, if there was a start
if (startDate != null) {
Integer currentStartDelta = deltasPerDate.get(startDate);
if (currentStartDelta == null) {
currentStartDelta = 0;
if (animalsBySpeciesId.get(species) != null)
{
for (String id : animalsBySpeciesId.get(species))
{
AnimalEventSet animalEventSet = animalEventSetsById.get(id);
for (StintAtPrimateCenter stint : animalEventSet.getStints())
{
// Null startdate is okay...
LocalDate startDate = (stint.getStartDay() == null) ? null : new LocalDate(stint.getStartDay());
LocalDate endDate = (stint.getEndDay() == null) ? null : new LocalDate(stint.getEndDay());


// Increment the counter for start of stints, if there was a start
if (startDate != null)
{
Integer currentStartDelta = deltasPerDate.get(startDate);
if (currentStartDelta == null)
{
currentStartDelta = 0;
}
deltasPerDate.put(startDate, currentStartDelta + 1);
}
else
{
// If there wasn't a start, assume the animal was always in the colony
animalsAtStart++;
}
deltasPerDate.put(startDate, currentStartDelta + 1);
}
else {
// If there wasn't a start, assume the animal was always in the colony
animalsAtStart++;
}

// Decrement the counter for end of stints, if there was an end
if ( endDate != null) {
Integer currentEndDelta = deltasPerDate.get(endDate);
if ( currentEndDelta == null ) {
currentEndDelta = 0;
// Decrement the counter for end of stints, if there was an end
if (endDate != null)
{
Integer currentEndDelta = deltasPerDate.get(endDate);
if (currentEndDelta == null)
{
currentEndDelta = 0;
}
deltasPerDate.put(endDate, currentEndDelta - 1);
}
deltasPerDate.put(endDate, currentEndDelta - 1);
}

}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
dependencies.add("fullcalendar");
}
%>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" nonce="<%=getScriptNonce()%>" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<%--<script src='https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.6.0/fullcalendar.js'></script>--%>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" nonce="<%=getScriptNonce()%>">
<%--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.css">--%>
<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>
<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>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js"></script>
<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>
<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>
<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>
<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>

<%
SimpleQueryFactory queryFactory = new SimpleQueryFactory(getUser(), getContainer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

%>

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

<style type="text/css">
/* Full Calendar heading */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public void renderGridCellContents(RenderContext ctx, HtmlWriter out)
String formType = (String) ctx.get(new FieldKey(getBoundColumn().getFieldKey().getParent(), "formtype"));
String qcState = (String) ctx.get(new FieldKey(getBoundColumn().getFieldKey().getParent(), "QCState$Label"));

if (isExt4Form("form", formType))
if (formType != null && isExt4Form("form", formType))
{
ActionURL url = new ActionURL("ehr", "dataEntryForm.view", us.getContainer());
if ("Research Ultrasounds".equalsIgnoreCase(formType))
Expand Down
Loading