source: WorldVistAEHR/trunk/r/SURGERY-SR/SROCANUP.m@ 1806

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

initial load of WorldVistAEHR

File size: 2.0 KB
Line 
1SROCANUP ;B'HAM ISC/ADM - UPDATE CANCELLED CASE ; 26 MAY 1992 2:10 PM [ 03/07/97 12:00 PM ]
2 ;;3.0; Surgery ;**63**;24 Jun 93
3 S SRSOUT=0 K DIC W @IOF,!,"Update Cancelled Case",!!
4PAT S DIC("A")="Select Patient: ",DIC=2,DIC(0)="QEAM" D ^DIC I Y<0 S SRSOUT=1 G END
5 S DFN=+Y D DEM^VADPT D HDR
6 W ! S (SRDT,CNT)=0 F S SRDT=$O(^SRF("ADT",DFN,SRDT)) Q:'SRDT!(SRSOUT) S SROP=0 F S SROP=$O(^SRF("ADT",DFN,SRDT,SROP)) Q:'SROP!($D(SRTN))!(SRSOUT) D LIST
7 Q:$D(SRTN)!SRSOUT
8 I 'CNT W !!,"No cancelled cases exist on this patient.",!! K DFN G PAT
9OPT W !!!,"Select Operation: " R X:DTIME I '$T!("^"[X) S SRSOUT=1 G END
10 I '$D(SRCASE(X)) W !!,"Enter the number of the desired operation." G OPT
11 S SRTN=+SRCASE(X)
12 Q
13LIST ; list cases
14 I $P($G(^SRF(SROP,30)),"^")="" Q
15 I $P($G(^SRF(SROP,.2)),"^")!($P($G(^SRF(SROP,.2)),"^",10)) Q
16 I $Y+5>IOSL S SRBACK=0 D SEL^SROPER Q:$D(SRTN)!(SRSOUT) D:'SRBACK HDR I SRBACK S CNT=0,SROP=SRCASE(1)-1,SRDT=$P(SRCASE(1),"^",2) W @IOF,!,?1,VADM(1)_" "_VA("PID"),! Q
17 S CNT=CNT+1,SRSDATE=$P(^SRF(SROP,0),"^",9)
18 W !,CNT_". "
19CASE W $E(SRSDATE,4,5)_"-"_$E(SRSDATE,6,7)_"-"_$E(SRSDATE,2,3)
20 S SROPER=$P(^SRF(SROP,"OP"),"^") I $O(^SRF(SROP,13,0)) S SROTHER=0 F I=0:0 S SROTHER=$O(^SRF(SROP,13,SROTHER)) Q:'SROTHER D OTHER
21 D ^SROP1 K SROPS,MM,MMM S:$L(SROPER)<65 SROPS(1)=SROPER I $L(SROPER)>64 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
22 W ?14,SROPS(1) I $D(SROPS(2)) W !,?14,SROPS(2) I $D(SROPS(3)) W !,?14,SROPS(3) W:$D(SROPS(4)) !,?14,SROPS(4)
23 W ! S SRCASE(CNT)=SROP_"^"_SRDT
24 Q
25OTHER ; other operations
26 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SROP,13,SROTHER,0),"^"))>235 S SRLONG=0,SROTHER=999,SROPERS=" ..."
27 I SRLONG S SROPERS=$P(^SRF(SROP,13,SROTHER,0),"^")
28 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
29 Q
30LOOP ; break procedures
31 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<65 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
32 Q
33END K SRTN D ^SRSKILL W @IOF
34 Q
35RT ; start RT logging
36 I $D(XRTL) S XRTN="SROP" D T0^%ZOSV
37 Q
38HDR ; print heading
39 W @IOF,!,?1,VADM(1)_" "_VA("PID"),!
40 Q
Note: See TracBrowser for help on using the repository browser.