VistA-WorldVistAEHR/r/SURGERY-SR/SRSCG.m

15 lines
986 B
Mathematica

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