SROCANUP ;B'HAM ISC/ADM - UPDATE CANCELLED CASE ; 26 MAY 1992 2:10 PM [ 03/07/97 12:00 PM ]
;;3.0; Surgery ;**63**;24 Jun 93
S SRSOUT=0 K DIC W @IOF,!,"Update Cancelled Case",!!
PAT S DIC("A")="Select Patient: ",DIC=2,DIC(0)="QEAM" D ^DIC I Y<0 S SRSOUT=1 G END
S DFN=+Y D DEM^VADPT D HDR
W ! S (SRDT,CNT)=0 F S SRDT=$O(^SRF("ADT",DFN,SRDT)) Q:'SRDT!(SRSOUT) S SROP=0 F S SROP=$O(^SRF("ADT",DFN,SRDT,SROP)) Q:'SROP!($D(SRTN))!(SRSOUT) D LIST
Q:$D(SRTN)!SRSOUT
I 'CNT W !!,"No cancelled cases exist on this patient.",!! K DFN G PAT
OPT W !!!,"Select Operation: " R X:DTIME I '$T!("^"[X) S SRSOUT=1 G END
I '$D(SRCASE(X)) W !!,"Enter the number of the desired operation." G OPT
S SRTN=+SRCASE(X)
Q
LIST ; list cases
I $P($G(^SRF(SROP,30)),"^")="" Q
I $P($G(^SRF(SROP,.2)),"^")!($P($G(^SRF(SROP,.2)),"^",10)) Q
I $Y+5>IOSL S SRBACK=0 D SEL^SROPER Q:$D(SRTN)!(SRSOUT) D:'SRBACK HDR I SRBACK S CNT=0,SROP=SRCASE(1)-1,SRDT=$P(SRCASE(1),"^",2) W @IOF,!,?1,VADM(1)_" "_VA("PID"),! Q
S CNT=CNT+1,SRSDATE=$P(^SRF(SROP,0),"^",9)
W !,CNT_". "
CASE W $E(SRSDATE,4,5)_"-"_$E(SRSDATE,6,7)_"-"_$E(SRSDATE,2,3)
S SROPER=$P(^SRF(SROP,"OP"),"^") I $O(^SRF(SROP,13,0)) S SROTHER=0 F I=0:0 S SROTHER=$O(^SRF(SROP,13,SROTHER)) Q:'SROTHER D OTHER
D ^SROP1 K SROPS,MM,MMM S:$L(SROPER)<65 SROPS(1)=SROPER I $L(SROPER)>64 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
W ?14,SROPS(1) I $D(SROPS(2)) W !,?14,SROPS(2) I $D(SROPS(3)) W !,?14,SROPS(3) W:$D(SROPS(4)) !,?14,SROPS(4)
W ! S SRCASE(CNT)=SROP_"^"_SRDT
Q
OTHER ; other operations
S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SROP,13,SROTHER,0),"^"))>235 S SRLONG=0,SROTHER=999,SROPERS=" ..."
I SRLONG S SROPERS=$P(^SRF(SROP,13,SROTHER,0),"^")
S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
Q
LOOP ; break procedures
S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<65 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
Q
END K SRTN D ^SRSKILL W @IOF
Q
RT ; start RT logging
I $D(XRTL) S XRTN="SROP" D T0^%ZOSV
Q
HDR ; print heading
W @IOF,!,?1,VADM(1)_" "_VA("PID"),!
Q
SROCANUP ;B'HAM ISC/ADM - UPDATE CANCELLED CASE ; 26 MAY 1992 2:10 PM [ 03/07/97 12:00 PM ]
+1 ;;3.0; Surgery ;**63**;24 Jun 93
+2 SET SRSOUT=0
KILL DIC
WRITE @IOF,!,"Update Cancelled Case",!!
PAT SET DIC("A")="Select Patient: "
SET DIC=2
SET DIC(0)="QEAM"
DO ^DIC
IF Y<0
SET SRSOUT=1
GOTO END
+1 SET DFN=+Y
DO DEM^VADPT
DO HDR
+2 WRITE !
SET (SRDT,CNT)=0
FOR
SET SRDT=$ORDER(^SRF("ADT",DFN,SRDT))
IF 'SRDT!(SRSOUT)
QUIT
SET SROP=0
FOR
SET SROP=$ORDER(^SRF("ADT",DFN,SRDT,SROP))
IF 'SROP!($DATA(SRTN))!(SRSOUT)
QUIT
DO LIST
+3 IF $DATA(SRTN)!SRSOUT
QUIT
+4 IF 'CNT
WRITE !!,"No cancelled cases exist on this patient.",!!
KILL DFN
GOTO PAT
OPT WRITE !!!,"Select Operation: "
READ X:DTIME
IF '$TEST!("^"[X)
SET SRSOUT=1
GOTO END
+1 IF '$DATA(SRCASE(X))
WRITE !!,"Enter the number of the desired operation."
GOTO OPT
+2 SET SRTN=+SRCASE(X)
+3 QUIT
LIST ; list cases
+1 IF $PIECE($GET(^SRF(SROP,30)),"^")=""
QUIT
+2 IF $PIECE($GET(^SRF(SROP,.2)),"^")!($PIECE($GET(^SRF(SROP,.2)),"^",10))
QUIT
+3 IF $Y+5>IOSL
SET SRBACK=0
DO SEL^SROPER
IF $DATA(SRTN)!(SRSOUT)
QUIT
IF 'SRBACK
DO HDR
IF SRBACK
SET CNT=0
SET SROP=SRCASE(1)-1
SET SRDT=$PIECE(SRCASE(1),"^",2)
WRITE @IOF,!,?1,VADM(1)_" "_VA("PID"),!
QUIT
+4 SET CNT=CNT+1
SET SRSDATE=$PIECE(^SRF(SROP,0),"^",9)
+5 WRITE !,CNT_". "
CASE WRITE $EXTRACT(SRSDATE,4,5)_"-"_$EXTRACT(SRSDATE,6,7)_"-"_$EXTRACT(SRSDATE,2,3)
+1 SET SROPER=$PIECE(^SRF(SROP,"OP"),"^")
IF $ORDER(^SRF(SROP,13,0))
SET SROTHER=0
FOR I=0:0
SET SROTHER=$ORDER(^SRF(SROP,13,SROTHER))
IF 'SROTHER
QUIT
DO OTHER
+2 DO ^SROP1
KILL SROPS,MM,MMM
IF $LENGTH(SROPER)<65
SET SROPS(1)=SROPER
IF $LENGTH(SROPER)>64
SET SROPER=SROPER_" "
FOR M=1:1
DO LOOP
IF MMM=""
QUIT
+3 WRITE ?14,SROPS(1)
IF $DATA(SROPS(2))
WRITE !,?14,SROPS(2)
IF $DATA(SROPS(3))
WRITE !,?14,SROPS(3)
IF $DATA(SROPS(4))
WRITE !,?14,SROPS(4)
+4 WRITE !
SET SRCASE(CNT)=SROP_"^"_SRDT
+5 QUIT
OTHER ; other operations
+1 SET SRLONG=1
IF $LENGTH(SROPER)+$LENGTH($PIECE(^SRF(SROP,13,SROTHER,0),"^"))>235
SET SRLONG=0
SET SROTHER=999
SET SROPERS=" ..."
+2 IF SRLONG
SET SROPERS=$PIECE(^SRF(SROP,13,SROTHER,0),"^")
+3 SET SROPER=SROPER_$SELECT(SROPERS=" ...":SROPERS,1:", "_SROPERS)
+4 QUIT
LOOP ; break procedures
+1 SET SROPS(M)=""
FOR LOOP=1:1
SET MM=$PIECE(SROPER," ")
SET MMM=$PIECE(SROPER," ",2,200)
IF MMM=""
QUIT
IF $LENGTH(SROPS(M))+$LENGTH(MM)'<65
QUIT
SET SROPS(M)=SROPS(M)_MM_" "
SET SROPER=MMM
+2 QUIT
END KILL SRTN
DO ^SRSKILL
WRITE @IOF
+1 QUIT
RT ; start RT logging
+1 IF $DATA(XRTL)
SET XRTN="SROP"
DO T0^%ZOSV
+2 QUIT
HDR ; print heading
+1 WRITE @IOF,!,?1,VADM(1)_" "_VA("PID"),!
+2 QUIT