SRSCG ;B'HAM ISC/MAM - CANCEL GRAPH ; 10 DEC 10:00 AM
;;3.0; Surgery ;**7,42**;24 Jun 93
Q:'$G(SRSOR) S SRDAT=SRSDATE,X=$J($P(SRSDT1,".",2)_"0000",4),Y=$J($P(SRSDT2,".",2)_"0000",4)
S START=$E(X,1,2)_"."_$E(X,3,4),END=$E(Y,1,2)_"."_$E(Y,3,4),(SRSTIME,SRT)=START_"^"_END
I $E(SRSDT2,1,7)>($E(SRSDT1,1,7)) S $P(SRSTIME,"^",2)="24.00"
GRPH S SRSST=$P(SRSTIME,"^"),SRSET=$P(SRSTIME,"^",2)
S SRS1=11+($P(SRSST,".")*5)+(SRSST-$P(SRSST,".")*100\15),SRS2=11+($P(SRSET,".")*5)+(SRSET-$P(SRSET,".")*100\15),S="" F I=SRS1:1:SRS2-1 S S=S_$S('(I#5):"|",1:"_")
I '$D(^SRS(SRSOR,"S",SRSDATE))!'$D(^SRS(SRSOR,"SS",SRSDATE)) S SROR=SRSOR D GRAPH^SRSDISP
S X0=^SRS(SRSOR,"SS",SRSDATE,1),X1=^SRS(SRSOR,"S",SRSDATE,1),(^(1),X1)=$E(X1,1,SRS1)_S_$E(X1,SRS2+1,200),^SRS(SRSOR,"S",SRSDATE,0)=SRSDATE
F I=SRS1:1:SRS2+1 I "X="'[$E(X1,I) S X1=$E(X1,1,I-1)_$E(X0,I)_$E(X1,I+1,200)
S ^SRS(SRSOR,"S",SRSDATE,1)=X1
I SRSEDT'=SRSDATE S SRSTIME="00.00^"_END,SRSDATE=SRSEDT G GRPH
S SRSDATE=SRDAT K SRDAT
Q
SRSCG ;B'HAM ISC/MAM - CANCEL GRAPH ; 10 DEC 10:00 AM
+1 ;;3.0; Surgery ;**7,42**;24 Jun 93
+2 IF '$GET(SRSOR)
QUIT
SET SRDAT=SRSDATE
SET X=$JUSTIFY($PIECE(SRSDT1,".",2)_"0000",4)
SET Y=$JUSTIFY($PIECE(SRSDT2,".",2)_"0000",4)
+3 SET START=$EXTRACT(X,1,2)_"."_$EXTRACT(X,3,4)
SET END=$EXTRACT(Y,1,2)_"."_$EXTRACT(Y,3,4)
SET (SRSTIME,SRT)=START_"^"_END
+4 IF $EXTRACT(SRSDT2,1,7)>($EXTRACT(SRSDT1,1,7))
SET $PIECE(SRSTIME,"^",2)="24.00"
GRPH SET SRSST=$PIECE(SRSTIME,"^")
SET SRSET=$PIECE(SRSTIME,"^",2)
+1 SET SRS1=11+($PIECE(SRSST,".")*5)+(SRSST-$PIECE(SRSST,".")*100\15)
SET SRS2=11+($PIECE(SRSET,".")*5)+(SRSET-$PIECE(SRSET,".")*100\15)
SET S=""
FOR I=SRS1:1:SRS2-1
SET S=S_$SELECT('(I#5):"|",1:"_")
+2 IF '$DATA(^SRS(SRSOR,"S",SRSDATE))!'$DATA(^SRS(SRSOR,"SS",SRSDATE))
SET SROR=SRSOR
DO GRAPH^SRSDISP
+3 SET X0=^SRS(SRSOR,"SS",SRSDATE,1)
SET X1=^SRS(SRSOR,"S",SRSDATE,1)
SET (^(1),X1)=$EXTRACT(X1,1,SRS1)_S_$EXTRACT(X1,SRS2+1,200)
SET ^SRS(SRSOR,"S",SRSDATE,0)=SRSDATE
+4 FOR I=SRS1:1:SRS2+1
IF "X="'[$EXTRACT(X1,I)
SET X1=$EXTRACT(X1,1,I-1)_$EXTRACT(X0,I)_$EXTRACT(X1,I+1,200)
+5 SET ^SRS(SRSOR,"S",SRSDATE,1)=X1
+6 IF SRSEDT'=SRSDATE
SET SRSTIME="00.00^"_END
SET SRSDATE=SRSEDT
GOTO GRPH
+7 SET SRSDATE=SRDAT
KILL SRDAT
+8 QUIT