source: FOIAVistA/tag/r/SURGERY-SR/SRSWL3.m@ 1312

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

initial load of FOIAVistA 6/30/08 version

File size: 3.5 KB
Line 
1SRSWL3 ;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^SRSWL3" D ^%ZTLOAD G END
5BEG ; entry when queued
6 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)
7 S SRSS=0 F S SRSS=$O(^SRO(133.8,"AWL",SRSS)) Q:'SRSS!(SRSOUT) S SRSNM=$P(^SRO(133.8,SRSS,0),"^"),SRSNM=$P(^SRO(137.45,SRSNM,0),"^") D PAGE S SRSDT=0 F S SRSDT=$O(^SRO(133.8,"AWL",SRSS,SRSDT)) Q:'SRSDT!(SRSOUT) D MORE
8END I $E(IOST)="P" S SRSOUT=1 W @IOF
9 I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
10 I 'SRSOUT W !!,"Press RETURN to continue " R X:DTIME W @IOF
11 D ^%ZISC,^SRSKILL K SRTN
12 Q
13HDR ; print heading
14 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
15 S SRHDR=1 W:$Y @IOF W !,"Surgery Waiting List for "_SRSNM,!,"Printed "_SRTIME,! F LINE=1:1:80 W "="
16 Q
17MORE ; continue looping on 'WL' x-ref
18 S SROFN=0 F S SROFN=$O(^SRO(133.8,"AWL",SRSS,SRSDT,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,SRDT)=SRSDT D D^DIQ S SRDT=$E(Y,1,12)_" "_$E(Y,14,18)
23OUT S (Y,SRADT)=$P(SRW,"^",4) I Y D D^DIQ S SRADT=$E(Y,1,12)
24 S (Y,TEMPDT)=$P(SRW,"^",5) I Y D D^DIQ S TEMPDT=Y
25 D ADD^VADPT
26 S SRSPH1=VAPA(8)
27 S SRSDPT(.13)=$S($D(^DPT(DFN,.13)):^(.13),1:"") S SRSPH2=$P(SRSDPT(.13),"^",2) S:SRSPH1="" SRSPH1="NOT ENTERED" S:SRSPH2="" SRSPH2="NOT ENTERED"
28 K SROPS,MM,MMM S:$L(SROPER)<60 SROPS(1)=SROPER I $L(SROPER)>59 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
29 W !,"Patient:",?14,SRSDPT,!,"Date Entered: ",?12,SRDT,!,"Procedure: ",?14,SROPS(1) I $D(SROPS(2)) W !,?14,SROPS(2)
30 W !!,"Tentative Admission Date: "_$S(SRADT="":"None Specified",1:SRADT)
31 W !,"Tentative Date of Operation: "_$S(TEMPDT="":"None Specified",1:TEMPDT)
32 D ^SRSWL5
33 K ^UTILITY($J,"W") I $O(^SRO(133.8,SRSS,1,SROFN,2,0)) W !!,"Comments: " S SRCOM=0 F I=0:0 S SRCOM=$O(^SRO(133.8,SRSS,1,SROFN,2,SRCOM)) Q:'SRCOM S X=^SRO(133.8,SRSS,1,SROFN,2,SRCOM,0),DIWL=3,DIWR=78 D ^DIWP
34 I $D(^UTILITY($J,"W")) F X=1:1:^UTILITY($J,"W",3) W !,?3,^UTILITY($J,"W",3,X,0)
35 W !!," Home Phone: "_SRSPH1,?40,"Work Phone: "_SRSPH2
36 ; VAPA contents are (1)-street add 1 (2)-street add 2 (3)-street add 3
37 ; (4)-city (5)-state (6)-zip (8)-home phone
38 W !," Address: ",?14,VAPA(1) W:VAPA(2)'="" !,?14,VAPA(2) W:VAPA(3)'="" !,?14,VAPA(3) W:VAPA(4)'="" !,?14,VAPA(4) W:$P(VAPA(5),U,2)'="" ", "_$P(VAPA(5),U,2)_" "_VAPA(6)
39 I $O(^SRO(133.8,SRSS,1,SROFN,1,0)) W !!,"Referring Physician/Institution: "
40 S SREFER=0 F K SRPHY S SREFER=$O(^SRO(133.8,SRSS,1,SROFN,1,SREFER)) Q:'SREFER D
41 .S X=^SRO(133.8,SRSS,1,SROFN,1,SREFER,0),SRPHY("NAME")=$P(X,"^"),SRPHY("ADD")=$P(X,"^",2),SRPHY("CITY")=$P(X,"^",3)
42 .S Y=$P(X,"^",4),SRPHY("STATE")=$S(Y:$P(^DIC(5,Y,0),"^"),1:""),SRPHY("ZIP")=$P(X,"^",5),SRPHY("PH")=$P(X,"^",6)
43 .W !,?5,SRPHY("NAME"),?40,"Phone: "_SRPHY("PH"),!,?8,SRPHY("ADD") W:SRPHY("CITY")'="" !,?8,SRPHY("CITY")_", "_SRPHY("STATE")_" "_SRPHY("ZIP")
44 W ! 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
49PAGE ; end of page
50 I 'SRHDR S SRHDR=1 D HDR Q
51 I $E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
52 D HDR
53 Q
Note: See TracBrowser for help on using the repository browser.