Hi fellow CHT members,
I created a test form containing the Age field and added length and range validations for it but the code only seems to check for the type of the age field, during the parsing of the message.
Hence the only place to validate these seem to be when running registration triggers by adding validations there.
Was this intended? I believe, as much as possible we should fail fast and fail early. Please kindly advise.
Sample form config below.:
"NP": {
"meta": {
"code": "NP",
"translation_key": "forms.np.title",
"label": {
"en": "Just age and name"
}
},
"fields": {
"patient_age": {
"labels": {
"tiny": {
"en": "Person Age"
},
"short": {
"en": "Person Age"
}
},
"position": 0,
"type": "integer",
"length": [
1,
3
],
"range": [
0,
125
],
"required": true
},
"patient_name": {
"labels": {
"tiny": {
"en": "patient_name"
},
"description": {
"en": "Patient name"
},
"short": {
"en": "Patient name"
}
},
"position": 1,
"type": "string",
"length": [
3,
30
],
"required": true
}
},
"public_form": false,
"use_sentinel": true
}