ONCOSA ;Hines OIFO - ANNUAL CROSS TABS-CANNED REPORTS ;9/3/93
;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
ACT ;ANNUAL CROSS TABS
W @IOF,!!!?21,"CROSS TABS for ANNUAL Reports"
W !?25,"requires definition of"
W !?22,"YEAR and Row for all TABLES"
Y S BYR=$O(^ONCO(165.5,"AY",0)) F YR=$E(DT,1)+17_$E(DT,2,3)-1:-1:BYR-1 S EYR=$O(^ONCO(165.5,"AY",YR)) Q:EYR'=""
;
A W !! K DIR S YR=$E(DT,1)+17_$E(DT,2,3),DIR("A")=" Select YEAR for Cross Tab Reports",DIR("B")=$E(DT,1)+17_$E(DT,2,3)-1,DIR(0)="N^"_BYR_":"_EYR D ^DIR G EX:Y["^"!(Y=""),A:Y>YR,A:Y'?1.N S ONCOS("YR")=Y_"^"_Y
ST W !! K DIR S DIR(0)="L^"_BYR_":"_EYR,DIR("A")=" Specify Time Frame for Total Registry" D ^DIR Q:Y["^"!(Y="") S N=$L(Y,",")-1,Y1=$P(Y,","),Y2=$P(Y,",",N)
;TASK RANGE
W !!?20,"Year for Annual Report is: ",+ONCOS("YR"),!!?20,"Complete Registry is "_Y1_" to "_Y2,!! K DIR S DIR("A")=" Definitions OK",DIR(0)="Yes",DIR("B")="Y" D ^DIR Q:Y="^"!(Y="") G A:Y=0 S ONCOS("RG")=Y1_"^"_Y2
;
ROW ;SELECT ROW
K DIR S DIR("A")=" Select Row",DIR(0)="SO^1:PRIMARY SITE/GP;2:ICDO-SITE;3:ICDO-TOPOGRAPHY;4:SELECTED SITES;5:SYSTEMS" D ^DIR G EX:Y="^"!(Y="") S ONCOS("R")=$P($P(DIR(0),";",Y),":",2)
K DIR S DIR("A")=" Percentages",DIR(0)="Y" W ! D ^DIR G EX:Y="^"!(Y="") S ONCOS("P")=$S(Y=0:"",1:1)
QUE ;QUE to run report
W !!!?10,"-QUE ('Q') to run this report at night.",!?10,"-Ask your IRM for the appropriate time.",!!
K IO("Q"),IOP S %ZIS="Q",%ZIS("A")=" Select Device to Print Annual Cross Tabs: " D ^%ZIS S IOP=ION I POP S ONCOUT="" G EX
I '$D(IO("Q")) D TSK^ONCOSA1 G EX
S ONCOION=ION,ONCOIOM=IOM,ZTSAVE("ONCOION")="",ZTSAVE("ONCOIOM")="",ZTRTN="TSK^ONCOSA1",ZTDESC="ONCOLOGY ANNUAL CROSS TABS",ZTSAVE("ONCOS*")="" D ^%ZTLOAD K ZTSK G EX
;
EX ;EXIT TASK
K DIR,ONCOS,RG,CT,YR,BYR,EYR,CC,G,GLO,HEAD,J,NM,O11,OC,OS,OT,RC,ROWDEF
K SX,T,TX,W,Y2,%DT,%T,%ZISOS,Y2,ONCOIOM,ONCOION
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONCOSA 1899 printed Nov 22, 2024@17:35:31 Page 2
ONCOSA ;Hines OIFO - ANNUAL CROSS TABS-CANNED REPORTS ;9/3/93
+1 ;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
ACT ;ANNUAL CROSS TABS
+1 WRITE @IOF,!!!?21,"CROSS TABS for ANNUAL Reports"
+2 WRITE !?25,"requires definition of"
+3 WRITE !?22,"YEAR and Row for all TABLES"
Y SET BYR=$ORDER(^ONCO(165.5,"AY",0))
FOR YR=$EXTRACT(DT,1)+17_$EXTRACT(DT,2,3)-1:-1:BYR-1
SET EYR=$ORDER(^ONCO(165.5,"AY",YR))
if EYR'=""
QUIT
+1 ;
A WRITE !!
KILL DIR
SET YR=$EXTRACT(DT,1)+17_$EXTRACT(DT,2,3)
SET DIR("A")=" Select YEAR for Cross Tab Reports"
SET DIR("B")=$EXTRACT(DT,1)+17_$EXTRACT(DT,2,3)-1
SET DIR(0)="N^"_BYR_":"_EYR
DO ^DIR
if Y["^"!(Y="")
GOTO EX
if Y>YR
GOTO A
if Y'?1.N
GOTO A
SET ONCOS("YR")=Y_"^"_Y
ST WRITE !!
KILL DIR
SET DIR(0)="L^"_BYR_":"_EYR
SET DIR("A")=" Specify Time Frame for Total Registry"
DO ^DIR
if Y["^"!(Y="")
QUIT
SET N=$LENGTH(Y,",")-1
SET Y1=$PIECE(Y,",")
SET Y2=$PIECE(Y,",",N)
+1 ;TASK RANGE
+2 WRITE !!?20,"Year for Annual Report is: ",+ONCOS("YR"),!!?20,"Complete Registry is "_Y1_" to "_Y2,!!
KILL DIR
SET DIR("A")=" Definitions OK"
SET DIR(0)="Yes"
SET DIR("B")="Y"
DO ^DIR
if Y="^"!(Y="")
QUIT
if Y=0
GOTO A
SET ONCOS("RG")=Y1_"^"_Y2
+3 ;
ROW ;SELECT ROW
+1 KILL DIR
SET DIR("A")=" Select Row"
SET DIR(0)="SO^1:PRIMARY SITE/GP;2:ICDO-SITE;3:ICDO-TOPOGRAPHY;4:SELECTED SITES;5:SYSTEMS"
DO ^DIR
if Y="^"!(Y="")
GOTO EX
SET ONCOS("R")=$PIECE($PIECE(DIR(0),";",Y),":",2)
+2 KILL DIR
SET DIR("A")=" Percentages"
SET DIR(0)="Y"
WRITE !
DO ^DIR
if Y="^"!(Y="")
GOTO EX
SET ONCOS("P")=$SELECT(Y=0:"",1:1)
QUE ;QUE to run report
+1 WRITE !!!?10,"-QUE ('Q') to run this report at night.",!?10,"-Ask your IRM for the appropriate time.",!!
+2 KILL IO("Q"),IOP
SET %ZIS="Q"
SET %ZIS("A")=" Select Device to Print Annual Cross Tabs: "
DO ^%ZIS
SET IOP=ION
IF POP
SET ONCOUT=""
GOTO EX
+3 IF '$DATA(IO("Q"))
DO TSK^ONCOSA1
GOTO EX
+4 SET ONCOION=ION
SET ONCOIOM=IOM
SET ZTSAVE("ONCOION")=""
SET ZTSAVE("ONCOIOM")=""
SET ZTRTN="TSK^ONCOSA1"
SET ZTDESC="ONCOLOGY ANNUAL CROSS TABS"
SET ZTSAVE("ONCOS*")=""
DO ^%ZTLOAD
KILL ZTSK
GOTO EX
+5 ;
EX ;EXIT TASK
+1 KILL DIR,ONCOS,RG,CT,YR,BYR,EYR,CC,G,GLO,HEAD,J,NM,O11,OC,OS,OT,RC,ROWDEF
+2 KILL SX,T,TX,W,Y2,%DT,%T,%ZISOS,Y2,ONCOIOM,ONCOION
+3 QUIT