source: WorldVistAEHR/trunk/r/SURGERY-SR/SRSWL11.m@ 1150

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

initial load of WorldVistAEHR

File size: 2.0 KB
Line 
1SRSWL11 ;B'HAM ISC/MAM - WAITING LIST, EXTENDED-ALL ; 17 OCT 1989 7:35 AM
2 ;;3.0; Surgery ;**34**;24 Jun 93
3 W ! K %ZIS,POP,IOP,IO("Q") S %ZIS("A")="Print to Device: ",%ZIS="Q" D ^%ZIS Q:POP
4 I $D(IO("Q")) K IO("Q") S ZTDESC="SURGERY WAITING LIST",ZTRTN="BEG^SRSWL11" D ^%ZTLOAD G END
5 ;
6BEG ; entry when queued
7 K ^TMP("SR",$J)
8 U IO S (SRSOUT,SRHDR)=0 D NOW^%DTC S Y=% D D^DIQ S SRTIME=$E(Y,1,12)_" at "_$E(Y,14,18)
9 S SS="",ST="",SR="",SRW="",SRNAME="",SRRECNO="",SRSUB="",DFN="",SRSDPT="",SRHDR=0
10 ;
11 F S SRW=$O(^SRO(133.8,"AP",SRW)) Q:SRW="" F S SRRECNO=$O(^SRO(133.8,"AP",SRW,SRRECNO)) Q:SRRECNO="" F S SRSUB=$O(^SRO(133.8,"AP",SRW,SRRECNO,SRSUB)) Q:SRSUB="" D MORE
12 W @IOF D HDR
13 ;
14 F S SS=$O(^TMP("SR",$J,SS)) Q:SS=""!(SRSOUT) F S SR=$O(^TMP("SR",$J,SS,SR)) Q:SR=""!(SRSOUT) F S ST=$O(^TMP("SR",$J,SS,SR,ST)) Q:ST=""!(SRSOUT) D PRINT
15END ;
16 I $E(IOST)="P" W ! S SRSOUT=1 W @IOF
17 I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
18 I 'SRSOUT W !!,"Press RETURN to continue " R X:DTIME W @IOF
19 D ^%ZISC,^SRSKILL K SRTN
20 Q
21PRINT ; print information
22 S SRSDPT=SS,SRSS=SR,SROFN=ST
23 I $Y+20>IOSL S SRHDR=0 D PAGE S SRHDR=1 Q:SRSOUT
24 S SRW=^SRO(133.8,SRSS,1,SROFN,0),DFN=$P(SRW,"^",1),SROPER=$P(SRW,"^",2),(SRDT,Y)=$P(SRW,"^",3) I Y D D^DIQ S SRDT=$E(Y,1,12)_" "_$E(Y,14,18)
25 D OUT^SRSWL3
26 Q
27LOOP ; break operation if greater than 59 characters
28 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<59 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
29 Q
30PAGE ; end of page
31 I $E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
32 D HDR
33 Q
34MORE S SRNAME=$P(^SRO(133.8,SRRECNO,0),"^"),SRNAME=$P(^SRO(137.45,SRNAME,0),"^")
35 I SRNAME=SRSNM S DFN=SRW D DEM^VADPT S SRSDPT=VADM(1)_" ("_VA("PID")_")",^TMP("SR",$J,SRSDPT,SRRECNO,SRSUB)=""
36 Q
37 ;
38HDR ; print heading
39 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
40 W:$Y @IOF W !,"Surgery Waiting List sorted by Patient",!,"Surgical Specialty is "_SRSNM,!,"Printed "_SRTIME,! F LINE=1:1:80 W "="
41 S SRHDR=1
42 Q
Note: See TracBrowser for help on using the repository browser.