LR425 ;ALB/GTS - LR*5.2*425 KIDS POST-INIT ROUTINE ;09/28/2012 11:25
 ;;5.2;LAB SERVICE;**425**;Sep 27, 1994;Build 30
 ;
 ;
 ;Environment check for LSRP: ENSTART, CHK4LSRP, LSRPEX and Call Environment check in LR*425
ENSTART ; -- Generic Lab environment check
 ; May prevent loading of the transport global.
 ; Environment check is done only during the install.
 ;
 N LRMSG,LAPOS,LRALST,MSG,BAD,LSRPEND,X
 S LSRPEND="N/A"
 S XPDNOQUE=1 ;no queuing
 S LAPOS=$G(IOM,80) S:LAPOS<1 LAPOS=80
 D LMES($$CJ^XLFSTR("***"_$S('$G(XPDENV):" 'Transport Global Load'",1:" 'Installation'")_" Environment Check started ***",LAPOS),1,"B")
 ;
 ; Check for LMI mailgroup
 D LMES("'LMI' Mail Group must exist.",10,"B")
 D LMES("Checking for 'LMI' Mail Group...",15)
 S X=$$FIND1^DIC(3.8,,"BOQUX","LMI","B","","LAMSG")
 I 'X D  Q  ;QUIT/Abort if LMI Mailgroup is not defined
 . D LMES("Mail Group (#3.8) 'LMI' does not exist.",20)
 . D LMES($$CJ^XLFSTR("* * *  Environment failed.  Aborting.  * * *",LAPOS),1,"B")
 . S XPDABORT=2 ; Leave transport global
 . D LSRPEX
 E  D 
 . D LMES("'LMI' Mail Group exists.",20)
 . D LMES("Continuing...",25)
 ;
 I '$G(XPDENV) D  Q  ;QUIT if Loading Distribution
 . NEW LRC383,LAC75,LRP393,LAP76
 . SET MSG="Distribution for '"_$G(XPDNM,"Unknown patch")_"' loaded "_$$HTE^XLFDT($H)
 . DO LMES(" ",1)
 . DO LMES("Sending distribution loaded alert...",7,"B")
 . DO ALERT(MSG)
 . SET LRC383=$$PATCH^XPDUTL("LR*5.2*383")
 . SET LAC75=$$PATCH^XPDUTL("LA*5.2*75")
 . SET LRP393=$$PATCH^XPDUTL("LR*5.2*393")
 . SET LAP76=$$PATCH^XPDUTL("LA*5.2*76")
 . SET LSRPEND=(LRC383!LAC75!LRP393!LAP76)
 . DO LSRPEX
 ;
 ;Continue if $G(XPDENV) - Installation underway, Check for LSRP
 D LMES("Sending install started alert...",7,"B")
 S MSG="Installation of '"_$G(XPDNM,"Unknown patch")_"' started "_$$HTE^XLFDT($H)
 D ALERT(MSG)
 ;
 D CHK4LSRP
 D LSRPEX
 Q
 ;
CHK4LSRP ; [During Installation...] Check if LSRP is installed at site, do NOT install over LSRP
 NEW LRC383,LAC75,LRP393,LAP76
 SET LRC383=$$PATCH^XPDUTL("LR*5.2*383")
 SET LAC75=$$PATCH^XPDUTL("LA*5.2*75")
 SET LRP393=$$PATCH^XPDUTL("LR*5.2*393")
 SET LAP76=$$PATCH^XPDUTL("LA*5.2*76")
 IF (LRC383!LAC75!LRP393!LAP76) DO  ;LSRP Site?
 . NEW LRMGR,LROVRD
 . DO OWNSKEY^XUSRB(.LRMGR,"LRJ CERNER MGR")
 . DO OWNSKEY^XUSRB(.LROVRD,"LRJ CERNER OVERRIDE")
 . IF ($G(LRMGR(0))=0)!($G(LROVRD(0))=0) DO  ;Hold LRJ CERNER MGR & LRJ CERNER OVERRIDE keys?
 . . SET XPDABORT=1
 . . SET BAD=1
 . . SET BAD(1)="**  LSRP is installed at this site!!  **"
 . . SET BAD(2)="All Lab (LR/LA namespaced) patches must be installed by the LSRP Triage team."
 . ELSE  DO
 . . NEW DIR,X,Y,DTOUT,DIRUT,DUOUT,LROK
 . . WRITE !
 . . SET DIR(0)="Y"
 . . SET DIR("A",1)="You are installing a Legacy Lab patch at a LSRP Site."
 . . SET DIR("A",2)="The LSRP Triage Team should be coordinating this installation."
 . . SET DIR("A",3)="If LSRP Triage is NOT coordinating, DO NOT INSTALL THIS PATCH!"
 . . SET DIR("A")="Do you want to install"
 . . SET DIR("B")="NO"
 . . SET DIR("?",1)="You have the privileges to install this patch."
 . . SET DIR("?",2)="Installing means LSRP Triage has determined if this patch will"
 . . SET DIR("?")="overwrite LSRP system structures and how to address the conflicts."
 . . DO ^DIR
 . . SET LROK=+Y
 . . SET LSRPEND='+Y
 . . IF 'LROK DO
 . . . SET XPDABORT=1
 . . . DO LMES("Installer with DUZ: "_DUZ_" defering to LSRP Triage.",20,"B")
 . . . DO:$G(XPDENV) LMES("Installation will stop and remove global.",25)
 . . . DO LMES($$CJ^XLFSTR("* * *  Install stopped during Environment check.  * * *",LAPOS),1,"B")
 Q
 ;
LSRPEX ; LSRP Exit message for Install log
 NEW LAPOS,MSG
 SET LAPOS=$G(IOM,80) S:LAPOS<1 LAPOS=80
 IF $G(XPDQUIT)!$G(XPDABORT) DO  QUIT  ;
 . W !!,$C(7)
 . D:LSRPEND=1 LMES($$CJ^XLFSTR("* * *  Installer aborted installation.  * * *",LAPOS),1,"B")
 . D:LSRPEND="N/A" LMES($$CJ^XLFSTR("* * *  Environment Check FAILED  * * *",LAPOS),1,"B")
 . I $G(BAD(1))'="" D LMES($$CJ^XLFSTR(BAD(1),LAPOS),1,"B")
 . I $G(BAD(2))'="" D LMES($$CJ^XLFSTR(BAD(2),LAPOS),1,"B")
 . D LMES("Sending Install aborted alert...",7,"B")
 . S MSG="Installation of '"_$G(XPDNM,"Unknown patch")_"' Aborted "_$$HTE^XLFDT($H)
 . D ALERT(MSG)
 . D LMES("",1,"B")
 ;
 I '$G(XPDENV),LSRPEND=1 D
 . DO LMES("Sending 'Lab Patch at LSRP site' alert...",7,"B")
 . SET MSG="Transport global for Lab patch available at LSRP site.  Notify LSRP Triage!"
 . DO ALERT(MSG)
 . DO LMES($$CJ^XLFSTR("* * Loaded Lab patch on a LSRP Site. * *",LAPOS),1,"B")
 . DO LMES($$CJ^XLFSTR("** Installation must be coordinated with LSRP Triage Team! **",LAPOS),1,"")
 . DO LMES("",1,"B")
 I '$G(XPDENV),LSRPEND=0 D LMES($$CJ^XLFSTR("--- Lab Environment okay ---",LAPOS),1,"B")
 ;
 D LMES(" ",1,"B")
 IF $G(XPDENV),LSRPEND="N/A" D LMES($$CJ^XLFSTR("--- Lab Environment okay ---",LAPOS),1,"B")
 IF $G(XPDENV),LSRPEND=0 D LMES($$CJ^XLFSTR("--- LSRP Environment okay for install with LSRP Triage assistance. ---",LAPOS),1,"B")
 IF $G(XPDENV),LSRPEND=1 D LMES($$CJ^XLFSTR("--- LSRP Environment not OK for install.  Requires LSRP Triage assistance. ---",LAPOS),1,"B") ;Bullet Proof
 QUIT
 ;
POST ; -- post-init for LR*5.2*425
 N LAPOS
 S LAPOS=$G(IOM,80) S:LAPOS<1 LAPOS=80
 D LMES($$CJ^XLFSTR("*** Post install started ***",LAPOS),1,"B")
 ;
 D AUDSET("LRJSMLA1","patient location") ;Enable Fileman auditing for HLCMS (Hospital Location monitoring)
 D LMES("Enable Auditing for selected LABORATORY TEST file (#60) fields...",10,"B")
 D AUDSET^LRJSAU ; Set up auditing on LABORATORY TEST file fields
 ;
 D LMES("Checking parameters for file 60 audit changes affecting quick orders...",10,"B")
 D SETP ; Set parameters in file 69.9 if previous file 60 audits exist
 ;
 D LMES($$CJ^XLFSTR("*** Post install completed ***",LAPOS),1,"B")
 D LMES("",1,"B")
 D LMES("Sending install completion alert to mail group G.LMI",7,"B")
 D ALERT("Installation of '"_$G(XPDNM,"Unknown patch")_"' completed "_$$HTE^XLFDT($H))
 Q
 ;
AUDSET(LROU,LRFILTXT) ; -- enable audit on select Hospital Location, Ward Location and Room-Bed fields
 ;
 ;INPUT : LROU     - Name of routine containing "AFLDS" tag.
 ;        LRFILTXT - Descriptive text of data being audited for message.
 ;
 NEW LRI,LRAFLDS,LRJ,LRFLD
 D LMES("Enable Auditing for selected "_LRFILTXT_" fields...",10,"B")
 FOR LRI=1:1 SET LRAFLDS=$P($TEXT(AFLDS+LRI^@LROU),";;",2) QUIT:LRAFLDS=""  DO
 . DO TURNON^DIAUTL(+LRAFLDS,$P(LRAFLDS,"^",2))  ;IA #5611 allows audit in HL files
 . D LMES("Turn on Audit Attribute for the following fields in file: "_$P(LRAFLDS,"^"),15,"B")
 . F LRJ=1:1 S LRFLD=$P($P(LRAFLDS,"^",2),";",LRJ) Q:LRFLD=""  D LMES("Field #: "_LRFLD,20)
 ;
 D LMES("Continuing...",20)
 D LMES("",1,"B")
 QUIT
 ;
SETP ; Set parameters for the latest file 60 audit file entries affecting quick orders, if not already set
 N LRLIEN,LRLDATE,LRMSG,LRD
 S LRLIEN=+$O(^DIA(60,"A"),-1)
 S LRLDATE=$P($G(^DIA(60,+$O(^DIA(60,"A"),-1),0)),U,2)
 I 'LRLIEN,'LRLDATE D  Q
 . D LMES("No previous file 60 audits found, no parameter update necessary",15)
 D GETS^DIQ(69.9,1,"64.913;64.914","I","LRD")
 I $G(LRD(69.9,"1,",64.913,"I"))=""!($G(LRD(69.9,"1,",64.914,"I"))="") D  Q
 . K LRD
 . S LRD(69.9,"1,",64.913)=LRLIEN,LRD(69.9,"1,",64.914)=LRLDATE
 . D FILE^DIE("","LRD","LRMSG")
 . D LMES("Parameters updated based on data found for last file 60 audit",15)
 . D LMES("LAST IEN: "_LRLIEN_"    LAST DATE: "_$$FMTE^XLFDT(LRLDATE,2),20)
 D LMES("Parameters are already set, no update necessary",15)
 Q
 ;
LMES(STR,SPCNUM,BVAR) ; List text in output display
 ;
 ; INPUT:
 ;   STR    - String to output
 ;   SPCNUM - # Leading spaces
 ;   BVAR   - Null: Do not print a blank prior to text (Default) [MES]
 ;            "B" : Print a blank prior to text [BMES]
 ;
 ; Write string in a single line list
 N LRMSG
 S LRMSG=""
 S:+$G(SPCNUM)=0 SPCNUM=1
 S $P(LRMSG," ",SPCNUM)=STR
 D:$G(BVAR)'="B" MES^XPDUTL(LRMSG)
 D:$G(BVAR)="B" BMES^XPDUTL(LRMSG)
 Q
 ;
ALERT(MSG) ;Send Alert message
 ;Input: MSG - Alert message to send
 N XQA,XQAMSG
 S XQAMSG=$G(MSG)
 ;
 I $$GOTLOCAL^XMXAPIG("LMI") DO
 . S XQA("G.LMI")=""
 . D LMES("Alert addressed to mail group G.LMI",10)
 E  DO
 . S XQA(DUZ)=""
 . D LMES("LMI Mail group not defined. Alert addressed to installer.",10)
 ;
 D:$G(MSG)]"" LMES(MSG,80-$L(MSG))
 D LMES(" ",1)
 I '$$SETUP1^XQALERT DO
 .D:$G(MSG)']"" LMES($$CJ^XLFSTR("Alert Message string not defined.",IOM),1)
 .D LMES($$CJ^XLFSTR("** Alert error occured...Alert not sent!! **",IOM),1,"B")
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLR425   8642     printed  Sep 23, 2025@19:39:39                                                                                                                                                                                                       Page 2
LR425     ;ALB/GTS - LR*5.2*425 KIDS POST-INIT ROUTINE ;09/28/2012 11:25
 +1       ;;5.2;LAB SERVICE;**425**;Sep 27, 1994;Build 30
 +2       ;
 +3       ;
 +4       ;Environment check for LSRP: ENSTART, CHK4LSRP, LSRPEX and Call Environment check in LR*425
ENSTART   ; -- Generic Lab environment check
 +1       ; May prevent loading of the transport global.
 +2       ; Environment check is done only during the install.
 +3       ;
 +4        NEW LRMSG,LAPOS,LRALST,MSG,BAD,LSRPEND,X
 +5        SET LSRPEND="N/A"
 +6       ;no queuing
           SET XPDNOQUE=1
 +7        SET LAPOS=$GET(IOM,80)
           if LAPOS<1
               SET LAPOS=80
 +8        DO LMES($$CJ^XLFSTR("***"_$SELECT('$GET(XPDENV):" 'Transport Global Load'",1:" 'Installation'")_" Environment Check started ***",LAPOS),1,"B")
 +9       ;
 +10      ; Check for LMI mailgroup
 +11       DO LMES("'LMI' Mail Group must exist.",10,"B")
 +12       DO LMES("Checking for 'LMI' Mail Group...",15)
 +13       SET X=$$FIND1^DIC(3.8,,"BOQUX","LMI","B","","LAMSG")
 +14      ;QUIT/Abort if LMI Mailgroup is not defined
           IF 'X
               Begin DoDot:1
 +15               DO LMES("Mail Group (#3.8) 'LMI' does not exist.",20)
 +16               DO LMES($$CJ^XLFSTR("* * *  Environment failed.  Aborting.  * * *",LAPOS),1,"B")
 +17      ; Leave transport global
                   SET XPDABORT=2
 +18               DO LSRPEX
               End DoDot:1
               QUIT 
 +19      IF '$TEST
               Begin DoDot:1
 +20               DO LMES("'LMI' Mail Group exists.",20)
 +21               DO LMES("Continuing...",25)
               End DoDot:1
 +22      ;
 +23      ;QUIT if Loading Distribution
           IF '$GET(XPDENV)
               Begin DoDot:1
 +24               NEW LRC383,LAC75,LRP393,LAP76
 +25               SET MSG="Distribution for '"_$GET(XPDNM,"Unknown patch")_"' loaded "_$$HTE^XLFDT($HOROLOG)
 +26               DO LMES(" ",1)
 +27               DO LMES("Sending distribution loaded alert...",7,"B")
 +28               DO ALERT(MSG)
 +29               SET LRC383=$$PATCH^XPDUTL("LR*5.2*383")
 +30               SET LAC75=$$PATCH^XPDUTL("LA*5.2*75")
 +31               SET LRP393=$$PATCH^XPDUTL("LR*5.2*393")
 +32               SET LAP76=$$PATCH^XPDUTL("LA*5.2*76")
 +33               SET LSRPEND=(LRC383!LAC75!LRP393!LAP76)
 +34               DO LSRPEX
               End DoDot:1
               QUIT 
 +35      ;
 +36      ;Continue if $G(XPDENV) - Installation underway, Check for LSRP
 +37       DO LMES("Sending install started alert...",7,"B")
 +38       SET MSG="Installation of '"_$GET(XPDNM,"Unknown patch")_"' started "_$$HTE^XLFDT($HOROLOG)
 +39       DO ALERT(MSG)
 +40      ;
 +41       DO CHK4LSRP
 +42       DO LSRPEX
 +43       QUIT 
 +44      ;
CHK4LSRP  ; [During Installation...] Check if LSRP is installed at site, do NOT install over LSRP
 +1        NEW LRC383,LAC75,LRP393,LAP76
 +2        SET LRC383=$$PATCH^XPDUTL("LR*5.2*383")
 +3        SET LAC75=$$PATCH^XPDUTL("LA*5.2*75")
 +4        SET LRP393=$$PATCH^XPDUTL("LR*5.2*393")
 +5        SET LAP76=$$PATCH^XPDUTL("LA*5.2*76")
 +6       ;LSRP Site?
           IF (LRC383!LAC75!LRP393!LAP76)
               Begin DoDot:1
 +7                NEW LRMGR,LROVRD
 +8                DO OWNSKEY^XUSRB(.LRMGR,"LRJ CERNER MGR")
 +9                DO OWNSKEY^XUSRB(.LROVRD,"LRJ CERNER OVERRIDE")
 +10      ;Hold LRJ CERNER MGR & LRJ CERNER OVERRIDE keys?
                   IF ($GET(LRMGR(0))=0)!($GET(LROVRD(0))=0)
                       Begin DoDot:2
 +11                       SET XPDABORT=1
 +12                       SET BAD=1
 +13                       SET BAD(1)="**  LSRP is installed at this site!!  **"
 +14                       SET BAD(2)="All Lab (LR/LA namespaced) patches must be installed by the LSRP Triage team."
                       End DoDot:2
 +15              IF '$TEST
                       Begin DoDot:2
 +16                       NEW DIR,X,Y,DTOUT,DIRUT,DUOUT,LROK
 +17                       WRITE !
 +18                       SET DIR(0)="Y"
 +19                       SET DIR("A",1)="You are installing a Legacy Lab patch at a LSRP Site."
 +20                       SET DIR("A",2)="The LSRP Triage Team should be coordinating this installation."
 +21                       SET DIR("A",3)="If LSRP Triage is NOT coordinating, DO NOT INSTALL THIS PATCH!"
 +22                       SET DIR("A")="Do you want to install"
 +23                       SET DIR("B")="NO"
 +24                       SET DIR("?",1)="You have the privileges to install this patch."
 +25                       SET DIR("?",2)="Installing means LSRP Triage has determined if this patch will"
 +26                       SET DIR("?")="overwrite LSRP system structures and how to address the conflicts."
 +27                       DO ^DIR
 +28                       SET LROK=+Y
 +29                       SET LSRPEND='+Y
 +30                       IF 'LROK
                               Begin DoDot:3
 +31                               SET XPDABORT=1
 +32                               DO LMES("Installer with DUZ: "_DUZ_" defering to LSRP Triage.",20,"B")
 +33                               if $GET(XPDENV)
                                       DO LMES("Installation will stop and remove global.",25)
 +34                               DO LMES($$CJ^XLFSTR("* * *  Install stopped during Environment check.  * * *",LAPOS),1,"B")
                               End DoDot:3
                       End DoDot:2
               End DoDot:1
 +35       QUIT 
 +36      ;
LSRPEX    ; LSRP Exit message for Install log
 +1        NEW LAPOS,MSG
 +2        SET LAPOS=$GET(IOM,80)
           if LAPOS<1
               SET LAPOS=80
 +3       ;
           IF $GET(XPDQUIT)!$GET(XPDABORT)
               Begin DoDot:1
 +4                WRITE !!,$CHAR(7)
 +5                if LSRPEND=1
                       DO LMES($$CJ^XLFSTR("* * *  Installer aborted installation.  * * *",LAPOS),1,"B")
 +6                if LSRPEND="N/A"
                       DO LMES($$CJ^XLFSTR("* * *  Environment Check FAILED  * * *",LAPOS),1,"B")
 +7                IF $GET(BAD(1))'=""
                       DO LMES($$CJ^XLFSTR(BAD(1),LAPOS),1,"B")
 +8                IF $GET(BAD(2))'=""
                       DO LMES($$CJ^XLFSTR(BAD(2),LAPOS),1,"B")
 +9                DO LMES("Sending Install aborted alert...",7,"B")
 +10               SET MSG="Installation of '"_$GET(XPDNM,"Unknown patch")_"' Aborted "_$$HTE^XLFDT($HOROLOG)
 +11               DO ALERT(MSG)
 +12               DO LMES("",1,"B")
               End DoDot:1
               QUIT 
 +13      ;
 +14       IF '$GET(XPDENV)
               IF LSRPEND=1
                   Begin DoDot:1
 +15                   DO LMES("Sending 'Lab Patch at LSRP site' alert...",7,"B")
 +16                   SET MSG="Transport global for Lab patch available at LSRP site.  Notify LSRP Triage!"
 +17                   DO ALERT(MSG)
 +18                   DO LMES($$CJ^XLFSTR("* * Loaded Lab patch on a LSRP Site. * *",LAPOS),1,"B")
 +19                   DO LMES($$CJ^XLFSTR("** Installation must be coordinated with LSRP Triage Team! **",LAPOS),1,"")
 +20                   DO LMES("",1,"B")
                   End DoDot:1
 +21       IF '$GET(XPDENV)
               IF LSRPEND=0
                   DO LMES($$CJ^XLFSTR("--- Lab Environment okay ---",LAPOS),1,"B")
 +22      ;
 +23       DO LMES(" ",1,"B")
 +24       IF $GET(XPDENV)
               IF LSRPEND="N/A"
                   DO LMES($$CJ^XLFSTR("--- Lab Environment okay ---",LAPOS),1,"B")
 +25       IF $GET(XPDENV)
               IF LSRPEND=0
                   DO LMES($$CJ^XLFSTR("--- LSRP Environment okay for install with LSRP Triage assistance. ---",LAPOS),1,"B")
 +26      ;Bullet Proof
           IF $GET(XPDENV)
               IF LSRPEND=1
                   DO LMES($$CJ^XLFSTR("--- LSRP Environment not OK for install.  Requires LSRP Triage assistance. ---",LAPOS),1,"B")
 +27       QUIT 
 +28      ;
POST      ; -- post-init for LR*5.2*425
 +1        NEW LAPOS
 +2        SET LAPOS=$GET(IOM,80)
           if LAPOS<1
               SET LAPOS=80
 +3        DO LMES($$CJ^XLFSTR("*** Post install started ***",LAPOS),1,"B")
 +4       ;
 +5       ;Enable Fileman auditing for HLCMS (Hospital Location monitoring)
           DO AUDSET("LRJSMLA1","patient location")
 +6        DO LMES("Enable Auditing for selected LABORATORY TEST file (#60) fields...",10,"B")
 +7       ; Set up auditing on LABORATORY TEST file fields
           DO AUDSET^LRJSAU
 +8       ;
 +9        DO LMES("Checking parameters for file 60 audit changes affecting quick orders...",10,"B")
 +10      ; Set parameters in file 69.9 if previous file 60 audits exist
           DO SETP
 +11      ;
 +12       DO LMES($$CJ^XLFSTR("*** Post install completed ***",LAPOS),1,"B")
 +13       DO LMES("",1,"B")
 +14       DO LMES("Sending install completion alert to mail group G.LMI",7,"B")
 +15       DO ALERT("Installation of '"_$GET(XPDNM,"Unknown patch")_"' completed "_$$HTE^XLFDT($HOROLOG))
 +16       QUIT 
 +17      ;
AUDSET(LROU,LRFILTXT) ; -- enable audit on select Hospital Location, Ward Location and Room-Bed fields
 +1       ;
 +2       ;INPUT : LROU     - Name of routine containing "AFLDS" tag.
 +3       ;        LRFILTXT - Descriptive text of data being audited for message.
 +4       ;
 +5        NEW LRI,LRAFLDS,LRJ,LRFLD
 +6        DO LMES("Enable Auditing for selected "_LRFILTXT_" fields...",10,"B")
 +7        FOR LRI=1:1
               SET LRAFLDS=$PIECE($TEXT(AFLDS+LRI^@LROU),";;",2)
               if LRAFLDS=""
                   QUIT 
               Begin DoDot:1
 +8       ;IA #5611 allows audit in HL files
                   DO TURNON^DIAUTL(+LRAFLDS,$PIECE(LRAFLDS,"^",2))
 +9                DO LMES("Turn on Audit Attribute for the following fields in file: "_$PIECE(LRAFLDS,"^"),15,"B")
 +10               FOR LRJ=1:1
                       SET LRFLD=$PIECE($PIECE(LRAFLDS,"^",2),";",LRJ)
                       if LRFLD=""
                           QUIT 
                       DO LMES("Field #: "_LRFLD,20)
               End DoDot:1
 +11      ;
 +12       DO LMES("Continuing...",20)
 +13       DO LMES("",1,"B")
 +14       QUIT 
 +15      ;
SETP      ; Set parameters for the latest file 60 audit file entries affecting quick orders, if not already set
 +1        NEW LRLIEN,LRLDATE,LRMSG,LRD
 +2        SET LRLIEN=+$ORDER(^DIA(60,"A"),-1)
 +3        SET LRLDATE=$PIECE($GET(^DIA(60,+$ORDER(^DIA(60,"A"),-1),0)),U,2)
 +4        IF 'LRLIEN
               IF 'LRLDATE
                   Begin DoDot:1
 +5                    DO LMES("No previous file 60 audits found, no parameter update necessary",15)
                   End DoDot:1
                   QUIT 
 +6        DO GETS^DIQ(69.9,1,"64.913;64.914","I","LRD")
 +7        IF $GET(LRD(69.9,"1,",64.913,"I"))=""!($GET(LRD(69.9,"1,",64.914,"I"))="")
               Begin DoDot:1
 +8                KILL LRD
 +9                SET LRD(69.9,"1,",64.913)=LRLIEN
                   SET LRD(69.9,"1,",64.914)=LRLDATE
 +10               DO FILE^DIE("","LRD","LRMSG")
 +11               DO LMES("Parameters updated based on data found for last file 60 audit",15)
 +12               DO LMES("LAST IEN: "_LRLIEN_"    LAST DATE: "_$$FMTE^XLFDT(LRLDATE,2),20)
               End DoDot:1
               QUIT 
 +13       DO LMES("Parameters are already set, no update necessary",15)
 +14       QUIT 
 +15      ;
LMES(STR,SPCNUM,BVAR) ; List text in output display
 +1       ;
 +2       ; INPUT:
 +3       ;   STR    - String to output
 +4       ;   SPCNUM - # Leading spaces
 +5       ;   BVAR   - Null: Do not print a blank prior to text (Default) [MES]
 +6       ;            "B" : Print a blank prior to text [BMES]
 +7       ;
 +8       ; Write string in a single line list
 +9        NEW LRMSG
 +10       SET LRMSG=""
 +11       if +$GET(SPCNUM)=0
               SET SPCNUM=1
 +12       SET $PIECE(LRMSG," ",SPCNUM)=STR
 +13       if $GET(BVAR)'="B"
               DO MES^XPDUTL(LRMSG)
 +14       if $GET(BVAR)="B"
               DO BMES^XPDUTL(LRMSG)
 +15       QUIT 
 +16      ;
ALERT(MSG) ;Send Alert message
 +1       ;Input: MSG - Alert message to send
 +2        NEW XQA,XQAMSG
 +3        SET XQAMSG=$GET(MSG)
 +4       ;
 +5        IF $$GOTLOCAL^XMXAPIG("LMI")
               Begin DoDot:1
 +6                SET XQA("G.LMI")=""
 +7                DO LMES("Alert addressed to mail group G.LMI",10)
               End DoDot:1
 +8       IF '$TEST
               Begin DoDot:1
 +9                SET XQA(DUZ)=""
 +10               DO LMES("LMI Mail group not defined. Alert addressed to installer.",10)
               End DoDot:1
 +11      ;
 +12       if $GET(MSG)]""
               DO LMES(MSG,80-$LENGTH(MSG))
 +13       DO LMES(" ",1)
 +14       IF '$$SETUP1^XQALERT
               Begin DoDot:1
 +15               if $GET(MSG)']""
                       DO LMES($$CJ^XLFSTR("Alert Message string not defined.",IOM),1)
 +16               DO LMES($$CJ^XLFSTR("** Alert error occured...Alert not sent!! **",IOM),1,"B")
               End DoDot:1
 +17       QUIT