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 @@ -83,12 +83,6 @@ public List<String> getAssociatedModules()
return Arrays.asList("ehr", "onprc_ehr");
}

@Override
public String getContainerPath()
{
return getProjectName();
}

@Override
protected EHRClientAPIHelper getApiHelper()
{
Expand All @@ -103,6 +97,8 @@ protected void setEHRModuleProperties(ModulePropertyValue... extraProps)
super._containerHelper.enableModule("ONPRC_Billing");
super._containerHelper.enableModule("ONPRC_BillingPublic");
super._containerHelper.enableModule("SLA");
goToEHRFolder();
super._containerHelper.enableModules(List.of("ONPRC_Billing", "ONPRC_BillingPublic", "SLA"));
super.setEHRModuleProperties(
new ModulePropertyValue("ONPRC_Billing", "/" + getProjectName(), "BillingContainer", "/" + getContainerPath()),
new ModulePropertyValue("ONPRC_Billing", "/" + getProjectName(), "BillingContainer_Public", "/" + getContainerPath()),
Expand Down Expand Up @@ -134,7 +130,7 @@ protected void createBirthRecords() throws Exception
log("creating birth records");

//note: these should cascade insert into demographics
EHRClientAPIHelper apiHelper = new EHRClientAPIHelper(this, getProjectName());
EHRClientAPIHelper apiHelper = new EHRClientAPIHelper(this, getContainerPath());
String schema = "study";
String query = "birth";
String parentageQuery = "parentage";
Expand Down Expand Up @@ -185,20 +181,20 @@ protected void createBirthRecords() throws Exception
protected void doExtraPreStudyImportSetup() throws IOException, CommandException
{
//create onprc_billing_public linked schema
beginAt(getProjectName());
goToEHRFolder();
SchemaHelper schemaHelper = new SchemaHelper(this);
schemaHelper.createLinkedSchema(this.getProjectName(), "onprc_billing_public", "/" + this.getContainerPath(), "onprc_billing_public", null, null, null);
schemaHelper.createLinkedSchema(getContainerPath(), "onprc_billing_public", "/" + getContainerPath(), "onprc_billing_public", null, null, null);

//create Labfee_NoChargeProjects
beginAt(getProjectName());
goToEHRFolder();

ListDefinition listDef = new IntListDefinition("Labfee_NoChargeProjects", "key");
listDef.addField(new FieldDefinition("project", FieldDefinition.ColumnType.Integer));
listDef.addField(new FieldDefinition("startDate", FieldDefinition.ColumnType.DateAndTime));
listDef.addField(new FieldDefinition("dateDisabled", FieldDefinition.ColumnType.DateAndTime));
listDef.addField(new FieldDefinition("Createdb", FieldDefinition.ColumnType.Integer));
listDef.addField(new FieldDefinition("Notes", FieldDefinition.ColumnType.String));
listDef.getCreateCommand().execute(createDefaultConnection(), getProjectName());
listDef.getCreateCommand().execute(createDefaultConnection(), getContainerPath());

ListDefinition listDef2 = new VarListDefinition("GeneticValue");
listDef2.setKeyName("Id");
Expand All @@ -212,12 +208,12 @@ protected void doExtraPreStudyImportSetup() throws IOException, CommandException
listDef2.addField(new FieldDefinition("import", FieldDefinition.ColumnType.String));
listDef2.addField(new FieldDefinition("value", FieldDefinition.ColumnType.String));
listDef2.addField(new FieldDefinition("rank", FieldDefinition.ColumnType.Integer));
listDef2.getCreateCommand().execute(createDefaultConnection(), getProjectName());
listDef2.getCreateCommand().execute(createDefaultConnection(), getContainerPath());

ListDefinition listDef3 = new IntListDefinition("Special_Aliases", "Key");
listDef3.addField(new FieldDefinition("Category", FieldDefinition.ColumnType.String));
listDef3.addField(new FieldDefinition("Alias", FieldDefinition.ColumnType.String));
listDef3.getCreateCommand().execute(createDefaultConnection(), getProjectName());
listDef3.getCreateCommand().execute(createDefaultConnection(), getContainerPath());

ListDefinition listDef4 = new IntListDefinition("Rpt_ChargesProjection", "RowId");
listDef4.addField(new FieldDefinition("ChargeId", FieldDefinition.ColumnType.Integer));
Expand All @@ -240,7 +236,7 @@ protected void doExtraPreStudyImportSetup() throws IOException, CommandException
listDef4.addField(new FieldDefinition("Aprate8", FieldDefinition.ColumnType.Decimal));
listDef4.addField(new FieldDefinition("Aprate9", FieldDefinition.ColumnType.Decimal));
listDef4.addField(new FieldDefinition("PostedDate", FieldDefinition.ColumnType.DateAndTime));
listDef4.getCreateCommand().execute(createDefaultConnection(), getProjectName());
listDef4.getCreateCommand().execute(createDefaultConnection(), getContainerPath());

// Mock up a table in the MHC_Data schema instead of needing to mock up all of its dependencies too
ListDefinition listDef5 = new IntListDefinition("MHC_Data_Unified", "RowId");
Expand All @@ -255,17 +251,17 @@ protected void doExtraPreStudyImportSetup() throws IOException, CommandException
listDef5.addField(new FieldDefinition("datatype", FieldDefinition.ColumnType.String));
listDef5.addField(new FieldDefinition("result", FieldDefinition.ColumnType.String));
listDef5.addField(new FieldDefinition("type", FieldDefinition.ColumnType.String));
listDef5.getCreateCommand().execute(createDefaultConnection(), getProjectName());

schemaHelper.createLinkedSchema(this.getProjectName(), "dbo", "/" + this.getContainerPath(), null, "lists", null, null);
schemaHelper.createLinkedSchema(this.getProjectName(), "MHC_Data", "/" + this.getContainerPath(), null, "lists", null, null);
schemaHelper.createLinkedSchema(this.getProjectName(), "ehrSLA", "/" + this.getContainerPath(), "ehrSLA", "sla", null, null);
schemaHelper.createLinkedSchema(this.getProjectName(), "financepublic", "/" + this.getContainerPath(), "financepublic", "onprc_billing", null, null);
schemaHelper.createLinkedSchema(this.getProjectName(), "publicehr", "/" + this.getContainerPath(), null, "ehr", null, null);
schemaHelper.createLinkedSchema(this.getProjectName(), "onprc_ehrSLA", "/" + this.getContainerPath(), null, "onprc_ehr", null, null);
schemaHelper.createLinkedSchema(this.getProjectName(), "pf_onprcehrPublic", "/" + this.getContainerPath(), "pf_onprcehrPublic", null, null, null);
schemaHelper.createLinkedSchema(this.getProjectName(), "pf_publicEHR", "/" + this.getContainerPath(), "pf_publicEHR", null, null, null);
schemaHelper.createLinkedSchema(this.getProjectName(), "pf_publicFinance", "/" + this.getContainerPath(), "pf_publicFinance", null, null, null);
listDef5.getCreateCommand().execute(createDefaultConnection(), getContainerPath());

schemaHelper.createLinkedSchema(getContainerPath(), "dbo", "/" + getContainerPath(), null, "lists", null, null);
schemaHelper.createLinkedSchema(getContainerPath(), "MHC_Data", "/" + getContainerPath(), null, "lists", null, null);
schemaHelper.createLinkedSchema(getContainerPath(), "ehrSLA", "/" + getContainerPath(), "ehrSLA", "sla", null, null);
schemaHelper.createLinkedSchema(getContainerPath(), "financepublic", "/" + getContainerPath(), "financepublic", "onprc_billing", null, null);
schemaHelper.createLinkedSchema(getContainerPath(), "publicehr", "/" + getContainerPath(), null, "ehr", null, null);
schemaHelper.createLinkedSchema(getContainerPath(), "onprc_ehrSLA", "/" + getContainerPath(), null, "onprc_ehr", null, null);
schemaHelper.createLinkedSchema(getContainerPath(), "pf_onprcehrPublic", "/" + getContainerPath(), "pf_onprcehrPublic", null, null, null);
schemaHelper.createLinkedSchema(getContainerPath(), "pf_publicEHR", "/" + getContainerPath(), "pf_publicEHR", null, null, null);
schemaHelper.createLinkedSchema(getContainerPath(), "pf_publicFinance", "/" + getContainerPath(), "pf_publicFinance", null, null, null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,10 @@ public void testCustomButtons(){}

@Override
public void customActionsTest(){}

@Override
public void testCrawlEhrLinks()
{
// This is being done in ONPRC_EHRTest, don't need to do it here as well.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private void doSetUp() throws Exception
_portalHelper.addWebPart("ONPRC Finance");
_portalHelper.moveWebPart("Finance", PortalHelper.Direction.UP);
}

@Test
public void testNotifications()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
public class ONPRC_EHRTest extends AbstractGenericONPRC_EHRTest
{
protected String PROJECT_NAME = "ONPRC_EHR_TestProject";
private final String ANIMAL_HISTORY_URL = "/" + getProjectName() + "/ehr-animalHistory.view";
private final String ANIMAL_HISTORY_URL = "/" + getContainerPath() + "/ehr-animalHistory.view";

@Override
protected String getProjectName()
Expand Down Expand Up @@ -161,7 +161,7 @@ public void testAssignmentApi() throws Exception
{
final String investLastName = "Tester";

goToProjectHome();
goToEHRFolder();

String[][] CONDITION_FLAGS = new String[][]{
{"Nonrestricted", "201"},
Expand Down Expand Up @@ -346,7 +346,7 @@ public void testAssignmentApi() throws Exception
@Test
public void testAnimalGroupsApi() throws Exception
{
goToProjectHome();
goToEHRFolder();

int group1 = getOrCreateGroup("Group1");
int group2 = getOrCreateGroup("Group2");
Expand All @@ -365,7 +365,7 @@ public void testAnimalGroupsApi() throws Exception
@Test
public void testProjectProtocolApi() throws Exception
{
goToProjectHome();
goToEHRFolder();

//auto-assignment of IDs
String protocolTitle = generateGUID();
Expand Down Expand Up @@ -400,7 +400,7 @@ public void testProjectProtocolApi() throws Exception
@Test
public void testDrugApi()
{
goToProjectHome();
goToEHRFolder();

getApiHelper().testValidationMessage(DATA_ADMIN.getEmail(), "study", "drug", new String[]{"Id", "date", "code", "outcome", "remark", "amount", "amount_units", "volume", "vol_units", "QCStateLabel", "objectid", "_recordId"}, new Object[][]{
{MORE_ANIMAL_IDS[0], new Date(), "code", "Abnormal", null, 1.0, "mg", 2.0, "mL", EHRQCState.COMPLETED.label, generateGUID(), "recordID"}
Expand Down Expand Up @@ -471,7 +471,7 @@ public void testDrugApi()
@Test
public void testArrivalApi() throws Exception
{
goToProjectHome();
goToEHRFolder();

final String arrivalId1 = "Arrival1";
final String arrivalId2 = "Arrival2";
Expand Down Expand Up @@ -579,11 +579,11 @@ public void testCustomActions() throws Exception
}

//colony overview
goToProjectHome();
goToEHRFolder();
waitAndClickAndWait(Locator.tagContainingText("a", "Colony Overview"));

//NOTE: depending on the test order and whether demographics records were created, so we test this
EHRClientAPIHelper apiHelper = new EHRClientAPIHelper(this, getProjectName());
EHRClientAPIHelper apiHelper = new EHRClientAPIHelper(this, getContainerPath());
boolean hasDemographics = apiHelper.getRowCount("study", "demographics") > 0;
boolean hasCases = apiHelper.getRowCount("study", "cases") > 0;
int aggregatePanelCount = 0;
Expand Down Expand Up @@ -630,7 +630,7 @@ public void testCustomActions() throws Exception

//bulk history export
log("testing bulk history export");
goToProjectHome();
goToEHRFolder();
waitAndClickAndWait(Locator.tagContainingText("a", "Bulk History Export"));
waitForElement(Locator.tagContainingText("label", "Enter Animal Id(s)"));
Ext4FieldRef.getForLabel(this, "Enter Animal Id(s)").setValue("12345;23432\nABCDE");
Expand All @@ -644,7 +644,7 @@ public void testCustomActions() throws Exception
assertElementNotPresent(Locator.tagContainingText("label", "Projects").notHidden()); //check redaction

//compare lists of animals
goToProjectHome();
goToEHRFolder();
waitAndClickAndWait(Locator.tagContainingText("a", "Compare Lists of Animals"));
waitForElement(Locator.id("unique"));
setFormElement(Locator.id("unique"), "1,2,1\n3,3;4");
Expand Down Expand Up @@ -674,7 +674,7 @@ public void testCustomActions() throws Exception
ensureGroupMember(groupId, MORE_ANIMAL_IDS[0]);
ensureGroupMember(groupId, MORE_ANIMAL_IDS[1]);

goToProjectHome();
goToEHRFolder();
waitAndClickAndWait(Locator.tagContainingText("a", "Animal Groups"));
waitForElement(Locator.tagContainingText("span", "Active Groups"));
DataRegionTable dr = new DataRegionTable("query", this);
Expand All @@ -683,7 +683,7 @@ public void testCustomActions() throws Exception
Assert.assertEquals(2, membersTable.getDataRowCount());

//more reports
goToProjectHome();
goToEHRFolder();
waitAndClickAndWait(Locator.tagContainingText("a", "More Reports"));
waitForElement(Locator.tagContainingText("a", "View Summary of Clinical Tasks"));
}
Expand All @@ -692,7 +692,7 @@ public void testCustomActions() throws Exception
public void testPrintableReports()
{
// NOTE: these primarily run SSRS, so we will just set up the UI and test whether the URL matches expectations
goToProjectHome();
goToEHRFolder();
waitAndClickAndWait(Locator.tagContainingText("a", "Printable Reports"));
waitForElement(Ext4Helper.Locators.ext4Button("Print Version"));

Expand All @@ -717,7 +717,7 @@ public void testPrintableReports()
closeExtraWindows();

// Now try the CITES Report
goToProjectHome();
goToEHRFolder();
waitAndClickAndWait(Locator.tagContainingText("a", "More Reports"));
waitAndClickAndWait(Locator.tagContainingText("a", "Cites Report"));
waitForElement(Locator.textarea("animalField"));
Expand Down Expand Up @@ -749,7 +749,7 @@ private void validateSsrsUrlParams(String reportName, String... additionalParams
@Test
public void testPedigreeReport()
{
goToProjectHome();
goToEHRFolder();
beginAtAnimalHistoryTab();

String id = ID_PREFIX + 10;
Expand Down Expand Up @@ -1247,7 +1247,7 @@ public void testWeightEntry()
@Test
public void testGeneticsPipeline()
{
goToProjectHome();
goToEHRFolder();

//retain pipeline log for debugging
getArtifactCollector().addArtifactLocation(new File(TestFileUtils.getLabKeyRoot(), getModulePath() + GENETICS_PIPELINE_LOG_PATH),
Expand All @@ -1270,7 +1270,7 @@ public void testGeneticsPipeline()
Test coverage for : https://www.labkey.org/ONPRC/Support%20Tickets/issues-details.view?issueId=41231
*/

goToProjectHome();
goToEHRFolder();
beginAtAnimalHistoryTab();
AnimalHistoryPage<?> animalHistoryPage = new AnimalHistoryPage<>(getDriver());
animalHistoryPage.searchSingleAnimal("99995,99996,99997,99998,99999,999910");
Expand Down Expand Up @@ -1316,7 +1316,7 @@ public void testNotifications()
{
setupNotificationService();

goToProjectHome();
goToEHRFolder();
waitAndClickAndWait(Locators.bodyPanel().append(Locator.tagContainingText("a", "EHR Admin Page")));
waitAndClickAndWait(Locator.tagContainingText("a", "Notification Admin"));

Expand Down Expand Up @@ -1772,6 +1772,8 @@ private void setDrugAmountField(String fieldName, int rowIdx, Object value, Map<
@Test
public void testBehaviorRounds() throws Exception
{
goToEHRFolder();

_helper.goToTaskForm("BSU Rounds");

//create a previous observation for the active case
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class ONPRC_EHRTest2 extends AbstractONPRC_EHRTest
private final String PROJECT_NAME = "ONPRC_EHR_TestProject2";
private final String ANIMAL_HISTORY_URL = "/ehr/" + getProjectName() + "/animalHistory.view?";
public AbstractContainerHelper _containerHelper = new APIContainerHelper(this);
public DataIntegrationHelper _etlHelper = new DataIntegrationHelper(PROJECT_NAME);
public DataIntegrationHelper _etlHelper = new DataIntegrationHelper(getContainerPath());
protected DateTimeFormatter _dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");

@BeforeClass
Expand Down Expand Up @@ -125,7 +125,7 @@ protected boolean doSetUserPasswords()
@Test
public void testBirthStatusApi() throws Exception
{
goToProjectHome();
goToEHRFolder();

//first create record for dam, along w/ animal group and SPF status. we expect this to automatically create a demographics record w/ the right status
final String damId1 = "Dam1";
Expand Down Expand Up @@ -724,7 +724,7 @@ public void testBirthInheritFromDam() throws Exception
Date damBirth = prepareDate(DateUtils.truncate(new Date(), Calendar.DATE), -720, 0);

// Navigate to the start of the project
goToProjectHome();
goToEHRFolder();

// Insert dam into birth via API
log("Creating Dam");
Expand Down Expand Up @@ -860,7 +860,7 @@ public void testManageTreatment() throws Exception
});
getApiHelper().doSaveRows(PasswordUtil.getUsername(), insertCommand, getExtraContext());

goToProjectHome();
goToEHRFolder();
waitAndClickAndWait(Locator.linkWithText("Animal History"));

String query = "textfield[itemId=subjArea]";
Expand Down Expand Up @@ -1267,7 +1267,7 @@ public void testTreatmentToDrugETL() throws IOException, CommandException
String animalId = "12345";

log("Creating the Treatment order request");
goToProjectHome();
goToEHRFolder();
clickAndWait(Locator.linkWithText("Enter Data / Task Review"));
waitAndClickAndWait(Locator.linkWithText("Medications/Diet"));

Expand Down Expand Up @@ -1302,7 +1302,7 @@ public void bloodRequestTest() throws IOException, CommandException
LocalDateTime now = LocalDateTime.now();
String animalId = "12345";

goToProjectHome();
goToEHRFolder();

log("Inserting the charge unit necessary for blood draw request");
InsertRowsCommand chargeUnitCommand = new InsertRowsCommand("onprc_billing", "chargeUnits");
Expand Down