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

ONCCS2.m

Go to the documentation of this file.
ONCCS2 ;Hines OIFO/GWB - Collaborative Staging v2 Stuffing ;06/23/10
 ;;2.2;ONCOLOGY;**1,4,5,10**;Jul 31, 2013;Build 20
 ;
 S SCHEMA="Unable to compute schema"
 N ONCDISC S ONCDISC="" ;variable for discontinued items, set=1 if D/C
 Q:$G(TOP)=""
 N DISCRIM,HIST,MO,SCHNAME,SITE
 S MO=$$HIST^ONCFUNC(D0)
 S SITE=$TR($$GET1^DIQ(164,TOP,1,"I"),".","")
 S HIST=$E(MO,1,4)
 S DISCRIM=$$GET1^DIQ(165.5,D0,240)
 S SCHEMA=+$$SCHEMA^ONCSAPIS(.ONCSAPI,SITE,HIST,DISCRIM)
 Q:SCHEMA<0
 S SCHEMA=SCHNAME
 I DATEDX>3171231 Q  ;don't stuff for 2018+ cases
 ;
 I $G(SCHEMA)="AdnexaUterineOther" D  Q
 .D 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .D EVAL
 ;
 I $G(SCHEMA)="AdrenalGland" D  Q
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,5)="" 1
 .D 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 2,3    ;CS V02.05
 ;
 I $G(SCHEMA)="AmpullaVater" D  Q
 .D 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 1,2,3    ;CS V02.05
 ;
 I $G(SCHEMA)="Anus" D  Q
 .D 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 1    ;CS V02.05
 ;
 I $G(SCHEMA)="Appendix" D  Q
 .D 5,6,8,9,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 4,7,10,12    ;CS V02.05
 ;
 I $G(SCHEMA)="BileDuctsDistal" D  Q
 .D 1,2,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24
 .I DATEDX>3131231 S ONCDISC=1 D 12,13,14    ;CS V02.05
 ;
 I $G(SCHEMA)="BileDuctsIntraHepat" D  Q
 .D 4,5,6,7,8,9,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 3,12    ;CS V02.05
 ;
 I $G(SCHEMA)="BileDuctsPerihilar" D  Q
 .D 1,2,3,4,5,6,7,8,9,15,16,17,18,19,20,21,22,23,24
 .I DATEDX>3131231 S ONCDISC=1 D 10,12,13,14    ;CS V02.05
 ;
 I $G(SCHEMA)="BiliaryOther" D  Q
 .D 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 ;
 I $G(SCHEMA)="Bladder" D  Q
 .D 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 ;
 I $G(SCHEMA)="Bone" D  Q
 .D 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 1,2,4    ;CS V02.05
 ;
 I $G(SCHEMA)="Brain" D  Q
 .D 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .D EVAL,LN
 .I DATEDX>3131231 S ONCDISC=1 D 2,3,7,8    ;CS V02.05
 ;
 I $G(SCHEMA)="Breast" D  Q
 .D 25
 .I DATEDX>3131231 S ONCDISC=1 D 17,18,19,20,24    ;CS V02.05
 ;
 I $G(SCHEMA)="BuccalMucosa" D  Q
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,6)="" 2
 .D 12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 7,8,10    ;CS V02.05
 ;
 I $G(SCHEMA)="CarcinoidAppendix" D  Q
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,5)="" 1
 .D 3,4,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 13    ;CS V02.05
 ;
 I $G(SCHEMA)="Cervix" D  Q
 .D 10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 2,3,4,5,6,7,8,9    ;CS V02.05
 ;
 I $G(SCHEMA)="CNSOther" D  Q
 .D 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .D EVAL,LN
 .I DATEDX>3131231 S ONCDISC=1 D 2,3,7,8    ;CS V02.05
 ;
 I $G(SCHEMA)="Colon" D  Q
 .D 11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 5,7,10    ;CS V02.05
 ;
 I $G(SCHEMA)="Conjunctiva" D  Q
 .D 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .D:$P($G(^ONCO(165.5,D0,"CS1")),U,10)="" TS
 .I DATEDX>3131231 S ONCDISC=1 D 2    ;CS V02.05
 ;
 I $G(SCHEMA)="CorpusAdenosarcoma" D  Q
 .D 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 7,8    ;CS V02.05
 ;
 I $G(SCHEMA)="CorpusCarcinoma" D  Q
 .D 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 7,8    ;CS V02.05
 ;
 I $G(SCHEMA)="CorpusSarcoma" D  Q
 .D 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 7,8    ;CS V02.05
 ;
 I $G(SCHEMA)="CysticDuct" D  Q
 .D 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
 ;
 I $G(SCHEMA)="DigestiveOther" D  Q
 .D 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .D EVAL
 ;
 I $G(SCHEMA)="EndocrineOther" D  Q
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,5)="" 1
 .D 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .D EVAL
 ;
 I $G(SCHEMA)="EpiglottisAnterior" D  Q
 .D 11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 7,8,10    ;CS V02.05
 ;
 I $G(SCHEMA)="Esophagus" D  Q
 .D 6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 2,3,4,5    ;CS V02.05
 ;
 I $G(SCHEMA)="EsophagusGEJunction" D  Q
 .D 2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
 .I DATEDX>3131231 S ONCDISC=1 D 3,4,5    ;CS V02.05
 ;
 I $G(SCHEMA)="EyeOther" D  Q
 .D 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .D EVAL
 ;
 I $G(SCHEMA)="FallopianTube" D  Q
 .D 8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 2,3    ;CS V02.05
 ;
 I $G(SCHEMA)="FloorMouth" D  Q
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,6)="" 2
 .D 12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 7,8,10    ;CS V02.05
 ;
 I $G(SCHEMA)="Gallbladder" D  Q
 .D 1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 15,16    ;CS V02.05
 ;
 I $G(SCHEMA)="GenitalFemaleOther" D  Q
 .D 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .D EVAL
 ;
 I $G(SCHEMA)="GenitalMaleOther" D  Q
 .D 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .D EVAL
 ;
 I $G(SCHEMA)="GISTAppendix" D  Q
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,5)="" 1
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,6)="" 2
 .D 3,4,5,6,7,8,9,10,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 13,14,15    ;CS V02.05
 ;
 I $G(SCHEMA)="GISTColon" D  Q
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,5)="" 1
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,6)="" 2
 .D 3,4,5,6,7,8,9,10,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 13,14,15    ;CS V02.05
 ;
 I $G(SCHEMA)="GISTEsophagus" D  Q
 .D 1,2,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 8,9,10    ;CS V02.05
 ;
 I $G(SCHEMA)="GISTPeritoneum" D  Q
 .D 1,2,3,4,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 7,8,9    ;CS V02.05
 ;
 I $G(SCHEMA)="GISTRectum" D  Q
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,5)="" 1
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,6)="" 2
 .D 3,4,5,6,7,8,9,10,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 13,14,15    ;CS V02.05
 ;
 I $G(SCHEMA)="GISTSmallIntestine" D  Q
 .D 1,2,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 8,9,10    ;CS V02.05
 ;
 I $G(SCHEMA)="GISTStomach" D  Q
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,5)="" 1
 .D 2,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 8,9,10    ;CS V02.05
 ;
 I $G(SCHEMA)="GumLower" D  Q
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,6)="" 2
 .D 12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 7,8,10    ;CS V02.05
 ;
 I $G(SCHEMA)="GumOther" D  Q
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,6)="" 2
 .D 12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 7,8,10    ;CS V02.05
 ;
 I $G(SCHEMA)="GumUpper" D  Q
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,6)="" 2
 .D 12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 7,8,10    ;CS V02.05
 ;
 I $G(SCHEMA)="HeartMediastinum" D  Q
 .D 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 2,4    ;CS V02.05
 ;
 I $G(SCHEMA)="HemeRetic" D  Q
 .D 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .D TS,EVAL,LN,METS
 ;
 I $G(SCHEMA)="Hypopharynx" D  Q
 .D:$P($G(^ONCO(165.5,D0,"CS")),U,6)="" 2
 .D 11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .I DATEDX>3131231 S ONCDISC=1 D 7,8    ;CS V02.05
 ;
 I $G(SCHEMA)="IllDefinedOther" D  Q
 .D 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .D EXT,EVAL,LN,METS
 ;
 I $G(SCHEMA)="IntracranialGland" D  Q
 .D 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .D EVAL
 .I DATEDX>3131231 S ONCDISC=1 D 2    ;CS V02.05
 ;
 I $G(SCHEMA)="KaposiSarcoma" D  Q
 .D 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 .D TS,EVAL
 .I DATEDX>3131231 S ONCDISC=1 D 2,3    ;CS V02.05
 ;
 D ^ONCCS3
 K ONCDISC Q
 ;
