source: FOIAVistA/tag/r/SCHEDULING-SD-SC/SDAMEVT2.m@ 1424

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

initial load of FOIAVistA 6/30/08 version

File size: 1.2 KB
Line 
1SDAMEVT2 ;ALB/CAW - Add/Edit Event Driver Utilities ; 10/15/92
2 ;;5.3;Scheduling;**132**;Aug 13, 1993
3 ;
4BEFORE(SDOE,SDHDL) ;
5 D CAPTURE("BEFORE",.SDOE,.SDHDL)
6 Q
7 ;
8AFTER(SDOE,SDHDL) ;
9 D CAPTURE("AFTER",.SDOE,SDHDL)
10 Q
11 ;
12CAPTURE(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 ;
25EVT(SDOE,SDEVT,SDHDL,SDOEP) ;
26 D AFTER(SDOE,SDHDL)
27 D EVTGO
28 Q
29 ;
30EVTGO ; -- 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 ;
40SWAP(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 ;
Note: See TracBrowser for help on using the repository browser.