Metadata for string data that may include canonical numbers
Final Release Note
The functions XREFDATA^%YDBAIM() and UNXREFDATA^%YDBAIM take an additional parameter force. With a nonzero force parameter, AIM prefixes the cross reference of each data item with a hash ("#"), forcing the cross references to use string collation. An application using $ORDER() to step through a cross reference built with a nonzero length force will need to strip that hash prefix, e.g., if x is the variable used for the $ORDER() calls, the actual subscripts are ZEXTRACT(x,2,ZLENGTH(x)). This is useful when a data item can include non-canonic numbers, then strings, e.g., US zip codes, which can have leading zeroes.
If unspecified, or zero, the default collation continues to be used, i.e., first the null subscript, then canonic numbers, then strings.
The parameter list for both functions is therefore (gbl,xsub,sep,pnum,nmonly,zpiece,omitfix,stat,type,force).
Description
As noted in Key-fix/Optimize WHERE COLUMN > LITERAL (>, >=, <, <=) just like COLUMN = LITERAL case, the optimization is disabled for string data where the string may include canonical numbers; zip codes being the obvious example. While application data cannot be changed, AIM and Octo can collaborate to enable optimization.
Initial Release Note
The type parameter of XREFDATA^%YDBAIM() consists of two comma separated pieces. The first piece is the Application Schema Type, defaulting to zero if omitted. The second piece consists of zero or more piece numbers. Each piece number can be a single number, or a colon separated range of numbers, e.g., ",2;4:6;9" tells AIM that the schema is the default type 0 schema, and that pieces 2, 4, 5, 6, and 9 may have values that mix canonical numbers, and strings (including non-canonical numbers). In cross referencing those pieces, AIM prefixes each cross-referenced value with a "#" which forces canonical number values in application data to be cross referenced as strings. For columns in Octo that are labeled MAYBE_CANONIC Octo strips the leading "#" when accessing the underlying global nodes, and displaying the values. This enables Octo to optimize searching for such data.