source: FOIAVistA/trunk/r/SURGERY-SR/SRSCAN1.m@ 1397

Last change on this file since 1397 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.6 KB
Line 
1SRSCAN1 ;B'HAM ISC/MAM - CANCEL SCHEDULED OPERATION; 06/24/88 11:20
2 ;;3.0; Surgery ;;24 Jun 93
3 S S(0)=^SRF(SRTN,0),S(31)=^SRF(SRTN,31),SRSDOC=$P(^SRF(SRTN,.1),"^",4),SRSDATE=$E($P(S(0),"^",9),1,7),SRSOR=$P(S(0),"^",2)
4 S SRSST=$P(S(31),"^",4),SRSET=$P(S(31),"^",5)
5 K SRSEDT S SRSDT1=SRSST,SRSDT2=SRSET,MM=$E(SRSET,1,7),XX=$P(SRSST,1,7) I MM>XX S SRSET1=SRSET,SRSEDT=MM
6 I '$D(SRSEDT) S SRSEDT=SRSDATE
7 S Y=SRSST D D^DIQ S SRFIND=$F(Y,":"),SRSST=$S(SRFIND:$E(Y,SRFIND-3,SRFIND+1),1:"00:00") S Y=SRSET D D^DIQ S SRFIND=$F(Y,":"),SRSET=$S(SRFIND:$E(Y,SRFIND-3,SRFIND+1),1:"")
8 W !!,"Reservation for "_$S(SRSOR="":"",'$D(^SRS(SRSOR,0)):"",$D(^SC($P(^(0),"^"),0)):$P(^(0),"^"),1:"")
9 W !,"Scheduled Start Time: "_$E(SRSDATE,4,5)_"-"_$E(SRSDATE,6,7)_"-"_$E(SRSDATE,2,3)_" "_SRSST,!,"Scheduled End Time: "_$E(SRSEDT,4,5)_"-"_$E(SRSEDT,6,7)_"-"_$E(SRSEDT,2,3)_" "_SRSET
10 S SRSST=$P(SRSST,":")_"."_$P(SRSST,":",2),SRSET=$P(SRSET,":")_"."_$P(SRSET,":",2)
11MM S DFN=$P(^SRF(SRTN,0),"^") D DEM^VADPT S SRNM=VADM(1) W !,"Patient: "_SRNM
12 K SROPS,MM,MMM S SROPER=$P(^SRF(SRTN,"OP"),"^") S:$L(SROPER)<60 SROPS(1)=SROPER I $L(SROPER)>59 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
13 I SRSDOC S USER=$S($D(^VA(200,SRSDOC,0)):$P(^(0),"^"),1:"")
14 I SRSDOC="" S USER="NOT ENTERED"
15 W !,"Physician: "_USER
16 W !,"Procedure: "_SROPS(1) I $D(SROPS(2)) W !,?11,SROPS(2) I $D(SROPS(3)) W !,?11,SROPS(3) I $D(SROPS(4)) W !,?11,SROPS(4)
17 Q
18LOOP ; break procedure if greater than 60 characters
19 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<60 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
20 Q
Note: See TracBrowser for help on using the repository browser.