source: WorldVistAEHR/trunk/r/SURGERY-SR/SRSWL10.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.7 KB
Line 
1SRSWL10 ;B'HAM ISC/MAM - WAITING LIST, BRIEF-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 ;
5 I $D(IO("Q")) K IO("Q") S ZTDESC="SURGERY WAITING LIST",ZTRTN="BEG^SRSWL10" D ^%ZTLOAD G END
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 ;
10 D HDR
11 S SS="",ST="",SR="",SRW="",SRNAME="",SRRECNO="",SRSUB="",DFN="",SRSDPT=""
12 ;
13 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
14 ;
15 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
16END I $E(IOST)="P" 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 I $Y+5>IOSL D PAGE Q:SRSOUT
23 ;
24 S SRSDPT=SS,SRSS=SR,SROFN=ST
25 ;
26 S SRW=^SRO(133.8,SRSS,1,SROFN,0),DFN=$P(SRW,"^"),SROPER=$P(SRW,"^",2),Y=$P(SRW,"^",3) D D^DIQ S SRDT=$E(Y,1,12)
27 ;
28 S Y=$P(SRW,"^",4) S:Y="" SRADT="" I Y D D^DIQ S SRADT=$E(Y,1,12)
29 ;
30 S (Y,SROPDT)=$P(SRW,"^",5) I Y D D^DIQ S SROPDT=Y
31 ;
32 S SRSDPT=$S($L(SRSDPT)<24:SRSDPT,1:$E(SRSDPT,1,23))
33 ;
34 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=""
35 ;
36 W !,SRDT,?15,SRSDPT,?40,SROP(1),!,"Tentative Admission: "_SRADT I $D(SROP(2)) W ?40,SROP(2)
37 ;
38 I SROPDT="" S SROPDT="None Specified"
39 W !,"Tentative Date of Operation: "_SROPDT
40 ;
41 S SRNAME=$P(^SRO(133.8,SRSS,0),"^"),SRNAME=$P(^SRO(137.45,SRNAME,0),"^")
42 ;
43 S SROLD=0 D OLD^SRSWLST I SROLD W !,"* Procedure performed since entry on list ("_SROLD("DATE")_")"
44 ;
45 W ! F LINE=1:1:80 W "-"
46 Q
47LOOP ; break operation if greater than 39 characters
48 ;
49 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
50 ;
51 Q
52PAGE ; end of page
53 I 'SRHDR S SRHDR=1 D HDR Q
54 ;
55 I $E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
56 D HDR
57 Q
58MORE S SRNAME=$P(^SRO(133.8,SRRECNO,0),"^"),SRNAME=$P(^SRO(137.45,SRNAME,0),"^")
59 I SRNAME'=SRSNM Q
60 S DFN=SRW D DEM^VADPT S SRSDPT=VADM(1),^TMP("SR",$J,SRSDPT,SRRECNO,SRSUB)=""
61 Q
62HDR ; print heading
63 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
64 S SRHDR=1 W:$Y @IOF W !,"Surgery Waiting List sorted by Patient ",!,"Surgical Specialty is "_SRSNM,!,"Printed "_SRTIME,!!,"Date Entered",?15,"Patient",?40,"Operative Procedure",! F LINE=1:1:80 W "="
65 Q
Note: See TracBrowser for help on using the repository browser.