ONCOSCT0 ;WASH ISC/SRR-SETUP FOR CROSS-TABS ;9/22/92 15:55
;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
;
;ask all questions to enable quing report
;GET FILE # AND NAME
ST ;ENTRY CROSS TAB ROUTINES-DEFINITIONS
W @IOF,!?25,"CROSS TAB ROUTINES"
W !!!?15,"CREATE your own Cross-Tab Reports!!",!!
1 W ?15,"1 - Select File (usually Primary)",!
W ?15,"2 - Select a field for the ROW",!
W ?15,"3 - Select a field for the Column",!
W ?15,"4 - Optional: choose Column cutpoints ",!
W ?15,"5 - Choose a SEARCH template to select cases",!!!
W ?20,"REMEMBER - type a '?' for HELP!!"
FIL ;SELECT FILE
K DIR,DIC S DIR(0)="S^1:PRIMARY;2:PATIENT;3:CONTACT",DIR("A")=" Select File to Search",DIR("B")=1,DIR("?")="^D HLP^ONCOSCT0" D ^DIR G EX:Y["^"!(Y="")
S (OF,ONCOS("F"))="ONCOLOGY "_$P($P(DIR(0),";",Y),":",2),ONCOS("FI")=$S(Y=1:165.5,2:160,1:165)_U_ONCOS("F")
S FNUM=$S(Y=1:"165.5",Y=2:160,1:165),GLB=^DIC(FNUM,0,"GL"),ONCOS("FI")=FNUM_U_OF_GLB
R ;S DIC("A")=" Select Row (field for Cross Tabs) ",DIC(0)="AEQZ",DIC="^DD("_FNUM_"," D ^DIC G EX:Y>0 S ONCOS("R")=+Y
SER ;REQUEST FILE TO SEARCH, THEN SEARCH CRITERIA
W !!!?5,"We will build Crosstabs on entries in "_OF_" file...",!!
;
TEM ;TEMPLATE LOOKUP
K DIR,DIC S DIR("A")=" Select Search template to filter cases",DIR("B")="Yes",DIR(0)="Y" D ^DIR G EX:Y="^"!(Y=""),GET:Y,ALL
ALL ;ALL CASES
W ! S DIR("A")=" Cases will cover entire registry - OK",DIR(0)="Y",DIR("B")="No" D ^DIR G EX:Y["^"!(Y=""),GET:Y=0 S ONCOS("T")="ALL" D PRINT^ONCOSCT G EX
GET ;GET TEMPLATE
W ! K DIC,DIR S DIC("A")=" Select Search Template (Type ONCOS for list): ",DIC(0)="AEQZ",DIC="^DIBT(",D="F"_FNUM G EX:D="F" D IX^DIC G EX:Y="^",EX:Y=-1 S ONCOS("T")=Y
W !!,?5,"REMINDER: Run Define Search Criteria option",!
W ?5,"to be sure selected entries are up-to-date!!",!!
S DIR("A")="Continue ",DIR("B")="Y",DIR(0)="Y" D ^DIR G EX:Y'=1
D PRINT^ONCOSCT G EX
EX ;EXIT
K ONCOS,DIR,ONCOEX,ROWDEF
Q
HLP ;HELP SELECTING FILES
W !!?10,"The Primary File contains the 'cancer case' data.",!
W ?10,"The Oncology Patient File contains demographic data,",!?14,"Patient history, and Followup History.",!
W ?10,"The Contact File contains the contacts for all patients.",!!
Q
;ONCOSCT0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONCOSCT0 2266 printed Dec 13, 2024@02:25:36 Page 2
ONCOSCT0 ;WASH ISC/SRR-SETUP FOR CROSS-TABS ;9/22/92 15:55
+1 ;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
+2 ;
+3 ;ask all questions to enable quing report
+4 ;GET FILE # AND NAME
ST ;ENTRY CROSS TAB ROUTINES-DEFINITIONS
+1 WRITE @IOF,!?25,"CROSS TAB ROUTINES"
+2 WRITE !!!?15,"CREATE your own Cross-Tab Reports!!",!!
1 WRITE ?15,"1 - Select File (usually Primary)",!
+1 WRITE ?15,"2 - Select a field for the ROW",!
+2 WRITE ?15,"3 - Select a field for the Column",!
+3 WRITE ?15,"4 - Optional: choose Column cutpoints ",!
+4 WRITE ?15,"5 - Choose a SEARCH template to select cases",!!!
+5 WRITE ?20,"REMEMBER - type a '?' for HELP!!"
FIL ;SELECT FILE
+1 KILL DIR,DIC
SET DIR(0)="S^1:PRIMARY;2:PATIENT;3:CONTACT"
SET DIR("A")=" Select File to Search"
SET DIR("B")=1
SET DIR("?")="^D HLP^ONCOSCT0"
DO ^DIR
if Y["^"!(Y="")
GOTO EX
+2 SET (OF,ONCOS("F"))="ONCOLOGY "_$PIECE($PIECE(DIR(0),";",Y),":",2)
SET ONCOS("FI")=$SELECT(Y=1:165.5,2:160,1:165)_U_ONCOS("F")
+3 SET FNUM=$SELECT(Y=1:"165.5",Y=2:160,1:165)
SET GLB=^DIC(FNUM,0,"GL")
SET ONCOS("FI")=FNUM_U_OF_GLB
R ;S DIC("A")=" Select Row (field for Cross Tabs) ",DIC(0)="AEQZ",DIC="^DD("_FNUM_"," D ^DIC G EX:Y>0 S ONCOS("R")=+Y
SER ;REQUEST FILE TO SEARCH, THEN SEARCH CRITERIA
+1 WRITE !!!?5,"We will build Crosstabs on entries in "_OF_" file...",!!
+2 ;
TEM ;TEMPLATE LOOKUP
+1 KILL DIR,DIC
SET DIR("A")=" Select Search template to filter cases"
SET DIR("B")="Yes"
SET DIR(0)="Y"
DO ^DIR
if Y="^"!(Y="")
GOTO EX
if Y
GOTO GET
GOTO ALL
ALL ;ALL CASES
+1 WRITE !
SET DIR("A")=" Cases will cover entire registry - OK"
SET DIR(0)="Y"
SET DIR("B")="No"
DO ^DIR
if Y["^"!(Y="")
GOTO EX
if Y=0
GOTO GET
SET ONCOS("T")="ALL"
DO PRINT^ONCOSCT
GOTO EX
GET ;GET TEMPLATE
+1 WRITE !
KILL DIC,DIR
SET DIC("A")=" Select Search Template (Type ONCOS for list): "
SET DIC(0)="AEQZ"
SET DIC="^DIBT("
SET D="F"_FNUM
if D="F"
GOTO EX
DO IX^DIC
if Y="^"
GOTO EX
if Y=-1
GOTO EX
SET ONCOS("T")=Y
+2 WRITE !!,?5,"REMINDER: Run Define Search Criteria option",!
+3 WRITE ?5,"to be sure selected entries are up-to-date!!",!!
+4 SET DIR("A")="Continue "
SET DIR("B")="Y"
SET DIR(0)="Y"
DO ^DIR
if Y'=1
GOTO EX
+5 DO PRINT^ONCOSCT
GOTO EX
EX ;EXIT
+1 KILL ONCOS,DIR,ONCOEX,ROWDEF
+2 QUIT
HLP ;HELP SELECTING FILES
+1 WRITE !!?10,"The Primary File contains the 'cancer case' data.",!
+2 WRITE ?10,"The Oncology Patient File contains demographic data,",!?14,"Patient history, and Followup History.",!
+3 WRITE ?10,"The Contact File contains the contacts for all patients.",!!
+4 QUIT
+5 ;ONCOSCT0