Modifying PAT file

Infosphere's Quality Product

Moderators: chulett, rschirm

Post Reply
shails
Participant
Posts: 27
Joined: Mon Jul 18, 2005 2:55 am

Modifying PAT file

Post by shails »

I created a custom rule set based out of USNAME ruleset for name standardization. Input to the ruleset must be in this format - ZQ,FirstName,ZQ,MiddleInitial,ZQ,LastName

When I pass repeated words to FirstName column, I see that the spaces are not preserved.
For example, if I pass input string - "ZQ,AB BB CR,ZQ,J,ZQ,LARRY", the ruleset gives "AB BB CR" in the FirstName output column. But when I pass a input string "ZQ,AB AB CR,ZQ,J,ZQ,LARRY" I see that the output is "AB ABCR" with the space between AB and CR removed.

Can someone help me to identify what I am missing in the patterns. I am unable to figure out where to check for this.
Last edited by shails on Mon Mar 19, 2012 9:52 pm, edited 1 time in total.
stuartjvnorton
Participant
Posts: 527
Joined: Thu Apr 19, 2007 1:25 am
Location: Melbourne

Post by stuartjvnorton »

Without knowing anything else about your ruleset, it will be a little tricky to help you out too much.

At a guess, either AB or BB are a recognised term in the CLS file, or they are both recognised but as different types.
So your 2 examples would probably be processed using different patterns. (You are aware that your 2 examples don't match your specified format? I'm assuming it's just a typo)

Are you copying each token over individually in the action block?
If so maybe you are missing a

CONCAT " " temp

between the 2nd and 3rd tokens.


As for checking this stuff, you either manually follow it through the PAT file, or you add some comments to tell which patterns were hit as you run your ruleset.
shails
Participant
Posts: 27
Joined: Mon Jul 18, 2005 2:55 am

Post by shails »

Hi Staurt,

Thanks for your reply. I modified my original post with correct input data.

This is happening only when the first 2 words in the firstname are same. I checked my classification table and lookup tables and I dont see any terms matching the formats AB/BB.

I see spaces added after each word in the patterns. I am pasting the code which processes FirstName here. Hope this explains.


!Z | !Z | + | !Z | Z
COPY [1] Temp
CONCAT " " Temp
CONCAT [2] Temp
CONCAT " " Temp
CONCAT [3] Temp
CONCAT " " Temp
CONCAT [4] Temp
COPY Temp {FirstName}
RETYPE [1] 0
RETYPE [2] 0
RETYPE [3] 0
RETYPE [4] 0
RETYPE [5] 0
RETURN

!Z | !Z | F | !Z | Z
COPY [1] Temp
CONCAT " " Temp
CONCAT [2] Temp
CONCAT " " Temp
CONCAT [3] Temp
CONCAT " " Temp
CONCAT [4] Temp
COPY Temp {FirstName}
RETYPE [1] 0
RETYPE [2] 0
RETYPE [3] 0
RETYPE [4] 0
RETYPE [5] 0
RETURN

& | !Z | !Z | Z
COPY [1] Temp
CONCAT " " Temp
CONCAT [2] Temp
CONCAT " " Temp
CONCAT [3] Temp
COPY Temp {FirstName}
RETYPE [1] 0
RETYPE [2] 0
RETYPE [3] 0
RETYPE [4] 0
RETURN

& | !Z | Z
COPY [1] Temp
CONCAT " " Temp
CONCAT [2] Temp
COPY Temp {FirstName}
RETYPE [1] 0
RETYPE [2] 0
RETYPE [3] 0
RETURN

& | Z
COPY [1] {FirstName}
RETYPE [1] 0
RETYPE [2] 0
RETURN
stuartjvnorton
Participant
Posts: 527
Joined: Thu Apr 19, 2007 1:25 am
Location: Melbourne

Post by stuartjvnorton »

A few more questions:

What is the InputPattern for each of your examples?

Have you written any other pattern/action blocks? Ones that start with the Z for the leading delimiter? Or have you removed it earlier?
With nothing further to go on, I can't see how any of those patterns are being triggered.
shails
Participant
Posts: 27
Joined: Mon Jul 18, 2005 2:55 am

Post by shails »

Here is the code under input patterns.

*.
CALL Periods

0*. ;
RETYPE [1] 0

0*, ;
RETYPE [1] 0

*- | - |
RETYPE [1] 0

*W="NURSE" | W="PRACTITIONER"
RETYPE [1] S "NP" "NP"
RETYPE [2] 0

*- | S | - | $ ; ; -ARNP-
RETYPE [1] 0
RETYPE [3] 0

*- | S | $ ; ; -ARNP
RETYPE [1] 0

*S="MD","NP","APRN","PAC","DO" | - | + | $
RETYPE [2] 0
RETYPE [3] 0

*S | - | I="C" ;
COPY [1] Temp
CONCAT [3] Temp
RETYPE [1] S Temp Temp
RETYPE [2] 0
RETYPE [3] 0

*I="C" | - | S ;
COPY [1] Temp
CONCAT [3] Temp
RETYPE [1] S Temp Temp
RETYPE [2] 0
RETYPE [3] 0

*S | I="C" ;
COPY [1] Temp
CONCAT [2] Temp
RETYPE [1] S Temp Temp
RETYPE [2] 0

*I="C" | S ;
COPY [1] Temp
CONCAT [2] Temp
RETYPE [1] S Temp Temp
RETYPE [2] 0

*&="-" |&="("
RETYPE [1] 0

*!Z | - | !Z | - | !Z
COPY [1] Temp
CONCAT [2] Temp
CONCAT [3] Temp
CONCAT [4] Temp
CONCAT [5] Temp
RETYPE [1] + Temp Temp
RETYPE [2] 0
RETYPE [3] 0
RETYPE [4] 0
RETYPE [5] 0

*!Z | - | !Z | - | !Z
COPY [1] Temp
CONCAT [2] Temp
CONCAT [3] Temp
CONCAT [4] Temp
CONCAT [5] Temp
RETYPE [1] + Temp Temp
RETYPE [2] 0
RETYPE [3] 0
RETYPE [4] 0
RETYPE [5] 0

*!Z | &="-","'","/" | !Z
COPY [1] Temp
CONCAT [2] Temp
CONCAT [3] Temp
RETYPE [1] + Temp Temp
RETYPE [2] 0
RETYPE [3] 0

*!Z | &="-","'","/" | !Z
COPY [1] Temp
CONCAT [2] Temp
CONCAT [3] Temp
RETYPE [1] + Temp Temp
RETYPE [2] 0
RETYPE [3] 0

*&="(" | & | & | &=")"
COPY [2] Temp
CONCAT " " Temp
CONCAT [3] Temp
RETYPE [2] + Temp Temp
RETYPE [3] 0

*&="(" | G | &=")"
RETYPE [1] 0
RETYPE [3] 0

*&="(" | S | &=")"
RETYPE [1] 0
RETYPE [3] 0

*&="(" | P | &=")"
RETYPE [1] 0
RETYPE [3] 0

*&="(" | & | & | & | & | &=")"
RETYPE [1] 0
RETYPE [2] 0
RETYPE [3] 0
RETYPE [4] 0
RETYPE [5] 0
RETYPE [6] 0

*&="(" | & | & | & | &=")"
RETYPE [1] 0
RETYPE [2] 0
RETYPE [3] 0
RETYPE [4] 0
RETYPE [5] 0

*&="(" | & | & | &=")"
RETYPE [1] 0
RETYPE [2] 0
RETYPE [3] 0
RETYPE [4] 0

*&="(" | & | & | &=")"
RETYPE [1] 0
RETYPE [2] 0
RETYPE [3] 0
RETYPE [4] 0

*&="(" | & | &=")"
RETYPE [1] 0
RETYPE [2] 0
RETYPE [3] 0

*&="(" | & | &=")"
RETYPE [1] 0
RETYPE [2] 0
RETYPE [3] 0

*&="(" | &=")"
RETYPE [1] 0
RETYPE [2] 0



Whatever pattern actions I specified earlier are used for FirstName. I have some more patterns mentioned for other columns.
Post Reply