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

ONCNTX.m

Go to the documentation of this file.
ONCNTX ;HINES OIFO/GWB - No treatment stuffing ;03/31/11
 ;;2.2;ONCOLOGY;**1,6,10,15,20**;Jul 31, 2013;Build 5
 ;
NTX ;No treatment stuffing
 N COC,PAUSE
 S COC=$E($$GET1^DIQ(165.5,DA,.04,"E"),1,2)
 ;ROADS
 N SITE
 S SITE=$P(^ONCO(165.5,DA,0),U,1)
 I DATEDX<3030000 D
 .D HDR,SURR,SURATFR^ONCNTX1,NODER
 .I (SITE=35)!(SITE=58)!(SITE=63)!(SITE=65)!($$LYMPHOMA^ONCFUNC(DA)=1) D NODATFR^ONCUTX1
 .E  D NODATFR^ONCNTX1
 .D SOSNR,SOSATFR^ONCNTX1
 .W ! D PAUSE
 ;
 ;FORDS
 D HDR
 S TP=$P($G(^ONCO(165.5,DA,2)),U,1)
 S TXDT=$P($G(^ONCO(165.5,DA,3.1)),U,38)_"S0"
 K ^ONCO(165.5,"ATX",DA,TXDT)
 S $P(^ONCO(165.5,DA,3.1),U,38)="0000000"
 S ^ONCO(165.5,"ATX",DA,"0000000S0")=""
 ;D SUR,SURATF^ONCNTX1,SA,SM,NODE
 D SUR,SURATF^ONCNTX1,SA,SM
 ;Code 9 (FORDS 138-139)
 N MO S MO=$$HIST^ONCFUNC(DA)
 N TP14 S TP14=$E(TP,1,4)
 I (TP14=6770)!(TP14=6771)!(TP14=6772)!(TP=67751)!(TP=67752)!(TP=67753)!(TP14=6776)!(($$LYMPHOMA^ONCFUNC(DA)=1)&(TP14=6777))!(TP14=6776)!(TP=67809)!(TP=67420)!(TP=67421)!(TP=67423)!(TP=67424)!((MO'<97310)&(MO'>99899)) D NODEATF^ONCUTX1
 E  W "" ;D NODEATF^ONCNTX1
 D SOSN,SOSNATF^ONCNTX1,RR,DSD
 D RFNS W ! S Y=138.4 Q
 ;
NTXCONT S $P(^ONCO(165.5,DA,3),U,6)=0
 S $P(^ONCO(165.5,DA,3.1),U,12)=0
 ;S $P(^ONCO(165.5,DA,3),U,35)=""
 D HDR,RAD1,RADATF^ONCNTX1,RAD2,RSSQ^ONCNTX1,RFNR W !
 ;S $P(^ONCO(165.5,DA,3),U,13)="00"
 S $P(^ONCO(165.5,DA,3.1),U,14)="00"
 ;S $P(^ONCO(165.5,DA,3),U,16)="00"
 S $P(^ONCO(165.5,DA,3.1),U,16)="00"
 ;S $P(^ONCO(165.5,DA,3),U,19)="00"
 S $P(^ONCO(165.5,DA,3.1),U,18)="00"
 ;S $P(^ONCO(165.5,DA,3.1),U,36)=1
 ;S $P(^ONCO(165.5,DA,3),U,25)=0
 S $P(^ONCO(165.5,DA,3.1),U,20)=0
 D HDR,CHE,CHEMATF^ONCNTX1,HOR^ONCNTX1,HTATF^ONCNTX1,IMM^ONCNTX1,IMMATF^ONCNTX1,HTEP^ONCNTX1,HTEPATF^ONCNTX1,SSS^ONCNTX1
 D PAUSE
 D HDR,OTH^ONCNTX1,OTHATF^ONCNTX1
 W !
 D PAUSE
 ;
 W ! S Y="@425" G EXIT
 ;
SURR ;SURGERY OF PRIMARY (R) (165.5,58.2)
 S $P(^ONCO(165.5,DA,3),U,38)=$S(DATEDX>2971231:1,1:"00")
 S $P(^ONCO(165.5,DA,3),U,34)=1
 S DR="58.2;74" D DIQ1
 I $D(NTX) D
 .;W !,"SURGICAL PROCEDURES (R)=ROADS"
 .;W !,"-----------------------------"
 .W !,"SURGERY OF PRIMARY..........(R): ",ONC(165.5,DA,58.2,"E")
 W !,"SURGICAL APPROACH...........(R): ",ONC(165.5,DA,74,"E")
 K ONC
 Q
 ;
