Skip to content

Commit

Permalink
Put the validation code back into treatment orders.
Browse files Browse the repository at this point in the history
  • Loading branch information
kollil committed Dec 19, 2023
1 parent b2461b8 commit a73a3ae
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1044,24 +1044,20 @@ exports.init = function(EHR){
}
}


// Removing this validation check from the "Meds Given" data entry panel as some forms like BSU exam entry doesn't need amount_units
// Please refer to the tkt # 10285

// /* Added by Kollil, 11/17/2023. Tkt #10159
// Added extra validation: 1. If volume is not null, must enter vol units
// 2. If amount is not null, must enter amount units
// */
// if (!row.vol_units) {
// if (row.volume) {
// EHR.Server.Utils.addError(scriptErrors, 'vol_units', 'Must enter Vol Units if Volume is entered', 'WARN');
// }
// }
// if (!row.amount_units ) {
// if (row.amount) {
// EHR.Server.Utils.addError(scriptErrors, 'amount_units', 'Must enter Amount Units if Amount is entered', 'WARN');
// }
// }
/* Added by Kollil, 11/17/2023. Tkt #10159
Added extra validation: 1. If volume is not null, must enter vol units
2. If amount is not null, must enter amount units
*/
if (!row.vol_units) {
if (row.volume) {
EHR.Server.Utils.addError(scriptErrors, 'vol_units', 'Must enter Vol Units if Volume is entered', 'WARN');
}
}
if (!row.amount_units ) {
if (row.amount) {
EHR.Server.Utils.addError(scriptErrors, 'amount_units', 'Must enter Amount Units if Amount is entered', 'WARN');
}
}

if (row.frequency){
if (!triggerHelper.isTreatmentFrequencyActive(row.frequency)){
Expand Down

0 comments on commit a73a3ae

Please sign in to comment.