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

HTML-777: Validate that encounter dates times are within visit start and end date. #48

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,19 @@ && hasNoTimeComponent(formEncounter.getEncounterDatetime())) {
new FormSubmissionError("general-form-error", ui.message("htmlformentryui.datetimeBeforeVisitDate")));
}

if (validationErrors.size() > 0) {
return returnHelper(validationErrors, fes, null);
}
} else if(visit != null) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @icrc-toliveira we can put this on the same line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @HerbertYiga
I´m not sure if this was you mean, but I change the indentation to be on the same line.
However, I noticed that if I let the project auto-ident, the entire file will have changes

if (encounter.getEncounterDatetime().before(visit.getStartDatetime())) {
validationErrors.add(
new FormSubmissionError("general-form-error", ui.message("htmlformentryui.datetimeAfterVisitDate")));
}

if (visit.getStopDatetime() != null && encounter.getEncounterDatetime().after(visit.getStopDatetime())) {
validationErrors.add(
new FormSubmissionError("general-form-error", ui.message("htmlformentryui.datetimeBeforeVisitDate")));
}
if (validationErrors.size() > 0) {
return returnHelper(validationErrors, fes, null);
}
Expand Down