source: FOIAVistA/tag/r/SURGERY-SR/SRSWL13.m@ 1233

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

initial load of FOIAVistA 6/30/08 version

File size: 2.4 KB
Line 
1SRSWL13 ;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 the Waiting List on which Device: ",%ZIS="Q" D ^%ZIS Q:POP
4 I $D(IO("Q")) K IO("Q") S ZTDESC="SURGERY WAITING LIST",ZTRTN="BEG^SRSWL13" D ^%ZTLOAD G END
5BEG ; entry when queued
6 K ^TMP("SR",$J)
7 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)
8 S SRPNM="" F S SRPNM=$O(^SRO(133.8,"AP",SRPNM)) Q:SRPNM="" S SRSS="" F S SRSS=$O(^SRO(133.8,"AP",SRPNM,SRSS)) Q:SRSS="" S SROFN="" F S SROFN=$O(^SRO(133.8,"AP",SRPNM,SRSS,SROFN)) Q:SROFN="" D MORE
9 ;
10 S SRSNM="" F S SRSNM=$O(^TMP("SR",$J,SRSNM)) Q:SRSNM=""!(SRSOUT) D PAGE Q:SRSOUT S SROPDT="" F S SROPDT=$O(^TMP("SR",$J,SRSNM,SROPDT)) Q:SROPDT=""!(SRSOUT) D ANOTHER
11END I $E(IOST)="P" W ! S SRSOUT=1 W @IOF
12 I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
13 I 'SRSOUT W !!,"Press RETURN to continue " R X:DTIME W @IOF
14 D ^%ZISC,^SRSKILL K SRTN
15 Q
16MORE S SRSNM=$P(^SRO(133.8,SRSS,0),"^"),SRSNM=$P(^SRO(137.45,SRSNM,0),"^"),SRTEMP=^SRO(133.8,SRSS,1,SROFN,0),SROPDT=$P($G(SRTEMP),"^",5),SROPDT=$S(SROPDT'="":SROPDT,1:"None Specified"),^TMP("SR",$J,SRSNM,SROPDT,SRSS,SROFN)=""
17 Q
18ANOTHER S SRSS="" F S SRSS=$O(^TMP("SR",$J,SRSNM,SROPDT,SRSS)) Q:SRSS=""!(SRSOUT) S SROFN="" F S SROFN=$O(^TMP("SR",$J,SRSNM,SROPDT,SRSS,SROFN)) Q:'SROFN!(SRSOUT) D PRINT
19 Q
20PRINT ; print information
21 I $Y+20>IOSL D PAGE Q:SRSOUT
22 S SRW=^SRO(133.8,SRSS,1,SROFN,0),DFN=$P(SRW,"^") D DEM^VADPT S SRSDPT=VADM(1)_" ("_VA("PID")_")",SROPER=$P(SRW,"^",2),Y=$P(SRW,"^",3) D D^DIQ S SRDT=$E(Y,1,12)_" "_$E(Y,14,18)
23 D OUT^SRSWL3
24 Q
25PAGE ; end of page
26 I 'SRHDR S SRHDR=1 D HDR Q
27 I $E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
28 D HDR
29 Q
30HDR ; print heading
31 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
32 S SRHDR=1 W:$Y @IOF W !,"Surgery Waiting List for ",SRSNM,!,"Printed "_SRTIME,! F LINE=1:1:80 W "="
33 Q
34LOOP ; break operation if greater than 59 characters
35 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
36 Q
37AGAIN ; reprint patient name, date entered, and procedure when referring
38 ; physician will not fit on first page
39 Q:$Y+6<IOSL
40 D PAGE Q:SRSOUT
41 W !,"Patient:",?14,SRSDPT,?65,"(continued)",!,"Date Entered:",?14,SRDT,!,"Procedure:",?14,SROPS(1) I $D(SROPS(2)) W !,?14,SROPS(2)
42 Q
Note: See TracBrowser for help on using the repository browser.