ONC2PSTN ;Hines OIFO/RTK - Post-Install Routine for ONC*2.2*10 [cont] ;11/29/18
;;2.2;ONCOLOGY;**10**;Jul 31, 2013;Build 20
;
PASS4 ;
D MES^XPDUTL("...pass 4 (of 5)...")
S ONCDONE=0
S IEN=0 F S IEN=$O(^ONCO(165.5,IEN)) Q:IEN'>0 D
.S DATEDX=$P($G(^ONCO(165.5,IEN,0)),U,16)
.S TOPIEN=$P($G(^ONCO(165.5,IEN,2)),U,1) Q:TOPIEN=""
.S TOPCOD=$P($G(^ONCO(164,TOPIEN,0)),U,2)
.S ONCTPCD=$P(TOPCOD,".",1)_$P(TOPCOD,".",2) ;remove the "."
.S ONCHIST=$$HIST^ONCFUNC(IEN)
.S HST14=$E(ONCHIST,1,4),ONCT3=$E(ONCTPCD,2,5)
.S RAD1540=$P($G(^ONCO(165.5,IEN,3)),U,21)
.S RAD3200=$P($G(^ONCO(165.5,IEN,24)),U,9)
.I RAD1540=1,RAD3200=1 S RAD1514=1,RAD1515=1,RAD1511="00000",RAD1513="000" D SETPASS4 Q
.I RAD1540=2,RAD3200>17 S RAD1514=10,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=3,RAD3200>17 S RAD1514=11,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=4,RAD3200>17 S RAD1514=12,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=5,RAD3200>17 S RAD1514=13,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I ((RAD1540=6)!(RAD1540=7))&(RAD3200>17) D I ONCDONE=1 Q
..I ((HST14>9589)&(HST14<9730)) S RAD1514=2,RAD1515=10,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I (ONCT3="000")!((ONCT3>0)&(ONCT3<10))!((ONCT3>19)&(ONCT3<51))!((ONCT3>59)&(ONCT3<70)) S RAD1514=16,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I (ONCTPCD="C019")!((ONCT3>50)&(ONCT3<60))!((ONCT3>89)&(ONCT3<110))!(ONCTPCD="C140") S RAD1514=17,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I ((ONCT3>109)&(ONCT3<120)) S RAD1514=15,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I (ONCTPCD="C129")!((ONCT3>129)&(ONCT3<140))!((ONCT3>319)&(ONCT3<330)) S RAD1514=18,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..S RAD1514=22,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=8,RAD3200>17 S RAD1514=18,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=9,RAD3200>17 S RAD1514=19,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=10,RAD3200>17 S RAD1514=20,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=11,RAD3200>17 D I ONCDONE=1 Q
..I ((HST14>9049)&(HST14<9056)) S RAD1514=24,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I ((HST14>8579)&(HST14<8589)) S RAD1514=25,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..S RAD1514=26,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=12,RAD3200>17 D I ONCDONE=1 Q
..I ((HST14>9049)&(HST14<9056)) S RAD1514=24,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I ((HST14>8579)&(HST14<8589)) S RAD1514=25,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..S RAD1514=23,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=13,RAD3200>17 S RAD1514=30,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=14,RAD3200>17 S RAD1514=31,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=15,RAD3200>17 S RAD1514=36,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=16,RAD3200>17 S RAD1514=38,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=17,RAD3200>17 S RAD1514=42,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=18,RAD3200>17 D I ONCDONE=1 Q
..I ((ONCT3>169)&(ONCT3<180)) S RAD1514=32,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I ((ONCT3>179)&(ONCT3<190)) S RAD1514=33,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..S RAD1514=39,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=19,RAD3200>17 D I ONCDONE=1 Q
..I (RAD3200>35)&(RAD3200<42) S RAD1514=28,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I (RAD1540=20)&(((RAD3200>17)&(RAD3200<36))!(RAD3200>41)) S RAD1514=27,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=21,RAD3200>17 S RAD1514=29,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=22,RAD3200>17 S RAD1514=29,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=23,RAD3200>17 S RAD1514=65,RAD1515=10,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=24,RAD3200>17 S RAD1514=66,RAD1515=10,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=25,RAD3200>17 S RAD1514=54,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=26,RAD3200>17 S RAD1514=53,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=27,RAD3200>17 S RAD1514=56,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=28,RAD3200>17 S RAD1514=57,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=29,RAD3200>17 S RAD1514=58,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=30,RAD3200>17 D I ONCDONE=1 Q
..I ((HST14>9589)&(HST14<9730)) S RAD1514=7,RAD1515=10,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I "C180^C181^C182^C183^C184^C185^C186^C187^C188^C189"[ONCTPCD S RAD1514=33,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I ONCTPCD="C209" S RAD1514=34,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I "C210^C211^C212^C213^C214^C215^C216^C217^C218"[ONCTPCD S RAD1514=35,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I "C510^C511^C512^C513^C514^C515^C516^C517^C518^C519"[ONCTPCD S RAD1514=51,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I ONCTPCD="C529" S RAD1514=52,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I ((ONCT3>529)&(ONCT3<560)) S RAD1514=50,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I ONCTPCD="C619" S RAD1514=44,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I ONCTPCD="C669" S RAD1514=43,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I "C670^C671^C672^C673^C674^C675^C676^C677^C678^C679"[ONCTPCD S RAD1514=40,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..S RAD1514=59,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=31,RAD3200>17 S RAD1514=61,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=32,RAD3200>17 S RAD1514=62,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=33,RAD3200>17 S RAD1514=63,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=34,RAD3200>17 S RAD1514=64,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=35,RAD3200>17 S RAD1514=40,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=36,RAD3200>17 S RAD1514=44,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=37,RAD3200>17 S RAD1514=50,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=38,RAD3200>17 S RAD1514=55,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=39,RAD3200>17 S RAD1514=60,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=40,RAD3200>17 S RAD1514=67,RAD1515=10,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=43,RAD3200>17 S RAD1514=14,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=44,RAD3200>17 S RAD1514=44,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=45,RAD3200>17 S RAD1514=21,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=46,RAD3200>17 S RAD1514=9,RAD1515=10,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=41,RAD3200>17 D I ONCDONE=1 Q
..I ONCTPCD="C669" S RAD1514=43,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I ONCTPCD="C680" S RAD1514=46,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I "C600^C601^C602^C603^C604^C605^C606^C607^C608^C609"[ONCTPCD S RAD1514=47,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..I ((ONCT3>619)&(ONCT3<640)) S RAD1514=48,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
..S RAD1514=69,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540=42,RAD3200>17 S RAD1514=70,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.I RAD1540'="",RAD3200>17 S RAD1514=68,RAD1515=11,RAD1511="99999",RAD1513="999" D SETPASS4 Q
.Q
;
PASS5 ;
D MES^XPDUTL("...pass 5 (of 5)...")
S IEN=0 F S IEN=$O(^ONCO(165.5,IEN)) Q:IEN'>0 D
.S DATEDX=$P($G(^ONCO(165.5,IEN,0)),U,16)
.S TOPIEN=$P($G(^ONCO(165.5,IEN,2)),U,1) Q:TOPIEN=""
.S TOPCOD=$P($G(^ONCO(164,TOPIEN,0)),U,2)
.S ONCTPCD=$P(TOPCOD,".",1)_$P(TOPCOD,".",2) ;remove the "."
.S ONCHIST=$$HIST^ONCFUNC(IEN)
.S HST14=$E(ONCHIST,1,4),ONCT3=$E(ONCTPCD,2,5)
.S RAD3200=$P($G(^ONCO(165.5,IEN,24)),U,9)
.I RAD3200="" Q
.I RAD3200=1 S RAD1516=1,RAD1512=1 D SETPASS5 Q
.I (RAD3200=20)!(RAD3200=29) S RAD1516=2,RAD1512=2 D SETPASS5 Q
.I RAD3200=21 S RAD1516=3,RAD1512=3 D SETPASS5 Q
.I (RAD3200=22)!(RAD3200=23)!(RAD3200=24)!(RAD3200=25)!(RAD3200=26)!(RAD3200=27) S RAD1516=3,RAD1512=2 D SETPASS5 Q
.I RAD3200=28 S RAD1516=5,RAD1512=4 D SETPASS5 Q
.I RAD3200=30 S RAD1516=6,RAD1512=2 D SETPASS5 Q
.I RAD3200=31 S RAD1516=3,RAD1512=6 D SETPASS5 Q
.I RAD3200=32 S RAD1516=2,RAD1512=5 D SETPASS5 Q
.I RAD3200=33 S RAD1516=4,RAD1512=2 D SETPASS5 Q
.I RAD3200=34 S RAD1516=3,RAD1512=7 D SETPASS5 Q
.I RAD3200=35 S RAD1516=3,RAD1512=8 D SETPASS5 Q
.I RAD3200=36 S RAD1516=3,RAD1512=9 D SETPASS5 Q
.I RAD3200=37 S RAD1516=8,RAD1512=12 D SETPASS5 Q
.I RAD3200=38 S RAD1516=9,RAD1512=12 D SETPASS5 Q
.I RAD3200=39 S RAD1516=10,RAD1512=12 D SETPASS5 Q
.I RAD3200=40 S RAD1516=11,RAD1512=12 D SETPASS5 Q
.I RAD3200=41 S RAD1516=12,RAD1512=12 D SETPASS5 Q
.I (RAD3200=42)!(RAD3200=43) S RAD1516=14,RAD1512=12 D SETPASS5 Q
.I RAD3200=44 S RAD1516=16,RAD1512=12 D SETPASS5 Q
.I RAD3200=45 S RAD1516=17,RAD1512=12 D SETPASS5 Q
.I RAD3200=18 S RAD1516=18,RAD1512=13 D SETPASS5 Q
.I RAD3200=19 S RAD1516=18,RAD1512=14 D SETPASS5 Q
.I ((RAD3200>1)&(RAD3200<18)) S RAD1516=18,RAD1512=13 D SETPASS5 Q
.Q
;
;
Q
;
SETPASS4 ;set the values for the new RAD fields - Pass 4
S $P(^ONCO(165.5,IEN,"RAD18"),U,11)=RAD1514 ;PHASE 2 RAD TX VOL
S $P(^ONCO(165.5,IEN,"RAD18"),U,12)=RAD1515 ;PHASE 2 RAD DRAINING LN
S $P(^ONCO(165.5,IEN,"RAD18"),U,8)=RAD1511 ;PHASE 2 RAD DOSE PER FRAC
S $P(^ONCO(165.5,IEN,"RAD18"),U,10)=RAD1513 ;PHASE 2 NUM OF FRACTIONS
S ONCDONE=1
Q
;
SETPASS5 ;set the values for the new RAD fields - Pass 5
S $P(^ONCO(165.5,IEN,"RAD18"),U,13)=RAD1516 ;PHASE 2 RAD TX MODALITY
S $P(^ONCO(165.5,IEN,"RAD18"),U,9)=RAD1512 ;PHASE 2 RAD EXT BEAM PLAN
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONC2PSTN 10264 printed Dec 13, 2024@02:21:58 Page 2
ONC2PSTN ;Hines OIFO/RTK - Post-Install Routine for ONC*2.2*10 [cont] ;11/29/18
+1 ;;2.2;ONCOLOGY;**10**;Jul 31, 2013;Build 20
+2 ;
PASS4 ;
+1 DO MES^XPDUTL("...pass 4 (of 5)...")
+2 SET ONCDONE=0
+3 SET IEN=0
FOR
SET IEN=$ORDER(^ONCO(165.5,IEN))
if IEN'>0
QUIT
Begin DoDot:1
+4 SET DATEDX=$PIECE($GET(^ONCO(165.5,IEN,0)),U,16)
+5 SET TOPIEN=$PIECE($GET(^ONCO(165.5,IEN,2)),U,1)
if TOPIEN=""
QUIT
+6 SET TOPCOD=$PIECE($GET(^ONCO(164,TOPIEN,0)),U,2)
+7 ;remove the "."
SET ONCTPCD=$PIECE(TOPCOD,".",1)_$PIECE(TOPCOD,".",2)
+8 SET ONCHIST=$$HIST^ONCFUNC(IEN)
+9 SET HST14=$EXTRACT(ONCHIST,1,4)
SET ONCT3=$EXTRACT(ONCTPCD,2,5)
+10 SET RAD1540=$PIECE($GET(^ONCO(165.5,IEN,3)),U,21)
+11 SET RAD3200=$PIECE($GET(^ONCO(165.5,IEN,24)),U,9)
+12 IF RAD1540=1
IF RAD3200=1
SET RAD1514=1
SET RAD1515=1
SET RAD1511="00000"
SET RAD1513="000"
DO SETPASS4
QUIT
+13 IF RAD1540=2
IF RAD3200>17
SET RAD1514=10
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+14 IF RAD1540=3
IF RAD3200>17
SET RAD1514=11
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+15 IF RAD1540=4
IF RAD3200>17
SET RAD1514=12
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+16 IF RAD1540=5
IF RAD3200>17
SET RAD1514=13
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+17 IF ((RAD1540=6)!(RAD1540=7))&(RAD3200>17)
Begin DoDot:2
+18 IF ((HST14>9589)&(HST14<9730))
SET RAD1514=2
SET RAD1515=10
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+19 IF (ONCT3="000")!((ONCT3>0)&(ONCT3<10))!((ONCT3>19)&(ONCT3<51))!((ONCT3>59)&(ONCT3<70))
SET RAD1514=16
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+20 IF (ONCTPCD="C019")!((ONCT3>50)&(ONCT3<60))!((ONCT3>89)&(ONCT3<110))!(ONCTPCD="C140")
SET RAD1514=17
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+21 IF ((ONCT3>109)&(ONCT3<120))
SET RAD1514=15
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+22 IF (ONCTPCD="C129")!((ONCT3>129)&(ONCT3<140))!((ONCT3>319)&(ONCT3<330))
SET RAD1514=18
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+23 SET RAD1514=22
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
End DoDot:2
IF ONCDONE=1
QUIT
+24 IF RAD1540=8
IF RAD3200>17
SET RAD1514=18
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+25 IF RAD1540=9
IF RAD3200>17
SET RAD1514=19
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+26 IF RAD1540=10
IF RAD3200>17
SET RAD1514=20
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+27 IF RAD1540=11
IF RAD3200>17
Begin DoDot:2
+28 IF ((HST14>9049)&(HST14<9056))
SET RAD1514=24
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+29 IF ((HST14>8579)&(HST14<8589))
SET RAD1514=25
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+30 SET RAD1514=26
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
End DoDot:2
IF ONCDONE=1
QUIT
+31 IF RAD1540=12
IF RAD3200>17
Begin DoDot:2
+32 IF ((HST14>9049)&(HST14<9056))
SET RAD1514=24
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+33 IF ((HST14>8579)&(HST14<8589))
SET RAD1514=25
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+34 SET RAD1514=23
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
End DoDot:2
IF ONCDONE=1
QUIT
+35 IF RAD1540=13
IF RAD3200>17
SET RAD1514=30
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+36 IF RAD1540=14
IF RAD3200>17
SET RAD1514=31
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+37 IF RAD1540=15
IF RAD3200>17
SET RAD1514=36
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+38 IF RAD1540=16
IF RAD3200>17
SET RAD1514=38
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+39 IF RAD1540=17
IF RAD3200>17
SET RAD1514=42
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+40 IF RAD1540=18
IF RAD3200>17
Begin DoDot:2
+41 IF ((ONCT3>169)&(ONCT3<180))
SET RAD1514=32
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+42 IF ((ONCT3>179)&(ONCT3<190))
SET RAD1514=33
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+43 SET RAD1514=39
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
End DoDot:2
IF ONCDONE=1
QUIT
+44 IF RAD1540=19
IF RAD3200>17
Begin DoDot:2
+45 IF (RAD3200>35)&(RAD3200<42)
SET RAD1514=28
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
End DoDot:2
IF ONCDONE=1
QUIT
+46 IF (RAD1540=20)&(((RAD3200>17)&(RAD3200<36))!(RAD3200>41))
SET RAD1514=27
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+47 IF RAD1540=21
IF RAD3200>17
SET RAD1514=29
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+48 IF RAD1540=22
IF RAD3200>17
SET RAD1514=29
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+49 IF RAD1540=23
IF RAD3200>17
SET RAD1514=65
SET RAD1515=10
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+50 IF RAD1540=24
IF RAD3200>17
SET RAD1514=66
SET RAD1515=10
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+51 IF RAD1540=25
IF RAD3200>17
SET RAD1514=54
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+52 IF RAD1540=26
IF RAD3200>17
SET RAD1514=53
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+53 IF RAD1540=27
IF RAD3200>17
SET RAD1514=56
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+54 IF RAD1540=28
IF RAD3200>17
SET RAD1514=57
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+55 IF RAD1540=29
IF RAD3200>17
SET RAD1514=58
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+56 IF RAD1540=30
IF RAD3200>17
Begin DoDot:2
+57 IF ((HST14>9589)&(HST14<9730))
SET RAD1514=7
SET RAD1515=10
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+58 IF "C180^C181^C182^C183^C184^C185^C186^C187^C188^C189"[ONCTPCD
SET RAD1514=33
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+59 IF ONCTPCD="C209"
SET RAD1514=34
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+60 IF "C210^C211^C212^C213^C214^C215^C216^C217^C218"[ONCTPCD
SET RAD1514=35
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+61 IF "C510^C511^C512^C513^C514^C515^C516^C517^C518^C519"[ONCTPCD
SET RAD1514=51
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+62 IF ONCTPCD="C529"
SET RAD1514=52
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+63 IF ((ONCT3>529)&(ONCT3<560))
SET RAD1514=50
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+64 IF ONCTPCD="C619"
SET RAD1514=44
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+65 IF ONCTPCD="C669"
SET RAD1514=43
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+66 IF "C670^C671^C672^C673^C674^C675^C676^C677^C678^C679"[ONCTPCD
SET RAD1514=40
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+67 SET RAD1514=59
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
End DoDot:2
IF ONCDONE=1
QUIT
+68 IF RAD1540=31
IF RAD3200>17
SET RAD1514=61
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+69 IF RAD1540=32
IF RAD3200>17
SET RAD1514=62
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+70 IF RAD1540=33
IF RAD3200>17
SET RAD1514=63
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+71 IF RAD1540=34
IF RAD3200>17
SET RAD1514=64
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+72 IF RAD1540=35
IF RAD3200>17
SET RAD1514=40
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+73 IF RAD1540=36
IF RAD3200>17
SET RAD1514=44
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+74 IF RAD1540=37
IF RAD3200>17
SET RAD1514=50
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+75 IF RAD1540=38
IF RAD3200>17
SET RAD1514=55
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+76 IF RAD1540=39
IF RAD3200>17
SET RAD1514=60
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+77 IF RAD1540=40
IF RAD3200>17
SET RAD1514=67
SET RAD1515=10
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+78 IF RAD1540=43
IF RAD3200>17
SET RAD1514=14
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+79 IF RAD1540=44
IF RAD3200>17
SET RAD1514=44
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+80 IF RAD1540=45
IF RAD3200>17
SET RAD1514=21
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+81 IF RAD1540=46
IF RAD3200>17
SET RAD1514=9
SET RAD1515=10
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+82 IF RAD1540=41
IF RAD3200>17
Begin DoDot:2
+83 IF ONCTPCD="C669"
SET RAD1514=43
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+84 IF ONCTPCD="C680"
SET RAD1514=46
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+85 IF "C600^C601^C602^C603^C604^C605^C606^C607^C608^C609"[ONCTPCD
SET RAD1514=47
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+86 IF ((ONCT3>619)&(ONCT3<640))
SET RAD1514=48
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+87 SET RAD1514=69
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
End DoDot:2
IF ONCDONE=1
QUIT
+88 IF RAD1540=42
IF RAD3200>17
SET RAD1514=70
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+89 IF RAD1540'=""
IF RAD3200>17
SET RAD1514=68
SET RAD1515=11
SET RAD1511="99999"
SET RAD1513="999"
DO SETPASS4
QUIT
+90 QUIT
End DoDot:1
+91 ;
PASS5 ;
+1 DO MES^XPDUTL("...pass 5 (of 5)...")
+2 SET IEN=0
FOR
SET IEN=$ORDER(^ONCO(165.5,IEN))
if IEN'>0
QUIT
Begin DoDot:1
+3 SET DATEDX=$PIECE($GET(^ONCO(165.5,IEN,0)),U,16)
+4 SET TOPIEN=$PIECE($GET(^ONCO(165.5,IEN,2)),U,1)
if TOPIEN=""
QUIT
+5 SET TOPCOD=$PIECE($GET(^ONCO(164,TOPIEN,0)),U,2)
+6 ;remove the "."
SET ONCTPCD=$PIECE(TOPCOD,".",1)_$PIECE(TOPCOD,".",2)
+7 SET ONCHIST=$$HIST^ONCFUNC(IEN)
+8 SET HST14=$EXTRACT(ONCHIST,1,4)
SET ONCT3=$EXTRACT(ONCTPCD,2,5)
+9 SET RAD3200=$PIECE($GET(^ONCO(165.5,IEN,24)),U,9)
+10 IF RAD3200=""
QUIT
+11 IF RAD3200=1
SET RAD1516=1
SET RAD1512=1
DO SETPASS5
QUIT
+12 IF (RAD3200=20)!(RAD3200=29)
SET RAD1516=2
SET RAD1512=2
DO SETPASS5
QUIT
+13 IF RAD3200=21
SET RAD1516=3
SET RAD1512=3
DO SETPASS5
QUIT
+14 IF (RAD3200=22)!(RAD3200=23)!(RAD3200=24)!(RAD3200=25)!(RAD3200=26)!(RAD3200=27)
SET RAD1516=3
SET RAD1512=2
DO SETPASS5
QUIT
+15 IF RAD3200=28
SET RAD1516=5
SET RAD1512=4
DO SETPASS5
QUIT
+16 IF RAD3200=30
SET RAD1516=6
SET RAD1512=2
DO SETPASS5
QUIT
+17 IF RAD3200=31
SET RAD1516=3
SET RAD1512=6
DO SETPASS5
QUIT
+18 IF RAD3200=32
SET RAD1516=2
SET RAD1512=5
DO SETPASS5
QUIT
+19 IF RAD3200=33
SET RAD1516=4
SET RAD1512=2
DO SETPASS5
QUIT
+20 IF RAD3200=34
SET RAD1516=3
SET RAD1512=7
DO SETPASS5
QUIT
+21 IF RAD3200=35
SET RAD1516=3
SET RAD1512=8
DO SETPASS5
QUIT
+22 IF RAD3200=36
SET RAD1516=3
SET RAD1512=9
DO SETPASS5
QUIT
+23 IF RAD3200=37
SET RAD1516=8
SET RAD1512=12
DO SETPASS5
QUIT
+24 IF RAD3200=38
SET RAD1516=9
SET RAD1512=12
DO SETPASS5
QUIT
+25 IF RAD3200=39
SET RAD1516=10
SET RAD1512=12
DO SETPASS5
QUIT
+26 IF RAD3200=40
SET RAD1516=11
SET RAD1512=12
DO SETPASS5
QUIT
+27 IF RAD3200=41
SET RAD1516=12
SET RAD1512=12
DO SETPASS5
QUIT
+28 IF (RAD3200=42)!(RAD3200=43)
SET RAD1516=14
SET RAD1512=12
DO SETPASS5
QUIT
+29 IF RAD3200=44
SET RAD1516=16
SET RAD1512=12
DO SETPASS5
QUIT
+30 IF RAD3200=45
SET RAD1516=17
SET RAD1512=12
DO SETPASS5
QUIT
+31 IF RAD3200=18
SET RAD1516=18
SET RAD1512=13
DO SETPASS5
QUIT
+32 IF RAD3200=19
SET RAD1516=18
SET RAD1512=14
DO SETPASS5
QUIT
+33 IF ((RAD3200>1)&(RAD3200<18))
SET RAD1516=18
SET RAD1512=13
DO SETPASS5
QUIT
+34 QUIT
End DoDot:1
+35 ;
+36 ;
+37 QUIT
+38 ;
SETPASS4 ;set the values for the new RAD fields - Pass 4
+1 ;PHASE 2 RAD TX VOL
SET $PIECE(^ONCO(165.5,IEN,"RAD18"),U,11)=RAD1514
+2 ;PHASE 2 RAD DRAINING LN
SET $PIECE(^ONCO(165.5,IEN,"RAD18"),U,12)=RAD1515
+3 ;PHASE 2 RAD DOSE PER FRAC
SET $PIECE(^ONCO(165.5,IEN,"RAD18"),U,8)=RAD1511
+4 ;PHASE 2 NUM OF FRACTIONS
SET $PIECE(^ONCO(165.5,IEN,"RAD18"),U,10)=RAD1513
+5 SET ONCDONE=1
+6 QUIT
+7 ;
SETPASS5 ;set the values for the new RAD fields - Pass 5
+1 ;PHASE 2 RAD TX MODALITY
SET $PIECE(^ONCO(165.5,IEN,"RAD18"),U,13)=RAD1516
+2 ;PHASE 2 RAD EXT BEAM PLAN
SET $PIECE(^ONCO(165.5,IEN,"RAD18"),U,9)=RAD1512
+3 QUIT