source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SDAMEVT4.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 2.4 KB
Line 
1SDAMEVT4 ;ALB/MJK - Appt Event Driver Utilities ;12/1/91
2 ;;5.3;Scheduling;**28,132**;Aug 13, 1993
3 ;
4COMP(SDHDL,SDAMEVT) ; -- main entry point for compare
5 N SDORG,SDCHG
6 S (SDORG,SDCHG)=0
7 F S SDORG=$O(^TMP("SDEVT",$J,SDHDL,SDORG)) Q:'SDORG D Q:SDCHG
8 .;
9 .; -- if overall visit flag is 1
10 .; then set to 1
11 .IF $G(^TMP("SDEVT",$J,SDHDL,SDORG,"VISIT CHANGE FLAGS"))[1 S SDCHG=1 Q
12 .;
13 .; -- if not a credit stop
14 .; and visit flags not set then assume data changed
15 .; then set to 1
16 .IF SDORG'=4,$G(^TMP("SDEVT",$J,SDHDL,SDORG,"VISIT CHANGE FLAGS"))="" S SDCHG=1 Q
17 .;
18 .; -- process orginating types
19 .I SDORG=1 S SDCHG=$$APPT(SDHDL) Q
20 .I SDORG=2 S SDCHG=$$AE(SDHDL) Q
21 .I SDORG=3 S SDCHG=$$DIS(SDHDL) Q
22 .I SDORG=4 S SDCHG=$$CRSC(SDHDL) Q
23COMPQ Q SDCHG
24 ;
25APPT(SDHDL) ; -- appt check
26 N SDCHG,NODE
27 S SDCHG=$S(SDATA("BEFORE","STATUS")'=SDATA("AFTER","STATUS"):1,1:0)
28 I 'SDCHG S SDCHG=$$OE(SDHDL,1)
29 I 'SDCHG F NODE="DPT","SC" I $G(^TMP("SDEVT",$J,SDHDL,1,NODE,0,"BEFORE"))'=$G(^("AFTER")) S SDCHG=1 Q
30 Q SDCHG
31 ;
32AE(SDHDL) ; -- add/edit check
33 N SDCHG,SDDA,NODE
34 S SDCHG=$$OE(SDHDL,2)
35 I 'SDCHG,$G(^TMP("SDEVT",$J,SDHDL,2,"STANDALONE",0,"BEFORE"))'=$G(^("AFTER")) S SDCHG=1
36 Q SDCHG
37 ;
38DIS(SDHDL) ; - disposition check
39 N SDCHG
40 S SDCHG=$$OE(SDHDL,3)
41 I 'SDCHG,$G(^TMP("SDEVT",$J,SDHDL,3,"DIS",0,"BEFORE"))'=$G(^("AFTER")) S SDCHG=1
42 Q SDCHG
43 ;
44CRSC(SDHDL) ; -- credit stop code check
45 N SDCHG
46 S SDCHG=$$OE(SDHDL,4)
47 Q SDCHG
48 ;
49OE(SDHDL,SDORG) ; -- compare encounter data
50 N SDCHG,SDI,NODE,SDOE
51 S (SDOE,SDCHG)=0
52 F S SDOE=$O(^TMP("SDEVT",$J,SDHDL,SDORG,"SDOE",SDOE)) Q:'SDOE D Q:SDCHG
53 .I $G(^TMP("SDEVT",$J,SDHDL,SDORG,"SDOE",SDOE,0,"BEFORE"))'=$G(^("AFTER")) S SDCHG=1 Q
54 .F NODE="CL" S SDI=0 D Q:SDCHG
55 ..F S SDI=$O(^TMP("SDEVT",$J,SDHDL,SDORG,"SDOE",SDOE,NODE,SDI)) Q:'SDI D Q:SDCHG
56 ...I $G(^TMP("SDEVT",$J,SDHDL,SDORG,"SDOE",SDOE,NODE,SDI,0,"BEFORE"))'=$G(^("AFTER")) S SDCHG=1
57OEQ Q SDCHG
58 ;
59 ; -- SEE SDAMEVT0 FOR DOC ON VARIABLES
60 ;
61MODE(SDHDL) ; -- can event talk
62 N Y S Y=""
63 I $D(ZTQUEUED) S Y=2 ; -- queued job
64 I Y="",IO'=IO(0) S Y=2 ; -- not home device
65 S:Y="" Y=$G(SDMODE)
66 Q $S(Y=0:"DIALOGUE",Y=1:"MONOLOGUE",Y=2:"QUIET",1:"QUIET")
67 ;
68MESSAGE(MESSAGE,SDHDL) ; -- show message to user if ok
69 N SDSENT
70 I $$MODE()["LOGUE" W !!,MESSAGE S SDSENT=1
71 Q $G(SDSENT)
72 ;
73CHANGE(SDHDL,SDORG,SDFLAGS) ; -- set visit change flags value
74 S ^TMP("SDEVT",$J,+$G(SDHDL),+$G(SDORG),"VISIT CHANGE FLAGS")=$G(SDFLAGS)
75 Q
76 ;
Note: See TracBrowser for help on using the repository browser.