ONCSG0 ;Hines OIFO/GWB - Automatic Staging Tables ;06/23/10
;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
;
;HEAD AND NECK SITES
;
LIP12 ;Lip and Oral Cavity - 1st and 2nd editions
I M[1 S SG=4
E I M[0 D
.I (N[2)!(N[3) S SG=4
.E I N[1,(T[1)!(T[2)!(T[3)!(T[4) S SG=$S(T=4:4,1:3)
.E I N[0,(T[1)!(T[2)!(T[3)!(T[4) S SG=+T
Q
;
LIP34 ;Lip and Oral Cavity - 3rd and 4th editions
I M[1 S SG=4
E I M[0 D
.I (N[2)!(N[3) S SG=4
.E I N[1,(T[1)!(T[2)!(T[3)!(T[4) S SG=$S(T=4:4,1:3)
.E I N[0,(T["IS")!(T[1)!(T[2)!(T[3)!(T[4) S SG=+T
Q
;
LIP5 ;Lip and Oral Cavity - 5th edition
S TNM=T_$E(N,1)_M D K TNM Q
.I TNM="IS00" S SG=0 Q ;0 Tis N0 M0
.I TNM=100 S SG=1 Q ;I T1 N0 M0
.I TNM=200 S SG=2 Q ;II T2 N0 M0
.I TNM=300 S SG=3 Q ;III T3 N0 M0
.I TNM=110 S SG=3 Q ; T1 N1 M0
.I TNM=210 S SG=3 Q ; T2 N1 M0
.I TNM=310 S SG=3 Q ; T3 N1 M0
.I TNM=400 S SG="4A" Q ;IVA T4 N0 M0
.I TNM=410 S SG="4A" Q ; T4 N1 M0
.I $E(N,1)=2,M=0 S SG="4A" Q ; Any T N2 M0
.I $E(N,1)=3,M=0 S SG="4B" Q ;IVB Any T N3 M0
.I M=1 S SG="4C" Q ;IVC Any T Any N M1
;
LIP6 ;Lip and Oral Cavity - 6th edition
S TNM=T_$E(N,1)_M D K TNM Q
.I TNM="IS00" S SG=0 Q ;0 Tis N0 M0
.I TNM=100 S SG=1 Q ;I T1 N0 M0
.I TNM=200 S SG=2 Q ;II T2 N0 M0
.I TNM=300 S SG=3 Q ;III T3 N0 M0
.I TNM=110 S SG=3 Q ; T1 N1 M0
.I TNM=210 S SG=3 Q ; T2 N1 M0
.I TNM=310 S SG=3 Q ; T3 N1 M0
.I TNM="4A00" S SG="4A" Q ;IVA T4a N0 M0
.I TNM="4A10" S SG="4A" Q ; T4a N1 M0
.I TNM=120 S SG="4A" Q ; T1 N2 M0
.I TNM=220 S SG="4A" Q ; T2 N2 M0
.I TNM=320 S SG="4A" Q ; T3 N2 M0
.I TNM="4A20" S SG="4A" Q ; T4a N2 M0
.I T="4B",M=0 S SG="4B" Q ;IVB T4b Any N M0
.I $E(N,1)=3,M=0 S SG="4B" Q ; Any T N3 M0
.I M=1 S SG="4C" Q ;IVC Any T Any N M1
;
PHA12 ;Pharynx - 1st and 2nd editions
I M[1 S SG=4
E I M[0 D
.I (N[2)!(N[3) S SG=4
.E I N[1,(T[1)!(T[2)!(T[3)!(T[4) S SG=$S(T=4:4,1:3)
.E I N[0,(T[1)!(T[2)!(T[3)!(T[4) S SG=+T
Q
;
PHA34 ;Pharynx - 3rd and 4th editions
I M[1 S SG=4
E I M[0 D
.I (N[2)!(N[3) S SG=4
.E I N[1,(T[1)!(T[2)!(T[3)!(T[4) S SG=$S(T=4:4,1:3)
.E I N[0,(T["IS")!(T[1)!(T[2)!(T[3)!(T[4) S SG=+T
Q
;
PHAN56 ;Pharynx - nasopharynx - 5th and 6th editions
S TNM=T_$E(N,1)_M D K TNM Q
.I TNM="IS00" S SG=0 Q ;0 Tis N0 M0
.I TNM=100 S SG=1 Q ;I T1 N0 M0
.I TNM="2A00" S SG="2A" Q ;IIA T2a N0 M0
.I TNM=110 S SG="2B" Q ;IIB T1 N1 M0
.I TNM=210 S SG="2B" Q ; T2 N1 M0
.I TNM="2A10" S SG="2B" Q ; T2a N1 M0
.I TNM="2B00" S SG="2B" Q ; T2b N0 M0
.I TNM="2B10" S SG="2B" Q ; T2b N1 M0
.I TNM=120 S SG=3 Q ;III T1 N2 M0
.I TNM="2A20" S SG=3 Q ; T2a N2 M0
.I TNM="2B20" S SG=3 Q ; T2b N2 M0
.I TNM=300 S SG=3 Q ; T3 N0 M0
.I TNM=310 S SG=3 Q ; T3 N1 M0
.I TNM=320 S SG=3 Q ; T3 N2 M0
.I TNM=400 S SG="4A" Q ;IVA T4 N0 M0
.I TNM=410 S SG="4A" Q ; T4 N1 M0
.I TNM=420 S SG="4A" Q ; T4 N2 M0
.I $E(N,1)=3,M=0 S SG="4B" Q ;IVB Any T N3 M0
.I M=1 S SG="4C" Q ;IVC Any T Any N M1
;
PHAOH5 ;Pharynx - oropharynx, hypopharynx - 5th edition
S TNM=T_$E(N,1)_M D K TNM Q
.I TNM="IS00" S SG=0 Q ;0 Tis N0 M0
.I TNM=100 S SG=1 Q ;I T1 N0 M0
.I TNM=200 S SG=2 Q ;II T2 N0 M0
.I TNM=300 S SG=3 Q ;III T3 N0 M0
.I TNM=110 S SG=3 Q ; T1 N1 M0
.I TNM=210 S SG=3 Q ; T2 N1 M0
.I TNM=310 S SG=3 Q ; T3 N1 M0
.I TNM=400 S SG="4A" Q ;IVA T4 N0 M0
.I TNM=410 S SG="4A" Q ; T4 N1 M0
.I $E(N,1)=2,M=0 S SG="4A" Q ; Any T N2 M0
.I $E(N,1)=3,M=0 S SG="4B" Q ;IVB Any T N3 M0
.I M=1 S SG="4C" Q ;IVC Any T Any N M1
;
PHAOH6 ;Pharynx - oropharynx, hypopharynx - 6th edition
S TNM=T_$E(N,1)_M D K TNM Q
.I TNM="IS00" S SG=0 Q ;0 Tis N0 M0
.I TNM=100 S SG=1 Q ;I T1 N0 M0
.I TNM=200 S SG=2 Q ;II T2 N0 M0
.I TNM=300 S SG=3 Q ;III T3 N0 M0
.I TNM=110 S SG=3 Q ; T1 N1 M0
.I TNM=210 S SG=3 Q ; T2 N1 M0
.I TNM=310 S SG=3 Q ; T3 N1 M0
.I TNM="4A00" S SG="4A" Q ;IVA T4a N0 M0
.I TNM="4A10" S SG="4A" Q ; T4a N1 M0
.I TNM=120 S SG="4A" Q ; T1 N2 M0
.I TNM=220 S SG="4A" Q ; T2 N2 M0
.I TNM=320 S SG="4A" Q ; T3 N2 M0
.I TNM="4A20" S SG="4A" Q ; T4a N2 M0
.I T="4B",M=0 S SG="4B" Q ;IVB T4b Any N M0
.I $E(N,1)=3,M=0 S SG="4B" Q ; Any T N3 M0
.I M=1 S SG="4C" Q ;IVC Any T Any N M1
;
PHAN7 ;Pharynx - nasopharynx - 7th edition
S TNM=T_$E(N,1)_M D K TNM Q
.I TNM="IS00" S SG=0 Q ;0 Tis N0 M0
.I TNM=100 S SG=1 Q ;I T1 N0 M0
.I TNM=110 S SG=2 Q ;II T1 N1 M0
.I TNM=200 S SG=2 Q ; T2 N0 M0
.I TNM=210 S SG=2 Q ; T2 N1 M0
.I TNM=120 S SG=3 Q ;III T1 N2 M0
.I TNM=220 S SG=3 Q ; T2 N2 M0
.I TNM=300 S SG=3 Q ; T3 N0 M0
.I TNM=310 S SG=3 Q ; T3 N1 M0
.I TNM=320 S SG=3 Q ; T3 N2 M0
.I TNM=400 S SG="4A" Q ;IVA T4 N0 M0
.I TNM=410 S SG="4A" Q ; T4 N1 M0
.I TNM=420 S SG="4A" Q ; T4 N2 M0
.I $E(N,1)=3,M=0 S SG="4B" Q ;IVB Any T N3 M0
.I M=1 S SG="4C" Q ;IVC Any T Any N M1
;
LAR12 ;Larynx - 1st and 2nd editions
I M[1 S SG=4
E I M[0 D
.I (N[2)!(N[3) S SG=4
.E I N[1,(T[1)!(T[2)!(T[3)!(T[4) S SG=$S(T=4:4,1:3)
.E I N[0,(T[1)!(T[2)!(T[3)!(T[4) S SG=+T
Q
;
LAR34 ;Larynx - 3rd and 4th editions
I M[1 S SG=4
E I M[0 D
.I (N[2)!(N[3) S SG=4
.E I N[1,(T[1)!(T[2)!(T[3)!(T[4) S SG=$S(T=4:4,1:3)
.E I N[0,(T["IS")!(T[1)!(T[2)!(T[3)!(T[4) S SG=+T
Q
;
LAR5 ;Larynx - 5th edition
I T="IS" S TNM=T_$E(N,1)_M
E S TNM=$E(T,1)_$E(N,1)_M
D K TNM Q
.I TNM="IS00" S SG=0 Q ;0 Tis N0 M0
.I TNM=100 S SG=1 Q ;I T1 N0 M0
.I TNM=200 S SG=2 Q ;II T2 N0 M0
.I TNM=300 S SG=3 Q ;III T3 N0 M0
.I TNM=110 S SG=3 Q ; T1 N1 M0
.I TNM=210 S SG=3 Q ; T2 N1 M0
.I TNM=310 S SG=3 Q ; T3 N1 M0
.I TNM=400 S SG="4A" Q ;IVA T4 N0 M0
.I TNM=410 S SG="4A" Q ; T4 N1 M0
.I $E(N,1)=2,M=0 S SG="4A" Q ; Any T N2 M0
.I $E(N,1)=3,M=0 S SG="4B" Q ;IVB Any T N3 M0
.I M=1 S SG="4C" Q ;IVC Any T Any N M1
;
LAR6 ;Larynx - 6th edition
S TNM=T_$E(N,1)_M
D K TNM Q
.I TNM="IS00" S SG=0 Q ;0 Tis N0 M0
.I TNM=100 S SG=1 Q ;I T1 N0 M0
.I TNM="1A00" S SG=1 Q
.I TNM="1B00" S SG=1 Q
.I TNM=200 S SG=2 Q ;II T2 N0 M0
.I TNM=300 S SG=3 Q ;III T3 N0 M0
.I TNM=110 S SG=3 Q ; T1 N1 M0
.I TNM="1A10" S SG=3 Q
.I TNM="1B10" S SG=3 Q
.I TNM=210 S SG=3 Q ; T2 N1 M0
.I TNM=310 S SG=3 Q ; T3 N1 M0
.I TNM="4A00" S SG="4A" Q ;IVA T4a N0 M0
.I TNM="4A10" S SG="4A" Q ; T4a N1 M0
.I TNM=120 S SG="4A" Q ; T1 N2 M0
.I TNM="1A20" S SG="4A" Q
.I TNM="1B20" S SG="4A" Q
.I TNM=220 S SG="4A" Q ; T2 N2 M0
.I TNM=320 S SG="4A" Q ; T3 N2 M0
.I TNM="4A20" S SG="4A" Q ; T4a N2 M0
.I T="4B",M=0 S SG="4B" Q ;IVB T4b Any N M0
.I $E(N,1)=3,M=0 S SG="4B" Q ; Any T N3 M0
.I M=1 S SG="4C" Q ;IVC Any T Any N M1
;
CLEANUP ;Cleanup
K M,N,SG,T
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONCSG0 8486 printed Dec 13, 2024@02:28:18 Page 2
ONCSG0 ;Hines OIFO/GWB - Automatic Staging Tables ;06/23/10
+1 ;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
+2 ;
+3 ;HEAD AND NECK SITES
+4 ;
LIP12 ;Lip and Oral Cavity - 1st and 2nd editions
+1 IF M[1
SET SG=4
+2 IF '$TEST
IF M[0
Begin DoDot:1
+3 IF (N[2)!(N[3)
SET SG=4
+4 IF '$TEST
IF N[1
IF (T[1)!(T[2)!(T[3)!(T[4)
SET SG=$SELECT(T=4:4,1:3)
+5 IF '$TEST
IF N[0
IF (T[1)!(T[2)!(T[3)!(T[4)
SET SG=+T
End DoDot:1
+6 QUIT
+7 ;
LIP34 ;Lip and Oral Cavity - 3rd and 4th editions
+1 IF M[1
SET SG=4
+2 IF '$TEST
IF M[0
Begin DoDot:1
+3 IF (N[2)!(N[3)
SET SG=4
+4 IF '$TEST
IF N[1
IF (T[1)!(T[2)!(T[3)!(T[4)
SET SG=$SELECT(T=4:4,1:3)
+5 IF '$TEST
IF N[0
IF (T["IS")!(T[1)!(T[2)!(T[3)!(T[4)
SET SG=+T
End DoDot:1
+6 QUIT
+7 ;
LIP5 ;Lip and Oral Cavity - 5th edition
+1 SET TNM=T_$EXTRACT(N,1)_M
Begin DoDot:1
+2 ;0 Tis N0 M0
IF TNM="IS00"
SET SG=0
QUIT
+3 ;I T1 N0 M0
IF TNM=100
SET SG=1
QUIT
+4 ;II T2 N0 M0
IF TNM=200
SET SG=2
QUIT
+5 ;III T3 N0 M0
IF TNM=300
SET SG=3
QUIT
+6 ; T1 N1 M0
IF TNM=110
SET SG=3
QUIT
+7 ; T2 N1 M0
IF TNM=210
SET SG=3
QUIT
+8 ; T3 N1 M0
IF TNM=310
SET SG=3
QUIT
+9 ;IVA T4 N0 M0
IF TNM=400
SET SG="4A"
QUIT
+10 ; T4 N1 M0
IF TNM=410
SET SG="4A"
QUIT
+11 ; Any T N2 M0
IF $EXTRACT(N,1)=2
IF M=0
SET SG="4A"
QUIT
+12 ;IVB Any T N3 M0
IF $EXTRACT(N,1)=3
IF M=0
SET SG="4B"
QUIT
+13 ;IVC Any T Any N M1
IF M=1
SET SG="4C"
QUIT
End DoDot:1
KILL TNM
QUIT
+14 ;
LIP6 ;Lip and Oral Cavity - 6th edition
+1 SET TNM=T_$EXTRACT(N,1)_M
Begin DoDot:1
+2 ;0 Tis N0 M0
IF TNM="IS00"
SET SG=0
QUIT
+3 ;I T1 N0 M0
IF TNM=100
SET SG=1
QUIT
+4 ;II T2 N0 M0
IF TNM=200
SET SG=2
QUIT
+5 ;III T3 N0 M0
IF TNM=300
SET SG=3
QUIT
+6 ; T1 N1 M0
IF TNM=110
SET SG=3
QUIT
+7 ; T2 N1 M0
IF TNM=210
SET SG=3
QUIT
+8 ; T3 N1 M0
IF TNM=310
SET SG=3
QUIT
+9 ;IVA T4a N0 M0
IF TNM="4A00"
SET SG="4A"
QUIT
+10 ; T4a N1 M0
IF TNM="4A10"
SET SG="4A"
QUIT
+11 ; T1 N2 M0
IF TNM=120
SET SG="4A"
QUIT
+12 ; T2 N2 M0
IF TNM=220
SET SG="4A"
QUIT
+13 ; T3 N2 M0
IF TNM=320
SET SG="4A"
QUIT
+14 ; T4a N2 M0
IF TNM="4A20"
SET SG="4A"
QUIT
+15 ;IVB T4b Any N M0
IF T="4B"
IF M=0
SET SG="4B"
QUIT
+16 ; Any T N3 M0
IF $EXTRACT(N,1)=3
IF M=0
SET SG="4B"
QUIT
+17 ;IVC Any T Any N M1
IF M=1
SET SG="4C"
QUIT
End DoDot:1
KILL TNM
QUIT
+18 ;
PHA12 ;Pharynx - 1st and 2nd editions
+1 IF M[1
SET SG=4
+2 IF '$TEST
IF M[0
Begin DoDot:1
+3 IF (N[2)!(N[3)
SET SG=4
+4 IF '$TEST
IF N[1
IF (T[1)!(T[2)!(T[3)!(T[4)
SET SG=$SELECT(T=4:4,1:3)
+5 IF '$TEST
IF N[0
IF (T[1)!(T[2)!(T[3)!(T[4)
SET SG=+T
End DoDot:1
+6 QUIT
+7 ;
PHA34 ;Pharynx - 3rd and 4th editions
+1 IF M[1
SET SG=4
+2 IF '$TEST
IF M[0
Begin DoDot:1
+3 IF (N[2)!(N[3)
SET SG=4
+4 IF '$TEST
IF N[1
IF (T[1)!(T[2)!(T[3)!(T[4)
SET SG=$SELECT(T=4:4,1:3)
+5 IF '$TEST
IF N[0
IF (T["IS")!(T[1)!(T[2)!(T[3)!(T[4)
SET SG=+T
End DoDot:1
+6 QUIT
+7 ;
PHAN56 ;Pharynx - nasopharynx - 5th and 6th editions
+1 SET TNM=T_$EXTRACT(N,1)_M
Begin DoDot:1
+2 ;0 Tis N0 M0
IF TNM="IS00"
SET SG=0
QUIT
+3 ;I T1 N0 M0
IF TNM=100
SET SG=1
QUIT
+4 ;IIA T2a N0 M0
IF TNM="2A00"
SET SG="2A"
QUIT
+5 ;IIB T1 N1 M0
IF TNM=110
SET SG="2B"
QUIT
+6 ; T2 N1 M0
IF TNM=210
SET SG="2B"
QUIT
+7 ; T2a N1 M0
IF TNM="2A10"
SET SG="2B"
QUIT
+8 ; T2b N0 M0
IF TNM="2B00"
SET SG="2B"
QUIT
+9 ; T2b N1 M0
IF TNM="2B10"
SET SG="2B"
QUIT
+10 ;III T1 N2 M0
IF TNM=120
SET SG=3
QUIT
+11 ; T2a N2 M0
IF TNM="2A20"
SET SG=3
QUIT
+12 ; T2b N2 M0
IF TNM="2B20"
SET SG=3
QUIT
+13 ; T3 N0 M0
IF TNM=300
SET SG=3
QUIT
+14 ; T3 N1 M0
IF TNM=310
SET SG=3
QUIT
+15 ; T3 N2 M0
IF TNM=320
SET SG=3
QUIT
+16 ;IVA T4 N0 M0
IF TNM=400
SET SG="4A"
QUIT
+17 ; T4 N1 M0
IF TNM=410
SET SG="4A"
QUIT
+18 ; T4 N2 M0
IF TNM=420
SET SG="4A"
QUIT
+19 ;IVB Any T N3 M0
IF $EXTRACT(N,1)=3
IF M=0
SET SG="4B"
QUIT
+20 ;IVC Any T Any N M1
IF M=1
SET SG="4C"
QUIT
End DoDot:1
KILL TNM
QUIT
+21 ;
PHAOH5 ;Pharynx - oropharynx, hypopharynx - 5th edition
+1 SET TNM=T_$EXTRACT(N,1)_M
Begin DoDot:1
+2 ;0 Tis N0 M0
IF TNM="IS00"
SET SG=0
QUIT
+3 ;I T1 N0 M0
IF TNM=100
SET SG=1
QUIT
+4 ;II T2 N0 M0
IF TNM=200
SET SG=2
QUIT
+5 ;III T3 N0 M0
IF TNM=300
SET SG=3
QUIT
+6 ; T1 N1 M0
IF TNM=110
SET SG=3
QUIT
+7 ; T2 N1 M0
IF TNM=210
SET SG=3
QUIT
+8 ; T3 N1 M0
IF TNM=310
SET SG=3
QUIT
+9 ;IVA T4 N0 M0
IF TNM=400
SET SG="4A"
QUIT
+10 ; T4 N1 M0
IF TNM=410
SET SG="4A"
QUIT
+11 ; Any T N2 M0
IF $EXTRACT(N,1)=2
IF M=0
SET SG="4A"
QUIT
+12 ;IVB Any T N3 M0
IF $EXTRACT(N,1)=3
IF M=0
SET SG="4B"
QUIT
+13 ;IVC Any T Any N M1
IF M=1
SET SG="4C"
QUIT
End DoDot:1
KILL TNM
QUIT
+14 ;
PHAOH6 ;Pharynx - oropharynx, hypopharynx - 6th edition
+1 SET TNM=T_$EXTRACT(N,1)_M
Begin DoDot:1
+2 ;0 Tis N0 M0
IF TNM="IS00"
SET SG=0
QUIT
+3 ;I T1 N0 M0
IF TNM=100
SET SG=1
QUIT
+4 ;II T2 N0 M0
IF TNM=200
SET SG=2
QUIT
+5 ;III T3 N0 M0
IF TNM=300
SET SG=3
QUIT
+6 ; T1 N1 M0
IF TNM=110
SET SG=3
QUIT
+7 ; T2 N1 M0
IF TNM=210
SET SG=3
QUIT
+8 ; T3 N1 M0
IF TNM=310
SET SG=3
QUIT
+9 ;IVA T4a N0 M0
IF TNM="4A00"
SET SG="4A"
QUIT
+10 ; T4a N1 M0
IF TNM="4A10"
SET SG="4A"
QUIT
+11 ; T1 N2 M0
IF TNM=120
SET SG="4A"
QUIT
+12 ; T2 N2 M0
IF TNM=220
SET SG="4A"
QUIT
+13 ; T3 N2 M0
IF TNM=320
SET SG="4A"
QUIT
+14 ; T4a N2 M0
IF TNM="4A20"
SET SG="4A"
QUIT
+15 ;IVB T4b Any N M0
IF T="4B"
IF M=0
SET SG="4B"
QUIT
+16 ; Any T N3 M0
IF $EXTRACT(N,1)=3
IF M=0
SET SG="4B"
QUIT
+17 ;IVC Any T Any N M1
IF M=1
SET SG="4C"
QUIT
End DoDot:1
KILL TNM
QUIT
+18 ;
PHAN7 ;Pharynx - nasopharynx - 7th edition
+1 SET TNM=T_$EXTRACT(N,1)_M
Begin DoDot:1
+2 ;0 Tis N0 M0
IF TNM="IS00"
SET SG=0
QUIT
+3 ;I T1 N0 M0
IF TNM=100
SET SG=1
QUIT
+4 ;II T1 N1 M0
IF TNM=110
SET SG=2
QUIT
+5 ; T2 N0 M0
IF TNM=200
SET SG=2
QUIT
+6 ; T2 N1 M0
IF TNM=210
SET SG=2
QUIT
+7 ;III T1 N2 M0
IF TNM=120
SET SG=3
QUIT
+8 ; T2 N2 M0
IF TNM=220
SET SG=3
QUIT
+9 ; T3 N0 M0
IF TNM=300
SET SG=3
QUIT
+10 ; T3 N1 M0
IF TNM=310
SET SG=3
QUIT
+11 ; T3 N2 M0
IF TNM=320
SET SG=3
QUIT
+12 ;IVA T4 N0 M0
IF TNM=400
SET SG="4A"
QUIT
+13 ; T4 N1 M0
IF TNM=410
SET SG="4A"
QUIT
+14 ; T4 N2 M0
IF TNM=420
SET SG="4A"
QUIT
+15 ;IVB Any T N3 M0
IF $EXTRACT(N,1)=3
IF M=0
SET SG="4B"
QUIT
+16 ;IVC Any T Any N M1
IF M=1
SET SG="4C"
QUIT
End DoDot:1
KILL TNM
QUIT
+17 ;
LAR12 ;Larynx - 1st and 2nd editions
+1 IF M[1
SET SG=4
+2 IF '$TEST
IF M[0
Begin DoDot:1
+3 IF (N[2)!(N[3)
SET SG=4
+4 IF '$TEST
IF N[1
IF (T[1)!(T[2)!(T[3)!(T[4)
SET SG=$SELECT(T=4:4,1:3)
+5 IF '$TEST
IF N[0
IF (T[1)!(T[2)!(T[3)!(T[4)
SET SG=+T
End DoDot:1
+6 QUIT
+7 ;
LAR34 ;Larynx - 3rd and 4th editions
+1 IF M[1
SET SG=4
+2 IF '$TEST
IF M[0
Begin DoDot:1
+3 IF (N[2)!(N[3)
SET SG=4
+4 IF '$TEST
IF N[1
IF (T[1)!(T[2)!(T[3)!(T[4)
SET SG=$SELECT(T=4:4,1:3)
+5 IF '$TEST
IF N[0
IF (T["IS")!(T[1)!(T[2)!(T[3)!(T[4)
SET SG=+T
End DoDot:1
+6 QUIT
+7 ;
LAR5 ;Larynx - 5th edition
+1 IF T="IS"
SET TNM=T_$EXTRACT(N,1)_M
+2 IF '$TEST
SET TNM=$EXTRACT(T,1)_$EXTRACT(N,1)_M
+3 Begin DoDot:1
+4 ;0 Tis N0 M0
IF TNM="IS00"
SET SG=0
QUIT
+5 ;I T1 N0 M0
IF TNM=100
SET SG=1
QUIT
+6 ;II T2 N0 M0
IF TNM=200
SET SG=2
QUIT
+7 ;III T3 N0 M0
IF TNM=300
SET SG=3
QUIT
+8 ; T1 N1 M0
IF TNM=110
SET SG=3
QUIT
+9 ; T2 N1 M0
IF TNM=210
SET SG=3
QUIT
+10 ; T3 N1 M0
IF TNM=310
SET SG=3
QUIT
+11 ;IVA T4 N0 M0
IF TNM=400
SET SG="4A"
QUIT
+12 ; T4 N1 M0
IF TNM=410
SET SG="4A"
QUIT
+13 ; Any T N2 M0
IF $EXTRACT(N,1)=2
IF M=0
SET SG="4A"
QUIT
+14 ;IVB Any T N3 M0
IF $EXTRACT(N,1)=3
IF M=0
SET SG="4B"
QUIT
+15 ;IVC Any T Any N M1
IF M=1
SET SG="4C"
QUIT
End DoDot:1
KILL TNM
QUIT
+16 ;
LAR6 ;Larynx - 6th edition
+1 SET TNM=T_$EXTRACT(N,1)_M
+2 Begin DoDot:1
+3 ;0 Tis N0 M0
IF TNM="IS00"
SET SG=0
QUIT
+4 ;I T1 N0 M0
IF TNM=100
SET SG=1
QUIT
+5 IF TNM="1A00"
SET SG=1
QUIT
+6 IF TNM="1B00"
SET SG=1
QUIT
+7 ;II T2 N0 M0
IF TNM=200
SET SG=2
QUIT
+8 ;III T3 N0 M0
IF TNM=300
SET SG=3
QUIT
+9 ; T1 N1 M0
IF TNM=110
SET SG=3
QUIT
+10 IF TNM="1A10"
SET SG=3
QUIT
+11 IF TNM="1B10"
SET SG=3
QUIT
+12 ; T2 N1 M0
IF TNM=210
SET SG=3
QUIT
+13 ; T3 N1 M0
IF TNM=310
SET SG=3
QUIT
+14 ;IVA T4a N0 M0
IF TNM="4A00"
SET SG="4A"
QUIT
+15 ; T4a N1 M0
IF TNM="4A10"
SET SG="4A"
QUIT
+16 ; T1 N2 M0
IF TNM=120
SET SG="4A"
QUIT
+17 IF TNM="1A20"
SET SG="4A"
QUIT
+18 IF TNM="1B20"
SET SG="4A"
QUIT
+19 ; T2 N2 M0
IF TNM=220
SET SG="4A"
QUIT
+20 ; T3 N2 M0
IF TNM=320
SET SG="4A"
QUIT
+21 ; T4a N2 M0
IF TNM="4A20"
SET SG="4A"
QUIT
+22 ;IVB T4b Any N M0
IF T="4B"
IF M=0
SET SG="4B"
QUIT
+23 ; Any T N3 M0
IF $EXTRACT(N,1)=3
IF M=0
SET SG="4B"
QUIT
+24 ;IVC Any T Any N M1
IF M=1
SET SG="4C"
QUIT
End DoDot:1
KILL TNM
QUIT
+25 ;
CLEANUP ;Cleanup
+1 KILL M,N,SG,T