SROUTC ;BIR/SJA - OUTCOMES DATA ;09/28/2011
;;3.0;Surgery;**125,135,153,174,175,176,182,184**;24 Jun 93;Build 35
D UPDT645,UP422,EN^SROCCAT
F I=205,206,208,209 S SRA(I)=$G(^SRF(SRTN,I))
S NYUK=$P(SRA(205),"^",27) D YN S SRAO(1)=SHEMP_"^258",NYUK=$P(SRA(208),"^",7) D YN S SRAO(8)=SHEMP_"^391"
S NYUK=$P(SRA(208),"^",3) D YN S SRAO(2)=SHEMP_"^386",NYUK=$P(SRA(206),"^",39) D YN S SRAO(9)=SHEMP_"^466"
S NYUK=$P(SRA(205),"^",17) D YN S SRAO(16)=SHEMP_"^254"
;S NYUK=$P(SRA(205),"^",43) D YN S SRAO(10)=SHEMP_"^645"
S NYUK=$P(SRA(205),"^",44) D YN S SRAO(10)=SHEMP_"^422"
S NYUK=$P(SRA(208),"^",5) D YN S SRAO(4)=SHEMP_"^388",NYUK=$P(SRA(205),"^",21) D YN S SRAO(11)=SHEMP_"^256"
S NYUK=$P(SRA(205),"^",26) D YN S SRAO(5)=SHEMP_"^411",NYUK=$P(SRA(205),"^",22) D YN S SRAO(12)=SHEMP_"^410"
S NYUK=$P(SRA(208),"^",6) D YN S SRAO(6)=SHEMP_"^389",NYUK=$P(SRA(206),"^",40) D YN S SRAO(13)=SHEMP_"^467"
S NYUK=$P(SRA(205),"^",13) D YN S SRAO(7)=SHEMP_"^285"
S NYUK=$P(SRA(205),"^",40) D YN S SRAO(14)=SHEMP_"^448",NYUK=$P(SRA(205),"^",8) D YN S SRAO(15)=SHEMP_"^404"
S NYUK=$P(SRA(205),"^",6) D YN S SRAO(3)=SHEMP_"^248"
;
DISP S SRPAGE="PAGE: 1",SRHDR(.5)="OUTCOMES INFORMATION" D HDR^SROAUTL
W !,"Perioperative (30 day) Occurrences:",!,"-----------------------------------"
W !,"1. Myocardial Infarction: ",?35,$P(SRAO(1),"^"),?40," 9. Tracheostomy: ",?76,$P(SRAO(9),"^")
W !,"2. Endocarditis: ",?35,$P(SRAO(2),"^"),?40,"10. Out Of OR Unplanned Intubation:",?76,$P(SRAO(10),"^")
W !,"3. Superficial Incisional SSI: ",?35,$P(SRAO(3),"^"),?40,"11. Stroke/CVA: ",?76,$P(SRAO(11),"^")
W !,"4. Mediastinitis: ",?35,$P(SRAO(4),"^"),?40,"12. Coma >= 24 hr: ",?76,$P(SRAO(12),"^")
W !,"5. Cardiac arrest requiring CPR: ",?35,$P(SRAO(5),"^"),?40,"13. New Mech Circ Support: ",?76,$P(SRAO(13),"^")
W !,"6. Reoperation for bleeding: ",?35,$P(SRAO(6),"^"),?40,"14. Postop Atrial Fibrillation: ",?76,$P(SRAO(14),"^")
W !,"7. On ventilator >= 48 hr: ",?35,$P(SRAO(7),"^"),?40,"15. Wound Disruption: ",?76,$P(SRAO(15),"^")
W !,"8. Repeat cardiac surg procedure: ",?35,$P(SRAO(8),"^"),?40,"16. Renal failure require dialysis: ",$P(SRAO(16),"^")
W !! F MOE=1:1:80 W "-"
Q
YN ; store answer
S SHEMP=$S(NYUK="NS":"NS",NYUK="N":"NO",NYUK="Y":"YES",1:"")
Q
UPDT645 ; update field 645
N SRX S SRX=$P($G(^SRF(SRTN,205)),"^",43) S:SRX="" SRX="N"
K DA,DIE,DR S DIE=130,DA=SRTN,DR="645////"_SRX D ^DIE K DA,DIE,DR
Q
UP422 ; update field 422
N SRX S SRX=$P($G(^SRF(SRTN,205)),"^",44) S:SRX="" SRX="N"
K DA,DIE,DR S DIE=130,DA=SRTN,DR="422////"_SRX D ^DIE K DA,DIE,DR
Q
UPDATE N SRCMP,SROC,SRI,SRIF,SRQ,SRY D MAP
I EMILY=5!(EMILY=13) D IP Q:EMILY=5
I EMILY=13 S SRY=+Y G EM13
S X=$P(^SRO(136.5,SROC,0),"^"),DIC(0)="L",DLAYGO="130.22",DA(1)=SRTN,DIC="^SRF("_SRTN_",16," D FILE^DICN
S $P(^SRF(SRTN,16,+Y,0),"^",2)=SROC,SRY=+Y
EM13 I EMILY=13 K DIR S DIR(0)="130"_$S(SRIF=1:".13,5",1:".22,15"),DIR("A")=$S(SRIF=1:"Intra",1:"Post")_"op Device Type" D ^DIR G:X="" EM13 D K DR,DA,DIE
.K DA,DR,DIE,DIR I X["^"!(X="@")!(Y=0) D DEL S DA=SRTN,DIE=130,DR="467////N" D ^DIE Q
.S DA=SRY,DR=$S(SRIF=1:5,1:15)_"///"_Y,DA(1)=SRTN,DIE="^SRF(SRTN,"_$S(SRIF=1:10,1:16)_"," D ^DIE
EM8 I EMILY=8 K DIR S DIR(0)="130.22,8",DIR("A")="Cardiopulmonary Bypass Status" D ^DIR G:X="" EM8 D K DR,DA,DIE
.K DA,DR,DIE,DIR I X["^"!(X="@")!(Y=0) D DEL S DA=SRTN,DIE=130,DR="391////N" D ^DIE Q
.S DA=SRY,DR="8///"_Y,DA(1)=SRTN,DIE="^SRF(SRTN,16," D ^DIE
EM11 I EMILY=11 K DIR S DIR(0)="130.22,9",DIR("A")="Stroke/CVA Duration",DIR("B")="<24 HOURS" D ^DIR G:X="" EM11 D K DR,DA,DIE
.K DA,DR,DIE,DIR I X["^"!(X="@")!(Y=1) D DEL S DA=SRTN,DIE=130,DR="256////N" D ^DIE Q
.S DA=SRY,DR="9///"_Y,DA(1)=SRTN,DIE="^SRF(SRTN,16," D ^DIE
Q
IP K DIR S DIR("A")="Is this an Intraoperative occurrence? ",DIR("B")="YES",DIR(0)="YA" D ^DIR K DIR Q:$D(DTOUT)!$D(DUOUT)
S SRIF=Y
I SRIF=1 S X=$P(^SRO(136.5,SROC,0),"^"),DIC(0)="L",DLAYGO="130.14",DA(1)=SRTN,DIC="^SRF("_SRTN_",10," D FILE^DICN S $P(^SRF(SRTN,10,+Y,0),"^",2)=SROC Q
I SRIF=0 S X=$P(^SRO(136.5,SROC,0),"^"),DIC(0)="L",DLAYGO="130.22",DA(1)=SRTN,DIC="^SRF("_SRTN_",16," D FILE^DICN S $P(^SRF(SRTN,16,+Y,0),"^",2)=SROC
Q
DEL ; delete existing Post/Intraoperative occurrences.
N II,SRII,SROC D MAP
S II=0 F S II=$O(^SRF(SRTN,16,II)) Q:'II S SRII=$G(^(II,0)) I $P(SRII,"^",2)=SROC D Q
.S DA(1)=SRTN,DA=II,DIK="^SRF("_SRTN_",16," D ^DIK I '$O(^SRF(SRTN,16,0)) K ^SRF(SRTN,16,0)
;
S II=0 F S II=$O(^SRF(SRTN,10,II)) Q:'II S SRII=$G(^(II,0)) I $P(SRII,"^",2)=SROC D Q
.S DA(1)=SRTN,DA=II,DIK="^SRF("_SRTN_",10," D ^DIK I '$O(^SRF(SRTN,10,0)) K ^SRF(SRTN,10,0)
Q
MAP S SROC=$S(EMILY=1:17,EMILY=2:23,EMILY=3:1,EMILY=4:25,EMILY=5:16,EMILY=6:26,EMILY=7:6,EMILY=8:27,EMILY=9:33,EMILY=10:41,EMILY=11:12,EMILY=12:13,EMILY=14:39,EMILY=15:22,EMILY=16:9,1:34)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSROUTC 4857 printed Dec 13, 2024@02:46:24 Page 2
SROUTC ;BIR/SJA - OUTCOMES DATA ;09/28/2011
+1 ;;3.0;Surgery;**125,135,153,174,175,176,182,184**;24 Jun 93;Build 35
+2 DO UPDT645
DO UP422
DO EN^SROCCAT
+3 FOR I=205,206,208,209
SET SRA(I)=$GET(^SRF(SRTN,I))
+4 SET NYUK=$PIECE(SRA(205),"^",27)
DO YN
SET SRAO(1)=SHEMP_"^258"
SET NYUK=$PIECE(SRA(208),"^",7)
DO YN
SET SRAO(8)=SHEMP_"^391"
+5 SET NYUK=$PIECE(SRA(208),"^",3)
DO YN
SET SRAO(2)=SHEMP_"^386"
SET NYUK=$PIECE(SRA(206),"^",39)
DO YN
SET SRAO(9)=SHEMP_"^466"
+6 SET NYUK=$PIECE(SRA(205),"^",17)
DO YN
SET SRAO(16)=SHEMP_"^254"
+7 ;S NYUK=$P(SRA(205),"^",43) D YN S SRAO(10)=SHEMP_"^645"
+8 SET NYUK=$PIECE(SRA(205),"^",44)
DO YN
SET SRAO(10)=SHEMP_"^422"
+9 SET NYUK=$PIECE(SRA(208),"^",5)
DO YN
SET SRAO(4)=SHEMP_"^388"
SET NYUK=$PIECE(SRA(205),"^",21)
DO YN
SET SRAO(11)=SHEMP_"^256"
+10 SET NYUK=$PIECE(SRA(205),"^",26)
DO YN
SET SRAO(5)=SHEMP_"^411"
SET NYUK=$PIECE(SRA(205),"^",22)
DO YN
SET SRAO(12)=SHEMP_"^410"
+11 SET NYUK=$PIECE(SRA(208),"^",6)
DO YN
SET SRAO(6)=SHEMP_"^389"
SET NYUK=$PIECE(SRA(206),"^",40)
DO YN
SET SRAO(13)=SHEMP_"^467"
+12 SET NYUK=$PIECE(SRA(205),"^",13)
DO YN
SET SRAO(7)=SHEMP_"^285"
+13 SET NYUK=$PIECE(SRA(205),"^",40)
DO YN
SET SRAO(14)=SHEMP_"^448"
SET NYUK=$PIECE(SRA(205),"^",8)
DO YN
SET SRAO(15)=SHEMP_"^404"
+14 SET NYUK=$PIECE(SRA(205),"^",6)
DO YN
SET SRAO(3)=SHEMP_"^248"
+15 ;
DISP SET SRPAGE="PAGE: 1"
SET SRHDR(.5)="OUTCOMES INFORMATION"
DO HDR^SROAUTL
+1 WRITE !,"Perioperative (30 day) Occurrences:",!,"-----------------------------------"
+2 WRITE !,"1. Myocardial Infarction: ",?35,$PIECE(SRAO(1),"^"),?40," 9. Tracheostomy: ",?76,$PIECE(SRAO(9),"^")
+3 WRITE !,"2. Endocarditis: ",?35,$PIECE(SRAO(2),"^"),?40,"10. Out Of OR Unplanned Intubation:",?76,$PIECE(SRAO(10),"^")
+4 WRITE !,"3. Superficial Incisional SSI: ",?35,$PIECE(SRAO(3),"^"),?40,"11. Stroke/CVA: ",?76,$PIECE(SRAO(11),"^")
+5 WRITE !,"4. Mediastinitis: ",?35,$PIECE(SRAO(4),"^"),?40,"12. Coma >= 24 hr: ",?76,$PIECE(SRAO(12),"^")
+6 WRITE !,"5. Cardiac arrest requiring CPR: ",?35,$PIECE(SRAO(5),"^"),?40,"13. New Mech Circ Support: ",?76,$PIECE(SRAO(13),"^")
+7 WRITE !,"6. Reoperation for bleeding: ",?35,$PIECE(SRAO(6),"^"),?40,"14. Postop Atrial Fibrillation: ",?76,$PIECE(SRAO(14),"^")
+8 WRITE !,"7. On ventilator >= 48 hr: ",?35,$PIECE(SRAO(7),"^"),?40,"15. Wound Disruption: ",?76,$PIECE(SRAO(15),"^")
+9 WRITE !,"8. Repeat cardiac surg procedure: ",?35,$PIECE(SRAO(8),"^"),?40,"16. Renal failure require dialysis: ",$PIECE(SRAO(16),"^")
+10 WRITE !!
FOR MOE=1:1:80
WRITE "-"
+11 QUIT
YN ; store answer
+1 SET SHEMP=$SELECT(NYUK="NS":"NS",NYUK="N":"NO",NYUK="Y":"YES",1:"")
+2 QUIT
UPDT645 ; update field 645
+1 NEW SRX
SET SRX=$PIECE($GET(^SRF(SRTN,205)),"^",43)
if SRX=""
SET SRX="N"
+2 KILL DA,DIE,DR
SET DIE=130
SET DA=SRTN
SET DR="645////"_SRX
DO ^DIE
KILL DA,DIE,DR
+3 QUIT
UP422 ; update field 422
+1 NEW SRX
SET SRX=$PIECE($GET(^SRF(SRTN,205)),"^",44)
if SRX=""
SET SRX="N"
+2 KILL DA,DIE,DR
SET DIE=130
SET DA=SRTN
SET DR="422////"_SRX
DO ^DIE
KILL DA,DIE,DR
+3 QUIT
UPDATE NEW SRCMP,SROC,SRI,SRIF,SRQ,SRY
DO MAP
+1 IF EMILY=5!(EMILY=13)
DO IP
if EMILY=5
QUIT
+2 IF EMILY=13
SET SRY=+Y
GOTO EM13
+3 SET X=$PIECE(^SRO(136.5,SROC,0),"^")
SET DIC(0)="L"
SET DLAYGO="130.22"
SET DA(1)=SRTN
SET DIC="^SRF("_SRTN_",16,"
DO FILE^DICN
+4 SET $PIECE(^SRF(SRTN,16,+Y,0),"^",2)=SROC
SET SRY=+Y
EM13 IF EMILY=13
KILL DIR
SET DIR(0)="130"_$SELECT(SRIF=1:".13,5",1:".22,15")
SET DIR("A")=$SELECT(SRIF=1:"Intra",1:"Post")_"op Device Type"
DO ^DIR
if X=""
GOTO EM13
Begin DoDot:1
+1 KILL DA,DR,DIE,DIR
IF X["^"!(X="@")!(Y=0)
DO DEL
SET DA=SRTN
SET DIE=130
SET DR="467////N"
DO ^DIE
QUIT
+2 SET DA=SRY
SET DR=$SELECT(SRIF=1:5,1:15)_"///"_Y
SET DA(1)=SRTN
SET DIE="^SRF(SRTN,"_$SELECT(SRIF=1:10,1:16)_","
DO ^DIE
End DoDot:1
KILL DR,DA,DIE
EM8 IF EMILY=8
KILL DIR
SET DIR(0)="130.22,8"
SET DIR("A")="Cardiopulmonary Bypass Status"
DO ^DIR
if X=""
GOTO EM8
Begin DoDot:1
+1 KILL DA,DR,DIE,DIR
IF X["^"!(X="@")!(Y=0)
DO DEL
SET DA=SRTN
SET DIE=130
SET DR="391////N"
DO ^DIE
QUIT
+2 SET DA=SRY
SET DR="8///"_Y
SET DA(1)=SRTN
SET DIE="^SRF(SRTN,16,"
DO ^DIE
End DoDot:1
KILL DR,DA,DIE
EM11 IF EMILY=11
KILL DIR
SET DIR(0)="130.22,9"
SET DIR("A")="Stroke/CVA Duration"
SET DIR("B")="<24 HOURS"
DO ^DIR
if X=""
GOTO EM11
Begin DoDot:1
+1 KILL DA,DR,DIE,DIR
IF X["^"!(X="@")!(Y=1)
DO DEL
SET DA=SRTN
SET DIE=130
SET DR="256////N"
DO ^DIE
QUIT
+2 SET DA=SRY
SET DR="9///"_Y
SET DA(1)=SRTN
SET DIE="^SRF(SRTN,16,"
DO ^DIE
End DoDot:1
KILL DR,DA,DIE
+3 QUIT
IP KILL DIR
SET DIR("A")="Is this an Intraoperative occurrence? "
SET DIR("B")="YES"
SET DIR(0)="YA"
DO ^DIR
KILL DIR
if $DATA(DTOUT)!$DATA(DUOUT)
QUIT
+1 SET SRIF=Y
+2 IF SRIF=1
SET X=$PIECE(^SRO(136.5,SROC,0),"^")
SET DIC(0)="L"
SET DLAYGO="130.14"
SET DA(1)=SRTN
SET DIC="^SRF("_SRTN_",10,"
DO FILE^DICN
SET $PIECE(^SRF(SRTN,10,+Y,0),"^",2)=SROC
QUIT
+3 IF SRIF=0
SET X=$PIECE(^SRO(136.5,SROC,0),"^")
SET DIC(0)="L"
SET DLAYGO="130.22"
SET DA(1)=SRTN
SET DIC="^SRF("_SRTN_",16,"
DO FILE^DICN
SET $PIECE(^SRF(SRTN,16,+Y,0),"^",2)=SROC
+4 QUIT
DEL ; delete existing Post/Intraoperative occurrences.
+1 NEW II,SRII,SROC
DO MAP
+2 SET II=0
FOR
SET II=$ORDER(^SRF(SRTN,16,II))
if 'II
QUIT
SET SRII=$GET(^(II,0))
IF $PIECE(SRII,"^",2)=SROC
Begin DoDot:1
+3 SET DA(1)=SRTN
SET DA=II
SET DIK="^SRF("_SRTN_",16,"
DO ^DIK
IF '$ORDER(^SRF(SRTN,16,0))
KILL ^SRF(SRTN,16,0)
End DoDot:1
QUIT
+4 ;
+5 SET II=0
FOR
SET II=$ORDER(^SRF(SRTN,10,II))
if 'II
QUIT
SET SRII=$GET(^(II,0))
IF $PIECE(SRII,"^",2)=SROC
Begin DoDot:1
+6 SET DA(1)=SRTN
SET DA=II
SET DIK="^SRF("_SRTN_",10,"
DO ^DIK
IF '$ORDER(^SRF(SRTN,10,0))
KILL ^SRF(SRTN,10,0)
End DoDot:1
QUIT
+7 QUIT
MAP SET SROC=$SELECT(EMILY=1:17,EMILY=2:23,EMILY=3:1,EMILY=4:25,EMILY=5:16,EMILY=6:26,EMILY=7:6,EMILY=8:27,EMILY=9:33,EMILY=10:41,EMILY=11:12,EMILY=12:13,EMILY=14:39,EMILY=15:22,EMILY=16:9,1:34)
+1 QUIT