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

Fixed Triage Validation #757

Merged
merged 2 commits into from
Dec 11, 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
10 changes: 5 additions & 5 deletions app/femr/ui/views/triage/index.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ <h2 id="vitalsHeading">Vitals</h2>
<div class="vitalWrap">
<label for="bloodPressureSystolic" id="bloodPressureTitle">Blood Pressure</label>
<div class="doubleVital">
<input type="number" step="number" min="0" class="fInput" id="systolicInput" placeholder="Systolic" name="@viewModel.getVitalNames.get(7).getName"/>
<input type="number" step="number" min="0" class="fInput" id="diastolicInput" placeholder="Diastolic" name="@viewModel.getVitalNames.get(8).getName"/>
<input type="number" step="number" min="0" class="fInput" id="@viewModel.getVitalNames.get(7).getName" placeholder="Systolic" name="@viewModel.getVitalNames.get(7).getName"/>
<input type="number" step="number" min="0" class="fInput" id="@viewModel.getVitalNames.get(8).getName" placeholder="Diastolic" name="@viewModel.getVitalNames.get(8).getName"/>
</div>
</div>
<div class="vitalWrap">
Expand Down Expand Up @@ -427,8 +427,8 @@ <h2 id="vitalsHeading">Vitals</h2>
<label for="heightFeet" id="heightLabel">Height</label>
<div class="doubleVital">
@if(viewModel.getSettings.isMetric) { <!--- Alaa Serhan -->
<input type="number" step="number" min="0" class="fInput" id="metersInput" placeholder="Meters" name="@viewModel.getVitalNames.get(4).getName"/>
<input type="number" step="number" min="0" class="fInput" id="centimetersInput" placeholder="Centimeters" name="@viewModel.getVitalNames.get(5).getName"/>
<input type="number" step="number" min="0" class="fInput" id="@viewModel.getVitalNames.get(4).getName" placeholder="Meters" name="@viewModel.getVitalNames.get(4).getName"/>
<input type="number" step="number" min="0" class="fInput" id="@viewModel.getVitalNames.get(5).getName" placeholder="Centimeters" name="@viewModel.getVitalNames.get(5).getName"/>
} else {
<input type="number" step="number" min="0" class="fInput" id="@viewModel.getVitalNames.get(4).getName" placeholder="Feet" name="@viewModel.getVitalNames.get(4).getName"/>
<input type="number" step="number" min="0" class="fInput" id="@viewModel.getVitalNames.get(5).getName" placeholder="Inches" name="@viewModel.getVitalNames.get(5).getName"/>
Expand All @@ -447,7 +447,7 @@ <h2 id="vitalsHeading">Vitals</h2>
<div class="vitalWrap">
<label id="bmiLabel">BMI</label>

<input type="text" id="bmi" class="fInput" disabled="true"/>
<input type="text" id="bmi" class="fInput" disabled/>
</div>
<div class="vitalWrap">
<label id="glucoseLabel">Glucose</label>
Expand Down
13 changes: 10 additions & 3 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 @@ -663,7 +663,8 @@ $(document).ready(function () {
patientPhotoFeature.flagForDeletion();
});

$('#triageSubmitBtn').click(function () {
$('#triageSubmitBtn').click(function (e) {
e.preventDefault();
var pass = validate();
var patientInfo = triageFields.patientInformation;
var query = patientInfo.firstName.val() + " " + patientInfo.lastName.val();
Expand All @@ -690,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
Loading