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 @@ -814,6 +814,7 @@ private void importWNPRCResults(String instrument) throws Exception
Locator btn = Locator.linkContainingText("Download Example Data");
waitForElement(btn);

Ext4FieldRef.waitForField(this, "Instrument");
assertEquals("Incorrect value for field", instrument, Ext4FieldRef.getForLabel(this, "Instrument").getValue());
assertEquals("Incorrect value for field", Long.valueOf(50), Ext4FieldRef.getForLabel(this, "Eluate Volume").getValue());
assertEquals("Incorrect value for field", Long.valueOf(5), Ext4FieldRef.getForLabel(this, "Sample Vol Per Rxn").getValue());
Expand Down
27 changes: 21 additions & 6 deletions ehr/src/org/labkey/ehr/EHRServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
import org.labkey.api.query.FieldKey;
import org.labkey.api.query.QueryService;
import org.labkey.api.query.UserSchema;
import org.labkey.api.resource.DirectoryResource;
import org.labkey.api.resource.FileResource;
import org.labkey.api.resource.Resource;
import org.labkey.api.security.SecurableResource;
import org.labkey.api.security.SecurityPolicy;
Expand Down Expand Up @@ -866,16 +868,29 @@ public void importStudyDefinition(Container container, User user, Module m, Path
Resource root = m.getModuleResource(sourceStudyDirPath);
PipeRoot pipeRoot = PipelineService.get().findPipelineRoot(container);
java.nio.file.Path pipeRootPath = pipeRoot.getRootNioPath();
java.nio.file.Path studyPath = pipeRootPath.resolve("upgradeStudyImport");
if (Files.exists(studyPath))

java.nio.file.Path studyXmlPath;

if (root instanceof DirectoryResource && ((DirectoryResource)root).getDir().equals(pipeRootPath.toFile()))
{
// The pipeline root is already pointed at the study definition's folder, like it might be on a dev machine.
// No need to copy, especially since copying can cause infinite recursion when the paths are nested
studyXmlPath = pipeRootPath.resolve("study.xml");
}
else
{
FileUtil.deleteDir(studyPath);
java.nio.file.Path studyPath = pipeRootPath.resolve("moduleStudyImport");
studyXmlPath = studyPath.resolve("study.xml");
if (Files.exists(studyPath))
{
FileUtil.deleteDir(studyPath);
}
copyResourceToPath(root, studyPath);
}
copyResourceToPath(root, studyPath);
java.nio.file.Path studyXmlPath = studyPath.resolve("study.xml");

if (!Files.exists(studyXmlPath))
{
throw new FileNotFoundException("Couldn't find an extracted " + studyPath);
throw new FileNotFoundException("Couldn't find an extracted " + studyXmlPath);
}
ImportOptions options = new ImportOptions(container.getId(), user.getUserId());
options.setSkipQueryValidation(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ public void testArrivalForm() throws Exception
waitForElement(finalizeOKButton, WAIT_FOR_JAVASCRIPT);
click(finalizeOKButton);

waitAndClick(WAIT_FOR_JAVASCRIPT * 2, Ext4Helper.Locators.window("Success").append(Ext4Helper.Locators.ext4Button("No")), WAIT_FOR_PAGE);
waitAndClick(WAIT_FOR_JAVASCRIPT * 5, Ext4Helper.Locators.window("Success").append(Ext4Helper.Locators.ext4Button("No")), WAIT_FOR_PAGE);

waitForElement(Locator.tagWithText("a", "Enter New Data"));

Expand Down Expand Up @@ -1009,7 +1009,7 @@ public void testTreatmentToDrugETL() throws IOException, CommandException
log("Creating the Treatment order request");
goToProjectHome();
clickAndWait(Locator.linkWithText("Enter Data / Task Review"));
clickAndWait(Locator.linkWithText("Medications/Diet"));
waitAndClickAndWait(Locator.linkWithText("Medications/Diet"));

addTreatmentOrder(animalId, beginDate, endDate, "640991", "ACETAMINOPHEN (80mg) (E-77510)",
"BID - AM/Night", "PO", "tablet(s)", 10, "mg");
Expand Down