source: FOIAVistA/trunk/r/SURGERY-SR/SRORESV.m@ 757

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

initial load of FOIAVistA 6/30/08 version

File size: 1.7 KB
Line 
1SRORESV ;B'HAM ISC/MAM - DISPLAY O.R. RESERVATION ; 6 DEC 1991 3:50 PM
2 ;;3.0; Surgery ;**7**;24 Jun 93
3 S S(0)=^SRF(SRTN,0),S(.1)=$G(^SRF(SRTN,.1)),S(31)=$G(^SRF(SRTN,31)),SROPER=$P(^SRF(SRTN,"OP"),"^"),DFN=$P(S(0),"^") D DEM^VADPT
4 S SRSDATE=$E($P(S(0),"^",9),1,7),SRSOR=$P(S(0),"^",2),SRSDOC=$P(S(.1),"^",4),SRATT=$P(S(.1),"^",13),SRSST=$P(S(31),"^",4),SRSET=$P(S(31),"^",5)
5 S SRSDOC=$S(SRSDOC:$P(^VA(200,SRSDOC,0),"^"),1:"") D OPS
6 S SRSDT1=SRSST,SRSDT2=SRSET
7 S SRSST=SRSST_"0000",SRSET=SRSET_"0000",SRSST=$P(SRSST,".",2),SRSET=$P(SRSET,".",2)
8 S SRSST=$E(SRSST,1,2)_"."_$E(SRSST,3,4),SRSET=$E(SRSET,1,2)_"."_$E(SRSET,3,4)
9 S Y=SRSDT1 D D^DIQ S SRSTART=$P(Y,"@")_" "_$S($P(Y,"@",2)'="":$E($P(Y,"@",2),1,5),1:"00:00"),Y=SRSDT2 D D^DIQ S SREND=$P(Y,"@")_" "_$P(Y,"@",2)
10 S X=$P(^SRS(SRSOR,0),"^"),SRSORN=$P(^SC(X,0),"^")
11 W @IOF,!,"Operating Room Reservations:",!!,"Surgeon: "_SRSDOC,!,"Patient: "_VADM(1)
12 W !,SROPS(1) I $D(SROPS(2)) W !,?15,SROPS(2) I $D(SROPS(3)) W !,?15,SROPS(3) I $D(SROPS(4)) W !,?15,SROPS(4)
13 W !!,"Operating Room: "_SRSORN,!,"Scheduled Start: "_SRSTART,!,"Scheduled End: "_SREND
14 Q
15OPS S SROPER="Procedure(s): "_$P(^SRF(SRTN,"OP"),"^"),OPER=0 F S OPER=$O(^SRF(SRTN,13,OPER)) Q:OPER="" D OTHER
16 K SROPS,MM,MMM S:$L(SROPER)<75 SROPS(1)=SROPER I $L(SROPER)>74 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
17 Q
18LOOP ; break procedure if greater than 75 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)'<75 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
20 Q
21OTHER ; other operations
22 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SRTN,13,OPER,0),"^"))>250 S SRLONG=0,OPER=999,SROPERS=" ..."
23 I SRLONG S SROPERS=$P(^SRF(SRTN,13,OPER,0),"^")
24 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
25 Q
Note: See TracBrowser for help on using the repository browser.