SROAPS1 ;BIR/MAM - PREOP INFO (PAGE 1) ;12/12/07
;;3.0; Surgery ;**38,47,125,153,166**;24 Jun 93;Build 6
;
; Reference to EN1^GMRVUT0 supported by DBIA #1446
;
N I S SRPAGE="PAGE: 1 OF 2" D HDR^SROAUTL,PRE1
W ! F I=1:1:80 W "-"
Q
PRE1 N SRX,Y D HW F I=200,206 S SRA(I)=$G(^SRF(SRTN,I))
S Y=$P(SRA(200),"^"),SRX=402,SRAO(1)=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(206),"^"),SRX=236,SRAO("1A")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(206),"^",2),SRX=237,SRAO("1B")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",2),SRX=346,SRAO("1C")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",3),SRX=202,SRAO("1D")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",4),SRX=246,SRAO("1E")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",6),SRX=325,SRAO("1F")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",7),SRX=238,SRAO("1G")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P($G(^SRF(SRTN,200.1)),"^",2),SRX=492,SRAO("1H")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",9),SRX=241,SRAO(2)=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",10),SRX=204,SRAO("2A")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",11),SRX=203,SRAO("2B")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",12),SRX=326,SRAO("2C")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",13),SRX=244,SRAO(3)=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",15),SRX=212,SRAO("3A")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P($G(^SRF(SRTN,200.1)),"^"),SRX=486,SRAO(4)=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",16),SRX=213,SRAO("4A")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",30),SRX=242,SRAO(5)=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",35),SRX=396,SRAO("5A")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",31),SRX=394,SRAO("5B")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",32),SRX=220,SRAO("5C")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",33),SRX=266,SRAO("5D")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",34),SRX=395,SRAO("5E")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",36),SRX=208,SRAO("5F")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",40),SRX=206,SRAO(6)=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",41),SRX=329,SRAO("6A")=$$OUT(SRX,Y)_"^"_SRX
S Y=$P(SRA(200),"^",42),SRX=330,SRAO("6B")=$$OUT(SRX,Y)_"^"_SRX K SRA
W "1. GENERAL:",?32,$P(SRAO(1),"^"),?41,"4. GASTROINTESTINAL:",?76,$P(SRAO(4),"^")
W !," A. Height:" S Y=$P(SRAO("1A"),"^") W:Y'="NS" ?14,$J($P(Y,"^"),25) W:Y="NS" ?32,Y
W ?43,"A. Esophageal Varices:",?76,$P(SRAO("4A"),"^")
W !," B. Weight:" S Y=$P(SRAO("1B"),"^") W ?($S(Y="NS":19,1:24)),$J(Y,15)
W !," C. Diabetes Mellitus:",?32,$P(SRAO("1C"),"^"),?41,"5. CARDIAC:",?76,$P(SRAO(5),"^")
W !," D. Current Smoker W/I 1 Year:",?32,$P(SRAO("1D"),"^"),?43,"A. CHF Within 1 Month:",?76,$P(SRAO("5A"),"^")
W !," E. ETOH > 2 Drinks/Day:",?32,$P(SRAO("1E"),"^"),?43,"B. MI Within 6 Months:",?76,$P(SRAO("5B"),"^")
W !," F. Dyspnea: ",?14,$J($P(SRAO("1F"),"^"),25),?43,"C. Previous PCI:",?76,$P(SRAO("5C"),"^")
W !," G. DNR Status: ",?32,$P(SRAO("1G"),"^"),?43,"D. Previous Cardiac Surgery:",?76,$P(SRAO("5D"),"^")
W !," H. Preop Funct Status: ",$J($P(SRAO("1H"),"^"),17),?43,"E. Angina Within 1 Month:",?76,$P(SRAO("5E"),"^")
W !,?43,"F. Hypertension Requiring Meds:",?76,$P(SRAO("5F"),"^")
W !,"2. PULMONARY:",?32,$P(SRAO(2),"^")
W !," A. Ventilator Dependent:",?32,$P(SRAO("2A"),"^"),?41,"6. VASCULAR:",?76,$P(SRAO(6),"^")
W !," B. History of Severe COPD:",?32,$P(SRAO("2B"),"^"),?43,"A. Revascularization/Amputation:",?76,$P(SRAO("6A"),"^")
W !," C. Current Pneumonia:",?32,$P(SRAO("2C"),"^"),?43,"B. Rest Pain/Gangrene:",?76,$P(SRAO("6B"),"^")
W !!,"3. HEPATOBILIARY:",?32,$P(SRAO(3),"^"),!," A. Ascites:",?32,$P(SRAO("3A"),"^")
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 Y="NO STUDY" S Y="NS"
I SRFLD=237!(SRFLD=346) S Y=$E(Y,1,15)
I SRFLD=236 S Z=$P($G(^SRF(SRTN,200.1)),"^",7) I Z'="" S Y="("_$E(Z,4,5)_"/"_$E(Z,6,7)_"/"_$E(Z,2,3)_") "_Y
I SRFLD=492 D
.I SRY=2 S Y="PARTIAL DEPENDENT" Q
.I SRY=1 S Y=Y_" " Q
.I SRY=4 S Y=Y_" "
I SRFLD=325,$L(Y)=2 S Y=Y_" "
Q Y
HW ; get weight & height from Vitals
N SREND,SREQ,SREX,SREY,SRSTRT
WT I $P($G(^SRF(SRTN,206)),"^",2)="" D
.S SREND=$P($G(^SRF(SRTN,0)),"^",9),SRSTRT=$$FMADD^XLFDT(SREND,-30),SREX=$$HW^SROACL1(SRSTRT,SREND,"WT")
.I SREX'="" S SREX=SREX+.5\1 D CHK^DIE(130,237,"E",SREX,.SREY) I SREY'="^" S $P(^SRF(SRTN,206),"^",2)=SREY
HT I $P($G(^SRF(SRTN,206)),"^")'="" Q
N GMRVSTR,SRBRDT,SRBIEN,SRBDATA,SRHTDT
K ^UTILITY($J,"GMRVD"),RESULTS S SREND=$P($G(^SRF(SRTN,0)),"^",9),GMRVSTR="HT",GMRVSTR(0)="^"_SREND_"^^0"
D EN1^GMRVUT0 Q:'$D(^UTILITY($J,"GMRVD"))
S SRBRDT="",SRBRDT=$O(^UTILITY($J,"GMRVD","HT",SRBRDT)) Q:'SRBRDT D
.S SRBIEN=0 F S SRBIEN=$O(^UTILITY($J,"GMRVD","HT",SRBRDT,SRBIEN)) Q:'SRBIEN D
..S SRBDATA=$G(^UTILITY($J,"GMRVD","HT",SRBRDT,SRBIEN)),SREX=$P(SRBDATA,"^",8)
..I SREX'="" S SREX=SREX+.5\1 D CHK^DIE(130,236,"E",SREX,.SREY) I SREY'="^" D
...S $P(^SRF(SRTN,206),"^")=SREY
...S SRHTDT=$P(SRBDATA,"^") I SRHTDT'="" S $P(^SRF(SRTN,200.1),"^",7)=SRHTDT
Q
SROAPS1 ;BIR/MAM - PREOP INFO (PAGE 1) ;12/12/07
+1 ;;3.0; Surgery ;**38,47,125,153,166**;24 Jun 93;Build 6
+2 ;
+3 ; Reference to EN1^GMRVUT0 supported by DBIA #1446
+4 ;
+5 NEW I
SET SRPAGE="PAGE: 1 OF 2"
DO HDR^SROAUTL
DO PRE1
+6 WRITE !
FOR I=1:1:80
WRITE "-"
+7 QUIT
PRE1 NEW SRX,Y
DO HW
FOR I=200,206
SET SRA(I)=$GET(^SRF(SRTN,I))
+1 SET Y=$PIECE(SRA(200),"^")
SET SRX=402
SET SRAO(1)=$$OUT(SRX,Y)_"^"_SRX
+2 SET Y=$PIECE(SRA(206),"^")
SET SRX=236
SET SRAO("1A")=$$OUT(SRX,Y)_"^"_SRX
+3 SET Y=$PIECE(SRA(206),"^",2)
SET SRX=237
SET SRAO("1B")=$$OUT(SRX,Y)_"^"_SRX
+4 SET Y=$PIECE(SRA(200),"^",2)
SET SRX=346
SET SRAO("1C")=$$OUT(SRX,Y)_"^"_SRX
+5 SET Y=$PIECE(SRA(200),"^",3)
SET SRX=202
SET SRAO("1D")=$$OUT(SRX,Y)_"^"_SRX
+6 SET Y=$PIECE(SRA(200),"^",4)
SET SRX=246
SET SRAO("1E")=$$OUT(SRX,Y)_"^"_SRX
+7 SET Y=$PIECE(SRA(200),"^",6)
SET SRX=325
SET SRAO("1F")=$$OUT(SRX,Y)_"^"_SRX
+8 SET Y=$PIECE(SRA(200),"^",7)
SET SRX=238
SET SRAO("1G")=$$OUT(SRX,Y)_"^"_SRX
+9 SET Y=$PIECE($GET(^SRF(SRTN,200.1)),"^",2)
SET SRX=492
SET SRAO("1H")=$$OUT(SRX,Y)_"^"_SRX
+10 SET Y=$PIECE(SRA(200),"^",9)
SET SRX=241
SET SRAO(2)=$$OUT(SRX,Y)_"^"_SRX
+11 SET Y=$PIECE(SRA(200),"^",10)
SET SRX=204
SET SRAO("2A")=$$OUT(SRX,Y)_"^"_SRX
+12 SET Y=$PIECE(SRA(200),"^",11)
SET SRX=203
SET SRAO("2B")=$$OUT(SRX,Y)_"^"_SRX
+13 SET Y=$PIECE(SRA(200),"^",12)
SET SRX=326
SET SRAO("2C")=$$OUT(SRX,Y)_"^"_SRX
+14 SET Y=$PIECE(SRA(200),"^",13)
SET SRX=244
SET SRAO(3)=$$OUT(SRX,Y)_"^"_SRX
+15 SET Y=$PIECE(SRA(200),"^",15)
SET SRX=212
SET SRAO("3A")=$$OUT(SRX,Y)_"^"_SRX
+16 SET Y=$PIECE($GET(^SRF(SRTN,200.1)),"^")
SET SRX=486
SET SRAO(4)=$$OUT(SRX,Y)_"^"_SRX
+17 SET Y=$PIECE(SRA(200),"^",16)
SET SRX=213
SET SRAO("4A")=$$OUT(SRX,Y)_"^"_SRX
+18 SET Y=$PIECE(SRA(200),"^",30)
SET SRX=242
SET SRAO(5)=$$OUT(SRX,Y)_"^"_SRX
+19 SET Y=$PIECE(SRA(200),"^",35)
SET SRX=396
SET SRAO("5A")=$$OUT(SRX,Y)_"^"_SRX
+20 SET Y=$PIECE(SRA(200),"^",31)
SET SRX=394
SET SRAO("5B")=$$OUT(SRX,Y)_"^"_SRX
+21 SET Y=$PIECE(SRA(200),"^",32)
SET SRX=220
SET SRAO("5C")=$$OUT(SRX,Y)_"^"_SRX
+22 SET Y=$PIECE(SRA(200),"^",33)
SET SRX=266
SET SRAO("5D")=$$OUT(SRX,Y)_"^"_SRX
+23 SET Y=$PIECE(SRA(200),"^",34)
SET SRX=395
SET SRAO("5E")=$$OUT(SRX,Y)_"^"_SRX
+24 SET Y=$PIECE(SRA(200),"^",36)
SET SRX=208
SET SRAO("5F")=$$OUT(SRX,Y)_"^"_SRX
+25 SET Y=$PIECE(SRA(200),"^",40)
SET SRX=206
SET SRAO(6)=$$OUT(SRX,Y)_"^"_SRX
+26 SET Y=$PIECE(SRA(200),"^",41)
SET SRX=329
SET SRAO("6A")=$$OUT(SRX,Y)_"^"_SRX
+27 SET Y=$PIECE(SRA(200),"^",42)
SET SRX=330
SET SRAO("6B")=$$OUT(SRX,Y)_"^"_SRX
KILL SRA
+28 WRITE "1. GENERAL:",?32,$PIECE(SRAO(1),"^"),?41,"4. GASTROINTESTINAL:",?76,$PIECE(SRAO(4),"^")
+29 WRITE !," A. Height:"
SET Y=$PIECE(SRAO("1A"),"^")
IF Y'="NS"
WRITE ?14,$JUSTIFY($PIECE(Y,"^"),25)
IF Y="NS"
WRITE ?32,Y
+30 WRITE ?43,"A. Esophageal Varices:",?76,$PIECE(SRAO("4A"),"^")
+31 WRITE !," B. Weight:"
SET Y=$PIECE(SRAO("1B"),"^")
WRITE ?($SELECT(Y="NS":19,1:24)),$JUSTIFY(Y,15)
+32 WRITE !," C. Diabetes Mellitus:",?32,$PIECE(SRAO("1C"),"^"),?41,"5. CARDIAC:",?76,$PIECE(SRAO(5),"^")
+33 WRITE !," D. Current Smoker W/I 1 Year:",?32,$PIECE(SRAO("1D"),"^"),?43,"A. CHF Within 1 Month:",?76,$PIECE(SRAO("5A"),"^")
+34 WRITE !," E. ETOH > 2 Drinks/Day:",?32,$PIECE(SRAO("1E"),"^"),?43,"B. MI Within 6 Months:",?76,$PIECE(SRAO("5B"),"^")
+35 WRITE !," F. Dyspnea: ",?14,$JUSTIFY($PIECE(SRAO("1F"),"^"),25),?43,"C. Previous PCI:",?76,$PIECE(SRAO("5C"),"^")
+36 WRITE !," G. DNR Status: ",?32,$PIECE(SRAO("1G"),"^"),?43,"D. Previous Cardiac Surgery:",?76,$PIECE(SRAO("5D"),"^")
+37 WRITE !," H. Preop Funct Status: ",$JUSTIFY($PIECE(SRAO("1H"),"^"),17),?43,"E. Angina Within 1 Month:",?76,$PIECE(SRAO("5E"),"^")
+38 WRITE !,?43,"F. Hypertension Requiring Meds:",?76,$PIECE(SRAO("5F"),"^")
+39 WRITE !,"2. PULMONARY:",?32,$PIECE(SRAO(2),"^")
+40 WRITE !," A. Ventilator Dependent:",?32,$PIECE(SRAO("2A"),"^"),?41,"6. VASCULAR:",?76,$PIECE(SRAO(6),"^")
+41 WRITE !," B. History of Severe COPD:",?32,$PIECE(SRAO("2B"),"^"),?43,"A. Revascularization/Amputation:",?76,$PIECE(SRAO("6A"),"^")
+42 WRITE !," C. Current Pneumonia:",?32,$PIECE(SRAO("2C"),"^"),?43,"B. Rest Pain/Gangrene:",?76,$PIECE(SRAO("6B"),"^")
+43 WRITE !!,"3. HEPATOBILIARY:",?32,$PIECE(SRAO(3),"^"),!," A. Ascites:",?32,$PIECE(SRAO("3A"),"^")
+44 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 IF Y="NO STUDY"
SET Y="NS"
+4 IF SRFLD=237!(SRFLD=346)
SET Y=$EXTRACT(Y,1,15)
+5 IF SRFLD=236
SET Z=$PIECE($GET(^SRF(SRTN,200.1)),"^",7)
IF Z'=""
SET Y="("_$EXTRACT(Z,4,5)_"/"_$EXTRACT(Z,6,7)_"/"_$EXTRACT(Z,2,3)_") "_Y
+6 IF SRFLD=492
Begin DoDot:1
+7 IF SRY=2
SET Y="PARTIAL DEPENDENT"
QUIT
+8 IF SRY=1
SET Y=Y_" "
QUIT
+9 IF SRY=4
SET Y=Y_" "
End DoDot:1
+10 IF SRFLD=325
IF $LENGTH(Y)=2
SET Y=Y_" "
+11 QUIT Y
HW ; get weight & height from Vitals
+1 NEW SREND,SREQ,SREX,SREY,SRSTRT
WT IF $PIECE($GET(^SRF(SRTN,206)),"^",2)=""
Begin DoDot:1
+1 SET SREND=$PIECE($GET(^SRF(SRTN,0)),"^",9)
SET SRSTRT=$$FMADD^XLFDT(SREND,-30)
SET SREX=$$HW^SROACL1(SRSTRT,SREND,"WT")
+2 IF SREX'=""
SET SREX=SREX+.5\1
DO CHK^DIE(130,237,"E",SREX,.SREY)
IF SREY'="^"
SET $PIECE(^SRF(SRTN,206),"^",2)=SREY
End DoDot:1
HT IF $PIECE($GET(^SRF(SRTN,206)),"^")'=""
QUIT
+1 NEW GMRVSTR,SRBRDT,SRBIEN,SRBDATA,SRHTDT
+2 KILL ^UTILITY($JOB,"GMRVD"),RESULTS
SET SREND=$PIECE($GET(^SRF(SRTN,0)),"^",9)
SET GMRVSTR="HT"
SET GMRVSTR(0)="^"_SREND_"^^0"
+3 DO EN1^GMRVUT0
IF '$DATA(^UTILITY($JOB,"GMRVD"))
QUIT
+4 SET SRBRDT=""
SET SRBRDT=$ORDER(^UTILITY($JOB,"GMRVD","HT",SRBRDT))
IF 'SRBRDT
QUIT
Begin DoDot:1
+5 SET SRBIEN=0
FOR
SET SRBIEN=$ORDER(^UTILITY($JOB,"GMRVD","HT",SRBRDT,SRBIEN))
IF 'SRBIEN
QUIT
Begin DoDot:2
+6 SET SRBDATA=$GET(^UTILITY($JOB,"GMRVD","HT",SRBRDT,SRBIEN))
SET SREX=$PIECE(SRBDATA,"^",8)
+7 IF SREX'=""
SET SREX=SREX+.5\1
DO CHK^DIE(130,236,"E",SREX,.SREY)
IF SREY'="^"
Begin DoDot:3
+8 SET $PIECE(^SRF(SRTN,206),"^")=SREY
+9 SET SRHTDT=$PIECE(SRBDATA,"^")
IF SRHTDT'=""
SET $PIECE(^SRF(SRTN,200.1),"^",7)=SRHTDT
End DoDot:3
End DoDot:2
End DoDot:1
+10 QUIT