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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ wnprc_billing/resources/credits/jars.txt

.storybook-out/

docker/ehrcron/scripts/pg_backup/lkbackup.ini

# generated artifacts from @labkey/build
*/resources/web/*/gen/
*/resources/views/gen/
2 changes: 1 addition & 1 deletion DBUtils/resources/credits/jars.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{table}
Filename|Component|Version|Source|License|LabKey Dev|Purpose
Filename|Component|Version|Source|License|Dev|Purpose
jooq-3.8.4.jar|jOOQ|3.8.4|{link:From GitHub|https://github.com/jOOQ/jOOQ}|{link:Apache Software License 2.0|http://www.apache.org/licenses/LICENSE-2.0}|jrichardson|Database-mapping for Java
jaxb-api-2.3.0.jar|jaxb|2.3.0|Oracle|{link:CDDL 1.1|https://oss.oracle.com/licenses/CDDL+GPL-1.1}{link:GPL2w/ CPE|https://oss.oracle.com/licenses/CDDL+GPL-1.1}|klum|Parsing XML
{table}
2 changes: 1 addition & 1 deletion DeviceProxy/resources/credits/jars.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{table}
Filename|Component|Version|Source|License|LabKey Dev|Purpose
Filename|Component|Version|Source|License|Dev|Purpose
jooq-3.8.4.jar|jOOQ|3.8.4|{link:From GitHub|https://github.com/jOOQ/jOOQ}|{link:Apache Software License 2.0|http://www.apache.org/licenses/LICENSE-2.0}|jrichardson|Database-mapping for Java
jaxb-api-2.3.0.jar|Java Architecture for XML Binding (JAXB)|2.3.0|Oracle|{link:CDDL|https://oss.oracle.com/licenses/CDDL}|klum|Parsing XML
{table}
4 changes: 2 additions & 2 deletions GoogleDrive/resources/credits/jars.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{table}
Filename|Component|Version|Source|License|LabKey Dev|Purpose
google-api-client-1.22.0.jar|Google APIs Client Library for Java|1.22.0|{link:From GitHub|https://github.com/google/google-api-java-client}|{link:Apache Software License 2.0|http://www.apache.org/licenses/LICENSE-2.0}|jrichardson|Used to connect to Google Drive
Filename|Component|Version|Source|License|WNPRC Dev|Purpose
google-api-client-1.23.0.jar|Google APIs Client Library for Java|1.23.0|{link:From GitHub|https://github.com/google/google-api-java-client}|{link:Apache Software License 2.0|http://www.apache.org/licenses/LICENSE-2.0}|jrichardson|Used to connect to Google Drive
google-api-services-drive-v3-rev85-1.23.0.jar|Google Drive API Client Library for Java|v3 rev85 1.23.0|{link:From Google|https://developers.google.com/api-client-library/java/apis/drive/v3}|{link:Apache Software License 2.0|http://www.apache.org/licenses/LICENSE-2.0}|jrichardson|Used to connect to Google Drive
{table}
2 changes: 1 addition & 1 deletion WNPRC_Compliance/module.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ License: Apache 2.0
LicenseURL: http://www.apache.org/licenses/LICENSE-2.0
ModuleClass: org.labkey.wnprc_compliance.WNPRC_ComplianceModule
Name: WNPRC_Compliance
SchemaVersion: 20.000
SchemaVersion: 21.001
SupportedDatabases: pgsql
ManageVersion: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE wnprc_compliance.measles_clearances ADD COLUMN IF NOT EXISTS required BOOLEAN DEFAULT true;

ALTER TABLE wnprc_compliance.persons ADD COLUMN IF NOT EXISTS hold BOOLEAN DEFAULT false;
--update measles_required from wnprc_compliance.measles_clearances using labkey javascript API
ALTER TABLE wnprc_compliance.persons ADD COLUMN IF NOT EXISTS measles_required BOOLEAN DEFAULT false;
2 changes: 2 additions & 0 deletions WNPRC_Compliance/resources/schemas/wnprc_compliance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
<column columnName="modified"/>
<column columnName="archived_for_access_purposes"/>
<column columnName="date_of_birth"/>
<column columnName="hold"/>
<column columnName="measles_required"/>
</columns>
</table>
<table tableName="measles_clearances" tableDbType="TABLE">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
WebUtils.VM.submitMarkExempt = function() {
$exemptDialog.modal('hide');
var cardData = ko.mapping.toJS(WebUtils.VM.form);
WebUtils.API.postJSON("<%=q(urlFor(MarkCardExemptAPI.class))%>", {
WebUtils.API.postJSON(<%=q(urlFor(MarkCardExemptAPI.class))%>, {
cardId: cardData.selectedCard[0],
reason: cardData.notes
}).then(function(d) {
Expand All @@ -236,7 +236,7 @@

//TODO validate here...
//TODO not sure how this $parent selectedPerson really works here?
WebUtils.API.postJSON("<%=q(urlFor(WNPRC_ComplianceController.LinkCardAPI.class))%>", {
WebUtils.API.postJSON(<%=q(urlFor(WNPRC_ComplianceController.LinkCardAPI.class))%>, {
cardId: cardData.selectedCard[0],
personId: personData.selectedPerson
}).then(function(d) {
Expand Down Expand Up @@ -285,7 +285,7 @@
} else {
// knockout wasn't playing nice here, using jQuery to force button to disabled
$(document).on('click', '#radio-person', function () {
$('#link-card-button').removeProp('disabled');
$('#link-card-button').prop('disabled', false);
});
}
WebUtils.VM.listPersons.userMatches((PERSONS in results) ? results[PERSONS] : []);
Expand Down
14 changes: 11 additions & 3 deletions WNPRC_EHR/resources/credits/jars.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{table}
Filename|Component|Version|Source|License|LabKey Dev|Purpose
Filename|Component|Version|Source|License|WNPRC Dev|Purpose
joda-time-2.8.1.jar|Joda-Time|2.8.1|{link:From GitHub|https://github.com/JodaOrg/joda-time}|{link:Apache Software License 2.0|http://www.apache.org/licenses/LICENSE-2.0}|jrichardson|Tools for dealing with dates/times in Java
jsoup-1.10.3.jar|jsoup: Java HTML Parser|1.10.3|{link:From GitHub|https://github.com/jhy/jsoup}|{link:MIT License|https://opensource.org/licenses/MIT}|jricharson|Tools for parsing and manipulating HTML and CSS using the DOM
jsoup-1.13.1.jar|jsoup: Java HTML Parser|1.10.3|{link:From GitHub|https://github.com/jhy/jsoup}|{link:MIT License|https://opensource.org/licenses/MIT}|jricharson|Tools for parsing and manipulating HTML and CSS using the DOM
reflections-0.9.10.jar|Reflections|0.9.10|{link:From GitHub|https://github.com/ronmamo/reflections}|{link:WTFPL|http://www.wtfpl.net/about/}|cstevens|Runtime analysis of Java classes and packages
{table}
google-api-client-1.23.0.jar|Google API Client for Java|1.30.5|{link:GitHub|https://github.com/googleapis/google-api-java-client}|{link:Apache License 2.0|https://github.com/googleapis/google-api-java-client/blob/master/LICENSE}|ggottfredsen|Library to interact with Google APIs
google-api-services-calendar-v3-rev255-1.23.0.jar|Google Calendar API Client Library for Java|v3-rev20210708-1.32.1|{link:GitHub|https://github.com/googleapis/google-api-java-client-services/tree/master/clients/google-api-services-calendar/v3}|{link:Apache License 2.0|http://www.apache.org/licenses/LICENSE-2.0}|ggottfredsen|Library for interacting with Google Calendars in Java
google-http-client-gson-1.23.0.jar|Google HTTP Client Library for Java|1.39.2-sp.1|{link:GitHub|https://github.com/googleapis/google-http-java-client/tree/master/google-http-client-gson}|{link:Apache License 2.0|https://github.com/googleapis/google-http-java-client/blob/master/LICENSE}|ggottfredsen|A flexible, efficient, and powerful Java library for accessing any resource on the web via HTTP
google-auth-library-oauth2-http-0.19.0.jar|Google Auth Library|1.0.0|{link:GitHub|https://github.com/googleapis/google-auth-library-java/tree/master/oauth2_http}|{link:BSD 3-Clause "New" or "Revised" License|https://github.com/googleapis/google-auth-library-java/blob/master/LICENSE}|ggottfredsen|Contains a wide variety of credentials as well as utility methods to create them and to get Application Default Credentials
commons-text-1.9.jar|Apache Commons Text|1.9|{link:GitHub|https://github.com/apache/commons-text}|{link:Apache License 2.0|https://github.com/apache/commons-text/blob/master/LICENSE.txt}|ggottfredsen|A library focused on algorithms working on strings
msal4j-1.11.0.jar|Microsoft Authentication Library (MSAL) for Java|1.11.0|{link:GitHub|https://github.com/AzureAD/microsoft-authentication-library-for-java}|{link:MIT License|https://github.com/AzureAD/microsoft-authentication-library-for-java/blob/dev/LICENSE}|ggottfredsen|Allows to sign in users or apps with Microsoft identities (Azure AD, Microsoft accounts and Azure AD B2C accounts) and obtain tokens to call Microsoft APIs such as Microsoft Graph
microsoft-graph-2.10.0.jar|Microsoft Graph Java SDK|2.10.0|{link:GitHub|https://github.com/microsoftgraph/msgraph-sdk-java}|{link:MIT License|https://github.com/microsoftgraph/msgraph-sdk-java/blob/dev/LICENSE}|ggottfredsen|Allows for interacting with Microsoft Graph (Calendars/User Accounts/Email/etc.)
slf4j-nop-1.8.0-beta4.jar|Simple Logging Facade for Java|1.8.0-beta4|{link:GitHub|https://github.com/qos-ch/slf4j/tree/master/slf4j-nop}|{link:MIT License|https://github.com/qos-ch/slf4j/blob/master/LICENSE.txt}|ggottfredsen|Abstraction for various logging frameworks allowing for plugging in a desired framework at deployment time
{table}
1 change: 1 addition & 0 deletions WNPRC_EHR/resources/queries/study/Biopsy/.qview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<column name="remark" />
<column name="type" />
<column name="nhpbmd" />
<column name="billingComplete"/>
<column name="grossdescription" />
<column name="performedby" />
<column name="veterinarian" />
Expand Down
15 changes: 15 additions & 0 deletions WNPRC_EHR/resources/queries/study/Demographics.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@
<!--</fk>-->
<url>/ehr/participantView.view?participantId=${dam}</url>
</column>
<column columnName="dam_old">
<isHidden>true</isHidden>
</column>
<column columnName="sire_old">
<isHidden>true</isHidden>
</column>
<column columnName="sire">
<columnTitle>Sire</columnTitle>
<!--<fk>-->
Expand All @@ -92,6 +98,9 @@
</column>
<column columnName="origin/source">
</column>
<column columnName="origin_old">
<isHidden>true</isHidden>
</column>
<column columnName="birth">
<formatString>yyyy-MM-dd</formatString>
<!--<shownInInsertView>false</shownInInsertView>-->
Expand All @@ -102,6 +111,9 @@
query.Id~eq=${Id}
</url>
</column>
<column columnName="birth_old">
<isHidden>true</isHidden>
</column>
<column columnName="death">
<formatString>yyyy-MM-dd</formatString>
<!--<shownInInsertView>false</shownInInsertView>-->
Expand Down Expand Up @@ -214,6 +226,9 @@
</column>
<column columnName="geographic_origin">
</column>
<column columnName="geographic_origin_old">
<isHidden>true</isHidden>
</column>
<!--<column columnName="behavior">
<isHidden>true</isHidden>
<shownInInsertView>false</shownInInsertView>
Expand Down
6 changes: 4 additions & 2 deletions WNPRC_EHR/resources/queries/study/Pedigree.sql
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ END
AS status,
d.calculated_status as status_code,
'Demographics' as source,
d.species as Species
d.species as Species,
d.created AS date

--d.qcstate

Expand Down Expand Up @@ -79,7 +80,8 @@ CAST(p.departdate AS SQL_VARCHAR) as status_code,
--'Rhesus' as Species
--null as qcstate

p.species AS species
p.species AS species,
COALESCE(p.created,p.modified) AS date

FROM ehr.supplemental_pedigree p
LEFT JOIN study.demographics d ON (d.id=p.id)
Expand Down
6 changes: 5 additions & 1 deletion WNPRC_EHR/resources/queries/study/R24DemographicsSrc.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ SELECT
d.dam,
d.sire,
d.modified as modified,
curdate() as date
curdate() as date,
CASE d.participantid.activeAssignments.projects
WHEN '20210102' THEN true
ELSE false
END AS U24_Animals
FROM study.demographics d

LEFT OUTER JOIN study.demographics as ih on d.id = ih.id and ih.origin.code in
Expand Down
Empty file.
64 changes: 64 additions & 0 deletions WNPRC_EHR/resources/queries/study/WaterOrders.query.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="waterOrders" tableDbType="TABLE" useColumnOrder="true">
<tableUrl />
<insertUrl />
<importUrl />
<updateUrl />
<deleteUrl />
<columns>
<column columnName="Id">

</column>
<column columnName="date">
<columnTitle>Start Date</columnTitle>
<formatString>yyyy-MM-dd hh:mm</formatString>
</column>
<column columnName="enddate">
<columnTitle>End Date</columnTitle>
<formatString>yyyy-MM-dd</formatString>
</column>
<column columnName="volume">
<columnTitle>Water Volume (mL)</columnTitle>
</column>
<column columnName="frequency">
<columnTitle>Frequency</columnTitle>
<fk>
<fkDbSchema>wnprc</fkDbSchema>
<fkTable>husbandry_frequency</fkTable>
<fkColumnName>rowid</fkColumnName>
<fkDisplayColumnName>Meaning</fkDisplayColumnName>
</fk>
</column>
<column columnName="assignedTo">
<columnTitle>Assigned To</columnTitle>
<fk>
<fkDbSchema>ehr_lookups</fkDbSchema>
<fkTable>husbandry_assigned</fkTable>
<fkColumnName>value</fkColumnName>
</fk>
</column>
<column columnName="waterSource">
<columnTitle>Water Source</columnTitle>
<fk>
<fkDbSchema>ehr_lookups</fkDbSchema>
<fkTable>water_source</fkTable>
<fkColumnName>value</fkColumnName>
<fkDisplayColumnName>title</fkDisplayColumnName>
</fk>
</column>
<column columnName="provideFruit">
<columnTitle>Provide Fruit</columnTitle>
<fk>
<fkDbSchema>ehr_lookups</fkDbSchema>
<fkTable>husbandry_fruit</fkTable>
<fkColumnName>value</fkColumnName>
</fk>
</column>

</columns>
</table>
</tables>
</metadata>
</query>
20 changes: 20 additions & 0 deletions WNPRC_EHR/resources/queries/study/WaterOrders/.qview.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="Id" />
<column name="date" />
<column name="endDate" />
<column name="volume" />
<column name="frequency" />
<column name="waterSource"/>
<column name="assignedTo"/>
<column name="provideFruit"/>
<column name="qcstate" />
<column name="taskid" />
</columns>
<sorts>
<sort column="date" descending="true"/>
</sorts>
<!--<filters>-->
<!--<filter column="qcstate/publicdata" operator="eq" value="true"/>-->
<!--</filters>-->
</customView>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="Id" />
<column name="date" />
<column name="endDate" />
<column name="volume" />
<column name="frequency" />
<column name="waterSource"/>
<column name="assignedTo"/>
<column name="provideFruit"/>
<column name="qcstate" />
<column name="taskid" />
</columns>
<sorts>
<sort column="date" descending="true"/>
</sorts>
<filters>
<filter column="enddatecoalescedfuture" operator="dategte" value="+0d"/>
</filters>
</customView>
27 changes: 27 additions & 0 deletions WNPRC_EHR/resources/queries/study/WaterRecentWeight.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
SELECT
voGi.id,
CAST (voGi.date AS DATE) AS Date,
voGi.volume,
voGi.RecentWeight,
voGi.InnerWeight,
voGi.objectid
--voGi.DayDiff

FROM (

SELECT
wa.id AS id,
wa.date AS date,
wa.volume,
(SELECT we.weight
FROM study.weight we
--INNER JOIN study.weight wein
--ON we.id = wein.id
WHERE we.id = wa.id AND we.date = (SELECT MAX(wen.date) from study.weight wen WHERE wen.id=wa.id AND timestampdiff('SQL_TSI_DAY',wa.date,wen.date)<=0))AS InnerWeight,
(SELECT MAX(wen.date) from study.weight wen WHERE wen.id=wa.id AND timestampdiff('SQL_TSI_DAY',wa.date,wen.date)<=0) AS RecentWeight,
wa.objectid
--timestampdiff('SQL_TSI_DAY',wa.date ,wa.RecentWeight) AS DayDiff

FROM study.waterGiven wa
) voGi
--GROUP BY voGi.id, voGi.date,voGi.RecentWeight,voGi.InnerWeight
41 changes: 41 additions & 0 deletions WNPRC_EHR/resources/queries/study/WaterScheduleWithWeight.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
SELECT
lsid AS lsid,
objectid AS objectIdCoalesced,
taskid AS taskid,
project AS projectCoalesced,
animalId AS animalId,
room || '-' || cage AS location,
date AS date,
dateOrdered AS dateOrdered,
startDateCoalesced AS startDateCoalesced,
volume AS volume,
provideFruit AS provideFruit,
provideFruitTitle AS provideFruitTitle,
dataSource AS dataSource,
assignedTo AS assignedToCoalesced,
assignedToTitle AS assignedToTitleCoalesced,
frequency AS frequencyCoalesced,
frequencyMeaning AS frequencyMeaningCoalesced,
timeofday AS timeofday,
displaytimeofday AS displaytimeofday,
qcstate AS qcstate,

--(SELECT max(wg.qcstate) as label FROM study.waterGiven wg WHERE WCO.objectid = wg.treatmentid AND WCO.dateOrdered = wg.dateordered ) AS waterStatus,
-- (SELECT timestampdiff(SQL_TSI_HOUR,WCO.date,wg.dateordered ) as diff FROM study.waterGiven wg WHERE WCO.objectid = wg.treatmentid ) AS difference,

(SELECT wg.weight AS weightAtDate
FROM study.weight wg
WHERE wg.id = WCO.animalId AND CAST(substring(CAST(wg.date AS VARCHAR) , 1, 10) AS DATE) <= WCO.date
ORDER BY wg.date DESC
LIMIT 1
) AS weightAtDate,

(SELECT wg.date AS weightDate
FROM study.weight wg
WHERE wg.id = WCO.animalId AND CAST(substring(CAST(wg.date AS VARCHAR) , 1, 10) AS DATE) <= WCO.date
ORDER BY wg.date DESC
LIMIT 1
) AS weightDate

FROM study.waterScheduleCoalesced WCO
--WHERE WCO.dateRangeStartDate >= curdate()
3 changes: 3 additions & 0 deletions WNPRC_EHR/resources/queries/study/biopsy.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<column columnName="nhpbmd">
<columnTitle>NHPBMD</columnTitle>
</column>
<column columnName="billingComplete">
<columnTitle>Billing Complete</columnTitle>
</column>
<column columnName="remark">
<columnTitle>Final Summary Comments</columnTitle>
</column>
Expand Down
Loading