SUR ;SURGERY OF PRIMARY (F) (165.5,58.6)
 S TOPX=$P($G(^ONCO(165.5,DA,2)),U,1)
 N TOPSRCDZ S TOPSRCDZ=$P($G(^ONCO(164,TOPX,0)),U,16)
 I (TOPX=67420)!(TOPX=67421)!(TOPX=67423)!(TOPX=67424)!($E(TOPX,3,4)=76)!(TOPX=67809) D  G SUR1
 .S $P(^ONCO(165.5,DA,3.1),U,29)=1
 S $P(^ONCO(165.5,DA,3.1),U,29)=$S(DATEDX>2971231:1,1:"00")
 I DATEDX>3221231 D
 .S $P(^ONCO(165.5,DA,3.2),U,9)="A000"
 .I TOPSRCDZ=67440 S $P(^ONCO(165.5,DA,3.2),U,9)="B000"
 .I (TOPSRCDZ=67420)!(TOPSRCDZ=67760) S $P(^ONCO(165.5,DA,3.2),U,9)="A980"
 .Q
SUR1 S TXDT=$P($G(^ONCO(165.5,DA,3)),U,1)_"S1"
 K ^ONCO(165.5,"ATX",DA,TXDT)
 S $P(^ONCO(165.5,DA,3),U,1)="0000000" D SPSDT^ONCATF
 S ^ONCO(165.5,"ATX",DA,"0000000S1")=""
 S $P(^ONCO(165.5,DA,3),U,28)=8
 ;S $P(^ONCO(165.5,DA,0),U,11)="00000000"
 S $P(^ONCO(165.5,DA,"THY1"),U,36)="0000000"
 S $P(^ONCO(165.5,DA,3.1),U,28)=0
 S DR="58.6:58.9;50;74;59;435;14;170" D DIQ1
 I $D(NTX) D
 .;W !,"SURGICAL PROCEDURES (F)=FORDS"
 .;W !,"-----------------------------"
 .W !,"DATE FIRST SURGICAL PROCEDURE..: ",ONC(165.5,DA,170,"E")
 .W:DATEDX<3230000 !,"RX SUMM--SURG PRIMSITE 03-2022.: ",ONC(165.5,DA,58.6,"E")
 .W:DATEDX>3221231 !,"RX SUMM--SURG PRIM SITE 2023...: ",ONC(165.5,DA,58.9,"E")
 W !,"MOST DEFINITIVE SURG DATE......: ",ONC(165.5,DA,50,"E")
 K ONC,TXDT,TOPX
 Q
 ;
SA ;APPROACH (165.5,234)
 ;Q:DATEDX<3100000
 ;S $P(^ONCO(165.5,DA,2.3),U,4)=0
 ;S DR=234 D DIQ1
 ;W !,"APPROACH.......................: ",ONC(165.5,DA,234,"E")
 Q
 ;
SM ;SURGICAL MARGINS (165.5,59)
 N HST14,MO,TPG
 S TPG=$P($G(^ONCO(165.5,DA,2)),U,1)
 S MO=$$HIST^ONCFUNC(DA)
 S HST14=$E(MO,1,4)
 S $P(^ONCO(165.5,DA,3),U,28)=8
 I $$LYMPH^ONCFUNC(DA),($E(TPG,3,4)=77) S $P(^ONCO(165.5,DA,3),U,28)=9
 I ($E(TPG,3,4)=76)!(TPG=67809)!(TPG=67420)!(TPG=67421)!(TPG=67423)!(TPG=67424) S $P(^ONCO(165.5,DA,3),U,28)=9
 I $$HEMATO^ONCFUNC(DA) S $P(^ONCO(165.5,DA,3),U,28)=9
 S DR="59" D DIQ1
 W !,"SURGICAL MARGINS...............: ",ONC(165.5,DA,59,"E")
 K ONC
 Q
 ;
