ONCOXU ; GENERATED FROM 'ONCO XABSTRACT RECORD' PRINT TEMPLATE (#826) ; 01/20/16 ; (FILE 165.5, MARGIN=80)
G BEGIN
N W !
T W:$X ! I '$D(DIOT(2)),DN,$D(IOSL),$S('$D(DIWF):1,$P(DIWF,"B",2):$P(DIWF,"B",2),1:1)+$Y'<IOSL,$D(^UTILITY($J,1))#2,^(1)?1U1P1E.E X ^(1)
S DISTP=DISTP+1,DILCT=DILCT+1 D:'(DISTP#100) CSTP^DIO2
Q
DT I $G(DUZ("LANG"))>1,Y W $$OUT^DIALOGU(Y,"DD") Q
I Y W $P("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$E(Y,4,5))_" " W:Y#100 $J(Y#100\1,2)_"," W Y\10000+1700 W:Y#1 " "_$E(Y_0,9,10)_":"_$E(Y_"000",11,12) Q
W Y Q
M D @DIXX
Q
BEGIN ;
S:'$D(DN) DN=1 S DISTP=$G(DISTP),DILCT=$G(DILCT)
I $D(DXS)<9 M DXS=^DIPT(826,"DXS")
S I(0)="^ONCO(165.5,",J(0)=165.5
W ?0 W @IOF K DIP K:DN Y
S X=$G(^ONCO(165.5,D0,0)) D N:$X>2 Q:'DN W ?2 S Y=$P(X,U,3) S Y(0)=Y I Y'="" S Y=$P($G(^ONCO(160.19,Y,0)),U,2) W $E(Y,1,30)
S X="PATIENT SUMMARY",X=$J("",$S($D(DIWR)+$D(DIWL)=2:DIWR-DIWL+1,$D(IOM):IOM,1:80)-$L(X)\2-$X)_X K DIP K:DN Y W X
D N:$X>67 Q:'DN W ?67 N %I,%H,% D NOW^%DTC S Y=X K DIP K:DN Y S Y=X D DT
D T Q:'DN W ?2 W !,"" K DIP K:DN Y
S I(100)="^ONCO(160,",J(100)=160 S I(0,0)=D0 S DIP(1)=$S($D(^ONCO(165.5,D0,0)):^(0),1:"") S X=$P(DIP(1),U,2),X=X S D(0)=+X S D0=D(0) I D0>0 D A1
G A1R
A1 ;
D N:$X>2 Q:'DN W ?2 W "Name: "
S X=$G(^ONCO(160,D0,0)) D N:$X>8 Q:'DN W ?8 S Y=$P(X,U,1) S C=$P(^DD(160,.01,0),U,2) D Y^DIQ:Y S C="," W $E(Y,1,30)
D N:$X>39 Q:'DN W ?39 W "SSN: "
D N:$X>46 Q:'DN W ?46 D SSN^ONCOES W $J(X,12) K Y(160,2)
D N:$X>2 Q:'DN W ?2 W "Sex: "
S X=$G(^ONCO(160,D0,0)) D N:$X>8 Q:'DN W ?8 S Y=$P(X,U,8) W:Y]"" $S($D(DXS(1,Y)):DXS(1,Y),1:Y)
D N:$X>39 Q:'DN W ?39 W "DOB: "
D N:$X>46 Q:'DN W ?46 D DOB^ONCOES W $J(X,11) K Y(160,3)
D N:$X>2 Q:'DN W ?2 W "Race: "
S X=$G(^ONCO(160,D0,0)) D N:$X>8 Q:'DN W ?8 S Y=$P(X,U,6) S Y=$S(Y="":Y,$D(^ONCO(164.46,Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,50)
D N:$X>39 Q:'DN W ?39 W "Status: "
S X=$G(^ONCO(160,D0,1)) D N:$X>47 Q:'DN W ?47 S Y=$P(X,U,1) W:Y]"" $S($D(DXS(2,Y)):DXS(2,Y),1:Y)
W ?47 W !," " K DIP K:DN Y
W ?58 D DLC^ONCOCRF,DATEOT^ONCOES K DIP K:DN Y
D N:$X>2 Q:'DN W ?2 W "Date of Last Contact or Death:"
D N:$X>33 Q:'DN W ?33 W X K DIP K:DN Y
D N:$X>2 Q:'DN W ?2 W "Autopsy Date/Time: "
S X=$G(^ONCO(160,D0,1)) D N:$X>33 Q:'DN W ?33 S Y=$P(X,U,9) S Y(0)=Y S X=Y D DATEOT^ONCOES W $E(Y,1,30)
D N:$X>2 Q:'DN W ?2 W "Autopsy #: "
S X=$G(^ONCO(160,D0,1)) D N:$X>33 Q:'DN W ?33,$E($P(X,U,10),1,15)
D N:$X>2 Q:'DN W ?2 W "Cause of Death: "
D N:$X>33 Q:'DN W ?33 S Y=$P(X,U,3) S Y(0)=Y S X=Y D SDOT^ONCFUNC W $E(Y,1,30)
Q
A1R ;
K J(100),I(100) S:$D(I(0,0)) D0=I(0,0)
W ?33 W !!," " K DIP K:DN Y
D N:$X>2 Q:'DN W ?2 W "Abstract Status: "
S X=$G(^ONCO(165.5,D0,7)) S Y=$P(X,U,2) W:Y]"" $S($D(DXS(3,Y)):DXS(3,Y),1:Y)
D N:$X>39 Q:'DN W ?39 W "Date Case Completed: "
S Y=$P(X,U,1) S Y(0)=Y S X=Y D DATEOT^ONCOES W $E(Y,1,30)
D N:$X>2 Q:'DN W ?2 W "Acc/Seq Number: "
D N:$X>19 Q:'DN W ?19 X ^DD(165.5,.061,9.3) S X=$E(Y(165.5,.061,5),Y(165.5,.061,6),X) S Y=X,X=Y(165.5,.061,4),X=X_Y_"/"_$P(Y(165.5,.061,1),U,6) W $E(X,1,13) K Y(165.5,.061)
D N:$X>2 Q:'DN W ?2 W "Date Dx: "
S X=$G(^ONCO(165.5,D0,0)) D N:$X>19 Q:'DN W ?19 S Y=$P(X,U,16) S Y(0)=Y S X=Y D DATEOT^ONCOES W $E(Y,1,10)
D N:$X>2 Q:'DN W ?2 W "Site/Gp: "
S X=$G(^ONCO(165.5,D0,0)) D N:$X>19 Q:'DN W ?19 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^ONCO(164.2,Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,30)
D N:$X>2 Q:'DN W ?2 W "Primary Site: "
S X=$G(^ONCO(165.5,D0,2)) D N:$X>19 Q:'DN W ?19 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^ONCO(164,Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,30)
D N:$X>2 Q:'DN W ?2 W "Histology: "
S X=$G(^ONCO(165.5,D0,2.2)) D N:$X>19 Q:'DN W ?19 S Y=$P(X,U,3) S Y=$S(Y="":Y,$D(^ONCO(169.3,Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,80)
K Y
Q
HEAD ;
W !,"--------------------------------------------------------------------------------",!!
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONCOXU 3889 printed Dec 13, 2024@02:26:39 Page 2
ONCOXU ; GENERATED FROM 'ONCO XABSTRACT RECORD' PRINT TEMPLATE (#826) ; 01/20/16 ; (FILE 165.5, MARGIN=80)
+1 GOTO BEGIN
N WRITE !
T if $X
WRITE !
IF '$DATA(DIOT(2))
IF DN
IF $DATA(IOSL)
IF $SELECT('$DATA(DIWF):1,$PIECE(DIWF,"B",2):$PIECE(DIWF,"B",2),1:1)+$Y'<IOSL
IF $DATA(^UTILITY($JOB,1))#2
IF ^(1)?1U1P1E.E
XECUTE ^(1)
+1 SET DISTP=DISTP+1
SET DILCT=DILCT+1
if '(DISTP#100)
DO CSTP^DIO2
+2 QUIT
DT IF $GET(DUZ("LANG"))>1
IF Y
WRITE $$OUT^DIALOGU(Y,"DD")
QUIT
+1 IF Y
WRITE $PIECE("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$EXTRACT(Y,4,5))_" "
if Y#100
WRITE $JUSTIFY(Y#100\1,2)_","
WRITE Y\10000+1700
if Y#1
WRITE " "_$EXTRACT(Y_0,9,10)_":"_$EXTRACT(Y_"000",11,12)
QUIT
+2 WRITE Y
QUIT
M DO @DIXX
+1 QUIT
BEGIN ;
+1 if '$DATA(DN)
SET DN=1
SET DISTP=$GET(DISTP)
SET DILCT=$GET(DILCT)
+2 IF $DATA(DXS)<9
MERGE DXS=^DIPT(826,"DXS")
+3 SET I(0)="^ONCO(165.5,"
SET J(0)=165.5
+4 WRITE ?0
WRITE @IOF
KILL DIP
if DN
KILL Y
+5 SET X=$GET(^ONCO(165.5,D0,0))
if $X>2
DO N
if 'DN
QUIT
WRITE ?2
SET Y=$PIECE(X,U,3)
SET Y(0)=Y
IF Y'=""
SET Y=$PIECE($GET(^ONCO(160.19,Y,0)),U,2)
WRITE $EXTRACT(Y,1,30)
+6 SET X="PATIENT SUMMARY"
SET X=$JUSTIFY("",$SELECT($DATA(DIWR)+$DATA(DIWL)=2:DIWR-DIWL+1,$DATA(IOM):IOM,1:80)-$LENGTH(X)\2-$X)_X
KILL DIP
if DN
KILL Y
WRITE X
+7 if $X>67
DO N
if 'DN
QUIT
WRITE ?67
NEW %I,%H,%
DO NOW^%DTC
SET Y=X
KILL DIP
if DN
KILL Y
SET Y=X
DO DT
+8 DO T
if 'DN
QUIT
WRITE ?2
WRITE !,""
KILL DIP
if DN
KILL Y
+9 SET I(100)="^ONCO(160,"
SET J(100)=160
SET I(0,0)=D0
SET DIP(1)=$SELECT($DATA(^ONCO(165.5,D0,0)):^(0),1:"")
SET X=$PIECE(DIP(1),U,2)
SET X=X
SET D(0)=+X
SET D0=D(0)
IF D0>0
DO A1
+10 GOTO A1R
A1 ;
+1 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "Name: "
+2 SET X=$GET(^ONCO(160,D0,0))
if $X>8
DO N
if 'DN
QUIT
WRITE ?8
SET Y=$PIECE(X,U,1)
SET C=$PIECE(^DD(160,.01,0),U,2)
if Y
DO Y^DIQ
SET C=","
WRITE $EXTRACT(Y,1,30)
+3 if $X>39
DO N
if 'DN
QUIT
WRITE ?39
WRITE "SSN: "
+4 if $X>46
DO N
if 'DN
QUIT
WRITE ?46
DO SSN^ONCOES
WRITE $JUSTIFY(X,12)
KILL Y(160,2)
+5 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "Sex: "
+6 SET X=$GET(^ONCO(160,D0,0))
if $X>8
DO N
if 'DN
QUIT
WRITE ?8
SET Y=$PIECE(X,U,8)
if Y]""
WRITE $SELECT($DATA(DXS(1,Y)):DXS(1,Y),1:Y)
+7 if $X>39
DO N
if 'DN
QUIT
WRITE ?39
WRITE "DOB: "
+8 if $X>46
DO N
if 'DN
QUIT
WRITE ?46
DO DOB^ONCOES
WRITE $JUSTIFY(X,11)
KILL Y(160,3)
+9 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "Race: "
+10 SET X=$GET(^ONCO(160,D0,0))
if $X>8
DO N
if 'DN
QUIT
WRITE ?8
SET Y=$PIECE(X,U,6)
SET Y=$SELECT(Y="":Y,$DATA(^ONCO(164.46,Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,50)
+11 if $X>39
DO N
if 'DN
QUIT
WRITE ?39
WRITE "Status: "
+12 SET X=$GET(^ONCO(160,D0,1))
if $X>47
DO N
if 'DN
QUIT
WRITE ?47
SET Y=$PIECE(X,U,1)
if Y]""
WRITE $SELECT($DATA(DXS(2,Y)):DXS(2,Y),1:Y)
+13 WRITE ?47
WRITE !," "
KILL DIP
if DN
KILL Y
+14 WRITE ?58
DO DLC^ONCOCRF
DO DATEOT^ONCOES
KILL DIP
if DN
KILL Y
+15 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "Date of Last Contact or Death:"
+16 if $X>33
DO N
if 'DN
QUIT
WRITE ?33
WRITE X
KILL DIP
if DN
KILL Y
+17 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "Autopsy Date/Time: "
+18 SET X=$GET(^ONCO(160,D0,1))
if $X>33
DO N
if 'DN
QUIT
WRITE ?33
SET Y=$PIECE(X,U,9)
SET Y(0)=Y
SET X=Y
DO DATEOT^ONCOES
WRITE $EXTRACT(Y,1,30)
+19 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "Autopsy #: "
+20 SET X=$GET(^ONCO(160,D0,1))
if $X>33
DO N
if 'DN
QUIT
WRITE ?33,$EXTRACT($PIECE(X,U,10),1,15)
+21 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "Cause of Death: "
+22 if $X>33
DO N
if 'DN
QUIT
WRITE ?33
SET Y=$PIECE(X,U,3)
SET Y(0)=Y
SET X=Y
DO SDOT^ONCFUNC
WRITE $EXTRACT(Y,1,30)
+23 QUIT
A1R ;
+1 KILL J(100),I(100)
if $DATA(I(0,0))
SET D0=I(0,0)
+2 WRITE ?33
WRITE !!," "
KILL DIP
if DN
KILL Y
+3 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "Abstract Status: "
+4 SET X=$GET(^ONCO(165.5,D0,7))
SET Y=$PIECE(X,U,2)
if Y]""
WRITE $SELECT($DATA(DXS(3,Y)):DXS(3,Y),1:Y)
+5 if $X>39
DO N
if 'DN
QUIT
WRITE ?39
WRITE "Date Case Completed: "
+6 SET Y=$PIECE(X,U,1)
SET Y(0)=Y
SET X=Y
DO DATEOT^ONCOES
WRITE $EXTRACT(Y,1,30)
+7 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "Acc/Seq Number: "
+8 if $X>19
DO N
if 'DN
QUIT
WRITE ?19
XECUTE ^DD(165.5,.061,9.3)
SET X=$EXTRACT(Y(165.5,.061,5),Y(165.5,.061,6),X)
SET Y=X
SET X=Y(165.5,.061,4)
SET X=X_Y_"/"_$PIECE(Y(165.5,.061,1),U,6)
WRITE $EXTRACT(X,1,13)
KILL Y(165.5,.061)
+9 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "Date Dx: "
+10 SET X=$GET(^ONCO(165.5,D0,0))
if $X>19
DO N
if 'DN
QUIT
WRITE ?19
SET Y=$PIECE(X,U,16)
SET Y(0)=Y
SET X=Y
DO DATEOT^ONCOES
WRITE $EXTRACT(Y,1,10)
+11 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "Site/Gp: "
+12 SET X=$GET(^ONCO(165.5,D0,0))
if $X>19
DO N
if 'DN
QUIT
WRITE ?19
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^ONCO(164.2,Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,30)
+13 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "Primary Site: "
+14 SET X=$GET(^ONCO(165.5,D0,2))
if $X>19
DO N
if 'DN
QUIT
WRITE ?19
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^ONCO(164,Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,30)
+15 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "Histology: "
+16 SET X=$GET(^ONCO(165.5,D0,2.2))
if $X>19
DO N
if 'DN
QUIT
WRITE ?19
SET Y=$PIECE(X,U,3)
SET Y=$SELECT(Y="":Y,$DATA(^ONCO(169.3,Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,80)
+17 KILL Y
+18 QUIT
HEAD ;
+1 WRITE !,"--------------------------------------------------------------------------------",!!