[613] | 1 | SDAMEVT2 ;ALB/CAW - Add/Edit Event Driver Utilities ; 10/15/92
|
---|
| 2 | ;;5.3;Scheduling;**132**;Aug 13, 1993
|
---|
| 3 | ;
|
---|
| 4 | BEFORE(SDOE,SDHDL) ;
|
---|
| 5 | D CAPTURE("BEFORE",.SDOE,.SDHDL)
|
---|
| 6 | Q
|
---|
| 7 | ;
|
---|
| 8 | AFTER(SDOE,SDHDL) ;
|
---|
| 9 | D CAPTURE("AFTER",.SDOE,SDHDL)
|
---|
| 10 | Q
|
---|
| 11 | ;
|
---|
| 12 | CAPTURE(SDCAP,SDOE,SDHDL) ;
|
---|
| 13 | N OP
|
---|
| 14 | ; -- set up 'OP'posite variable
|
---|
| 15 | S OP=$S(SDCAP="BEFORE":"AFTER",1:"BEFORE")
|
---|
| 16 | ;
|
---|
| 17 | ; -- next lines are redunant data with OE^SDAMEVT but consistent
|
---|
| 18 | ; with appt and disp ^TMP strurcture
|
---|
| 19 | S ^TMP("SDEVT",$J,SDHDL,2,"STANDALONE",0,SDCAP)=$G(^SCE(SDOE,0))
|
---|
| 20 | S:'$D(^TMP("SDEVT",$J,SDHDL,2,"STANDALONE",0,OP)) ^(OP)=""
|
---|
| 21 | ;
|
---|
| 22 | D OE^SDAMEVT(.SDCAP,2,SDOE,SDHDL)
|
---|
| 23 | Q
|
---|
| 24 | ;
|
---|
| 25 | EVT(SDOE,SDEVT,SDHDL,SDOEP) ;
|
---|
| 26 | D AFTER(SDOE,SDHDL)
|
---|
| 27 | D EVTGO
|
---|
| 28 | Q
|
---|
| 29 | ;
|
---|
| 30 | EVTGO ; -- do it!
|
---|
| 31 | N SDATA,SDHDLX
|
---|
| 32 | S SDHDLX="SDHDL"_SDHDL_" SAVE"
|
---|
| 33 | ; for compatibility in IB
|
---|
| 34 | D SWAP("SDAMEVT",SDHDLX)
|
---|
| 35 | S SDATA="0^0^0^0",(SDATA("BEFORE","STATUS"),SDATA("AFTER","STATUS"))=""
|
---|
| 36 | S (^TMP("SDAMEVT",$J,"BEFORE","STATUS"),^TMP("SDAMEVT",$J,"AFTER","STATUS"))=""
|
---|
| 37 | D EVT^SDAMEVT(.SDATA,SDEVT,0,SDHDL),SWAP(SDHDLX,"SDAMEVT")
|
---|
| 38 | Q
|
---|
| 39 | ;
|
---|
| 40 | SWAP(FR,TO) ; -- save/restore data for compatibility
|
---|
| 41 | N NODE,SDCAP
|
---|
| 42 | K ^TMP(TO,$J)
|
---|
| 43 | I $D(^TMP(FR,$J)) D K ^TMP(FR,$J)
|
---|
| 44 | .F SDCAP="BEFORE","AFTER" S NODE="" F S NODE=$O(^TMP(FR,$J,SDCAP,NODE)) Q:NODE="" S ^TMP(TO,$J,SDCAP,NODE)=^TMP(FR,$J,SDCAP,NODE)
|
---|
| 45 | Q
|
---|
| 46 | ;
|
---|