source: WorldVistAEHR/trunk/r/ONCOLOGY-ONC/ONCOSCG.m@ 1764

Last change on this file since 1764 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1ONCOSCG ;WASH ISC/SRR,MLH-CROSS TABS: STAGE & TREATMENT ;12/15/99
2 ;;2.11;ONCOLOGY;**5,25,28**;Mar 07, 1995
3TS ;individual stage group/treatment,Treatment by Stage
4 W !?10,"This option will print cross-tabs for ALL ANALYTIC",!?10,"cases for TREATMENT by STAGE groups (I,II,III,IV)",!
5 ;call to ONCOST for time frame
6 S ONCOT=1 D TF^ONCOST G EX:$D(DIRUT)
7ROW ;SELECT ROW
8 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)
9 K DIR S DIR("A")=" Percentages",DIR(0)="Y" W ! D ^DIR G EX:$D(DIRUT) S ONCOS("P")=$S(Y=0:"",1:1)
10 K IO("Q") S %ZIS="Q" W !! D ^%ZIS S IOP=ION I POP S ONCOUT="" G EX
11 I '$D(IO("Q")) D TSK^ONCOSCG G EX
12 S ZTRTN="TSK^ONCOSCG",ZTDESC="ONCOLOGY STG/TX",ZTSAVE("ONCOS*")="" D ^%ZTLOAD K ZTSK G EX
13 ;
14TSK ;Tasked job to go through all 4 stages (use xref "ASG")
15 S TF=ONCOS("YR") I TF'="ALL" S BYR=$P(TF,U),EYR=$P(TF,U,2),TF=$S(BYR=EYR:"ANN",1:"RGE")
16 S YR=$S(TF="ANN":" ANNUAL ",1:" ") ;use ONCOS ANAL/...for Range or All ;ANNUAL for Annual
17G 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
18 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)
19GET S HEAD=$S(TF="ALL":"ALL",TF="ANN":BYR,1:BYR_"-"_EYR)
20 D ALL:TF="ALL",ANN:TF="ANN",RGE:TF="RGE"
21TEM D SETV,HED S ONCOS("T")="ONCOS "_$S(TF="ANN":"ANNUAL-",1:"")_"ANALYTIC"
22ST S ONCOEX=0 F G="I","II","III","IV" Q:ONCOEX S ONCOS("C")="GP-"_G_" AJCC SUMMARY STAGE" D PRINT^ONCOSCT
23 Q:ONCOEX S ONCOS("C")="TREATMENT" D PRINT^ONCOSCT Q:ONCOEX
24 F G=0,"I","II","III","IV","U","NA" Q:ONCOEX S ONCOS("T")="ONCOS"_YR_"ANAL/STAGE "_G D PRINT^ONCOSCT
25 D KIL^ONCOSCT G EX
26 ;
27 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)=""
28ALL 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)=""
29 Q
30 ;
31ANN ;SPECIFIED TIME FRAME
32 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)=""
33 ;
34RGE ;RANGE of years for cases
35 F D1=BYR:1:EYR S D0=0 D
36 .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)=""
37 Q
38SETV S (ONCOS("N"),ONCOS("Y"))="",ONCOS("F")="ONCOLOGY PRIMARY",ONCOS("TK")="",ONCOS("FI")="165.5^ONCOLOGY PRIMARY^ONCO(165.5,"
39 Q
40HED ;DEFINE HEADER
41 ;S ONCOS("H")=^DD("SITE")_" Years: "_HEAD ;" "_ONCOS("R")_"-"_ONCOS("C")
42 S ONCOS("H")="Years: "_HEAD
43 Q
44EX ;EXIT
45 K IOP,FNAM,GBL,HLAB,NVA,ROWDEF,SL,TF,TX,W
46 K %T,D,ONCOT,ONCOEX,ONCOS,XDA,XD,N,G,TEM,PER,COL,ROW,R D ^%ZISC
47 Q
Note: See TracBrowser for help on using the repository browser.