MCAROPG ; GENERATED FROM 'MCARPG' PRINT TEMPLATE (#988) ; 10/04/96 ; (FILE 698, 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(988,"DXS",X)) Q:'X S Y=$O(^(X,"")) F X=X:0 Q:Y="" S DXS(X,Y)=^(Y),Y=$O(^(Y))
D N:$X>32 Q:'DN W ?32 X DXS(1,9) K DIP K:DN Y W X
D T Q:'DN D N D N:$X>2 Q:'DN W ?2 S DIP(1)=$S($D(^MCAR(698,D0,0)):^(0),1:"") S X="HOSPITAL WHERE IMPLANTED: "_$S('$D(^DIC(4,+$P(DIP(1),U,8),0)):"",1:$P(^(0),U,1)) K DIP K:DN Y W X
D T Q:'DN D N D N:$X>2 Q:'DN W ?2 W "GENERATOR"
D N:$X>5 Q:'DN W ?5 S DIP(1)=$S($D(^MCAR(698,D0,0)):^(0),1:"") S X="MODEL: "_$S('$D(^MCAR(698.4,+$P(DIP(1),U,3),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(698,D0,0)):^(0),1:"") S X="MANUFACTURER: "_$S('$D(^MCAR(698.6,+$P(DIP(1),U,4),0)):"",1:$P(^(0),U,1)) K DIP K:DN Y W X
D N:$X>5 Q:'DN W ?5 S DIP(1)=$S($D(^MCAR(698,D0,0)):^(0),1:"") S X="SERIAL NUMBER: "_$P(DIP(1),U,5) K DIP K:DN Y W X
D N:$X>44 Q:'DN W ?44 X DXS(2,9) K DIP K:DN Y W X
D T Q:'DN D N D N:$X>2 Q:'DN W ?2 W "TRANSMITTER"
D N:$X>5 Q:'DN W ?5 S DIP(1)=$S($D(^MCAR(698,D0,1)):^(1),1:"") S X="MODEL: "_$S('$D(^MCAR(698.4,+$P(DIP(1),U,3),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(698,D0,1)):^(1),1:"") S X="MANUFACTURER: "_$S('$D(^MCAR(698.6,+$P(DIP(1),U,4),0)):"",1:$P(^(0),U,1)) K DIP K:DN Y W X
D T Q:'DN D N D N:$X>2 Q:'DN W ?2 X DXS(3,9) K DIP K:DN Y W X
D N:$X>2 Q:'DN W ?2 W "ATTENDING PHYSICIAN: "
S X=$G(^MCAR(698,D0,3)) S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^VA(200,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,35)
D N:$X>2 Q:'DN W ?2 W "FELLOW-1st: "
S Y=$P(X,U,2) S Y=$S(Y="":Y,$D(^VA(200,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,35)
D N:$X>2 Q:'DN W ?2 W "FELLOW-2nd: "
S Y=$P(X,U,3) S Y=$S(Y="":Y,$D(^VA(200,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,35)
D N:$X>2 Q:'DN W ?2 X DXS(4,9) K DIP K:DN Y W X
D N:$X>2 Q:'DN W ?2 W "FIRST SCHEDULED FOLLOW-UP: "
S X=$G(^MCAR(698,D0,0)) S Y=$P(X,U,12) D DT
D T Q:'DN D N D N D N:$X>34 Q:'DN W ?34 X DXS(5,9) K DIP K:DN Y W X
D N:$X>54 Q:'DN W ?54 X DXS(6,9) K DIP K:DN Y W X
D N:$X>4 Q:'DN W ?4 W "NON-MAG RATE"
S X=$G(^MCAR(698,D0,4)) D N:$X>35 Q:'DN W ?35 S Y=$P(X,U,1) W:Y]"" $J(Y,6,1)
D N:$X>54 Q:'DN W ?54 S Y=$P(X,U,5) W:Y]"" $J(Y,6,1)
D N:$X>4 Q:'DN W ?4 W "MAGNET RATE"
D N:$X>35 Q:'DN W ?35 S Y=$P(X,U,2) W:Y]"" $J(Y,6,1)
D N:$X>54 Q:'DN W ?54 S Y=$P(X,U,6) W:Y]"" $J(Y,6,1)
D N:$X>4 Q:'DN W ?4 W "NON-MAG PULSE WIDTH"
D N:$X>37 Q:'DN W ?37 S Y=$P(X,U,3) W:Y]"" $J(Y,5,2)
D N:$X>56 Q:'DN W ?56 S Y=$P(X,U,7) W:Y]"" $J(Y,5,2)
D N:$X>4 Q:'DN W ?4 W "MAGNET PULSE WIDTH"
D N:$X>37 Q:'DN W ?37 S Y=$P(X,U,4) W:Y]"" $J(Y,5,2)
D N:$X>56 Q:'DN W ?56 S Y=$P(X,U,8) W:Y]"" $J(Y,5,2)
D N:$X>4 Q:'DN W ?4 W "OTHER INDICATOR"
D N:$X>36 Q:'DN W ?36,$E($P(X,U,9),1,25)
D N:$X>56 Q:'DN S DIWL=57,DIWR=76 S Y=$P(X,U,10) S X=Y D ^DIWP
D A^DIWW
D T Q:'DN D N D N:$X>2 Q:'DN W ?2 S DIP(1)=$S($D(^MCAR(698,D0,0)):^(0),1:"") S X="NUMBER OF PULSE GENERATORS: "_$P(DIP(1),U,13) K DIP K:DN Y W X
D T Q:'DN D N D N:$X>2 Q:'DN W ?2 W "LAST PREVIOUS IMPLANT: "
S X=$G(^MCAR(698,D0,0)) S Y=$P(X,U,14) D DT
D N:$X>2 Q:'DN W ?2 W "INCIPIENT MALFUNCTION: "
S X=$G(^MCAR(698,D0,1)) S Y=$P(X,U,6) D DT
D N:$X>2 Q:'DN W ?2 W "PACING FAILURE: "
S I(1)=2,J(1)=698.093 F D1=0:0 Q:$O(^MCAR(698,D0,2,D1))'>0 X:$D(DSC(698.093)) DSC(698.093) S D1=$O(^(D1)) Q:D1'>0 D:$X>20 T Q:'DN D A1
G A1R
A1 ;
S X=$G(^MCAR(698,D0,2,D1,0)) W ?20 S Y=$P(X,U,1) W:Y]"" $S($D(DXS(13,Y)):DXS(13,Y),1:Y)
W ", "
W ?37 S Y=$P(X,U,2) D DT
Q
A1R ;
D T Q:'DN D N D N:$X>2 Q:'DN W ?2 W "GENERATOR EXPLANT DATE: "
S X=$G(^MCAR(698,D0,1)) S Y=$P(X,U,1) D DT
D N:$X>2 Q:'DN W ?2 S DIP(1)=$S($D(^MCAR(698,D0,1)):^(1),1:"") S X="REASON FOR CHANGE: "_$S('$D(^MCAR(695.8,+$P(DIP(1),U,2),0)):"",1:$P(^(0),U,1)) K DIP K:DN Y W X
G ^MCAROPG1
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMCAROPG 4407 printed Oct 16, 2024@18:14:18 Page 2
MCAROPG ; GENERATED FROM 'MCARPG' PRINT TEMPLATE (#988) ; 10/04/96 ; (FILE 698, 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(988,"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 if $X>32
DO N
if 'DN
QUIT
WRITE ?32
XECUTE DXS(1,9)
KILL DIP
if DN
KILL Y
WRITE X
+4 DO T
if 'DN
QUIT
DO N
if $X>2
DO N
if 'DN
QUIT
WRITE ?2
SET DIP(1)=$SELECT($DATA(^MCAR(698,D0,0)):^(0),1:"")
SET X="HOSPITAL WHERE IMPLANTED: "_$SELECT('$DATA(^DIC(4,+$PIECE(DIP(1),U,8),0)):"",1:$PIECE(^(0),U,1))
KILL DIP
if DN
KILL Y
WRITE X
+5 DO T
if 'DN
QUIT
DO N
if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "GENERATOR"
+6 if $X>5
DO N
if 'DN
QUIT
WRITE ?5
SET DIP(1)=$SELECT($DATA(^MCAR(698,D0,0)):^(0),1:"")
SET X="MODEL: "_$SELECT('$DATA(^MCAR(698.4,+$PIECE(DIP(1),U,3),0)):"",1:$PIECE(^(0),U,1))
KILL DIP
if DN
KILL Y
WRITE X
+7 if $X>44
DO N
if 'DN
QUIT
WRITE ?44
SET DIP(1)=$SELECT($DATA(^MCAR(698,D0,0)):^(0),1:"")
SET X="MANUFACTURER: "_$SELECT('$DATA(^MCAR(698.6,+$PIECE(DIP(1),U,4),0)):"",1:$PIECE(^(0),U,1))
KILL DIP
if DN
KILL Y
WRITE X
+8 if $X>5
DO N
if 'DN
QUIT
WRITE ?5
SET DIP(1)=$SELECT($DATA(^MCAR(698,D0,0)):^(0),1:"")
SET X="SERIAL NUMBER: "_$PIECE(DIP(1),U,5)
KILL DIP
if DN
KILL Y
WRITE X
+9 if $X>44
DO N
if 'DN
QUIT
WRITE ?44
XECUTE DXS(2,9)
KILL DIP
if DN
KILL Y
WRITE X
+10 DO T
if 'DN
QUIT
DO N
if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "TRANSMITTER"
+11 if $X>5
DO N
if 'DN
QUIT
WRITE ?5
SET DIP(1)=$SELECT($DATA(^MCAR(698,D0,1)):^(1),1:"")
SET X="MODEL: "_$SELECT('$DATA(^MCAR(698.4,+$PIECE(DIP(1),U,3),0)):"",1:$PIECE(^(0),U,1))
KILL DIP
if DN
KILL Y
WRITE X
+12 if $X>44
DO N
if 'DN
QUIT
WRITE ?44
SET DIP(1)=$SELECT($DATA(^MCAR(698,D0,1)):^(1),1:"")
SET X="MANUFACTURER: "_$SELECT('$DATA(^MCAR(698.6,+$PIECE(DIP(1),U,4),0)):"",1:$PIECE(^(0),U,1))
KILL DIP
if DN
KILL Y
WRITE X
+13 DO T
if 'DN
QUIT
DO N
if $X>2
DO N
if 'DN
QUIT
WRITE ?2
XECUTE DXS(3,9)
KILL DIP
if DN
KILL Y
WRITE X
+14 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "ATTENDING PHYSICIAN: "
+15 SET X=$GET(^MCAR(698,D0,3))
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^VA(200,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,35)
+16 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "FELLOW-1st: "
+17 SET Y=$PIECE(X,U,2)
SET Y=$SELECT(Y="":Y,$DATA(^VA(200,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,35)
+18 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "FELLOW-2nd: "
+19 SET Y=$PIECE(X,U,3)
SET Y=$SELECT(Y="":Y,$DATA(^VA(200,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,35)
+20 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
XECUTE DXS(4,9)
KILL DIP
if DN
KILL Y
WRITE X
+21 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "FIRST SCHEDULED FOLLOW-UP: "
+22 SET X=$GET(^MCAR(698,D0,0))
SET Y=$PIECE(X,U,12)
DO DT
+23 DO T
if 'DN
QUIT
DO N
DO N
if $X>34
DO N
if 'DN
QUIT
WRITE ?34
XECUTE DXS(5,9)
KILL DIP
if DN
KILL Y
WRITE X
+24 if $X>54
DO N
if 'DN
QUIT
WRITE ?54
XECUTE DXS(6,9)
KILL DIP
if DN
KILL Y
WRITE X
+25 if $X>4
DO N
if 'DN
QUIT
WRITE ?4
WRITE "NON-MAG RATE"
+26 SET X=$GET(^MCAR(698,D0,4))
if $X>35
DO N
if 'DN
QUIT
WRITE ?35
SET Y=$PIECE(X,U,1)
if Y]""
WRITE $JUSTIFY(Y,6,1)
+27 if $X>54
DO N
if 'DN
QUIT
WRITE ?54
SET Y=$PIECE(X,U,5)
if Y]""
WRITE $JUSTIFY(Y,6,1)
+28 if $X>4
DO N
if 'DN
QUIT
WRITE ?4
WRITE "MAGNET RATE"
+29 if $X>35
DO N
if 'DN
QUIT
WRITE ?35
SET Y=$PIECE(X,U,2)
if Y]""
WRITE $JUSTIFY(Y,6,1)
+30 if $X>54
DO N
if 'DN
QUIT
WRITE ?54
SET Y=$PIECE(X,U,6)
if Y]""
WRITE $JUSTIFY(Y,6,1)
+31 if $X>4
DO N
if 'DN
QUIT
WRITE ?4
WRITE "NON-MAG PULSE WIDTH"
+32 if $X>37
DO N
if 'DN
QUIT
WRITE ?37
SET Y=$PIECE(X,U,3)
if Y]""
WRITE $JUSTIFY(Y,5,2)
+33 if $X>56
DO N
if 'DN
QUIT
WRITE ?56
SET Y=$PIECE(X,U,7)
if Y]""
WRITE $JUSTIFY(Y,5,2)
+34 if $X>4
DO N
if 'DN
QUIT
WRITE ?4
WRITE "MAGNET PULSE WIDTH"
+35 if $X>37
DO N
if 'DN
QUIT
WRITE ?37
SET Y=$PIECE(X,U,4)
if Y]""
WRITE $JUSTIFY(Y,5,2)
+36 if $X>56
DO N
if 'DN
QUIT
WRITE ?56
SET Y=$PIECE(X,U,8)
if Y]""
WRITE $JUSTIFY(Y,5,2)
+37 if $X>4
DO N
if 'DN
QUIT
WRITE ?4
WRITE "OTHER INDICATOR"
+38 if $X>36
DO N
if 'DN
QUIT
WRITE ?36,$EXTRACT($PIECE(X,U,9),1,25)
+39 if $X>56
DO N
if 'DN
QUIT
SET DIWL=57
SET DIWR=76
SET Y=$PIECE(X,U,10)
SET X=Y
DO ^DIWP
+40 DO A^DIWW
+41 DO T
if 'DN
QUIT
DO N
if $X>2
DO N
if 'DN
QUIT
WRITE ?2
SET DIP(1)=$SELECT($DATA(^MCAR(698,D0,0)):^(0),1:"")
SET X="NUMBER OF PULSE GENERATORS: "_$PIECE(DIP(1),U,13)
KILL DIP
if DN
KILL Y
WRITE X
+42 DO T
if 'DN
QUIT
DO N
if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "LAST PREVIOUS IMPLANT: "
+43 SET X=$GET(^MCAR(698,D0,0))
SET Y=$PIECE(X,U,14)
DO DT
+44 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "INCIPIENT MALFUNCTION: "
+45 SET X=$GET(^MCAR(698,D0,1))
SET Y=$PIECE(X,U,6)
DO DT
+46 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "PACING FAILURE: "
+47 SET I(1)=2
SET J(1)=698.093
FOR D1=0:0
if $ORDER(^MCAR(698,D0,2,D1))'>0
QUIT
if $DATA(DSC(698.093))
XECUTE DSC(698.093)
SET D1=$ORDER(^(D1))
if D1'>0
QUIT
if $X>20
DO T
if 'DN
QUIT
DO A1
+48 GOTO A1R
A1 ;
+1 SET X=$GET(^MCAR(698,D0,2,D1,0))
WRITE ?20
SET Y=$PIECE(X,U,1)
if Y]""
WRITE $SELECT($DATA(DXS(13,Y)):DXS(13,Y),1:Y)
+2 WRITE ", "
+3 WRITE ?37
SET Y=$PIECE(X,U,2)
DO DT
+4 QUIT
A1R ;
+1 DO T
if 'DN
QUIT
DO N
if $X>2
DO N
if 'DN
QUIT
WRITE ?2
WRITE "GENERATOR EXPLANT DATE: "
+2 SET X=$GET(^MCAR(698,D0,1))
SET Y=$PIECE(X,U,1)
DO DT
+3 if $X>2
DO N
if 'DN
QUIT
WRITE ?2
SET DIP(1)=$SELECT($DATA(^MCAR(698,D0,1)):^(1),1:"")
SET X="REASON FOR CHANGE: "_$SELECT('$DATA(^MCAR(695.8,+$PIECE(DIP(1),U,2),0)):"",1:$PIECE(^(0),U,1))
KILL DIP
if DN
KILL Y
WRITE X
+4 GOTO ^MCAROPG1