Can someone help in the validation on CommCare for checking whether the "7th digit" of a South African ID number is greater than 5 (to allow us to flag Male vs Female).
I want to restrict the ID number question to only allow males, hence, the 7th digit needs to be greater or equal to 5.
For example, the South African ID number is in the format of YYMMDDSSSSCAZ
ID Number 7th digit Gender
9901295674083 5 Male
9901290674083 0 Female
9901287674081 7 Male
I want to flag this on CommCare and not allow the Data capturer to proceed until the correct value is entered. I can easily do this on Excel, SQL or PowerBI but we want to prevent this from being captured on CommCare.
Also, in many cases we don't have full ID numbers being captured (i.e. the full 13 digits) due to many patients not coming though to clinics with their IDs and rather they present themselves with affidavits showing just their DOB. So in those cases, we are obliged to allow them to proceed and capture only the DOB as an ID number. Hence, the validation for the gender should only be applicable when the string-length is greater than 6.
Hope someone is able to assist. I have tried a few expressions but none has worked.