SROACL1 ;BIR/MAM - CARDIAC PREOP CLINICAL DATA ;06/13/06
;;3.0; Surgery ;**38,71,95,125,153,160**;24 Jun 93;Build 7
;
; Reference to EN1^GMRVUT0 supported by DBIA #1446
;
F I=0,200,202,205,206,206.1,208,209,200.1 S SRA(I)=$G(^SRF(SRTN,I))
HT N SRSD,SRED S SRED=$P(SRA(0),"^",9)
I $P(SRA(206),"^")="" S SRSD=$$FMADD^XLFDT(SRED,-365),NYUK=$$HW(SRSD,SRED,"HT") D
.I NYUK'="" S NYUK=NYUK+.5\1,$P(^SRF(SRTN,206),"^")=NYUK,SRA(206)=$G(^SRF(SRTN,206))
S NYUK=$P(SRA(206),"^") S:NYUK'="" NYUK=$S(NYUK["C"!(NYUK["c"):+NYUK_" cm",+NYUK=NYUK:+NYUK_" in",NYUK="NS":" NS",1:NYUK) S SRAO(1)=NYUK_"^236"
WT I $P(SRA(206),"^",2)="" S SRSD=$$FMADD^XLFDT(SRED,-30),NYUK=$$HW(SRSD,SRED,"WT") D
.I NYUK'="" S NYUK=NYUK+.5\1,$P(^SRF(SRTN,206),"^",2)=NYUK,SRA(206)=$G(^SRF(SRTN,206))
S NYUK=$P(SRA(206),"^",2) S:NYUK'="" NYUK=$S(NYUK["K"!(NYUK["k"):+NYUK_" kg",+NYUK=NYUK:+NYUK_" lb",NYUK="NS":" NS",1:NYUK) S SRAO(2)=NYUK_"^237"
K SRA(0) S NYUK=$P(SRA(209),"^",3),SRAO(3)=$S(NYUK="N":" NO",NYUK="D":" DIET",NYUK="O":" ORAL",NYUK="I":" INSULIN",1:"")_"^475",NYUK=$P(SRA(200),"^",11) D YN S SRAO(4)=SHEMP_"^203"
S SRAO(5)=$P(SRA(206),"^",5)_"^347",NYUK=$P(SRA(206),"^",6) D YN S SRAO(6)=SHEMP_"^209",NYUK=$P(SRA(206),"^",7) D YN S SRAO(7)=SHEMP_"^348"
S Y=$P(SRA(200.1),"^",5),C=$P(^DD(130,510,0),"^",2) D Y^DIQ S SRAO(8)=$S(Y["-":$E($P(Y,"-",2),1,19),1:$E(Y,1,19))_"^510"
S NYUK=$P(SRA(206),"^",10) D YN S SRAO(9)=SHEMP_"^349"
S NYUK=$P(SRA(206),"^",11) D YN S SRAO(10)=SHEMP_"^350",NYUK=$P(SRA(200),"^",8),SRAO(11)=$S(NYUK=1:"INDEPENDENT",NYUK=2:"PARTIAL DEPENDENT",NYUK=3:"TOTALLY DEPENDENT",NYUK="NS":"NO STUDY",1:"")_"^240"
S NYUK=$P(SRA(206),"^",13),SRAO(12)=$S(NYUK=0:"NONE ",NYUK=1:"NONE RECENT",NYUK=2:"12-72 HRS",NYUK=3:"<12 hrs ",NYUK=12:"12 - 72 hrs",NYUK=72:">72 hrs - 7 days",NYUK=7:">7 days ",NYUK="NS":"NO STUDY",1:"")_"^351"
S NYUK=$P(SRA(206),"^",14),SRAO(13)=$S(NYUK=0:"NONE",NYUK=1:"< OR = 7 DAYS",NYUK=2:"> 7 DAYS",1:"")_"^205"
S NYUK=$P(SRA(206),"^",15) S SRAO(14)=$S(NYUK=0:"NONE",NYUK=">":">3",NYUK="Y":"YES",NYUK="N":"NO",1:NYUK)_"^352"
S SRAO(15)=$P(SRA(206),"^",42)_"^485"
S NYUK=$P(SRA(206),"^",16) D YN S SRAO(16)=SHEMP_"^265",NYUK=$P(SRA(206),"^",17) D YN S SRAO(17)=SHEMP_"^264"
S SRAO(18)=$P(SRA(206),"^",18)_"^267",SRAO(19)=$P(SRA(206),"^",19)_"^207",NYUK=$P(SRA(206),"^",20) D YN S SRAO(20)=SHEMP_"^353",NYUK=$P(SRA(206),"^",21) D YN S SRAO(21)=SHEMP_"^354"
S NYUK=$P(SRA(206),"^",22) D YN S SRAO(22)=SHEMP_"^355"
S NYUK=$P(SRA(209),"^",2),SRAO(23)=$S(NYUK="N":"NONE",NYUK="I":"IABP",NYUK="V":"VAD",NYUK="A":"ARTI",NYUK="O":"OTHER",1:"")_"^474"
S NYUK=$P(SRA(206),"^",38) D YN S SRAO(24)=SHEMP_"^463"
DISP ; display fields
S SRPAGE="PAGE: 1" D HDR^SROAUTL
W !," 1. Height:",?29,$P(SRAO(1),"^"),?41,"13. Prior MI: ",$J($P(SRAO(13),"^"),24)
W !," 2. Weight:",?29,$P(SRAO(2),"^"),?41,"14. Number prior heart surgeries: ",?70,$P(SRAO(14),"^")
W !," 3. Diabetes:",?27,$P(SRAO(3),"^"),?41,"15. Prior heart surgeries:" D H485
W !," 4. COPD:",?30,$P(SRAO(4),"^"),?41,"16. Peripheral Vascular Disease:",?75,$P(SRAO(16),"^")
W !," 5. FEV1:",?($S($P(SRAO(5),"^")="NS":30,1:27)),$P(SRAO(5),"^")_$S($P(SRAO(5),"^")="":"",$P(SRAO(5),"^")="NS":"",1:" liters"),?41,"17. Cerebral Vascular Disease:",?75,$P(SRAO(17),"^")
W !," 6. Cardiomegaly (X-ray):",?30,$P(SRAO(6),"^"),?41,"18. Angina (use CCS Class):",?75,$P(SRAO(18),"^")
W !," 7. Pulmonary Rales:",?30,$P(SRAO(7),"^"),?41,"19. CHF (use NYHA Class):",?75,$P(SRAO(19),"^")
W !," 8. Current Smoker: ",$J($P(SRAO(8),"^"),19),?41,"20. Current Diuretic Use:",?75,$P(SRAO(20),"^")
W !," 9. Active Endocarditis:",?30,$P(SRAO(9),"^"),?41,"21. Current Digoxin Use:",?75,$P(SRAO(21),"^")
W !,"10. Resting ST Depression:",?30,$P(SRAO(10),"^"),?41,"22. IV NTG within 48 Hours:",?75,$P(SRAO(22),"^")
W !,"11. Functional Status: ",$J($P(SRAO(11),"^"),17),?41,"23. Preop circulatory Device:",?75,$P(SRAO(23),"^")
W !,"12. PCI: ",$J($P(SRAO(12),"^"),29),?41,"24. Hypertension (Y/N):",?75,$P(SRAO(24),"^")
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
H485 S SHEMP="",X=$P(SRAO(15),"^") F I=1:1:$L(X,",") D
.S C=$P(X,",",I) S:I>1 SHEMP=SHEMP_", " S SHEMP=SHEMP_$S(C=0:"NONE",C=1:"CABG-ONLY",C=2:"VALVE-ONLY",C=3:"CABG/VALVE",C=4:"OTHER",C=5:"CABG/OTHER",1:"")
;
S X=SHEMP I $L(X)<12 W ?68,$J(X,11) Q
W ?68,$J($P(X,",")_",",11) I $L($P(X,", ",2,9))<36 W !,?44,$P(X,", ",2,9) Q
W !,?44,$P(X,", ",2,4)_",",!,?44,$P(X,", ",5,9)
Q
HW(SRSD,SRED,SVTYPE) ; get weight & height from Vitals
N GMRVSTR,SRTYPE,SRBCNT,SRBRDT,SRBIEN,SRBDATA,RESULTS
K ^UTILITY($J,"GMRVD"),RESULTS S GMRVSTR=SVTYPE,GMRVSTR(0)=SRSD_"^"_SRED_"^^"
D EN1^GMRVUT0 Q:'$D(^UTILITY($J,"GMRVD")) ""
S SRTYPE="",SRBCNT=1 F S SRTYPE=$O(^UTILITY($J,"GMRVD",SRTYPE)) Q:SRTYPE="" D
.S SRBRDT=0 F S SRBRDT=$O(^UTILITY($J,"GMRVD",SRTYPE,SRBRDT)) Q:'SRBRDT D
..S SRBIEN=0 F S SRBIEN=$O(^UTILITY($J,"GMRVD",SRTYPE,SRBRDT,SRBIEN)) Q:'SRBIEN D
...S SRBDATA=$G(^UTILITY($J,"GMRVD",SRTYPE,SRBRDT,SRBIEN))
...S RESULTS(SRTYPE,SRBRDT)=$P(SRBDATA,"^",1,2)_"^"_$P(SRBDATA,"^",8),SRBCNT=SRBCNT+1
I $D(RESULTS(SVTYPE)) S SRI=$O(RESULTS(SVTYPE,0)) Q $P(RESULTS(SVTYPE,SRI),"^",3)
Q ""
SROACL1 ;BIR/MAM - CARDIAC PREOP CLINICAL DATA ;06/13/06
+1 ;;3.0; Surgery ;**38,71,95,125,153,160**;24 Jun 93;Build 7
+2 ;
+3 ; Reference to EN1^GMRVUT0 supported by DBIA #1446
+4 ;
+5 FOR I=0,200,202,205,206,206.1,208,209,200.1
SET SRA(I)=$GET(^SRF(SRTN,I))
HT NEW SRSD,SRED
SET SRED=$PIECE(SRA(0),"^",9)
+1 IF $PIECE(SRA(206),"^")=""
SET SRSD=$$FMADD^XLFDT(SRED,-365)
SET NYUK=$$HW(SRSD,SRED,"HT")
Begin DoDot:1
+2 IF NYUK'=""
SET NYUK=NYUK+.5\1
SET $PIECE(^SRF(SRTN,206),"^")=NYUK
SET SRA(206)=$GET(^SRF(SRTN,206))
End DoDot:1
+3 SET NYUK=$PIECE(SRA(206),"^")
IF NYUK'=""
SET NYUK=$SELECT(NYUK["C"!(NYUK["c"):+NYUK_" cm",+NYUK=NYUK:+NYUK_" in",NYUK="NS":" NS",1:NYUK)
SET SRAO(1)=NYUK_"^236"
WT IF $PIECE(SRA(206),"^",2)=""
SET SRSD=$$FMADD^XLFDT(SRED,-30)
SET NYUK=$$HW(SRSD,SRED,"WT")
Begin DoDot:1
+1 IF NYUK'=""
SET NYUK=NYUK+.5\1
SET $PIECE(^SRF(SRTN,206),"^",2)=NYUK
SET SRA(206)=$GET(^SRF(SRTN,206))
End DoDot:1
+2 SET NYUK=$PIECE(SRA(206),"^",2)
IF NYUK'=""
SET NYUK=$SELECT(NYUK["K"!(NYUK["k"):+NYUK_" kg",+NYUK=NYUK:+NYUK_" lb",NYUK="NS":" NS",1:NYUK)
SET SRAO(2)=NYUK_"^237"
+3 KILL SRA(0)
SET NYUK=$PIECE(SRA(209),"^",3)
SET SRAO(3)=$SELECT(NYUK="N":" NO",NYUK="D":" DIET",NYUK="O":" ORAL",NYUK="I":" INSULIN",1:"")_"^475"
SET NYUK=$PIECE(SRA(200),"^",11)
DO YN
SET SRAO(4)=SHEMP_"^203"
+4 SET SRAO(5)=$PIECE(SRA(206),"^",5)_"^347"
SET NYUK=$PIECE(SRA(206),"^",6)
DO YN
SET SRAO(6)=SHEMP_"^209"
SET NYUK=$PIECE(SRA(206),"^",7)
DO YN
SET SRAO(7)=SHEMP_"^348"
+5 SET Y=$PIECE(SRA(200.1),"^",5)
SET C=$PIECE(^DD(130,510,0),"^",2)
DO Y^DIQ
SET SRAO(8)=$SELECT(Y["-":$EXTRACT($PIECE(Y,"-",2),1,19),1:$EXTRACT(Y,1,19))_"^510"
+6 SET NYUK=$PIECE(SRA(206),"^",10)
DO YN
SET SRAO(9)=SHEMP_"^349"
+7 SET NYUK=$PIECE(SRA(206),"^",11)
DO YN
SET SRAO(10)=SHEMP_"^350"
SET NYUK=$PIECE(SRA(200),"^",8)
SET SRAO(11)=$SELECT(NYUK=1:"INDEPENDENT",NYUK=2:"PARTIAL DEPENDENT",NYUK=3:"TOTALLY DEPENDENT",NYUK="NS":"NO STUDY",1:"")_"^240"
+8 SET NYUK=$PIECE(SRA(206),"^",13)
SET SRAO(12)=$SELECT(NYUK=0:"NONE ",NYUK=1:"NONE RECENT",NYUK=2:"12-72 HRS",NYUK=3:"<12 hrs ",NYUK=12:"12 - 72 hrs",NYUK=72:">72 hrs - 7 days",NYUK=7:">7 days ",NYUK="NS":"NO STUDY",1:"")_"^351"
+9 SET NYUK=$PIECE(SRA(206),"^",14)
SET SRAO(13)=$SELECT(NYUK=0:"NONE",NYUK=1:"< OR = 7 DAYS",NYUK=2:"> 7 DAYS",1:"")_"^205"
+10 SET NYUK=$PIECE(SRA(206),"^",15)
SET SRAO(14)=$SELECT(NYUK=0:"NONE",NYUK=">":">3",NYUK="Y":"YES",NYUK="N":"NO",1:NYUK)_"^352"
+11 SET SRAO(15)=$PIECE(SRA(206),"^",42)_"^485"
+12 SET NYUK=$PIECE(SRA(206),"^",16)
DO YN
SET SRAO(16)=SHEMP_"^265"
SET NYUK=$PIECE(SRA(206),"^",17)
DO YN
SET SRAO(17)=SHEMP_"^264"
+13 SET SRAO(18)=$PIECE(SRA(206),"^",18)_"^267"
SET SRAO(19)=$PIECE(SRA(206),"^",19)_"^207"
SET NYUK=$PIECE(SRA(206),"^",20)
DO YN
SET SRAO(20)=SHEMP_"^353"
SET NYUK=$PIECE(SRA(206),"^",21)
DO YN
SET SRAO(21)=SHEMP_"^354"
+14 SET NYUK=$PIECE(SRA(206),"^",22)
DO YN
SET SRAO(22)=SHEMP_"^355"
+15 SET NYUK=$PIECE(SRA(209),"^",2)
SET SRAO(23)=$SELECT(NYUK="N":"NONE",NYUK="I":"IABP",NYUK="V":"VAD",NYUK="A":"ARTI",NYUK="O":"OTHER",1:"")_"^474"
+16 SET NYUK=$PIECE(SRA(206),"^",38)
DO YN
SET SRAO(24)=SHEMP_"^463"
DISP ; display fields
+1 SET SRPAGE="PAGE: 1"
DO HDR^SROAUTL
+2 WRITE !," 1. Height:",?29,$PIECE(SRAO(1),"^"),?41,"13. Prior MI: ",$JUSTIFY($PIECE(SRAO(13),"^"),24)
+3 WRITE !," 2. Weight:",?29,$PIECE(SRAO(2),"^"),?41,"14. Number prior heart surgeries: ",?70,$PIECE(SRAO(14),"^")
+4 WRITE !," 3. Diabetes:",?27,$PIECE(SRAO(3),"^"),?41,"15. Prior heart surgeries:"
DO H485
+5 WRITE !," 4. COPD:",?30,$PIECE(SRAO(4),"^"),?41,"16. Peripheral Vascular Disease:",?75,$PIECE(SRAO(16),"^")
+6 WRITE !," 5. FEV1:",?($SELECT($PIECE(SRAO(5),"^")="NS":30,1:27)),$PIECE(SRAO(5),"^")_$SELECT($PIECE(SRAO(5),"^")="":"",$PIECE(SRAO(5),"^")="NS":"",1:" liters"),?41,"17. Cerebral Vascular Disease:",?75,$PIECE(SRAO(17),"^")
+7 WRITE !," 6. Cardiomegaly (X-ray):",?30,$PIECE(SRAO(6),"^"),?41,"18. Angina (use CCS Class):",?75,$PIECE(SRAO(18),"^")
+8 WRITE !," 7. Pulmonary Rales:",?30,$PIECE(SRAO(7),"^"),?41,"19. CHF (use NYHA Class):",?75,$PIECE(SRAO(19),"^")
+9 WRITE !," 8. Current Smoker: ",$JUSTIFY($PIECE(SRAO(8),"^"),19),?41,"20. Current Diuretic Use:",?75,$PIECE(SRAO(20),"^")
+10 WRITE !," 9. Active Endocarditis:",?30,$PIECE(SRAO(9),"^"),?41,"21. Current Digoxin Use:",?75,$PIECE(SRAO(21),"^")
+11 WRITE !,"10. Resting ST Depression:",?30,$PIECE(SRAO(10),"^"),?41,"22. IV NTG within 48 Hours:",?75,$PIECE(SRAO(22),"^")
+12 WRITE !,"11. Functional Status: ",$JUSTIFY($PIECE(SRAO(11),"^"),17),?41,"23. Preop circulatory Device:",?75,$PIECE(SRAO(23),"^")
+13 WRITE !,"12. PCI: ",$JUSTIFY($PIECE(SRAO(12),"^"),29),?41,"24. Hypertension (Y/N):",?75,$PIECE(SRAO(24),"^")
+14 WRITE !!
FOR MOE=1:1:80
WRITE "-"
+15 QUIT
YN ; store answer
+1 SET SHEMP=$SELECT(NYUK="NS":"NS",NYUK="N":"NO",NYUK="Y":"YES",1:"")
+2 QUIT
H485 SET SHEMP=""
SET X=$PIECE(SRAO(15),"^")
FOR I=1:1:$LENGTH(X,",")
Begin DoDot:1
+1 SET C=$PIECE(X,",",I)
IF I>1
SET SHEMP=SHEMP_", "
SET SHEMP=SHEMP_$SELECT(C=0:"NONE",C=1:"CABG-ONLY",C=2:"VALVE-ONLY",C=3:"CABG/VALVE",C=4:"OTHER",C=5:"CABG/OTHER",1:"")
End DoDot:1
+2 ;
+3 SET X=SHEMP
IF $LENGTH(X)<12
WRITE ?68,$JUSTIFY(X,11)
QUIT
+4 WRITE ?68,$JUSTIFY($PIECE(X,",")_",",11)
IF $LENGTH($PIECE(X,", ",2,9))<36
WRITE !,?44,$PIECE(X,", ",2,9)
QUIT
+5 WRITE !,?44,$PIECE(X,", ",2,4)_",",!,?44,$PIECE(X,", ",5,9)
+6 QUIT
HW(SRSD,SRED,SVTYPE) ; get weight & height from Vitals
+1 NEW GMRVSTR,SRTYPE,SRBCNT,SRBRDT,SRBIEN,SRBDATA,RESULTS
+2 KILL ^UTILITY($JOB,"GMRVD"),RESULTS
SET GMRVSTR=SVTYPE
SET GMRVSTR(0)=SRSD_"^"_SRED_"^^"
+3 DO EN1^GMRVUT0
IF '$DATA(^UTILITY($JOB,"GMRVD"))
QUIT ""
+4 SET SRTYPE=""
SET SRBCNT=1
FOR
SET SRTYPE=$ORDER(^UTILITY($JOB,"GMRVD",SRTYPE))
IF SRTYPE=""
QUIT
Begin DoDot:1
+5 SET SRBRDT=0
FOR
SET SRBRDT=$ORDER(^UTILITY($JOB,"GMRVD",SRTYPE,SRBRDT))
IF 'SRBRDT
QUIT
Begin DoDot:2
+6 SET SRBIEN=0
FOR
SET SRBIEN=$ORDER(^UTILITY($JOB,"GMRVD",SRTYPE,SRBRDT,SRBIEN))
IF 'SRBIEN
QUIT
Begin DoDot:3
+7 SET SRBDATA=$GET(^UTILITY($JOB,"GMRVD",SRTYPE,SRBRDT,SRBIEN))
+8 SET RESULTS(SRTYPE,SRBRDT)=$PIECE(SRBDATA,"^",1,2)_"^"_$PIECE(SRBDATA,"^",8)
SET SRBCNT=SRBCNT+1
End DoDot:3
End DoDot:2
End DoDot:1
+9 IF $DATA(RESULTS(SVTYPE))
SET SRI=$ORDER(RESULTS(SVTYPE,0))
QUIT $PIECE(RESULTS(SVTYPE,SRI),"^",3)
+10 QUIT ""