XLFNAME7 ;BPOIFO/KEITH - NAME STANDARDIZATION ; 27 Jan 2002 11:05 PM ;;8.0;KERNEL;**343**; Jul 10, 1995; ; FORMAT(XUNAME,XUMINL,XUMAXL,XUNOP,XUCOMA,XUAUDIT,XUFAM,XUDNC) ;Format name value ;Input: XUNAME=text value representing person name to transform ; XUMINL=minimum length (optional), default 3 ; XUMAXL=maximum length (optional), default 30 ; XUNOP=1 to standardize last name for 'NOP' x-ref ; (for the PAITNE file). (optional) ; XUCOMA=0 to not require a comma ; 1 to require a comma in the input value ; 2 to add a comma if none ; 3 to prohibit (remove) commas ; (optional) default if not specified is 1 ; ; XUAUDIT=variable to return audit, pass by reference (optional), ; returned values: ; XUAUDIT=0 if no change was made ; 1 if name is changed ; 2 if name could not be converted ; XUAUDIT(1) defined if name contains no comma ; XUAUDIT(2) defined if parenthetical text is removed ; XUAUDIT(3) defined if value is unconvertible ; XUAUDIT(4) defined if characters are removed or changed ; XUFAM='1' if just the family name, '0' otherwise (optional) ; XUDNC='1' to prevent componentization (optional) ; ='2' to return components before standardize ; ;Output: XUNAME in specified format or null if length of transformed value is less than XUMINL ; N XUX,XUOX,XUOLDN,XUAX,XUI,XUNEWN ;Initialize variables K XUAUDIT S XUOLDN=XUNAME M XUX=XUNAME S XUDNC=$G(XUDNC) D COMP^XLFNAME8(.XUX,.XUDNC) S XUMINL=+$G(XUMINL) S:XUMINL<1 XUMINL=3 S XUMAXL=+$G(XUMAXL) S:XUMAXL