SROACAR ;BIR/MAM - OPEATIVE DATA ;12/03/07
;;3.0; Surgery ;**38,71,93,95,100,125,142,153,166**;24 Jun 93;Build 6
I '$D(SRTN) W !!,"A Surgery Risk Assessment must be selected prior to using this option.",!!,"Press <RET> to continue " R X:DTIME G END
S SRACLR=0,SRSOUT=0,SRSUPCPT=1 D ^SROAUTL
START D:SRACLR RET G:SRSOUT END S SRACLR=0 K SRA,SRAO D ^SROACR1
ASK W !,"Select Cardiac Procedures Operative Information to Edit: " R X:DTIME I '$T!("^"[X) G END
S X=$S(X="a":"A",X="n":"N",1:X) I '$D(SRAO(X)),(X'?.N1":".N),(X'="A"),(X'="N") D HELP G:SRSOUT END G START
I X="A" S X="1:22"
I X?.N1":".N S Y=$E(X),Z=$P(X,":",2) I Y<1!(Z>22)!(Y>Z) D HELP G:SRSOUT END G START
I X="N" D G:SRSOUT END G START
.W ! K DIR S DIR(0)="Y",DIR("B")="NO",DIR("A")="Are you sure you want to set all fields on this page to NO"
.D ^DIR I $D(DTOUT)!$D(DUOUT) S SRSOUT=1 Q
.I Y D NO2ALL
D HDR^SROAUTL
I X?.N1":".N D RANGE G START
I $D(SRAO(X)),+X=X S EMILY=X D G START
.I $$LOCK^SROUTL(SRTN) W ! D ONE,UNLOCK^SROUTL(SRTN)
I $D(SRAO(X)) W ! S EMILY=X D G START
.I $$LOCK^SROUTL(SRTN) D ONE,UNLOCK^SROUTL(SRTN)
END I 'SRSOUT D ^SROACR2
W @IOF D ^SRSKILL
Q
HELP W @IOF,!!!!,"Enter the number or range of numbers you want to edit. Examples of proper",!,"responses are listed below."
W !!,"1. Enter 'A' to update all information.",!!,"2. Enter 'N' to set all fields on this page to NO."
W !!,"3. Enter a number (1-22) to update the information in that field. (For",!," example, enter '9' to update Valve Repair.)"
W !!,"4. Enter a range of numbers (1-22) separated by a ':' to enter a range of",!," information. (For example, enter '6:8' to enter Aortic Valve",!," Replacement, Mitral Valve Replacement, and Tricuspid Valve Replacement.)"
D RET
Q
RANGE ; range of numbers
I $$LOCK^SROUTL(SRTN) D D UNLOCK^SROUTL(SRTN)
.W ! S SHEMP=$P(X,":"),CURLEY=$P(X,":",2) F EMILY=SHEMP:1:CURLEY Q:SRSOUT D ONE
Q
ONE ; edit one item
;I EMILY=16 D MIS^SROACR1 Q
I EMILY=22 D OPS Q
K DR,DIE S DA=SRTN,DR=$P(SRAO(EMILY),"^",2)_"T",DIE=130 D ^DIE K DR I $D(Y) S SRSOUT=1
I 'SRSOUT,EMILY=12!(EMILY=13) D OK
Q
NO2ALL ; set all fields to NO
N II K DR,DIE S DA=SRTN,DIE=130
F II=367,368,369,371,481,483,376,380,378,377,379,373,372,505,502 S DR=$S($D(DR):DR_";",1:"")_II_"////N"
F II=365,366,464,465,416 S DR=DR_";"_II_"////0"
S DR=DR_";"_370_"////5"_";"_512_"////N"
D ^DIE K DR
Q
OK N SRISCH,SRCPB S X=$G(^SRF(SRTN,206)),SRISCH=$P(X,"^",36),SRCPB=$P(X,"^",37)
I SRISCH,SRCPB,SRISCH>SRCPB W !!," *** NOTE: Ischemic Time is greater than CPB Time!! Please check. ***",! D RET W !
Q
RET Q:SRSOUT W ! K DIR S DIR(0)="E" D ^DIR K DIR I $D(DTOUT)!$D(DUOUT) S SRSOUT=1
Q
OPS ; enter other cardiac procedures, specify
S DIE=130,DA=SRTN,DR="502T" D ^DIE K DR Q:$D(Y)
I X'="Y" K ^SRF(SRTN,209.1) Q
S DIE=130,DA=SRTN,DR="484T" D ^DIE K DR
Q
SROACAR ;BIR/MAM - OPEATIVE DATA ;12/03/07
+1 ;;3.0; Surgery ;**38,71,93,95,100,125,142,153,166**;24 Jun 93;Build 6
+2 IF '$DATA(SRTN)
WRITE !!,"A Surgery Risk Assessment must be selected prior to using this option.",!!,"Press <RET> to continue "
READ X:DTIME
GOTO END
+3 SET SRACLR=0
SET SRSOUT=0
SET SRSUPCPT=1
DO ^SROAUTL
START IF SRACLR
DO RET
IF SRSOUT
GOTO END
SET SRACLR=0
KILL SRA,SRAO
DO ^SROACR1
ASK WRITE !,"Select Cardiac Procedures Operative Information to Edit: "
READ X:DTIME
IF '$TEST!("^"[X)
GOTO END
+1 SET X=$SELECT(X="a":"A",X="n":"N",1:X)
IF '$DATA(SRAO(X))
IF (X'?.N1":".N)
IF (X'="A")
IF (X'="N")
DO HELP
IF SRSOUT
GOTO END
GOTO START
+2 IF X="A"
SET X="1:22"
+3 IF X?.N1":".N
SET Y=$EXTRACT(X)
SET Z=$PIECE(X,":",2)
IF Y<1!(Z>22)!(Y>Z)
DO HELP
IF SRSOUT
GOTO END
GOTO START
+4 IF X="N"
Begin DoDot:1
+5 WRITE !
KILL DIR
SET DIR(0)="Y"
SET DIR("B")="NO"
SET DIR("A")="Are you sure you want to set all fields on this page to NO"
+6 DO ^DIR
IF $DATA(DTOUT)!$DATA(DUOUT)
SET SRSOUT=1
QUIT
+7 IF Y
DO NO2ALL
End DoDot:1
IF SRSOUT
GOTO END
GOTO START
+8 DO HDR^SROAUTL
+9 IF X?.N1":".N
DO RANGE
GOTO START
+10 IF $DATA(SRAO(X))
IF +X=X
SET EMILY=X
Begin DoDot:1
+11 IF $$LOCK^SROUTL(SRTN)
WRITE !
DO ONE
DO UNLOCK^SROUTL(SRTN)
End DoDot:1
GOTO START
+12 IF $DATA(SRAO(X))
WRITE !
SET EMILY=X
Begin DoDot:1
+13 IF $$LOCK^SROUTL(SRTN)
DO ONE
DO UNLOCK^SROUTL(SRTN)
End DoDot:1
GOTO START
END IF 'SRSOUT
DO ^SROACR2
+1 WRITE @IOF
DO ^SRSKILL
+2 QUIT
HELP WRITE @IOF,!!!!,"Enter the number or range of numbers you want to edit. Examples of proper",!,"responses are listed below."
+1 WRITE !!,"1. Enter 'A' to update all information.",!!,"2. Enter 'N' to set all fields on this page to NO."
+2 WRITE !!,"3. Enter a number (1-22) to update the information in that field. (For",!," example, enter '9' to update Valve Repair.)"
+3 WRITE !!,"4. Enter a range of numbers (1-22) separated by a ':' to enter a range of",!," information. (For example, enter '6:8' to enter Aortic Valve",!," Replacement, Mitral Valve Replacement, and Tricuspid Valve Replacement.)"
+4 DO RET
+5 QUIT
RANGE ; range of numbers
+1 IF $$LOCK^SROUTL(SRTN)
Begin DoDot:1
+2 WRITE !
SET SHEMP=$PIECE(X,":")
SET CURLEY=$PIECE(X,":",2)
FOR EMILY=SHEMP:1:CURLEY
IF SRSOUT
QUIT
DO ONE
End DoDot:1
DO UNLOCK^SROUTL(SRTN)
+3 QUIT
ONE ; edit one item
+1 ;I EMILY=16 D MIS^SROACR1 Q
+2 IF EMILY=22
DO OPS
QUIT
+3 KILL DR,DIE
SET DA=SRTN
SET DR=$PIECE(SRAO(EMILY),"^",2)_"T"
SET DIE=130
DO ^DIE
KILL DR
IF $DATA(Y)
SET SRSOUT=1
+4 IF 'SRSOUT
IF EMILY=12!(EMILY=13)
DO OK
+5 QUIT
NO2ALL ; set all fields to NO
+1 NEW II
KILL DR,DIE
SET DA=SRTN
SET DIE=130
+2 FOR II=367,368,369,371,481,483,376,380,378,377,379,373,372,505,502
SET DR=$SELECT($DATA(DR):DR_";",1:"")_II_"////N"
+3 FOR II=365,366,464,465,416
SET DR=DR_";"_II_"////0"
+4 SET DR=DR_";"_370_"////5"_";"_512_"////N"
+5 DO ^DIE
KILL DR
+6 QUIT
OK NEW SRISCH,SRCPB
SET X=$GET(^SRF(SRTN,206))
SET SRISCH=$PIECE(X,"^",36)
SET SRCPB=$PIECE(X,"^",37)
+1 IF SRISCH
IF SRCPB
IF SRISCH>SRCPB
WRITE !!," *** NOTE: Ischemic Time is greater than CPB Time!! Please check. ***",!
DO RET
WRITE !
+2 QUIT
RET IF SRSOUT
QUIT
WRITE !
KILL DIR
SET DIR(0)="E"
DO ^DIR
KILL DIR
IF $DATA(DTOUT)!$DATA(DUOUT)
SET SRSOUT=1
+1 QUIT
OPS ; enter other cardiac procedures, specify
+1 SET DIE=130
SET DA=SRTN
SET DR="502T"
DO ^DIE
KILL DR
IF $DATA(Y)
QUIT
+2 IF X'="Y"
KILL ^SRF(SRTN,209.1)
QUIT
+3 SET DIE=130
SET DA=SRTN
SET DR="484T"
DO ^DIE
KILL DR
+4 QUIT