NODER ;SCOPE OF LN SURGERY (R) (165.5,138)
 ;For unknown primary, leukemia, lymphoma, & brain, code 9
 N LAST,SC,SGRP,SITE
 S SITE=$P(^ONCO(165.5,DA,0),U,1)
 I (SITE=35)!(SITE=58)!(SITE=63)!(SITE=65)!($$LYMPHOMA^ONCFUNC(DA)=1) D  D NUMND^ONCATF Q
 .D SGRP^ONCUTX1
 .I ($E(TPG,3,4)=76)!(TPG=67809)!(TPG=67420)!(TPG=67421)!(TPG=67423)!(TPG=67424) S SGRP=67141
 .F SC=0:0 S SC=$O(^ONCO(164,SGRP,"SC5",SC)) Q:SC="B"  S LAST=SC
 .S $P(^ONCO(165.5,DA,3),U,40)=LAST
 .W !,"SCOPE OF LN SURGERY.........(R): ",$P(^ONCO(164,SGRP,"SC5",LAST,0),U,1)
 .D NODER^ONCUTX
 S $P(^ONCO(165.5,DA,3),U,40)=1
 S $P(^ONCO(165.5,DA,3),U,42)="00"
 D NUMND^ONCATF
 S DR="138;140" D DIQ1
 W:$D(NTX) !,"SCOPE OF LN SURGERY.........(R): ",ONC(165.5,DA,138,"E")
 W !,"NUMBER OF LN REMOVED........(R): ",ONC(165.5,DA,140,"E")
 Q
 ;
NODE ;SCOPE OF LN SURGERY (F) (165.5,138.4)
 ;Code 9 (FORDS 138-139)
 S TP=$P($G(^ONCO(165.5,DA,2)),U,1)
 N TP14 S TP14=$E(TP,1,4)
 N MO S MO=$$HIST^ONCFUNC(DA)
 I (TP14=6770)!(TP14=6771)!(TP14=6772)!(TP=67751)!(TP=67752)!(TP=67753)!(TP14=6776)!(($$LYMPHOMA^ONCFUNC(DA)=1)&(TP14=6777))!(TP14=6776)!(TP=67809)!(TP=67420)!(TP=67421)!(TP=67423)!(TP=67424)!((MO'<97310)&(MO'>99899)) D  D SCPDT^ONCATF Q
 .S $P(^ONCO(165.5,DA,3.1),U,31)=9
 .W !,"SCOPE OF LN SURGERY.........(F): Unknown/NA"
 .D NODE^ONCUTX
 S $P(^ONCO(165.5,DA,3.1),U,31)=0
 S TXDT=$P($G(^ONCO(165.5,DA,3.1)),U,22)_"S2"
 K ^ONCO(165.5,"ATX",DA,TXDT)
 S $P(^ONCO(165.5,D0,3.1),U,22)="0000000" D SCPDT^ONCATF
 S ^ONCO(165.5,"ATX",DA,"0000000S2")=""
 S DR="138.4;138.2" D DIQ1
 W:$D(NTX) !,"SCOPE OF LN SURGERY.........(F): ",ONC(165.5,DA,138.4,"E")
 W !,"SCOPE OF LN SURGERY DATE.......: ",ONC(165.5,DA,138.2,"E")
 Q
 ;
SOSNR ;SURG PROC/OTHER SITE (R) (165.5,139)
 S $P(^ONCO(165.5,DA,3),U,41)=1
 S DR=139 D DIQ1
 W:$D(NTX) !,"SURG PROC/OTHER SITE........(R): ",ONC(165.5,DA,139,"E")
 Q
 ;
SOSN ;SURG PROC/OTHER SITE (F) (165.5,139.4)
 S $P(^ONCO(165.5,DA,3.1),U,33)=0
 S TXDT=$P($G(^ONCO(165.5,DA,3.1)),U,24)_"S3"
 K ^ONCO(165.5,"ATX",DA,TXDT)
 S $P(^ONCO(165.5,D0,3.1),U,24)="0000000" D SOSNDT^ONCATF
 S ^ONCO(165.5,"ATX",DA,"0000000S3")=""
 S DR="139.4;139.2" D DIQ1
 W:$D(NTX) !,"SURG PROC/OTHER SITE........(F): ",ONC(165.5,DA,139.4,"E")
 W !,"SURG PROC/OTHER SITE DATE......: ",ONC(165.5,DA,139.2,"E")
 Q
 ;
RR ;RECONSTRUCTION/RESTORATION (165.5,23)
 I DATEDX>3021231 Q
 I DATEDX>2951231 D
 .S $P(^ONCO(165.5,DA,3),U,33)=$S(DATEDX>2971231:1,1:9)
 .S DR=23 D DIQ1
 .W !,"RECONSTRUCTION/RESTORATION.....: ",ONC(165.5,DA,23,"E")
 Q
 ;
