Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ONCOSA1

ONCOSA1.m

Go to the documentation of this file.
ONCOSA1 ;WASH ISC/SRR-ANNUAL CROSS TABS-CANNED REPORTS-TASKED JOB ;12/14/99
 ;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
 Q  ;NOT A RUN ROUTINE
 ;
TSK ;Tasked job to print all cross tab tables
1 S J=0 F NM="NON ANAL","ANALYTIC","ALLCASES" S D0=$O(^DIBT("F165.5","ONCOS RANGE-"_NM,0)) Q:D0=""  S KD(J)=D0,$P(^DIBT(D0,0),U,2)=DT,J=J+1 K ^DIBT(D0,1)
 S RG=ONCOS("RG"),Y1=$P(RG,U),Y2=$P(RG,U,2) F YR=Y1:1:Y2 S D0=0 D
 .F  S D0=$O(^ONCO(165.5,"AY",YR,D0)) Q:D0'>0  I $$DIV^ONCFUNC(D0)=DUZ(2) S CC=+$P(^ONCO(165.5,D0,0),U,20),^DIBT(KD(CC),1,D0)="",^DIBT(KD(2),1,D0)=""
2 F J=0 F NM="NON ANAL","ANALYTIC","ALLCASES" S D0=$O(^DIBT("F165.5","ONCOS ANNUAL-"_NM,0)) Q:D0=""  S XD(J)=D0,$P(^DIBT(D0,0),U,2)=DT,J=J+1 K ^DIBT(D0,1)
 S YR=+ONCOS("YR"),D0=0 F  S D0=$O(^ONCO(165.5,"AY",YR,D0)) Q:D0=""  I $$DIV^ONCFUNC(D0)=DUZ(2) S CC=+$P(^ONCO(165.5,D0,0),U,20),^DIBT(XD(CC),1,D0)="",^DIBT(XD(2),1,D0)=""
3 ;Setup templates for Stage/Treatment
 F G="0","I","II","III","IV","U","NA" D
 .S D0=$O(^DIBT("F165.5","ONCOS ANAL/STAGE "_G,0)) Q:D0'>0  K ^DIBT(D0,1) S XD(G)=D0,$P(^DIBT(D0,0),U,2)=DT
 S D0=0 F  S D0=$O(^ONCO(165.5,"AG",1,D0)) Q:D0'>0  I $$DIV^ONCFUNC(D0)=DUZ(2) S G=$P($G(^ONCO(165.5,D0,2)),U,28) I G'="" S ^DIBT(XD(G),1,D0)=""
 ;
4 F G=0,"I","II","III","IV","U","NA" D
 .S D0=$O(^DIBT("F165.5","ONCOS ANNUAL ANAL/STAGE "_G,0)) Q:D0'>0  K ^DIBT(D0,1) S XD(G)=D0,$P(^DIBT(D0,0),U,2)=DT
 S D0=0 F  S D0=$O(^ONCO(165.5,"AY",YR,D0)) Q:D0'>0  I $$DIV^ONCFUNC(D0)=DUZ(2) S G=$P($G(^ONCO(165.5,D0,2)),U,28) I G'="" S ^DIBT(XD(G),1,D0)=""
TAB ;Call to do crosstabs for each case
 ;Given ONCOS("R")=row,ONCOS("P")=percentages
 ;Reset ONCOS("C") and ONCOS("T")
 S ONCOEX=0,ONCOS("TK")=1,ONCOS("F")="ONCOLOGY PRIMARY",(ONCOS("N"),ONCOS("Y"))=""
R S ONCOS("T")="ONCOS RANGE-ALLCASES",ONCOS("C")="CLASS CATEGORY" D PRINT^ONCOSCT Q:ONCOEX
 F NM="ALLCASES","NON ANAL","ANALYTIC" Q:ONCOEX  S ONCOS("T")="ONCOS RANGE-"_NM D
 .F I=2:1:13 Q:ONCOEX  D
 ..S ONCOS("C")=$P($T(COL+I),";",3) D PRINT^ONCOSCT
 Q:ONCOEX  F I=14:1:17 Q:ONCOEX  D
 .S ONCOS("C")=$P($T(COL+I),";",3) D PRINT^ONCOSCT
 Q:ONCOEX  F G=0,"I","II","III","IV","U","NA" Q:ONCOEX  D
 .S ONCOS("T")="ONCOS ANAL/STAGE "_G,ONCOS("C")="TREATMENT" D PRINT^ONCOSCT
 ;ANNUAL CASES
AN Q:ONCOEX  S ONCOS("T")="ONCOS ANNUAL-ALLCASES",ONCOS("C")="CLASS CATEGORY" D PRINT^ONCOSCT Q:ONCOEX
 Q:ONCOEX  F NM="ALLCASES","NON ANAL","ANALYTIC" Q:ONCOEX  S ONCOS("T")="ONCOS ANNUAL-"_NM D
T .F I=2:1:13 Q:ONCOEX  D
 ..S ONCOS("C")=$P($T(COL+I),";",3) D PRINT^ONCOSCT
 Q:ONCOEX  F I=14:1:17 Q:ONCOEX  D
 .S ONCOS("C")=$P($T(COL+I),";",3) D PRINT^ONCOSCT
 Q:ONCOEX  F G=0,"I","II","III","IV","U","NA" Q:ONCOEX  D
 .S ONCOS("T")="ONCOS ANNUAL ANAL/STAGE "_G,ONCOS("C")="TREATMENT" D PRINT^ONCOSCT
EX ;EXIT
 K ONCOS,RG,YR,Y1,Y2,D0,ONCOEX,ONCOION,ONCOIOM
 Q
COL ;List of fields for Columns
 ;;CLASS CATEGORY
 ;;ACCESSION YEAR
 ;;CLASS NO.
 ;;STATUS
 ;;SEX
 ;;RACE
 ;;RACE-SEX
 ;;SEX-RACE
 ;;DX AGE-GP
 ;;PLACE OF BIRTH
 ;;MARITAL STATUS AT DX
 ;;STATE
 ;;ST-COUNTY
 ;;SUMMARY STAGE
 ;;HISTOLOGY
 ;;STAGE GROUPING-AJCC
 ;;TREATMENT
 ;;GP-G AJCC SUMMARY STAGE