molgenis / molgenis

MOLGENIS - for scientific data: management, exploration, integration and analysis.
https://molgenis.org
GNU Lesser General Public License v3.0
111 stars 99 forks source link

Validation broken using validation expression age #6112

Closed marikaris closed 6 years ago

marikaris commented 7 years ago

How to Reproduce

Take typetest Put $('birthdate').age().value() == null || ($('birthdate').age().value() >= 0 && $('birthdate').age().value() < 150) in validation expression Try to fill in a date

Expected behavior

Filling in date works fine

Observed behavior

Date is not valid

mswertz commented 7 years ago

Expected behavior not clearly described

dennishendriksen commented 6 years ago

@marikaris Where to put the validation expression?

marikaris commented 6 years ago

@dennishendriksen in the validationExpression column in your EMX file, as is documented here: https://molgenis.gitbooks.io/molgenis/content/user_documentation/ref-emx.html

dennishendriksen commented 6 years ago

Importing advanced_data_example_v20151104.xlsx results in error:

Conversion failure in entity type [root_hospital_patients] attribute [birthdate]; Failed to convert from type [java.lang.String] to type [java.time.LocalDate] for value '1976-13-03'; nested exception is java.time.format.DateTimeParseException: Text '1976-13-03' could not be parsed: Invalid value for MonthOfYear (valid values 1 - 12): 13

which seems correct since the required date format is yyyy-MM-dd.

Fixing the value in the EMX file results in a successful import.

marikaris commented 6 years ago

I will retest it. I cannot recall the issue since I reported it a while ago.