1 | SRSUPC ;B'HAM ISC/MAM - UPDATE CANCEL REASON & DATE; [ 01/31/01 8:59 AM ]
|
---|
2 | ;;3.0; Surgery ;**100**;24 Jun 93
|
---|
3 | PAT ;
|
---|
4 | W @IOF S DIC=2,DIC(0)="QEAMZ",DIC("A")="Update Cancellation Information for which Patient: " D ^DIC K DIC G:Y'>0 END S DFN=+Y
|
---|
5 | D DEM^VADPT S SRNAME=VADM(1)
|
---|
6 | W ! S (SROP,CNT)=0 F S SROP=$O(^SRF("B",DFN,SROP)) Q:'SROP S SRSDATE=$P(^SRF(SROP,0),"^",9) D LIST
|
---|
7 | I '$D(SRCASE(1)) W !!,"There are no cancelled cases for "_SRNAME_"." G END
|
---|
8 | OPT R !!!,"Select Operation: ",OPT:DTIME I '$T!("^"[OPT) K SRTN G END
|
---|
9 | I OPT["?"!('$D(SRCASE(OPT))) W !!,"Enter the number of the desired operation" G OPT
|
---|
10 | S SROP=SRCASE(OPT),SRSDATE=$P(^SRF(SROP,0),"^",9),SRSDATE=$E(SRSDATE,4,5)_"-"_$E(SRSDATE,6,7)_"-"_$E(SRSDATE,2,3)
|
---|
11 | W @IOF,!,VADM(1),?32,VA("PID"),?50,"Case # ",SROP,!!,SRSDATE D CASE W !!
|
---|
12 | I $$LOCK^SROUTL(SROP) S DIE=130,DA=SRCASE(OPT),DR="17T;18T;67T" D ^DIE,UNLOCK^SROUTL(SROP)
|
---|
13 | END W !!,"Press RETURN to continue " R X:DTIME
|
---|
14 | W @IOF K SROP D ^SRSKILL
|
---|
15 | Q
|
---|
16 | LOOP ; break operation name if longer than 65 characters
|
---|
17 | 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
|
---|
18 | Q
|
---|
19 | OTHER ; other operations
|
---|
20 | S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SROP,13,SROTHER,0),"^"))>235 S SRLONG=0,SROTHER=999,SROPERS=" ..."
|
---|
21 | I SRLONG S SROPERS=$P(^SRF(SROP,13,SROTHER,0),"^")
|
---|
22 | S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
|
---|
23 | Q
|
---|
24 | LIST ;
|
---|
25 | S SRCAN=0
|
---|
26 | I $D(^SRF(SROP,30)),$P(^(30),"^")'="" S SRCAN=1
|
---|
27 | I $D(^SRF(SROP,31)),$P(^(31),"^",8)'="" S SRCAN=1
|
---|
28 | I 'SRCAN Q
|
---|
29 | S CNT=CNT+1,SRCASE(CNT)=SROP
|
---|
30 | W !,CNT_". "_$E(SRSDATE,4,5)_"-"_$E(SRSDATE,6,7)_"-"_$E(SRSDATE,2,3)
|
---|
31 | CASE 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
|
---|
32 | 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=""
|
---|
33 | 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) W:$D(SROPS(5)) !,?14,SROPS(5)
|
---|