SROAPCA3 ;B'HAM ISC/MAM - CARDIAC OCCURRENCE DATA ;02/05/08
;;3.0; Surgery ;**38,71,95,101,125,160,164,166**;24 Jun 93;Build 6
D EN^SROCCAT K SRA S SRA(205)=$G(^SRF(SRTN,205)),SRA(208)=$G(^SRF(SRTN,208)),SRA(206)=$G(^SRF(SRTN,206)),SRA(209)=$G(^SRF(SRTN,209))
S NYUK=$P(SRA(208),"^") D YN S SRAO(1)=SHEMP_"^384"
S Y=$P($G(^DPT(DFN,.35)),"^") D DT^SROAPCA1 S SRAO(2)=X
S NYUK=$P(SRA(208),"^",2) D YN S SRAO(3)=SHEMP_"^385",NYUK=$P(SRA(208),"^",3) D YN S SRAO(4)=SHEMP_"^386",NYUK=$P(SRA(205),"^",17) D YN S SRAO(5)=SHEMP_"^254",NYUK=$P(SRA(209),"^",12) D YN S SRAO(6)=SHEMP_"^490"
S NYUK=$P(SRA(208),"^",5) D YN S SRAO(7)=SHEMP_"^388",NYUK=$P(SRA(208),"^",6) D YN S SRAO(8)=SHEMP_"^389",NYUK=$P(SRA(205),"^",13) D YN S SRAO(9)=SHEMP_"^285"
S NYUK=$P(SRA(208),"^",7) D YN S SRAO(10)=SHEMP_"^391",NYUK=$P(SRA(205),"^",22) D YN S SRAO(11)=SHEMP_"^410"
S NYUK=$P(SRA(205),"^",21) D YN S SRAO(12)=SHEMP_"^256",NYUK=$P(SRA(205),"^",26) D YN S SRAO(13)=SHEMP_"^411"
S NYUK=$P(SRA(206),"^",39) D YN S SRAO(14)=SHEMP_"^466"
S NYUK=$P(SRA(206),"^",40) D YN S SRAO(15)=SHEMP_"^467"
I $Y+5>IOSL D PAGE^SROAPCA I SRSOUT Q
W !!,"VII. OUTCOMES"
W !,"Operative Death:",?18,$P(SRAO(1),"^"),?43,"Date of Death:",?58,$P(SRAO(2),"^")
;I $Y+10>IOSL D PAGE^SROAPCA I SRSOUT Q
W !!,"Perioperative (30 day) Occurrences:"
W !,?2,"Perioperative MI:",?36,$P(SRAO(3),"^"),?42,"Repeat cardiac Surg procedure:",?74,$P(SRAO(10),"^")
W !,?2,"Endocarditis:",?36,$P(SRAO(4),"^"),?42,"Tracheostomy:",?74,$P(SRAO(14),"^")
W !,?2,"Renal Failure Requiring Dialysis:",?36,$P(SRAO(5),"^"),?42,"Ventilator supp within 30 days:",?74,$P(SRAO(6),"^")
W !,?2,"Mediastinitis:",?36,$P(SRAO(7),"^"),?42,"Stroke/CVA:",?74,$P(SRAO(12),"^")
W !,?2,"Cardiac Arrest Requiring CPR:",?36,$P(SRAO(13),"^"),?42,"Coma > or = 24 Hours:",?74,$P(SRAO(11),"^")
W !,?2,"Reoperation for Bleeding:",?36,$P(SRAO(8),"^"),?42,"New Mech Circulatory Support:",?74,$P(SRAO(15),"^")
W !,?2,"On ventilator > or = 48 hr:",?36,$P(SRAO(9),"^")
D RES
Q
YN ; store answer
S SHEMP=$S(NYUK="NS":"NS",NYUK="N":"NO",NYUK="Y":"YES",1:"")
Q
;
RES I $Y+12>IOSL D PAGE^SROAPCA I SRSOUT Q
S SRA(208)=$G(^SRF(SRTN,208))
S SRA(.2)=$G(^SRF(SRTN,.2))
W !!,"VIII. RESOURCE DATA"
S Y=$P(SRA(208),"^",14) D DT^SROAPCA1 W !,"Hospital Admission Date:",?47,X
S Y=$P(SRA(208),"^",15) D DT^SROAPCA1 W !,"Hospital Discharge Date:",?47,X
S Y=$P(SRA(.2),"^",10) D DT^SROAPCA1 W !,"Time Patient In OR: ",?47,X
S Y=$P(SRA(.2),"^",12) D DT^SROAPCA1 W !,"Time Patient Out OR: ",?47,X
S Y=$P(SRA(208),"^",22) I Y>1 D DT^SROAPCA1 S Y=X
S Y=$S(Y="NS":"Unable to determine",Y="RI":"Remains intubated at 30 days",1:Y) W !,"Date and Time Patient Extubated: ",?47,Y
I $P(SRA(208),"^",22)>1,$P(SRA(.2),"^",12) D
.S X=$$FMDIFF^XLFDT($P(SRA(208),"^",22),$P(SRA(.2),"^",12),2) W !,?5,"Postop Intubation Hrs: "_$FN((X/3600),"+",1)
S Y=$P(SRA(208),"^",23) I Y>1 D DT^SROAPCA1 S Y=X
S Y=$S(Y="NS":"Unable to determine",Y="RI":"Remains in ICU at 30 days",1:Y) W !,"Date and Time Patient Discharged from ICU: ",?47,Y
S Y=$P(SRA(209),"^") W !,"Patient is Homeless: ",?47,$S(Y="Y":"YES",Y="N":"NO",Y="NS":"NS",1:"")
S Y=$P(SRA(206),"^",41) W !,"Cardiac Surg Performed at Non-VA Facility: ",?47,$S(Y="Y":"YES",Y="N":"NO",Y="NS":"UNKNOWN",1:"")
S Y=$P(SRA(209),"^",15) D DT^SROAPCA1 W !,"CT Surgery Consult Date: ",?47,$P(X," ")
S Y=$P(SRA(209),"^",16),C=$P(^DD(130,515,0),"^",2) D:Y'="" Y^DIQ W !,"Cause for Delay for Surgery: ",?47,Y
W !,"Resource Data Comments: "
I $G(^SRF(SRTN,206.2))'="" S SRQ=0 S X=$G(^SRF(SRTN,206.2)) W:$L(X)<49 X,! I $L(X)>48 S Z=$L(X) D
.I X'[" " W ?25,X Q
.S I=0,LINE=1 F S SRL=$S(LINE=1:48,1:80) D Q:SRQ
..I $E(X,1,SRL)'[" " W X,! S SRQ=1 Q
..S J=SRL-I,Y=$E(X,J),I=I+1 I Y=" " W $E(X,1,J-1),!,?5 S X=$E(X,J+1,Z),Z=$L(X),I=0,LINE=LINE+1 I Z<SRL W X S SRQ=1 Q
I $Y+7>IOSL D PAGE^SROAPCA I SRSOUT Q
W ! F MOE=1:1:80 W "="
W !,"IX. SOCIOECONOMIC, ETHNICITY, AND RACE"
N SREMP S SREMP=$P(SRA(208),"^",18) S SREMP=$S(SREMP=1:"EMPLOYED FULL TIME",SREMP=2:"EMPLOYED PART TIME",SREMP=3:"NOT EMPLOYED",SREMP=4:"SELF EMPLOYED",SREMP=5:"RETIRED",SREMP=6:"ACTIVE MILITARY DUTY",SREMP=9:"UNKNOWN",1:" ")
W !,?1,"Employment Status Preoperatively: ",?40,SREMP
K SRA,SRAO
; Race/Ethnic
D ENTH^SRORACE
I $Y+7>IOSL D PAGE^SROAPCA I SRSOUT Q
D ^SROAPCA4
W !!," *** End of report for "_SRANM_" assessment #"_SRTN_" ***"
I $E(IOST)'="P" W ! K DIR S DIR(0)="E" D ^DIR K DIR
Q
SROAPCA3 ;B'HAM ISC/MAM - CARDIAC OCCURRENCE DATA ;02/05/08
+1 ;;3.0; Surgery ;**38,71,95,101,125,160,164,166**;24 Jun 93;Build 6
+2 DO EN^SROCCAT
KILL SRA
SET SRA(205)=$GET(^SRF(SRTN,205))
SET SRA(208)=$GET(^SRF(SRTN,208))
SET SRA(206)=$GET(^SRF(SRTN,206))
SET SRA(209)=$GET(^SRF(SRTN,209))
+3 SET NYUK=$PIECE(SRA(208),"^")
DO YN
SET SRAO(1)=SHEMP_"^384"
+4 SET Y=$PIECE($GET(^DPT(DFN,.35)),"^")
DO DT^SROAPCA1
SET SRAO(2)=X
+5 SET NYUK=$PIECE(SRA(208),"^",2)
DO YN
SET SRAO(3)=SHEMP_"^385"
SET NYUK=$PIECE(SRA(208),"^",3)
DO YN
SET SRAO(4)=SHEMP_"^386"
SET NYUK=$PIECE(SRA(205),"^",17)
DO YN
SET SRAO(5)=SHEMP_"^254"
SET NYUK=$PIECE(SRA(209),"^",12)
DO YN
SET SRAO(6)=SHEMP_"^490"
+6 SET NYUK=$PIECE(SRA(208),"^",5)
DO YN
SET SRAO(7)=SHEMP_"^388"
SET NYUK=$PIECE(SRA(208),"^",6)
DO YN
SET SRAO(8)=SHEMP_"^389"
SET NYUK=$PIECE(SRA(205),"^",13)
DO YN
SET SRAO(9)=SHEMP_"^285"
+7 SET NYUK=$PIECE(SRA(208),"^",7)
DO YN
SET SRAO(10)=SHEMP_"^391"
SET NYUK=$PIECE(SRA(205),"^",22)
DO YN
SET SRAO(11)=SHEMP_"^410"
+8 SET NYUK=$PIECE(SRA(205),"^",21)
DO YN
SET SRAO(12)=SHEMP_"^256"
SET NYUK=$PIECE(SRA(205),"^",26)
DO YN
SET SRAO(13)=SHEMP_"^411"
+9 SET NYUK=$PIECE(SRA(206),"^",39)
DO YN
SET SRAO(14)=SHEMP_"^466"
+10 SET NYUK=$PIECE(SRA(206),"^",40)
DO YN
SET SRAO(15)=SHEMP_"^467"
+11 IF $Y+5>IOSL
DO PAGE^SROAPCA
IF SRSOUT
QUIT
+12 WRITE !!,"VII. OUTCOMES"
+13 WRITE !,"Operative Death:",?18,$PIECE(SRAO(1),"^"),?43,"Date of Death:",?58,$PIECE(SRAO(2),"^")
+14 ;I $Y+10>IOSL D PAGE^SROAPCA I SRSOUT Q
+15 WRITE !!,"Perioperative (30 day) Occurrences:"
+16 WRITE !,?2,"Perioperative MI:",?36,$PIECE(SRAO(3),"^"),?42,"Repeat cardiac Surg procedure:",?74,$PIECE(SRAO(10),"^")
+17 WRITE !,?2,"Endocarditis:",?36,$PIECE(SRAO(4),"^"),?42,"Tracheostomy:",?74,$PIECE(SRAO(14),"^")
+18 WRITE !,?2,"Renal Failure Requiring Dialysis:",?36,$PIECE(SRAO(5),"^"),?42,"Ventilator supp within 30 days:",?74,$PIECE(SRAO(6),"^")
+19 WRITE !,?2,"Mediastinitis:",?36,$PIECE(SRAO(7),"^"),?42,"Stroke/CVA:",?74,$PIECE(SRAO(12),"^")
+20 WRITE !,?2,"Cardiac Arrest Requiring CPR:",?36,$PIECE(SRAO(13),"^"),?42,"Coma > or = 24 Hours:",?74,$PIECE(SRAO(11),"^")
+21 WRITE !,?2,"Reoperation for Bleeding:",?36,$PIECE(SRAO(8),"^"),?42,"New Mech Circulatory Support:",?74,$PIECE(SRAO(15),"^")
+22 WRITE !,?2,"On ventilator > or = 48 hr:",?36,$PIECE(SRAO(9),"^")
+23 DO RES
+24 QUIT
YN ; store answer
+1 SET SHEMP=$SELECT(NYUK="NS":"NS",NYUK="N":"NO",NYUK="Y":"YES",1:"")
+2 QUIT
+3 ;
RES IF $Y+12>IOSL
DO PAGE^SROAPCA
IF SRSOUT
QUIT
+1 SET SRA(208)=$GET(^SRF(SRTN,208))
+2 SET SRA(.2)=$GET(^SRF(SRTN,.2))
+3 WRITE !!,"VIII. RESOURCE DATA"
+4 SET Y=$PIECE(SRA(208),"^",14)
DO DT^SROAPCA1
WRITE !,"Hospital Admission Date:",?47,X
+5 SET Y=$PIECE(SRA(208),"^",15)
DO DT^SROAPCA1
WRITE !,"Hospital Discharge Date:",?47,X
+6 SET Y=$PIECE(SRA(.2),"^",10)
DO DT^SROAPCA1
WRITE !,"Time Patient In OR: ",?47,X
+7 SET Y=$PIECE(SRA(.2),"^",12)
DO DT^SROAPCA1
WRITE !,"Time Patient Out OR: ",?47,X
+8 SET Y=$PIECE(SRA(208),"^",22)
IF Y>1
DO DT^SROAPCA1
SET Y=X
+9 SET Y=$SELECT(Y="NS":"Unable to determine",Y="RI":"Remains intubated at 30 days",1:Y)
WRITE !,"Date and Time Patient Extubated: ",?47,Y
+10 IF $PIECE(SRA(208),"^",22)>1
IF $PIECE(SRA(.2),"^",12)
Begin DoDot:1
+11 SET X=$$FMDIFF^XLFDT($PIECE(SRA(208),"^",22),$PIECE(SRA(.2),"^",12),2)
WRITE !,?5,"Postop Intubation Hrs: "_$FNUMBER((X/3600),"+",1)
End DoDot:1
+12 SET Y=$PIECE(SRA(208),"^",23)
IF Y>1
DO DT^SROAPCA1
SET Y=X
+13 SET Y=$SELECT(Y="NS":"Unable to determine",Y="RI":"Remains in ICU at 30 days",1:Y)
WRITE !,"Date and Time Patient Discharged from ICU: ",?47,Y
+14 SET Y=$PIECE(SRA(209),"^")
WRITE !,"Patient is Homeless: ",?47,$SELECT(Y="Y":"YES",Y="N":"NO",Y="NS":"NS",1:"")
+15 SET Y=$PIECE(SRA(206),"^",41)
WRITE !,"Cardiac Surg Performed at Non-VA Facility: ",?47,$SELECT(Y="Y":"YES",Y="N":"NO",Y="NS":"UNKNOWN",1:"")
+16 SET Y=$PIECE(SRA(209),"^",15)
DO DT^SROAPCA1
WRITE !,"CT Surgery Consult Date: ",?47,$PIECE(X," ")
+17 SET Y=$PIECE(SRA(209),"^",16)
SET C=$PIECE(^DD(130,515,0),"^",2)
IF Y'=""
DO Y^DIQ
WRITE !,"Cause for Delay for Surgery: ",?47,Y
+18 WRITE !,"Resource Data Comments: "
+19 IF $GET(^SRF(SRTN,206.2))'=""
SET SRQ=0
SET X=$GET(^SRF(SRTN,206.2))
IF $LENGTH(X)<49
WRITE X,!
IF $LENGTH(X)>48
SET Z=$LENGTH(X)
Begin DoDot:1
+20 IF X'[" "
WRITE ?25,X
QUIT
+21 SET I=0
SET LINE=1
FOR
SET SRL=$SELECT(LINE=1:48,1:80)
Begin DoDot:2
+22 IF $EXTRACT(X,1,SRL)'[" "
WRITE X,!
SET SRQ=1
QUIT
+23 SET J=SRL-I
SET Y=$EXTRACT(X,J)
SET I=I+1
IF Y=" "
WRITE $EXTRACT(X,1,J-1),!,?5
SET X=$EXTRACT(X,J+1,Z)
SET Z=$LENGTH(X)
SET I=0
SET LINE=LINE+1
IF Z<SRL
WRITE X
SET SRQ=1
QUIT
End DoDot:2
IF SRQ
QUIT
End DoDot:1
+24 IF $Y+7>IOSL
DO PAGE^SROAPCA
IF SRSOUT
QUIT
+25 WRITE !
FOR MOE=1:1:80
WRITE "="
+26 WRITE !,"IX. SOCIOECONOMIC, ETHNICITY, AND RACE"
+27 NEW SREMP
SET SREMP=$PIECE(SRA(208),"^",18)
SET SREMP=$SELECT(SREMP=1:"EMPLOYED FULL TIME",SREMP=2:"EMPLOYED PART TIME",SREMP=3:"NOT EMPLOYED",SREMP=4:"SELF EMPLOYED",SREMP=5:"RETIRED",SREMP=6:"ACTIVE MILITARY DUTY",SREMP=9:"UNKNOWN",1:" ")
+28 WRITE !,?1,"Employment Status Preoperatively: ",?40,SREMP
+29 KILL SRA,SRAO
+30 ; Race/Ethnic
+31 DO ENTH^SRORACE
+32 IF $Y+7>IOSL
DO PAGE^SROAPCA
IF SRSOUT
QUIT
+33 DO ^SROAPCA4
+34 WRITE !!," *** End of report for "_SRANM_" assessment #"_SRTN_" ***"
+35 IF $EXTRACT(IOST)'="P"
WRITE !
KILL DIR
SET DIR(0)="E"
DO ^DIR
KILL DIR
+36 QUIT