source: FOIAVistA/trunk/r/SURGERY-SR/SRSWL15.m@ 1582

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

initial load of FOIAVistA 6/30/08 version

File size: 2.8 KB
Line 
1SRSWL15 ;B'HAM ISC/MAM - WAITING LIST, EXTENDED-ONE ; 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^SRSWL15" 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 ;
9 ; The AP cross reference is used to get the Patient Number, the record
10 ; number and sub-record number associated with that Patient.
11 ; SRPNM is set to Patient Number; SRSS=the record #; SROFN =
12 ; sub-record; SRSNM is set to the Surgical Specialty. The TMP
13 ; global is set to contain the Surgical Specialty, Tentative Date
14 ; of Operation, and corresponding record and sub-record numbers.
15 ;
16 S SRPNM="" F S SRPNM=$O(^SRO(133.8,"AP",SRPNM)) Q:SRPNM="" S SROFN="" F S SROFN=$O(^SRO(133.8,"AP",SRPNM,SRSS,SROFN)) Q:SROFN="" D MORE
17 ;
18 ; Below, extract information from TMP in order of Surgical
19 ; Specialty and within Surgical Specialty in order by Tentative Date
20 ; of Operation.
21 ;
22 D HDR S SROPDT="" F S SROPDT=$O(^TMP("SR",$J,SRSNM,SROPDT)) Q:SROPDT=""!(SRSOUT) S SRSS="" F S SRSS=$O(^TMP("SR",$J,SRSNM,SROPDT,SRSS)) Q:'SRSS!(SRSOUT) D ANOTHER
23END I $E(IOST)="P" W ! S SRSOUT=1 W @IOF
24 I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
25 I 'SRSOUT W !!,"Press RETURN to continue " R X:DTIME W @IOF
26 D ^%ZISC,^SRSKILL K SRTN
27 Q
28MORE S SRTEMP=^SRO(133.8,SRSS,1,SROFN,0),SROPDT=$P($G(SRTEMP),"^",5),SROPDT=$S(SROPDT'="":SROPDT,1:"None Specified") S ^TMP("SR",$J,SRSNM,SROPDT,SRSS,SROFN)=""
29 Q
30ANOTHER S SROFN="" F S SROFN=$O(^TMP("SR",$J,SRSNM,SROPDT,SRSS,SROFN)) Q:'SROFN!(SRSOUT) D PRINT
31 Q
32PRINT ; print information
33 I $Y+20>IOSL D PAGE Q:SRSOUT
34 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)
35 D OUT^SRSWL3
36 Q
37PAGE ; end of page
38 I 'SRHDR S SRHDR=1 D HDR Q
39 I $E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
40 D HDR
41 Q
42HDR ; print heading
43 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
44 S SRHDR=1 W:$Y @IOF W !,"Surgery Waiting List for ",SRSNM,!,"Printed "_SRTIME,! F LINE=1:1:80 W "="
45 Q
46LOOP ; break operation if greater than 59 characters
47 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
48 Q
49AGAIN ; reprint patient name, date entered, and procedure when referring
50 ; physician will not fit on first page
51 Q:$Y+6<IOSL
52 D PAGE Q:SRSOUT
53 W !,"Patient:",?14,SRSDPT,?65,"(continued)",!,"Date Entered:",?14,SRDT,!,"Procedure:",?14,SROPS(1) I $D(SROPS(2)) W !,?14,SROPS(2)
54 Q
Note: See TracBrowser for help on using the repository browser.