![]() ![]() |
Reference Type: Supported, Category: Name Standardization, ICR#: 3065
The $$NAMEFMT^XLFNAME extrinsic function returns a name converted to a form useful for display.
$$NAMEFMT^XLFNAME(.name[,format][,flags])
.name: |
(required) An array that contains the component parts of the name: NAME("FAMILY) = Family (Last) Name (required) Alternatively, this array can contain the file number, IENS, and field number of the field that contains the name. If the name has a corresponding entry in the NAME COMPONENTS file, then the name components are obtained from that entry. Otherwise, the name is obtained directly from the file, record, and field specified, and (#20)the name components are obtained by making a call to the STDNAME^XLFNAME(): Name Standardization Routine API. NAME("FILE") = Source file number (required) |
format: |
(optional) Controls the general formatting of the output (Default = G). Possible values are:
|
flags: |
(optional) Flags to controls processing. Possible values are:
|
returns: |
Returns the formatted name. |
If the L# flag is used, and the resulting name is longer than #, the following pruning algorithm is performed to shorten the name:
Suppose the MYNAME array contains the following elements:
MYNAME("PREFIX") = "MR." MYNAME("GIVEN") = "SIXTY" MYNAME("MIDDLE") = "K." MYNAME("FAMILY") = "XUUSER" MYNAME("SUFFIX") = "JR" MYNAME("DEGREE") = "PHD"
Then calls to the $$NAMEFMT^XLFNAME API returns the name as follows:
>S X=$$NAMEFMT^XLFNAME(.MYNAME,"F") >W X XUUSER SIXTY K. JR >S X=$$NAMEFMT^XLFNAME(.MYNAME,"F","C") >W X XUUSER,SIXTY K. JR >S X=$$NAMEFMT^XLFNAME(.MYNAME,"F","CS") >W X XUUSER,SIXTY K JR >S X=$$NAMEFMT^XLFNAME(.MYNAME,"F","CSD") >W X XUUSER,SIXTY K JR PHD >S X=$$NAMEFMT^XLFNAME(.MYNAME,"F","CDcXc") >W X XUUSER,SIXTY K., JR, PHD >S X=$$NAMEFMT^XLFNAME(.MYNAME,"F","CSL12") >W X XUUSER,SI K >S X=$$NAMEFMT^XLFNAME(.MYNAME,"F","CMD") >W X Krnuser,Sixty K. Jr PhD >S X=$$NAMEFMT^XLFNAME(.MYNAME,"G") >W X SIXTY K. XUUSER JR >S X=$$NAMEFMT^XLFNAME(.MYNAME,"G","D") >W X SIXTY K. XUUSER JR PHD >S X=$$NAMEFMT^XLFNAME(.MYNAME,"G","Dc") >W X SIXTY K. XUUSER JR, PHD >S X=$$NAMEFMT^XLFNAME(.MYNAME,"G","P") >W X MR. SIXTY K. XUUSER JR >S X=$$NAMEFMT^XLFNAME(.MYNAME,"G","Xc") >W X SIXTY K. XUUSER, JR >S X=$$NAMEFMT^XLFNAME(.MYNAME,"G","PDcXc") >W X MR. SIXTY K. XUUSER, JR, PHD >S X=$$NAMEFMT^XLFNAME(.MYNAME,"G","PDcXcM") >W X Mr. Sixty K. Krnuser, Jr, PhD >S X=$$NAMEFMT^XLFNAME(.MYNAME,"G","S") >W X SIXTY K XUUSER JR >S X=$$NAMEFMT^XLFNAME(.MYNAME,"G","SL12") >W X SI K XUUSER >S X=$$NAMEFMT^XLFNAME(.MYNAME,"O") >W X XUUSER >S X=$$NAMEFMT^XLFNAME(.MYNAME,"O","S") >W X XUUSER >S X=$$NAMEFMT^XLFNAME(.MYNAME,"O","M") >W X Xuuser >S X=$$NAMEFMT^XLFNAME(.MYNAME,"O","L3") >W X XU |
If an entry in the NAME COMPONENTS (#20) file stores the components of a name stored in the NAME (#.01) field of record number 32 in the NEW PERSON (#200) file, and the data in the corresponding record in the NAME COMPONENTS (#20) file is:
FILE = 200 FIELD = .01 IENS = "32," PREFIX = "MR." GIVEN NAME = "SIXTY" MIDDLE NAME = "K." FAMILY NAME = "XUUSER" SUFFIX = "JR" DEGREE = "PHD"
You can set:
MYNAME("FILE")=200 MYNAME("FIELD")=.01 MYNAME("IENS")="32,"
Then call the $$NAMEFMT^XLFNAME API, as in Example 1, to return the name in various formats.