MCAROC3 ; GENERATED FROM 'MCARCATH3' PRINT TEMPLATE (#972) ; 10/04/96 ; (FILE 691.1, 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 F X=0:0 S X=$O(^DIPT(972,"DXS",X)) Q:'X S Y=$O(^(X,"")) F X=X:0 Q:Y="" S DXS(X,Y)=^(Y),Y=$O(^(Y))
D T Q:'DN D N D N D N:$X>29 Q:'DN W ?29 X DXS(1,9) K DIP K:DN Y W X
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 X DXS(2,9) K DIP K:DN Y W X
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "RIGHT CORONARY ARTERY:"
S X=$G(^MCAR(691.1,D0,20)) W ?28 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^MCAR(695.9,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,30)
S I(1)=21,J(1)=691.27 F D1=0:0 Q:$O(^MCAR(691.1,D0,21,D1))'>0 X:$D(DSC(691.27)) DSC(691.27) S D1=$O(^(D1)) Q:D1'>0 D:$X>60 T Q:'DN D A1
G A1R
A1 ;
S X=$G(^MCAR(691.1,D0,21,D1,0)) D N:$X>9 Q:'DN W ?9 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^MCAR(696,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,30)
D N:$X>33 Q:'DN W ?33 S Y=$P(X,U,2) S Y=$S(Y="":Y,$D(^MCAR(696.1,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,17)
D N:$X>33 Q:'DN W ?33 S Y=$P(X,U,4) W:Y]"" $J(Y,7,2)
W ?42 S Y=$P(X,U,3) S Y=$S(Y="":Y,$D(^MCAR(696.2,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,25)
Q
A1R ;
D N:$X>7 Q:'DN W ?7 X DXS(3,9.2) S DIP(3)=X S X=1,DIP(4)=X S X="",X=$S(DIP(2):DIP(3),DIP(4):X) K DIP K:DN Y W X
D N:$X>7 Q:'DN W ?7 X DXS(4,9.3) S DIP(5)=X S X=1,DIP(6)=X S X="",X=$S(DIP(3):DIP(5),DIP(6):X) K DIP K:DN Y W X
S I(1)=23,J(1)=691.28 F D1=0:0 Q:$O(^MCAR(691.1,D0,23,D1))'>0 X:$D(DSC(691.28)) DSC(691.28) S D1=$O(^(D1)) Q:D1'>0 D:$X>18 T Q:'DN D B1
G B1R
B1 ;
D N:$X>8 Q:'DN W ?8 W "FROM:"
S X=$G(^MCAR(691.1,D0,23,D1,0)) W ?15 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^MCAR(696,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,30)
D N:$X>44 Q:'DN W ?44 W "TO:"
W ?49 S Y=$P(X,U,2) S Y=$S(Y="":Y,$D(^MCAR(696,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,30)
Q
B1R ;
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 S DIP(1)=$S($D(^MCAR(691.1,D0,24)):^(24),1:"") S X="LEFT MAIN CA: "_$S('$D(^MCAR(695.9,+$P(DIP(1),U,1),0)):"",1:$P(^(0),U,1)) K DIP K:DN Y W X
S I(1)=25,J(1)=691.29 F D1=0:0 Q:$O(^MCAR(691.1,D0,25,D1))'>0 X:$D(DSC(691.29)) DSC(691.29) S D1=$O(^(D1)) Q:D1'>0 D:$X>15 T Q:'DN D C1
G C1R
C1 ;
S X=$G(^MCAR(691.1,D0,25,D1,0)) D N:$X>33 Q:'DN W ?33 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^MCAR(696.1,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,17)
W ?52 S Y=$P(X,U,2) S Y=$S(Y="":Y,$D(^MCAR(696.2,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,25)
Q
C1R ;
S I(1)=25.5,J(1)=691.47 F D1=0:0 Q:$O(^MCAR(691.1,D0,25.5,D1))'>0 X:$D(DSC(691.47)) DSC(691.47) S D1=$O(^(D1)) Q:D1'>0 D:$X>79 T Q:'DN D D1
G D1R
D1 ;
S X=$G(^MCAR(691.1,D0,25.5,D1,0)) D N:$X>33 Q:'DN W ?33 S Y=$P(X,U,1) W:Y]"" $J(Y,6,2)
W ?41 S Y=$P(X,U,2) S Y=$S(Y="":Y,$D(^MCAR(696.2,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,25)
Q
D1R ;
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 S DIP(1)=$S($D(^MCAR(691.1,D0,26)):^(26),1:"") S X="LAD: "_$S('$D(^MCAR(695.9,+$P(DIP(1),U,1),0)):"",1:$P(^(0),U,1)) K DIP K:DN Y W X
S I(1)=27,J(1)=691.3 F D1=0:0 Q:$O(^MCAR(691.1,D0,27,D1))'>0 X:$D(DSC(691.3)) DSC(691.3) S D1=$O(^(D1)) Q:D1'>0 D:$X>15 T Q:'DN D E1
G E1R
E1 ;
S X=$G(^MCAR(691.1,D0,27,D1,0)) D N:$X>9 Q:'DN W ?9 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^MCAR(696,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,30)
D N:$X>33 Q:'DN W ?33 S Y=$P(X,U,2) S Y=$S(Y="":Y,$D(^MCAR(696.1,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,17)
D N:$X>33 Q:'DN W ?33 S Y=$P(X,U,4) W:Y]"" $J(Y,7,2)
W ?42 S Y=$P(X,U,3) S Y=$S(Y="":Y,$D(^MCAR(696.2,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,25)
Q
E1R ;
D N:$X>7 Q:'DN W ?7 X DXS(5,9.2) S DIP(3)=X S X=1,DIP(4)=X S X="",X=$S(DIP(2):DIP(3),DIP(4):X) K DIP K:DN Y W X
D N:$X>7 Q:'DN W ?7 X DXS(6,9.3) S DIP(5)=X S X=1,DIP(6)=X S X="",X=$S(DIP(3):DIP(5),DIP(6):X) K DIP K:DN Y W X
S I(1)=29,J(1)=691.31 F D1=0:0 Q:$O(^MCAR(691.1,D0,29,D1))'>0 X:$D(DSC(691.31)) DSC(691.31) S D1=$O(^(D1)) Q:D1'>0 D:$X>18 T Q:'DN D F1
G F1R^MCAROC31
F1 ;
D N:$X>8 Q:'DN W ?8 S DIP(1)=$S($D(^MCAR(691.1,D0,29,D1,0)):^(0),1:"") S X="FROM: "_$S('$D(^MCAR(696,+$P(DIP(1),U,1),0)):"",1:$P(^(0),U,1)) K DIP K:DN Y W X
G ^MCAROC31
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMCAROC3 4490 printed Nov 22, 2024@17:23:13 Page 2
MCAROC3 ; GENERATED FROM 'MCARCATH3' PRINT TEMPLATE (#972) ; 10/04/96 ; (FILE 691.1, 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
FOR X=0:0
SET X=$ORDER(^DIPT(972,"DXS",X))
if 'X
QUIT
SET Y=$ORDER(^(X,""))
FOR X=X:0
if Y=""
QUIT
SET DXS(X,Y)=^(Y)
SET Y=$ORDER(^(Y))
+3 DO T
if 'DN
QUIT
DO N
DO N
if $X>29
DO N
if 'DN
QUIT
WRITE ?29
XECUTE DXS(1,9)
KILL DIP
if DN
KILL Y
WRITE X
+4 DO T
if 'DN
QUIT
DO N
if $X>4
DO N
if 'DN
QUIT
WRITE ?4
XECUTE DXS(2,9)
KILL DIP
if DN
KILL Y
WRITE X
+5 DO T
if 'DN
QUIT
DO N
if $X>4
DO N
if 'DN
QUIT
WRITE ?4
WRITE "RIGHT CORONARY ARTERY:"
+6 SET X=$GET(^MCAR(691.1,D0,20))
WRITE ?28
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(695.9,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,30)
+7 SET I(1)=21
SET J(1)=691.27
FOR D1=0:0
if $ORDER(^MCAR(691.1,D0,21,D1))'>0
QUIT
if $DATA(DSC(691.27))
XECUTE DSC(691.27)
SET D1=$ORDER(^(D1))
if D1'>0
QUIT
if $X>60
DO T
if 'DN
QUIT
DO A1
+8 GOTO A1R
A1 ;
+1 SET X=$GET(^MCAR(691.1,D0,21,D1,0))
if $X>9
DO N
if 'DN
QUIT
WRITE ?9
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(696,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,30)
+2 if $X>33
DO N
if 'DN
QUIT
WRITE ?33
SET Y=$PIECE(X,U,2)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(696.1,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,17)
+3 if $X>33
DO N
if 'DN
QUIT
WRITE ?33
SET Y=$PIECE(X,U,4)
if Y]""
WRITE $JUSTIFY(Y,7,2)
+4 WRITE ?42
SET Y=$PIECE(X,U,3)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(696.2,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,25)
+5 QUIT
A1R ;
+1 if $X>7
DO N
if 'DN
QUIT
WRITE ?7
XECUTE DXS(3,9.2)
SET DIP(3)=X
SET X=1
SET DIP(4)=X
SET X=""
SET X=$SELECT(DIP(2):DIP(3),DIP(4):X)
KILL DIP
if DN
KILL Y
WRITE X
+2 if $X>7
DO N
if 'DN
QUIT
WRITE ?7
XECUTE DXS(4,9.3)
SET DIP(5)=X
SET X=1
SET DIP(6)=X
SET X=""
SET X=$SELECT(DIP(3):DIP(5),DIP(6):X)
KILL DIP
if DN
KILL Y
WRITE X
+3 SET I(1)=23
SET J(1)=691.28
FOR D1=0:0
if $ORDER(^MCAR(691.1,D0,23,D1))'>0
QUIT
if $DATA(DSC(691.28))
XECUTE DSC(691.28)
SET D1=$ORDER(^(D1))
if D1'>0
QUIT
if $X>18
DO T
if 'DN
QUIT
DO B1
+4 GOTO B1R
B1 ;
+1 if $X>8
DO N
if 'DN
QUIT
WRITE ?8
WRITE "FROM:"
+2 SET X=$GET(^MCAR(691.1,D0,23,D1,0))
WRITE ?15
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(696,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,30)
+3 if $X>44
DO N
if 'DN
QUIT
WRITE ?44
WRITE "TO:"
+4 WRITE ?49
SET Y=$PIECE(X,U,2)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(696,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,30)
+5 QUIT
B1R ;
+1 DO T
if 'DN
QUIT
DO N
if $X>4
DO N
if 'DN
QUIT
WRITE ?4
SET DIP(1)=$SELECT($DATA(^MCAR(691.1,D0,24)):^(24),1:"")
SET X="LEFT MAIN CA: "_$SELECT('$DATA(^MCAR(695.9,+$PIECE(DIP(1),U,1),0)):"",1:$PIECE(^(0),U,1))
KILL DIP
if DN
KILL Y
WRITE X
+2 SET I(1)=25
SET J(1)=691.29
FOR D1=0:0
if $ORDER(^MCAR(691.1,D0,25,D1))'>0
QUIT
if $DATA(DSC(691.29))
XECUTE DSC(691.29)
SET D1=$ORDER(^(D1))
if D1'>0
QUIT
if $X>15
DO T
if 'DN
QUIT
DO C1
+3 GOTO C1R
C1 ;
+1 SET X=$GET(^MCAR(691.1,D0,25,D1,0))
if $X>33
DO N
if 'DN
QUIT
WRITE ?33
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(696.1,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,17)
+2 WRITE ?52
SET Y=$PIECE(X,U,2)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(696.2,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,25)
+3 QUIT
C1R ;
+1 SET I(1)=25.5
SET J(1)=691.47
FOR D1=0:0
if $ORDER(^MCAR(691.1,D0,25.5,D1))'>0
QUIT
if $DATA(DSC(691.47))
XECUTE DSC(691.47)
SET D1=$ORDER(^(D1))
if D1'>0
QUIT
if $X>79
DO T
if 'DN
QUIT
DO D1
+2 GOTO D1R
D1 ;
+1 SET X=$GET(^MCAR(691.1,D0,25.5,D1,0))
if $X>33
DO N
if 'DN
QUIT
WRITE ?33
SET Y=$PIECE(X,U,1)
if Y]""
WRITE $JUSTIFY(Y,6,2)
+2 WRITE ?41
SET Y=$PIECE(X,U,2)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(696.2,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,25)
+3 QUIT
D1R ;
+1 DO T
if 'DN
QUIT
DO N
if $X>4
DO N
if 'DN
QUIT
WRITE ?4
SET DIP(1)=$SELECT($DATA(^MCAR(691.1,D0,26)):^(26),1:"")
SET X="LAD: "_$SELECT('$DATA(^MCAR(695.9,+$PIECE(DIP(1),U,1),0)):"",1:$PIECE(^(0),U,1))
KILL DIP
if DN
KILL Y
WRITE X
+2 SET I(1)=27
SET J(1)=691.3
FOR D1=0:0
if $ORDER(^MCAR(691.1,D0,27,D1))'>0
QUIT
if $DATA(DSC(691.3))
XECUTE DSC(691.3)
SET D1=$ORDER(^(D1))
if D1'>0
QUIT
if $X>15
DO T
if 'DN
QUIT
DO E1
+3 GOTO E1R
E1 ;
+1 SET X=$GET(^MCAR(691.1,D0,27,D1,0))
if $X>9
DO N
if 'DN
QUIT
WRITE ?9
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(696,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,30)
+2 if $X>33
DO N
if 'DN
QUIT
WRITE ?33
SET Y=$PIECE(X,U,2)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(696.1,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,17)
+3 if $X>33
DO N
if 'DN
QUIT
WRITE ?33
SET Y=$PIECE(X,U,4)
if Y]""
WRITE $JUSTIFY(Y,7,2)
+4 WRITE ?42
SET Y=$PIECE(X,U,3)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(696.2,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,25)
+5 QUIT
E1R ;
+1 if $X>7
DO N
if 'DN
QUIT
WRITE ?7
XECUTE DXS(5,9.2)
SET DIP(3)=X
SET X=1
SET DIP(4)=X
SET X=""
SET X=$SELECT(DIP(2):DIP(3),DIP(4):X)
KILL DIP
if DN
KILL Y
WRITE X
+2 if $X>7
DO N
if 'DN
QUIT
WRITE ?7
XECUTE DXS(6,9.3)
SET DIP(5)=X
SET X=1
SET DIP(6)=X
SET X=""
SET X=$SELECT(DIP(3):DIP(5),DIP(6):X)
KILL DIP
if DN
KILL Y
WRITE X
+3 SET I(1)=29
SET J(1)=691.31
FOR D1=0:0
if $ORDER(^MCAR(691.1,D0,29,D1))'>0
QUIT
if $DATA(DSC(691.31))
XECUTE DSC(691.31)
SET D1=$ORDER(^(D1))
if D1'>0
QUIT
if $X>18
DO T
if 'DN
QUIT
DO F1
+4 GOTO F1R^MCAROC31
F1 ;
+1 if $X>8
DO N
if 'DN
QUIT
WRITE ?8
SET DIP(1)=$SELECT($DATA(^MCAR(691.1,D0,29,D1,0)):^(0),1:"")
SET X="FROM: "_$SELECT('$DATA(^MCAR(696,+$PIECE(DIP(1),U,1),0)):"",1:$PIECE(^(0),U,1))
KILL DIP
if DN
KILL Y
WRITE X
+2 GOTO ^MCAROC31