MCOBC1 ; GENERATED FROM 'MCARCATHBRPR' PRINT TEMPLATE (#3743) ; 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(3743,"DXS")
S I(0)="^MCAR(691.1,",J(0)=691.1
W ?0 W "DATE/TIME: "
S X=$G(^MCAR(691.1,D0,0)) S Y=$P(X,U,1) D DT
D N:$X>34 Q:'DN W ?34 W "MEDICAL PATIENT: "
S Y=$P(X,U,2) S Y=$S(Y="":Y,$D(^MCAR(690,Y,0))#2:$P(^(0),U),1:Y) S Y=$S(Y="":Y,$D(^DPT(Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,30)
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "PROCEDURES: "
S I(1)=3,J(1)=691.13 F D1=0:0 Q:$O(^MCAR(691.1,D0,3,D1))'>0 X:$D(DSC(691.13)) DSC(691.13) S D1=$O(^(D1)) Q:D1'>0 D:$X>18 T Q:'DN D A1
G A1R
A1 ;
S X=$G(^MCAR(691.1,D0,3,D1,0)) D N:$X>19 Q:'DN W ?19 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^MCAR(695.3,Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,30)
Q
A1R ;
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "INDICATIONS: "
S I(1)=8,J(1)=691.18 F D1=0:0 Q:$O(^MCAR(691.1,D0,8,D1))'>0 X:$D(DSC(691.18)) DSC(691.18) S D1=$O(^(D1)) Q:D1'>0 D:$X>19 T Q:'DN D B1
G B1R
B1 ;
S X=$G(^MCAR(691.1,D0,8,D1,0)) D N:$X>19 Q:'DN W ?19 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^MCAR(697.5,Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,50)
Q
B1R ;
S I(1)=19,J(1)=691.26 F D1=0:0 Q:$O(^MCAR(691.1,D0,19,D1))'>0 X:$D(DSC(691.26)) DSC(691.26) S D1=$O(^(D1)) Q:D1'>0 D:$X>71 T Q:'DN D C1
G C1R
C1 ;
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "INTERVENTION: "
S X=$G(^MCAR(691.1,D0,19,D1,0)) D N:$X>19 Q:'DN W ?19 S Y=$P(X,U,1) W:Y]"" $S($D(DXS(3,Y)):DXS(3,Y),1:Y)
D T Q:'DN D N D N:$X>9 Q:'DN W ?9 S DIP(1)=$S($D(^MCAR(691.1,D0,19,D1,0)):^(0),1:"") S X="RA MEAN PRESSURE: "_$P(DIP(1),U,4) K DIP K:DN Y W X
D N:$X>39 Q:'DN W ?39 W "PA SYSTOLIC/DIASTOLIC: "
W ?64 X DXS(1,9.2) S DIP(5)=X S X=$P(DIP(1),U,9)_"/"_$P(DIP(1),U,10),X=$S(DIP(3):DIP(4),DIP(5):X) K DIP K:DN Y W X
D N:$X>9 Q:'DN W ?9 S DIP(1)=$S($D(^MCAR(691.1,D0,19,D1,0)):^(0),1:"") S X="PCW MEAN: "_$P(DIP(1),U,15) K DIP K:DN Y W X
D N:$X>39 Q:'DN W ?39 S DIP(1)=$S($D(^MCAR(691.1,D0,19,D1,0)):^(0),1:"") S X="LV END DIASTOLIC (Z): "_$P(DIP(1),U,21) K DIP K:DN Y W X
Q
C1R ;
D T Q:'DN D N W ?0 W " "
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>3 T Q:'DN D D1
G D1R
D1 ;
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>39 Q:'DN W ?39 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>39 Q:'DN W ?39 S Y=$P(X,U,4) W:Y]"" $J(Y,7,2)
Q
D1R ;
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>48 T Q:'DN D E1
G E1R
E1 ;
D N:$X>9 Q:'DN W ?9 W "LEFT MAIN CA NARROWING"
S X=$G(^MCAR(691.1,D0,25,D1,0)) D N:$X>39 Q:'DN W ?39 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)
Q
E1R ;
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>58 T Q:'DN D F1
G F1R
F1 ;
D N:$X>9 Q:'DN W ?9 W "LEFT MAIN CA NARROWING NUMBER"
S X=$G(^MCAR(691.1,D0,25.5,D1,0)) D N:$X>39 Q:'DN W ?39 S Y=$P(X,U,1) W:Y]"" $J(Y,6,2)
Q
F1R ;
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>47 T Q:'DN D G1
G G1R
G1 ;
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>39 Q:'DN W ?39 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>39 Q:'DN W ?39 S Y=$P(X,U,4) W:Y]"" $J(Y,7,2)
Q
G1R ;
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>48 T Q:'DN D H1
G H1R
H1 ;
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>39 Q:'DN W ?39 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>39 Q:'DN W ?39 S Y=$P(X,U,4) W:Y]"" $J(Y,7,2)
Q
H1R ;
S I(1)=37,J(1)=691.36 F D1=0:0 Q:$O(^MCAR(691.1,D0,37,D1))'>0 X:$D(DSC(691.36)) DSC(691.36) S D1=$O(^(D1)) Q:D1'>0 D:$X>48 T Q:'DN D I1
G I1R
I1 ;
D T Q:'DN D N D N:$X>23 Q:'DN W ?23 W "STARTING"
D N:$X>38 Q:'DN W ?38 W "RESULTING"
D N:$X>21 Q:'DN W ?21 W "% OBSTRUCTION"
D N:$X>36 Q:'DN W ?36 W "% OBSTRUCTION"
S X=$G(^MCAR(691.1,D0,37,D1,0)) D N:$X>7 Q:'DN W ?7 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>23 Q:'DN W ?23 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)
S X=$G(^MCAR(691.1,D0,37,D1,3)) D N:$X>23 Q:'DN W ?23 S Y=$P(X,U,1) W:Y]"" $J(Y,7,2)
S X=$G(^MCAR(691.1,D0,37,D1,0)) D N:$X>40 Q:'DN W ?40 S Y=$P(X,U,3) S Y=$S(Y="":Y,$D(^MCAR(696.1,Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,17)
S X=$G(^MCAR(691.1,D0,37,D1,3)) D N:$X>40 Q:'DN W ?40 S Y=$P(X,U,2) W:Y]"" $J(Y,7,2)
Q
I1R ;
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 S DIP(1)=$S($D(^MCAR(691.1,D0,40)):^(40),1:"") S X="EJECTION FRACTION: "_$P(DIP(1),U,3) K DIP K:DN Y W X
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "COMPLICATIONS: "
S DICMX="D L^DIWP" D N:$X>20 Q:'DN S DIWL=21,DIWR=78 X DXS(2,9) K DIP K:DN Y
D 0^DIWW
D ^DIWW
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "CONCLUSION: "
S I(1)=43,J(1)=691.41 F D1=0:0 Q:$O(^MCAR(691.1,D0,43,D1))'>0 S D1=$O(^(D1)) D:$X>18 T Q:'DN D J1
G J1R
J1 ;
S X=$G(^MCAR(691.1,D0,43,D1,0)) S DIWL=18,DIWR=77 D ^DIWP
Q
J1R ;
D 0^DIWW
D ^DIWW
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "PLAN: "
S I(1)=44,J(1)=691.42 F D1=0:0 Q:$O(^MCAR(691.1,D0,44,D1))'>0 S D1=$O(^(D1)) D:$X>12 T Q:'DN D K1
G K1R
K1 ;
S X=$G(^MCAR(691.1,D0,44,D1,0)) S DIWL=13,DIWR=77 D ^DIWP
Q
K1R ;
D 0^DIWW
D ^DIWW
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "SUMMARY: "
S X=$G(^MCAR(691.1,D0,.2)) S Y=$P(X,U,1) W:Y]"" $S($D(DXS(4,Y)):DXS(4,Y),1:Y)
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "PROCEDURE SUMMARY: "
D N:$X>17 Q:'DN S DIWL=18,DIWR=77 S Y=$P(X,U,2) S X=Y D ^DIWP
D 0^DIWW
D ^DIWW
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "CARDIOLOGY STAFF: "
S X=$G(^MCAR(691.1,D0,45)) S Y=$P(X,U,2) S Y=$S(Y="":Y,$D(^VA(200,Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,35)
W ?24 S MCFILE=691.1 D DISP^MCMAG K DIP K:DN Y
W ?35 K MCFILE K DIP K:DN Y
K Y K DIWF
Q
HEAD ;
W !,"--------------------------------------------------------------------------------",!!
MCOBC1 ; GENERATED FROM 'MCARCATHBRPR' PRINT TEMPLATE (#3743) ; 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(3743,"DXS")
+3 SET I(0)="^MCAR(691.1,"
SET J(0)=691.1
+4 WRITE ?0
WRITE "DATE/TIME: "
+5 SET X=$GET(^MCAR(691.1,D0,0))
SET Y=$PIECE(X,U,1)
DO DT
+6 IF $X>34
DO N
IF 'DN
QUIT
WRITE ?34
WRITE "MEDICAL PATIENT: "
+7 SET Y=$PIECE(X,U,2)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(690,Y,0))#2:$PIECE(^(0),U),1:Y)
SET Y=$SELECT(Y="":Y,$DATA(^DPT(Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,30)
+8 DO T
IF 'DN
QUIT
DO N
IF $X>4
DO N
IF 'DN
QUIT
WRITE ?4
WRITE "PROCEDURES: "
+9 SET I(1)=3
SET J(1)=691.13
FOR D1=0:0
IF $ORDER(^MCAR(691.1,D0,3,D1))'>0
QUIT
IF $DATA(DSC(691.13))
XECUTE DSC(691.13)
SET D1=$ORDER(^(D1))
IF D1'>0
QUIT
IF $X>18
DO T
IF 'DN
QUIT
DO A1
+10 GOTO A1R
A1 ;
+1 SET X=$GET(^MCAR(691.1,D0,3,D1,0))
IF $X>19
DO N
IF 'DN
QUIT
WRITE ?19
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(695.3,Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,30)
+2 QUIT
A1R ;
+1 DO T
IF 'DN
QUIT
DO N
IF $X>4
DO N
IF 'DN
QUIT
WRITE ?4
WRITE "INDICATIONS: "
+2 SET I(1)=8
SET J(1)=691.18
FOR D1=0:0
IF $ORDER(^MCAR(691.1,D0,8,D1))'>0
QUIT
IF $DATA(DSC(691.18))
XECUTE DSC(691.18)
SET D1=$ORDER(^(D1))
IF D1'>0
QUIT
IF $X>19
DO T
IF 'DN
QUIT
DO B1
+3 GOTO B1R
B1 ;
+1 SET X=$GET(^MCAR(691.1,D0,8,D1,0))
IF $X>19
DO N
IF 'DN
QUIT
WRITE ?19
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(697.5,Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,50)
+2 QUIT
B1R ;
+1 SET I(1)=19
SET J(1)=691.26
FOR D1=0:0
IF $ORDER(^MCAR(691.1,D0,19,D1))'>0
QUIT
IF $DATA(DSC(691.26))
XECUTE DSC(691.26)
SET D1=$ORDER(^(D1))
IF D1'>0
QUIT
IF $X>71
DO T
IF 'DN
QUIT
DO C1
+2 GOTO C1R
C1 ;
+1 DO T
IF 'DN
QUIT
DO N
IF $X>4
DO N
IF 'DN
QUIT
WRITE ?4
WRITE "INTERVENTION: "
+2 SET X=$GET(^MCAR(691.1,D0,19,D1,0))
IF $X>19
DO N
IF 'DN
QUIT
WRITE ?19
SET Y=$PIECE(X,U,1)
IF Y]""
WRITE $SELECT($DATA(DXS(3,Y)):DXS(3,Y),1:Y)
+3 DO T
IF 'DN
QUIT
DO N
IF $X>9
DO N
IF 'DN
QUIT
WRITE ?9
SET DIP(1)=$SELECT($DATA(^MCAR(691.1,D0,19,D1,0)):^(0),1:"")
SET X="RA MEAN PRESSURE: "_$PIECE(DIP(1),U,4)
KILL DIP
IF DN
KILL Y
WRITE X
+4 IF $X>39
DO N
IF 'DN
QUIT
WRITE ?39
WRITE "PA SYSTOLIC/DIASTOLIC: "
+5 WRITE ?64
XECUTE DXS(1,9.2)
SET DIP(5)=X
SET X=$PIECE(DIP(1),U,9)_"/"_$PIECE(DIP(1),U,10)
SET X=$SELECT(DIP(3):DIP(4),DIP(5):X)
KILL DIP
IF DN
KILL Y
WRITE X
+6 IF $X>9
DO N
IF 'DN
QUIT
WRITE ?9
SET DIP(1)=$SELECT($DATA(^MCAR(691.1,D0,19,D1,0)):^(0),1:"")
SET X="PCW MEAN: "_$PIECE(DIP(1),U,15)
KILL DIP
IF DN
KILL Y
WRITE X
+7 IF $X>39
DO N
IF 'DN
QUIT
WRITE ?39
SET DIP(1)=$SELECT($DATA(^MCAR(691.1,D0,19,D1,0)):^(0),1:"")
SET X="LV END DIASTOLIC (Z): "_$PIECE(DIP(1),U,21)
KILL DIP
IF DN
KILL Y
WRITE X
+8 QUIT
C1R ;
+1 DO T
IF 'DN
QUIT
DO N
WRITE ?0
WRITE " "
+2 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>3
DO T
IF 'DN
QUIT
DO D1
+3 GOTO D1R
D1 ;
+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>39
DO N
IF 'DN
QUIT
WRITE ?39
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>39
DO N
IF 'DN
QUIT
WRITE ?39
SET Y=$PIECE(X,U,4)
IF Y]""
WRITE $JUSTIFY(Y,7,2)
+4 QUIT
D1R ;
+1 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>48
DO T
IF 'DN
QUIT
DO E1
+2 GOTO E1R
E1 ;
+1 IF $X>9
DO N
IF 'DN
QUIT
WRITE ?9
WRITE "LEFT MAIN CA NARROWING"
+2 SET X=$GET(^MCAR(691.1,D0,25,D1,0))
IF $X>39
DO N
IF 'DN
QUIT
WRITE ?39
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)
+3 QUIT
E1R ;
+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>58
DO T
IF 'DN
QUIT
DO F1
+2 GOTO F1R
F1 ;
+1 IF $X>9
DO N
IF 'DN
QUIT
WRITE ?9
WRITE "LEFT MAIN CA NARROWING NUMBER"
+2 SET X=$GET(^MCAR(691.1,D0,25.5,D1,0))
IF $X>39
DO N
IF 'DN
QUIT
WRITE ?39
SET Y=$PIECE(X,U,1)
IF Y]""
WRITE $JUSTIFY(Y,6,2)
+3 QUIT
F1R ;
+1 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>47
DO T
IF 'DN
QUIT
DO G1
+2 GOTO G1R
G1 ;
+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>39
DO N
IF 'DN
QUIT
WRITE ?39
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>39
DO N
IF 'DN
QUIT
WRITE ?39
SET Y=$PIECE(X,U,4)
IF Y]""
WRITE $JUSTIFY(Y,7,2)
+4 QUIT
G1R ;
+1 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>48
DO T
IF 'DN
QUIT
DO H1
+2 GOTO H1R
H1 ;
+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>39
DO N
IF 'DN
QUIT
WRITE ?39
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>39
DO N
IF 'DN
QUIT
WRITE ?39
SET Y=$PIECE(X,U,4)
IF Y]""
WRITE $JUSTIFY(Y,7,2)
+4 QUIT
H1R ;
+1 SET I(1)=37
SET J(1)=691.36
FOR D1=0:0
IF $ORDER(^MCAR(691.1,D0,37,D1))'>0
QUIT
IF $DATA(DSC(691.36))
XECUTE DSC(691.36)
SET D1=$ORDER(^(D1))
IF D1'>0
QUIT
IF $X>48
DO T
IF 'DN
QUIT
DO I1
+2 GOTO I1R
I1 ;
+1 DO T
IF 'DN
QUIT
DO N
IF $X>23
DO N
IF 'DN
QUIT
WRITE ?23
WRITE "STARTING"
+2 IF $X>38
DO N
IF 'DN
QUIT
WRITE ?38
WRITE "RESULTING"
+3 IF $X>21
DO N
IF 'DN
QUIT
WRITE ?21
WRITE "% OBSTRUCTION"
+4 IF $X>36
DO N
IF 'DN
QUIT
WRITE ?36
WRITE "% OBSTRUCTION"
+5 SET X=$GET(^MCAR(691.1,D0,37,D1,0))
IF $X>7
DO N
IF 'DN
QUIT
WRITE ?7
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)
+6 IF $X>23
DO N
IF 'DN
QUIT
WRITE ?23
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)
+7 SET X=$GET(^MCAR(691.1,D0,37,D1,3))
IF $X>23
DO N
IF 'DN
QUIT
WRITE ?23
SET Y=$PIECE(X,U,1)
IF Y]""
WRITE $JUSTIFY(Y,7,2)
+8 SET X=$GET(^MCAR(691.1,D0,37,D1,0))
IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
SET Y=$PIECE(X,U,3)
SET Y=$SELECT(Y="":Y,$DATA(^MCAR(696.1,Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,17)
+9 SET X=$GET(^MCAR(691.1,D0,37,D1,3))
IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
SET Y=$PIECE(X,U,2)
IF Y]""
WRITE $JUSTIFY(Y,7,2)
+10 QUIT
I1R ;
+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,40)):^(40),1:"")
SET X="EJECTION FRACTION: "_$PIECE(DIP(1),U,3)
KILL DIP
IF DN
KILL Y
WRITE X
+2 DO T
IF 'DN
QUIT
DO N
IF $X>4
DO N
IF 'DN
QUIT
WRITE ?4
WRITE "COMPLICATIONS: "
+3 SET DICMX="D L^DIWP"
IF $X>20
DO N
IF 'DN
QUIT
SET DIWL=21
SET DIWR=78
XECUTE DXS(2,9)
KILL DIP
IF DN
KILL Y
+4 DO 0^DIWW
+5 DO ^DIWW
+6 DO T
IF 'DN
QUIT
DO N
IF $X>4
DO N
IF 'DN
QUIT
WRITE ?4
WRITE "CONCLUSION: "
+7 SET I(1)=43
SET J(1)=691.41
FOR D1=0:0
IF $ORDER(^MCAR(691.1,D0,43,D1))'>0
QUIT
SET D1=$ORDER(^(D1))
IF $X>18
DO T
IF 'DN
QUIT
DO J1
+8 GOTO J1R
J1 ;
+1 SET X=$GET(^MCAR(691.1,D0,43,D1,0))
SET DIWL=18
SET DIWR=77
DO ^DIWP
+2 QUIT
J1R ;
+1 DO 0^DIWW
+2 DO ^DIWW
+3 DO T
IF 'DN
QUIT
DO N
IF $X>4
DO N
IF 'DN
QUIT
WRITE ?4
WRITE "PLAN: "
+4 SET I(1)=44
SET J(1)=691.42
FOR D1=0:0
IF $ORDER(^MCAR(691.1,D0,44,D1))'>0
QUIT
SET D1=$ORDER(^(D1))
IF $X>12
DO T
IF 'DN
QUIT
DO K1
+5 GOTO K1R
K1 ;
+1 SET X=$GET(^MCAR(691.1,D0,44,D1,0))
SET DIWL=13
SET DIWR=77
DO ^DIWP
+2 QUIT
K1R ;
+1 DO 0^DIWW
+2 DO ^DIWW
+3 DO T
IF 'DN
QUIT
DO N
IF $X>4
DO N
IF 'DN
QUIT
WRITE ?4
WRITE "SUMMARY: "
+4 SET X=$GET(^MCAR(691.1,D0,.2))
SET Y=$PIECE(X,U,1)
IF Y]""
WRITE $SELECT($DATA(DXS(4,Y)):DXS(4,Y),1:Y)
+5 DO T
IF 'DN
QUIT
DO N
IF $X>4
DO N
IF 'DN
QUIT
WRITE ?4
WRITE "PROCEDURE SUMMARY: "
+6 IF $X>17
DO N
IF 'DN
QUIT
SET DIWL=18
SET DIWR=77
SET Y=$PIECE(X,U,2)
SET X=Y
DO ^DIWP
+7 DO 0^DIWW
+8 DO ^DIWW
+9 DO T
IF 'DN
QUIT
DO N
IF $X>4
DO N
IF 'DN
QUIT
WRITE ?4
WRITE "CARDIOLOGY STAFF: "
+10 SET X=$GET(^MCAR(691.1,D0,45))
SET Y=$PIECE(X,U,2)
SET Y=$SELECT(Y="":Y,$DATA(^VA(200,Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,35)
+11 WRITE ?24
SET MCFILE=691.1
DO DISP^MCMAG
KILL DIP
IF DN
KILL Y
+12 WRITE ?35
KILL MCFILE
KILL DIP
IF DN
KILL Y
+13 KILL Y
KILL DIWF
+14 QUIT
HEAD ;
+1 WRITE !,"--------------------------------------------------------------------------------",!!