Skip to content
Open
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
1 change: 0 additions & 1 deletion CageUI/module.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ URL: WNPRC/EHR/cageui-editLayout.view
Name: CageUI
License: Apache 2.0
LicenseURL: http://www.apache.org/licenses/LICENSE-2.0
SupportedDatabases: pgsql
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.labkey.api.data.ColumnInfo;
import org.labkey.api.data.CompareType;
import org.labkey.api.data.Container;
import org.labkey.api.data.DbScope;
import org.labkey.api.data.Results;
import org.labkey.api.data.ResultsImpl;
import org.labkey.api.data.SimpleFilter;
Expand All @@ -36,7 +35,6 @@
import org.labkey.api.util.PageFlowUtil;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
Expand Down Expand Up @@ -143,13 +141,11 @@ protected void doAssignmentChecks(final Container c, User u, final StringBuilder
deadAnimalsWithActiveAssignments(c, u, msg);
assignmentsWithoutValidProtocol(c, u, msg);
//assignmentsWithEndedProject(c, u, msg);
projectsWithExpiredProtocol(c, u, msg);
//duplicateAssignments(c, u, msg);
protocolsWithFutureApproveDates(c, u, msg);
// protocolsOverLimit(c, u, msg);
assignmentsProjectedToday(c, u, msg);
assignmentsProjectedTomorrow(c, u, msg);
protocolsWithAnimalsExpiringSoon(c, u, msg);
}

protected void livingAnimalsWithoutHousing(final Container c, User u, final StringBuilder msg)
Expand Down Expand Up @@ -238,29 +234,6 @@ protected void assignmentsWithoutValidProtocol(final Container c, User u, final
}
}

/**
* find any active assignment where the project lacks a valid protocol
*/
protected void projectsWithExpiredProtocol(final Container c, User u, final StringBuilder msg)
{
TableInfo ti = getEHRSchema(c, u).getTable("project");
if (!ti.getSqlDialect().isSqlServer())
{
return;
}

SimpleFilter filter = new SimpleFilter(FieldKey.fromString("enddateCoalesced"), "+0d", CompareType.DATE_GTE);
filter.addCondition(FieldKey.fromString("protocol/renewalDate"), new Date(), CompareType.DATE_LTE);
TableSelector ts = new TableSelector(ti, filter, null);
long count = ts.getRowCount();
if (count > 0)
{
msg.append("<b>WARNING: There are " + count + " active projects associated with an expired IACUC protocol.</b><br>\n");
msg.append("<p><a href='" + getExecuteQueryUrl(c, "ehr", "project", null, filter) + "'>Click here to view them</a><br>\n\n");
msg.append("<hr>\n\n");
}
}

protected void protocolsWithFutureApproveDates(final Container c, User u, final StringBuilder msg)
{
Calendar cal = Calendar.getInstance();
Expand Down Expand Up @@ -312,37 +285,6 @@ protected void assignmentsProjectedToday(final Container c, User u, final String
}
}

/**
* protocols with active animals that expire in next 30 days
*/
protected void protocolsWithAnimalsExpiringSoon(final Container c, User u, final StringBuilder msg)
{
if (!DbScope.getLabKeyScope().getSqlDialect().isSqlServer())
{
return;
}

SimpleFilter filter = new SimpleFilter(FieldKey.fromString("daysUntilRenewal"), 30, CompareType.LTE);
filter.addCondition(FieldKey.fromString("activeAnimals/totalActiveAnimals"), 0, CompareType.GT);

TableInfo ti = getEHRSchema(c, u).getTable("protocol");

List<FieldKey> colKeys = new ArrayList<>();
colKeys.add(FieldKey.fromString("displayName"));
colKeys.add(FieldKey.fromString("daysUntilrenewal"));
colKeys.add(FieldKey.fromString("activeAnimals/totalActiveAnimals"));
final Map<FieldKey, ColumnInfo> columns = QueryService.get().getColumns(ti, colKeys);

TableSelector ts = new TableSelector(ti, columns.values(), filter, null);
long count = ts.getRowCount();
if (count > 0)
{
msg.append("<b>WARNING: There are " + count + " protocols with active assignments set to expire within the next 30 days.</b><br>\n");
msg.append("<p><a href='" + getExecuteQueryUrl(c, "ehr", "protocol", null) + "&query.daysUntilRenewal~lte=30&query.activeAnimals/totalActiveAnimals~gt=0'>Click here to view them</a><br>\n\n");
msg.append("<hr>\n\n");
}
}

