Skip to content

Commit

Permalink
fixed triage submission
Browse files Browse the repository at this point in the history
  • Loading branch information
realkaranvir committed Dec 11, 2024
1 parent c10dbf3 commit 7900611
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions public/js/triage/triage.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ var triageFields = {
address: $('#address'),
phoneNumber: $('#phoneNumber'),
age: $('#age'),//doesn't work for an existing patient
years: $('#years'),
months: $('#months'),
years: $('#yearsInput'),
months: $('#monthsInput'),
ageClassification: $('[name=ageClassification]'),
city: $('#city'),
maleButton: $('#maleBtn'),
Expand Down Expand Up @@ -691,8 +691,14 @@ $(document).ready(function () {
//checkIfDuplicatePatient();
checkIfDuplicatePatientMatch();
}

pass = !isDiabeticScreeningPromptNecessary;
}

if (pass === true) {
$('.triage-form').submit(); // Submit the form only if validation is successful
}

return pass; //located in triageClientValidation.js
});

Expand Down
2 changes: 1 addition & 1 deletion public/js/triage/triageClientValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var triageFieldValidator = {
}

//Validate Age
if ( (patientInformation.months.val().length > 0 && !integerCheck(patientInformation.months.val())) ||
if ((patientInformation.months.val().length > 0 && !integerCheck(patientInformation.months.val())) ||
(patientInformation.years.val().length > 0 && !integerCheck(patientInformation.years.val()))
){
$('#ageClassificationWrap').children(".generalInfoInput").addClass("has-errors");
Expand Down

0 comments on commit 7900611

Please sign in to comment.