DSD ;DATE OF SURGICAL DISCHARGE (165.5,435)
 ;READMISSION W/I 30 DAYS/SURG (165.5,14)
 S $P(^ONCO(165.5,DA,"THY1"),U,36)="0000000"
 S $P(^ONCO(165.5,DA,3.1),U,28)=0
 S $P(^ONCO(165.5,DA,7),U,19)=9
 S $P(^ONCO(165.5,DA,7),U,20)=""
 S DR="435;14;46" D DIQ1
 W !,"DATE OF SURGICAL DISCHARGE.....: ",ONC(165.5,DA,435,"E")
 W !,"READMISSION W/I 30 DAYS/SURG...: ",ONC(165.5,DA,14,"E")
 W !,"CAP PROTOCOL REVIEW............: ",ONC(165.5,DA,46,"E")
 K ONC
 Q
 ;
RFNS ;REASON NO SURGERY OF PRIMARY (165.5,58)
 I $D(NTX) W ! D  Q
 .N DIE,DR,DP,DL,DQ
 .S DIE="^ONCO(165.5,",DR=58 D ^DIE
 N RFNS
 S RFNS=$$GET1^DIQ(165.5,DA,1.2)
 I (COC=38)!(RFNS="Autopsy only")!(RFNS="Death certificate only") D  Q
 .S $P(^ONCO(165.5,DA,3),U,26)=9
 .W !,"REASON NO SURGERY OF PRIMARY...: Unknown"
 S RFNSDD=$P(^DD(165.5,58,0),U,3)
 W ! K DIR S DIR(0)="SA^"_RFNSDD
 S DIR("A")="REASON NO SURGERY OF PRIMARY: "
 ;S DIR("B")="Not part of 1st course"
 S DIR("??")="^D RFNSHLP^ONCNTX1"
 D ^DIR
 I Y[U Q
 S $P(^ONCO(165.5,DA,3),U,26)=Y
 K RFNSDD Q
 ;
RAD1 ;RADIATION (165.5,51.2)
 N RFNR
 S RFNR=$P($G(^ONCO(165.5,DA,3)),U,35)
 D ^ONCRFNR
 S DR="51.2;51" D DIQ1
 W:$D(NTX) !,"RADIATION:.....................: ",ONC(165.5,DA,51.2,"E")
 W !,"DATE RADIATION STARTED.........: ",ONC(165.5,DA,51,"E")
 K ONC,TXDT Q
 ;
RAD2 ;RADIATION (cont)
 I $P($G(^ONCO(165.5,DA,0)),"^",16)<3180000 D
 .S $P(^ONCO(165.5,DA,3),U,21)=1
 .S $P(^ONCO(165.5,DA,"BLA2"),U,18)=1
 .S $P(^ONCO(165.5,DA,"THY1"),U,43)=0
 .S $P(^ONCO(165.5,DA,24),U,9)=1
 .S $P(^ONCO(165.5,DA,"THY1"),U,44)=0
 .S $P(^ONCO(165.5,DA,3),U,20)=0
 S $P(^ONCO(165.5,DA,3),U,22)=0
 S $P(^ONCO(165.5,DA,"BLA2"),U,16)="0000000"
 S DR="126;125;363;442;363.1;443;56;361" D DIQ1
 W !,"LOCATION OF RADIATION..........: ",ONC(165.5,DA,126,"E")
 I $P($G(^ONCO(165.5,DA,0)),"^",16)<3180000 D
 .W !,"RADIATION TREATMENT VOLUME.....: ",ONC(165.5,DA,125,"E")
 .W !,"REGIONAL TREATMENT MODALITY....: ",ONC(165.5,DA,363,"E")
 .W !,"REGIONAL DOSE:cGy..............: ",ONC(165.5,DA,442,"E")
 .W !,"BOOST TREATMENT MODALITY.......: ",ONC(165.5,DA,363.1,"E")
 .W !,"BOOST DOSE:cGy.................: ",ONC(165.5,DA,443,"E")
 .W !,"NUMBER OF TREATMENTS...........: ",ONC(165.5,DA,56,"E")
 I $P($G(^ONCO(165.5,DA,0)),"^",16)>3171231 D
 .S $P(^ONCO(165.5,D0,"RAD18"),"^",4)=1
 .D RADSTF^ONCOAIP2
 .S $P(^ONCO(165.5,DA,"NCR18B"),U,1)="00"
 .S $P(^ONCO(165.5,DA,"NCR18B"),U,2)="00"
 .S $P(^ONCO(165.5,DA,"NCR18B"),U,3)="000000"
 .W !,"NUMBER OF PHASES RAD TX..............: 00"
 .W !,"RADIATION TREATMENT DISC EARLY.......: 00"
 .W !,"TOTAL DOSE...........................: 000000"
 .S $P(^ONCO(165.5,D0,3),"^",7)=0    ; SET RAD/SURG SEQUENCE = 0
 .;S $P(^ONCO(165.5,D0,3),"^",35)=""  ; CLEAR REASON FOR NO RAD FIELD
 W !,"DATE RADIATION ENDED...........: ",ONC(165.5,DA,361,"E")
 I $P($G(^ONCO(165.5,DA,0)),"^",16)>3171231 W !
 K ONC,TXDT Q
 ;
RFNR ;REASON FOR NO RADIATION (165.5,75)
 I $D(NTX) W ! D  Q
 .N DIE,DL,DP,DQ,DR
 .S DIE="^ONCO(165.5,",DR=75 D ^DIE
 N RFNS
 S RFNS=$$GET1^DIQ(165.5,DA,1.2)
 I (COC=38)!(RFNS="Autopsy only")!(RFNS="Death certificate only") D  Q
 .S $P(^ONCO(165.5,DA,3),U,35)=9
 .W !,"REASON NO SURGERY OF PRIMARY...: Unknown"
 S RFNRDD=$P(^DD(165.5,75,0),U,3)
 W ! K DIR S DIR(0)="SA^"_RFNRDD
 S DIR("A")="REASON FOR NO RADIATION: "
 S DIR("B")="Not part of 1st course"
 S DIR("??")="^D RFNRHLP^ONCNTX1"
 D ^DIR
 I Y[U Q
 S $P(^ONCO(165.5,DA,3),U,35)=Y
 I X=8 S RFNR=8 D ^ONCRFNR D
 .W !!,"DATE RADIATION STARTED changed to 88/88/8888"
 K RFNRDD Q
 ;
CHE ;CHEMOTHERAPY (165.5,53.2)
 I $D(NTX) D
 .N DIE,DL,DP,DQ,DR
 .S DIE="^ONCO(165.5,",DR=53.2 D ^DIE
 S TXDT=$P(^ONCO(165.5,DA,3),U,11)_"C"
 K ^ONCO(165.5,"ATX",DA,TXDT)
 S $P(^ONCO(165.5,DA,3),U,11)="0000000" D CHEMDT^ONCATF1
 S ^ONCO(165.5,"ATX",DA,"0000000C")=""
 F CMX=28,29,30,44,45 S $P(^ONCO(165.5,DA,"LUN2"),U,CMX)="" K CMX
 S DR=53 D DIQ1
 W !,"CHEMOTHERAPY DATE.............: ",ONC(165.5,DA,53,"E")
 K ONC Q
 ;
NCDS ;SURGICAL DX/STAGING PROC (165.5,58.1)
 S $P(^ONCO(165.5,D0,3),U,31)="0000000" D NCDSDT^ONCATF
 S DR=58.3 D DIQ1
 W !,"SURGICAL DX/STAGING PROC DATE: ",ONC(165.5,DA,58.3,"E")
 Q
 ;
HDR K DASH S $P(DASH,"-",80)="-"
 W @IOF,DASH,!,?1,PATNAM,?TAB,"First Course of Treatment",?SITTAB,SITEGP,!,?1,SSN,?TOPTAB,TOPNAM," ",TOPCOD,!,DASH
 K DASH
 Q
 ;
DIQ1 N DIC,DIQ K ONC
 S DIC="^ONCO(165.5,",DIQ="ONC(",DIQ(0)="E" D EN^DIQ1
 Q
 ;
PAUSE ;"Enter RETURN to continue" prompt
 W ! R "Enter RETURN to continue: ",PAUSE:30
 I PAUSE="" Q
 I PAUSE=U Q
 G PAUSE
 ;
EXIT ;Exit
 W !
 K TP,TPG
 Q
 ;
CLEANUP ;Cleanup
 K D0,DA,DATEDX,NTX,PATNAM,SITEGP,SITTAB,SSN,TAB,TOPCOD,TOPNAM,TOPTAB,X
 K Y