/**
* we find death records without a corresponding demographics record
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@
import org.labkey.test.tests.ehr.ComplianceTrainingTest;
import org.labkey.test.util.DataRegionTable;
import org.labkey.test.util.Ext4Helper;
import org.labkey.test.util.PostgresOnlyTest;
import org.labkey.test.util.SchemaHelper;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

@Category({EHR.class, WNPRC_EHR.class})
public class WNPRCComplianceTrainingTest extends ComplianceTrainingTest implements PostgresOnlyTest
public class WNPRCComplianceTrainingTest extends ComplianceTrainingTest
{
@Override
protected void setUpTest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
import org.labkey.test.util.Maps;
import org.labkey.test.util.PasswordUtil;
import org.labkey.test.util.PortalHelper;
import org.labkey.test.util.PostgresOnlyTest;
import org.labkey.test.util.SchemaHelper;
import org.labkey.test.util.TestLogger;
import org.labkey.test.util.TextSearcher;
Expand Down Expand Up @@ -117,7 +116,7 @@
* or similar business logic.
*/
@Category({EHR.class, WNPRC_EHR.class})
public class WNPRC_EHRTest extends AbstractGenericEHRTest implements PostgresOnlyTest
public class WNPRC_EHRTest extends AbstractGenericEHRTest
{
public static final String PROJECT_NAME = "WNPRC";
public static final String EHR_FOLDER_PATH = PROJECT_NAME + "/EHR";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import org.labkey.test.util.DataRegionTable;
import org.labkey.test.util.Maps;
import org.labkey.test.util.PortalHelper;
import org.labkey.test.util.PostgresOnlyTest;
import org.labkey.test.util.SchemaHelper;
import org.labkey.test.util.UIPermissionsHelper;

Expand All @@ -69,7 +68,7 @@

@Category({EHR.class, WNPRC_EHR.class})
@BaseWebDriverTest.ClassTimeout(minutes = 10)
public class WNPRC_PurchasingTest extends BaseWebDriverTest implements PostgresOnlyTest
public class WNPRC_PurchasingTest extends BaseWebDriverTest
{
//folders
private static final String PURCHASING_FOLDER = "WNPRC Purchasing";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,8 @@ public Object execute(Object o, BindException errors) throws Exception
DbScope scope = DbScope.getLabKeyScope();
try (DbScope.Transaction tx = schema.getDbSchema().getScope().ensureTransaction())
{
SQLFragment sql;
if (scope.getSqlDialect().isPostgreSQL())
{
sql = new SQLFragment("ALTER SEQUENCE ehr_billing.aliases_rowid_seq RESTART WITH 96");
new SqlExecutor(scope).execute(sql);
}
SQLFragment sql = new SQLFragment("ALTER SEQUENCE ehr_billing.aliases_rowid_seq RESTART WITH 96");
new SqlExecutor(scope).execute(sql);
tx.commit();
}
return null;
Expand All @@ -369,12 +365,8 @@ public Object execute(Object o, BindException errors)
DbScope scope = DbScope.getLabKeyScope();
try (DbScope.Transaction tx = schema.getDbSchema().getScope().ensureTransaction())
{
SQLFragment sql;
if (scope.getSqlDialect().isPostgreSQL())
{
sql = new SQLFragment("TRUNCATE wnprc_virology.rsehr_folders_accounts_and_vl_reader_emails CASCADE;\n");
new SqlExecutor(scope).execute(sql);
}
SQLFragment sql = new SQLFragment("TRUNCATE wnprc_virology.rsehr_folders_accounts_and_vl_reader_emails CASCADE;\n");
new SqlExecutor(scope).execute(sql);
tx.commit();
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.labkey.test.util.Ext4Helper;
import org.labkey.test.util.PasswordUtil;
import org.labkey.test.util.PortalHelper;
import org.labkey.test.util.PostgresOnlyTest;
import org.labkey.test.util.RemoteConnectionHelper;
import org.labkey.test.util.SchemaHelper;
import org.labkey.test.util.di.DataIntegrationHelper;
Expand All @@ -66,7 +65,7 @@
import static org.labkey.test.util.PermissionsHelper.READER_ROLE;

@Category({EHR.class, WNPRC_EHR.class})
public class WNPRC_VirologyTest extends ViralLoadAssayTest implements PostgresOnlyTest
public class WNPRC_VirologyTest extends ViralLoadAssayTest
{

public static final String CUSTOM_PROJECT_NAME = "LaboratoryVerifyProject";
Expand Down
2 changes: 1 addition & 1 deletion docker/labkey/application.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## These properties are used for development and test deployments.
## Many properties here will be filled in and uncommented by the Gradle 'pickPg' and 'pickMssql' tasks
## Many properties here will be filled in and uncommented by the Gradle 'pickPg' task

#server.port=@@serverPort@@
server.port=8080
Expand Down
1 change: 0 additions & 1 deletion wnprc_ios_app/module.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
ModuleClass: org.labkey.wnprc_ios_app.wnprc_ios_appModule
Name: wnprc_ios_app
ManageVersion: false
SupportedDatabases: pgsql
#SchemaVersion: 25.000
BuildType: Production