LA74 ;DALOI/JMC - LA*5.2*74 KIDS ROUTINE ;12/27/11 09:32
;;5.2;AUTOMATED LAB INSTRUMENTS;**74**;Sep 27, 1994;Build 229
;
EN ; Does not prevent loading of the transport global.
N STR,BAD,POS,X
S XPDNOQUE=1 ;no queuing
S POS=$G(IOM,80) S:POS<1 POS=80
I '$G(XPDENV) D ;
. S STR="Transport global for patch "_$G(XPDNM,"Unknown patch")_" loaded on "_$$HTE^XLFDT($H)
. D ALERT(STR)
. W !,$$CJ^XLFSTR("Sending transport global loaded alert to mail group G.LMI",POS)
;
I $G(XPDENV) D ;
. W !,$$CJ^XLFSTR("Sending install started alert to mail group G.LMI",POS)
. S STR="Installation of patch "_$G(XPDNM,"Unknown patch")_" started on "_$$HTE^XLFDT($H)
. D ALERT(STR)
;
S BAD=0
I '$G(IOM) S BAD=1
I '$G(IOSL) S BAD=1
I $G(U)'="^" S BAD=1
I BAD D ;
. W !,$$CJ^XLFSTR("Terminal Device is not defined.",POS)
. S XPDABORT=2
;
S BAD=0
I '$G(DUZ) S BAD=1
I $D(DUZ)[0 S BAD=1
I $D(DUZ(0))[0 S BAD=1
I BAD D ;
. W !,$$CJ^XLFSTR("Please login to set DUZ variables.",POS)
. S XPDABORT=2
;
I $G(DUZ) I '$$ACTIVE^XUSER(DUZ) D ;
. W !,$$CJ^XLFSTR("Not a valid user on this system.",POS)
. S XPDABORT=2
;
S BAD=0
I $G(XPDABORT)!$G(XPDQUIT) S BAD=1
S X="LR350"
X ^%ZOSF("TEST")
I '$T D ;
. S BAD=1
. S BAD(1)="Routine LR350 is missing."
. S XPDABORT=2
;
I BAD!($G(XPDABORT)) D ;
. S XPDABORT=2
. W !!,$C(7),$$CJ^XLFSTR("* * * Environment Check FAILED * * *",POS)
. I $G(BAD(1))'="" W !,$$CJ^XLFSTR(BAD(1),POS)
. I XPDENV=1 W !!,$C(7),$$CJ^XLFSTR("Installation aborted.",POS),!
;
I 'BAD&'$G(XPDABORT) D ;
. W !,$$CJ^XLFSTR("--- Environment okay ---",POS)
;
; Disable options, protocols, scheduled options
I XPDENV=1 S XPDDIQ("XPZ1","B")="YES"
Q
;
;
PRE ;
; KIDS Pre install for LA*5.2*74
N LADATA,LAMSG,LAACTN,LAX,X
D BMES("*** Pre install started ***")
; System ready from LR350?
S X=$G(^TMP("LR350",$J,1))
I 'X D Q ;
. S XPDABORT=1
. W $C(7)
. D BMES(" ")
. D BMES("Install aborted -- System not ready.")
. D MES("Refer to the Install Guide for more information.")
. D BMES(" ")
. H 5
. D RESTORE^LR350
;
; Save off any local entries in File #62.47
K ^TMP("LA74-LOCAL",$J)
; Is this the LDSI development acount?
;S LAACTN(2)=($G(^%ZOSF("VOL"))="MHCVSS")
;I LAACTN(2)=0 D ;
I 1 D ;
. D BMES("Checking for local codes in #62.47")
. D GETLOCAL
. S LAX=+$G(^TMP("LA74-LOCAL",$J,"6247",0))
. D BMES(LAX_" local code"_$S(LAX=1:"",1:"s")_" found in #62.47")
K LAACTN(2)
;
; delete #62.47 data and DD
D BMES("Deleting File #62.47 data and DD")
D ;
. N DIU
. S LADATA=$$VFILE^DILFD(62.47)
. ; handle remnant #62.47 (sub-file of 62.4) VFILE=0 for this
. I 'LADATA D ;
. . S DIU(0)="S"
. . S DIU=62.47
. ;
. I LADATA D ;
. . S DIU(0)="DS"
. . S DIU="^LAB(62.47,"
. D EN^DIU2
; take care of orphaned DD if not deleted from above
; This happened in San Antonio initial install
I $D(^DD(62.47)) D ;
. D BMES("#62.47 DD still exists. KILLing the DD now")
. I $D(^LAB(62.47)) D ;
. . N DIERR,LAMSG,LAFDA
. . S R6247=0
. . F S R6247=$O(^LAB(62.47,R6247)) Q:'R6247 D ;
. . . K LRFDA,LAMSG
. . . S LAFDA(1,62.47,R6247_",",.01)="@"
. . . D FILE^DIE("E","LAFDA(1)","LAMSG")
. . ;
. K ^DD(62.47) ;(okay by Skip Ormsby)
;
; Delete DD for file #62.49
I $$VFILE^DILFD(62.49) D
. N DIU
. D BMES("Purging DD for file #62.49")
. S DIU="^LAHM(62.49,",DIU(0)="" D EN^DIU2
;
;I '$D(LAACTN) D BMES("--- No action required for pre-install ---")
D BMES("*** Pre install completed ***")
;
Q
;
;
POST ;
; KIDS Post install for LA*5.2*74
N X
D POST^LA74A
; Delete extra routines here
I '$$GET^XUPARAM("XPD NO_EPP_DELETE") D ;
. S X="LA74A" X ^%ZOSF("TEST") Q:'$T X ^%ZOSF("DEL")
D RESTORE^LR350
Q
;
;
ALERT(MSG,RECIPS) ;
N DA,DIK,XQA,XQAMSG
S XQAMSG=$G(MSG)
I '$$GOTLOCAL^XMXAPIG("LMI") S XQA("G.LMI")=""
E S XQA(DUZ)=""
I $D(RECIPS) M XQA=RECIPS
D SETUP^XQALERT
Q
;
;
BMES(STR) ;
; Write string
D BMES^XPDUTL($$TRIM^XLFSTR($$CJ^XLFSTR(STR,$G(IOM,80)),"R"," "))
Q
;
PROGRESS(LAST) ;
; Prints a "." when NOW > LAST + INT
; Input
; LAST : <byref> The last $H when "." was shown
N INT
S INT=1 ;interval in seconds
I $P($H,",",2)>(+$P(LAST,",",2)+INT) S LAST=$H W "."
Q
;
;
PTG ;
; Pre-Transport Global routine
; Populate pre-transport global with #62.47 data
; Only files the 0 nodes (2 node is for local data)
N R6247,R624701,DATA,X,MSG,IENS2,P2FILE,SUB,CNT,DIERR
S (R6247,CNT)=0
F S R6247=$O(^LAB(62.47,R6247)) Q:'R6247 D ;
. S DATA=$G(^LAB(62.47,R6247,0))
. D SETTG(R6247,0,0,DATA)
. S R624701=0
. F S R624701=$O(^LAB(62.47,R6247,1,R624701)) Q:'R624701 D ;
. . S DATA=$G(^LAB(62.47,R6247,1,R624701,0))
. . I $P(DATA,"^",5)'=1 Q ; only send national standard
. . I $P(DATA,"^",2)="L" Q ; don't send local codes
. . S CNT=CNT+1
. . D SETTG(0,0,0,CNT)
. . D SETTG(R6247,R624701,0,DATA)
Q
;
SETTG(R1,R2,SUB,VAL) ;
; Adds the Pre-Transport data node
; ^XTMP("XPDI",DA,"TEMP","LA6247",R6247,0)=0 node data
; ,R6247,1,R624701,0)=0 node data
N NMSPC,CNT,NODE
S SUB=+$G(SUB,0)
S NMSPC="LA6247"
Q:'$D(XPDGREF)
S NODE=XPDGREF
S NODE=$$TRIM^XLFSTR(NODE,"R",")")
S NODE=NODE_","""_NMSPC_""","_R1
I 'R1 S NODE=NODE_")"
I R1 I 'R2 S NODE=NODE_",0)"
I R2 S NODE=NODE_",1,"_R2_","_SUB_")"
S @NODE=VAL
Q
;
;
GETLOCAL ;
; Called from Pre-Install
; Gets all Local and non-National codes from File #62.47 and saves them to TMP for restore in Post
; Also saves site's mapping of national entries to local files for antibiotics (#62.06)
N CNT,DATA,DIERR,FDA,FLDIENS,LA72,MSG,R6247,R624701,X,X2
;
K ^TMP("LA74-LOCAL",$J),^TMP("LA74-LOCAL-MAPPING",$J)
;
S (CNT,CNT(1),R6247)=0
F S R6247=$O(^LAB(62.47,R6247)) Q:'R6247 D ;
. S R624701=0
. F S R624701=$O(^LAB(62.47,R6247,1,R624701)) Q:'R624701 D ;
. . S DATA=$G(^LAB(62.47,R6247,1,R624701,0))
. . S LA72=$G(^LAB(62.47,R6247,1,R624701,2))
. . ; don't process if a Local or non-national code, just save field 2.1 mapping
. . I +$P(DATA,"^",5)=1 D Q
. . . I $P(LA72,"^")'="" S ^TMP("LA74-LOCAL-MAPPING",$J,"6247",R6247,1,R624701,2.1)=$P(LA72,"^"),CNT(1)=CNT(1)+1
. . S ^TMP("LA74-LOCAL",$J,"6247",R6247,0)=$G(^LAB(62.47,R6247,0))
. . K DATA,DIERR
. . S IENS=R624701_","_R6247_","
. . D GETS^DIQ(62.4701,IENS,"*","I","DATA","MSG")
. . I '$D(DATA) Q
. . S FLD=.001,CNT=CNT+1
. . F S FLD=$O(DATA(62.4701,IENS,FLD)) Q:FLD="" D ;
. . . S X=$G(DATA(62.4701,IENS,FLD,"I"))
. . . I X'="" S ^TMP("LA74-LOCAL",$J,"6247",R6247,1,R624701,FLD)=X
;
S ^TMP("LA74-LOCAL",$J,"6247",0)=CNT
S ^TMP("LA74-LOCAL-MAPPING",$J,"6247",0)=CNT(1)
;
Q
;
;
MES(STR,CJ,LM) ;
; Display a string using MES^XPDUTL
; Inputs
; STR: String to display
; CJ: Center text? 1=yes 0=1 <dflt=1>
; LM: Left Margin (padding)
N X
S STR=$G(STR)
S CJ=$G(CJ,1)
S LM=$G(LM)
I CJ S STR=$$TRIM^XLFSTR($$CJ^XLFSTR(STR,$G(IOM,80)),"R"," ")
I 'CJ I LM S X="" S $P(X," ",LM)=" " S STR=X_STR
D MES^XPDUTL(STR)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLA74 7188 printed Dec 13, 2024@01:38:54 Page 2
LA74 ;DALOI/JMC - LA*5.2*74 KIDS ROUTINE ;12/27/11 09:32
+1 ;;5.2;AUTOMATED LAB INSTRUMENTS;**74**;Sep 27, 1994;Build 229
+2 ;
EN ; Does not prevent loading of the transport global.
+1 NEW STR,BAD,POS,X
+2 ;no queuing
SET XPDNOQUE=1
+3 SET POS=$GET(IOM,80)
if POS<1
SET POS=80
+4 ;
IF '$GET(XPDENV)
Begin DoDot:1
+5 SET STR="Transport global for patch "_$GET(XPDNM,"Unknown patch")_" loaded on "_$$HTE^XLFDT($HOROLOG)
+6 DO ALERT(STR)
+7 WRITE !,$$CJ^XLFSTR("Sending transport global loaded alert to mail group G.LMI",POS)
End DoDot:1
+8 ;
+9 ;
IF $GET(XPDENV)
Begin DoDot:1
+10 WRITE !,$$CJ^XLFSTR("Sending install started alert to mail group G.LMI",POS)
+11 SET STR="Installation of patch "_$GET(XPDNM,"Unknown patch")_" started on "_$$HTE^XLFDT($HOROLOG)
+12 DO ALERT(STR)
End DoDot:1
+13 ;
+14 SET BAD=0
+15 IF '$GET(IOM)
SET BAD=1
+16 IF '$GET(IOSL)
SET BAD=1
+17 IF $GET(U)'="^"
SET BAD=1
+18 ;
IF BAD
Begin DoDot:1
+19 WRITE !,$$CJ^XLFSTR("Terminal Device is not defined.",POS)
+20 SET XPDABORT=2
End DoDot:1
+21 ;
+22 SET BAD=0
+23 IF '$GET(DUZ)
SET BAD=1
+24 IF $DATA(DUZ)[0
SET BAD=1
+25 IF $DATA(DUZ(0))[0
SET BAD=1
+26 ;
IF BAD
Begin DoDot:1
+27 WRITE !,$$CJ^XLFSTR("Please login to set DUZ variables.",POS)
+28 SET XPDABORT=2
End DoDot:1
+29 ;
+30 ;
IF $GET(DUZ)
IF '$$ACTIVE^XUSER(DUZ)
Begin DoDot:1
+31 WRITE !,$$CJ^XLFSTR("Not a valid user on this system.",POS)
+32 SET XPDABORT=2
End DoDot:1
+33 ;
+34 SET BAD=0
+35 IF $GET(XPDABORT)!$GET(XPDQUIT)
SET BAD=1
+36 SET X="LR350"
+37 XECUTE ^%ZOSF("TEST")
+38 ;
IF '$TEST
Begin DoDot:1
+39 SET BAD=1
+40 SET BAD(1)="Routine LR350 is missing."
+41 SET XPDABORT=2
End DoDot:1
+42 ;
+43 ;
IF BAD!($GET(XPDABORT))
Begin DoDot:1
+44 SET XPDABORT=2
+45 WRITE !!,$CHAR(7),$$CJ^XLFSTR("* * * Environment Check FAILED * * *",POS)
+46 IF $GET(BAD(1))'=""
WRITE !,$$CJ^XLFSTR(BAD(1),POS)
+47 IF XPDENV=1
WRITE !!,$CHAR(7),$$CJ^XLFSTR("Installation aborted.",POS),!
End DoDot:1
+48 ;
+49 ;
IF 'BAD&'$GET(XPDABORT)
Begin DoDot:1
+50 WRITE !,$$CJ^XLFSTR("--- Environment okay ---",POS)
End DoDot:1
+51 ;
+52 ; Disable options, protocols, scheduled options
+53 IF XPDENV=1
SET XPDDIQ("XPZ1","B")="YES"
+54 QUIT
+55 ;
+56 ;
PRE ;
+1 ; KIDS Pre install for LA*5.2*74
+2 NEW LADATA,LAMSG,LAACTN,LAX,X
+3 DO BMES("*** Pre install started ***")
+4 ; System ready from LR350?
+5 SET X=$GET(^TMP("LR350",$JOB,1))
+6 ;
IF 'X
Begin DoDot:1
+7 SET XPDABORT=1
+8 WRITE $CHAR(7)
+9 DO BMES(" ")
+10 DO BMES("Install aborted -- System not ready.")
+11 DO MES("Refer to the Install Guide for more information.")
+12 DO BMES(" ")
+13 HANG 5
+14 DO RESTORE^LR350
End DoDot:1
QUIT
+15 ;
+16 ; Save off any local entries in File #62.47
+17 KILL ^TMP("LA74-LOCAL",$JOB)
+18 ; Is this the LDSI development acount?
+19 ;S LAACTN(2)=($G(^%ZOSF("VOL"))="MHCVSS")
+20 ;I LAACTN(2)=0 D ;
+21 ;
IF 1
Begin DoDot:1
+22 DO BMES("Checking for local codes in #62.47")
+23 DO GETLOCAL
+24 SET LAX=+$GET(^TMP("LA74-LOCAL",$JOB,"6247",0))
+25 DO BMES(LAX_" local code"_$SELECT(LAX=1:"",1:"s")_" found in #62.47")
End DoDot:1
+26 KILL LAACTN(2)
+27 ;
+28 ; delete #62.47 data and DD
+29 DO BMES("Deleting File #62.47 data and DD")
+30 ;
Begin DoDot:1
+31 NEW DIU
+32 SET LADATA=$$VFILE^DILFD(62.47)
+33 ; handle remnant #62.47 (sub-file of 62.4) VFILE=0 for this
+34 ;
IF 'LADATA
Begin DoDot:2
+35 SET DIU(0)="S"
+36 SET DIU=62.47
End DoDot:2
+37 ;
+38 ;
IF LADATA
Begin DoDot:2
+39 SET DIU(0)="DS"
+40 SET DIU="^LAB(62.47,"
End DoDot:2
+41 DO EN^DIU2
End DoDot:1
+42 ; take care of orphaned DD if not deleted from above
+43 ; This happened in San Antonio initial install
+44 ;
IF $DATA(^DD(62.47))
Begin DoDot:1
+45 DO BMES("#62.47 DD still exists. KILLing the DD now")
+46 ;
IF $DATA(^LAB(62.47))
Begin DoDot:2
+47 NEW DIERR,LAMSG,LAFDA
+48 SET R6247=0
+49 ;
FOR
SET R6247=$ORDER(^LAB(62.47,R6247))
if 'R6247
QUIT
Begin DoDot:3
+50 KILL LRFDA,LAMSG
+51 SET LAFDA(1,62.47,R6247_",",.01)="@"
+52 DO FILE^DIE("E","LAFDA(1)","LAMSG")
End DoDot:3
+53 ;
End DoDot:2
+54 ;(okay by Skip Ormsby)
KILL ^DD(62.47)
End DoDot:1
+55 ;
+56 ; Delete DD for file #62.49
+57 IF $$VFILE^DILFD(62.49)
Begin DoDot:1
+58 NEW DIU
+59 DO BMES("Purging DD for file #62.49")
+60 SET DIU="^LAHM(62.49,"
SET DIU(0)=""
DO EN^DIU2
End DoDot:1
+61 ;
+62 ;I '$D(LAACTN) D BMES("--- No action required for pre-install ---")
+63 DO BMES("*** Pre install completed ***")
+64 ;
+65 QUIT
+66 ;
+67 ;
POST ;
+1 ; KIDS Post install for LA*5.2*74
+2 NEW X
+3 DO POST^LA74A
+4 ; Delete extra routines here
+5 ;
IF '$$GET^XUPARAM("XPD NO_EPP_DELETE")
Begin DoDot:1
+6 SET X="LA74A"
XECUTE ^%ZOSF("TEST")
if '$TEST
QUIT
XECUTE ^%ZOSF("DEL")
End DoDot:1
+7 DO RESTORE^LR350
+8 QUIT
+9 ;
+10 ;
ALERT(MSG,RECIPS) ;
+1 NEW DA,DIK,XQA,XQAMSG
+2 SET XQAMSG=$GET(MSG)
+3 IF '$$GOTLOCAL^XMXAPIG("LMI")
SET XQA("G.LMI")=""
+4 IF '$TEST
SET XQA(DUZ)=""
+5 IF $DATA(RECIPS)
MERGE XQA=RECIPS
+6 DO SETUP^XQALERT
+7 QUIT
+8 ;
+9 ;
BMES(STR) ;
+1 ; Write string
+2 DO BMES^XPDUTL($$TRIM^XLFSTR($$CJ^XLFSTR(STR,$GET(IOM,80)),"R"," "))
+3 QUIT
+4 ;
PROGRESS(LAST) ;
+1 ; Prints a "." when NOW > LAST + INT
+2 ; Input
+3 ; LAST : <byref> The last $H when "." was shown
+4 NEW INT
+5 ;interval in seconds
SET INT=1
+6 IF $PIECE($HOROLOG,",",2)>(+$PIECE(LAST,",",2)+INT)
SET LAST=$HOROLOG
WRITE "."
+7 QUIT
+8 ;
+9 ;
PTG ;
+1 ; Pre-Transport Global routine
+2 ; Populate pre-transport global with #62.47 data
+3 ; Only files the 0 nodes (2 node is for local data)
+4 NEW R6247,R624701,DATA,X,MSG,IENS2,P2FILE,SUB,CNT,DIERR
+5 SET (R6247,CNT)=0
+6 ;
FOR
SET R6247=$ORDER(^LAB(62.47,R6247))
if 'R6247
QUIT
Begin DoDot:1
+7 SET DATA=$GET(^LAB(62.47,R6247,0))
+8 DO SETTG(R6247,0,0,DATA)
+9 SET R624701=0
+10 ;
FOR
SET R624701=$ORDER(^LAB(62.47,R6247,1,R624701))
if 'R624701
QUIT
Begin DoDot:2
+11 SET DATA=$GET(^LAB(62.47,R6247,1,R624701,0))
+12 ; only send national standard
IF $PIECE(DATA,"^",5)'=1
QUIT
+13 ; don't send local codes
IF $PIECE(DATA,"^",2)="L"
QUIT
+14 SET CNT=CNT+1
+15 DO SETTG(0,0,0,CNT)
+16 DO SETTG(R6247,R624701,0,DATA)
End DoDot:2
End DoDot:1
+17 QUIT
+18 ;
SETTG(R1,R2,SUB,VAL) ;
+1 ; Adds the Pre-Transport data node
+2 ; ^XTMP("XPDI",DA,"TEMP","LA6247",R6247,0)=0 node data
+3 ; ,R6247,1,R624701,0)=0 node data
+4 NEW NMSPC,CNT,NODE
+5 SET SUB=+$GET(SUB,0)
+6 SET NMSPC="LA6247"
+7 if '$DATA(XPDGREF)
QUIT
+8 SET NODE=XPDGREF
+9 SET NODE=$$TRIM^XLFSTR(NODE,"R",")")
+10 SET NODE=NODE_","""_NMSPC_""","_R1
+11 IF 'R1
SET NODE=NODE_")"
+12 IF R1
IF 'R2
SET NODE=NODE_",0)"
+13 IF R2
SET NODE=NODE_",1,"_R2_","_SUB_")"
+14 SET @NODE=VAL
+15 QUIT
+16 ;
+17 ;
GETLOCAL ;
+1 ; Called from Pre-Install
+2 ; Gets all Local and non-National codes from File #62.47 and saves them to TMP for restore in Post
+3 ; Also saves site's mapping of national entries to local files for antibiotics (#62.06)
+4 NEW CNT,DATA,DIERR,FDA,FLDIENS,LA72,MSG,R6247,R624701,X,X2
+5 ;
+6 KILL ^TMP("LA74-LOCAL",$JOB),^TMP("LA74-LOCAL-MAPPING",$JOB)
+7 ;
+8 SET (CNT,CNT(1),R6247)=0
+9 ;
FOR
SET R6247=$ORDER(^LAB(62.47,R6247))
if 'R6247
QUIT
Begin DoDot:1
+10 SET R624701=0
+11 ;
FOR
SET R624701=$ORDER(^LAB(62.47,R6247,1,R624701))
if 'R624701
QUIT
Begin DoDot:2
+12 SET DATA=$GET(^LAB(62.47,R6247,1,R624701,0))
+13 SET LA72=$GET(^LAB(62.47,R6247,1,R624701,2))
+14 ; don't process if a Local or non-national code, just save field 2.1 mapping
+15 IF +$PIECE(DATA,"^",5)=1
Begin DoDot:3
+16 IF $PIECE(LA72,"^")'=""
SET ^TMP("LA74-LOCAL-MAPPING",$JOB,"6247",R6247,1,R624701,2.1)=$PIECE(LA72,"^")
SET CNT(1)=CNT(1)+1
End DoDot:3
QUIT
+17 SET ^TMP("LA74-LOCAL",$JOB,"6247",R6247,0)=$GET(^LAB(62.47,R6247,0))
+18 KILL DATA,DIERR
+19 SET IENS=R624701_","_R6247_","
+20 DO GETS^DIQ(62.4701,IENS,"*","I","DATA","MSG")
+21 IF '$DATA(DATA)
QUIT
+22 SET FLD=.001
SET CNT=CNT+1
+23 ;
FOR
SET FLD=$ORDER(DATA(62.4701,IENS,FLD))
if FLD=""
QUIT
Begin DoDot:3
+24 SET X=$GET(DATA(62.4701,IENS,FLD,"I"))
+25 IF X'=""
SET ^TMP("LA74-LOCAL",$JOB,"6247",R6247,1,R624701,FLD)=X
End DoDot:3
End DoDot:2
End DoDot:1
+26 ;
+27 SET ^TMP("LA74-LOCAL",$JOB,"6247",0)=CNT
+28 SET ^TMP("LA74-LOCAL-MAPPING",$JOB,"6247",0)=CNT(1)
+29 ;
+30 QUIT
+31 ;
+32 ;
MES(STR,CJ,LM) ;
+1 ; Display a string using MES^XPDUTL
+2 ; Inputs
+3 ; STR: String to display
+4 ; CJ: Center text? 1=yes 0=1 <dflt=1>
+5 ; LM: Left Margin (padding)
+6 NEW X
+7 SET STR=$GET(STR)
+8 SET CJ=$GET(CJ,1)
+9 SET LM=$GET(LM)
+10 IF CJ
SET STR=$$TRIM^XLFSTR($$CJ^XLFSTR(STR,$GET(IOM,80)),"R"," ")
+11 IF 'CJ
IF LM
SET X=""
SET $PIECE(X," ",LM)=" "
SET STR=X_STR
+12 DO MES^XPDUTL(STR)
+13 QUIT