![]() ![]() |
Reference Type: Supported, Category: Name Standardization, ICR#: 3065
The $$HLNAME^XLFNAME extrinsic function converts an input name to an HL7 formatted name.
$$HLNAME^XLFNAME([.]name[,flags][,delim])
[.]name: |
(required) The component parts of the name to be converted: 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 (#20) file, then the name components are obtained from that entry. Otherwise, the name is obtained directly from the file, record, and field specified, and the name components are obtained by making a call to the STDNAME^XLFNAME(): Name Standardization Routine API. NAME("FILE") = Source file number (required) Another alternative is to pass in the unsubscripted NAME parameter the name to be converted. $$HLNAME^XLFNAME obtains the components parts of that name by making a call to the STDNAME^XLFNAME(): Name Standardization Routine API. This alternative is recommended only for names that do not have associated entries on the NAME COMPONENTS (#20) file. |
flags: |
(optional) Flags to controls processing. Possible values are:
|
delim: |
(optional) The delimiter to use in the HL7 string (default is ^). |
returns: |
Returns the converted name in HL7 format. |
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") = "KRNUSER" MYNAME("SUFFIX") = "JR" MYNAME("DEGREE") = "PHD"
Then calls to the $$HLNAME^XLFNAME API returns the name as follows:
>S X=$$HLNAME^XLFNAME(.MYNAME) >W X KRNUSER^SIXTY^K.^JR^MR.^PHD >S X=$$HLNAME^XLFNAME(.MYNAME,"","~") >W X KRNUSER~SIXTY~K.~JR~MR.~PHD >S X=$$HLNAME^XLFNAME(.MYNAME,"S","~") >W X KRNUSER~SIXTY~K~JR~MR~PHD >S X=$$HLNAME^XLFNAME(.MYNAME,"L12S") >W X KRNUSER^SI^K |
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 = "KRNUSER" SUFFIX = "JR" DEGREE = "PHD"
You can set:
MYNAME("FILE") = 200 MYNAME("FIELD") = .01 MYNAME("IENS") = "32,"
Then call the $$HLNAME^XLFNAME API, as in Example 1, to return the name in various formats.
Convert a name passed by value to HL7 format:
>S X=$$HLNAME^XLFNAME("KRNUSER,SIXTY HOWARD II" >W X KRNUSER^SIXTY^HOWARD^II >S X=$$HLNAME^XLFNAME("KRNUSER,SIXTY HOWARD II","S") >W X KRNUSER^SIXTY^HOWARD^II >S X=$$HLNAME^XLFNAME("KRNUSER,SIXTY HOWARD II","SL10","~") >W X KRNUSER~S~H |