1 ;SSF1 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS")),U,5)'="" Q
 S $P(^ONCO(165.5,D0,"CS"),U,5)=988
 Q
 ;
2 ;SSF2 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS")),U,6)'="" Q
 S $P(^ONCO(165.5,D0,"CS"),U,6)=988
 Q
 ;
3 ;SSF3 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS")),U,7)'="" Q
 S $P(^ONCO(165.5,D0,"CS"),U,7)=988
 Q
 ;
4 ;SSF4 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS")),U,8)'="" Q
 S $P(^ONCO(165.5,D0,"CS"),U,8)=988
 Q
 ;
5 ;SSF5 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS")),U,9)'="" Q
 S $P(^ONCO(165.5,D0,"CS"),U,9)=988
 Q
 ;
6 ;SSF6 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS")),U,10)'="" Q
 S $P(^ONCO(165.5,D0,"CS"),U,10)=988
 Q
 ;
7 ;SSF7 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,1)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,1)=988
 Q
 ;
8 ;SSF8 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,2)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,2)=988
 Q
 ;
9 ;SSF9 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,3)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,3)=988
 Q
 ;
10 ;SSF10 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,4)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,4)=988
 Q
 ;
11 ;SSF11 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,5)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,5)=988
 Q
 ;
12 ;SSF12 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,6)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,6)=988
 Q
 ;
