source: WorldVistAEHR/trunk/r/SURGERY-SR/SRSWL12.m@ 1259

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1SRSWL12 ;BIR/MAM - WAITING LIST, BRIEF-ALL ; [ 12/06/99 9:45 AM ]
2 ;;3.0; Surgery ;**92**;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^SRSWL12" 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 subrecord numbers.
15 ;
16 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
17 ;
18 ; Below, extract information from TMP in order of Surgical
19 ; Specialty and within Surgical Specialty by Tentative Date of
20 ; Operation.
21 ;
22 S SRSNM="" F S SRSNM=$O(^TMP("SR",$J,SRSNM)) Q:SRSNM=""!SRSOUT D
23 .D PAGE Q:SRSOUT 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
24END I $E(IOST)="P" S SRSOUT=1 W @IOF
25 I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
26 I 'SRSOUT W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME W @IOF
27 D ^%ZISC,^SRSKILL K SRTN
28 Q
29MORE 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)=""
30 Q
31ANOTHER S SROFN="" F S SROFN=$O(^TMP("SR",$J,SRSNM,SROPDT,SRSS,SROFN)) Q:'SROFN!SRSOUT D PRINT
32 Q
33PRINT ; print information
34 I $Y+5>IOSL D PAGE Q:SRSOUT
35 S SRW=^SRO(133.8,SRSS,1,SROFN,0),DFN=$P(SRW,"^") D DEM^VADPT S SRSDPT=VADM(1),SROPER=$P(SRW,"^",2),Y=$P(SRW,"^",3) D D^DIQ S SRDT=$E(Y,1,12)
36 S Y=$P(SRW,"^",4) S:Y="" SRADT="" I Y D D^DIQ S SRADT=$E(Y,1,12)
37 S TEMPDT=SROPDT
38 I TEMPDT?7N S Y=TEMPDT D D^DIQ S TEMPDT=$E(Y,1,12)
39 S SRSDPT=$S($L(SRSDPT)<24:SRSDPT,1:$E(SRSDPT,1,23))
40 K SROP,MM,MMM S:$L(SROPER)<40 SROP(1)=SROPER I $L(SROPER)>39 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
41 W !,SRDT,?15,SRSDPT,?40,SROP(1),!,"Tentative Admission: "_SRADT I $D(SROP(2)) W ?40,SROP(2)
42 W !,"Tentative Date of Operation: "_TEMPDT
43 S SROLD=0 D OLD^SRSWLST I SROLD W !,"* Procedure performed since entry on list ("_SROLD("DATE")_")"
44 W ! F LINE=1:1:80 W "-"
45 Q
46PAGE ; end of page
47 I 'SRHDR S SRHDR=1 D HDR Q
48 I $E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
49 D HDR
50 Q
51HDR ; print heading
52 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
53 S SRHDR=1 W:$Y @IOF W !,"Surgery Waiting List for ",SRSNM,!,"Printed "_SRTIME,!!,"Date Entered",?15,"Patient",?40,"Operative Procedure",! F LINE=1:1:80 W "="
54 Q
55LOOP ; break operation if greater than 39 characters
56 S SROP(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROP(M))+$L(MM)'<39 S SROP(M)=SROP(M)_MM_" ",SROPER=MMM
57 Q
Note: See TracBrowser for help on using the repository browser.