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

ONCOSCG.m

Go to the documentation of this file.
ONCOSCG ;WASH ISC/SRR,MLH-CROSS TABS: STAGE & TREATMENT ;12/15/99
 ;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
TS ;individual stage group/treatment,Treatment by Stage
 W !?10,"This option will print cross-tabs for ALL ANALYTIC",!?10,"cases for TREATMENT by STAGE groups (I,II,III,IV)",!
 ;call to ONCOST for time frame
 S ONCOT=1 D TF^ONCOST G EX:$D(DIRUT)
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 G EX:$D(DIRUT) S ONCOS("R")=$P($P(DIR(0),";",Y),":",2)
 K DIR S DIR("A")="      Percentages",DIR(0)="Y" W ! D ^DIR G EX:$D(DIRUT) S ONCOS("P")=$S(Y=0:"",1:1)
 K IO("Q") S %ZIS="Q" W !! D ^%ZIS S IOP=ION I POP S ONCOUT="" G EX
 I '$D(IO("Q")) D TSK^ONCOSCG G EX
 S ZTRTN="TSK^ONCOSCG",ZTDESC="ONCOLOGY STG/TX",ZTSAVE("ONCOS*")="" D ^%ZTLOAD K ZTSK G EX
 ;
TSK ;Tasked job to go through all 4 stages (use xref "ASG")
 S TF=ONCOS("YR") I TF'="ALL" S BYR=$P(TF,U),EYR=$P(TF,U,2),TF=$S(BYR=EYR:"ANN",1:"RGE")
 S YR=$S(TF="ANN":" ANNUAL ",1:" ") ;use ONCOS ANAL/...for Range or All ;ANNUAL for Annual
G F G=0,"I","II","III","IV","U","NA" S XD0=$O(^DIBT("F165.5","ONCOS"_YR_"ANAL/STAGE "_G,0)) Q:XD0'>0  K ^DIBT(XD0,1) S XD(G)=XD0,$P(^DIBT(XD0,0),U,2)=DT
 S XD0=$O(^DIBT("F165.5","ONCOS"_$S(TF="ANN":" ANNUAL-",1:" ")_"ANALYTIC",0)) I XD0'="" S $P(^DIBT(XD0,0),U,2)=DT K ^DIBT(XD0,1)
GET S HEAD=$S(TF="ALL":"ALL",TF="ANN":BYR,1:BYR_"-"_EYR)
 D ALL:TF="ALL",ANN:TF="ANN",RGE:TF="RGE"
TEM D SETV,HED S ONCOS("T")="ONCOS "_$S(TF="ANN":"ANNUAL-",1:"")_"ANALYTIC"
ST S ONCOEX=0 F G="I","II","III","IV" Q:ONCOEX  S ONCOS("C")="GP-"_G_" AJCC SUMMARY STAGE" D PRINT^ONCOSCT
 Q:ONCOEX  S ONCOS("C")="TREATMENT" D PRINT^ONCOSCT Q:ONCOEX
 F G=0,"I","II","III","IV","U","NA" Q:ONCOEX  S ONCOS("T")="ONCOS"_YR_"ANAL/STAGE "_G D PRINT^ONCOSCT
 D KIL^ONCOSCT G EX
 ;
 S D0=0 F  S D0=$O(^ONCO(165.5,"AG",1,D0)) Q:D0=""  I $$DIV^ONCFUNC(D0)=DUZ(2) S ^DIBT(XD0,1,D0)="",G=$P($G(^ONCO(165.5,D0,2)),U,28) I G'="" S ^DIBT(XD(G),1,D0)=""
ALL S D0=0 F  S D0=$O(^ONCO(165.5,"AG",1,D0)) Q:D0=""  I $$DIV^ONCFUNC(D0)=DUZ(2) S ^DIBT(XD0,1,D0)="",G=$P($G(^ONCO(165.5,D0,2)),U,28) I G'="" S ^DIBT(XD(G),1,D0)=""
 Q
 ;
ANN ;SPECIFIED TIME FRAME
 S D1=BYR,D0=0 F  S D0=$O(^ONCO(165.5,"AAY",D1,D0)) Q:D0=""  I $$DIV^ONCFUNC(D0)=DUZ(2) S ^DIBT(XD0,1,D0)="",G=$P($G(^ONCO(165.5,D0,2)),U,28) I G'="" S ^DIBT(XD(G),1,D0)=""
 ;
RGE ;RANGE of years for cases
 F D1=BYR:1:EYR S D0=0 D
 .F  S D0=$O(^ONCO(165.5,"AAY",D1,D0)) Q:D0=""  I $$DIV^ONCFUNC(D0)=DUZ(2) S ^DIBT(XD0,1,D0)="",G=$P($G(^ONCO(165.5,D0,2)),U,28) I G'="" S ^DIBT(XD(G),1,D0)=""
 Q
SETV S (ONCOS("N"),ONCOS("Y"))="",ONCOS("F")="ONCOLOGY PRIMARY",ONCOS("TK")="",ONCOS("FI")="165.5^ONCOLOGY PRIMARY^ONCO(165.5,"
 Q
HED ;DEFINE HEADER
 ;S ONCOS("H")=^DD("SITE")_" Years: "_HEAD ;" "_ONCOS("R")_"-"_ONCOS("C")
 S ONCOS("H")="Years: "_HEAD
 Q
EX ;EXIT
 K IOP,FNAM,GBL,HLAB,NVA,ROWDEF,SL,TF,TX,W
 K %T,D,ONCOT,ONCOEX,ONCOS,XDA,XD,N,G,TEM,PER,COL,ROW,R D ^%ZISC
 Q