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

$$FMNAME^XLFNAME(): Convert HL7 Formatted Name to Name

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

Description

The $$FMNAME^XLFNAME extrinsic function converts an HL7 formatted input name to a VistA formatted name.

Format

  $$FMNAME^XLFNAME([.]name[,flags][,delim])

Input Parameters

[.]name:

(required) This is the HL7 name to be converted; it can be passed by reference. If the C flag is used, the name components are returned in nodes descendent from this parameter (see "Output").

flags:

(optional) Flags to controls processing. Possible values are:

  • C—Return name components in the NAME array (see Output).

  • L#—Truncate the returned name to a maximum Length of # characters, where # is an integer between 1 and 256.

  • M—Return the name in mixed case, with the first letter of each name component capitalized.

  • S—Return the name in standardized form.
delim:

(optional) The delimiter used in the HL7 formatted name (default = ^).

Output Parameters

name:

If the flags input parameter contains a C, the component parts of the name are returned in the NAME array:

    NAME("FAMILY) = Family (Last) Name
NAME("GIVEN") = Given (First) Name(s)
NAME("MIDDLE") = Middle Name(s)
NAME("SUFFIX") = Suffix(es)

Details

If the L# flag is used, and the resulting name is longer than #, the following pruning algorithm is performed to shorten the name:

  1. Truncate Middle Name from the right-most position until only the initial character is left.

  2. Drop suffix.

  3. Truncate Given Name from the right-most position until only the initial character is left.

  4. Truncate Family Name from the right-most position.

  5. Truncate the name from the right.

 

Examples

Example 1

Convert an HL7 formatted name to a VistA name:

>S X=$$FMNAME^XLFNAME("XUUSER^SIXTY^K.^JR^MR.^PHD")

>W X
XUUSER,SIXTY K. JR

 
>S X=$$FMNAME^XLFNAME("XUUSER^SIXTY^K.^JR^MR.^PHD","S")

>W X
XUUSER,SIXTY K JR

 
>S X=$$FMNAME^XLFNAME("XUUSER^SIXTY^K.^JR^MR.^PHD","M")

>W X
Xuuser,Sixty K. Jr

 
>S X=$$FMNAME^XLFNAME("XUUSER^SIXTY^K.^JR^MR.^PHD","SL12")

>W X
XUUSER,SI K

Example 2

Convert an HL7 formatted name where the tilde character (~) is the delimiter to a standard name:

>S X=$$FMNAME^XLFNAME("XUUSER~SIXTY~K.~JR~MR","S","~")

>W X
XUUSER,SIXTY K JR

Example 3

Convert an HL7 formatted name to a standard name, and return the components of that name in the MYNAME array:

>S MYNAME="XUUSER^SIXTY^K.^JR^MR.^PHD"

>W $$FMNAME^XLFNAME(.MYNAME,"CS")
XUUSER,SIXTY K JR

>ZW MYNAME
MYNAME=XUUSER^SIXTY^K.^JR^MR.^PHD
MYNAME("DEGREE")=PHD
MYNAME("FAMILY")=XUUSER
MYNAME("GIVEN")=SIXTY
MYNAME("MIDDLE")=K.
MYNAME("PREFIX")=MR.
MYNAME("SUFFIX")=JR