source: WorldVistAEHR/trunk/r/SURGERY-SR/SROSCH1.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: 3.1 KB
Line 
1SROSCH1 ;B'HAM ISC/MAM - OR SCHEDULE ; [ 09/22/98 11:49 AM ]
2 ;;3.0; Surgery ;**63,77,50**;24 Jun 93
3EN I '$D(SRSITE) W @IOF D ^SROVAR I '$D(SRSITE) Q
4 W @IOF S %DT="AEFX",%DT("A")="Print Schedule of Operations for which date ? " D ^%DT K %DT Q:Y<1 S SRDT=Y D D^DIQ S SRDT1=Y
5 D ALL G:SRYN["^" END I "Yy"[SRYN W !!,"Schedule will be queued to print at all locations defined in the SURGERY",!,"SITE PARAMETERS file...." D ^SROSCH2 W !!,"Press RETURN to continue " R X:DTIME G END
6 K IOP,%ZIS,POP,IO("Q") S %ZIS("A")="Print the Report on which Device: ",%ZIS="QM" W !!,"This report is designed to use a 132 column format.",! D ^%ZIS G:POP END
7 I $D(IO("Q")) K IO("Q") S ZTDESC="SCHEDULE OF OPERATIONS",ZTRTN="SROSCH",(ZTSAVE("SRDT"),ZTSAVE("SRDT1"),ZTSAVE("SRSITE*"))="" D ^%ZTLOAD G END
8 G ^SROSCH
9END D ^SRSKILL,^%ZISC W @IOF
10 Q
11ASK I $E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R Z:DTIME I '$T!(Z="^") S SRQ=1 Q
12 D HDR I SX'=1 W !!,?1,"OPERATING ROOM: "_SROOM,!
13 Q
14LOOP ; break procedure if greater than 70 characters
15 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<70 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
16 Q
17HDR ; print heading
18 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRQ=1 Q
19 W:$Y @IOF W !,?(132-$L(SRINST)\2),SRINST,?123,$J("PAGE "_SRPAGE,8)
20 W !,?58,"SURGICAL SERVICE",!,?55,"SCHEDULE OF OPERATIONS",?90,"SIGNATURE OF CHIEF: ",SRCHF,!
21 D NOW^%DTC S Y=% D DD^%DT W "PRINTED: ",$P(Y,"@")_" "_$E($P(Y,"@",2),1,5),?58,"FOR: ",SRDT1,?110,"____________________"
22 W !!!,"PATIENT",?23,"DISPOSITION",?40,"PREOPERATIVE DIAGNOSIS",?92,"REQ ANESTHESIA"
23 W ?116,"SURGEON",!,"ID#",?15,"AGE",?23,"START TIME",?40,"OPERATION(S)",?92,"ANESTHESIOLOGIST",?115,"FIRST ASST.",!,"WARD",?24,"END TIME",?92,"PRIN. ANESTHETIST",?115,"ATT SURGEON",! F LINE=1:1:132 W "="
24 S SRPAGE=SRPAGE+1
25 Q
26CON ; print concurrent procedure
27 K SROPS,MM,MMM S SROPER=$P(^SRF(SRCON,"OP"),"^") S:$L(SROPER)<70 SROPS(1)=SROPER I $L(SROPER)>69 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
28 W !,?26,"** Concurrent Case #"_SRCON,?53,SROPS(1) I $D(SROPS(2)) W !,?53,SROPS(2) I $D(SROPS(3)) W !,?53,SROPS(3)
29 Q
30DIQ ; extract time from date
31 S Y=SRST D D^DIQ S SRFIND=$F(Y,":") S SRST=$S(SRFIND:$E(Y,SRFIND-3,SRFIND+1),1:"")
32 S Y=SRET D D^DIQ S SRFIND=$F(Y,":") S SRET=$S(SRFIND:$E(Y,SRFIND-3,SRFIND+1),1:"")
33 Q
34TIME ; start and finish times
35 S S(31)=^SRF(SRTN,31),Y=$P(S(31),"^",4) D D^DIQ S SRFIND=$F(Y,":"),SRSST=$S(SRFIND:$E(Y,SRFIND-3,SRFIND+1),1:"00:00")
36 S Y=$P(S(31),"^",5) D D^DIQ S SRFIND=$F(Y,":"),SRSET=$S(SRFIND:$E(Y,SRFIND-3,SRFIND+1),1:"")
37 Q
38ALL ; print to all locations ?
39 I '$O(^SRO(133,SRSITE,1,0)) S SRYN="N" Q
40 W @IOF,!,"Do you want to print the schedule at all locations ? NO// " R SRYN:DTIME I '$T!(SRYN["^") Q
41 S SRYN=$E(SRYN) S:SRYN="" SRYN="N"
42 I "YyNn"'[SRYN W !!,"Enter RETURN to select a specific printer, or 'YES' to print the Schedule of",!,"Operations on all of the printers specified in your SURGERY SITE",!,"PARAMETERS file."
43 I "YyNn"'[SRYN W !!,"Press RETURN to continue " R X:DTIME G ALL
44 Q
45OUT ; outpatient ?
46 I $P(^SRF(SRTN,0),"^",12)="I" S SRSLOC="TO BE ADMITTED" Q
47 I $D(^SRF(SRTN,.4)),$P(^(.4),"^",3)'="O" S SRSLOC="TO BE ADMITTED"
48 Q
Note: See TracBrowser for help on using the repository browser.