diff --git a/onprc_billingpublic/resources/queries/onprc_billing_public/NIHIndustryRates/.qview.xml b/onprc_billingpublic/resources/queries/onprc_billing_public/NIHIndustryRates/.qview.xml index a473db037..684af65eb 100644 --- a/onprc_billingpublic/resources/queries/onprc_billing_public/NIHIndustryRates/.qview.xml +++ b/onprc_billingpublic/resources/queries/onprc_billing_public/NIHIndustryRates/.qview.xml @@ -6,52 +6,51 @@ - + - + - + - + - + - + - + - + - + - diff --git a/onprc_billingpublic/resources/queries/onprc_billing_public/NIHRateSheet/.qview.xml b/onprc_billingpublic/resources/queries/onprc_billing_public/NIHRateSheet/.qview.xml index dfe378d46..cc9151e73 100644 --- a/onprc_billingpublic/resources/queries/onprc_billing_public/NIHRateSheet/.qview.xml +++ b/onprc_billingpublic/resources/queries/onprc_billing_public/NIHRateSheet/.qview.xml @@ -6,52 +6,51 @@ - + - + - + - + - + - + - + - + - + - diff --git a/onprc_billingpublic/resources/queries/onprc_billing_public/NIHRates_ReducedFA/.qview.xml b/onprc_billingpublic/resources/queries/onprc_billing_public/NIHRates_ReducedFA/.qview.xml index a21a4dfe7..cdd6ab9a0 100644 --- a/onprc_billingpublic/resources/queries/onprc_billing_public/NIHRates_ReducedFA/.qview.xml +++ b/onprc_billingpublic/resources/queries/onprc_billing_public/NIHRates_ReducedFA/.qview.xml @@ -6,52 +6,51 @@ - + - + - + - + - + - + - + - + - + - diff --git a/onprc_ehr/resources/web/onprc_ehr/panel/RoomLayoutPanel.js b/onprc_ehr/resources/web/onprc_ehr/panel/RoomLayoutPanel.js index 1dd9304b0..b331c6582 100644 --- a/onprc_ehr/resources/web/onprc_ehr/panel/RoomLayoutPanel.js +++ b/onprc_ehr/resources/web/onprc_ehr/panel/RoomLayoutPanel.js @@ -184,15 +184,15 @@ Ext4.define('ONPRC.panel.RoomLayoutPanel', { var rooms = Ext4.Object.getKeys(roomMap).sort(); var dividerWidth = 3; - var height = 115; - var cageWidth = 51; //Modified: 10-15-2020 + var height = 75; + var cageWidth = 60; var hasCages = false; Ext4.each(rooms, function(room, roomIdx){ if (roomIdx == 0 && !config.printMode){ toAdd.push(ONPRC.panel.RoomLayoutPanel.getButtonCfgs(config)); toAdd.push({ - style: 'margin-bottom: 20px;', + style: 'margin-bottom: 5px;', border: false }); } @@ -244,7 +244,7 @@ Ext4.define('ONPRC.panel.RoomLayoutPanel', { border: false }); - //Modified: 8-19-2019 R. Blasa Added Divider Legends Not eeded at this time + //Modified: 8-19-2019 R. Blasa Added Divider Legends Not needed at this time currentSection.push({ //Modified: 4/3/2023 R.Blasa diff --git a/onprc_ehr/resources/web/onprc_ehr/templates/ClinicalProcessing.xlsx b/onprc_ehr/resources/web/onprc_ehr/templates/ClinicalProcessing.xlsx deleted file mode 100644 index 9979a28d5..000000000 Binary files a/onprc_ehr/resources/web/onprc_ehr/templates/ClinicalProcessing.xlsx and /dev/null differ diff --git a/onprc_ehr/resources/web/onprc_ehr/templates/ClinicalProcessingTemplate.xlsx b/onprc_ehr/resources/web/onprc_ehr/templates/ClinicalProcessingTemplate.xlsx old mode 100644 new mode 100755 index bae51e026..66f764b22 Binary files a/onprc_ehr/resources/web/onprc_ehr/templates/ClinicalProcessingTemplate.xlsx and b/onprc_ehr/resources/web/onprc_ehr/templates/ClinicalProcessingTemplate.xlsx differ diff --git a/onprc_ehr/resources/web/onprc_ehr/templates/ClinicalProcessingTemplate_TPR_Master.xlsx b/onprc_ehr/resources/web/onprc_ehr/templates/ClinicalProcessingTemplate_TPR_Master.xlsx old mode 100644 new mode 100755 index d3affcd46..a3ff5ddee Binary files a/onprc_ehr/resources/web/onprc_ehr/templates/ClinicalProcessingTemplate_TPR_Master.xlsx and b/onprc_ehr/resources/web/onprc_ehr/templates/ClinicalProcessingTemplate_TPR_Master.xlsx differ diff --git a/onprc_ehr/resources/web/onprc_ehr/window/ClinicalMassProcessing.js b/onprc_ehr/resources/web/onprc_ehr/window/ClinicalMassProcessing.js index 74cb01ae1..9633f508b 100644 --- a/onprc_ehr/resources/web/onprc_ehr/window/ClinicalMassProcessing.js +++ b/onprc_ehr/resources/web/onprc_ehr/window/ClinicalMassProcessing.js @@ -305,6 +305,8 @@ Ext4.define('ONPRC_EHR.window.ClinicalProcessingWindow', { {snomedcode = 'F-31030'} if (row[7]== 3 ) {snomedcode = 'F-31040'} + if (row[7]== 'No' ) + {snomedcode = 'F-30980'} var obj = { Id: id, date: this.getTime(date, times, errors, rowIdx), diff --git a/onprc_ehr/resources/web/onprc_ehr/window/ClinicalMassProcessing_TPR.js b/onprc_ehr/resources/web/onprc_ehr/window/ClinicalMassProcessing_TPR.js index 3c7d37472..f883a9b76 100644 --- a/onprc_ehr/resources/web/onprc_ehr/window/ClinicalMassProcessing_TPR.js +++ b/onprc_ehr/resources/web/onprc_ehr/window/ClinicalMassProcessing_TPR.js @@ -420,6 +420,8 @@ Ext4.define('ONPRC_EHR.window.ClinicalProcessingTPRWindow', { {snomedcode = 'F-31030'} if (row[10]== 3 ) {snomedcode = 'F-31040'} + if (row[10]== 'No' ) + {snomedcode = 'F-30980'} var obj = { Id: id, date: this.getTime(date, times, errors, rowIdx), diff --git a/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java b/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java index 1614ab36e..92589d531 100644 --- a/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java +++ b/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest.java @@ -71,6 +71,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import java.util.function.Function; import static org.junit.Assert.assertEquals; @@ -556,6 +557,29 @@ public void testArrivalApi() throws Exception Assert.assertEquals(1, demographicsSelect.execute(getApiHelper().getConnection(), getContainerPath()).getRowCount().intValue()); } + @Test + public void testSubmitButtonsDisabledDuringValidation() throws Exception + { + List allIds = createTemporaryValidationAnimals(30); + + try + { + log("Bulk adding animals in treatment orders for temporary test animals"); + _helper.goToTaskForm("Medications/Diet", false); + Ext4GridRef treatmentGrid = _helper.getExt4GridForFormSection("Medication/Treatment Orders"); + addBatchIdsToGrid(treatmentGrid, allIds); + + assertActionsDisabledDuringValidation(); + + treatmentGrid.waitForRowCount(allIds.size()); + _helper.discardForm(); + } + finally + { + deleteTemporaryValidationAnimals(allIds); + } + } + @Test public void testCustomActions() throws Exception { @@ -1102,8 +1126,9 @@ public void testExamEntry() throws Exception Assert.assertEquals(remark, bloodGrid.getFieldValue(3, "remark")); Assert.assertEquals(remark, bloodGrid.getFieldValue(4, "remark")); - waitAndClickAndWait(_helper.getDataEntryButton("Save & Close")); - waitForElement(Locator.tagWithText("a", "Enter New Data")); + waitForDataEntryButtonEnabled("Save & Close", WAIT_FOR_PAGE * 2); + waitAndClick(_helper.getDataEntryButton("Save & Close")); + waitForElement(Locator.tagWithText("a", "Enter New Data"), WAIT_FOR_PAGE * 2); } @Test @@ -1487,6 +1512,9 @@ public void testPathology() //test SNOMED codes _ext4Helper.clickExt4Tab("Histologic Findings"); Ext4GridRef histologyGrid = _helper.getExt4GridForFormSection("Histologic Findings"); + // The custom "Add Record" handler returns early until the tab's grid store finishes loading. + waitFor(() -> (Boolean)histologyGrid.getFnEval("return !!this.store && (!this.store.hasLoaded || this.store.hasLoaded());"), + "Histologic Findings grid store did not finish loading", WAIT_FOR_JAVASCRIPT); _helper.addRecordToGrid(histologyGrid, "Add Record"); scrollIntoView(histologyGrid.getCell(1,7), true); waitAndClick(histologyGrid.getCell(1, 7)); @@ -1565,7 +1593,9 @@ public void testPathology() waitForElementToDisappear(deathWindow, 20000); //saving can take longer than default 10 seconds waitForElementToDisappear(Locator.tagContainingText("div", "Saving Changes...").notHidden()); - waitAndClickAndWait(_helper.getDataEntryButton("Save & Close")); + waitForDataEntryButtonEnabled("Save & Close", WAIT_FOR_PAGE * 2); + waitAndClick(_helper.getDataEntryButton("Save & Close")); + waitForElement(Locator.tagWithText("a", "Enter New Data"), WAIT_FOR_PAGE * 2); //make new necropsy, copy from previous _helper.goToTaskForm("Necropsy", false); @@ -1970,6 +2000,107 @@ private void setNecropsyFormElement(String id, String value) assertEquals(value, getFormElement(loc)); } + private void addBatchIdsToGrid(Ext4GridRef grid, List ids) + { + grid.clickTbarButton("Add Batch"); + waitForElement(Ext4Helper.Locators.window("Choose Animals")); + Ext4FieldRef.getForLabel(this, "Id(s)").setValue(StringUtils.join(ids, ";")); + + waitAndClick(Ext4Helper.Locators.window("Choose Animals").append(Ext4Helper.Locators.ext4Button("Submit"))); + grid.waitForRowCount(ids.size()); + } + + private void assertActionsDisabledDuringValidation() + { + List buttonTexts = Arrays.asList("Save Draft", "Save & Close", "Submit For Review", "Submit Final"); + List menuItemTexts = Arrays.asList("Submit And Reload", "Force Submit"); + Locator.XPathLocator validationIndicator = Locator.tagContainingText("span", "Validating...").notHidden(); + waitFor(() -> !validationIndicator.findElements(getDriver()).isEmpty(), + "Validation indicator never appeared", WAIT_FOR_PAGE); + + for (String buttonText : buttonTexts) + { + List buttons = _ext4Helper.componentQuery("button[text='" + buttonText + "']", Ext4CmpRef.class); + if (!buttons.isEmpty()) + { + waitFor(() -> Boolean.TRUE.equals(buttons.get(0).getEval("isDisabled() == arguments[0]", true)), + buttonText + " did not become disabled during validation", WAIT_FOR_PAGE); + } + } + + waitAndClick(_helper.getDataEntryButton("More Actions")); + waitForElement(Ext4Helper.Locators.menu().notHidden()); + for (String menuItemText : menuItemTexts) + { + waitForElement(Ext4Helper.Locators.menuItemDisabled(menuItemText).notHidden()); + } + waitAndClick(_helper.getDataEntryButton("More Actions")); + waitForElementToDisappear(Ext4Helper.Locators.menu().notHidden()); + + waitFor(() -> validationIndicator.findElements(getDriver()).isEmpty(), + "Validation indicator did not disappear", WAIT_FOR_PAGE * 2); + waitForText(WAIT_FOR_PAGE * 2, "WARN"); + waitForText(WAIT_FOR_PAGE * 2, "ERROR"); + } + + private List createTemporaryValidationAnimals(int count) throws Exception + { + String seed = Long.toString(System.currentTimeMillis()); + seed = seed.substring(Math.max(0, seed.length() - 6)); + + String[] species = {"Rhesus", "Cynomolgus", "Marmoset"}; + String[] fields = {"Id", "Species", "Birth", "Gender", "date", "calculated_status", "objectid"}; + Object[][] data = new Object[count][]; + List ids = new ArrayList<>(); + + for (int i = 0; i < count; i++) + { + String id = "VAL" + seed + String.format("%02d", i + 1); + ids.add(id); + data[i] = new Object[]{ + id, + species[i % species.length], + new Date().toString(), + i % 2 == 0 ? getMale() : getFemale(), + new Date(), + "Alive", + UUID.randomUUID().toString() + }; + } + + getApiHelper().deleteAllRecords("study", "demographics", new Filter("Id", StringUtils.join(ids, ";"), Filter.Operator.IN)); + getApiHelper().doSaveRows(DATA_ADMIN.getEmail(), + getApiHelper().prepareInsertCommand("study", "demographics", "lsid", fields, data), + getExtraContext()); + cacheIds(ids); + + return ids; + } + + private void deleteTemporaryValidationAnimals(List ids) throws Exception + { + if (ids.isEmpty()) + { + return; + } + + getApiHelper().deleteAllRecords("study", "demographics", new Filter("Id", StringUtils.join(ids, ";"), Filter.Operator.IN)); + } + + private void waitForDataEntryButtonEnabled(String buttonText, int timeout) + { + waitFor(() -> { + List buttons = _ext4Helper.componentQuery("button[text='" + buttonText + "']", Ext4CmpRef.class); + if (buttons.isEmpty()) + { + return false; + } + + return Boolean.TRUE.equals(buttons.get(0).getEval("isDisabled() == arguments[0]", false)); + }, + "Button did not become enabled: " + buttonText, timeout); + } + @Override protected String getAnimalHistoryPath() {