source: WorldVistAEHR/trunk/r/SURGERY-SR/SROPSN.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: 2.5 KB
Line 
1SROPSN ;B'HAM ISC/MAM - SELECT CASE ; [ 06/19/03 3:22 PM ]
2 ;;3.0; Surgery ;**121**;24 Jun 93
3 N SROPZ S SROPZ=SROP D HDR I $D(DUZ("SAV")) K SRNEWOP
4 ;;;I $D(SRCASE(1)) S SRTN=+SRCASE(1) Q
5ADT W ! S (SRDT,CNT)=0 F S SRDT=$O(^SRF("ADT",DFN,SRDT)) Q:'SRDT!SRSOUT!$D(SRTN) S SROP=0 F S SROP=$O(^SRF("ADT",DFN,SRDT,SROP)) Q:'SROP!$D(SRTN)!SRSOUT I SROPZ=SROP D LIST
6 G:'$D(SRNEWOP)&SRSOUT END D:SRSOUT HDR I $D(SRTN) G FUTURE
7 I '$D(SRNEWOP),'$D(SRCASE(1)) D W !!,"Press RETURN to continue " R X:DTIME G END
8 .W !!,$S($P($G(^SRF(SROPZ,"NON")),"^")="Y":"Case #"_SROPZ_" is not an O.R. surgical procedure.",1:"Case #"_SROPZ_" is not marked for exclusion from assessment.")
9 S SRTN=+SRCASE(1)
10 Q
11FUTURE ; is this a future case? if so, OK to proceed?
12 Q:$D(PRCP("I")) ; quit if called from Inventory
13 S SROP=SRTN,SRSDATE=$P(^SRF(SRTN,0),"^",9) I $E(SRSDATE,1,7)'>DT Q
14 D HDR W !,?1 D CASE W !,$C(7) K DIR
15 S DIR("A",1)=">>> The case you have selected has a future date.",DIR("A")=" Are you sure you have selected the correct case ? ",DIR("B")="NO",DIR(0)="YA" D ^DIR K DIR I $D(DTOUT)!$D(DUOUT) G END
16 I 'Y K SRTN D HDR G ADT
17 Q
18LIST ; list cases
19 I '$D(SRNONOR),$P($G(^SRF(SROP,"NON")),"^")="Y" Q
20 S SRSCAN=1 I $D(^SRF(SROP,.2)),$P(^(.2),"^",12)'="" K SRSCAN
21 I $D(SRSCAN),$D(^SRF(SROP,30)),$P(^(30),"^") Q
22 I $D(SRSCAN),$D(^SRF(SROP,31)),$P(^(31),"^",8) Q
23 I $D(^SRF(SROP,37)),$P(^(37),"^") Q
24 S CNT=CNT+1,SRSDATE=$P(^SRF(SROP,0),"^",9) W !
25CASE W $E(SRSDATE,4,5)_"-"_$E(SRSDATE,6,7)_"-"_$E(SRSDATE,2,3)
26 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
27 D ^SROP1,LOCK 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=""
28 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)
29 W ! S SRCASE(CNT)=SROP_"^"_SRDT
30 Q
31LOCK ; case locked?
32 I $D(SRTN),$P($G(^SRF(SRTN,"LOCK")),"^") S SROPER=SROPER_" **LOCKED**"
33 Q
34OTHER ; other operations
35 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SROP,13,SROTHER,0),"^"))>235 S SRLONG=0,SROTHER=999,SROPERS=" ..."
36 I SRLONG S SROPERS=$P(^SRF(SROP,13,SROTHER,0),"^")
37 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
38 Q
39LOOP ; break procedure
40 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
41 Q
42END K SRTN D ^SRSKILL W @IOF
43 Q
44HDR ; print heading
45 W @IOF,!,?1,VADM(1)_" "_VA("PID") S X=$P($G(VADM(6)),"^") W:X " * DIED "_$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3)_" *" W !
46 Q
Note: See TracBrowser for help on using the repository browser.