Detailed Description of Get Person Type
Determines the person type based on the input personType.
If the input personType is not specified and icoRc is
specified, the personType is determined from icoRc.
The following rules apply:
- If the icoRc string
contains only digits and its length is 8 characters, then it is considered
as a CRN.
- If the icoRc string
contains only digits and its length is 9 characters and the first
two digits form a number smaller than 54, then it is considered
as a birth number.
- If the icoRc string
contains only digits and its length is 10 characters and the first
two digits form a number greater than 53, then it is considered
as a birth number.
- If the icoRc contains
six digits followed by either a '\' or '/' and
then by 3 digits and the first two digits form a number smaller
than 54, then it is considered as a birth number.
- If the icoRc contains
six digits followed by either a '\' or '/' and
then by 4 digits and the first two digits form a number greater
than 53, then it is considered as a birth number.
- If the icoRc is
a date in some of the supported forms: [d]d<x>[m]m<x>yy, [d]d<x>[m]m<x>yyyy where
<x> could be '.' , '-' , '/' or '\' then
it is considered as a birth number.
- In any other
case the icoRc string is considered to be neither
birth number nor CRN.
If the icoRc string is considered as a CRN,
the person type will be determined as personTypeWhenLegal,
if the icoRc string is considered as a birth number,
the person type will be determined as personTypeWhenNatural.