KMPRPN03 ;OAK/RAK - Print Package RUM Stats ;11/19/04 09:01
;;2.0;CAPACITY MANAGEMENT - RUM;**1**;May 28, 2003
EN ;-- entry point.
;
N %ZIS,CONT,DIR,KMPRDATE,KMPRNAM,MESSAGE,POP
N X,Y,ZTDESC,ZTRTN,ZTSAVE,ZTSK
;
D HDR^KMPDUTL4(" Package Resource Usage ")
W !,?2,"This option will display the package Resource Usage Monitor statistics.",!
W ?2,"The printout summarizes the statistics of the options, protocols and",!
W ?2,"tasks for a selected namespace as percentages.",!!
;
K DIR S DIR(0)="FO^1:999:0^K:X="" "" X"
S DIR("A")="Select Package Namespace (case sensitive)"
D ^DIR Q:Y=""!(Y="^")
S KMPRNAM=Y
;
; determine start date from file 8970.1
D RUMDATES^KMPRUTL(.KMPRDATE)
Q:'KMPRDATE
;
; select output device.
S %ZIS="Q",%ZIS("A")="Device: ",%ZIS("B")="HOME"
W ! D ^%ZIS I POP W !,"No action taken." Q
; if queued.
I $D(IO("Q")) K IO("Q") D Q
.S ZTDESC="RUM Package Resource Usage for '"_KMPRNAM_"'."
.S ZTRTN="EN1^KMPRPN03"
.S ZTSAVE("KMPRDATE")="",ZTSAVE("KMPRNAM")=""
.D ^%ZTLOAD W:$G(ZTSK) !,"Task #",ZTSK
.D EXIT
;
; if output to terminal display message.
W:$E(IOST,1,2)="C-" !?3,"compiling data for: "
;
EN1 ;-- entry point from taskman.
;
Q:'$G(KMPRDATE)
Q:$G(KMPRNAM)=""
;
N DOTS,ELEMENT,KMPRARRY
;
S DOTS=$S($E(IOST,1,2)="C-":0,1:1)
D ELEARRY^KMPRUTL("ELEMENT") Q:'$D(ELEMENT)
S KMPRARRY=$NA(^TMP("KMPR PKG %",$J))
K @KMPRARRY
D PKGDATA^KMPRUTL2(KMPRNAM,$P(KMPRDATE,U),$P(KMPRDATE,U,2),KMPRARRY,DOTS)
D PRINT,EXIT
K @KMPRARRY
;
Q
;
EXIT ;
S:$D(ZTQUEUED) ZTREQ="@"
D ^%ZISC
K KMPUDATE,KMPUNAM
;
Q
;
PRINT ;-- print data from KMPRARRY.
;
Q:'$D(ELEMENT)
Q:$G(KMPRARRY)=""
;
U IO
;
I '$D(@KMPRARRY) D HDR W !,"<<<No Data to Report>>>" Q
;
N DATA,I,NODE,PIECE,SITE,TOTALS,TYP
;
; facility name.
S SITE=$P($$SITE^VASITE,U,2)
S NODE="",CONT=1
F S NODE=$O(@KMPRARRY@(NODE)) Q:NODE="" D Q:'CONT
.D HDR S I=0
.F S I=$O(ELEMENT(I)) Q:'I D Q:'CONT
..W !,$P(ELEMENT(I),U) S PIECE=$P(ELEMENT(I),U,2)
..S TOTALS=$P($G(@KMPRARRY@(NODE,"TOTALS")),U,PIECE)
..F TYP=KMPRNAM,"PRTCL","RPC","HL7","TASK","OTH" D
...S DATA=$P($G(@KMPRARRY@(NODE,TYP)),U,PIECE)
...W ?($S(TYP=KMPRNAM:20,TYP="PRTCL":30,TYP="RPC":40,TYP="HL7":50,TYP="TASK":60,1:70))
...W $J($S('TOTALS:"n/a",1:$FN(DATA/TOTALS*100,"",1)),6)
.;
.; back to NODE level.
.; if no more entries send message else use default.
.S MESSAGE=""
.S:$O(@KMPRARRY@(NODE))="" MESSAGE="Press RETURN to continue"
.D CONTINUE^KMPDUTL4(MESSAGE,2,.CONT)
;
Q
;
HDR ;
W:$Y @IOF
W !?29,"Package Resource Usage"
W !?(80-$L($G(SITE))\2),$G(SITE)
W !?17,"Node ",$G(NODE)," from ",$P(KMPRDATE,U,3)," to ",$P(KMPRDATE,U,4)
W !?(80-($L(KMPRNAM)+12)\2),"'",KMPRNAM,"' Namespace"
W !
W !?20," % ",?30," % ",?40," % ",?50," % ",?60," % ",?70,"All Other"
W !?20,"Options",?30,"Protocols",?40," RPC",?50," HL7",?60," Tasks",?70,"Packages"
W !
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPRPN03 3004 printed Dec 13, 2024@01:41:41 Page 2
KMPRPN03 ;OAK/RAK - Print Package RUM Stats ;11/19/04 09:01
+1 ;;2.0;CAPACITY MANAGEMENT - RUM;**1**;May 28, 2003
EN ;-- entry point.
+1 ;
+2 NEW %ZIS,CONT,DIR,KMPRDATE,KMPRNAM,MESSAGE,POP
+3 NEW X,Y,ZTDESC,ZTRTN,ZTSAVE,ZTSK
+4 ;
+5 DO HDR^KMPDUTL4(" Package Resource Usage ")
+6 WRITE !,?2,"This option will display the package Resource Usage Monitor statistics.",!
+7 WRITE ?2,"The printout summarizes the statistics of the options, protocols and",!
+8 WRITE ?2,"tasks for a selected namespace as percentages.",!!
+9 ;
+10 KILL DIR
SET DIR(0)="FO^1:999:0^K:X="" "" X"
+11 SET DIR("A")="Select Package Namespace (case sensitive)"
+12 DO ^DIR
if Y=""!(Y="^")
QUIT
+13 SET KMPRNAM=Y
+14 ;
+15 ; determine start date from file 8970.1
+16 DO RUMDATES^KMPRUTL(.KMPRDATE)
+17 if 'KMPRDATE
QUIT
+18 ;
+19 ; select output device.
+20 SET %ZIS="Q"
SET %ZIS("A")="Device: "
SET %ZIS("B")="HOME"
+21 WRITE !
DO ^%ZIS
IF POP
WRITE !,"No action taken."
QUIT
+22 ; if queued.
+23 IF $DATA(IO("Q"))
KILL IO("Q")
Begin DoDot:1
+24 SET ZTDESC="RUM Package Resource Usage for '"_KMPRNAM_"'."
+25 SET ZTRTN="EN1^KMPRPN03"
+26 SET ZTSAVE("KMPRDATE")=""
SET ZTSAVE("KMPRNAM")=""
+27 DO ^%ZTLOAD
if $GET(ZTSK)
WRITE !,"Task #",ZTSK
+28 DO EXIT
End DoDot:1
QUIT
+29 ;
+30 ; if output to terminal display message.
+31 if $EXTRACT(IOST,1,2)="C-"
WRITE !?3,"compiling data for: "
+32 ;
EN1 ;-- entry point from taskman.
+1 ;
+2 if '$GET(KMPRDATE)
QUIT
+3 if $GET(KMPRNAM)=""
QUIT
+4 ;
+5 NEW DOTS,ELEMENT,KMPRARRY
+6 ;
+7 SET DOTS=$SELECT($EXTRACT(IOST,1,2)="C-":0,1:1)
+8 DO ELEARRY^KMPRUTL("ELEMENT")
if '$DATA(ELEMENT)
QUIT
+9 SET KMPRARRY=$NAME(^TMP("KMPR PKG %",$JOB))
+10 KILL @KMPRARRY
+11 DO PKGDATA^KMPRUTL2(KMPRNAM,$PIECE(KMPRDATE,U),$PIECE(KMPRDATE,U,2),KMPRARRY,DOTS)
+12 DO PRINT
DO EXIT
+13 KILL @KMPRARRY
+14 ;
+15 QUIT
+16 ;
EXIT ;
+1 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 DO ^%ZISC
+3 KILL KMPUDATE,KMPUNAM
+4 ;
+5 QUIT
+6 ;
PRINT ;-- print data from KMPRARRY.
+1 ;
+2 if '$DATA(ELEMENT)
QUIT
+3 if $GET(KMPRARRY)=""
QUIT
+4 ;
+5 USE IO
+6 ;
+7 IF '$DATA(@KMPRARRY)
DO HDR
WRITE !,"<<<No Data to Report>>>"
QUIT
+8 ;
+9 NEW DATA,I,NODE,PIECE,SITE,TOTALS,TYP
+10 ;
+11 ; facility name.
+12 SET SITE=$PIECE($$SITE^VASITE,U,2)
+13 SET NODE=""
SET CONT=1
+14 FOR
SET NODE=$ORDER(@KMPRARRY@(NODE))
if NODE=""
QUIT
Begin DoDot:1
+15 DO HDR
SET I=0
+16 FOR
SET I=$ORDER(ELEMENT(I))
if 'I
QUIT
Begin DoDot:2
+17 WRITE !,$PIECE(ELEMENT(I),U)
SET PIECE=$PIECE(ELEMENT(I),U,2)
+18 SET TOTALS=$PIECE($GET(@KMPRARRY@(NODE,"TOTALS")),U,PIECE)
+19 FOR TYP=KMPRNAM,"PRTCL","RPC","HL7","TASK","OTH"
Begin DoDot:3
+20 SET DATA=$PIECE($GET(@KMPRARRY@(NODE,TYP)),U,PIECE)
+21 WRITE ?($SELECT(TYP=KMPRNAM:20,TYP="PRTCL":30,TYP="RPC":40,TYP="HL7":50,TYP="TASK":60,1:70))
+22 WRITE $JUSTIFY($SELECT('TOTALS:"n/a",1:$FNUMBER(DATA/TOTALS*100,"",1)),6)
End DoDot:3
End DoDot:2
if 'CONT
QUIT
+23 ;
+24 ; back to NODE level.
+25 ; if no more entries send message else use default.
+26 SET MESSAGE=""
+27 if $ORDER(@KMPRARRY@(NODE))=""
SET MESSAGE="Press RETURN to continue"
+28 DO CONTINUE^KMPDUTL4(MESSAGE,2,.CONT)
End DoDot:1
if 'CONT
QUIT
+29 ;
+30 QUIT
+31 ;
HDR ;
+1 if $Y
WRITE @IOF
+2 WRITE !?29,"Package Resource Usage"
+3 WRITE !?(80-$LENGTH($GET(SITE))\2),$GET(SITE)
+4 WRITE !?17,"Node ",$GET(NODE)," from ",$PIECE(KMPRDATE,U,3)," to ",$PIECE(KMPRDATE,U,4)
+5 WRITE !?(80-($LENGTH(KMPRNAM)+12)\2),"'",KMPRNAM,"' Namespace"
+6 WRITE !
+7 WRITE !?20," % ",?30," % ",?40," % ",?50," % ",?60," % ",?70,"All Other"
+8 WRITE !?20,"Options",?30,"Protocols",?40," RPC",?50," HL7",?60," Tasks",?70,"Packages"
+9 WRITE !
+10 ;
+11 QUIT