BLRINRPT ; IHS/MSC/MKK - IHS Lab Patch Reports ; 17-Oct-2014 09:22 ; MKK
;;5.2;IHS LABORATORY;**1034**;NOV 01, 1997;Build 88
;
EEP ; EP - Ersatz EP
D EEP^BLRGMENU
Q
;
EP ; EP
PEP ; EP
NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,U,XPARSYS,XQXFLG)
;
D SETBLRVS
;
D ADDTMENU^BLRGMENU("BACKUP^BLRINRPT","Backup Confirmed By")
D ADDTMENU^BLRGMENU("INSTALL^BLRINRPT","Installed By")
;
; Main Menu driver
D MENUDRVR^BLRGMENU("RPMS Lab","Patch Install Reports")
Q
;
BACKUP ; EP - Report on BACKUP CONFIRMED
NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,U,XPARSYS,XQXFLG)
;
D REPORT("BACKUP CONFIRMED BY","BACKUP")
;
Q
;
INSTALL ; EP - Report on INSTALLED BY
NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,U,XPARSYS,XQXFLG)
;
D REPORT("INSTALLED BY","INSTALL")
;
Q
;
;
; ============================= UTILITIES =============================
;
SETBLRVS(TWO) ; EP - Set BLRVERN variable(s). See BLRGMENU routine.
S BLRVERN=$TR($P($T(+1),";")," ")
S:$D(TWO) BLRVERN2=TWO
Q
;
REPORT(SUBSTR,TWO) ; EP - Produce the report
Q:$$INITVARS(SUBSTR_" Report",TWO)="Q"
;
F S PATCH=$O(^BLRINSTL("LAB PATCH",PATCH)) Q:PATCH<1!(QFLG="Q") D
. S (FOUNDIT,NUM)=0
. F S NUM=$O(^BLRINSTL("LAB PATCH",PATCH,SUBSTR,NUM)) Q:NUM<1!(QFLG="Q") D PRNTLINE(PATCH,SUBSTR,NUM)
. I FOUNDIT D LINER S PATCHCNT=PATCHCNT+1
;
D ^%ZISC
Q:QFLG="Q"
;
W !!,?9,PATCHCNT," Patches analyzed.",!
D PRESSKEY^BLRGMENU(9)
Q
;
INITVARS(SECONDH,SECONDV) ; EP - Initialization
D SETBLRVS($G(SECONDV))
;
S HEADER(1)="RPMS Lab Patch"
S HEADER(2)=SECONDH
;
D HEADERDT^BLRGMENU
D HEADONE^BLRGMENU(.HDRONE)
;
D ^%ZIS
U IO
;
S HEADER(3)=" "
;
S $E(HEADER(4),20)=$TR($$CJ^XLFSTR("@User@",43)," @","= ")
S $E(HEADER(5),5)="Patch"
S $E(HEADER(5),16)="#"
S $E(HEADER(5),20)="DUZ"
S $E(HEADER(5),30)="Name"
S $E(HEADER(5),65)="Date/Time"
;
S MAXLINES=IOSL-4,LINES=MAXLINES+10
S QFLG="NO"
S (CNT,PATCH,PATCHCNT,PG)=0
Q "OK"
;
PRNTLINE(PATCH,SUBSTR,NUM) ; EP - Line of Data
Q:$$PRNTLNBO(PATCH,SUBSTR,NUM)="Q"
;
S FOUNDIT=FOUNDIT+1
I LINES>MAXLINES D HEADERPG^BLRGMENU(.PG,.QFLG,HDRONE) Q:QFLG="Q"
;
W ?4,PATCH
W ?14,$J(NUM,2)
W ?19,USERDUZ
W ?29,USERNAME
W ?64,DATETIME
D LINERCNT
Q
;
PRNTLNBO(PATCH,SUBSTR,NUM) ; EP - Breakout variables
S STR=$G(^BLRINSTL("LAB PATCH",PATCH,SUBSTR,NUM))
S:STR'["^" USERNAME=STR,USERDUZ=""
S:STR["^" USERDUZ=$P(STR,"^"),USERNAME=$P(STR,"^",2)
Q:USERDUZ=""&(USERNAME="") "Q"
;
S DATETIME=$P($G(^BLRINSTL("LAB PATCH",PATCH,SUBSTR,NUM,"DATE/TIME")),":",1,2)
Q "OK"
;
LINER ; EP
W !
S LINES=LINES+1
Q
;
LINERCNT ; EP
W !
S LINES=LINES+1
S CNT=1+$G(CNT)
Q
BLRINRPT ; IHS/MSC/MKK - IHS Lab Patch Reports ; 17-Oct-2014 09:22 ; MKK
+1 ;;5.2;IHS LABORATORY;**1034**;NOV 01, 1997;Build 88
+2 ;
EEP ; EP - Ersatz EP
+1 DO EEP^BLRGMENU
+2 QUIT
+3 ;
EP ; EP
PEP ; EP
+1 NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,U,XPARSYS,XQXFLG)
+2 ;
+3 DO SETBLRVS
+4 ;
+5 DO ADDTMENU^BLRGMENU("BACKUP^BLRINRPT","Backup Confirmed By")
+6 DO ADDTMENU^BLRGMENU("INSTALL^BLRINRPT","Installed By")
+7 ;
+8 ; Main Menu driver
+9 DO MENUDRVR^BLRGMENU("RPMS Lab","Patch Install Reports")
+10 QUIT
+11 ;
BACKUP ; EP - Report on BACKUP CONFIRMED
+1 NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,U,XPARSYS,XQXFLG)
+2 ;
+3 DO REPORT("BACKUP CONFIRMED BY","BACKUP")
+4 ;
+5 QUIT
+6 ;
INSTALL ; EP - Report on INSTALLED BY
+1 NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,U,XPARSYS,XQXFLG)
+2 ;
+3 DO REPORT("INSTALLED BY","INSTALL")
+4 ;
+5 QUIT
+6 ;
+7 ;
+8 ; ============================= UTILITIES =============================
+9 ;
SETBLRVS(TWO) ; EP - Set BLRVERN variable(s). See BLRGMENU routine.
+1 SET BLRVERN=$TRANSLATE($PIECE($TEXT(+1),";")," ")
+2 IF $DATA(TWO)
SET BLRVERN2=TWO
+3 QUIT
+4 ;
REPORT(SUBSTR,TWO) ; EP - Produce the report
+1 IF $$INITVARS(SUBSTR_" Report",TWO)="Q"
QUIT
+2 ;
+3 FOR
SET PATCH=$ORDER(^BLRINSTL("LAB PATCH",PATCH))
IF PATCH<1!(QFLG="Q")
QUIT
Begin DoDot:1
+4 SET (FOUNDIT,NUM)=0
+5 FOR
SET NUM=$ORDER(^BLRINSTL("LAB PATCH",PATCH,SUBSTR,NUM))
IF NUM<1!(QFLG="Q")
QUIT
DO PRNTLINE(PATCH,SUBSTR,NUM)
+6 IF FOUNDIT
DO LINER
SET PATCHCNT=PATCHCNT+1
End DoDot:1
+7 ;
+8 DO ^%ZISC
+9 IF QFLG="Q"
QUIT
+10 ;
+11 WRITE !!,?9,PATCHCNT," Patches analyzed.",!
+12 DO PRESSKEY^BLRGMENU(9)
+13 QUIT
+14 ;
INITVARS(SECONDH,SECONDV) ; EP - Initialization
+1 DO SETBLRVS($GET(SECONDV))
+2 ;
+3 SET HEADER(1)="RPMS Lab Patch"
+4 SET HEADER(2)=SECONDH
+5 ;
+6 DO HEADERDT^BLRGMENU
+7 DO HEADONE^BLRGMENU(.HDRONE)
+8 ;
+9 DO ^%ZIS
+10 USE IO
+11 ;
+12 SET HEADER(3)=" "
+13 ;
+14 SET $EXTRACT(HEADER(4),20)=$TRANSLATE($$CJ^XLFSTR("@User@",43)," @","= ")
+15 SET $EXTRACT(HEADER(5),5)="Patch"
+16 SET $EXTRACT(HEADER(5),16)="#"
+17 SET $EXTRACT(HEADER(5),20)="DUZ"
+18 SET $EXTRACT(HEADER(5),30)="Name"
+19 SET $EXTRACT(HEADER(5),65)="Date/Time"
+20 ;
+21 SET MAXLINES=IOSL-4
SET LINES=MAXLINES+10
+22 SET QFLG="NO"
+23 SET (CNT,PATCH,PATCHCNT,PG)=0
+24 QUIT "OK"
+25 ;
PRNTLINE(PATCH,SUBSTR,NUM) ; EP - Line of Data
+1 IF $$PRNTLNBO(PATCH,SUBSTR,NUM)="Q"
QUIT
+2 ;
+3 SET FOUNDIT=FOUNDIT+1
+4 IF LINES>MAXLINES
DO HEADERPG^BLRGMENU(.PG,.QFLG,HDRONE)
IF QFLG="Q"
QUIT
+5 ;
+6 WRITE ?4,PATCH
+7 WRITE ?14,$JUSTIFY(NUM,2)
+8 WRITE ?19,USERDUZ
+9 WRITE ?29,USERNAME
+10 WRITE ?64,DATETIME
+11 DO LINERCNT
+12 QUIT
+13 ;
PRNTLNBO(PATCH,SUBSTR,NUM) ; EP - Breakout variables
+1 SET STR=$GET(^BLRINSTL("LAB PATCH",PATCH,SUBSTR,NUM))
+2 IF STR'["^"
SET USERNAME=STR
SET USERDUZ=""
+3 IF STR["^"
SET USERDUZ=$PIECE(STR,"^")
SET USERNAME=$PIECE(STR,"^",2)
+4 IF USERDUZ=""&(USERNAME="")
QUIT "Q"
+5 ;
+6 SET DATETIME=$PIECE($GET(^BLRINSTL("LAB PATCH",PATCH,SUBSTR,NUM,"DATE/TIME")),":",1,2)
+7 QUIT "OK"
+8 ;
LINER ; EP
+1 WRITE !
+2 SET LINES=LINES+1
+3 QUIT
+4 ;
LINERCNT ; EP
+1 WRITE !
+2 SET LINES=LINES+1
+3 SET CNT=1+$GET(CNT)
+4 QUIT