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

ONCSCHMH.m

Go to the documentation of this file.
ONCSCHMH ;HINES OIFO/RTK - TNM CODE CALLED FROM SCHMG ROUTINE ;05/19/20
 ;;2.2;ONCOLOGY;**12,13,20**;Jul 31, 2013;Build 5
 ;
CCODES ;IT code for PATH T/N to also accept CLIN T/N codes
 I ($G(ONCTNMTP)="P")&((ONCNODE=1)!(ONCNODE=6)) S ONCTNMTP="C" D ADDN1CS S ONCTNMTP="P" Q  ; reset ONCTNMTP when done
 I ($G(ONCTNMTP)="P")&((ONCNODE=2)!(ONCNODE=7)) S ONCTNMTP="C" D ADDN2CS S ONCTNMTP="P" Q  ; reset ONCTNMTP when done
 Q
ADDN1CS ;code to add the Clin T codes from Node 1 to ONCAJVAL
 F IEN=0:0 S IEN=$O(^ONCO(165.8,ONCAJIEN,1,IEN)) Q:IEN'>0  D
 .S ONCCODE=$P($G(^ONCO(165.8,ONCAJIEN,1,IEN,0)),U,1)
 .D PRFX^ONCSCHMG S ONCAJVAL=ONCAJVAL_ONCPRFX_ONCCODE_"^"
 Q
ADDN2CS ;code to add the Clin N codes from Node 2 to ONCAJVAL
 F IEN=0:0 S IEN=$O(^ONCO(165.8,ONCAJIEN,2,IEN)) Q:IEN'>0  D
 .S ONCCODE=$P($G(^ONCO(165.8,ONCAJIEN,2,IEN,0)),U,1)
 .D PRFX^ONCSCHMG S ONCAJVAL=ONCAJVAL_ONCPRFX_ONCCODE_"^"
 Q
 ;
YPCHECK ;code for yp to match Path instead of Clin codes where there is 6/7 node
 I ($G(ONCTNMTP)="Y")&((ONCAJIEN=62)!(ONCAJIEN=63)!(ONCAJIEN=75)!(ONCAJIEN=78)) D
 .I ONCNODE=1 S ONCNODE=6
 .Q
 I ($G(ONCTNMTP)="Y")&((ONCAJIEN=1)!(ONCAJIEN=5)!(ONCAJIEN=6)!(ONCAJIEN=50)!(ONCAJIEN=52)!(ONCAJIEN=61)!(ONCAJIEN=63)!(ONCAJIEN=78)) D
 .I ONCNODE=2 S ONCNODE=7
 Q
 ;
CFORPATH ;HELP code for PATH T/N to also display CLIN T/N codes
 ; Set ONCTNMTP="C" to list Clin codes, then set back to "P" before exiting
 I ($G(ONCTNMTP)="P")&((ONCNODE=1)!(ONCNODE=6)) S ONCTNMTP="C" D NODE1CS S ONCTNMTP="P" Q  ; reset ONCTNMTP when done
 I ($G(ONCTNMTP)="P")&((ONCNODE=2)!(ONCNODE=7)) S ONCTNMTP="C" D NODE2CS S ONCTNMTP="P" Q  ; reset ONCTNMTP when done
 Q
NODE1CS ;1 node
 F IEN=0:0 S IEN=$O(^ONCO(165.8,ONCAJIEN,1,IEN)) Q:IEN'>0  D
 .S ONCDES=$P($G(^ONCO(165.8,ONCAJIEN,1,IEN,1)),U,1)
 .S ONCCODE=$P($G(^ONCO(165.8,ONCAJIEN,1,IEN,0)),U,1)
 .D PRFX^ONCSCHMG W !,ONCPRFX,ONCCODE D WORDWRP^ONCSCHMG
 Q
NODE2CS ;2 node
 F IEN=0:0 S IEN=$O(^ONCO(165.8,ONCAJIEN,2,IEN)) Q:IEN'>0  D
 .S ONCDES=$P($G(^ONCO(165.8,ONCAJIEN,2,IEN,1)),U,1)
 .S ONCCODE=$P($G(^ONCO(165.8,ONCAJIEN,2,IEN,0)),U,1)
 .D PRFX^ONCSCHMG W !,ONCPRFX,ONCCODE D WORDWRP^ONCSCHMG
 Q
 ;
