MEDITECH Code of the Month - MIS Facility F9 Lookup by Database
[MEDITECH MIS Facility F9 Lookup by Database]
@FACILITY.LIST.BY.DATABASE,
; A - name of file
; B - default value
; C - header string
; D - string to display
; E - ID.ARG
; F - Title
^/FACILITY^/A,
A^/B,
("Facility":12L)_("Name":30L)^/TITLE^/C,
"CD:12L_"_@Quote(@MIS.FACILITY.name[CD])^/DATA.FIELDS^/D,
"BR"^/E,
"Facility"^/F,
{"N","","","Y"}^/G,
@LOOKUP.KEY.PRESS^@KEY.PRESSED.LAST,
IF{@MIS.FACILITY.main[/B]DB[/(.S).DB^MIS.FACILITY.database] %Z.id(/A,/B,/C,/D,/E,/F,/G);
%Z.id.lookup(/A,/B,/C,/D,/E,/F,/G)}^/FACILITY,
/FACILITY;
LOOKUP.KEY.PRESS
144
KEY.PRESSED.LAST
/Z
FACILITY.LIST.BY.DATABASE
"/FACILITY"^@KILL.STRUCTURE,
@.db^MIS.FACILITY.database,
""^MIS.FACILITY.mnemonic,
DO{@Next(MIS.FACILITY.mnemonic,MIS.FACILITY.database.x) .,
1^/FACILITY[MIS.FACILITY.mnemonic]|1},
1
KILL.STRUCTURE
/ARRAY.NAME,
IF{/ARRAY.NAME#0="/" /ARRAY.NAME%0^/ARRAY.NAME},
""^Q,
DO{>/[/ARRAY.NAME,Q]^Q ""^/[/ARRAY.NAME,Q]}
Want an alert when the next post is published? Click the phone and Subscribe to the MEDITECH Reports Blog!