source: FOIAVistA/tag/r/ONCOLOGY-ONC/ONCOSCT1.m@ 1540

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

initial load of FOIAVistA 6/30/08 version

File size: 2.2 KB
Line 
1ONCOSCT1 ;Hines OIFO/GWB - CROSS TAB SETUP ;7/27/92
2 ;;2.11;ONCOLOGY;**5,22,34,43**;Mar 07, 1995
3GC ;GET CUTS
4 ;
5ABORT S ROWDD=""
6 Q
7 ;
8SETUP ;get options
9 ;in: ^DD,^DIPT,FNUM,ONCOS,TEMPL
10 ;out: COLCUTS,COLDD,HEADER,PCT,ROWCUTS,ROWDD
11 ;do: ^ONCOSINP,^DIC
12 N CUTS,DIC,FDD,FLD
13S1 S ROWDD="",DIC="^DD("_FNUM_",",DIC("S")="I +$P(^(0),U,2)=0 "
14 F FLD="COLUMN","ROW" D GETFLD Q:FDD(F)=""
15 Q:FDD(F)="" S COLDD=FDD("C"),ROWDD=FDD("R")
16 S COLCUTS=CUTS("C"),ROWCUTS=CUTS("R")
17 I $D(ONCOS("P")) S PCT=ONCOS("P") G W
18 W ! S DIR("A")=" Print Percents",DIR("B")="No",DIR(0)="Y",DIR("?")="Enter 'Y' to include total percents" D ^DIR Q:Y="^"!(Y="") S PCT=Y
19W U IO W !!,$S(COLDD="":"One",1:"Two"),"-Way Table with ",$P(ROWDD,U,1)_" Values"
20 I COLDD]"" W " for Rows ",!,"and ",$P(COLDD,U,1)," Values for Columns"
21 W !,"For ",$S(TEMPL:"Entries in Search Template "_HEADER,1:"ALL Cases")
22 Q:$D(ONCOS("Y")) S Y="OK? Yes// ",Z="" D GETYES^ONCOSINP
23 E G ABORT:Y=-1,S1
24 Q
25 ;
26GETFLD ;get field & cuts
27 ;N F
28 S F=$E(FLD,1),CUTS(F)="",FDD(F)=""
29 I $D(ONCOS(F)) S X=$P(ONCOS(F),U,1),DIC(0)="EOQ",FDD(F)=X Q:FDD(F)=""
30 E S DIC(0)="AEQ",DIC("A")="Select "_FLD_" field: "
31 D ^DIC Q:Y="^"!(Y=-1)
32 S X=^DD(FNUM,+Y,0),FDD(F)=X,X=$P(X,U,2) Q:X["N"!(X["J")!(X["C")=0
33 I $D(ONCOS(F)) S X=$P(ONCOS(F),U,2) S:X]"" CUTS(F)=X_":99999999" Q
34CUTS W !!?10,"You may enter cutpoints for this variable: "_$P(FDD(F),U)
35 W !?10,"E.g., enter '4:7:12:30' to count the values"
36 W !?10,"in 5 categories (LE 4),(GT4-LE7),...,(GT30)"
37C R !!?5,"Define CUTPOINTS: ",X:DTIME G ABORT:'$T!(X="^") Q:X="" I X["?" D HLP G CUTS
38CK ;Check cutpoint format
39 F I=1:1:$L(X) S Y=$E(X,I) I Y'?1N.N&(Y'=":") W ?50,*7,"ERROR = '"_Y_"' ~ Try Again!" G CUTS
40 S NC=$L(X,":") F I=1:1:NC S X(I)=$P(X,":",I) I I>2 Q:X(I)'>X(I-1)
41 ; I I=NC F I=1:1:NC I I>2,X(I)'<X(I-1) Q
42 ; W !!?10,"Cutpoints not properly defined",!?10,"Use increasing or decreasing numbers",!,?10,"Must have ':' as delimiter only!!" G CUTS
43 S CUTS(F)=X_":99999999" Q
44HLP ;Help on cutpoints
45 W !!?10,"Cutpoints are used to partition data into groups"
46 W !?10,"where there is no computed field like 'AGE GROUP'."
47 W !?10,"Use a series of increasing or decreasing numbers"
48 W !?10,"separated by colons (':') to create the RANGE.",!!
49 Q
Note: See TracBrowser for help on using the repository browser.