NONXX9724 ;special code for Medulloblastoma schema 09724
 S $P(^ONCO(165.5,D0,"AJCC8"),U,2)=88   ;5001 AJCC TNM CLIN T
 S $P(^ONCO(165.5,D0,"AJCC8"),U,3)=88   ;5002 AJCC TNM CLIN N
 W !!,"AJCC TNM CLIN T: 88"
 W !,"AJCC TNM CLIN N: 88"
 I ONCSCMA="09724" S Y=5003 Q
NONXX5003 ;
 S $P(^ONCO(165.5,D0,"AJCC8"),U,5)=88   ;5004 AJCC TNM CLIN STAGE GROUP
 S TMP=$G(X),X=88 D CSSG^ONCOCRC S X=TMP K TMP   ;set "ASG" for field 38.5
 S $P(^ONCO(165.5,D0,"AJCC8"),U,6)=88   ;5011 AJCC TNM PATH T
 S $P(^ONCO(165.5,D0,"AJCC8"),U,7)=88   ;5012 AJCC TNM PATH N
 W !,"AJCC TNM CLIN STAGE GROUP: 88"
 W !!,"AJCC TNM PATH T: 88"
 W !,"AJCC TNM PATH N: 88"
 I ONCSCMA="09724" S Y=5013 Q
NONXX5013 ;
 S $P(^ONCO(165.5,D0,"AJCC8"),U,9)=88   ;5014 AJCC TNM PATH STAGE GROUP
 S TMP=$G(X),X=88 D PSSG^ONCOCRC S X=TMP K TMP   ;set "ASG" for field 38.5
 W !,"AJCC TNM PATH STAGE GROUP: 88"
 S $P(^ONCO(165.5,D0,"AJCC8"),U,20)=""   ;5025 AJCC TNM POST THERAPY (yc) T
 S $P(^ONCO(165.5,D0,"AJCC8"),U,21)=""   ;5026 AJCC TNM POST THERAPY (yc) N
 S $P(^ONCO(165.5,D0,"AJCC8"),U,22)=""   ;5027 AJCC TNM POST THERAPY (yc) M
 ;S $P(^ONCO(165.5,D0,"AJCC8"),U,23)=""   ;5028 AJCC TNM PT STAGE GROUP (yc) N/A
 S $P(^ONCO(165.5,D0,"AJCC8"),U,10)=""   ;5021 AJCC TNM POST THERAPY T
 S $P(^ONCO(165.5,D0,"AJCC8"),U,11)=""   ;5022 AJCC TNM POST THERAPY N
 S $P(^ONCO(165.5,D0,"AJCC8"),U,12)=""   ;5023 AJCC TNM POST THERAPY M
 S $P(^ONCO(165.5,D0,"AJCC8"),U,13)=""   ;5024 AJCC TNM PT STAGE GROUP
 I $P($G(^ONCO(165.5,D0,0)),U,16)>3210000 W !!,"AJCC TNM POST THERAPY (yc) T="
 I $P($G(^ONCO(165.5,D0,0)),U,16)>3210000 W !,"AJCC TNM POST THERAPY (yc) N="
 I $P($G(^ONCO(165.5,D0,0)),U,16)>3210000 W !,"AJCC TNM POST THERAPY (yc) M="
 ;W !,"AJCC TNM POST THERAPY (yc) STAGE GROUP=",!
 W !!,"AJCC TNM POST THERAPY (yp) T="
 W !,"AJCC TNM POST THERAPY (yp) N="
 W !,"AJCC TNM POST THERAPY (yp) M="
 W !,"AJCC TNM POST THERAPY (yp) STAGE GROUP=",!
 S Y="@149" Q
 ;
STGVRCHK ;check the AJCC edition (version) and set correct node
 I DATEDX<3210000 Q
 I DATEDX>3201231 D  ;2021 v9 update-Cervix
 .I ONCAJIEN=55 D
 ..I (ONCNODE=1)!(ONCNODE=6) S ONCNODE="V9T"
 ..I (ONCNODE=2)!(ONCNODE=7) S ONCNODE="V9N"
 ..I ONCNODE=3 S ONCNODE="V9M"
 I DATEDX>3221231 D   ;2023 v9 update-Appendix, Anus, Brain & Spinal Cord
 .I ONCAJIEN=21 D  ; appendix
 ..I ONCNODE=3 S ONCNODE="V9M"
 .I ONCAJIEN=23 D  ; anus
 ..I (ONCNODE=1)!(ONCNODE=6) S ONCNODE="V9T"
 .I ONCAJIEN=108 D  ; medulloblastoma (new 72.9 chapter)
 ..I ONCNODE=3 S ONCNODE="V9M"
 Q