ONCSRVRP ;Hines OIFO/RVD - REGISTRY SERVER REPORT ;06/26/13
;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
;
TK ;Tasked [RS Registry Summary Reports - Today] report
S YR="T"
N G,W,ONCAC,ONCANA,ONCNON,ONCMI,ONCIN,ONCWA,ONCXD0,ONCDIV,X0,X1,X2
N ONCPA,ONCCO,START,END,XMY,XMTEXT,RPTDATE
K ^TMP($J)
S Y=DT D DD^%DT S RPTDATE=Y
S G=0,XD0=0 F S XD0=$O(^ONCO(165.5,"AG",G,XD0)) Q:XD0'>0 D
.S ONCDIV=$P(^DIC(4,$$DIV^ONCFUNC(XD0),0),U,1)
.I $P($G(^ONCO(165.5,XD0,7)),"^",2)'="A" D
..S:'$D(G(ONCDIV,G)) G(ONCDIV,G)=0
..S G(ONCDIV,G)=G(ONCDIV,G)+1
S G=1,XD0=0 F S XD0=$O(^ONCO(165.5,"AG",G,XD0)) Q:XD0'>0 D
.S ONCDIV=$P(^DIC(4,$$DIV^ONCFUNC(XD0),0),U,1)
.I $P($G(^ONCO(165.5,XD0,7)),"^",2)'="A" D
..S:'$D(G(ONCDIV,G)) G(ONCDIV,G)=0
..S G(ONCDIV,G)=G(ONCDIV,G)+1
S W=0,X0=0 F S X0=$O(^ONCO(160,"ADX",X0)) Q:'X0 S X1=0 F S X1=$O(^ONCO(160,"ADX",X0,X1)) Q:'X1 S X2=0 D
.F S X2=$O(^ONCO(160,"ADX",X0,X1,X2)) Q:'X2 D
..S ONCDIV=$P(^DIC(4,$$SUSDIV^ONCFUNC(X1,X2),0),U,1)
..S:'$D(W(ONCDIV)) W(ONCDIV)=0
..S W(ONCDIV)=W(ONCDIV)+1
F I=0,1,2,3,"A" S X0=0 F S X0=$O(^ONCO(165.5,"AS",I,X0)) Q:X0'>0 D
.S ONCDIV=$P(^DIC(4,$$DIV^ONCFUNC(X0),0),U,1)
.S:'$D(W(ONCDIV,I)) W(ONCDIV,I)=0
.S W(ONCDIV,I)=W(ONCDIV,I)+1
S ONCDIV="",I=0 F S ONCDIV=$O(G(ONCDIV)) Q:ONCDIV="" S ONCANA=$G(G(ONCDIV,1)),ONCNON=$G(G(ONCDIV,0)) D
.S I=I+1
.S:ONCANA="" ONCANA=0 S:ONCNON="" ONCNON=0
.S ^TMP($J,"ONCPRT",I)="REGISTRY SUMMARY REPORT (Today) for: "_ONCDIV_" Run Date: "_RPTDATE
.S ONCAC=$G(W(ONCDIV,"A")),ONCIN=$G(W(ONCDIV,0)),ONCMI=$G(W(ONCDIV,1)),ONCPA=$G(W(ONCDIV,2))
.S ONCCO=$G(W(ONCDIV,3)),ONCWA=$G(W(ONCDIV))
.S:ONCWA="" ONCWA=0 S:ONCCO="" ONCCO=0 S:ONCPA="" ONCPA=0 S:ONCMI="" ONCMI=0 S:ONCIN="" ONCIN=0
.S:ONCAC="" ONCAC=0
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=""
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=""
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=" Analytical: "_$J(ONCANA,5)
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=""
.S I=I+1
.S ^TMP($J,"ONCPRT",I)="Non-Analytical: "_$J(ONCNON,5)
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=""
.S I=I+1
.S ^TMP($J,"ONCPRT",I)="Accession Only: "_$J(ONCAC,5)
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=""
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=" ------",I=I+1
.S ^TMP($J,"ONCPRT",I)=""
.S I=I+1
.S ^TMP($J,"ONCPRT",I)="Total: "_$J(ONCANA+ONCNON+ONCAC,5)
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=""
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=""
.S I=I+1
.S ^TMP($J,"ONCPRT",I)="WORKLOAD STATITICS"
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=""
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=""
.S I=I+1
.S ^TMP($J,"ONCPRT",I)="Suspense: "_ONCWA
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=""
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=""
.S I=I+1
.S ^TMP($J,"ONCPRT",I)="Incomplete: "_ONCIN_" Minimal: "_ONCMI_" Partial: "_ONCPA_" Complete: "_ONCCO
.S ^TMP($J,"ONCPRT",I)=^TMP($J,"ONCPRT",I)_" Acc Only: "_ONCAC
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=""
.S I=I+1
.S ^TMP($J,"ONCPRT",I)="--------------"
.S I=I+1
.S ^TMP($J,"ONCPRT",I)="",I=I+1
.S ^TMP($J,"ONCPRT",I)="Total: "_$J(ONCIN+ONCMI+ONCPA+ONCCO+ONCAC,5)
.S I=I+1
.S ^TMP($J,"ONCPRT",I)=""
D MAIL
Q
;
W !!?30,"Analytical: ",$J(G(1),5)
W !?26,"Non-Analytical: ",$J(G(0),5)
W !?26,"Accession Only: ",$J(W("A"),5)
W !?42,"-----"
W !?35,"Total: ",$J(G(0)+G(1)+W("A"),5),!!
W !,?30,"WORKLOAD STATISTICS",!!
W "Suspense: ",W,!!,"Incomplete: ",W(0),?19,"Minimal: ",W(1),?34,"Partial: ",W(2),?49,"Complete: ",W(3),?65,"Acc Only: ",W("A"),!
W "---------------",!,"Total: ",W(0)+W(1)+W(2)+W(3)+W("A")
Q
;
MAIL ;email report to Oncology
S XMDUZ=.5
D REC^ONCSRV ;get recipients
S XMSUB="Oncology Registry Summary Report (Today)"
S XMTEXT="^TMP($J,""ONCPRT"","
D ^XMD
K XMTEXT,XMY,XMSUB
Q
;
DIVID ;DIVISION (160.1,6) identifier
Q
;
EX ;EXIT
;K ^TMP($J)
Q
;
CLEANUP ;Cleanup
K %ZIS,ACO
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONCSRVRP 3868 printed Nov 22, 2024@17:38:47 Page 2
ONCSRVRP ;Hines OIFO/RVD - REGISTRY SERVER REPORT ;06/26/13
+1 ;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
+2 ;
TK ;Tasked [RS Registry Summary Reports - Today] report
+1 SET YR="T"
+2 NEW G,W,ONCAC,ONCANA,ONCNON,ONCMI,ONCIN,ONCWA,ONCXD0,ONCDIV,X0,X1,X2
+3 NEW ONCPA,ONCCO,START,END,XMY,XMTEXT,RPTDATE
+4 KILL ^TMP($JOB)
+5 SET Y=DT
DO DD^%DT
SET RPTDATE=Y
+6 SET G=0
SET XD0=0
FOR
SET XD0=$ORDER(^ONCO(165.5,"AG",G,XD0))
if XD0'>0
QUIT
Begin DoDot:1
+7 SET ONCDIV=$PIECE(^DIC(4,$$DIV^ONCFUNC(XD0),0),U,1)
+8 IF $PIECE($GET(^ONCO(165.5,XD0,7)),"^",2)'="A"
Begin DoDot:2
+9 if '$DATA(G(ONCDIV,G))
SET G(ONCDIV,G)=0
+10 SET G(ONCDIV,G)=G(ONCDIV,G)+1
End DoDot:2
End DoDot:1
+11 SET G=1
SET XD0=0
FOR
SET XD0=$ORDER(^ONCO(165.5,"AG",G,XD0))
if XD0'>0
QUIT
Begin DoDot:1
+12 SET ONCDIV=$PIECE(^DIC(4,$$DIV^ONCFUNC(XD0),0),U,1)
+13 IF $PIECE($GET(^ONCO(165.5,XD0,7)),"^",2)'="A"
Begin DoDot:2
+14 if '$DATA(G(ONCDIV,G))
SET G(ONCDIV,G)=0
+15 SET G(ONCDIV,G)=G(ONCDIV,G)+1
End DoDot:2
End DoDot:1
+16 SET W=0
SET X0=0
FOR
SET X0=$ORDER(^ONCO(160,"ADX",X0))
if 'X0
QUIT
SET X1=0
FOR
SET X1=$ORDER(^ONCO(160,"ADX",X0,X1))
if 'X1
QUIT
SET X2=0
Begin DoDot:1
+17 FOR
SET X2=$ORDER(^ONCO(160,"ADX",X0,X1,X2))
if 'X2
QUIT
Begin DoDot:2
+18 SET ONCDIV=$PIECE(^DIC(4,$$SUSDIV^ONCFUNC(X1,X2),0),U,1)
+19 if '$DATA(W(ONCDIV))
SET W(ONCDIV)=0
+20 SET W(ONCDIV)=W(ONCDIV)+1
End DoDot:2
End DoDot:1
+21 FOR I=0,1,2,3,"A"
SET X0=0
FOR
SET X0=$ORDER(^ONCO(165.5,"AS",I,X0))
if X0'>0
QUIT
Begin DoDot:1
+22 SET ONCDIV=$PIECE(^DIC(4,$$DIV^ONCFUNC(X0),0),U,1)
+23 if '$DATA(W(ONCDIV,I))
SET W(ONCDIV,I)=0
+24 SET W(ONCDIV,I)=W(ONCDIV,I)+1
End DoDot:1
+25 SET ONCDIV=""
SET I=0
FOR
SET ONCDIV=$ORDER(G(ONCDIV))
if ONCDIV=""
QUIT
SET ONCANA=$GET(G(ONCDIV,1))
SET ONCNON=$GET(G(ONCDIV,0))
Begin DoDot:1
+26 SET I=I+1
+27 if ONCANA=""
SET ONCANA=0
if ONCNON=""
SET ONCNON=0
+28 SET ^TMP($JOB,"ONCPRT",I)="REGISTRY SUMMARY REPORT (Today) for: "_ONCDIV_" Run Date: "_RPTDATE
+29 SET ONCAC=$GET(W(ONCDIV,"A"))
SET ONCIN=$GET(W(ONCDIV,0))
SET ONCMI=$GET(W(ONCDIV,1))
SET ONCPA=$GET(W(ONCDIV,2))
+30 SET ONCCO=$GET(W(ONCDIV,3))
SET ONCWA=$GET(W(ONCDIV))
+31 if ONCWA=""
SET ONCWA=0
if ONCCO=""
SET ONCCO=0
if ONCPA=""
SET ONCPA=0
if ONCMI=""
SET ONCMI=0
if ONCIN=""
SET ONCIN=0
+32 if ONCAC=""
SET ONCAC=0
+33 SET I=I+1
+34 SET ^TMP($JOB,"ONCPRT",I)=""
+35 SET I=I+1
+36 SET ^TMP($JOB,"ONCPRT",I)=""
+37 SET I=I+1
+38 SET ^TMP($JOB,"ONCPRT",I)=" Analytical: "_$JUSTIFY(ONCANA,5)
+39 SET I=I+1
+40 SET ^TMP($JOB,"ONCPRT",I)=""
+41 SET I=I+1
+42 SET ^TMP($JOB,"ONCPRT",I)="Non-Analytical: "_$JUSTIFY(ONCNON,5)
+43 SET I=I+1
+44 SET ^TMP($JOB,"ONCPRT",I)=""
+45 SET I=I+1
+46 SET ^TMP($JOB,"ONCPRT",I)="Accession Only: "_$JUSTIFY(ONCAC,5)
+47 SET I=I+1
+48 SET ^TMP($JOB,"ONCPRT",I)=""
+49 SET I=I+1
+50 SET ^TMP($JOB,"ONCPRT",I)=" ------"
SET I=I+1
+51 SET ^TMP($JOB,"ONCPRT",I)=""
+52 SET I=I+1
+53 SET ^TMP($JOB,"ONCPRT",I)="Total: "_$JUSTIFY(ONCANA+ONCNON+ONCAC,5)
+54 SET I=I+1
+55 SET ^TMP($JOB,"ONCPRT",I)=""
+56 SET I=I+1
+57 SET ^TMP($JOB,"ONCPRT",I)=""
+58 SET I=I+1
+59 SET ^TMP($JOB,"ONCPRT",I)="WORKLOAD STATITICS"
+60 SET I=I+1
+61 SET ^TMP($JOB,"ONCPRT",I)=""
+62 SET I=I+1
+63 SET ^TMP($JOB,"ONCPRT",I)=""
+64 SET I=I+1
+65 SET ^TMP($JOB,"ONCPRT",I)="Suspense: "_ONCWA
+66 SET I=I+1
+67 SET ^TMP($JOB,"ONCPRT",I)=""
+68 SET I=I+1
+69 SET ^TMP($JOB,"ONCPRT",I)=""
+70 SET I=I+1
+71 SET ^TMP($JOB,"ONCPRT",I)="Incomplete: "_ONCIN_" Minimal: "_ONCMI_" Partial: "_ONCPA_" Complete: "_ONCCO
+72 SET ^TMP($JOB,"ONCPRT",I)=^TMP($JOB,"ONCPRT",I)_" Acc Only: "_ONCAC
+73 SET I=I+1
+74 SET ^TMP($JOB,"ONCPRT",I)=""
+75 SET I=I+1
+76 SET ^TMP($JOB,"ONCPRT",I)="--------------"
+77 SET I=I+1
+78 SET ^TMP($JOB,"ONCPRT",I)=""
SET I=I+1
+79 SET ^TMP($JOB,"ONCPRT",I)="Total: "_$JUSTIFY(ONCIN+ONCMI+ONCPA+ONCCO+ONCAC,5)
+80 SET I=I+1
+81 SET ^TMP($JOB,"ONCPRT",I)=""
End DoDot:1
+82 DO MAIL
+83 QUIT
+84 ;
+85 WRITE !!?30,"Analytical: ",$JUSTIFY(G(1),5)
+86 WRITE !?26,"Non-Analytical: ",$JUSTIFY(G(0),5)
+87 WRITE !?26,"Accession Only: ",$JUSTIFY(W("A"),5)
+88 WRITE !?42,"-----"
+89 WRITE !?35,"Total: ",$JUSTIFY(G(0)+G(1)+W("A"),5),!!
+90 WRITE !,?30,"WORKLOAD STATISTICS",!!
+91 WRITE "Suspense: ",W,!!,"Incomplete: ",W(0),?19,"Minimal: ",W(1),?34,"Partial: ",W(2),?49,"Complete: ",W(3),?65,"Acc Only: ",W("A"),!
+92 WRITE "---------------",!,"Total: ",W(0)+W(1)+W(2)+W(3)+W("A")
+93 QUIT
+94 ;
MAIL ;email report to Oncology
+1 SET XMDUZ=.5
+2 ;get recipients
DO REC^ONCSRV
+3 SET XMSUB="Oncology Registry Summary Report (Today)"
+4 SET XMTEXT="^TMP($J,""ONCPRT"","
+5 DO ^XMD
+6 KILL XMTEXT,XMY,XMSUB
+7 QUIT
+8 ;
DIVID ;DIVISION (160.1,6) identifier
+1 QUIT
+2 ;
EX ;EXIT
+1 ;K ^TMP($J)
+2 QUIT
+3 ;
CLEANUP ;Cleanup
+1 KILL %ZIS,ACO
+2 QUIT