I have a Policy Number of pattern:- AB-1234567-PAD; the Product Code is last 3 characters (PAD) of the Policy number.
With my code, I am now successfully extracting the Product Code (PAD) for given format of the policy number. But now I need to check the extracted Product Code(PAD) against the list of Product codes available. Currently, I am using STRINGLIST
, which has list of product codes. But I don't know how to check whether the extracted Product Code has a match in the List of available Product codes.
Below is my code:
PACKAGE uima.ruta.example;
Document{->RETAINTYPE(SPACE)};
DECLARE Annotation ProdCode;
"(?i)\\b(?=.*\\d)[1]{0,1}[A-Z0-9]{2}[\\s |-]{0,2}[A-Z0-9]{7}[\\s |-]{0,2}([A-Z]{3})\\b"->1 = ProdCode; //<-Previously ProdCode was replaced with EntityType to get last 3 chars of given REGEX
STRINGLIST CustomSL = {"PLB","PAD"};
ProdCode{INLIST(CustomSL)->MARK(EntityType)}; //<- Requesting your help here!
Ex 1:
Input:
The policy number is 1A-AB12345-PAD.
Expected output:
PAD
Ex 2:
Input:
The policy number is 1A-AB12345-PAN
.Expected output: Entity should not be recognized since PAN is not exist in given STRINGLIST