MCAROC3 ; GENERATED FROM 'MCARCATH3' PRINT TEMPLATE (#3696) ; 11/29/04 ; (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 M DXS=^DIPT(3696,"DXS")
S I(0)="^MCAR(691.1,",J(0)=691.1
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: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: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: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: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: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: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: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: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: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: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: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: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
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
D N:$X>44 Q:'DN W ?44 S DIP(1)=$S($D(^MCAR(691.1,D0,29,D1,0)):^(0),1:"") S X="TO: "_$S('$D(^MCAR(696,+$P(DIP(1),U,2),0)):"",1:$P(^(0),U,1)) K DIP K:DN Y W X
Q
F1R ;
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 S DIP(1)=$S($D(^MCAR(691.1,D0,30)):^(30),1:"") S X="CIRCUMFLEX: "_$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)=31,J(1)=691.32 F D1=0:0 Q:$O(^MCAR(691.1,D0,31,D1))'>0 X:$D(DSC(691.32)) DSC(691.32) S D1=$O(^(D1)) Q:D1'>0 D:$X>15 T Q:'DN D G1
G G1R
G1 ;
S X=$G(^MCAR(691.1,D0,31,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: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: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:Y) W $E(Y,1,25)
Q
G1R ;
D N:$X>7 Q:'DN W ?7 X DXS(7,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(8,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)=33,J(1)=691.33 F D1=0:0 Q:$O(^MCAR(691.1,D0,33,D1))'>0 X:$D(DSC(691.33)) DSC(691.33) S D1=$O(^(D1)) Q:D1'>0 D:$X>18 T Q:'DN D H1
G H1R
H1 ;
D N:$X>8 Q:'DN W ?8 S DIP(1)=$S($D(^MCAR(691.1,D0,33,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
D N:$X>44 Q:'DN W ?44 S DIP(1)=$S($D(^MCAR(691.1,D0,33,D1,0)):^(0),1:"") S X="TO: "_$S('$D(^MCAR(696,+$P(DIP(1),U,2),0)):"",1:$P(^(0),U,1)) K DIP K:DN Y W X
Q
H1R ;
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "BYPASS GRAFTS ?:"
S X=$G(^MCAR(691.1,D0,35)) W ?22 S Y=$P(X,U,2) W:Y]"" $S($D(DXS(9,Y)):DXS(9,Y),1:Y)
S I(1)=36,J(1)=691.35 F D1=0:0 Q:$O(^MCAR(691.1,D0,36,D1))'>0 X:$D(DSC(691.35)) DSC(691.35) S D1=$O(^(D1)) Q:D1'>0 D:$X>35 T Q:'DN D I1
G I1R
I1 ;
D N:$X>7 Q:'DN W ?7 W "DISTAL ANASTOMOSIS:"
S X=$G(^MCAR(691.1,D0,36,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: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: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.4,Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,25)
Q
I1R ;
K Y
Q
HEAD ;
W !,"--------------------------------------------------------------------------------",!!
MCAROC3 ; GENERATED FROM 'MCARCATH3' PRINT TEMPLATE (#3696) ; 11/29/04 ; (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
MERGE DXS=^DIPT(3696,"DXS")
+3 SET I(0)="^MCAR(691.1,"
SET J(0)=691.1
+4 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
+5 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
+6 DO T
IF 'DN
QUIT
DO N
IF $X>4
DO N
IF 'DN
QUIT
WRITE ?4
WRITE "RIGHT CORONARY ARTERY:"
+7 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:Y)
WRITE $EXTRACT(Y,1,30)
+8 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
+9 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: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: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: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: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: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: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: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: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: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: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: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
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 IF $X>44
DO N
IF 'DN
QUIT
WRITE ?44
SET DIP(1)=$SELECT($DATA(^MCAR(691.1,D0,29,D1,0)):^(0),1:"")
SET X="TO: "_$SELECT('$DATA(^MCAR(696,+$PIECE(DIP(1),U,2),0)):"",1:$PIECE(^(0),U,1))
KILL DIP
IF DN
KILL Y
WRITE X
+3 QUIT
F1R ;
+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,30)):^(30),1:"")
SET X="CIRCUMFLEX: "_$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)=31
SET J(1)=691.32
FOR D1=0:0
IF $ORDER(^MCAR(691.1,D0,31,D1))'>0
QUIT
IF $DATA(DSC(691.32))
XECUTE DSC(691.32)
SET D1=$ORDER(^(D1))
IF D1'>0
QUIT
IF $X>15
DO T
IF 'DN
QUIT
DO G1
+3 GOTO G1R
G1 ;
+1 SET X=$GET(^MCAR(691.1,D0,31,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: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: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:Y)
WRITE $EXTRACT(Y,1,25)
+5 QUIT
G1R ;
+1 IF $X>7
DO N
IF 'DN
QUIT
WRITE ?7
XECUTE DXS(7,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(8,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)=33
SET J(1)=691.33
FOR D1=0:0
IF $ORDER(^MCAR(691.1,D0,33,D1))'>0
QUIT
IF $DATA(DSC(691.33))
XECUTE DSC(691.33)
SET D1=$ORDER(^(D1))
IF D1'>0
QUIT
IF $X>18
DO T
IF 'DN
QUIT
DO H1
+4 GOTO H1R
H1 ;
+1 IF $X>8
DO N
IF 'DN
QUIT
WRITE ?8
SET DIP(1)=$SELECT($DATA(^MCAR(691.1,D0,33,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 IF $X>44
DO N
IF 'DN
QUIT
WRITE ?44
SET DIP(1)=$SELECT($DATA(^MCAR(691.1,D0,33,D1,0)):^(0),1:"")
SET X="TO: "_$SELECT('$DATA(^MCAR(696,+$PIECE(DIP(1),U,2),0)):"",1:$PIECE(^(0),U,1))
KILL DIP
IF DN
KILL Y
WRITE X
+3 QUIT
H1R ;
+1 DO T
IF 'DN
QUIT
DO N
IF $X>4
DO N
IF 'DN
QUIT
WRITE ?4
WRITE "BYPASS GRAFTS ?:"
+2 SET X=$GET(^MCAR(691.1,D0,35))
WRITE ?22
SET Y=$PIECE(X,U,2)
IF Y]""
WRITE $SELECT($DATA(DXS(9,Y)):DXS(9,Y),1:Y)
+3 SET I(1)=36
SET J(1)=691.35
FOR D1=0:0
IF $ORDER(^MCAR(691.1,D0,36,D1))'>0
QUIT
IF $DATA(DSC(691.35))
XECUTE DSC(691.35)
SET D1=$ORDER(^(D1))
IF D1'>0
QUIT
IF $X>35
DO T
IF 'DN
QUIT
DO I1
+4 GOTO I1R
I1 ;
+1 IF $X>7
DO N
IF 'DN
QUIT
WRITE ?7
WRITE "DISTAL ANASTOMOSIS:"
+2 SET X=$GET(^MCAR(691.1,D0,36,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:Y)
WRITE $EXTRACT(Y,1,30)
+3 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:Y)
WRITE $EXTRACT(Y,1,17)
+4 IF $X>33
DO N
IF 'DN
QUIT
WRITE ?33
SET Y=$PIECE(X,U,4)
IF Y]""
WRITE $JUSTIFY(Y,7,2)
+5 WRITE ?42
SET Y=$PIECE(X,U,3)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(696.4,Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,25)
+6 QUIT
I1R ;
+1 KILL Y
+2 QUIT
HEAD ;
+1 WRITE !,"--------------------------------------------------------------------------------",!!