ONCSGA8U ;HINES OIFO/RTK - AJCC 8th Ed Staging Utilities ;02/04/19
;;2.2;ONCOLOGY;**10,12,13**;Jul 31, 2013;Build 7
;
;
TNMSET ;Set the value of 8th Ed+ TNM in HIERTNM variable, but don't display
D GETFLD
S HIERTNM=T_$S(TSFX'="":TSFX,1:"")_" "_N_$S(NSFX'="":NSFX,1:"")_" "_M
Q
TNMDSP ;Display the 8th Ed TNM fields
D GETFLD
W T,$S(TSFX'="":TSFX,1:"")," ",N,$S(NSFX'="":NSFX,1:"")," ",M
Q
GETFLD ;Get the TNM (Clin/Path/Post-Th) from the record
I STGIND="C" D
.S T=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",2)
.S TSFX=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",14)
.S N=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",3)
.S NSFX=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",15)
.S M=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",4)
I STGIND="P" D
.S T=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",6)
.S TSFX=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",16)
.S N=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",7)
.S NSFX=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",17)
.S M=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",8)
I STGIND="Y" D
.S T=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",20)
.S TSFX=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",24)
.S N=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",21)
.S NSFX=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",25)
.S M=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",22)
I STGIND="T" D
.S T=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",10)
.S TSFX=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",18)
.S N=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",11)
.S NSFX=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",19)
.S M=$P($G(^ONCO(165.5,IEN,"AJCC8")),"^",12)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONCSGA8U 1496 printed Dec 13, 2024@02:28:31 Page 2
ONCSGA8U ;HINES OIFO/RTK - AJCC 8th Ed Staging Utilities ;02/04/19
+1 ;;2.2;ONCOLOGY;**10,12,13**;Jul 31, 2013;Build 7
+2 ;
+3 ;
TNMSET ;Set the value of 8th Ed+ TNM in HIERTNM variable, but don't display
+1 DO GETFLD
+2 SET HIERTNM=T_$SELECT(TSFX'="":TSFX,1:"")_" "_N_$SELECT(NSFX'="":NSFX,1:"")_" "_M
+3 QUIT
TNMDSP ;Display the 8th Ed TNM fields
+1 DO GETFLD
+2 WRITE T,$SELECT(TSFX'="":TSFX,1:"")," ",N,$SELECT(NSFX'="":NSFX,1:"")," ",M
+3 QUIT
GETFLD ;Get the TNM (Clin/Path/Post-Th) from the record
+1 IF STGIND="C"
Begin DoDot:1
+2 SET T=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",2)
+3 SET TSFX=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",14)
+4 SET N=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",3)
+5 SET NSFX=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",15)
+6 SET M=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",4)
End DoDot:1
+7 IF STGIND="P"
Begin DoDot:1
+8 SET T=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",6)
+9 SET TSFX=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",16)
+10 SET N=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",7)
+11 SET NSFX=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",17)
+12 SET M=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",8)
End DoDot:1
+13 IF STGIND="Y"
Begin DoDot:1
+14 SET T=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",20)
+15 SET TSFX=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",24)
+16 SET N=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",21)
+17 SET NSFX=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",25)
+18 SET M=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",22)
End DoDot:1
+19 IF STGIND="T"
Begin DoDot:1
+20 SET T=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",10)
+21 SET TSFX=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",18)
+22 SET N=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",11)
+23 SET NSFX=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",19)
+24 SET M=$PIECE($GET(^ONCO(165.5,IEN,"AJCC8")),"^",12)
End DoDot:1
+25 QUIT