13 ;SSF13 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,7)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,7)=988
 Q
 ;
14 ;SSF14 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,8)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,8)=988
 Q
 ;
15 ;SSF15 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,9)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,9)=988
 Q
 ;
16 ;SSF16 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,10)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,10)=988
 Q
 ;
17 ;SSF17 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,11)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,11)=988
 Q
 ;
18 ;SSF18 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,12)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,12)=988
 Q
 ;
19 ;SSF19 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,13)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,13)=988
 Q
 ;
20 ;SSF20 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,14)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,14)=988
 Q
 ;
21 ;SSF21 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,15)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,15)=988
 Q
 ;
22 ;SSF22 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,16)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,16)=988
 Q
 ;
23 ;SSF23 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,17)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,17)=988
 Q
 ;
24 ;SSF24 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,18)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,18)=988
 Q
 ;
25 ;SSF25 = 988
 I ONCDISC=1,$P($G(^ONCO(165.5,D0,"CS2")),U,19)'="" Q
 S $P(^ONCO(165.5,D0,"CS2"),U,19)=988
 Q
 ;
TS ;TUMOR SIZE (CS) = 988
 S $P(^ONCO(165.5,D0,"CS1"),U,10)=988
 Q
 ;
EXT ;EXTENSION (CS) = 988
 S $P(^ONCO(165.5,D0,"CS"),U,11)=988
 Q
 ;
EVAL ;TUMOR SIZE/EXT EVAL (CS) = 9
 ;LYMPH NODES EVAL (CS) = 9
 ;METS EVAL (CS) = 9
 S $P(^ONCO(165.5,D0,"CS"),U,1)=9
 S $P(^ONCO(165.5,D0,"CS"),U,2)=9
 S $P(^ONCO(165.5,D0,"CS"),U,4)=9
 Q
 ;
EVAL1 ;LYMPH NODES EVAL (CS) = 9
 ;METS EVAL (CS) = 9
 S $P(^ONCO(165.5,D0,"CS"),U,2)=9
 S $P(^ONCO(165.5,D0,"CS"),U,4)=9
 Q
 ;
EVAL2 ;LYMPH NODES EVAL (CS) = 9
 S $P(^ONCO(165.5,D0,"CS"),U,2)=9
 Q
 ;
LN ;LYMPH NODES (CS) = 988
 ;REGIONAL LYMPH NODES EXAMINED = 99
 ;REGIONAL LYMPH NODES POSITIVE = 99
 S $P(^ONCO(165.5,D0,"CS"),U,12)=988
 S $P(^ONCO(165.5,D0,2),U,12)=99
 S $P(^ONCO(165.5,D0,2),U,13)=99
 Q
 ;
METS ;METS AT DX (CS) = 98
 S $P(^ONCO(165.5,D0,"CS"),U,3)=98
 Q
 ;
CLEANUP ;Cleanup
 K D0,ONCSAPI,SCHEMA,TOP