Skip to content

Commit

Permalink
Modified Medication scripting to include duration, and enddates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ohsudev committed May 21, 2024
1 parent fea076e commit c15b7d8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions onprc_ehr/resources/web/onprc_ehr/window/ApplyTemplateWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,26 @@ Ext4.define('ONPRC_EHR.window.ApplyTemplateWindow', {


}

var enddate = null;
if (data.duration) {
//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 = date;
enddate = Ext4.Date.add(enddate, Ext4.Date.DAY, data.duration);
}
}
var obj2 = {};
obj2 = {
date: date
Expand Down

0 comments on commit c15b7d8

Please sign in to comment.