Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
74d287e
Merge from onprc19.1 r.63271
labkey-bpatel Oct 6, 2020
da1c620
Merge from onprc19.1 r.63282
labkey-bpatel Oct 6, 2020
25faf26
Merge from onprc19.1 r.63282
labkey-bpatel Oct 6, 2020
a01dd02
Merge from onprc19.1 r.63328 to 64381
labkey-bpatel Oct 7, 2020
2ed1767
Merge from onprc19.1 r.64647
labkey-bpatel Oct 7, 2020
7b23975
Merge from onprc19.1 r.64648
labkey-bpatel Oct 7, 2020
50b0d32
Merge from onprc19.1 r.64649 to 64652
labkey-bpatel Oct 7, 2020
6d7ff62
Merge from onprc19.1 r.64748
labkey-bpatel Oct 7, 2020
6b6e16f
Merge from onprc19.1 r.64953 to 65052
labkey-bpatel Oct 8, 2020
efbb2cf
Merge from onprc19.1 r.65678 to 65757
labkey-bpatel Oct 8, 2020
4a03e01
Fix build issues
labkey-bpatel Oct 10, 2020
8b7452f
Merge from onprc19.1Prod r 65762 to 65949
labkey-bpatel Oct 10, 2020
95fe82d
Remove code duplication from the merge.
labkey-bpatel Oct 11, 2020
3472a0e
'datedisabled' listed twice - remove duplicate
labkey-bpatel Oct 13, 2020
d63db3c
Remove 17.x scripts (content already part of rolled up scripts). Mino…
labkey-bpatel Oct 13, 2020
23c1f48
Code review changes:
labkey-bpatel Oct 14, 2020
906bd4c
Code review change - use varchar for postgres instead of nvarchar
labkey-bpatel Oct 14, 2020
1179f09
Code review change - remove expandRemarksColumn() that resets remarks…
labkey-bpatel Oct 21, 2020
2047202
-Replace hardcoded path with moduleProperty in sql queries.
labkey-bpatel Oct 21, 2020
99382f3
Automated test updates
labkey-bpatel Oct 21, 2020
1411dc8
Code review changes
labkey-bpatel Oct 21, 2020
bcb3794
Merge remote-tracking branch 'origin/release20.7-SNAPSHOT' into 20.7_…
labkey-bpatel Oct 21, 2020
02997d2
Automated test fix for testArrivalApi(). (Fix for testBloodVolumeApi(…
labkey-bpatel Oct 22, 2020
0a2ac07
Code review change - remove filtered query as fkTable, instead use a …
labkey-bpatel Oct 22, 2020
6d2a24d
Remove testBloodVolumeApi() - this test no longer relevant since LabK…
labkey-bpatel Oct 22, 2020
e3ea9e2
Remove extra ')'. Test fixes.
labkey-bpatel Oct 23, 2020
1c375ec
Add values to Surgical Repairs template. Move skipStudyImportQueryVal…
labkey-bpatel Oct 23, 2020
06b7657
Revert 'Add values to Surgical Repair template'.
labkey-bpatel Oct 24, 2020
23308a2
Get LabworkServices store before getting 'servicerequested' (so the s…
labkey-bpatel Oct 24, 2020
4171d41
Skip "Billing Validation Notification" - this is broken on the server…
labkey-bpatel Oct 24, 2020
5618ca4
Test fixes. Associate 'code' column with editorConfig for ehr_lookups…
labkey-bpatel Oct 26, 2020
630a601
Merge remote-tracking branch 'origin/release20.7-SNAPSHOT' into 20.7_…
labkey-bpatel Oct 26, 2020
626f2cd
Remove skipStudyImportQueryValidation(), and other related refactor. …
labkey-bpatel Oct 29, 2020
78f6cdd
Clean up queries - delete defunct queries, add missing lists and colu…
labkey-jeckels Oct 29, 2020
7375737
Fix ONPRC_EHRTest2.testArrivalForm
labkey-jeckels Oct 30, 2020
1c90aac
Fix ONPRC_EHRTest.testNecropsyRequestFlow
labkey-jeckels Oct 30, 2020
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 @@ -22,6 +22,7 @@
<column name="comment"/>
<column name="trainer"/>
<column name="employeeid/enddate"/>
<column name="FileName"/>
</columns>
<sorts>
<sort column="employeeid/lastName" descending="false"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE ehr_compliancedb.CompletionDates ADD COLUMN FileName varchar(500);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE ehr_compliancedb.Employees ALTER COLUMN Notes TYPE VARCHAR (4000);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE ehr_compliancedb.CompletionDates ADD FileName nvarchar(500);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE ehr_compliancedb.Employees ALTER COLUMN Notes NVARCHAR (4000);

11 changes: 8 additions & 3 deletions EHR_ComplianceDB/resources/schemas/ehr_compliancedb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,15 @@
</column>
<column columnName="lastName">
<columnTitle>Last Name</columnTitle>
<displayWidth>100</displayWidth>
<facetingBehavior>ALWAYS_OFF</facetingBehavior>
</column>
<column columnName="firstName">
<nullable>true</nullable>
<columnTitle>First Name</columnTitle>
<displayWidth>100</displayWidth>
<facetingBehavior>ALWAYS_OFF</facetingBehavior>
</column>
<column columnName="middleName">
<columnTitle>Middle Name</columnTitle>
<displayWidth>100</displayWidth>
<facetingBehavior>ALWAYS_OFF</facetingBehavior>
</column>
<column columnName="email">
Expand Down Expand Up @@ -201,10 +198,12 @@
<column columnName="startdate">
<nullable>true</nullable>
<columnTitle>Start Date</columnTitle>
<formatString>Date</formatString>
</column>
<column columnName="enddate">
<nullable>true</nullable>
<columnTitle>End Date</columnTitle>
<formatString>Date</formatString>
</column>
<column columnName="notes">
<nullable>true</nullable>
Expand Down Expand Up @@ -511,6 +510,7 @@
<column columnName="date">
<nullable>false</nullable>
<columnTitle>Date Completed</columnTitle>
<formatString>Date</formatString>
</column>
<column columnName="result">
<nullable>true</nullable>
Expand All @@ -529,6 +529,10 @@
<nullable>true</nullable>
<columnTitle>Comment</columnTitle>
</column>
<column columnName="FileName">
<columnTitle>FileName</columnTitle>
<isHidden>false</isHidden>
</column>
<column columnName="container">
<isUserEditable>false</isUserEditable>
<isHidden>true</isHidden>
Expand Down Expand Up @@ -709,6 +713,7 @@
<column columnName="date">
<nullable>true</nullable>
<columnTitle>Date Completed</columnTitle>
<formatString>Date</formatString>
</column>
<column columnName="container">
<isUserEditable>false</isUserEditable>
Expand Down
8 changes: 7 additions & 1 deletion EHR_ComplianceDB/resources/views/publicPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
xtype: 'ldk-linkbutton',
text: '<li>View Employee List</li>',
href: LABKEY.ActionURL.buildURL('query', 'executeQuery', null, {schemaName: 'EmployeeData', 'query.queryName': 'Employees'})
},{
},
// {
// xtype: 'ldk-linkbutton',
// text: '<li>View Respirator Protection Quarantine Report</li>',
// href: LABKEY.ActionURL.buildURL('query', 'executeQuery', null, {schemaName: 'EmployeeData', 'query.queryName': 'RespiratorProtectionQuarantine'})
// },
{
xtype: 'ldk-linkbutton',
text: '<li>View Private Section (authorized users only)</li>',
href: LABKEY.ActionURL.buildURL('project', 'start', container),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public String getName()
@Override
public @Nullable Double getSchemaVersion()
{
return 12.38;
return 12.40;
}

@Override
Expand Down
32 changes: 30 additions & 2 deletions ehr/api-src/org/labkey/api/ehr/EHRService.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@
import org.jetbrains.annotations.Nullable;
import org.labkey.api.data.AbstractTableInfo;
import org.labkey.api.data.Container;
import org.labkey.api.data.CoreSchema;
import org.labkey.api.data.SQLFragment;
import org.labkey.api.data.TableCustomizer;
import org.labkey.api.data.TableInfo;
import org.labkey.api.ehr.dataentry.DataEntryForm;
import org.labkey.api.ehr.dataentry.DataEntryFormFactory;
import org.labkey.api.ehr.dataentry.SingleQueryFormProvider;
import org.labkey.api.ehr.demographics.DemographicsProvider;
import org.labkey.api.ehr.demographics.ProjectValidator;
import org.labkey.api.ehr.history.HistoryDataSource;
import org.labkey.api.ehr.history.LabworkType;
import org.labkey.api.ehr.history.*;
import org.labkey.api.ldk.table.ButtonConfigFactory;
import org.labkey.api.module.Module;
import org.labkey.api.query.BatchValidationException;
import org.labkey.api.query.DetailsURL;
import org.labkey.api.query.ExprColumn;
import org.labkey.api.query.FieldKey;
import org.labkey.api.resource.Resource;
import org.labkey.api.security.User;
Expand Down Expand Up @@ -126,6 +128,32 @@ static public void setInstance(EHRService instance)
/** @return the project validator set by the EHR module, note a center specific module may have overridden the default */
abstract public ProjectValidator getProjectValidator();

public enum EndingOption
{
/** end date is not set, or any day in the future */
activeAfterMidnightTonight(new SQLFragment(" WHEN (CAST(" + ExprColumn.STR_TABLE_ALIAS + ".enddate AS DATE) > {fn curdate()}) THEN " + CoreSchema.getInstance().getSchema().getSqlDialect().getBooleanTRUE())),
/** ends anytime today */
endsToday(new SQLFragment("WHEN (" + ExprColumn.STR_TABLE_ALIAS + ".enddate IS NOT NULL AND CAST(" + ExprColumn.STR_TABLE_ALIAS + ".enddate AS DATE) = {fn curdate()}) THEN " + CoreSchema.getInstance().getSchema().getSqlDialect().getBooleanTRUE())),
/** consider records that start/stop on today's date to be active */
allowSameDay(new SQLFragment(" WHEN (" + ExprColumn.STR_TABLE_ALIAS + ".enddate IS NOT NULL AND CAST(" + ExprColumn.STR_TABLE_ALIAS + ".enddate AS DATE) = {fn curdate()} AND CAST(" + ExprColumn.STR_TABLE_ALIAS + ".date as DATE) = {fn curdate()}) THEN " + CoreSchema.getInstance().getSchema().getSqlDialect().getBooleanTRUE())),
/** end time must be before right now */
endingBeforeNow(new SQLFragment(" WHEN (" + ExprColumn.STR_TABLE_ALIAS + ".enddate >= {fn now()}) THEN " + CoreSchema.getInstance().getSchema().getSqlDialect().getBooleanTRUE()));

private final SQLFragment _sql;

EndingOption(SQLFragment sql)
{
_sql = sql;
}

public SQLFragment getSql()
{
return _sql;
}
}

public abstract void addIsActiveCol(AbstractTableInfo ti, boolean includeExpired, EndingOption... endOptions);

/** Categories where pre-configured reports can be offered to the user */
public enum REPORT_LINK_TYPE
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ protected String getLine(Results rs, boolean redacted) throws SQLException
StringBuilder sb = new StringBuilder();
String testId = getTestId(rs);
Double result = _resultField == null ? null : rs.getDouble(FieldKey.fromString(_resultField));
if (rs.wasNull())
{
result = null;
}
String units = _unitsField == null ? null : rs.getString(FieldKey.fromString(_unitsField));
String qualResult = _qualResultField == null ? null : rs.getString(FieldKey.fromString(_qualResultField));

Expand Down
5 changes: 5 additions & 0 deletions ehr/api-src/org/labkey/api/ehr/history/LabworkType.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ public interface LabworkType
Map<String, List<String>> getResults(Container c, User u, List<String> runIds, boolean redacted);

Map<String, List<String>> getResults(Container c, User u, String id, Date minDate, Date maxDate, boolean redacted);

default boolean showPerformedBy()
{
return true;
}
}
67 changes: 41 additions & 26 deletions ehr/api-src/org/labkey/api/ehr/table/DurationColumn.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import org.apache.commons.lang3.time.DurationFormatUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.labkey.api.data.ColumnInfo;
import org.labkey.api.data.DataColumn;
import org.labkey.api.data.RenderContext;
Expand All @@ -32,9 +33,11 @@
public class DurationColumn extends DataColumn
{

String _startDateColumn;
String _endDateColumn;
private String _durationFormat;
protected final String _startDateColumn;
protected final String _endDateColumn;
private final String _durationFormat;

private boolean _dropTime;

public DurationColumn(ColumnInfo col, String startDateColumn, String endDateColumn)
{
Expand All @@ -49,6 +52,12 @@ public DurationColumn(ColumnInfo col, String startDateColumn, String endDateColu
_durationFormat = durationFormat;
}

/** Treat all times as if they were at midnight of the same day */
public void setDropTime(boolean dropTime)
{
_dropTime = dropTime;
}

@Override
public Class getDisplayValueClass()
{
Expand All @@ -60,12 +69,24 @@ public Class getDisplayValueClass()
@Override
public Object getDisplayValue(RenderContext ctx)
{
return getFormattedDuration((Date)ctx.get(getMappedFieldKey(_startDateColumn)), (Date)ctx.get(getMappedFieldKey(_endDateColumn)));
Date startDate = (Date)ctx.get(getMappedFieldKey(_startDateColumn));
Date endDate = (Date)ctx.get(getMappedFieldKey(_endDateColumn));

return getFormattedDuration(startDate, endDate);
}

private void dropTime(@NotNull Calendar cal)
{
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
}

protected String getFormattedDuration(Date startDate, Date endDate)
/** Convert from dates to calendars, dealing with nulls */
public final String getFormattedDuration(@Nullable Date startDate, @Nullable Date endDate)
{
if (startDate == null || _durationFormat == null)
if (startDate == null)
return null;

Calendar startCal = Calendar.getInstance();
Expand All @@ -74,6 +95,20 @@ protected String getFormattedDuration(Date startDate, Date endDate)
Calendar endCal = Calendar.getInstance();
endCal.setTime(endDate == null ? new Date() : endDate);

if (_dropTime)
{
// Snap to midnight so that days work based on calendar day instead of 24-hour periods
dropTime(startCal);
dropTime(endCal);
}
return getFormattedDuration(startCal, endCal);
}

protected String getFormattedDuration(@NotNull Calendar startCal, @NotNull Calendar endCal)
{
if (_durationFormat == null)
return null;

String formattedDuration;
try
{
Expand Down Expand Up @@ -113,24 +148,4 @@ protected FieldKey getMappedFieldKey(String colName)
{
return new FieldKey(getBoundColumn().getFieldKey().getParent(), colName);
}

public String getStartDateColumn()
{
return _startDateColumn;
}

public void setStartDateColumn(String startDateColumn)
{
_startDateColumn = startDateColumn;
}

public String getEndDateColumn()
{
return _endDateColumn;
}

public void setEndDateColumn(String endDateColumn)
{
_endDateColumn = endDateColumn;
}
}
5 changes: 5 additions & 0 deletions ehr/resources/queries/study/treatment_order.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
<fkDbSchema>ehr_lookups</fkDbSchema>
<fkTable>treatment_frequency</fkTable>
<fkColumnName>rowid</fkColumnName>
<filters>
<filterGroup>
<filter column="active" operator="eq" value="true"/> <!-- filter applied only during insert and update, will not be used during grid view -->
</filterGroup>
</filters>
</fk>
</column>
<column columnName="route">
Expand Down
12 changes: 6 additions & 6 deletions ehr/resources/reports/schemas/study/Pedigree/Pedigree.r
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ library(Rlabkey)
#str(labkey.data);
#warnings();

labkey.acceptSelfSignedCerts();
labkey.setCurlOptions(ssl_verifypeer = FALSE, ssl_verifyhost = FALSE)


if ((length(labkey.data$id) == 0) | (is.na(labkey.data$dam) & is.na(labkey.data$sire))){
if ((length(labkey.data$id) == 0) || all(is.na(labkey.data$dam) & is.na(labkey.data$sire))) {
png(filename="${imgout:myscatterplot}", width = 650, height = 150);
plot(0, 0, type='n', xaxt='n', yaxt='n', bty='n', ann=FALSE )
title(main = "No pedigree data found for selected animal(s).", sub = NULL, xlab = NULL, ylab = NULL,
Expand Down Expand Up @@ -200,17 +200,17 @@ if ((length(labkey.data$id) == 0) | (is.na(labkey.data$dam) & is.na(labkey.data$
if (length(damIndex) == 0) damIndex <- which(allPed$Id == ped$Dam[i]);
if (length(sireIndex) == 0) sireIndex <- which(allPed$Id == ped$Sire[i]);

if((is.na(ped$Sire[i]))& (!is.na(ped$Dam[i]))){
xt <- sample (1:30,1)
if(is.na(ped$Sire[i])){
xt <- sample (1:99,1)
#typeof(ped$Sire);
#typeof(xt);
ped$Sire[i] <- paste('xxs',xt)
ped$Sire[i] <- paste (ped$Sire[i], "Unknown Sire", sep="\n")
#print(ped$Dam[i])
#print(ped$Sire[i])
}
if((is.na(ped$Dam[i]))& (!is.na(ped$Sire[i]))){
xt <- sample (1:30,1)
if(is.na(ped$Dam[i])){
xt <- sample (1:99,1)
#typeof(ped$Sire);
#typeof(xt);
ped$Dam[i] <- paste ('xxd',xt);
Expand Down
4 changes: 3 additions & 1 deletion ehr/resources/schemas/ehr_lookups.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2637,7 +2637,9 @@
<fkColumnName>entityid</fkColumnName>
</fk>
</column>
<column columnName="datedisabled" />
<column columnName="datedisabled">
<columnTitle>Date Disabled</columnTitle>
</column>
</columns>
</table>
<table tableName="labwork_services" tableDbType="TABLE" useColumnOrder="true">
Expand Down
8 changes: 6 additions & 2 deletions ehr/resources/views/groupOverlaps.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,11 @@
return;
}

// By Kollil, 3/22/2018 : In 17.2 the filter is not working. Removed the the line 168 and added the filterArray at line 169.
// The Animal group search is working fine now after this change.
if (groupName)
config.removeableFilters = [LABKEY.Filter.create('groupId/name', groupName, LABKEY.Filter.Types.EQUAL)];
//config.removeableFilters = [LABKEY.Filter.create('groupId/name', groupName, LABKEY.Filter.Types.EQUAL)];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnt userFilters the new name for removeableFilters? this change prevents the user from removing the group name filter, doesnt it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that is the intention given that user enters filter criteria in a form, which then results in a filtered grid in a different panel, having removable filters on this resultant grid would be confusing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's clear that if there was a bug preventing the filter from being applied, that's a problem.

I can see the argument on there being a filter panel above, but by that same logic then shouldnt start/end date also be immutable? It is possible for the top filter fields and DR to get out of sync.

This is a small enough change that it's probably not a big deal, but in general I would tend toward preserving capabilities for the user. For example, what is they want to do another filter type? More than one group? Contains? etc.

config.filterArray = [LABKEY.Filter.create('groupId/name', groupName, LABKEY.Filter.Types.EQUAL)];

var params = {
StartDate: start,
Expand All @@ -172,7 +175,8 @@

config.parameters = params;

LDK.Utils.getReadOnlyQWP(config).render(this.qwpDiv.id);
LDK.Utils.getReadOnlyQWP(config);

}

});
Expand Down
2 changes: 1 addition & 1 deletion ehr/resources/views/housingOverlaps.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
if (!LABKEY.Utils.isEmptyObj(params))
config.parameters = params;

LDK.Utils.getReadOnlyQWP(config).render(this.qwpDiv.id);
LDK.Utils.getReadOnlyQWP(config);
}

}).render(webpart.wrapperDivId);
Expand Down
Loading