ONCOSC ;WASH ISC/SRR,MLH-CROSS TAB REPORTS ;9/29/93 11:40
;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
ST ;Start
H W !!!,?10,"CROSS TABS for Total Registry",!!
AN ;ANNUAL (call ONCOST for time frames)
S ONCOT=1 D TF^ONCOST G EX:$D(DIRUT) S TF=ONCOS("YR"),YR=$S(TF="ALL":" ",1:" ANNUAL ") I TF'="ALL" S BYR=$P(TF,U),EYR=$P(TF,U,2),EYR=$S(BYR=EYR:EYR,1:EYR)
S HEAD=$S(TF="ALL":"ALL",BYR=EYR:BYR,1:BYR_"-"_EYR)
CAT K DIR S DIR("A")=" Select CLASS Category",DIR(0)="SO^N:Non-Analytic;A:Analytic;T:All Cases" D ^DIR G EX:Y="^"!(Y="")
S GP=$S(Y="A":1,Y="N":0,1:2),G=$P($P(DIR(0),";",GP+1),":",2)
Q
TR ;TOTAL REGISTRY CROSS TABS
S R="TR" D ST G EX:$D(DIRUT) W !!?10,"Using ICDO-SITE for Rows...Select column:",! S ROW="ICDO-SITE"
D COL G EX:$D(DIRUT) D PER G EX:$D(DIRUT) G ASK
CR ;DETERMINE CROSS TAB
S R="CR" D ST G EX:$D(DIRUT) D ROW G EX:$D(DIRUT) D COL G EX:$D(DIRUT) D PER G EX:$D(DIRUT) G ASK
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;6:HISTOLOGY (ICD-O-3)" D ^DIR Q:$D(DIRUT) S ROW=$P($P(DIR(0),";",Y),":",2) Q
COL K DIR S DIR("A")="Select Column",S="S^0:ACCESSION YEAR;1:CLASS OF CASE;2:STATUS;3:SEX;4:RACE;5:RACE-SEX;6:DX AGE-GP;7:PLACE OF BIRTH;8:MARITAL STATUS AT DX;9:STATE;10:ST-COUNTY"
S DIR(0)=S_$S($G(GP)'=1:";11:CLASS CATEGORY;12:ALL of the ABOVE",1:";11:STAGE GROUPING-AJCC;12:TREATMENT PLAN;13:SUMMARY STAGE;14:HISTOLOGY (ICD-O-3);15:ALL of the ABOVE") K S
D ^DIR Q:$D(DIRUT) S C=Y,XCOL=DIR(0),COL=$P($P(XCOL,";",C+1),":",2)
Q
PER K DIR S DIR("A")=" Percentages",DIR(0)="Y" W ! D ^DIR Q:$D(DIRUT) S PER=$S(Y=0:"",1:1)
Q
ASK W !!,?6,"CROSS TABS: "_ROW_" vs "_COL
W !!?11,"TOTAL: "_$P($G(G)," ")_" Cases in Registry",!!?11,"Years: ",$G(HEAD),!!
S DIR("A")="Conditions OK",DIR(0)="Y",DIR("B")="Yes" D ^DIR G EX:$D(DIRUT),@R:'Y
S ONCOS("C")=$S($E(COL,1,3)="ALL":"ALL",1:COL),ONCOS("R")=ROW,ONCOS("P")=PER,ONCOS("GP")=GP I ONCOS("C")="ALL" S ONCOS("CT")=XCOL
QUE ;Template in use
W !!?15,"QUE ('Q') report unless to 'home' device",!!
K IO("Q") S %ZIS="Q",%ZIS("A")=" Select Device to Print Cross Tabs: " W !! D ^%ZIS S IOP=ION I POP S ONCOUT="" G EX
I '$D(IO("Q")) D TOT^ONCOSC1 G EX
S ZTRTN="TOT^ONCOSC1",ZTDESC="ONCOLOGY CROSS TABS ALL",ZTSAVE("*")="" D ^%ZTLOAD K ZTSK G EX
EX ;EXIT
K IOP,ONCOT,ONCOS,XDA,XD,N,G,TEM,PER,COL,ROW,R,%DT,BYR,EYR,GLO,OT,ROWDEF
K HEAD,%T,GP,TF,W,YR,%ZISOS,FNAM,GBL,HLAB,RC,SX,B
K C,CO,DIC,ER,F,GP,HEAD,I,%I,%T,XCOL,J,K,NVA,Q,SL,VA,W,X,XD0,XDG,XX,%,%X
D ^%ZISC
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONCOSC 2573 printed Nov 22, 2024@17:35:33 Page 2
ONCOSC ;WASH ISC/SRR,MLH-CROSS TAB REPORTS ;9/29/93 11:40
+1 ;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
ST ;Start
H WRITE !!!,?10,"CROSS TABS for Total Registry",!!
AN ;ANNUAL (call ONCOST for time frames)
+1 SET ONCOT=1
DO TF^ONCOST
if $DATA(DIRUT)
GOTO EX
SET TF=ONCOS("YR")
SET YR=$SELECT(TF="ALL":" ",1:" ANNUAL ")
IF TF'="ALL"
SET BYR=$PIECE(TF,U)
SET EYR=$PIECE(TF,U,2)
SET EYR=$SELECT(BYR=EYR:EYR,1:EYR)
+2 SET HEAD=$SELECT(TF="ALL":"ALL",BYR=EYR:BYR,1:BYR_"-"_EYR)
CAT KILL DIR
SET DIR("A")=" Select CLASS Category"
SET DIR(0)="SO^N:Non-Analytic;A:Analytic;T:All Cases"
DO ^DIR
if Y="^"!(Y="")
GOTO EX
+1 SET GP=$SELECT(Y="A":1,Y="N":0,1:2)
SET G=$PIECE($PIECE(DIR(0),";",GP+1),":",2)
+2 QUIT
TR ;TOTAL REGISTRY CROSS TABS
+1 SET R="TR"
DO ST
if $DATA(DIRUT)
GOTO EX
WRITE !!?10,"Using ICDO-SITE for Rows...Select column:",!
SET ROW="ICDO-SITE"
+2 DO COL
if $DATA(DIRUT)
GOTO EX
DO PER
if $DATA(DIRUT)
GOTO EX
GOTO ASK
CR ;DETERMINE CROSS TAB
+1 SET R="CR"
DO ST
if $DATA(DIRUT)
GOTO EX
DO ROW
if $DATA(DIRUT)
GOTO EX
DO COL
if $DATA(DIRUT)
GOTO EX
DO PER
if $DATA(DIRUT)
GOTO EX
GOTO ASK
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;6:HISTOLOGY (ICD-O-3)"
DO ^DIR
if $DATA(DIRUT)
QUIT
SET ROW=$PIECE($PIECE(DIR(0),";",Y),":",2)
QUIT
COL KILL DIR
SET DIR("A")="Select Column"
SET S="S^0:ACCESSION YEAR;1:CLASS OF CASE;2:STATUS;3:SEX;4:RACE;5:RACE-SEX;6:DX AGE-GP;7:PLACE OF BIRTH;8:MARITAL STATUS AT DX;9:STATE;10:ST-COUNTY"
+1 SET DIR(0)=S_$SELECT($GET(GP)'=1:";11:CLASS CATEGORY;12:ALL of the ABOVE",1:";11:STAGE GROUPING-AJCC;12:TREATMENT PLAN;13:SUMMARY STAGE;14:HISTOLOGY (ICD-O-3);15:ALL of the ABOVE")
KILL S
+2 DO ^DIR
if $DATA(DIRUT)
QUIT
SET C=Y
SET XCOL=DIR(0)
SET COL=$PIECE($PIECE(XCOL,";",C+1),":",2)
+3 QUIT
PER KILL DIR
SET DIR("A")=" Percentages"
SET DIR(0)="Y"
WRITE !
DO ^DIR
if $DATA(DIRUT)
QUIT
SET PER=$SELECT(Y=0:"",1:1)
+1 QUIT
ASK WRITE !!,?6,"CROSS TABS: "_ROW_" vs "_COL
+1 WRITE !!?11,"TOTAL: "_$PIECE($GET(G)," ")_" Cases in Registry",!!?11,"Years: ",$GET(HEAD),!!
+2 SET DIR("A")="Conditions OK"
SET DIR(0)="Y"
SET DIR("B")="Yes"
DO ^DIR
if $DATA(DIRUT)
GOTO EX
if 'Y
GOTO @R
+3 SET ONCOS("C")=$SELECT($EXTRACT(COL,1,3)="ALL":"ALL",1:COL)
SET ONCOS("R")=ROW
SET ONCOS("P")=PER
SET ONCOS("GP")=GP
IF ONCOS("C")="ALL"
SET ONCOS("CT")=XCOL
QUE ;Template in use
+1 WRITE !!?15,"QUE ('Q') report unless to 'home' device",!!
+2 KILL IO("Q")
SET %ZIS="Q"
SET %ZIS("A")=" Select Device to Print Cross Tabs: "
WRITE !!
DO ^%ZIS
SET IOP=ION
IF POP
SET ONCOUT=""
GOTO EX
+3 IF '$DATA(IO("Q"))
DO TOT^ONCOSC1
GOTO EX
+4 SET ZTRTN="TOT^ONCOSC1"
SET ZTDESC="ONCOLOGY CROSS TABS ALL"
SET ZTSAVE("*")=""
DO ^%ZTLOAD
KILL ZTSK
GOTO EX
EX ;EXIT
+1 KILL IOP,ONCOT,ONCOS,XDA,XD,N,G,TEM,PER,COL,ROW,R,%DT,BYR,EYR,GLO,OT,ROWDEF
+2 KILL HEAD,%T,GP,TF,W,YR,%ZISOS,FNAM,GBL,HLAB,RC,SX,B
+3 KILL C,CO,DIC,ER,F,GP,HEAD,I,%I,%T,XCOL,J,K,NVA,Q,SL,VA,W,X,XD0,XDG,XX,%,%X
+4 DO ^%ZISC
+5 QUIT