Kernel 8.0 APIs Banner
Office of Information and Technology (OIT) Banner
[skip navigation]

$$CLEANC^XLFNAME(): Name Component Standardization Routine

Reference Type: Supported, Category: Name Standardization, ICR#: 3065

Description

The $$CLEANC^XLFNAME extrinsic function takes a single name component and returns that name in standard format.

Format

  $$CLEANC^XLFNAME(comp[,flags])

Input Parameters

comp:

(required) The name component to be converted to standard format.

flags:

(optional) Flag to control processing. Possible values are:

  • F—If the name component to be converted is the FAMILY (LAST) NAME, pass the F flag. With the F flag:

    • Colons (:), semicolons (;), and commas (,) are converted to hyphens (-).

    • Spaces and all punctuation except hyphens are removed.

    • Two or more consecutive spaces or hyphens are replaced with a single space or hyphen.

    • Birth position indicators 1ST through 10TH are changed to their Roman numeral equivalents.

  • NULL—Without the F flag:

    • The component is converted to uppercase.

    • Colons (:), semicolons (;), commas (,), and periods (.) are converted to spaces.

    • All punctuation except for hyphens and spaces are removed.

    • Two or more consecutive spaces or hyphens are replaced with a single space or hyphen.

    • Birth position indicators 1ST through 10TH are changed to their Roman numeral equivalents.

Output

returns:

Returns the standard formatted name.

Examples

Example 1

Standardize family (last) name:

>Set X=$$CLEANC^XLFNAME("KRNUSER-XU U SER","F")

>W X
KRNUSER-XUUSER
>Set X=$$CLEANC^XLFNAME("KRNUSER-XU U SER 2ND","F")

>W X
KRNUSER-XUUSERII
>Set X=$$CLEANC^XLFNAME("KRNUSER-XU U SER")

>W X
KRNUSER-XU U SER
>Set X=$$CLEANC^XLFNAME("ST. USER","F")

>W X
STUSER

Example 2

Standardize other (non-family) name components:

>S X=$$CLEANC^XLFNAME("F.O.")

>W X
F O
>S X=$$CLEANC^XLFNAME("FORTY'")

>W X
FORTY
>S X=$$CLEANC^XLFNAME("FORTY ONE")

>W X
FORTY ONE
>S X=$$CLEANC^XLFNAME("FORTY-ONE")

>W X
FORTY-ONE