Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bot] Merge 23.11 to 24.3 #1211

Merged
merged 4 commits into from
Dec 19, 2024
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
Binary file not shown.
62 changes: 55 additions & 7 deletions onprc_ehr/resources/web/onprc_ehr/window/ApplyTemplateWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ Ext4.define('ONPRC_EHR.window.ApplyTemplateWindow', {
Ext4.Msg.alert('Error', 'Must choose a template');
return;
}

var obj ={}
this.animalId = obj.Id;
this.loadTemplate(templateId);
},

Expand Down Expand Up @@ -225,16 +226,59 @@ Ext4.define('ONPRC_EHR.window.ApplyTemplateWindow', {
offsetDate.setHours(8);
date = offsetDate;

}

if (data.duration > 0) {
var enddate = null;
//this is specifically to handle hydro, when administered ~noon
if (new String(data.duration).match(/H$/)) {
var duration = new String(data.duration);
duration = duration.replace('H', '');
duration = Number(duration);
duration += encountersRec.get('date').getHours();
duration = Math.floor(duration / 24);

enddate = date;
endate = Ext4.Date.clearTime(enddate);
enddate = Ext4.Date.add(enddate, Ext4.Date.DAY, duration);
}
else {

enddate = offsetDate
enddate = Ext4.Date.add(enddate, Ext4.Date.DAY, data.duration);
enddate.setHours(23);
enddate = enddate;
enddate.setMinutes(59);
enddate = enddate;


}
}
var obj2 = {};
obj2 = {
date: date
else
{

var sdate= Ext4.Date.clone(new Date());
var soffsetDate = Ext4.Date.add(sdate, Ext4.Date.DAY, data.offset);
var soffsetDate = Ext4.Date.clearTime(soffsetDate);
enddate = soffsetDate;
enddate.setHours(23);
enddate = enddate;
enddate.setMinutes(59);
enddate = enddate;

}

var obj2 = {};
obj2 = {
date: date,
enddate: enddate

};

var newData = Ext4.apply({}, data);
newData = Ext4.apply(newData, obj);
newData = Ext4.apply(newData, obj2);
newData = Ext4.apply(newData, obj); //Adds monkey id

newData = Ext4.apply(newData, obj2); // add new computed dates

toAdd[store.storeId].push(newData);
}, this);
Expand All @@ -261,6 +305,7 @@ Ext4.define('ONPRC_EHR.window.ApplyTemplateWindow', {
}
},


getInitialRecordValues: function(){
var ret = [];
var date = this.down('#dateField').getValue();
Expand All @@ -271,6 +316,7 @@ Ext4.define('ONPRC_EHR.window.ApplyTemplateWindow', {
if (this.down('#subjectIds')){
var subjectArray = LDK.Utils.splitIds(this.down('#subjectIds').getValue(),true);
Ext4.Array.each(subjectArray, function(subj){
this.animalId = subj;
ret.push(Ext4.apply({
Id: subj
}, obj));
Expand Down Expand Up @@ -312,6 +358,8 @@ Ext4.define('ONPRC_EHR.window.ApplyTemplateWindow', {
return;
}



this.hide();
Ext4.Msg.wait("Loading Template...");

Expand Down Expand Up @@ -526,7 +574,7 @@ EHR.DataEntryUtils.registerGridButton('TEMPLATEREV', function(config){
var grid = btn.up('gridpanel');
var menu = this.up('menu').items.get('templatesMenu');

Ext4.create('EHR.window.ApplyTemplateWindow', {
Ext4.create('ONPRC_EHR.window.ApplyTemplateWindow', {
targetGrid: grid,
formType: grid.formConfig.name,
idSelectionMode: menu.idSelectionMode || 'multi'
Expand Down
10 changes: 9 additions & 1 deletion onprc_ehr/resources/web/onprc_ehr/window/EpocImportWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ Ext4.define('ONPRC_EHR.window.EpocImportWindow', {
items: [{
html: 'This helper allows you to bulk import EPOC data, exported as an excel file from the Epoc software.',
style: 'padding-bottom: 10px;'
},{
},{
xtype: 'ldk-linkbutton',
text: '[Download Epoc Template]',
scope: this,
style: 'margin-bottom: 10px;',
handler: function(){
window.location = LABKEY.contextPath + '/onprc_ehr/templates/Epoc_Template.xlsx'
}
},{
xtype: 'textarea',
itemId: 'textField',
height: 300,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public TreatmentsFormType(DataEntryFormContext ctx, Module owner)
{
super(ctx, owner, NAME, LABEL, "Clinical", Arrays.asList(
new TaskFormSection(),
//Added 2-19-2016 Blasa
// new NonStoreFormSection("Treatment Template Helper", "Treatment Template Helper", "onprc_AddScheduledTreatmentPanel", Arrays.asList(ClientDependency.supplierFromPath("/onprc_ehr/panel/AddScheduledTreatmentPanel.js"))),

new AnimalDetailsFormSection(),
new DrugAdministrationFormSection(ClientDependency.supplierFromPath("onprc_ehr/window/ONPRC_AddScheduledTreatmentWindow.js")),
new TreatmentOrdersFormSection()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.hc.client5.http.classic.methods.HttpGet;
import org.awaitility.Awaitility;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
Expand Down Expand Up @@ -56,6 +57,7 @@

import java.io.IOException;
import java.net.URI;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
Expand Down Expand Up @@ -1324,8 +1326,10 @@ public void bloodRequestTest() throws IOException, CommandException
waitAndClickAndWait(Locator.linkWithText("ASB Services Request"));
addBloodDrawRequest(animalId, now, "795644", "Heparin", 12);

checker().withScreenshot("Blood request").verifyTrue("Expected error is not present", isAnyTextPresent(
"Row 1, # of Tubes: ERROR: The quantity requested, 12.0ml exceeds the available blood volume, 10.0ml for AnimalId: 12345"));
Awaitility.await().atMost(Duration.ofSeconds(30)).untilAsserted(() -> {
Assert.assertTrue("Expected error is not present", isAnyTextPresent(
"Row 1, # of Tubes: ERROR: The quantity requested, 12.0ml exceeds the available blood volume, 10.0ml for AnimalId: 12345"));
});

//Updating the total volume below the available blood volume.
updateTotalVolume(8);
Expand Down
Loading