SROACL1 ;BIR/MAM - CARDIAC PREOP CLINICAL DATA ; AUGUST 11, 2011
;;3.0;Surgery;**38,71,95,125,153,160,174,176,182,184,200,203**;24 Jun 93;Build 7
;
; Reference to EN1^GMRVUT0 supported by DBIA #1446
;
D TUT^SROAUTL3 F I=0,200,202,205,206,206.1,208,209,200.1,210,207 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"
S Y=$P(SRA(200.1),"^",11),C=$P(^DD(130,519,0),"^",2) D:Y'="" Y^DIQ S SRAO(3)=Y_"^519"
S Y=$P(SRA(200.1),"^",12),C=$P(^DD(130,520,0),"^",2) D:Y'="" Y^DIQ S SRAO(4)=Y_"^520"
K SRA(0) S NYUK=$P(SRA(200),"^",11) D YN S SRAO(5)=SHEMP_"^203"
S SRAO(6)=$P(SRA(206),"^",5)_"^347",NYUK=$P(SRA(206),"^",6) D YN S SRAO(7)=SHEMP_"^209"
S Y=$P(SRA(200.1),"^",9),C=$P(^DD(130,517,0),"^",2) D:Y'="" Y^DIQ S SRAO(8)=Y_"^517"
S Y=$P(SRA(200.1),"^",10),C=$P(^DD(130,518,0),"^",2) D:Y'="" Y^DIQ S SRAO(9)=Y_"^518"
S Y=$P(SRA(200),"^",55) S SRAO(10)=$$H618(Y)_"^618"
S NYUK=$P(SRA(206),"^",10) D YN S SRAO(11)=SHEMP_"^349"
S NYUK=$P(SRA(200.1),"^",2),SRAO(12)=$S(NYUK=1:"INDEPENDENT",NYUK=2:"PARTIAL DEPENDENT",NYUK=3:"TOTALLY DEPENDENT",NYUK="NS":"NO STUDY",1:"")_"^492"
S NYUK=$P(SRA(200),"^",56),SRAO(13)=$S(NYUK=1:"NONE",NYUK=2:"<12 HRS OF SURG",NYUK=3:">12 HRS - 7 DAYS",NYUK=4:">7 DAYS",NYUK=5:"UNKNOWN",1:"")_"^640"
S NYUK=$P(SRA(206),"^",14),SRAO(14)=$S(NYUK=0:"NO",NYUK=1:"< OR = 7 DAYS",NYUK=2:"BETWEEN 7 DAYS AND 6 MONTHS",NYUK=3:"UNKNOWN",NYUK=4:"> 6 MONTHS",NYUK=5:"UNKNOWN",1:"")_"^205"
S NYUK=$P(SRA(206),"^",15) S SRAO(15)=$S(NYUK=0:"NONE",NYUK=">":">3",NYUK="Y":"YES",NYUK="N":"NO",1:NYUK)_"^352"
S SRAO(16)=$P(SRA(206),"^",42)_"^485"
S NYUK=$P(SRA(206),"^",16) S SRAO(17)=$$OUT(265,NYUK)_"^265"
S NYUK=$P(SRA(200.1),"^",13),SRAO(18)=$S(NYUK=1:"YES/NO SURG",NYUK=2:"YES/PRIOR SURG",NYUK=0:"NO CVD",1:"")_"^521"
S NYUK=$P(SRA(200.1),"^",14),SRAO(19)=$S(NYUK=1:"HIST OF TIA'S",NYUK=2:"CVA W/O NEURO DEF",NYUK=3:"CVA W/ NEURO DEF",NYUK=0:"NO CVD",1:"")_"^522"
S SRAO(20)=$$OUT(267,$P(SRA(206),"^",18))_"^267"
S SRAO(21)=$$OUT(643,$P(SRA(200),"^",59))_"^643"
S SRAO(22)=$P(SRA(207),"^",29)_"^423"
S NYUK=$P(SRA(206),"^",20) D YN S SRAO(23)=SHEMP_"^353"
S NYUK=$P(SRA(206),"^",22) D YN S SRAO(24)=SHEMP_"^355"
S NYUK=$P(SRA(209),"^",2),SRAO(25)=$S(NYUK="N":"NONE",NYUK="I":"IABP",NYUK="V":"VAD",NYUK="A":"ARTI",NYUK="O":"OTHER",1:"")_"^474"
S NYUK=$P(SRA(200),"^",57) D H641 S SRAO(26)=SHEMP_"^641"
S NYUK=$P(SRA(208),"^",19) D YN S SRAO(27)=SHEMP_"^509"
S NYUK=$P(SRA(200.1),"^",8),SRAO(28)=$$OUT(237.1,NYUK)_"^237.1"
S NYUK=$P(SRA(200.1),"^",15),SRAO(29)=$$OUT(667,NYUK)_"^667"
S SRAO(30)=$P(SRA(210),"^")_"^662"
DISP ; display fields
S SRPAGE="PAGE: 1" D HDR^SROAUTL
W " 1. Height:",?30,$P(SRAO(1),"^"),?42,"17. PAD:",?(79-$L($P(SRAO(17),"^"))),$P(SRAO(17),"^")
W !," 2. Weight:",?30,$P(SRAO(2),"^"),?42,"18. CVD Repair/Obstruct:",?(79-$L($P(SRAO(18),"^"))),$E($P(SRAO(18),"^"),1,13)
W !," 3. Diabetes - Long Term:",?30,$E($P(SRAO(3),"^"),1,10),?42,"19. History of CVD:",?(79-$L($P(SRAO(19),"^"))),$E($P(SRAO(19),"^"),1,15)
W !," 4. Diabetes - 2 Wks Preop:",?30,$E($P(SRAO(4),"^"),1,10),?42,"20. Angina Severity:",?(79-$L($P(SRAO(20),"^"))),$E($P(SRAO(20),"^"),1,15)
W !," 5. COPD:",?30,$P(SRAO(5),"^"),?42,"21. Angina Timeframe:",$J($E($P(SRAO(21),"^"),1,14),16)
W !," 6. FEV1:",?30,$P(SRAO(6),"^")_$S($P(SRAO(6),"^")="":"",$P(SRAO(6),"^")="NS":"",1:" liters"),?42,"22. Congestive Heart Failure:",?72,$P(SRAO(22),"^")
W !," 7. Cardiomegaly (X-ray):",?30,$P(SRAO(7),"^"),?42,"23. Current Diuretic Use:",?72,$P(SRAO(23),"^")
W !," 8. Tobacco Use:",$J($P(SRAO(8),"^"),25),?42,"24. IV NTG within 48 Hours:",?72,$P(SRAO(24),"^")
W !," 9. Tobacco Use Timeframe: ",$P(SRAO(9),"^"),?42,"25. Preop Circulatory Device: ",$P(SRAO(25),"^")
W !,"10. Positive Drug Screening: ",?30,$P(SRAO(10),"^"),?42,"26. Hypertension:",?(79-$L($P(SRAO(26),"^"))),($E($P(SRAO(26),"^"),1,20))
W !,"11. Active Endocarditis:",?30,$P(SRAO(11),"^"),?42,"27. Preop Atrial Fibrillation:",?72,$P(SRAO(27),"^")
W !,"12. Functional Status: ",$J($P(SRAO(12),"^"),18),?42,"28. Preop Sleep Apnea:",?72,$P(SRAO(28),"^")
W !,"13. PCI: ",$J($P(SRAO(13),"^"),25),?42,"29. Sleep Apnea-Compliance: ",$E($P(SRAO(29),"^"),1,10)
W !,"14. Prior MI: " D
.I $L($P(SRAO(14),"^"))<8 W ?30,$P(SRAO(14),"^") Q
.W $J($E($P(SRAO(14),"^"),1,23),27)
W ?42,"30. Impaired Cognitive Func: ",$P(SRAO(30),"^")
W !,"15. Num Prior Heart Surgeries:",$P(SRAO(15),"^")
W !,"16. Prior Heart Surgery:" D H485
W ! F MOE=1:1:80 W "-"
Q
YN ; store answer
S SHEMP=$S(NYUK="NS":"NS",NYUK="N":"NO",NYUK="Y":"YES",NYUK="NA":"N/A",1:"")
Q
H641 ; store answer
S SHEMP=$S(NYUK=1:"NO",NYUK=2:"YES WITHOUT MED",NYUK=3:"YES WITH MED",NYUK=4:"UNKNOWN",1:"")
Q
H618(Y) S SHEMP=$S(Y=1:"NOT DONE",Y=2:"NEG RESULT",Y=3:"POS NOT RX",Y=4:"POS RX",1:"")
Q $E(SHEMP,1,10)
;
H485 S SHEMP="",X=$P(SRAO(16),"^") 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",C=6:"UNKNOWN",1:"")
S X=SHEMP I $L(X)<12 W ?30,X Q
W ?25,$P(X,", ",1,4) I $P(X,", ",5) W ",",!,?25,$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)=$S(SVTYPE="HT":"0",1:SRSD)_"^"_SRED_"^^" ;SR203;was 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
;SR200: return all of RESULTS - but with WT in 1st piece
I $D(RESULTS(SVTYPE)) S SRI=$O(RESULTS(SVTYPE,0)) Q $P(RESULTS(SVTYPE,SRI),"^",3)_U_RESULTS(SVTYPE,SRI)
Q ""
OUT(SRFLD,SRY) ; get data in output form
N C,Y,Z
S Y=SRY,C=$P(^DD(130,SRFLD,0),"^",2) D:Y'="" Y^DIQ
;I SRFLD=662 S Y=$S(Y=0:"NO IMPAIRMENT",Y=1:"DOCUMENTED HISTORY",Y=2:"DOCUMENTED&DECLINING",Y=3:"NO STUDY",1:"") Q Y
S Y=$S(Y="NO STUDY":"NS",Y="N/A":"NA",1:Y)
I SRFLD=265 S Y=$S(SRY=1:"NO",SRY=2:"YES-W/O ANGI,REVASC,or AMPUT",SRY=3:"YES-W HX ANGI,REVASC,or AMPUT",SRY=4:"UNKNOWN",1:"") Q Y
I SRFLD=237.1 S Y=$E(Y,1,7)
Q Y
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSROACL1 7097 printed Dec 13, 2024@02:40:06 Page 2
SROACL1 ;BIR/MAM - CARDIAC PREOP CLINICAL DATA ; AUGUST 11, 2011
+1 ;;3.0;Surgery;**38,71,95,125,153,160,174,176,182,184,200,203**;24 Jun 93;Build 7
+2 ;
+3 ; Reference to EN1^GMRVUT0 supported by DBIA #1446
+4 ;
+5 DO TUT^SROAUTL3
FOR I=0,200,202,205,206,206.1,208,209,200.1,210,207
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 SET Y=$PIECE(SRA(200.1),"^",11)
SET C=$PIECE(^DD(130,519,0),"^",2)
if Y'=""
DO Y^DIQ
SET SRAO(3)=Y_"^519"
+4 SET Y=$PIECE(SRA(200.1),"^",12)
SET C=$PIECE(^DD(130,520,0),"^",2)
if Y'=""
DO Y^DIQ
SET SRAO(4)=Y_"^520"
+5 KILL SRA(0)
SET NYUK=$PIECE(SRA(200),"^",11)
DO YN
SET SRAO(5)=SHEMP_"^203"
+6 SET SRAO(6)=$PIECE(SRA(206),"^",5)_"^347"
SET NYUK=$PIECE(SRA(206),"^",6)
DO YN
SET SRAO(7)=SHEMP_"^209"
+7 SET Y=$PIECE(SRA(200.1),"^",9)
SET C=$PIECE(^DD(130,517,0),"^",2)
if Y'=""
DO Y^DIQ
SET SRAO(8)=Y_"^517"
+8 SET Y=$PIECE(SRA(200.1),"^",10)
SET C=$PIECE(^DD(130,518,0),"^",2)
if Y'=""
DO Y^DIQ
SET SRAO(9)=Y_"^518"
+9 SET Y=$PIECE(SRA(200),"^",55)
SET SRAO(10)=$$H618(Y)_"^618"
+10 SET NYUK=$PIECE(SRA(206),"^",10)
DO YN
SET SRAO(11)=SHEMP_"^349"
+11 SET NYUK=$PIECE(SRA(200.1),"^",2)
SET SRAO(12)=$SELECT(NYUK=1:"INDEPENDENT",NYUK=2:"PARTIAL DEPENDENT",NYUK=3:"TOTALLY DEPENDENT",NYUK="NS":"NO STUDY",1:"")_"^492"
+12 SET NYUK=$PIECE(SRA(200),"^",56)
SET SRAO(13)=$SELECT(NYUK=1:"NONE",NYUK=2:"<12 HRS OF SURG",NYUK=3:">12 HRS - 7 DAYS",NYUK=4:">7 DAYS",NYUK=5:"UNKNOWN",1:"")_"^640"
+13 SET NYUK=$PIECE(SRA(206),"^",14)
SET SRAO(14)=$SELECT(NYUK=0:"NO",NYUK=1:"< OR = 7 DAYS",NYUK=2:"BETWEEN 7 DAYS AND 6 MONTHS",NYUK=3:"UNKNOWN",NYUK=4:"> 6 MONTHS",NYUK=5:"UNKNOWN",1:"")_"^205"
+14 SET NYUK=$PIECE(SRA(206),"^",15)
SET SRAO(15)=$SELECT(NYUK=0:"NONE",NYUK=">":">3",NYUK="Y":"YES",NYUK="N":"NO",1:NYUK)_"^352"
+15 SET SRAO(16)=$PIECE(SRA(206),"^",42)_"^485"
+16 SET NYUK=$PIECE(SRA(206),"^",16)
SET SRAO(17)=$$OUT(265,NYUK)_"^265"
+17 SET NYUK=$PIECE(SRA(200.1),"^",13)
SET SRAO(18)=$SELECT(NYUK=1:"YES/NO SURG",NYUK=2:"YES/PRIOR SURG",NYUK=0:"NO CVD",1:"")_"^521"
+18 SET NYUK=$PIECE(SRA(200.1),"^",14)
SET SRAO(19)=$SELECT(NYUK=1:"HIST OF TIA'S",NYUK=2:"CVA W/O NEURO DEF",NYUK=3:"CVA W/ NEURO DEF",NYUK=0:"NO CVD",1:"")_"^522"
+19 SET SRAO(20)=$$OUT(267,$PIECE(SRA(206),"^",18))_"^267"
+20 SET SRAO(21)=$$OUT(643,$PIECE(SRA(200),"^",59))_"^643"
+21 SET SRAO(22)=$PIECE(SRA(207),"^",29)_"^423"
+22 SET NYUK=$PIECE(SRA(206),"^",20)
DO YN
SET SRAO(23)=SHEMP_"^353"
+23 SET NYUK=$PIECE(SRA(206),"^",22)
DO YN
SET SRAO(24)=SHEMP_"^355"
+24 SET NYUK=$PIECE(SRA(209),"^",2)
SET SRAO(25)=$SELECT(NYUK="N":"NONE",NYUK="I":"IABP",NYUK="V":"VAD",NYUK="A":"ARTI",NYUK="O":"OTHER",1:"")_"^474"
+25 SET NYUK=$PIECE(SRA(200),"^",57)
DO H641
SET SRAO(26)=SHEMP_"^641"
+26 SET NYUK=$PIECE(SRA(208),"^",19)
DO YN
SET SRAO(27)=SHEMP_"^509"
+27 SET NYUK=$PIECE(SRA(200.1),"^",8)
SET SRAO(28)=$$OUT(237.1,NYUK)_"^237.1"
+28 SET NYUK=$PIECE(SRA(200.1),"^",15)
SET SRAO(29)=$$OUT(667,NYUK)_"^667"
+29 SET SRAO(30)=$PIECE(SRA(210),"^")_"^662"
DISP ; display fields
+1 SET SRPAGE="PAGE: 1"
DO HDR^SROAUTL
+2 WRITE " 1. Height:",?30,$PIECE(SRAO(1),"^"),?42,"17. PAD:",?(79-$LENGTH($PIECE(SRAO(17),"^"))),$PIECE(SRAO(17),"^")
+3 WRITE !," 2. Weight:",?30,$PIECE(SRAO(2),"^"),?42,"18. CVD Repair/Obstruct:",?(79-$LENGTH($PIECE(SRAO(18),"^"))),$EXTRACT($PIECE(SRAO(18),"^"),1,13)
+4 WRITE !," 3. Diabetes - Long Term:",?30,$EXTRACT($PIECE(SRAO(3),"^"),1,10),?42,"19. History of CVD:",?(79-$LENGTH($PIECE(SRAO(19),"^"))),$EXTRACT($PIECE(SRAO(19),"^"),1,15)
+5 WRITE !," 4. Diabetes - 2 Wks Preop:",?30,$EXTRACT($PIECE(SRAO(4),"^"),1,10),?42,"20. Angina Severity:",?(79-$LENGTH($PIECE(SRAO(20),"^"))),$EXTRACT($PIECE(SRAO(20),"^"),1,15)
+6 WRITE !," 5. COPD:",?30,$PIECE(SRAO(5),"^"),?42,"21. Angina Timeframe:",$JUSTIFY($EXTRACT($PIECE(SRAO(21),"^"),1,14),16)
+7 WRITE !," 6. FEV1:",?30,$PIECE(SRAO(6),"^")_$SELECT($PIECE(SRAO(6),"^")="":"",$PIECE(SRAO(6),"^")="NS":"",1:" liters"),?42,"22. Congestive Heart Failure:",?72,$PIECE(SRAO(22),"^")
+8 WRITE !," 7. Cardiomegaly (X-ray):",?30,$PIECE(SRAO(7),"^"),?42,"23. Current Diuretic Use:",?72,$PIECE(SRAO(23),"^")
+9 WRITE !," 8. Tobacco Use:",$JUSTIFY($PIECE(SRAO(8),"^"),25),?42,"24. IV NTG within 48 Hours:",?72,$PIECE(SRAO(24),"^")
+10 WRITE !," 9. Tobacco Use Timeframe: ",$PIECE(SRAO(9),"^"),?42,"25. Preop Circulatory Device: ",$PIECE(SRAO(25),"^")
+11 WRITE !,"10. Positive Drug Screening: ",?30,$PIECE(SRAO(10),"^"),?42,"26. Hypertension:",?(79-$LENGTH($PIECE(SRAO(26),"^"))),($EXTRACT($PIECE(SRAO(26),"^"),1,20))
+12 WRITE !,"11. Active Endocarditis:",?30,$PIECE(SRAO(11),"^"),?42,"27. Preop Atrial Fibrillation:",?72,$PIECE(SRAO(27),"^")
+13 WRITE !,"12. Functional Status: ",$JUSTIFY($PIECE(SRAO(12),"^"),18),?42,"28. Preop Sleep Apnea:",?72,$PIECE(SRAO(28),"^")
+14 WRITE !,"13. PCI: ",$JUSTIFY($PIECE(SRAO(13),"^"),25),?42,"29. Sleep Apnea-Compliance: ",$EXTRACT($PIECE(SRAO(29),"^"),1,10)
+15 WRITE !,"14. Prior MI: "
Begin DoDot:1
+16 IF $LENGTH($PIECE(SRAO(14),"^"))<8
WRITE ?30,$PIECE(SRAO(14),"^")
QUIT
+17 WRITE $JUSTIFY($EXTRACT($PIECE(SRAO(14),"^"),1,23),27)
End DoDot:1
+18 WRITE ?42,"30. Impaired Cognitive Func: ",$PIECE(SRAO(30),"^")
+19 WRITE !,"15. Num Prior Heart Surgeries:",$PIECE(SRAO(15),"^")
+20 WRITE !,"16. Prior Heart Surgery:"
DO H485
+21 WRITE !
FOR MOE=1:1:80
WRITE "-"
+22 QUIT
YN ; store answer
+1 SET SHEMP=$SELECT(NYUK="NS":"NS",NYUK="N":"NO",NYUK="Y":"YES",NYUK="NA":"N/A",1:"")
+2 QUIT
H641 ; store answer
+1 SET SHEMP=$SELECT(NYUK=1:"NO",NYUK=2:"YES WITHOUT MED",NYUK=3:"YES WITH MED",NYUK=4:"UNKNOWN",1:"")
+2 QUIT
H618(Y) SET SHEMP=$SELECT(Y=1:"NOT DONE",Y=2:"NEG RESULT",Y=3:"POS NOT RX",Y=4:"POS RX",1:"")
+1 QUIT $EXTRACT(SHEMP,1,10)
+2 ;
H485 SET SHEMP=""
SET X=$PIECE(SRAO(16),"^")
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",C=6:"UNKNOWN",1:"")
End DoDot:1
+2 SET X=SHEMP
IF $LENGTH(X)<12
WRITE ?30,X
QUIT
+3 WRITE ?25,$PIECE(X,", ",1,4)
IF $PIECE(X,", ",5)
WRITE ",",!,?25,$PIECE(X,", ",5,9)
+4 QUIT
HW(SRSD,SRED,SVTYPE) ; get weight & height from Vitals
+1 NEW GMRVSTR,SRTYPE,SRBCNT,SRBRDT,SRBIEN,SRBDATA,RESULTS
+2 ;SR203;was SRSD_"^"_SRED_"^^"
KILL ^UTILITY($JOB,"GMRVD"),RESULTS
SET GMRVSTR=SVTYPE
SET GMRVSTR(0)=$SELECT(SVTYPE="HT":"0",1: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 ;SR200: return all of RESULTS - but with WT in 1st piece
+10 IF $DATA(RESULTS(SVTYPE))
SET SRI=$ORDER(RESULTS(SVTYPE,0))
QUIT $PIECE(RESULTS(SVTYPE,SRI),"^",3)_U_RESULTS(SVTYPE,SRI)
+11 QUIT ""
OUT(SRFLD,SRY) ; get data in output form
+1 NEW C,Y,Z
+2 SET Y=SRY
SET C=$PIECE(^DD(130,SRFLD,0),"^",2)
if Y'=""
DO Y^DIQ
+3 ;I SRFLD=662 S Y=$S(Y=0:"NO IMPAIRMENT",Y=1:"DOCUMENTED HISTORY",Y=2:"DOCUMENTED&DECLINING",Y=3:"NO STUDY",1:"") Q Y
+4 SET Y=$SELECT(Y="NO STUDY":"NS",Y="N/A":"NA",1:Y)
+5 IF SRFLD=265
SET Y=$SELECT(SRY=1:"NO",SRY=2:"YES-W/O ANGI,REVASC,or AMPUT",SRY=3:"YES-W HX ANGI,REVASC,or AMPUT",SRY=4:"UNKNOWN",1:"")
QUIT Y
+6 IF SRFLD=237.1
SET Y=$EXTRACT(Y,1,7)
+7 QUIT Y