Print Page as PDF
Database Server API: Lookup Utilities ICR (2051)

Database Server API: Lookup Utilities    ICR (2051)

Name Value
NUMBER 2051
IA # 2051
DATE CREATED 1997/07/02
CUSTODIAL PACKAGE VA FILEMAN
CUSTODIAL ISC San Francisco
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE DIC
NAME Database Server API: Lookup Utilities
GENERAL DESCRIPTION
Lookup utilities.

FIND: Finder $$FIND1: Finder (Single Record) LIST: Lister
STATUS Active
ID DIC
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
FIND()
This procedure finds records in a file based on an
input value.

Format FIND^DIC(FILE,IENS,FIELDS,FLAGS,VALUE,NUMBER,INDEXES,SCREEN,IDENTIFIER,
TARGET_ROOT,MSG_ROOT)
VARIABLES TYPE VARIABLES DESCRIPTION
FILE Input
(Required) This parameter is the number of the file
or subfile to search.  If it is a subfile, it must be accompanied by the IENS
parameter.
IENS Input
(Optional) The IENS that identifies the subfile if
FILE is a subfile number. Defaults to no subfile.
FIELDS Input
(Optional) The fields to return with each entry
found, in addition to the .01 field, internal entry number, and any MUMPS
identifiers on the file.  Defaults to returning the internal entry number, the
.01 field, and all identifiers.
FLAGS Input
(Optional) This parameter lets the caller adjust the
Finder's algorithm.  The possible values are:

A Allow pure numeric input to always be tried as an IEN.  M Multiple index
lookup allowed.  O Only find exact matches if possible.  Q Quick lookup.  X
EXact matches only.
VALUE Input
(Required) The lookup value.
NUMBER Input
(Optional) The maximum number of entries to find.
INDEXES Input
(Optional) The indexes the Finder should search for
matches.
SCREEN Input
(Optional) A screen to apply to each record found.
IDENTIFIER Input
(Optional) The text to accompany each found entry to
help identify it to the end user.
TARGET_ROOT Both
(Optional) The array that should receive the output
list of found entries.

If not specified, the default location is descendent from
^TMP("DILIST",$J).  When the calling application is finshed with the data the
^TMP("DILIST",$J) array may be killed.
MSG_ROOT Both
(Optional) The array that should receive any error
messages.
$$FIND1()
This extrinsic function finds a single record in a
file based on an input value; if more than one match is found, the function
returns an error.

Format $$FIND1^DIC(FILE,IENS,FLAGS,VALUE,INDEXES,SCREEN,MSG_ROOT)
VARIABLES TYPE VARIABLES DESCRIPTION
FILE Input
(Required) This parameter should be the number of the
file or subfile to search. If it is a subfile, it must be accompanied by the
IENS parameter.
IENS Input
(Optional) The IENS that identifies the subfile if
FILE is a subfile number.
FLAGS Input
(Optional) This parameter lets the caller adjust the
Finder's algorithm.

The possible values are:

A Allow pure numeric input to always be tried as an IEN.              M
Multiple index lookup allowed.                                   O Only find
exact matches if possible.                                    Q Quick lookup.
X EXact matches only.

VALUE Input
(Required) The lookup value.
INDEXES Input
(Optional) The indexes the Finder should search for a
match.
SCREEN Input
(Optional) A screen to apply to the record found.
MSG_ROOT Both
(Optional) The array that should receive any error
messages.
LIST()
This procedure, expected to be used to populate a GUI
Listbox gadget, retrieves a list of records from a file.

Format LIST^DIC(FILE,IENS,FIELDS,FLAGS,NUMBER,[.]FROM,PART,INDEX,SCREEN,
IDENTIFIER,TARGET_ROOT,MSG_ROOT)
VARIABLES TYPE VARIABLES DESCRIPTION
FILE Input
(Required) The file whose entries are to be listed.
This should equal the file or subfile number, depending on what the caller
wishes to list.
IENS Input
(Optional) If the FILE parameter equals a file
number, don't pass the IENS parameter; it is not needed. If, on the other
hand, the FILE parameter equals a subfile number, the Lister needs the IENS
parameter to help identify which subfile to list.
FIELDS Input
(Optional) The fields to return with each entry in
the list instead of the field identifiers otherwise returned.
FLAGS Input
(Optional) Flags to control processing:

B Backwards. (Defaults to traversing forward.)  I Internal format is returned.
NUMBER Input
(Optional) The number of entries to return.
[.]FROM Both
Optional) The index entry from which to begin the
list (e.g., a FROM value of "XQ" would list entries following XQ).
PART Input
(Optional) The partial match restriction.
INDEX Input
(Optional) The index from which to build the list.
Defaults to "B".
SCREEN Input
(Optional) The screen to apply to each potential
entry in the returned list to decide whether or not to include it.

This code can rely upon the following:

Naked indicator Zero-node of entry's record.  D Index being traversed.  DIC
Number of file being traversed.  DIC(0) Flags passed to the Lister
(direction).  Y Record number of entry under consideration.  Y() array For
subfiles, descendants give record numbers for all upper levels. Structure
resembles DA.  Y1 IENS equivalent to Y array.
IDENTIFIER Input
(Optional) The text to accompany each potential entry
in the returned list to help identify it to the end user.
TARGET_ROOT Both
(Optional) The array that should receive the output
list.
MSG_ROOT Both
(Optional) The array that should receive any error
messages.