source: WorldVistAEHR/trunk/r/ONCOLOGY-ONC/ONCOSSA.m@ 1661

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

initial load of WorldVistAEHR

File size: 3.7 KB
Line 
1ONCOSSA ;WASH ISC/SRR,MLH-SURVIVAL ANALYSIS ;11/5/93 15:14
2 ;;2.11;ONCOLOGY;**11,13,22**;Mar 07, 1995
3 ;ONCOS - used to force responses to setup prompts:
4 ;("F") = file name
5 ;("T") = sort template
6 ;("D") = duration field name^time unit letter^interval letter
7 ; e.g., "MOS FU^M^Y" for months followup, life table in years
8 ;("S") = status expression
9 ;("G") = number of groups^expression
10 ;("G",n) = field number^title for nth group^expression, e.g., VAL(7)=0
11 ;("L") = ] "P" for plots, "Y" to skip yes prompts
12 ;("I") = IOP variable for %ZIS
13PRINT ;entry point for qued report (%ZTLOAD)
14 S U="^",%=0
15 D GETFILE^ONCOSINP:'$D(ONCOS("FI")) G EX:$G(Y)<0 S FIL=ONCOS("FI"),FNUM=+FIL,GBL=U_$P(FIL,U,3)
16 S FNUM=+ONCOS("FI") D GETTEMPL^ONCOSINP G:$G(Y)<0 EX S HEADER=$P(Y,U,2),TEMPL=+Y
17 K ^TMP($J),IO("Q") D GET^ONCOSSA1 G:$G(Y)<0 EX ;get specs
18 K IOP,%ZIS S %ZIS="MQ" W ! D ^%ZIS K %ZIS,IOP G:POP EX
19 I $D(IO("Q")) S ONCOLST="COND^COND(^FIL^FLDDAT(^FNUM^GBL^GRPEXP^HEADER^I^J^LEN^LENEXP^MAXTIME^MORTEXP^N^NGRPS^NM^ONCOS(^PLOT^TEMPL^VAL" D TASK G EX
20 U IO D PRT D ^%ZISC K %ZIS,IOP G EX
21PRT S (D0,NMORT,NDROP,NPG)=0,XCRT=$S(IOST?1"C".E:1,1:0) D:XCRT WAIT^DICD
22 F N=1:1 S D0=$S(TEMPL:$O(^DIBT(TEMPL,1,D0)),1:$O(@(GBL_"D0)"))) Q:D0'?1N.N D CTCASE
23 S %DT="T",X="NOW" D ^%DT X ^DD("DD")
24 S X=$P(@(GBL_"0)"),U,1)_$S(TEMPL:" Template "_HEADER,1:"")_" "
25 S HEADER=X_U_$P(Y,"@",1)_" "_$P(Y,"@",2)
26 I NDROP W !!,$P(HEADER,U,1),?IOM-30,$P(HEADER,U,2) W !!,"Cases dropped: ",NDROP,! D I IOST?1"C".E W ! K DIR S DIR(0)="E" D ^DIR I 'Y G EX
27 .W !,"PATIENT",?30,"REASON FOR BEING DROPPED"
28 .W !,"--------------------------",?30,"----------------------------"
29 .S DROPD0=0 F S DROPD0=$O(DROP(DROPD0)) Q:DROPD0'>0 D
30 ..W !,$$GET1^DIQ(165.5,DROPD0,.025)," ",$$GET1^DIQ(165.5,DROPD0,.02),?30,$P(DROP(DROPD0),U,1),?51,$P(DROP(DROPD0),U,2)
31 S HEADER=HEADER_" Page "
32 S Y=0 F GRP=1:1:NGRPS S (CASES(GRP),INT(GRP))=0
33 F GRP=0:0 S:GRP INTS(GRP)=Y S GRP=$O(^TMP($J,"LT",GRP)) Q:GRP="" D SLOOP
34 D PRINT^ONCOSSA3,PLOT^ONCOSSA4:PLOT,TOF^ONCOSSA3
35EX K ^TMP($J)
36 K CASES,COND,D0,FLDDAT,FNUM,GBL,GRP,GRPEXP,HEADER,INTS,LEN,LENEXP
37 K MAXTIME,MORTEXP,N,NDROP,NGRPS,NMORT,NPG,NTOT,ONCOS,PLOT,POP,TEMPL
38 K X,XCRT,Y,Z,DROP,DROPD0,DROPRSN
39 Q
40 ;
41CTCASE ;count case
42 N FLDNUM,GRP,IGRP,MORT,SLEN,VAL,DROPRSN
43 S DROPRSN=""
44 W:XCRT&(N#100=1) "." Q:'$D(@(GBL_"D0)")) S FLDNUM=0
45 F IGRP=1:1 S FLDNUM=$O(FLDDAT(FLDNUM)) Q:FLDNUM="" D GETFLD S VAL(FLDNUM)=Y
46 S @("MORT="_MORTEXP),@("SLEN="_LENEXP)
47 I COND S @("GRP="_GRPEXP)
48 E S GRP=0 F IGRP=1:1:NGRPS I @COND(IGRP) S GRP=IGRP Q
49 I GRP=0 D G:DROPRSN'="" DROP
50 .I $D(VAL(38.5)) S VAL=VAL(38.5),DROPRSN="STAGE GROUPING-AJCC^"_$S(VAL=0:0,VAL="U":"Unk/Uns",VAL="NA":"NA",1:VAL) Q
51 .I $D(VAL(43)) S VAL=VAL(43),DROPRSN="TREATMENT^"_VAL
52 I SLEN'=0 S SLEN=+SLEN I SLEN=0 S GRP=0,DROPRSN=$P($G(ONCOS("D")),U,1)_"^0"
53DROP I GRP<1!(GRP>NGRPS) S NDROP=NDROP+1 S DROP(D0)=DROPRSN Q
54 S:SLEN>MAXTIME SLEN=MAXTIME,MORT=0
55 S:'$D(^TMP($J,"LT",GRP,SLEN\+LEN,MORT)) ^(MORT)=0 S ^(MORT)=^(MORT)+1
56 I PLOT S:'$D(^TMP($J,"KM",GRP,SLEN,MORT)) ^(MORT)=0 S ^(MORT)=^(MORT)+1
57 Q
58 ;
59GETFLD ;get field
60 ;in: D0,GBL,FLDNUM,FLDDAT
61 ;out: Y
62 S Y="",X=FLDDAT(FLDNUM)
63 I +X,$D(@(GBL_"D0,$P(X,U,2))")) S Y=$P(^($P(X,U,2)),U,$P(X,U,3))
64 I '(+X) X $P(X,U,2,99) S Y=X
65 Q
66 ;
67SLOOP ;loop through data & sum totals
68 S X=-1 F S X=$O(^TMP($J,"LT",GRP,X)) Q:X="" S Y=X D
69 .I $D(^TMP($J,"LT",GRP,X,0)) S CASES(GRP)=CASES(GRP)+^(0)
70 .I $D(^TMP($J,"LT",GRP,X,1)) S CASES(GRP)=CASES(GRP)+^(1),NMORT=NMORT+^(1)
71 Q
72TASK ;Queue a task
73 K IO("Q"),ZTUCI,ZTDTH,ZTIO,ZTSAVE
74 S ZTRTN="PRT^ONCOSSA",ZTREQ="@",ZTSAVE("ZTREQ")=""
75 S ZTDESC="ONCOLOGY STATISTICAL REPORT"
76 F V2=1:1 S V1=$P(ONCOLST,"^",V2) Q:V1="" S ZTSAVE(V1)=""
77 S ZTSAVE("^TMP($J,")=""
78 D ^%ZTLOAD D ^%ZISC U IO W !,"Request Queued",!
79 K V1,V2,ONCOLST,ZTSK Q
Note: See TracBrowser for help on using the repository browser.